2384 lines
4.1 MiB
2384 lines
4.1 MiB
(()=>{var dle={35412:function(ie,f,_){"use strict";var h;h={value:!0},h=h=h=h=f.toOndoTokenAmount=f.toOndoShareAmount=void 0;const w=_(90172),E=18,v=(x,R,S=E)=>{if(!Number.isInteger(S)||S<0)return"";const O=new w.BigNumber(x),M=new w.BigNumber(R);if(O.isNaN())throw new Error("tokenAmount must be a valid number");return M.isNaN()||!M.isFinite()||M.lte(0)?"":O.multipliedBy(M).decimalPlaces(S,w.BigNumber.ROUND_DOWN).toFixed()};f.toOndoShareAmount=v;const c=(x,R,S=E)=>{if(!Number.isInteger(S)||S<0)return"";const O=new w.BigNumber(x),M=new w.BigNumber(R);if(O.isNaN())throw new Error("shareAmount must be a valid number");return M.isNaN()||!M.isFinite()||M.lte(0)?"":O.dividedBy(M).decimalPlaces(S,w.BigNumber.ROUND_UP).toFixed()};f.toOndoTokenAmount=c,h=(x,R,S=E)=>{if(!Number.isInteger(S)||S<0)return"";const O=new w.BigNumber(x),M=new w.BigNumber(R);if(O.isNegative())throw new Error("tokenPrice must be non-negative");return M.isNaN()||!M.isFinite()||M.lte(0)?"":O.dividedBy(M).decimalPlaces(S,w.BigNumber.ROUND_DOWN).toFixed()},h=(x,R,S=E)=>{if(!Number.isInteger(S)||S<0)return"";const O=new w.BigNumber(x),M=new w.BigNumber(R);if(O.isNegative())throw new Error("sharePrice must be non-negative");return M.isNaN()||!M.isFinite()||M.lte(0)?"":O.multipliedBy(M).decimalPlaces(S,w.BigNumber.ROUND_DOWN).toFixed()},h=x=>{if(!x)return"--";const R=new w.BigNumber(x);if(R.isNaN())return"--";if(R.gte(1.01))return R.decimalPlaces(2,w.BigNumber.ROUND_HALF_UP).toFixed();if(R.gte(1.00005)&&R.lt(1.01))return R.decimalPlaces(4,w.BigNumber.ROUND_HALF_UP).toFixed();if(R.gte(1)&&R.lt(1.00005)){const S=R.decimalPlaces(4,w.BigNumber.ROUND_HALF_UP);return S.eq(1)?"1":S.toFixed()}else return R.decimalPlaces(4,w.BigNumber.ROUND_HALF_UP).toFixed()},h=(x,R,S,O=E)=>{if((0,w.BigNumber)(S).isEqualTo(1))return x;const M=(0,w.BigNumber)(x).dividedBy(S).decimalPlaces(O,w.BigNumber.ROUND_UP);return M.isLessThan(R)?M.toFixed():R}},55800:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.aes256cbc=f.aes256gcm=void 0;var h=_(3035),w=function(v,c,d){return(0,h.gcm)(v,c,d)};f.aes256gcm=w;var E=function(v,c,d){return(0,h.cbc)(v,c)};f.aes256cbc=E},65533:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.chacha20=f.xchacha20=void 0;var h=_(59946),w=function(v,c,d){return(0,h.xchacha20poly1305)(v,c,d)};f.xchacha20=w;var E=function(v,c,d){return(0,h.chacha20poly1305)(v,c,d)};f.chacha20=E},44406:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.RLP=f.utils=f.decode=f.encode=void 0;function _(b){if(Array.isArray(b)){const G=[];let ue=0;for(let le=0;le<b.length;le++){const X=_(b[le]);G.push(X),ue+=X.length}return x(E(ue,192),...G)}const F=q(b);return F.length===1&&F[0]<128?F:x(E(F.length,128),F)}f.encode=_;function h(b,F,G){if(G>b.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return b.slice(F,G)}function w(b){if(b[0]===0)throw new Error("invalid RLP: extra zeros");return m(p(b))}function E(b,F){if(b<56)return Uint8Array.from([b+F]);const G=S(b),ue=G.length/2,le=S(F+55+ue);return Uint8Array.from(C(le+G))}function v(b,F=!1){if(typeof b>"u"||b===null||b.length===0)return Uint8Array.from([]);const G=q(b),ue=c(G);if(F)return ue;if(ue.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return ue.data}f.decode=v;function c(b){let F,G,ue,le,X;const se=[],de=b[0];if(de<=127)return{data:b.slice(0,1),remainder:b.slice(1)};if(de<=183){if(F=de-127,de===128?ue=Uint8Array.from([]):ue=h(b,1,F),F===2&&ue[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:ue,remainder:b.slice(F)}}else if(de<=191){if(G=de-182,b.length-1<G)throw new Error("invalid RLP: not enough bytes for string length");if(F=w(h(b,1,G)),F<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return ue=h(b,G,F+G),{data:ue,remainder:b.slice(F+G)}}else if(de<=247){for(F=de-191,le=h(b,1,F);le.length;)X=c(le),se.push(X.data),le=X.remainder;return{data:se,remainder:b.slice(F)}}else{if(G=de-246,F=w(h(b,1,G)),F<56)throw new Error("invalid RLP: encoded list too short");const ye=G+F;if(ye>b.length)throw new Error("invalid RLP: total length is larger than the data");for(le=h(b,G,ye);le.length;)X=c(le),se.push(X.data),le=X.remainder;return{data:se,remainder:b.slice(ye)}}}const d=Array.from({length:256},(b,F)=>F.toString(16).padStart(2,"0"));function p(b){let F="";for(let G=0;G<b.length;G++)F+=d[b[G]];return F}function m(b){const F=Number.parseInt(b,16);if(Number.isNaN(F))throw new Error("Invalid byte sequence");return F}function C(b){if(typeof b!="string")throw new TypeError("hexToBytes: expected string, got "+typeof b);if(b.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const F=new Uint8Array(b.length/2);for(let G=0;G<F.length;G++){const ue=G*2;F[G]=m(b.slice(ue,ue+2))}return F}function x(...b){if(b.length===1)return b[0];const F=b.reduce((ue,le)=>ue+le.length,0),G=new Uint8Array(F);for(let ue=0,le=0;ue<b.length;ue++){const X=b[ue];G.set(X,le),le+=X.length}return G}function R(b){return new TextEncoder().encode(b)}function S(b){if(b<0)throw new Error("Invalid integer as argument, must be unsigned!");const F=b.toString(16);return F.length%2?`0${F}`:F}function O(b){return b.length%2?`0${b}`:b}function M(b){return b.length>=2&&b[0]==="0"&&b[1]==="x"}function k(b){return typeof b!="string"?b:M(b)?b.slice(2):b}function q(b){if(b instanceof Uint8Array)return b;if(typeof b=="string")return M(b)?C(O(k(b))):R(b);if(typeof b=="number"||typeof b=="bigint")return b?C(S(b)):Uint8Array.from([]);if(b==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof b)}f.utils={bytesToHex:p,concatBytes:x,hexToBytes:C,utf8ToBytes:R},f.RLP={encode:_,decode:v}},3021:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.accountBodyToRLP=f.accountBodyToSlim=f.accountBodyFromSlim=f.isZeroAddress=f.zeroAddress=f.importPublic=f.privateToAddress=f.privateToPublic=f.publicToAddress=f.pubToAddress=f.isValidPublic=f.isValidPrivate=f.generateAddress2=f.generateAddress=f.isValidChecksumAddress=f.toChecksumAddress=f.isValidAddress=f.Account=void 0;const w=_(44406),E=_(98381),v=_(51747),c=_(74114),d=_(1949),p=_(86111),m=_(55407),C=_(11921),x=BigInt(0);class R{constructor($=x,T=x,N=p.KECCAK256_RLP,j=p.KECCAK256_NULL){this.nonce=$,this.balance=T,this.storageRoot=N,this.codeHash=j,this._validate()}static fromAccountData($){const{nonce:T,balance:N,storageRoot:j,codeHash:Y}=$;return new R(T!==void 0?(0,d.bufferToBigInt)((0,d.toBuffer)(T)):void 0,N!==void 0?(0,d.bufferToBigInt)((0,d.toBuffer)(N)):void 0,j!==void 0?(0,d.toBuffer)(j):void 0,Y!==void 0?(0,d.toBuffer)(Y):void 0)}static fromRlpSerializedAccount($){const T=(0,d.arrToBufArr)(w.RLP.decode(Uint8Array.from($)));if(!Array.isArray(T))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(T)}static fromValuesArray($){const[T,N,j,Y]=$;return new R((0,d.bufferToBigInt)(T),(0,d.bufferToBigInt)(N),j,Y)}_validate(){if(this.nonce<x)throw new Error("nonce must be greater than zero");if(this.balance<x)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[(0,d.bigIntToUnpaddedBuffer)(this.nonce),(0,d.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return h.from(w.RLP.encode((0,d.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(p.KECCAK256_NULL)}isEmpty(){return this.balance===x&&this.nonce===x&&this.codeHash.equals(p.KECCAK256_NULL)}}f.Account=R;const S=function(L){try{(0,m.assertIsString)(L)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(L)};f.isValidAddress=S;const O=function(L,$){(0,m.assertIsHexString)(L);const T=(0,C.stripHexPrefix)(L).toLowerCase();let N="";$!==void 0&&(N=(0,d.bufferToBigInt)((0,d.toBuffer)($)).toString()+"0x");const j=h.from(N+T,"utf8"),Y=(0,c.bytesToHex)((0,E.keccak256)(j));let Z="0x";for(let z=0;z<T.length;z++)parseInt(Y[z],16)>=8?Z+=T[z].toUpperCase():Z+=T[z];return Z};f.toChecksumAddress=O;const M=function(L,$){return(0,f.isValidAddress)(L)&&(0,f.toChecksumAddress)(L,$)===L};f.isValidChecksumAddress=M;const k=function(L,$){return(0,m.assertIsBuffer)(L),(0,m.assertIsBuffer)($),(0,d.bufferToBigInt)($)===BigInt(0)?h.from((0,E.keccak256)(w.RLP.encode((0,d.bufArrToArr)([L,null])))).slice(-20):h.from((0,E.keccak256)(w.RLP.encode((0,d.bufArrToArr)([L,$])))).slice(-20)};f.generateAddress=k;const q=function(L,$,T){if((0,m.assertIsBuffer)(L),(0,m.assertIsBuffer)($),(0,m.assertIsBuffer)(T),L.length!==20)throw new Error("Expected from to be of length 20");if($.length!==32)throw new Error("Expected salt to be of length 32");const N=(0,E.keccak256)(h.concat([h.from("ff","hex"),L,$,(0,E.keccak256)(T)]));return(0,d.toBuffer)(N).slice(-20)};f.generateAddress2=q;const b=function(L){return v.secp256k1.utils.isValidPrivateKey(L)};f.isValidPrivate=b;const F=function(L,$=!1){if((0,m.assertIsBuffer)(L),L.length===64)try{return v.secp256k1.ProjectivePoint.fromHex(h.concat([h.from([4]),L])),!0}catch{return!1}if(!$)return!1;try{return v.secp256k1.ProjectivePoint.fromHex(L),!0}catch{return!1}};f.isValidPublic=F;const G=function(L,$=!1){if((0,m.assertIsBuffer)(L),$&&L.length!==64&&(L=h.from(v.secp256k1.ProjectivePoint.fromHex(L).toRawBytes(!1).slice(1))),L.length!==64)throw new Error("Expected pubKey to be of length 64");return h.from((0,E.keccak256)(L)).slice(-20)};f.pubToAddress=G,f.publicToAddress=f.pubToAddress;const ue=function(L){return(0,m.assertIsBuffer)(L),h.from(v.secp256k1.ProjectivePoint.fromPrivateKey(L).toRawBytes(!1).slice(1))};f.privateToPublic=ue;const le=function(L){return(0,f.publicToAddress)((0,f.privateToPublic)(L))};f.privateToAddress=le;const X=function(L){return(0,m.assertIsBuffer)(L),L.length!==64&&(L=h.from(v.secp256k1.ProjectivePoint.fromHex(L).toRawBytes(!1).slice(1))),L};f.importPublic=X;const se=function(){const $=(0,d.zeros)(20);return(0,d.bufferToHex)($)};f.zeroAddress=se;const de=function(L){try{(0,m.assertIsString)(L)}catch{return!1}return(0,f.zeroAddress)()===L};f.isZeroAddress=de;function ye(L){const[$,T,N,j]=L;return[$,T,(0,d.arrToBufArr)(N).length===0?p.KECCAK256_RLP:N,(0,d.arrToBufArr)(j).length===0?p.KECCAK256_NULL:j]}f.accountBodyFromSlim=ye;const he=new Uint8Array(0);function K(L){const[$,T,N,j]=L;return[$,T,(0,d.arrToBufArr)(N).equals(p.KECCAK256_RLP)?he:N,(0,d.arrToBufArr)(j).equals(p.KECCAK256_NULL)?he:j]}f.accountBodyToSlim=K;function B(L,$=!0){const T=$?ye(L):L;return(0,d.arrToBufArr)(w.RLP.encode(T))}f.accountBodyToRLP=B},51494:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.Address=void 0;const w=_(3021),E=_(1949);class v{constructor(d){if(d.length!==20)throw new Error("Invalid address length");this.buf=d}static zero(){return new v((0,E.zeros)(20))}static fromString(d){if(!(0,w.isValidAddress)(d))throw new Error("Invalid address");return new v((0,E.toBuffer)(d))}static fromPublicKey(d){if(!h.isBuffer(d))throw new Error("Public key should be Buffer");const p=(0,w.pubToAddress)(d);return new v(p)}static fromPrivateKey(d){if(!h.isBuffer(d))throw new Error("Private key should be Buffer");const p=(0,w.privateToAddress)(d);return new v(p)}static generate(d,p){if(typeof p!="bigint")throw new Error("Expected nonce to be a bigint");return new v((0,w.generateAddress)(d.buf,(0,E.bigIntToBuffer)(p)))}static generate2(d,p,m){if(!h.isBuffer(p))throw new Error("Expected salt to be a Buffer");if(!h.isBuffer(m))throw new Error("Expected initCode to be a Buffer");return new v((0,w.generateAddress2)(d.buf,p,m))}equals(d){return this.buf.equals(d.buf)}isZero(){return this.equals(v.zero())}isPrecompileOrSystemAddress(){const d=(0,E.bufferToBigInt)(this.buf),p=BigInt(0),m=BigInt("0xffff");return d>=p&&d<=m}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return h.from(this.buf)}}f.Address=v},93656:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.AsyncEventEmitter=void 0;const h=_(80381);async function w(v,c,d){let p;for await(const m of c)try{m.length<2?m.call(v,d):await new Promise((C,x)=>{m.call(v,d,R=>{R?x(R):C()})})}catch(C){p=C}if(p)throw p}class E extends h.EventEmitter{emit(c,...d){let[p,m]=d;const C=this;let x=C._events[c]??[];return m===void 0&&typeof p=="function"&&(m=p,p=void 0),(c==="newListener"||c==="removeListener")&&(p={event:p,fn:m},m=void 0),x=Array.isArray(x)?x:[x],w(C,x.slice(),p).then(m).catch(m),C.listenerCount(c)>0}once(c,d){const p=this;let m;if(typeof d!="function")throw new TypeError("listener must be a function");return d.length>=2?m=function(C,x){p.removeListener(c,m),d(C,x)}:m=function(C){p.removeListener(c,m),d(C,m)},p.on(c,m),p}first(c,d){let p=this._events[c]??[];if(typeof d!="function")throw new TypeError("listener must be a function");return Array.isArray(p)||(this._events[c]=p=[p]),p.unshift(d),this}before(c,d,p){return this.beforeOrAfter(c,d,p)}after(c,d,p){return this.beforeOrAfter(c,d,p,"after")}beforeOrAfter(c,d,p,m){let C=this._events[c]??[],x,R;const S=m==="after"?1:0;if(typeof p!="function")throw new TypeError("listener must be a function");if(typeof d!="function")throw new TypeError("target must be a function");for(Array.isArray(C)||(this._events[c]=C=[C]),R=C.length,x=C.length;x--;)if(C[x]===d){R=x+S;break}return C.splice(R,0,p),this}on(c,d){return super.on(c,d)}addListener(c,d){return super.addListener(c,d)}prependListener(c,d){return super.prependListener(c,d)}prependOnceListener(c,d){return super.prependOnceListener(c,d)}removeAllListeners(c){return super.removeAllListeners(c)}removeListener(c,d){return super.removeListener(c,d)}eventNames(){return super.eventNames()}listeners(c){return super.listeners(c)}listenerCount(c){return super.listenerCount(c)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(c){return super.setMaxListeners(c)}}f.AsyncEventEmitter=E},1949:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.intToUnpaddedBuffer=f.bigIntToUnpaddedBuffer=f.bigIntToHex=f.bufArrToArr=f.arrToBufArr=f.validateNoLeadingZeroes=f.baToJSON=f.toUtf8=f.short=f.addHexPrefix=f.toUnsigned=f.fromSigned=f.bufferToInt=f.bigIntToBuffer=f.bufferToBigInt=f.bufferToHex=f.toBuffer=f.unpadHexString=f.unpadArray=f.unpadBuffer=f.setLengthRight=f.setLengthLeft=f.zeros=f.intToBuffer=f.intToHex=void 0;const w=_(55407),E=_(11921),v=function(T){if(!Number.isSafeInteger(T)||T<0)throw new Error(`Received an invalid integer type: ${T}`);return`0x${T.toString(16)}`};f.intToHex=v;const c=function(T){const N=(0,f.intToHex)(T);return h.from((0,E.padToEven)(N.slice(2)),"hex")};f.intToBuffer=c;const d=function(T){return h.allocUnsafe(T).fill(0)};f.zeros=d;const p=function(T,N,j){const Y=(0,f.zeros)(N);return j?T.length<N?(T.copy(Y),Y):T.slice(0,N):T.length<N?(T.copy(Y,N-T.length),Y):T.slice(-N)},m=function(T,N){return(0,w.assertIsBuffer)(T),p(T,N,!1)};f.setLengthLeft=m;const C=function(T,N){return(0,w.assertIsBuffer)(T),p(T,N,!0)};f.setLengthRight=C;const x=function(T){let N=T[0];for(;T.length>0&&N.toString()==="0";)T=T.slice(1),N=T[0];return T},R=function(T){return(0,w.assertIsBuffer)(T),x(T)};f.unpadBuffer=R;const S=function(T){return(0,w.assertIsArray)(T),x(T)};f.unpadArray=S;const O=function(T){return(0,w.assertIsHexString)(T),T=(0,E.stripHexPrefix)(T),"0x"+x(T)};f.unpadHexString=O;const M=function(T){if(T==null)return h.allocUnsafe(0);if(h.isBuffer(T)||Array.isArray(T)||T instanceof Uint8Array)return h.from(T);if(typeof T=="string"){if(!(0,E.isHexString)(T))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${T}`);return h.from((0,E.padToEven)((0,E.stripHexPrefix)(T)),"hex")}if(typeof T=="number")return(0,f.intToBuffer)(T);if(typeof T=="bigint"){if(T<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${T}`);let N=T.toString(16);return N.length%2&&(N="0"+N),h.from(N,"hex")}if(T.toArray)return h.from(T.toArray());if(T.toBuffer)return h.from(T.toBuffer());throw new Error("invalid type")};f.toBuffer=M;const k=function(T){return T=(0,f.toBuffer)(T),"0x"+T.toString("hex")};f.bufferToHex=k;function q(T){const N=(0,f.bufferToHex)(T);return BigInt(N==="0x"?0:N)}f.bufferToBigInt=q;function b(T){return(0,f.toBuffer)("0x"+T.toString(16))}f.bigIntToBuffer=b;const F=function(T){const N=Number(q(T));if(!Number.isSafeInteger(N))throw new Error("Number exceeds 53 bits");return N};f.bufferToInt=F;const G=function(T){return BigInt.asIntN(256,q(T))};f.fromSigned=G;const ue=function(T){return b(BigInt.asUintN(256,T))};f.toUnsigned=ue;const le=function(T){return typeof T!="string"||(0,E.isHexPrefixed)(T)?T:"0x"+T};f.addHexPrefix=le;function X(T,N=50){const j=h.isBuffer(T)?T.toString("hex"):T;return j.length<=N?j:j.slice(0,N)+"\u2026"}f.short=X;const se=function(T){const N=/^(00)+|(00)+$/g;if(T=(0,E.stripHexPrefix)(T),T.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return h.from(T.replace(N,""),"hex").toString("utf8")};f.toUtf8=se;const de=function(T){if(h.isBuffer(T))return`0x${T.toString("hex")}`;if(T instanceof Array){const N=[];for(let j=0;j<T.length;j++)N.push((0,f.baToJSON)(T[j]));return N}};f.baToJSON=de;const ye=function(T){for(const[N,j]of Object.entries(T))if(j!==void 0&&j.length>0&&j[0]===0)throw new Error(`${N} cannot have leading zeroes, received: ${j.toString("hex")}`)};f.validateNoLeadingZeroes=ye;function he(T){return Array.isArray(T)?T.map(N=>he(N)):h.from(T)}f.arrToBufArr=he;function K(T){return Array.isArray(T)?T.map(N=>K(N)):Uint8Array.from(T??[])}f.bufArrToArr=K;const B=T=>"0x"+T.toString(16);f.bigIntToHex=B;function L(T){return(0,f.unpadBuffer)(b(T))}f.bigIntToUnpaddedBuffer=L;function $(T){return(0,f.unpadBuffer)((0,f.intToBuffer)(T))}f.intToUnpaddedBuffer=$},86111:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.MAX_WITHDRAWALS_PER_PAYLOAD=f.RLP_EMPTY_STRING=f.KECCAK256_RLP=f.KECCAK256_RLP_S=f.KECCAK256_RLP_ARRAY=f.KECCAK256_RLP_ARRAY_S=f.KECCAK256_NULL=f.KECCAK256_NULL_S=f.TWO_POW256=f.SECP256K1_ORDER_DIV_2=f.SECP256K1_ORDER=f.MAX_INTEGER_BIGINT=f.MAX_INTEGER=f.MAX_UINT64=void 0;const h=_(36533),w=_(51747);f.MAX_UINT64=BigInt("0xffffffffffffffff"),f.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),f.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),f.SECP256K1_ORDER=w.secp256k1.CURVE.n,f.SECP256K1_ORDER_DIV_2=w.secp256k1.CURVE.n/BigInt(2),f.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),f.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",f.KECCAK256_NULL=h.Buffer.from(f.KECCAK256_NULL_S,"hex"),f.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",f.KECCAK256_RLP_ARRAY=h.Buffer.from(f.KECCAK256_RLP_ARRAY_S,"hex"),f.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",f.KECCAK256_RLP=h.Buffer.from(f.KECCAK256_RLP_S,"hex"),f.RLP_EMPTY_STRING=h.Buffer.from([128]),f.MAX_WITHDRAWALS_PER_PAYLOAD=16},91281:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.compactBytesToNibbles=f.bytesToNibbles=f.nibblesToCompactBytes=f.nibblesToBytes=f.hasTerminator=void 0;const _=c=>c.length>0&&c[c.length-1]===16;f.hasTerminator=_;const h=(c,d)=>{for(let p=0,m=0;m<c.length;p+=1,m+=2)d[p]=c[m]<<4|c[m+1]};f.nibblesToBytes=h;const w=c=>{let d=0;(0,f.hasTerminator)(c)&&(d=1,c=c.subarray(0,c.length-1));const p=new Uint8Array(c.length/2+1);return p[0]=d<<5,(c.length&1)===1&&(p[0]|=16,p[0]|=c[0],c=c.subarray(1)),(0,f.nibblesToBytes)(c,p.subarray(1)),p};f.nibblesToCompactBytes=w;const E=c=>{const d=c.length*2+1,p=new Uint8Array(d);for(let m=0;m<c.length;m++){const C=c[m];p[m*2]=C/16,p[m*2+1]=C%16}return p[d-1]=16,p};f.bytesToNibbles=E;const v=c=>{if(c.length===0)return c;let d=(0,f.bytesToNibbles)(c);d[0]<2&&(d=d.subarray(0,d.length-1));const p=2-(d[0]&1);return d.subarray(p)};f.compactBytesToNibbles=v},55407:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.assertIsString=f.assertIsArray=f.assertIsBuffer=f.assertIsHexString=void 0;const w=_(11921),E=function(p){if(!(0,w.isHexString)(p)){const m=`This method only supports 0x-prefixed hex strings but input was: ${p}`;throw new Error(m)}};f.assertIsHexString=E;const v=function(p){if(!h.isBuffer(p)){const m=`This method only supports Buffer but input was: ${p}`;throw new Error(m)}};f.assertIsBuffer=v;const c=function(p){if(!Array.isArray(p)){const m=`This method only supports number arrays but input was: ${p}`;throw new Error(m)}};f.assertIsArray=c;const d=function(p){if(typeof p!="string"){const m=`This method only supports strings but input was: ${p}`;throw new Error(m)}};f.assertIsString=d},58094:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(v,c,d,p){p===void 0&&(p=d);var m=Object.getOwnPropertyDescriptor(c,d);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(v,p,m)}:function(v,c,d,p){p===void 0&&(p=d),v[p]=c[d]}),w=this&&this.__exportStar||function(v,c){for(var d in v)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&h(c,v,d)};Object.defineProperty(f,"__esModule",{value:!0}),f.toAscii=f.stripHexPrefix=f.padToEven=f.isHexString=f.isHexPrefixed=f.getKeys=f.getBinarySize=f.fromUtf8=f.fromAscii=f.arrayContainsArray=void 0,w(_(86111),f),w(_(87557),f),w(_(3021),f),w(_(51494),f),w(_(73455),f),w(_(10144),f),w(_(1949),f),w(_(49219),f),w(_(91281),f),w(_(93656),f);var E=_(11921);Object.defineProperty(f,"arrayContainsArray",{enumerable:!0,get:function(){return E.arrayContainsArray}}),Object.defineProperty(f,"fromAscii",{enumerable:!0,get:function(){return E.fromAscii}}),Object.defineProperty(f,"fromUtf8",{enumerable:!0,get:function(){return E.fromUtf8}}),Object.defineProperty(f,"getBinarySize",{enumerable:!0,get:function(){return E.getBinarySize}}),Object.defineProperty(f,"getKeys",{enumerable:!0,get:function(){return E.getKeys}}),Object.defineProperty(f,"isHexPrefixed",{enumerable:!0,get:function(){return E.isHexPrefixed}}),Object.defineProperty(f,"isHexString",{enumerable:!0,get:function(){return E.isHexString}}),Object.defineProperty(f,"padToEven",{enumerable:!0,get:function(){return E.padToEven}}),Object.defineProperty(f,"stripHexPrefix",{enumerable:!0,get:function(){return E.stripHexPrefix}}),Object.defineProperty(f,"toAscii",{enumerable:!0,get:function(){return E.toAscii}}),w(_(59599),f),w(_(33041),f)},11921:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.isHexString=f.getKeys=f.fromAscii=f.fromUtf8=f.toAscii=f.arrayContainsArray=f.getBinarySize=f.padToEven=f.stripHexPrefix=f.isHexPrefixed=void 0;function w(S){if(typeof S!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof S}`);return S[0]==="0"&&S[1]==="x"}f.isHexPrefixed=w;const E=S=>{if(typeof S!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof S}`);return w(S)?S.slice(2):S};f.stripHexPrefix=E;function v(S){let O=S;if(typeof O!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof O}`);return O.length%2&&(O=`0${O}`),O}f.padToEven=v;function c(S){if(typeof S!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof S}`);return h.byteLength(S,"utf8")}f.getBinarySize=c;function d(S,O,M){if(Array.isArray(S)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof S}'`);if(Array.isArray(O)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof O}'`);return O[M===!0?"some":"every"](k=>S.indexOf(k)>=0)}f.arrayContainsArray=d;function p(S){let O="",M=0;const k=S.length;for(S.substring(0,2)==="0x"&&(M=2);M<k;M+=2){const q=parseInt(S.substr(M,2),16);O+=String.fromCharCode(q)}return O}f.toAscii=p;function m(S){const O=h.from(S,"utf8");return`0x${v(O.toString("hex")).replace(/^0+|0+$/g,"")}`}f.fromUtf8=m;function C(S){let O="";for(let M=0;M<S.length;M++){const q=S.charCodeAt(M).toString(16);O+=q.length<2?`0${q}`:q}return`0x${O}`}f.fromAscii=C;function x(S,O,M){if(!Array.isArray(S))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof S}`);if(typeof O!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof S}`);const k=[];for(let q=0;q<S.length;q++){let b=S[q][O];if(M===!0&&!b)b="";else if(typeof b!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof b}`);k.push(b)}return k}f.getKeys=x;function R(S,O){return!(typeof S!="string"||!S.match(/^0x[0-9A-Fa-f]*$/)||typeof O<"u"&&O>0&&S.length!==2+2*O)}f.isHexString=R},59599:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.Lock=void 0;class _{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(w=>this.promiseResolverQueue.push(w))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const w=this.promiseResolverQueue.shift();w&&w(!0)}}}f.Lock=_},33041:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getProvider=f.fetchFromProvider=void 0;const h=_(43712),w=async(v,c)=>(await(0,h.default)(v,{headers:{"content-type":"application/json"},type:"json",data:{method:c.method,params:c.params,jsonrpc:"2.0",id:1}})).result;f.fetchFromProvider=w;const E=v=>{if(typeof v=="string")return v;if(v?.connection?.url!==void 0)return v.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};f.getProvider=E},10144:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.hashPersonalMessage=f.isValidSignature=f.fromRpcSig=f.toCompactSig=f.toRpcSig=f.ecrecover=f.ecsign=void 0;const w=_(98381),E=_(51747),v=_(1949),c=_(86111),d=_(55407);function p(q,b,F){const G=E.secp256k1.sign(q,b),ue=G.toCompactRawBytes(),le=h.from(ue.slice(0,32)),X=h.from(ue.slice(32,64)),se=F===void 0?BigInt(G.recovery+27):BigInt(G.recovery+35)+BigInt(F)*BigInt(2);return{r:le,s:X,v:se}}f.ecsign=p;function m(q,b){return q===BigInt(0)||q===BigInt(1)?q:b===void 0?q-BigInt(27):q-(b*BigInt(2)+BigInt(35))}function C(q){return q===BigInt(0)||q===BigInt(1)}const x=function(q,b,F,G,ue){const le=h.concat([(0,v.setLengthLeft)(F,32),(0,v.setLengthLeft)(G,32)],64),X=m(b,ue);if(!C(X))throw new Error("Invalid signature v value");const de=E.secp256k1.Signature.fromCompact(le).addRecoveryBit(Number(X)).recoverPublicKey(q);return h.from(de.toRawBytes(!1).slice(1))};f.ecrecover=x;const R=function(q,b,F,G){const ue=m(q,G);if(!C(ue))throw new Error("Invalid signature v value");return(0,v.bufferToHex)(h.concat([(0,v.setLengthLeft)(b,32),(0,v.setLengthLeft)(F,32),(0,v.toBuffer)(q)]))};f.toRpcSig=R;const S=function(q,b,F,G){const ue=m(q,G);if(!C(ue))throw new Error("Invalid signature v value");let le=F;return(q>BigInt(28)&&q%BigInt(2)===BigInt(1)||q===BigInt(1)||q===BigInt(28))&&(le=h.from(F),le[0]|=128),(0,v.bufferToHex)(h.concat([(0,v.setLengthLeft)(b,32),(0,v.setLengthLeft)(le,32)]))};f.toCompactSig=S;const O=function(q){const b=(0,v.toBuffer)(q);let F,G,ue;if(b.length>=65)F=b.slice(0,32),G=b.slice(32,64),ue=(0,v.bufferToBigInt)(b.slice(64));else if(b.length===64)F=b.slice(0,32),G=b.slice(32,64),ue=BigInt((0,v.bufferToInt)(b.slice(32,33))>>7),G[0]&=127;else throw new Error("Invalid signature length");return ue<27&&(ue=ue+BigInt(27)),{v:ue,r:F,s:G}};f.fromRpcSig=O;const M=function(q,b,F,G=!0,ue){if(b.length!==32||F.length!==32||!C(m(q,ue)))return!1;const le=(0,v.bufferToBigInt)(b),X=(0,v.bufferToBigInt)(F);return!(le===BigInt(0)||le>=c.SECP256K1_ORDER||X===BigInt(0)||X>=c.SECP256K1_ORDER||G&&X>=c.SECP256K1_ORDER_DIV_2)};f.isValidSignature=M;const k=function(q){(0,d.assertIsBuffer)(q);const b=h.from(`Ethereum Signed Message:
|
||
${q.length}`,"utf-8");return h.from((0,w.keccak256)(h.concat([b,q])))};f.hashPersonalMessage=k},49219:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.toType=f.TypeOutput=void 0;const h=_(1949),w=_(11921);var E;(function(c){c[c.Number=0]="Number",c[c.BigInt=1]="BigInt",c[c.Buffer=2]="Buffer",c[c.PrefixedHexString=3]="PrefixedHexString"})(E=f.TypeOutput||(f.TypeOutput={}));function v(c,d){if(c===null)return null;if(c===void 0)return;if(typeof c=="string"&&!(0,w.isHexString)(c))throw new Error(`A string must be provided with a 0x-prefix, given: ${c}`);if(typeof c=="number"&&!Number.isSafeInteger(c))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const p=(0,h.toBuffer)(c);switch(d){case E.Buffer:return p;case E.BigInt:return(0,h.bufferToBigInt)(p);case E.Number:{const m=(0,h.bufferToBigInt)(p);if(m>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(m)}case E.PrefixedHexString:return(0,h.bufferToHex)(p);default:throw new Error("unknown outputType")}}f.toType=v},87557:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.GWEI_TO_WEI=void 0,f.GWEI_TO_WEI=BigInt(1e9)},73455:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.Withdrawal=void 0;const w=_(51494),E=_(1949),v=_(49219);class c{constructor(p,m,C,x){this.index=p,this.validatorIndex=m,this.address=C,this.amount=x}static fromWithdrawalData(p){const{index:m,validatorIndex:C,address:x,amount:R}=p,S=(0,v.toType)(m,v.TypeOutput.BigInt),O=(0,v.toType)(C,v.TypeOutput.BigInt),M=new w.Address((0,v.toType)(x,v.TypeOutput.Buffer)),k=(0,v.toType)(R,v.TypeOutput.BigInt);return new c(S,O,M,k)}static fromValuesArray(p){if(p.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${p.length}`);const[m,C,x,R]=p;return c.fromWithdrawalData({index:m,validatorIndex:C,address:x,amount:R})}static toBufferArray(p){const{index:m,validatorIndex:C,address:x,amount:R}=p,S=(0,v.toType)(m,v.TypeOutput.BigInt)===BigInt(0)?h.alloc(0):(0,v.toType)(m,v.TypeOutput.Buffer),O=(0,v.toType)(C,v.TypeOutput.BigInt)===BigInt(0)?h.alloc(0):(0,v.toType)(C,v.TypeOutput.Buffer);let M;x instanceof w.Address?M=x.buf:M=(0,v.toType)(x,v.TypeOutput.Buffer);const k=(0,v.toType)(R,v.TypeOutput.BigInt)===BigInt(0)?h.alloc(0):(0,v.toType)(R,v.TypeOutput.Buffer);return[S,O,M,k]}raw(){return c.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,E.bigIntToHex)(this.index),validatorIndex:(0,E.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,E.bigIntToHex)(this.amount)}}}f.Withdrawal=c},50044:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.decodeSingle=f.decode=f.encodePacked=f.encodeSingle=f.encode=void 0;const h=_(29089),w=_(79647),E=_(80306),v=(C,x,R,S)=>{try{return(0,E.pack)({types:C,values:x,packed:R,tight:S})}catch(O){throw O instanceof w.ParserError?new w.ParserError(`Unable to encode value: ${O.message}`,O):new w.ParserError(`An unexpected error occurred: ${(0,w.getErrorMessage)(O)}`,O)}};f.encode=v;const c=(C,x)=>(0,f.encode)([C],[x]);f.encodeSingle=c;const d=(C,x,R)=>(0,f.encode)(C,x,!0,R);f.encodePacked=d;const p=(C,x)=>{const R=(0,h.createBytes)(x);try{return(0,E.unpack)(C,R)}catch(S){throw S instanceof w.ParserError?new w.ParserError(`Unable to decode value: ${S.message}`,S):new w.ParserError(`An unexpected error occurred: ${(0,w.getErrorMessage)(S)}`,S)}};f.decode=p;const m=(C,x)=>{const R=(0,f.decode)([C],x);return(0,h.assert)(R.length===1,new w.ParserError("Decoded value array has unexpected length.")),R[0]};f.decodeSingle=m},79647:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.ParserError=f.getErrorStack=f.getErrorMessage=void 0;const h=_(29089),w=c=>typeof c=="string"?c:c instanceof Error||(0,h.isObject)(c)&&(0,h.hasProperty)(c,"message")&&typeof c.message=="string"?c.message:"Unknown error.";f.getErrorMessage=w;const E=c=>{if(c instanceof Error)return c.stack};f.getErrorStack=E;class v extends Error{constructor(d,p){super(d),this.name="ParserError";const m=(0,f.getErrorStack)(p);m&&(this.stack=m)}}f.ParserError=v},59066:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(50044),f),w(_(79647),f),w(_(63792),f)},45242:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.iterate=void 0;const h=_(29089),w=function*(E,v=32){for(let c=0;c<E.length;c+=v){const d=m=>{(0,h.assert)(m>=0,"Cannot skip a negative number of bytes."),(0,h.assert)(m%v===0,"Length must be a multiple of the size."),c+=m},p=E.subarray(c);yield{skip:d,value:p}}return{skip:()=>{},value:new Uint8Array}};f.iterate=w},80306:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.unpack=f.pack=f.isDynamicParser=f.getParser=void 0;const h=_(29089),w=_(79647),E=_(45242),v=_(42469),c=_(17684),d=x=>{const R={address:v.address,array:v.array,bool:v.bool,bytes:v.bytes,fixedBytes:v.fixedBytes,function:v.fn,number:v.number,string:v.string,tuple:v.tuple},S=R[x];if(S)return S;const O=Object.values(R).find(M=>M.isType(x));if(O)return O;throw new w.ParserError(`The type "${x}" is not supported.`)};f.getParser=d;const p=(x,R)=>{const{isDynamic:S}=x;return typeof S=="function"?S(R):S};f.isDynamicParser=p;const m=({types:x,values:R,packed:S=!1,tight:O=!1,arrayPacked:M=!1,byteArray:k=new Uint8Array})=>{(0,h.assert)(x.length===R.length,new w.ParserError(`The number of types (${x.length}) does not match the number of values (${R.length}).`));const{staticBuffer:q,dynamicBuffer:b,pointers:F}=x.reduce(({staticBuffer:le,dynamicBuffer:X,pointers:se},de,ye)=>{const he=(0,f.getParser)(de),K=R[ye];if(S||M||!(0,f.isDynamicParser)(he,de))return{staticBuffer:he.encode({buffer:le,value:K,type:de,packed:S,tight:O}),dynamicBuffer:X,pointers:se};const B=(0,h.concatBytes)([le,new Uint8Array(32)]),L=he.encode({buffer:X,value:K,type:de,packed:S,tight:O});return{staticBuffer:B,dynamicBuffer:L,pointers:[...se,{position:le.length,pointer:X.length}]}},{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,h.assert)(!S&&!M||b.length===0,new w.ParserError("Invalid pack state."));const G=q.length,ue=F.reduce((le,{pointer:X,position:se})=>{const de=(0,c.padStart)((0,h.numberToBytes)(G+X));return(0,c.set)(le,de,se)},q);return(0,h.concatBytes)([k,ue,b])};f.pack=m;const C=(x,R)=>{const S=(0,E.iterate)(R);return x.map(O=>{const{value:{value:M,skip:k},done:q}=S.next();(0,h.assert)(!q,new w.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${O}".`));const b=(0,f.getParser)(O);if((0,f.isDynamicParser)(b,O)){const G=(0,h.bytesToNumber)(M.subarray(0,32)),ue=R.subarray(G);return b.decode({type:O,value:ue,skip:k})}return b.decode({type:O,value:M,skip:k})})};f.unpack=C},50113:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.address=f.getAddress=void 0;const h=_(29089),w=_(79647),E=_(17684),v=c=>{const d=(0,h.createBytes)(c);return(0,h.assert)(d.length<=20,new w.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${d.length} bytes.`)),(0,E.padStart)(d,20)};f.getAddress=v,f.address={isDynamic:!1,isType:c=>c==="address",getByteLength(){return 32},encode({buffer:c,value:d,packed:p}){const m=(0,f.getAddress)(d);if(p)return(0,h.concatBytes)([c,m]);const C=(0,E.padStart)(m);return(0,h.concatBytes)([c,C])},decode({value:c}){return(0,h.add0x)((0,h.bytesToHex)(c.slice(12,32)))}}},48956:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.array=f.getTupleType=f.getArrayType=f.isArrayType=void 0;const h=_(29089),w=_(79647),E=_(80306),v=_(17684),c=_(17861),d=_(22959),p=/^(?<type>.*)\[(?<length>\d*?)\]$/u,m=R=>p.test(R);f.isArrayType=m;const C=R=>{const S=R.match(p);return(0,h.assert)(S?.groups?.type,new w.ParserError(`Invalid array type. Expected an array type, but received "${R}".`)),[S.groups.type,S.groups.length?parseInt(S.groups.length,10):void 0]};f.getArrayType=C;const x=(R,S)=>`(${new Array(S).fill(R).join(",")})`;f.getTupleType=x,f.array={isDynamic(R){const[S,O]=(0,f.getArrayType)(R);return O===void 0||(0,E.isDynamicParser)((0,E.getParser)(S),S)},isType(R){return(0,f.isArrayType)(R)},getByteLength(R){(0,h.assert)((0,f.isArrayType)(R),new w.ParserError(`Expected an array type, but received "${R}".`));const[S,O]=(0,f.getArrayType)(R);return!(0,E.isDynamicParser)(this,R)&&O!==void 0?d.tuple.getByteLength((0,f.getTupleType)(S,O)):32},encode({type:R,buffer:S,value:O,packed:M,tight:k}){const[q,b]=(0,f.getArrayType)(R);if((0,h.assert)(!M||!(0,f.isArrayType)(q),new w.ParserError("Cannot pack nested arrays.")),M&&(0,E.isDynamicParser)((0,E.getParser)(q),q))return(0,E.pack)({types:new Array(O.length).fill(q),values:O,byteArray:S,packed:M,arrayPacked:!0,tight:k});if(b)return(0,h.assert)(b===O.length,new w.ParserError(`Array length does not match type length. Expected a length of ${b}, but received ${O.length}.`)),d.tuple.encode({type:(0,f.getTupleType)(q,b),buffer:S,value:O,packed:c.fixedBytes.isType(q)&&k,tight:k});if(M)return(0,E.pack)({types:new Array(O.length).fill(q),values:O,byteArray:S,packed:c.fixedBytes.isType(q)&&k,arrayPacked:!0,tight:k});const F=(0,v.padStart)((0,h.numberToBytes)(O.length));return(0,E.pack)({types:new Array(O.length).fill(q),values:O,byteArray:(0,h.concatBytes)([S,F]),packed:M,tight:k})},decode({type:R,value:S,...O}){const[M,k]=(0,f.getArrayType)(R);if(k){const b=d.tuple.decode({type:(0,f.getTupleType)(M,k),value:S,...O});return(0,h.assert)(b.length===k,new w.ParserError(`Array length does not match type length. Expected a length of ${k}, but received ${b.length}.`)),b}const q=(0,h.bytesToNumber)(S.subarray(0,32));return(0,E.unpack)(new Array(q).fill(M),S.subarray(32))}}},39853:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.bool=f.getBooleanValue=void 0;const h=_(7033),w=_(29089),E=_(79647),v=_(85136),c=(0,h.coerce)((0,h.boolean)(),(0,h.union)([(0,h.literal)("true"),(0,h.literal)("false")]),p=>p==="true"),d=p=>{try{return(0,h.create)(p,c)?BigInt(1):BigInt(0)}catch{throw new E.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${p}".`)}};f.getBooleanValue=d,f.bool={isDynamic:!1,isType:p=>p==="bool",getByteLength(){return 32},encode({buffer:p,value:m,packed:C,tight:x}){const R=(0,f.getBooleanValue)(m);return C?(0,w.concatBytes)([p,(0,w.bigIntToBytes)(R)]):v.number.encode({type:"uint256",buffer:p,value:R,packed:C,tight:x})},decode(p){return v.number.decode({...p,type:"uint256"})===BigInt(1)}}},87422:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.bytes=void 0;const h=_(29089),w=_(17684);f.bytes={isDynamic:!0,isType:E=>E==="bytes",getByteLength(){return 32},encode({buffer:E,value:v,packed:c}){const d=(0,h.createBytes)(v);if(c)return(0,h.concatBytes)([E,d]);const p=Math.ceil(d.byteLength/32)*32;return(0,h.concatBytes)([E,(0,w.padStart)((0,h.numberToBytes)(d.byteLength)),(0,w.padEnd)(d,p)])},decode({value:E}){const v=E.subarray(0,32),c=(0,h.bytesToNumber)(v);return E.slice(32,32+c)}}},17861:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.fixedBytes=f.getByteLength=void 0;const h=_(29089),w=_(79647),E=_(17684),v=/^bytes([0-9]{1,2})$/u,c=d=>{const p=d.match(v)?.[1];(0,h.assert)(p,`Invalid byte length. Expected a number between 1 and 32, but received "${d}".`);const m=Number(p);return(0,h.assert)(m>0&&m<=32,new w.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${d}".`)),m};f.getByteLength=c,f.fixedBytes={isDynamic:!1,isType(d){return v.test(d)},getByteLength(){return 32},encode({type:d,buffer:p,value:m,packed:C}){const x=(0,f.getByteLength)(d),R=(0,h.createBytes)(m);return(0,h.assert)(R.length<=x,new w.ParserError(`Expected a value of length ${x}, but received a value of length ${R.length}.`)),C?(0,h.concatBytes)([p,(0,E.padEnd)(R,x)]):(0,h.concatBytes)([p,(0,E.padEnd)(R)])},decode({type:d,value:p}){const m=(0,f.getByteLength)(d);return p.slice(0,m)}}},72453:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.fn=f.getFunction=void 0;const h=_(7033),w=_(29089),E=_(79647),v=_(17861),c=(0,h.coerce)((0,h.object)({address:w.StrictHexStruct,selector:w.StrictHexStruct}),(0,h.union)([w.StrictHexStruct,(0,h.instance)(Uint8Array)]),p=>{const m=(0,w.createBytes)(p);return(0,w.assert)(m.length===24,new E.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${m.length} bytes.`)),{address:(0,w.bytesToHex)(m.subarray(0,20)),selector:(0,w.bytesToHex)(m.subarray(20,24))}}),d=p=>{const m=(0,h.create)(p,c);return(0,w.concatBytes)([(0,w.hexToBytes)(m.address),(0,w.hexToBytes)(m.selector)])};f.getFunction=d,f.fn={isDynamic:!1,isType:p=>p==="function",getByteLength(){return 32},encode({buffer:p,value:m,packed:C,tight:x}){const R=(0,f.getFunction)(m);return v.fixedBytes.encode({type:"bytes24",buffer:p,value:R,packed:C,tight:x})},decode({value:p}){return{address:(0,w.bytesToHex)(p.slice(0,20)),selector:(0,w.bytesToHex)(p.slice(20,24))}}}},42469:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(50113),f),w(_(48956),f),w(_(39853),f),w(_(87422),f),w(_(17861),f),w(_(72453),f),w(_(85136),f),w(_(29914),f),w(_(91284),f),w(_(22959),f)},85136:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.number=f.getBigInt=f.assertNumberLength=f.getLength=f.isSigned=void 0;const h=_(29089),w=_(79647),E=_(17684),v=/^u?int(?<length>[0-9]*)?$/u,c=C=>!C.startsWith("u");f.isSigned=c;const d=C=>{if(C==="int"||C==="uint")return 256;const x=C.match(v);(0,h.assert)(x?.groups?.length,new w.ParserError(`Invalid number type. Expected a number type, but received "${C}".`));const R=parseInt(x.groups.length,10);return(0,h.assert)(R>=8&&R<=256,new w.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${C}".`)),(0,h.assert)(R%8===0,new w.ParserError(`Invalid number length. Expected a multiple of 8, but received "${C}".`)),R};f.getLength=d;const p=(C,x)=>{const R=(0,f.getLength)(x),S=BigInt(2)**BigInt(R-((0,f.isSigned)(x)?1:0))-BigInt(1);if((0,f.isSigned)(x)){(0,h.assert)(C>=-(S+BigInt(1))&&C<=S,new w.ParserError(`Number "${C}" is out of range for type "${x}".`));return}(0,h.assert)(C<=S,new w.ParserError(`Number "${C}" is out of range for type "${x}".`))};f.assertNumberLength=p;const m=C=>{try{return(0,h.createBigInt)(C)}catch{throw new w.ParserError(`Invalid number. Expected a valid number value, but received "${C}".`)}};f.getBigInt=m,f.number={isDynamic:!1,isType(C){return v.test(C)},getByteLength(){return 32},encode({type:C,buffer:x,value:R,packed:S}){const O=(0,f.getBigInt)(R);if((0,f.assertNumberLength)(O,C),(0,f.isSigned)(C)){if(S){const M=(0,f.getLength)(C)/8;return(0,h.concatBytes)([x,(0,h.signedBigIntToBytes)(O,M)])}return(0,h.concatBytes)([x,(0,E.padStart)((0,h.signedBigIntToBytes)(O,32))])}if(S){const M=(0,f.getLength)(C)/8;return(0,h.concatBytes)([x,(0,E.padStart)((0,h.bigIntToBytes)(O),M)])}return(0,h.concatBytes)([x,(0,E.padStart)((0,h.bigIntToBytes)(O))])},decode({type:C,value:x}){const R=x.subarray(0,32);if((0,f.isSigned)(C)){const O=(0,h.bytesToSignedBigInt)(R);return(0,f.assertNumberLength)(O,C),O}const S=(0,h.bytesToBigInt)(R);return(0,f.assertNumberLength)(S,C),S}}},29914:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0})},91284:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.string=void 0;const h=_(29089),w=_(87422);f.string={isDynamic:!0,isType:E=>E==="string",getByteLength(){return 32},encode({buffer:E,value:v,packed:c,tight:d}){return w.bytes.encode({type:"bytes",buffer:E,value:(0,h.stringToBytes)(v),packed:c,tight:d})},decode(E){return(0,h.bytesToString)(w.bytes.decode(E))}}},22959:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.tuple=f.getTupleElements=void 0;const h=_(29089),w=_(79647),E=_(80306),v=/^\((.+)\)$/u,c=p=>v.test(p),d=p=>{(0,h.assert)(p.startsWith("(")&&p.endsWith(")"),new w.ParserError(`Invalid tuple type. Expected tuple type, but received "${p}".`));const m=[];let C="",x=0;for(let R=1;R<p.length-1;R++){const S=p[R];S===","&&x===0?(m.push(C.trim()),C=""):(C+=S,S==="("?x+=1:S===")"&&(x-=1))}return C.trim()&&m.push(C.trim()),m};f.getTupleElements=d,f.tuple={isDynamic(p){return(0,f.getTupleElements)(p).some(C=>{const x=(0,E.getParser)(C);return(0,E.isDynamicParser)(x,C)})},isType(p){return c(p)},getByteLength(p){return(0,E.isDynamicParser)(this,p)?32:(0,f.getTupleElements)(p).reduce((C,x)=>C+(0,E.getParser)(x).getByteLength(x),0)},encode({type:p,buffer:m,value:C,packed:x,tight:R}){const S=(0,f.getTupleElements)(p);return(0,E.pack)({types:S,values:C,byteArray:m,packed:x,tight:R})},decode({type:p,value:m,skip:C}){const x=(0,f.getTupleElements)(p),R=this.getByteLength(p)-32;return C(R),(0,E.unpack)(x,m)}}},34074:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0})},63792:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(34074),f)},62020:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.padEnd=f.padStart=f.set=void 0;const h=_(29089),w=32,E=(d,p,m)=>(0,h.concatBytes)([d.subarray(0,m),p,d.subarray(m+p.length)]);f.set=E;const v=(d,p=w)=>{const m=new Uint8Array(Math.max(p-d.length,0)).fill(0);return(0,h.concatBytes)([m,d])};f.padStart=v;const c=(d,p=w)=>{const m=new Uint8Array(Math.max(p-d.length,0)).fill(0);return(0,h.concatBytes)([d,m])};f.padEnd=c},17684:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(62020),f)},44953:function(ie,f,_){"use strict";var h,w=_(36533).Buffer;h={value:!0},f.isVaultUpdated=h=h=f.generateSalt=h=h=f.keyFromPassword=f.exportKey=f.importKey=f.decryptWithKey=f.decryptWithDetail=f.decrypt=f.encryptWithKey=f.encryptWithDetail=f.encrypt=void 0;const E=_(29089),v="jwk",c="AES-GCM",d="utf-8",p={algorithm:"PBKDF2",params:{iterations:1e4}},m={algorithm:"PBKDF2",params:{iterations:9e5}};async function C(L,$,T,N=le(),j=m){const Y=T||await b(L,N,!1,j),Z=await R(Y,$);return Z.salt=N,JSON.stringify(Z)}f.encrypt=C;async function x(L,$,T=le(),N=m){const j=await b(L,T,!0,N),Y=await q(j);return{vault:await C(L,$,j,T),exportedKeyString:Y}}f.encryptWithDetail=x;async function R(L,$){const T=JSON.stringify($),N=w.from(T,d),j=globalThis.crypto.getRandomValues(new Uint8Array(16)),Y=K(L),Z=await globalThis.crypto.subtle.encrypt({name:c,iv:j},Y,N),z=new Uint8Array(Z),fe=w.from(j).toString("base64"),H={data:w.from(z).toString("base64"),iv:fe};return de(L)&&(H.keyMetadata=L.derivationOptions),H}f.encryptWithKey=R;async function S(L,$,T){const N=JSON.parse($),{salt:j,keyMetadata:Y}=N,Z=K(T||await b(L,j,!1,Y));return await M(Z,N)}f.decrypt=S;async function O(L,$){const T=JSON.parse($),{salt:N,keyMetadata:j}=T,Y=await b(L,N,!0,j),Z=await q(Y),z=await S(L,$,Y);return{exportedKeyString:Z,vault:z,salt:N}}f.decryptWithDetail=O;async function M(L,$){const T=w.from($.data,"base64"),N=w.from($.iv,"base64"),j=K(L);let Y;try{const Z=await crypto.subtle.decrypt({name:c,iv:N},j,T),z=new Uint8Array(Z),fe=w.from(z).toString(d);Y=JSON.parse(fe)}catch{throw new Error("Incorrect password")}return Y}f.decryptWithKey=M;async function k(L){const $=JSON.parse(L);return he($)?{key:await globalThis.crypto.subtle.importKey(v,$.key,c,!0,["encrypt","decrypt"]),derivationOptions:$.derivationOptions}:await globalThis.crypto.subtle.importKey(v,$,c,!0,["encrypt","decrypt"])}f.importKey=k;async function q(L){return de(L)?JSON.stringify({key:await globalThis.crypto.subtle.exportKey(v,L.key),derivationOptions:L.derivationOptions}):JSON.stringify(await globalThis.crypto.subtle.exportKey(v,L))}f.exportKey=q;async function b(L,$,T=!1,N=p){const j=w.from(L,d),Y=w.from($,"base64"),Z=await globalThis.crypto.subtle.importKey("raw",j,{name:"PBKDF2"},!1,["deriveBits","deriveKey"]),z=await globalThis.crypto.subtle.deriveKey({name:"PBKDF2",salt:Y,iterations:N.params.iterations,hash:"SHA-256"},Z,{name:c,length:256},T,["encrypt","decrypt"]);return N?{key:z,derivationOptions:N}:z}f.keyFromPassword=b;function F(L){const $=L.slice(0,2)==="0x"?L.slice(2):L,T=new Uint8Array($.length/2);for(let N=0;N<$.length;N+=2){const j=$.substr(N,2);T[N/2]=parseInt(j,16)}return T}h=F;function G(L){let $="0x";return L.forEach(T=>{$+=ue(T)}),$}h=G;function ue(L){let $=L.toString(16);for(;$.length<2;)$=`0${$}`;return $}function le(L=32){const $=new Uint8Array(L);return globalThis.crypto.getRandomValues($),btoa(String.fromCharCode.apply(null,$))}f.generateSalt=le;async function X(L,$,T=m){return B(L,T)?L:C($,await S($,L),void 0,void 0,T)}h=X;async function se(L,$,T=m){return B(L.vault,T)?L:x($,await S($,L.vault),void 0,T)}h=se;function de(L){return(0,E.isPlainObject)(L)&&(0,E.hasProperty)(L,"key")&&(0,E.hasProperty)(L,"derivationOptions")&&L.key instanceof CryptoKey&&ye(L.derivationOptions)}function ye(L){return(0,E.isPlainObject)(L)&&(0,E.hasProperty)(L,"algorithm")&&(0,E.hasProperty)(L,"params")}function he(L){return(0,E.isPlainObject)(L)&&(0,E.hasProperty)(L,"key")&&(0,E.hasProperty)(L,"derivationOptions")&&ye(L.derivationOptions)}function K(L){return de(L)?L.key:L}function B(L,$=m){const{keyMetadata:T}=JSON.parse(L);return ye(T)&&T.algorithm===$.algorithm&&T.params.iterations===$.params.iterations}f.isVaultUpdated=B},66508:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__createBinding||(Object.create?function(O,M,k,q){q===void 0&&(q=k);var b=Object.getOwnPropertyDescriptor(M,k);(!b||("get"in b?!M.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return M[k]}}),Object.defineProperty(O,q,b)}:function(O,M,k,q){q===void 0&&(q=k),O[q]=M[k]}),E=this&&this.__setModuleDefault||(Object.create?function(O,M){Object.defineProperty(O,"default",{enumerable:!0,value:M})}:function(O,M){O.default=M}),v=this&&this.__importStar||function(O){if(O&&O.__esModule)return O;var M={};if(O!=null)for(var k in O)k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)&&w(M,O,k);return E(M,O),M};Object.defineProperty(f,"__esModule",{value:!0}),f.getEncryptionPublicKey=f.decryptSafely=f.decrypt=f.encryptSafely=f.encrypt=void 0;const c=_(62723),d=v(_(18861)),p=_(5620);function m({publicKey:O,data:M,version:k}){if((0,p.isNullish)(O))throw new Error("Missing publicKey parameter");if((0,p.isNullish)(M))throw new Error("Missing data parameter");if((0,p.isNullish)(k))throw new Error("Missing version parameter");switch(k){case"x25519-xsalsa20-poly1305":{if(typeof M!="string")throw new Error("Message data must be given as a string");const q=d.box.keyPair();let b;try{b=c.base64.decode(O)}catch{throw new Error("Bad public key")}const F=c.utf8.decode(M),G=d.randomBytes(d.box.nonceLength),ue=d.box(F,G,b,q.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:c.base64.encode(G),ephemPublicKey:c.base64.encode(q.publicKey),ciphertext:c.base64.encode(ue)}}default:throw new Error("Encryption type/version not supported")}}f.encrypt=m;function C({publicKey:O,data:M,version:k}){if((0,p.isNullish)(O))throw new Error("Missing publicKey parameter");if((0,p.isNullish)(M))throw new Error("Missing data parameter");if((0,p.isNullish)(k))throw new Error("Missing version parameter");const q=2**11,b=16;if(typeof M=="object"&&M&&"toJSON"in M)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const F={data:M,padding:""},ue=h.byteLength(JSON.stringify(F),"utf-8")%q;let le=0;ue>0&&(le=q-ue-b),F.padding="0".repeat(le);const X=JSON.stringify(F);return m({publicKey:O,data:X,version:k})}f.encryptSafely=C;function x({encryptedData:O,privateKey:M}){if((0,p.isNullish)(O))throw new Error("Missing encryptedData parameter");if((0,p.isNullish)(M))throw new Error("Missing privateKey parameter");switch(O.version){case"x25519-xsalsa20-poly1305":{const k=h.from(M,"hex"),q=d.box.keyPair.fromSecretKey(k).secretKey,b=c.base64.decode(O.nonce),F=c.base64.decode(O.ciphertext),G=c.base64.decode(O.ephemPublicKey),ue=d.box.open(F,b,G,q);try{if(!ue)throw new Error;const le=c.utf8.encode(ue);if(!le)throw new Error;return le}catch(le){throw le&&typeof le.message=="string"&&le.message.length?new Error(`Decryption failed: ${le.message}`):new Error("Decryption failed.")}}default:throw new Error("Encryption type/version not supported.")}}f.decrypt=x;function R({encryptedData:O,privateKey:M}){if((0,p.isNullish)(O))throw new Error("Missing encryptedData parameter");if((0,p.isNullish)(M))throw new Error("Missing privateKey parameter");return JSON.parse(x({encryptedData:O,privateKey:M})).data}f.decryptSafely=R;function S(O){const M=h.from(O,"hex"),k=d.box.keyPair.fromSecretKey(M).publicKey;return c.base64.encode(k)}f.getEncryptionPublicKey=S},68601:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(v,c,d,p){p===void 0&&(p=d);var m=Object.getOwnPropertyDescriptor(c,d);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(v,p,m)}:function(v,c,d,p){p===void 0&&(p=d),v[p]=c[d]}),w=this&&this.__exportStar||function(v,c){for(var d in v)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&h(c,v,d)};Object.defineProperty(f,"__esModule",{value:!0}),f.normalize=f.concatSig=void 0,w(_(98251),f),w(_(77442),f),w(_(66508),f),w(_(71567),f);var E=_(5620);Object.defineProperty(f,"concatSig",{enumerable:!0,get:function(){return E.concatSig}}),Object.defineProperty(f,"normalize",{enumerable:!0,get:function(){return E.normalize}})},98251:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.extractPublicKey=f.recoverPersonalSignature=f.personalSign=void 0;const h=_(58094),w=_(5620);function E({privateKey:p,data:m}){if((0,w.isNullish)(m))throw new Error("Missing data parameter");if((0,w.isNullish)(p))throw new Error("Missing privateKey parameter");const C=(0,w.legacyToBuffer)(m),x=(0,h.hashPersonalMessage)(C),R=(0,h.ecsign)(x,p);return(0,w.concatSig)((0,h.toBuffer)(R.v),R.r,R.s)}f.personalSign=E;function v({data:p,signature:m}){if((0,w.isNullish)(p))throw new Error("Missing data parameter");if((0,w.isNullish)(m))throw new Error("Missing signature parameter");const C=d(p,m),x=(0,h.publicToAddress)(C);return(0,h.bufferToHex)(x)}f.recoverPersonalSignature=v;function c({data:p,signature:m}){if((0,w.isNullish)(p))throw new Error("Missing data parameter");if((0,w.isNullish)(m))throw new Error("Missing signature parameter");return`0x${d(p,m).toString("hex")}`}f.extractPublicKey=c;function d(p,m){const C=(0,h.hashPersonalMessage)((0,w.legacyToBuffer)(p));return(0,w.recoverPublicKey)(C,m)}},71567:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.hashEIP7702Authorization=f.recoverEIP7702Authorization=f.signEIP7702Authorization=void 0;const w=_(44406),E=_(58094),v=_(29089),c=_(98381),d=_(5620);function p({privateKey:R,authorization:S}){if(x(S),(0,d.isNullish)(R))throw new Error("Missing privateKey parameter");const O=C(S),{r:M,s:k,v:q}=(0,E.ecsign)(O,R),b=(0,E.toBuffer)(q);return(0,d.concatSig)(b,M,k)}f.signEIP7702Authorization=p;function m({signature:R,authorization:S}){if(x(S),(0,d.isNullish)(R))throw new Error("Missing signature parameter");const O=C(S),M=(0,d.recoverPublicKey)(O,R),k=(0,E.publicToAddress)(M);return(0,v.bytesToHex)(k)}f.recoverEIP7702Authorization=m;function C(R){x(R);const S=(0,w.encode)(R),O=h.concat([h.from("05","hex"),S]);return h.from((0,c.keccak256)(O))}f.hashEIP7702Authorization=C;function x(R){if((0,d.isNullish)(R))throw new Error("Missing authorization parameter");const[S,O,M]=R;if((0,d.isNullish)(S))throw new Error("Missing chainId parameter");if((0,d.isNullish)(O))throw new Error("Missing contractAddress parameter");if((0,d.isNullish)(M))throw new Error("Missing nonce parameter")}},77442:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.recoverTypedSignature=f.signTypedData=f.typedSignatureHash=f.TypedDataUtils=f.TYPED_MESSAGE_SCHEMA=f.SignTypedDataVersion=void 0;const h=_(58094),w=_(59066),E=_(42469),v=_(17684),c=_(29089),d=_(98381),p=_(5620);var m;(function(B){B.V1="V1",B.V3="V3",B.V4="V4"})(m=f.SignTypedDataVersion||(f.SignTypedDataVersion={})),f.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]};function C(B,L){if(Object.keys(m).includes(B)){if(L&&!L.includes(B))throw new Error(`SignTypedDataVersion not allowed: '${B}'. Allowed versions are: ${L.join(", ")}`)}else throw new Error(`Invalid version: '${B}'`)}function x(B,L){(0,c.assert)(L!==null,`Unable to encode value: Invalid number. Expected a valid number value, but received "${L}".`);const $=BigInt(L),T=(0,E.getLength)(B),N=BigInt(2)**BigInt(T)-BigInt(1);return(0,c.assert)($>=-N&&$<=N,`Unable to encode value: Number "${L}" is out of range for type "${B}".`),$}function R(B){let L=BigInt(0);for(let $=0;$<B.length;$++){const T=BigInt(B.charCodeAt($)-48);L*=BigInt(10),T>=49?L+=T-BigInt(49)+BigInt(10):T>=17?L+=T-BigInt(17)+BigInt(10):L+=T}return(0,v.padStart)((0,c.bigIntToBytes)(L),20)}function S(B,L,$,T,N){if(C(N,[m.V3,m.V4]),B[$]!==void 0)return["bytes32",N===m.V4&&T==null?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,h.arrToBufArr)((0,d.keccak256)(O($,T,B,N)))];if($==="function")throw new Error('Unsupported or invalid type: "function"');if(T===void 0)throw new Error(`missing value for field ${L} of type ${$}`);if($==="address"){if(typeof T=="number")return["address",(0,v.padStart)((0,c.numberToBytes)(T),20)];if((0,c.isStrictHexString)(T))return["address",(0,c.add0x)(T)];if(typeof T=="string")return["address",R(T).subarray(0,20)]}if($==="bool")return["bool",!!T];if($==="bytes")return typeof T=="number"?T=(0,c.numberToBytes)(T):(0,c.isStrictHexString)(T)||T==="0x"?T=(0,c.hexToBytes)(T):typeof T=="string"&&(T=(0,c.stringToBytes)(T)),["bytes32",(0,h.arrToBufArr)((0,d.keccak256)(T))];if($.startsWith("bytes")&&$!=="bytes"&&!$.includes("["))return typeof T=="number"?T<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,c.bigIntToBytes)(BigInt(T))]:(0,c.isStrictHexString)(T)?["bytes32",(0,c.hexToBytes)(T)]:["bytes32",T];if($.startsWith("int")&&!$.includes("[")){const j=x($,T);return j>=BigInt(0)?["uint256",j]:["int256",j]}if($==="string")return typeof T=="number"?T=(0,c.numberToBytes)(T):T=(0,c.stringToBytes)(T??""),["bytes32",(0,h.arrToBufArr)((0,d.keccak256)(T))];if($.endsWith("]")){if(N===m.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const j=$.slice(0,$.lastIndexOf("[")),Y=T.map(Z=>S(B,L,j,Z,N));return["bytes32",(0,h.arrToBufArr)((0,d.keccak256)((0,w.encode)(Y.map(([Z])=>Z),Y.map(([,Z])=>Z))))]}return[$,T]}function O(B,L,$,T){C(T,[m.V3,m.V4]);const N=["bytes32"],j=[b(B,$)];for(const Y of $[B]){if(T===m.V3&&L[Y.name]===void 0)continue;const[Z,z]=S($,Y.name,Y.type,L[Y.name],T);N.push(Z),j.push(z)}return(0,h.arrToBufArr)((0,w.encode)(N,j))}function M(B,L){let $="";const T=k(B,L);T.delete(B);const N=[B,...Array.from(T).sort()];for(const j of N){if(!L[j])throw new Error(`No type definition specified: ${j}`);$+=`${j}(${L[j].map(({name:Z,type:z})=>`${z} ${Z}`).join(",")})`}return $}function k(B,L,$=new Set){if(typeof B!="string")throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(B)}`);if([B]=B.match(/^\w*/u),$.has(B)||L[B]===void 0)return $;$.add(B);for(const N of L[B])k(N.type,L,$);return $}function q(B,L,$,T){C(T,[m.V3,m.V4]);const N=O(B,L,$,T),j=(0,d.keccak256)(N);return(0,h.arrToBufArr)(j)}function b(B,L){const $=(0,c.stringToBytes)(M(B,L));return(0,h.arrToBufArr)((0,d.keccak256)($))}function F(B){const L={};for(const $ in f.TYPED_MESSAGE_SCHEMA.properties)B[$]&&(L[$]=B[$]);return"types"in L&&(L.types=Object.assign({EIP712Domain:[]},L.types)),L}function G(B,L){C(L,[m.V3,m.V4]);const $=F(B),{domain:T}=$,N={EIP712Domain:$.types.EIP712Domain};return q("EIP712Domain",T,N,L)}function ue(B,L){C(L,[m.V3,m.V4]);const $=F(B),T=[(0,c.hexToBytes)("1901")];return T.push(G(B,L)),$.primaryType!=="EIP712Domain"&&T.push(q($.primaryType,$.message,$.types,L)),(0,h.arrToBufArr)((0,d.keccak256)((0,c.concatBytes)(T)))}f.TypedDataUtils={encodeData:O,encodeType:M,findTypeDependencies:k,hashStruct:q,hashType:b,sanitizeData:F,eip712Hash:ue,eip712DomainHash:G};function le(B){const L=ye(B);return(0,c.bytesToHex)(L)}f.typedSignatureHash=le;function X(B,L){if((0,E.isArrayType)(B)&&Array.isArray(L)){const[$]=(0,E.getArrayType)(B);return L.map(T=>X($,T))}if(B==="address"){if((0,c.isStrictHexString)(L))return(0,v.padStart)((0,c.hexToBytes)(L).subarray(0,20),20);if(L instanceof Uint8Array)return(0,v.padStart)(L.subarray(0,20),20)}if(B==="bool")return!!L;if(B.startsWith("bytes")&&B!=="bytes"){const $=(0,E.getByteLength)(B);if(typeof L=="number")return L<0?new Uint8Array:(0,c.numberToBytes)(L).subarray(0,$);if((0,c.isStrictHexString)(L))return(0,c.hexToBytes)(L).subarray(0,$);if(L instanceof Uint8Array)return L.subarray(0,$)}if(B.startsWith("uint")&&typeof L=="number")return Math.abs(L);if(B.startsWith("int")&&typeof L=="number"){const $=(0,E.getLength)(B);return BigInt.asIntN($,BigInt(L))}return L}function se(B){return B.map(L=>typeof L=="number"?(0,v.padStart)((0,c.numberToBytes)(L),32):(0,c.isStrictHexString)(L)?(0,v.padStart)((0,c.hexToBytes)(L).subarray(0,32),32):L instanceof Uint8Array?(0,v.padStart)(L.subarray(0,32),32):L)}function de(B,L){return L.map($=>{if(typeof $=="string"||typeof $=="number"||typeof $=="bigint"){const T=x(B,$);if(T>=BigInt(0))return(0,v.padStart)((0,c.bigIntToBytes)(T),32);const N=(0,E.getLength)(B),j=BigInt.asIntN(N,T);return(0,c.signedBigIntToBytes)(j,32)}return $})}function ye(B){const L=new Error("Expect argument to be non-empty array");if(typeof B!="object"||!("length"in B)||!B.length)throw L;const $=B.map(({name:Y,type:Z,value:z})=>{if(Z==="address[]")return{name:Y,type:"bytes32[]",value:se(z)};if(Z.startsWith("int")&&(0,E.isArrayType)(Z)){const[fe,te]=(0,E.getArrayType)(Z);return{name:Y,type:`bytes32[${te??""}]`,value:de(fe,z)}}return{name:Y,type:Z,value:X(Z,z)}}),T=$.map(Y=>Y.type!=="bytes"?Y.value:(0,p.legacyToBuffer)(Y.value)),N=$.map(Y=>{if(Y.type==="function")throw new Error('Unsupported or invalid type: "function"');return Y.type}),j=B.map(Y=>{if(!Y.name)throw L;return`${Y.type} ${Y.name}`});return(0,h.arrToBufArr)((0,d.keccak256)((0,w.encodePacked)(["bytes32","bytes32"],[(0,d.keccak256)((0,w.encodePacked)(["string[]"],[j],!0)),(0,d.keccak256)((0,w.encodePacked)(N,T,!0))])))}function he({privateKey:B,data:L,version:$}){if(C($),(0,p.isNullish)(L))throw new Error("Missing data parameter");if((0,p.isNullish)(B))throw new Error("Missing private key parameter");const T=$===m.V1?ye(L):f.TypedDataUtils.eip712Hash(L,$),N=(0,h.ecsign)(T,B);return(0,p.concatSig)((0,h.arrToBufArr)((0,c.bigIntToBytes)(N.v)),N.r,N.s)}f.signTypedData=he;function K({data:B,signature:L,version:$}){if(C($),(0,p.isNullish)(B))throw new Error("Missing data parameter");if((0,p.isNullish)(L))throw new Error("Missing signature parameter");const T=$===m.V1?ye(B):f.TypedDataUtils.eip712Hash(B,$),N=(0,p.recoverPublicKey)(T,L),j=(0,h.publicToAddress)(N);return(0,c.bytesToHex)(j)}f.recoverTypedSignature=K},5620:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.normalize=f.recoverPublicKey=f.concatSig=f.legacyToBuffer=f.isNullish=f.padWithZeroes=void 0;const w=_(58094),E=_(29089);function v(x,R){if(x!==""&&!/^[a-f0-9]+$/iu.test(x))throw new Error(`Expected an unprefixed hex string. Received: ${x}`);if(R<0)throw new Error(`Expected a non-negative integer target length. Received: ${R}`);return String.prototype.padStart.call(x,R,"0")}f.padWithZeroes=v;function c(x){return x==null}f.isNullish=c;function d(x){return typeof x=="string"&&!(0,w.isHexString)(x)?h.from(x):(0,w.toBuffer)(x)}f.legacyToBuffer=d;function p(x,R,S){const O=(0,w.fromSigned)(R),M=(0,w.fromSigned)(S),k=(0,w.bufferToInt)(x),q=v((0,w.toUnsigned)(O).toString("hex"),64),b=v((0,w.toUnsigned)(M).toString("hex"),64),F=(0,E.remove0x)((0,E.numberToHex)(k));return(0,E.add0x)(q.concat(b,F))}f.concatSig=p;function m(x,R){const S=(0,w.fromRpcSig)(R);return(0,w.ecrecover)(x,S.v,S.r,S.s)}f.recoverPublicKey=m;function C(x){if(!c(x)){if(typeof x=="number"){if(x<0)return"0x";const R=(0,E.numberToBytes)(x);x=(0,E.bytesToHex)(R)}if(typeof x!="string"){let R="eth-sig-util.normalize() requires hex string or integer input.";throw R+=` received ${typeof x}: ${x}`,new Error(R)}return(0,E.add0x)(x.toLowerCase())}}f.normalize=C},78e3:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.rotl=p,f.createCipher=M;const h=_(7837),w=k=>Uint8Array.from(k.split("").map(q=>q.charCodeAt(0))),E=w("expand 16-byte k"),v=w("expand 32-byte k"),c=(0,h.u32)(E),d=(0,h.u32)(v);function p(k,q){return k<<q|k>>>32-q}function m(k){return k.byteOffset%4===0}const C=64,x=16,R=2**32-1,S=new Uint32Array;function O(k,q,b,F,G,ue,le,X){const se=G.length,de=new Uint8Array(C),ye=(0,h.u32)(de),he=m(G)&&m(ue),K=he?(0,h.u32)(G):S,B=he?(0,h.u32)(ue):S;for(let L=0;L<se;le++){if(k(q,b,F,ye,le,X),le>=R)throw new Error("arx: counter overflow");const $=Math.min(C,se-L);if(he&&$===C){const T=L/4;if(L%4!==0)throw new Error("arx: invalid block position");for(let N=0,j;N<x;N++)j=T+N,B[j]=K[j]^ye[N];L+=C;continue}for(let T=0,N;T<$;T++)N=L+T,ue[N]=G[N]^de[T];L+=$}}function M(k,q){const{allowShortKeys:b,extendNonceFn:F,counterLength:G,counterRight:ue,rounds:le}=(0,h.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},q);if(typeof k!="function")throw new Error("core must be a function");return(0,h.anumber)(G),(0,h.anumber)(le),(0,h.abool)(ue),(0,h.abool)(b),(X,se,de,ye,he=0)=>{(0,h.abytes)(X),(0,h.abytes)(se),(0,h.abytes)(de);const K=de.length;if(ye===void 0&&(ye=new Uint8Array(K)),(0,h.abytes)(ye),(0,h.anumber)(he),he<0||he>=R)throw new Error("arx: counter overflow");if(ye.length<K)throw new Error(`arx: output (${ye.length}) is shorter than data (${K})`);const B=[];let L=X.length,$,T;if(L===32)B.push($=(0,h.copyBytes)(X)),T=d;else if(L===16&&b)$=new Uint8Array(32),$.set(X),$.set(X,16),T=c,B.push($);else throw new Error(`arx: invalid 32-byte key, got length=${L}`);m(se)||B.push(se=(0,h.copyBytes)(se));const N=(0,h.u32)($);if(F){if(se.length!==24)throw new Error("arx: extended nonce must be 24 bytes");F(T,N,(0,h.u32)(se.subarray(0,16)),N),se=se.subarray(16)}const j=16-G;if(j!==se.length)throw new Error(`arx: nonce must be ${j} or 16 bytes`);if(j!==12){const Z=new Uint8Array(12);Z.set(se,ue?0:12-se.length),se=Z,B.push(se)}const Y=(0,h.u32)(se);return O(k,T,N,Y,de,ye,he,le),(0,h.clean)(...B),ye}}},20720:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.poly1305=void 0,f.wrapConstructorWithKey=v;const h=_(7837),w=(c,d)=>c[d++]&255|(c[d++]&255)<<8;class E{constructor(d){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,d=(0,h.toBytes)(d),(0,h.abytes)(d,32);const p=w(d,0),m=w(d,2),C=w(d,4),x=w(d,6),R=w(d,8),S=w(d,10),O=w(d,12),M=w(d,14);this.r[0]=p&8191,this.r[1]=(p>>>13|m<<3)&8191,this.r[2]=(m>>>10|C<<6)&7939,this.r[3]=(C>>>7|x<<9)&8191,this.r[4]=(x>>>4|R<<12)&255,this.r[5]=R>>>1&8190,this.r[6]=(R>>>14|S<<2)&8191,this.r[7]=(S>>>11|O<<5)&8065,this.r[8]=(O>>>8|M<<8)&8191,this.r[9]=M>>>5&127;for(let k=0;k<8;k++)this.pad[k]=w(d,16+2*k)}process(d,p,m=!1){const C=m?0:2048,{h:x,r:R}=this,S=R[0],O=R[1],M=R[2],k=R[3],q=R[4],b=R[5],F=R[6],G=R[7],ue=R[8],le=R[9],X=w(d,p+0),se=w(d,p+2),de=w(d,p+4),ye=w(d,p+6),he=w(d,p+8),K=w(d,p+10),B=w(d,p+12),L=w(d,p+14);let $=x[0]+(X&8191),T=x[1]+((X>>>13|se<<3)&8191),N=x[2]+((se>>>10|de<<6)&8191),j=x[3]+((de>>>7|ye<<9)&8191),Y=x[4]+((ye>>>4|he<<12)&8191),Z=x[5]+(he>>>1&8191),z=x[6]+((he>>>14|K<<2)&8191),fe=x[7]+((K>>>11|B<<5)&8191),te=x[8]+((B>>>8|L<<8)&8191),H=x[9]+(L>>>5|C),Q=0,oe=Q+$*S+T*(5*le)+N*(5*ue)+j*(5*G)+Y*(5*F);Q=oe>>>13,oe&=8191,oe+=Z*(5*b)+z*(5*q)+fe*(5*k)+te*(5*M)+H*(5*O),Q+=oe>>>13,oe&=8191;let _e=Q+$*O+T*S+N*(5*le)+j*(5*ue)+Y*(5*G);Q=_e>>>13,_e&=8191,_e+=Z*(5*F)+z*(5*b)+fe*(5*q)+te*(5*k)+H*(5*M),Q+=_e>>>13,_e&=8191;let ge=Q+$*M+T*O+N*S+j*(5*le)+Y*(5*ue);Q=ge>>>13,ge&=8191,ge+=Z*(5*G)+z*(5*F)+fe*(5*b)+te*(5*q)+H*(5*k),Q+=ge>>>13,ge&=8191;let be=Q+$*k+T*M+N*O+j*S+Y*(5*le);Q=be>>>13,be&=8191,be+=Z*(5*ue)+z*(5*G)+fe*(5*F)+te*(5*b)+H*(5*q),Q+=be>>>13,be&=8191;let we=Q+$*q+T*k+N*M+j*O+Y*S;Q=we>>>13,we&=8191,we+=Z*(5*le)+z*(5*ue)+fe*(5*G)+te*(5*F)+H*(5*b),Q+=we>>>13,we&=8191;let Ee=Q+$*b+T*q+N*k+j*M+Y*O;Q=Ee>>>13,Ee&=8191,Ee+=Z*S+z*(5*le)+fe*(5*ue)+te*(5*G)+H*(5*F),Q+=Ee>>>13,Ee&=8191;let me=Q+$*F+T*b+N*q+j*k+Y*M;Q=me>>>13,me&=8191,me+=Z*O+z*S+fe*(5*le)+te*(5*ue)+H*(5*G),Q+=me>>>13,me&=8191;let Ke=Q+$*G+T*F+N*b+j*q+Y*k;Q=Ke>>>13,Ke&=8191,Ke+=Z*M+z*O+fe*S+te*(5*le)+H*(5*ue),Q+=Ke>>>13,Ke&=8191;let He=Q+$*ue+T*G+N*F+j*b+Y*q;Q=He>>>13,He&=8191,He+=Z*k+z*M+fe*O+te*S+H*(5*le),Q+=He>>>13,He&=8191;let Ie=Q+$*le+T*ue+N*G+j*F+Y*b;Q=Ie>>>13,Ie&=8191,Ie+=Z*q+z*k+fe*M+te*O+H*S,Q+=Ie>>>13,Ie&=8191,Q=(Q<<2)+Q|0,Q=Q+oe|0,oe=Q&8191,Q=Q>>>13,_e+=Q,x[0]=oe,x[1]=_e,x[2]=ge,x[3]=be,x[4]=we,x[5]=Ee,x[6]=me,x[7]=Ke,x[8]=He,x[9]=Ie}finalize(){const{h:d,pad:p}=this,m=new Uint16Array(10);let C=d[1]>>>13;d[1]&=8191;for(let S=2;S<10;S++)d[S]+=C,C=d[S]>>>13,d[S]&=8191;d[0]+=C*5,C=d[0]>>>13,d[0]&=8191,d[1]+=C,C=d[1]>>>13,d[1]&=8191,d[2]+=C,m[0]=d[0]+5,C=m[0]>>>13,m[0]&=8191;for(let S=1;S<10;S++)m[S]=d[S]+C,C=m[S]>>>13,m[S]&=8191;m[9]-=8192;let x=(C^1)-1;for(let S=0;S<10;S++)m[S]&=x;x=~x;for(let S=0;S<10;S++)d[S]=d[S]&x|m[S];d[0]=(d[0]|d[1]<<13)&65535,d[1]=(d[1]>>>3|d[2]<<10)&65535,d[2]=(d[2]>>>6|d[3]<<7)&65535,d[3]=(d[3]>>>9|d[4]<<4)&65535,d[4]=(d[4]>>>12|d[5]<<1|d[6]<<14)&65535,d[5]=(d[6]>>>2|d[7]<<11)&65535,d[6]=(d[7]>>>5|d[8]<<8)&65535,d[7]=(d[8]>>>8|d[9]<<5)&65535;let R=d[0]+p[0];d[0]=R&65535;for(let S=1;S<8;S++)R=(d[S]+p[S]|0)+(R>>>16)|0,d[S]=R&65535;(0,h.clean)(m)}update(d){(0,h.aexists)(this),d=(0,h.toBytes)(d),(0,h.abytes)(d);const{buffer:p,blockLen:m}=this,C=d.length;for(let x=0;x<C;){const R=Math.min(m-this.pos,C-x);if(R===m){for(;m<=C-x;x+=m)this.process(d,x);continue}p.set(d.subarray(x,x+R),this.pos),this.pos+=R,x+=R,this.pos===m&&(this.process(p,0,!1),this.pos=0)}return this}destroy(){(0,h.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(d){(0,h.aexists)(this),(0,h.aoutput)(d,this),this.finished=!0;const{buffer:p,h:m}=this;let{pos:C}=this;if(C){for(p[C++]=1;C<16;C++)p[C]=0;this.process(p,0,!0)}this.finalize();let x=0;for(let R=0;R<8;R++)d[x++]=m[R]>>>0,d[x++]=m[R]>>>8;return d}digest(){const{buffer:d,outputLen:p}=this;this.digestInto(d);const m=d.slice(0,p);return this.destroy(),m}}function v(c){const d=(m,C)=>c(C).update((0,h.toBytes)(m)).digest(),p=c(new Uint8Array(32));return d.outputLen=p.outputLen,d.blockLen=p.blockLen,d.create=m=>c(m),d}f.poly1305=v(c=>new E(c))},73840:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.polyval=f.ghash=void 0,f._toGHASHKey=m;const h=_(7837),w=16,E=new Uint8Array(16),v=(0,h.u32)(E),c=225,d=(O,M,k,q)=>{const b=q&1;return{s3:k<<31|q>>>1,s2:M<<31|k>>>1,s1:O<<31|M>>>1,s0:O>>>1^c<<24&-(b&1)}},p=O=>(O>>>0&255)<<24|(O>>>8&255)<<16|(O>>>16&255)<<8|O>>>24&255|0;function m(O){O.reverse();const M=O[15]&1;let k=0;for(let q=0;q<O.length;q++){const b=O[q];O[q]=b>>>1|k,k=(b&1)<<7}return O[0]^=-M&225,O}const C=O=>O>64*1024?8:O>1024?4:2;class x{constructor(M,k){this.blockLen=w,this.outputLen=w,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,M=(0,h.toBytes)(M),(0,h.abytes)(M,16);const q=(0,h.createView)(M);let b=q.getUint32(0,!1),F=q.getUint32(4,!1),G=q.getUint32(8,!1),ue=q.getUint32(12,!1);const le=[];for(let K=0;K<128;K++)le.push({s0:p(b),s1:p(F),s2:p(G),s3:p(ue)}),{s0:b,s1:F,s2:G,s3:ue}=d(b,F,G,ue);const X=C(k||1024);if(![1,2,4,8].includes(X))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=X;const de=128/X,ye=this.windowSize=2**X,he=[];for(let K=0;K<de;K++)for(let B=0;B<ye;B++){let L=0,$=0,T=0,N=0;for(let j=0;j<X;j++){if(!(B>>>X-j-1&1))continue;const{s0:Z,s1:z,s2:fe,s3:te}=le[X*K+j];L^=Z,$^=z,T^=fe,N^=te}he.push({s0:L,s1:$,s2:T,s3:N})}this.t=he}_updateBlock(M,k,q,b){M^=this.s0,k^=this.s1,q^=this.s2,b^=this.s3;const{W:F,t:G,windowSize:ue}=this;let le=0,X=0,se=0,de=0;const ye=(1<<F)-1;let he=0;for(const K of[M,k,q,b])for(let B=0;B<4;B++){const L=K>>>8*B&255;for(let $=8/F-1;$>=0;$--){const T=L>>>F*$&ye,{s0:N,s1:j,s2:Y,s3:Z}=G[he*ue+T];le^=N,X^=j,se^=Y,de^=Z,he+=1}}this.s0=le,this.s1=X,this.s2=se,this.s3=de}update(M){(0,h.aexists)(this),M=(0,h.toBytes)(M),(0,h.abytes)(M);const k=(0,h.u32)(M),q=Math.floor(M.length/w),b=M.length%w;for(let F=0;F<q;F++)this._updateBlock(k[F*4+0],k[F*4+1],k[F*4+2],k[F*4+3]);return b&&(E.set(M.subarray(q*w)),this._updateBlock(v[0],v[1],v[2],v[3]),(0,h.clean)(v)),this}destroy(){const{t:M}=this;for(const k of M)k.s0=0,k.s1=0,k.s2=0,k.s3=0}digestInto(M){(0,h.aexists)(this),(0,h.aoutput)(M,this),this.finished=!0;const{s0:k,s1:q,s2:b,s3:F}=this,G=(0,h.u32)(M);return G[0]=k,G[1]=q,G[2]=b,G[3]=F,M}digest(){const M=new Uint8Array(w);return this.digestInto(M),this.destroy(),M}}class R extends x{constructor(M,k){M=(0,h.toBytes)(M),(0,h.abytes)(M);const q=m((0,h.copyBytes)(M));super(q,k),(0,h.clean)(q)}update(M){M=(0,h.toBytes)(M),(0,h.aexists)(this);const k=(0,h.u32)(M),q=M.length%w,b=Math.floor(M.length/w);for(let F=0;F<b;F++)this._updateBlock(p(k[F*4+3]),p(k[F*4+2]),p(k[F*4+1]),p(k[F*4+0]));return q&&(E.set(M.subarray(b*w)),this._updateBlock(p(v[3]),p(v[2]),p(v[1]),p(v[0])),(0,h.clean)(v)),this}digestInto(M){(0,h.aexists)(this),(0,h.aoutput)(M,this),this.finished=!0;const{s0:k,s1:q,s2:b,s3:F}=this,G=(0,h.u32)(M);return G[0]=k,G[1]=q,G[2]=b,G[3]=F,M.reverse()}}function S(O){const M=(q,b)=>O(b,q.length).update((0,h.toBytes)(q)).digest(),k=O(new Uint8Array(16),0);return M.outputLen=k.outputLen,M.blockLen=k.blockLen,M.create=(q,b)=>O(q,b),M}f.ghash=S((O,M)=>new x(O,M)),f.polyval=S((O,M)=>new R(O,M))},3035:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.unsafe=f.aeskwp=f.aeskw=f.siv=f.gcmsiv=f.gcm=f.cfb=f.cbc=f.ecb=f.ctr=void 0;const h=_(73840),w=_(7837),E=16,v=4,c=new Uint8Array(E),d=283;function p(te){return te<<1^d&-(te>>7)}function m(te,H){let Q=0;for(;H>0;H>>=1)Q^=te&-(H&1),te=p(te);return Q}const C=(()=>{const te=new Uint8Array(256);for(let Q=0,oe=1;Q<256;Q++,oe^=p(oe))te[Q]=oe;const H=new Uint8Array(256);H[0]=99;for(let Q=0;Q<255;Q++){let oe=te[255-Q];oe|=oe<<8,H[te[Q]]=(oe^oe>>4^oe>>5^oe>>6^oe>>7^99)&255}return(0,w.clean)(te),H})(),x=C.map((te,H)=>C.indexOf(H)),R=te=>te<<24|te>>>8,S=te=>te<<8|te>>>24,O=te=>te<<24&4278190080|te<<8&16711680|te>>>8&65280|te>>>24&255;function M(te,H){if(te.length!==256)throw new Error("Wrong sbox length");const Q=new Uint32Array(256).map((me,Ke)=>H(te[Ke])),oe=Q.map(S),_e=oe.map(S),ge=_e.map(S),be=new Uint32Array(256*256),we=new Uint32Array(256*256),Ee=new Uint16Array(256*256);for(let me=0;me<256;me++)for(let Ke=0;Ke<256;Ke++){const He=me*256+Ke;be[He]=Q[me]^oe[Ke],we[He]=_e[me]^ge[Ke],Ee[He]=te[me]<<8|te[Ke]}return{sbox:te,sbox2:Ee,T0:Q,T1:oe,T2:_e,T3:ge,T01:be,T23:we}}const k=M(C,te=>m(te,3)<<24|te<<16|te<<8|m(te,2)),q=M(x,te=>m(te,11)<<24|m(te,13)<<16|m(te,9)<<8|m(te,14)),b=(()=>{const te=new Uint8Array(16);for(let H=0,Q=1;H<16;H++,Q=p(Q))te[H]=Q;return te})();function F(te){(0,w.abytes)(te);const H=te.length;if(![16,24,32].includes(H))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+H);const{sbox2:Q}=k,oe=[];(0,w.isAligned32)(te)||oe.push(te=(0,w.copyBytes)(te));const _e=(0,w.u32)(te),ge=_e.length,be=Ee=>le(Q,Ee,Ee,Ee,Ee),we=new Uint32Array(H+28);we.set(_e);for(let Ee=ge;Ee<we.length;Ee++){let me=we[Ee-1];Ee%ge===0?me=be(R(me))^b[Ee/ge-1]:ge>6&&Ee%ge===4&&(me=be(me)),we[Ee]=we[Ee-ge]^me}return(0,w.clean)(...oe),we}function G(te){const H=F(te),Q=H.slice(),oe=H.length,{sbox2:_e}=k,{T0:ge,T1:be,T2:we,T3:Ee}=q;for(let me=0;me<oe;me+=4)for(let Ke=0;Ke<4;Ke++)Q[me+Ke]=H[oe-me-4+Ke];(0,w.clean)(H);for(let me=4;me<oe-4;me++){const Ke=Q[me],He=le(_e,Ke,Ke,Ke,Ke);Q[me]=ge[He&255]^be[He>>>8&255]^we[He>>>16&255]^Ee[He>>>24]}return Q}function ue(te,H,Q,oe,_e,ge){return te[Q<<8&65280|oe>>>8&255]^H[_e>>>8&65280|ge>>>24&255]}function le(te,H,Q,oe,_e){return te[H&255|Q&65280]|te[oe>>>16&255|_e>>>16&65280]<<16}function X(te,H,Q,oe,_e){const{sbox2:ge,T01:be,T23:we}=k;let Ee=0;H^=te[Ee++],Q^=te[Ee++],oe^=te[Ee++],_e^=te[Ee++];const me=te.length/4-2;for(let Ge=0;Ge<me;Ge++){const Be=te[Ee++]^ue(be,we,H,Q,oe,_e),We=te[Ee++]^ue(be,we,Q,oe,_e,H),Ze=te[Ee++]^ue(be,we,oe,_e,H,Q),_t=te[Ee++]^ue(be,we,_e,H,Q,oe);H=Be,Q=We,oe=Ze,_e=_t}const Ke=te[Ee++]^le(ge,H,Q,oe,_e),He=te[Ee++]^le(ge,Q,oe,_e,H),Ie=te[Ee++]^le(ge,oe,_e,H,Q),Le=te[Ee++]^le(ge,_e,H,Q,oe);return{s0:Ke,s1:He,s2:Ie,s3:Le}}function se(te,H,Q,oe,_e){const{sbox2:ge,T01:be,T23:we}=q;let Ee=0;H^=te[Ee++],Q^=te[Ee++],oe^=te[Ee++],_e^=te[Ee++];const me=te.length/4-2;for(let Ge=0;Ge<me;Ge++){const Be=te[Ee++]^ue(be,we,H,_e,oe,Q),We=te[Ee++]^ue(be,we,Q,H,_e,oe),Ze=te[Ee++]^ue(be,we,oe,Q,H,_e),_t=te[Ee++]^ue(be,we,_e,oe,Q,H);H=Be,Q=We,oe=Ze,_e=_t}const Ke=te[Ee++]^le(ge,H,_e,oe,Q),He=te[Ee++]^le(ge,Q,H,_e,oe),Ie=te[Ee++]^le(ge,oe,Q,H,_e),Le=te[Ee++]^le(ge,_e,oe,Q,H);return{s0:Ke,s1:He,s2:Ie,s3:Le}}function de(te,H,Q,oe){(0,w.abytes)(H,E),(0,w.abytes)(Q);const _e=Q.length;oe=(0,w.getOutput)(_e,oe),(0,w.complexOverlapBytes)(Q,oe);const ge=H,be=(0,w.u32)(ge);let{s0:we,s1:Ee,s2:me,s3:Ke}=X(te,be[0],be[1],be[2],be[3]);const He=(0,w.u32)(Q),Ie=(0,w.u32)(oe);for(let Ge=0;Ge+4<=He.length;Ge+=4){Ie[Ge+0]=He[Ge+0]^we,Ie[Ge+1]=He[Ge+1]^Ee,Ie[Ge+2]=He[Ge+2]^me,Ie[Ge+3]=He[Ge+3]^Ke;let Be=1;for(let We=ge.length-1;We>=0;We--)Be=Be+(ge[We]&255)|0,ge[We]=Be&255,Be>>>=8;({s0:we,s1:Ee,s2:me,s3:Ke}=X(te,be[0],be[1],be[2],be[3]))}const Le=E*Math.floor(He.length/v);if(Le<_e){const Ge=new Uint32Array([we,Ee,me,Ke]),Be=(0,w.u8)(Ge);for(let We=Le,Ze=0;We<_e;We++,Ze++)oe[We]=Q[We]^Be[Ze];(0,w.clean)(Ge)}return oe}function ye(te,H,Q,oe,_e){(0,w.abytes)(Q,E),(0,w.abytes)(oe),_e=(0,w.getOutput)(oe.length,_e);const ge=Q,be=(0,w.u32)(ge),we=(0,w.createView)(ge),Ee=(0,w.u32)(oe),me=(0,w.u32)(_e),Ke=H?0:12,He=oe.length;let Ie=we.getUint32(Ke,H),{s0:Le,s1:Ge,s2:Be,s3:We}=X(te,be[0],be[1],be[2],be[3]);for(let _t=0;_t+4<=Ee.length;_t+=4)me[_t+0]=Ee[_t+0]^Le,me[_t+1]=Ee[_t+1]^Ge,me[_t+2]=Ee[_t+2]^Be,me[_t+3]=Ee[_t+3]^We,Ie=Ie+1>>>0,we.setUint32(Ke,Ie,H),{s0:Le,s1:Ge,s2:Be,s3:We}=X(te,be[0],be[1],be[2],be[3]);const Ze=E*Math.floor(Ee.length/v);if(Ze<He){const _t=new Uint32Array([Le,Ge,Be,We]),Ft=(0,w.u8)(_t);for(let gt=Ze,lt=0;gt<He;gt++,lt++)_e[gt]=oe[gt]^Ft[lt];(0,w.clean)(_t)}return _e}f.ctr=(0,w.wrapCipher)({blockSize:16,nonceLength:16},function(H,Q){function oe(_e,ge){if((0,w.abytes)(_e),ge!==void 0&&((0,w.abytes)(ge),!(0,w.isAligned32)(ge)))throw new Error("unaligned destination");const be=F(H),we=(0,w.copyBytes)(Q),Ee=[be,we];(0,w.isAligned32)(_e)||Ee.push(_e=(0,w.copyBytes)(_e));const me=de(be,we,_e,ge);return(0,w.clean)(...Ee),me}return{encrypt:(_e,ge)=>oe(_e,ge),decrypt:(_e,ge)=>oe(_e,ge)}});function he(te){if((0,w.abytes)(te),te.length%E!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size "+E)}function K(te,H,Q){(0,w.abytes)(te);let oe=te.length;const _e=oe%E;if(!H&&_e!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,w.isAligned32)(te)||(te=(0,w.copyBytes)(te));const ge=(0,w.u32)(te);if(H){let we=E-_e;we||(we=E),oe=oe+we}Q=(0,w.getOutput)(oe,Q),(0,w.complexOverlapBytes)(te,Q);const be=(0,w.u32)(Q);return{b:ge,o:be,out:Q}}function B(te,H){if(!H)return te;const Q=te.length;if(!Q)throw new Error("aes/pcks5: empty ciphertext not allowed");const oe=te[Q-1];if(oe<=0||oe>16)throw new Error("aes/pcks5: wrong padding");const _e=te.subarray(0,-oe);for(let ge=0;ge<oe;ge++)if(te[Q-ge-1]!==oe)throw new Error("aes/pcks5: wrong padding");return _e}function L(te){const H=new Uint8Array(16),Q=(0,w.u32)(H);H.set(te);const oe=E-te.length;for(let _e=E-oe;_e<E;_e++)H[_e]=oe;return Q}f.ecb=(0,w.wrapCipher)({blockSize:16},function(H,Q={}){const oe=!Q.disablePadding;return{encrypt(_e,ge){const{b:be,o:we,out:Ee}=K(_e,oe,ge),me=F(H);let Ke=0;for(;Ke+4<=be.length;){const{s0:He,s1:Ie,s2:Le,s3:Ge}=X(me,be[Ke+0],be[Ke+1],be[Ke+2],be[Ke+3]);we[Ke++]=He,we[Ke++]=Ie,we[Ke++]=Le,we[Ke++]=Ge}if(oe){const He=L(_e.subarray(Ke*4)),{s0:Ie,s1:Le,s2:Ge,s3:Be}=X(me,He[0],He[1],He[2],He[3]);we[Ke++]=Ie,we[Ke++]=Le,we[Ke++]=Ge,we[Ke++]=Be}return(0,w.clean)(me),Ee},decrypt(_e,ge){he(_e);const be=G(H);ge=(0,w.getOutput)(_e.length,ge);const we=[be];(0,w.isAligned32)(_e)||we.push(_e=(0,w.copyBytes)(_e)),(0,w.complexOverlapBytes)(_e,ge);const Ee=(0,w.u32)(_e),me=(0,w.u32)(ge);for(let Ke=0;Ke+4<=Ee.length;){const{s0:He,s1:Ie,s2:Le,s3:Ge}=se(be,Ee[Ke+0],Ee[Ke+1],Ee[Ke+2],Ee[Ke+3]);me[Ke++]=He,me[Ke++]=Ie,me[Ke++]=Le,me[Ke++]=Ge}return(0,w.clean)(...we),B(ge,oe)}}}),f.cbc=(0,w.wrapCipher)({blockSize:16,nonceLength:16},function(H,Q,oe={}){const _e=!oe.disablePadding;return{encrypt(ge,be){const we=F(H),{b:Ee,o:me,out:Ke}=K(ge,_e,be);let He=Q;const Ie=[we];(0,w.isAligned32)(He)||Ie.push(He=(0,w.copyBytes)(He));const Le=(0,w.u32)(He);let Ge=Le[0],Be=Le[1],We=Le[2],Ze=Le[3],_t=0;for(;_t+4<=Ee.length;)Ge^=Ee[_t+0],Be^=Ee[_t+1],We^=Ee[_t+2],Ze^=Ee[_t+3],{s0:Ge,s1:Be,s2:We,s3:Ze}=X(we,Ge,Be,We,Ze),me[_t++]=Ge,me[_t++]=Be,me[_t++]=We,me[_t++]=Ze;if(_e){const Ft=L(ge.subarray(_t*4));Ge^=Ft[0],Be^=Ft[1],We^=Ft[2],Ze^=Ft[3],{s0:Ge,s1:Be,s2:We,s3:Ze}=X(we,Ge,Be,We,Ze),me[_t++]=Ge,me[_t++]=Be,me[_t++]=We,me[_t++]=Ze}return(0,w.clean)(...Ie),Ke},decrypt(ge,be){he(ge);const we=G(H);let Ee=Q;const me=[we];(0,w.isAligned32)(Ee)||me.push(Ee=(0,w.copyBytes)(Ee));const Ke=(0,w.u32)(Ee);be=(0,w.getOutput)(ge.length,be),(0,w.isAligned32)(ge)||me.push(ge=(0,w.copyBytes)(ge)),(0,w.complexOverlapBytes)(ge,be);const He=(0,w.u32)(ge),Ie=(0,w.u32)(be);let Le=Ke[0],Ge=Ke[1],Be=Ke[2],We=Ke[3];for(let Ze=0;Ze+4<=He.length;){const _t=Le,Ft=Ge,gt=Be,lt=We;Le=He[Ze+0],Ge=He[Ze+1],Be=He[Ze+2],We=He[Ze+3];const{s0:dt,s1:tt,s2:rt,s3:ke}=se(we,Le,Ge,Be,We);Ie[Ze++]=dt^_t,Ie[Ze++]=tt^Ft,Ie[Ze++]=rt^gt,Ie[Ze++]=ke^lt}return(0,w.clean)(...me),B(be,_e)}}}),f.cfb=(0,w.wrapCipher)({blockSize:16,nonceLength:16},function(H,Q){function oe(_e,ge,be){(0,w.abytes)(_e);const we=_e.length;if(be=(0,w.getOutput)(we,be),(0,w.overlapBytes)(_e,be))throw new Error("overlapping src and dst not supported.");const Ee=F(H);let me=Q;const Ke=[Ee];(0,w.isAligned32)(me)||Ke.push(me=(0,w.copyBytes)(me)),(0,w.isAligned32)(_e)||Ke.push(_e=(0,w.copyBytes)(_e));const He=(0,w.u32)(_e),Ie=(0,w.u32)(be),Le=ge?Ie:He,Ge=(0,w.u32)(me);let Be=Ge[0],We=Ge[1],Ze=Ge[2],_t=Ge[3];for(let gt=0;gt+4<=He.length;){const{s0:lt,s1:dt,s2:tt,s3:rt}=X(Ee,Be,We,Ze,_t);Ie[gt+0]=He[gt+0]^lt,Ie[gt+1]=He[gt+1]^dt,Ie[gt+2]=He[gt+2]^tt,Ie[gt+3]=He[gt+3]^rt,Be=Le[gt++],We=Le[gt++],Ze=Le[gt++],_t=Le[gt++]}const Ft=E*Math.floor(He.length/v);if(Ft<we){({s0:Be,s1:We,s2:Ze,s3:_t}=X(Ee,Be,We,Ze,_t));const gt=(0,w.u8)(new Uint32Array([Be,We,Ze,_t]));for(let lt=Ft,dt=0;lt<we;lt++,dt++)be[lt]=_e[lt]^gt[dt];(0,w.clean)(gt)}return(0,w.clean)(...Ke),be}return{encrypt:(_e,ge)=>oe(_e,!0,ge),decrypt:(_e,ge)=>oe(_e,!1,ge)}});function $(te,H,Q,oe,_e){const ge=_e?_e.length:0,be=te.create(Q,oe.length+ge);_e&&be.update(_e);const we=(0,w.u64Lengths)(8*oe.length,8*ge,H);be.update(oe),be.update(we);const Ee=be.digest();return(0,w.clean)(we),Ee}f.gcm=(0,w.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(H,Q,oe){if(Q.length<8)throw new Error("aes/gcm: invalid nonce length");const _e=16;function ge(we,Ee,me){const Ke=$(h.ghash,!1,we,me,oe);for(let He=0;He<Ee.length;He++)Ke[He]^=Ee[He];return Ke}function be(){const we=F(H),Ee=c.slice(),me=c.slice();if(ye(we,!1,me,me,Ee),Q.length===12)me.set(Q);else{const He=c.slice(),Ie=(0,w.createView)(He);(0,w.setBigUint64)(Ie,8,BigInt(Q.length*8),!1);const Le=h.ghash.create(Ee).update(Q).update(He);Le.digestInto(me),Le.destroy()}const Ke=ye(we,!1,me,c);return{xk:we,authKey:Ee,counter:me,tagMask:Ke}}return{encrypt(we){const{xk:Ee,authKey:me,counter:Ke,tagMask:He}=be(),Ie=new Uint8Array(we.length+_e),Le=[Ee,me,Ke,He];(0,w.isAligned32)(we)||Le.push(we=(0,w.copyBytes)(we)),ye(Ee,!1,Ke,we,Ie.subarray(0,we.length));const Ge=ge(me,He,Ie.subarray(0,Ie.length-_e));return Le.push(Ge),Ie.set(Ge,we.length),(0,w.clean)(...Le),Ie},decrypt(we){const{xk:Ee,authKey:me,counter:Ke,tagMask:He}=be(),Ie=[Ee,me,He,Ke];(0,w.isAligned32)(we)||Ie.push(we=(0,w.copyBytes)(we));const Le=we.subarray(0,-_e),Ge=we.subarray(-_e),Be=ge(me,He,Le);if(Ie.push(Be),!(0,w.equalBytes)(Be,Ge))throw new Error("aes/gcm: invalid ghash tag");const We=ye(Ee,!1,Ke,Le);return(0,w.clean)(...Ie),We}}});const T=(te,H,Q)=>oe=>{if(!Number.isSafeInteger(oe)||H>oe||oe>Q){const _e="["+H+".."+Q+"]";throw new Error(""+te+": expected value in range "+_e+", got "+oe)}};f.gcmsiv=(0,w.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(H,Q,oe){const ge=T("AAD",0,68719476736),be=T("plaintext",0,2**36),we=T("nonce",12,12),Ee=T("ciphertext",16,2**36+16);(0,w.abytes)(H,16,24,32),we(Q.length),oe!==void 0&&ge(oe.length);function me(){const Ie=F(H),Le=new Uint8Array(H.length),Ge=new Uint8Array(16),Be=[Ie,Le];let We=Q;(0,w.isAligned32)(We)||Be.push(We=(0,w.copyBytes)(We));const Ze=(0,w.u32)(We);let _t=0,Ft=Ze[0],gt=Ze[1],lt=Ze[2],dt=0;for(const rt of[Ge,Le].map(w.u32)){const ke=(0,w.u32)(rt);for(let xe=0;xe<ke.length;xe+=2){const{s0:Pe,s1:it}=X(Ie,_t,Ft,gt,lt);ke[xe+0]=Pe,ke[xe+1]=it,_t=++dt}}const tt={authKey:Ge,encKey:F(Le)};return(0,w.clean)(...Be),tt}function Ke(Ie,Le,Ge){const Be=$(h.polyval,!0,Le,Ge,oe);for(let lt=0;lt<12;lt++)Be[lt]^=Q[lt];Be[15]&=127;const We=(0,w.u32)(Be);let Ze=We[0],_t=We[1],Ft=We[2],gt=We[3];return{s0:Ze,s1:_t,s2:Ft,s3:gt}=X(Ie,Ze,_t,Ft,gt),We[0]=Ze,We[1]=_t,We[2]=Ft,We[3]=gt,Be}function He(Ie,Le,Ge){let Be=(0,w.copyBytes)(Le);Be[15]|=128;const We=ye(Ie,!0,Be,Ge);return(0,w.clean)(Be),We}return{encrypt(Ie){be(Ie.length);const{encKey:Le,authKey:Ge}=me(),Be=Ke(Le,Ge,Ie),We=[Le,Ge,Be];(0,w.isAligned32)(Ie)||We.push(Ie=(0,w.copyBytes)(Ie));const Ze=new Uint8Array(Ie.length+16);return Ze.set(Be,Ie.length),Ze.set(He(Le,Be,Ie)),(0,w.clean)(...We),Ze},decrypt(Ie){Ee(Ie.length);const Le=Ie.subarray(-16),{encKey:Ge,authKey:Be}=me(),We=[Ge,Be];(0,w.isAligned32)(Ie)||We.push(Ie=(0,w.copyBytes)(Ie));const Ze=He(Ge,Le,Ie.subarray(0,-16)),_t=Ke(Ge,Be,Ze);if(We.push(_t),!(0,w.equalBytes)(Le,_t))throw(0,w.clean)(...We),new Error("invalid polyval tag");return(0,w.clean)(...We),Ze}}}),f.siv=f.gcmsiv;function N(te){return te instanceof Uint32Array||ArrayBuffer.isView(te)&&te.constructor.name==="Uint32Array"}function j(te,H){if((0,w.abytes)(H,16),!N(te))throw new Error("_encryptBlock accepts result of expandKeyLE");const Q=(0,w.u32)(H);let{s0:oe,s1:_e,s2:ge,s3:be}=X(te,Q[0],Q[1],Q[2],Q[3]);return Q[0]=oe,Q[1]=_e,Q[2]=ge,Q[3]=be,H}function Y(te,H){if((0,w.abytes)(H,16),!N(te))throw new Error("_decryptBlock accepts result of expandKeyLE");const Q=(0,w.u32)(H);let{s0:oe,s1:_e,s2:ge,s3:be}=se(te,Q[0],Q[1],Q[2],Q[3]);return Q[0]=oe,Q[1]=_e,Q[2]=ge,Q[3]=be,H}const Z={encrypt(te,H){if(H.length>=2**32)throw new Error("plaintext should be less than 4gb");const Q=F(te);if(H.length===16)j(Q,H);else{const oe=(0,w.u32)(H);let _e=oe[0],ge=oe[1];for(let be=0,we=1;be<6;be++)for(let Ee=2;Ee<oe.length;Ee+=2,we++){const{s0:me,s1:Ke,s2:He,s3:Ie}=X(Q,_e,ge,oe[Ee],oe[Ee+1]);_e=me,ge=Ke^O(we),oe[Ee]=He,oe[Ee+1]=Ie}oe[0]=_e,oe[1]=ge}Q.fill(0)},decrypt(te,H){if(H.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");const Q=G(te),oe=H.length/8-1;if(oe===1)Y(Q,H);else{const _e=(0,w.u32)(H);let ge=_e[0],be=_e[1];for(let we=0,Ee=oe*6;we<6;we++)for(let me=oe*2;me>=1;me-=2,Ee--){be^=O(Ee);const{s0:Ke,s1:He,s2:Ie,s3:Le}=se(Q,ge,be,_e[me],_e[me+1]);ge=Ke,be=He,_e[me]=Ie,_e[me+1]=Le}_e[0]=ge,_e[1]=be}Q.fill(0)}},z=new Uint8Array(8).fill(166);f.aeskw=(0,w.wrapCipher)({blockSize:8},te=>({encrypt(H){if(!H.length||H.length%8!==0)throw new Error("invalid plaintext length");if(H.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");const Q=(0,w.concatBytes)(z,H);return Z.encrypt(te,Q),Q},decrypt(H){if(H.length%8!==0||H.length<24)throw new Error("invalid ciphertext length");const Q=(0,w.copyBytes)(H);if(Z.decrypt(te,Q),!(0,w.equalBytes)(Q.subarray(0,8),z))throw new Error("integrity check failed");return Q.subarray(0,8).fill(0),Q.subarray(8)}}));const fe=2790873510;f.aeskwp=(0,w.wrapCipher)({blockSize:8},te=>({encrypt(H){if(!H.length)throw new Error("invalid plaintext length");const Q=Math.ceil(H.length/8)*8,oe=new Uint8Array(8+Q);oe.set(H,8);const _e=(0,w.u32)(oe);return _e[0]=fe,_e[1]=O(H.length),Z.encrypt(te,oe),oe},decrypt(H){if(H.length<16)throw new Error("invalid ciphertext length");const Q=(0,w.copyBytes)(H),oe=(0,w.u32)(Q);Z.decrypt(te,Q);const _e=O(oe[1])>>>0,ge=Math.ceil(_e/8)*8;if(oe[0]!==fe||Q.length-8!==ge)throw new Error("integrity check failed");for(let be=_e;be<ge;be++)if(Q[8+be]!==0)throw new Error("integrity check failed");return Q.subarray(0,8).fill(0),Q.subarray(8,8+_e)}})),f.unsafe={expandKeyLE:F,expandKeyDecLE:G,encrypt:X,decrypt:se,encryptBlock:j,decryptBlock:Y,ctrCounter:de,ctr32:ye}},59946:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.xchacha20poly1305=f.chacha20poly1305=f._poly1305_aead=f.chacha12=f.chacha8=f.xchacha20=f.chacha20=f.chacha20orig=void 0,f.hchacha=c;const h=_(78e3),w=_(20720),E=_(7837);function v(R,S,O,M,k,q=20){let b=R[0],F=R[1],G=R[2],ue=R[3],le=S[0],X=S[1],se=S[2],de=S[3],ye=S[4],he=S[5],K=S[6],B=S[7],L=k,$=O[0],T=O[1],N=O[2],j=b,Y=F,Z=G,z=ue,fe=le,te=X,H=se,Q=de,oe=ye,_e=he,ge=K,be=B,we=L,Ee=$,me=T,Ke=N;for(let Ie=0;Ie<q;Ie+=2)j=j+fe|0,we=(0,h.rotl)(we^j,16),oe=oe+we|0,fe=(0,h.rotl)(fe^oe,12),j=j+fe|0,we=(0,h.rotl)(we^j,8),oe=oe+we|0,fe=(0,h.rotl)(fe^oe,7),Y=Y+te|0,Ee=(0,h.rotl)(Ee^Y,16),_e=_e+Ee|0,te=(0,h.rotl)(te^_e,12),Y=Y+te|0,Ee=(0,h.rotl)(Ee^Y,8),_e=_e+Ee|0,te=(0,h.rotl)(te^_e,7),Z=Z+H|0,me=(0,h.rotl)(me^Z,16),ge=ge+me|0,H=(0,h.rotl)(H^ge,12),Z=Z+H|0,me=(0,h.rotl)(me^Z,8),ge=ge+me|0,H=(0,h.rotl)(H^ge,7),z=z+Q|0,Ke=(0,h.rotl)(Ke^z,16),be=be+Ke|0,Q=(0,h.rotl)(Q^be,12),z=z+Q|0,Ke=(0,h.rotl)(Ke^z,8),be=be+Ke|0,Q=(0,h.rotl)(Q^be,7),j=j+te|0,Ke=(0,h.rotl)(Ke^j,16),ge=ge+Ke|0,te=(0,h.rotl)(te^ge,12),j=j+te|0,Ke=(0,h.rotl)(Ke^j,8),ge=ge+Ke|0,te=(0,h.rotl)(te^ge,7),Y=Y+H|0,we=(0,h.rotl)(we^Y,16),be=be+we|0,H=(0,h.rotl)(H^be,12),Y=Y+H|0,we=(0,h.rotl)(we^Y,8),be=be+we|0,H=(0,h.rotl)(H^be,7),Z=Z+Q|0,Ee=(0,h.rotl)(Ee^Z,16),oe=oe+Ee|0,Q=(0,h.rotl)(Q^oe,12),Z=Z+Q|0,Ee=(0,h.rotl)(Ee^Z,8),oe=oe+Ee|0,Q=(0,h.rotl)(Q^oe,7),z=z+fe|0,me=(0,h.rotl)(me^z,16),_e=_e+me|0,fe=(0,h.rotl)(fe^_e,12),z=z+fe|0,me=(0,h.rotl)(me^z,8),_e=_e+me|0,fe=(0,h.rotl)(fe^_e,7);let He=0;M[He++]=b+j|0,M[He++]=F+Y|0,M[He++]=G+Z|0,M[He++]=ue+z|0,M[He++]=le+fe|0,M[He++]=X+te|0,M[He++]=se+H|0,M[He++]=de+Q|0,M[He++]=ye+oe|0,M[He++]=he+_e|0,M[He++]=K+ge|0,M[He++]=B+be|0,M[He++]=L+we|0,M[He++]=$+Ee|0,M[He++]=T+me|0,M[He++]=N+Ke|0}function c(R,S,O,M){let k=R[0],q=R[1],b=R[2],F=R[3],G=S[0],ue=S[1],le=S[2],X=S[3],se=S[4],de=S[5],ye=S[6],he=S[7],K=O[0],B=O[1],L=O[2],$=O[3];for(let N=0;N<20;N+=2)k=k+G|0,K=(0,h.rotl)(K^k,16),se=se+K|0,G=(0,h.rotl)(G^se,12),k=k+G|0,K=(0,h.rotl)(K^k,8),se=se+K|0,G=(0,h.rotl)(G^se,7),q=q+ue|0,B=(0,h.rotl)(B^q,16),de=de+B|0,ue=(0,h.rotl)(ue^de,12),q=q+ue|0,B=(0,h.rotl)(B^q,8),de=de+B|0,ue=(0,h.rotl)(ue^de,7),b=b+le|0,L=(0,h.rotl)(L^b,16),ye=ye+L|0,le=(0,h.rotl)(le^ye,12),b=b+le|0,L=(0,h.rotl)(L^b,8),ye=ye+L|0,le=(0,h.rotl)(le^ye,7),F=F+X|0,$=(0,h.rotl)($^F,16),he=he+$|0,X=(0,h.rotl)(X^he,12),F=F+X|0,$=(0,h.rotl)($^F,8),he=he+$|0,X=(0,h.rotl)(X^he,7),k=k+ue|0,$=(0,h.rotl)($^k,16),ye=ye+$|0,ue=(0,h.rotl)(ue^ye,12),k=k+ue|0,$=(0,h.rotl)($^k,8),ye=ye+$|0,ue=(0,h.rotl)(ue^ye,7),q=q+le|0,K=(0,h.rotl)(K^q,16),he=he+K|0,le=(0,h.rotl)(le^he,12),q=q+le|0,K=(0,h.rotl)(K^q,8),he=he+K|0,le=(0,h.rotl)(le^he,7),b=b+X|0,B=(0,h.rotl)(B^b,16),se=se+B|0,X=(0,h.rotl)(X^se,12),b=b+X|0,B=(0,h.rotl)(B^b,8),se=se+B|0,X=(0,h.rotl)(X^se,7),F=F+G|0,L=(0,h.rotl)(L^F,16),de=de+L|0,G=(0,h.rotl)(G^de,12),F=F+G|0,L=(0,h.rotl)(L^F,8),de=de+L|0,G=(0,h.rotl)(G^de,7);let T=0;M[T++]=k,M[T++]=q,M[T++]=b,M[T++]=F,M[T++]=K,M[T++]=B,M[T++]=L,M[T++]=$}f.chacha20orig=(0,h.createCipher)(v,{counterRight:!1,counterLength:8,allowShortKeys:!0}),f.chacha20=(0,h.createCipher)(v,{counterRight:!1,counterLength:4,allowShortKeys:!1}),f.xchacha20=(0,h.createCipher)(v,{counterRight:!1,counterLength:8,extendNonceFn:c,allowShortKeys:!1}),f.chacha8=(0,h.createCipher)(v,{counterRight:!1,counterLength:4,rounds:8}),f.chacha12=(0,h.createCipher)(v,{counterRight:!1,counterLength:4,rounds:12});const d=new Uint8Array(16),p=(R,S)=>{R.update(S);const O=S.length%16;O&&R.update(d.subarray(O))},m=new Uint8Array(32);function C(R,S,O,M,k){const q=R(S,O,m),b=w.poly1305.create(q);k&&p(b,k),p(b,M);const F=(0,E.u64Lengths)(M.length,k?k.length:0,!0);b.update(F);const G=b.digest();return(0,E.clean)(q,F),G}const x=R=>(S,O,M)=>({encrypt(q,b){const F=q.length;b=(0,E.getOutput)(F+16,b,!1),b.set(q);const G=b.subarray(0,-16);R(S,O,G,G,1);const ue=C(R,S,O,G,M);return b.set(ue,F),(0,E.clean)(ue),b},decrypt(q,b){b=(0,E.getOutput)(q.length-16,b,!1);const F=q.subarray(0,-16),G=q.subarray(-16),ue=C(R,S,O,F,M);if(!(0,E.equalBytes)(G,ue))throw new Error("invalid tag");return b.set(q.subarray(0,-16)),R(S,O,b,b,1),(0,E.clean)(ue),b}});f._poly1305_aead=x,f.chacha20poly1305=(0,E.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,f._poly1305_aead)(f.chacha20)),f.xchacha20poly1305=(0,E.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,f._poly1305_aead)(f.xchacha20))},54675:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.crypto=void 0,f.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0},7837:function(ie,f){"use strict";/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */Object.defineProperty(f,"__esModule",{value:!0}),f.wrapCipher=f.Hash=f.nextTick=f.isLE=void 0,f.isBytes=_,f.abool=h,f.anumber=w,f.abytes=E,f.ahash=v,f.aexists=c,f.aoutput=d,f.u8=p,f.u32=m,f.clean=C,f.createView=x,f.bytesToHex=O,f.hexToBytes=q,f.hexToNumber=b,f.bytesToNumberBE=F,f.numberToBytesBE=G,f.utf8ToBytes=le,f.bytesToUtf8=X,f.toBytes=se,f.overlapBytes=de,f.complexOverlapBytes=ye,f.concatBytes=he,f.checkOpts=K,f.equalBytes=B,f.getOutput=T,f.setBigUint64=N,f.u64Lengths=j,f.isAligned32=Y,f.copyBytes=Z;function _(z){return z instanceof Uint8Array||ArrayBuffer.isView(z)&&z.constructor.name==="Uint8Array"}function h(z){if(typeof z!="boolean")throw new Error(`boolean expected, not ${z}`)}function w(z){if(!Number.isSafeInteger(z)||z<0)throw new Error("positive integer expected, got "+z)}function E(z,...fe){if(!_(z))throw new Error("Uint8Array expected");if(fe.length>0&&!fe.includes(z.length))throw new Error("Uint8Array expected of length "+fe+", got length="+z.length)}function v(z){if(typeof z!="function"||typeof z.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");w(z.outputLen),w(z.blockLen)}function c(z,fe=!0){if(z.destroyed)throw new Error("Hash instance has been destroyed");if(fe&&z.finished)throw new Error("Hash#digest() has already been called")}function d(z,fe){E(z);const te=fe.outputLen;if(z.length<te)throw new Error("digestInto() expects output buffer of length at least "+te)}function p(z){return new Uint8Array(z.buffer,z.byteOffset,z.byteLength)}function m(z){return new Uint32Array(z.buffer,z.byteOffset,Math.floor(z.byteLength/4))}function C(...z){for(let fe=0;fe<z.length;fe++)z[fe].fill(0)}function x(z){return new DataView(z.buffer,z.byteOffset,z.byteLength)}f.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const R=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",S=Array.from({length:256},(z,fe)=>fe.toString(16).padStart(2,"0"));function O(z){if(E(z),R)return z.toHex();let fe="";for(let te=0;te<z.length;te++)fe+=S[z[te]];return fe}const M={_0:48,_9:57,A:65,F:70,a:97,f:102};function k(z){if(z>=M._0&&z<=M._9)return z-M._0;if(z>=M.A&&z<=M.F)return z-(M.A-10);if(z>=M.a&&z<=M.f)return z-(M.a-10)}function q(z){if(typeof z!="string")throw new Error("hex string expected, got "+typeof z);if(R)return Uint8Array.fromHex(z);const fe=z.length,te=fe/2;if(fe%2)throw new Error("hex string expected, got unpadded hex of length "+fe);const H=new Uint8Array(te);for(let Q=0,oe=0;Q<te;Q++,oe+=2){const _e=k(z.charCodeAt(oe)),ge=k(z.charCodeAt(oe+1));if(_e===void 0||ge===void 0){const be=z[oe]+z[oe+1];throw new Error('hex string expected, got non-hex character "'+be+'" at index '+oe)}H[Q]=_e*16+ge}return H}function b(z){if(typeof z!="string")throw new Error("hex string expected, got "+typeof z);return BigInt(z===""?"0":"0x"+z)}function F(z){return b(O(z))}function G(z,fe){return q(z.toString(16).padStart(fe*2,"0"))}const ue=async()=>{};f.nextTick=ue;function le(z){if(typeof z!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(z))}function X(z){return new TextDecoder().decode(z)}function se(z){if(typeof z=="string")z=le(z);else if(_(z))z=Z(z);else throw new Error("Uint8Array expected, got "+typeof z);return z}function de(z,fe){return z.buffer===fe.buffer&&z.byteOffset<fe.byteOffset+fe.byteLength&&fe.byteOffset<z.byteOffset+z.byteLength}function ye(z,fe){if(de(z,fe)&&z.byteOffset<fe.byteOffset)throw new Error("complex overlap of input and output is not supported")}function he(...z){let fe=0;for(let H=0;H<z.length;H++){const Q=z[H];E(Q),fe+=Q.length}const te=new Uint8Array(fe);for(let H=0,Q=0;H<z.length;H++){const oe=z[H];te.set(oe,Q),Q+=oe.length}return te}function K(z,fe){if(fe==null||typeof fe!="object")throw new Error("options must be defined");return Object.assign(z,fe)}function B(z,fe){if(z.length!==fe.length)return!1;let te=0;for(let H=0;H<z.length;H++)te|=z[H]^fe[H];return te===0}class L{}f.Hash=L;const $=(z,fe)=>{function te(H,...Q){if(E(H),!f.isLE)throw new Error("Non little-endian hardware is not yet supported");if(z.nonceLength!==void 0){const Ee=Q[0];if(!Ee)throw new Error("nonce / iv required");z.varSizeNonce?E(Ee):E(Ee,z.nonceLength)}const oe=z.tagLength;oe&&Q[1]!==void 0&&E(Q[1]);const _e=fe(H,...Q),ge=(Ee,me)=>{if(me!==void 0){if(Ee!==2)throw new Error("cipher output not supported");E(me)}};let be=!1;return{encrypt(Ee,me){if(be)throw new Error("cannot encrypt() twice with same key + nonce");return be=!0,E(Ee),ge(_e.encrypt.length,me),_e.encrypt(Ee,me)},decrypt(Ee,me){if(E(Ee),oe&&Ee.length<oe)throw new Error("invalid ciphertext length: smaller than tagLength="+oe);return ge(_e.decrypt.length,me),_e.decrypt(Ee,me)}}}return Object.assign(te,z),te};f.wrapCipher=$;function T(z,fe,te=!0){if(fe===void 0)return new Uint8Array(z);if(fe.length!==z)throw new Error("invalid output length, expected "+z+", got: "+fe.length);if(te&&!Y(fe))throw new Error("invalid output, must be aligned");return fe}function N(z,fe,te,H){if(typeof z.setBigUint64=="function")return z.setBigUint64(fe,te,H);const Q=BigInt(32),oe=BigInt(4294967295),_e=Number(te>>Q&oe),ge=Number(te&oe),be=H?4:0,we=H?0:4;z.setUint32(fe+be,_e,H),z.setUint32(fe+we,ge,H)}function j(z,fe,te){h(te);const H=new Uint8Array(16),Q=x(H);return N(Q,0,BigInt(fe),te),N(Q,8,BigInt(z),te),H}function Y(z){return z.byteOffset%4===0}function Z(z){return Uint8Array.from(z)}},93127:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.gcm=f.ctr=f.cbc=f.utils=void 0,f.randomBytes=E,f.getWebcryptoSubtle=v,f.managedNonce=c;const h=_(54675),w=_(7837);function E(C=32){if(h.crypto&&typeof h.crypto.getRandomValues=="function")return h.crypto.getRandomValues(new Uint8Array(C));if(h.crypto&&typeof h.crypto.randomBytes=="function")return Uint8Array.from(h.crypto.randomBytes(C));throw new Error("crypto.getRandomValues must be defined")}function v(){if(h.crypto&&typeof h.crypto.subtle=="object"&&h.crypto.subtle!=null)return h.crypto.subtle;throw new Error("crypto.subtle must be defined")}function c(C){const{nonceLength:x}=C;return(0,w.anumber)(x),(R,...S)=>({encrypt(O,...M){const k=E(x),q=C(R,k,...S).encrypt(O,...M),b=(0,w.concatBytes)(k,q);return q.fill(0),b},decrypt(O,...M){const k=O.subarray(0,x),q=O.subarray(x);return C(R,k,...S).decrypt(q,...M)}})}f.utils={async encrypt(C,x,R,S){const O=v(),M=await O.importKey("raw",C,x,!0,["encrypt"]),k=await O.encrypt(R,M,S);return new Uint8Array(k)},async decrypt(C,x,R,S){const O=v(),M=await O.importKey("raw",C,x,!0,["decrypt"]),k=await O.decrypt(R,M,S);return new Uint8Array(k)}};const d={CBC:"AES-CBC",CTR:"AES-CTR",GCM:"AES-GCM"};function p(C,x,R){if(C===d.CBC)return{name:d.CBC,iv:x};if(C===d.CTR)return{name:d.CTR,counter:x,length:64};if(C===d.GCM)return R?{name:d.GCM,iv:x,additionalData:R}:{name:d.GCM,iv:x};throw new Error("unknown aes block mode")}function m(C){return(x,R,S)=>{(0,w.abytes)(x),(0,w.abytes)(R);const O={name:C,length:x.length*8},M=p(C,R,S);let k=!1;return{encrypt(q){if((0,w.abytes)(q),k)throw new Error("Cannot encrypt() twice with same key / nonce");return k=!0,f.utils.encrypt(x,O,M,q)},decrypt(q){return(0,w.abytes)(q),f.utils.decrypt(x,O,M,q)}}}}f.cbc=m(d.CBC),f.ctr=m(d.CTR),f.gcm=m(d.GCM)},9171:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getHash=v,f.createCurve=c;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(53026),w=_(49724),E=_(17670);function v(d){return{hash:d,hmac:(p,...m)=>(0,h.hmac)(d,p,(0,w.concatBytes)(...m)),randomBytes:w.randomBytes}}function c(d,p){const m=C=>(0,E.weierstrass)({...d,...v(C)});return Object.freeze({...m(p),create:m})}},11189:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.wNAF=c,f.validateBasic=d;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(54136),w=_(15939),E=BigInt(0),v=BigInt(1);function c(p,m){const C=(R,S)=>{const O=S.negate();return R?O:S},x=R=>{const S=Math.ceil(m/R)+1,O=2**(R-1);return{windows:S,windowSize:O}};return{constTimeNegate:C,unsafeLadder(R,S){let O=p.ZERO,M=R;for(;S>E;)S&v&&(O=O.add(M)),M=M.double(),S>>=v;return O},precomputeWindow(R,S){const{windows:O,windowSize:M}=x(S),k=[];let q=R,b=q;for(let F=0;F<O;F++){b=q,k.push(b);for(let G=1;G<M;G++)b=b.add(q),k.push(b);q=b.double()}return k},wNAF(R,S,O){const{windows:M,windowSize:k}=x(R);let q=p.ZERO,b=p.BASE;const F=BigInt(2**R-1),G=2**R,ue=BigInt(R);for(let le=0;le<M;le++){const X=le*k;let se=Number(O&F);O>>=ue,se>k&&(se-=G,O+=v);const de=X,ye=X+Math.abs(se)-1,he=le%2!==0,K=se<0;se===0?b=b.add(C(he,S[de])):q=q.add(C(K,S[ye]))}return{p:q,f:b}},wNAFCached(R,S,O,M){const k=R._WINDOW_SIZE||1;let q=S.get(R);return q||(q=this.precomputeWindow(R,k),k!==1&&S.set(R,M(q))),this.wNAF(k,q,O)}}}function d(p){return(0,h.validateField)(p.Fp),(0,w.validateObject)(p,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,h.nLength)(p.n,p.nBitLength),...p,p:p.Fp.ORDER})}},20418:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.expand_message_xmd=p,f.expand_message_xof=m,f.hash_to_field=C,f.isogenyMap=x,f.createHasher=R;const h=_(54136),w=_(15939),E=w.bytesToNumberBE;function v(S,O){if(S<0||S>=1<<8*O)throw new Error(`bad I2OSP call: value=${S} length=${O}`);const M=Array.from({length:O}).fill(0);for(let k=O-1;k>=0;k--)M[k]=S&255,S>>>=8;return new Uint8Array(M)}function c(S,O){const M=new Uint8Array(S.length);for(let k=0;k<S.length;k++)M[k]=S[k]^O[k];return M}function d(S){if(!Number.isSafeInteger(S))throw new Error("number expected")}function p(S,O,M,k){(0,w.abytes)(S),(0,w.abytes)(O),d(M),O.length>255&&(O=k((0,w.concatBytes)((0,w.utf8ToBytes)("H2C-OVERSIZE-DST-"),O)));const{outputLen:q,blockLen:b}=k,F=Math.ceil(M/q);if(F>255)throw new Error("Invalid xmd length");const G=(0,w.concatBytes)(O,v(O.length,1)),ue=v(0,b),le=v(M,2),X=new Array(F),se=k((0,w.concatBytes)(ue,S,le,v(0,1),G));X[0]=k((0,w.concatBytes)(se,v(1,1),G));for(let ye=1;ye<=F;ye++){const he=[c(se,X[ye-1]),v(ye+1,1),G];X[ye]=k((0,w.concatBytes)(...he))}return(0,w.concatBytes)(...X).slice(0,M)}function m(S,O,M,k,q){if((0,w.abytes)(S),(0,w.abytes)(O),d(M),O.length>255){const b=Math.ceil(2*k/8);O=q.create({dkLen:b}).update((0,w.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(O).digest()}if(M>65535||O.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return q.create({dkLen:M}).update(S).update(v(M,2)).update(O).update(v(O.length,1)).digest()}function C(S,O,M){(0,w.validateObject)(M,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:k,k:q,m:b,hash:F,expand:G,DST:ue}=M;(0,w.abytes)(S),d(O);const le=typeof ue=="string"?(0,w.utf8ToBytes)(ue):ue,X=k.toString(2).length,se=Math.ceil((X+q)/8),de=O*b*se;let ye;if(G==="xmd")ye=p(S,le,de,F);else if(G==="xof")ye=m(S,le,de,q,F);else if(G==="_internal_pass")ye=S;else throw new Error('expand must be "xmd" or "xof"');const he=new Array(O);for(let K=0;K<O;K++){const B=new Array(b);for(let L=0;L<b;L++){const $=se*(L+K*b),T=ye.subarray($,$+se);B[L]=(0,h.mod)(E(T),k)}he[K]=B}return he}function x(S,O){const M=O.map(k=>Array.from(k).reverse());return(k,q)=>{const[b,F,G,ue]=M.map(le=>le.reduce((X,se)=>S.add(S.mul(X,k),se)));return k=S.div(b,F),q=S.mul(q,S.div(G,ue)),{x:k,y:q}}}function R(S,O,M){if(typeof O!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(k,q){const b=C(k,2,{...M,DST:M.DST,...q}),F=S.fromAffine(O(b[0])),G=S.fromAffine(O(b[1])),ue=F.add(G).clearCofactor();return ue.assertValidity(),ue},encodeToCurve(k,q){const b=C(k,1,{...M,DST:M.encodeDST,...q}),F=S.fromAffine(O(b[0])).clearCofactor();return F.assertValidity(),F},mapToCurve(k){if(!Array.isArray(k))throw new Error("mapToCurve: expected array of bigints");for(const b of k)if(typeof b!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${b} in array`);const q=S.fromAffine(O(k)).clearCofactor();return q.assertValidity(),q}}}},54136:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.isNegativeLE=void 0,f.mod=R,f.pow=S,f.pow2=O,f.invert=M,f.tonelliShanks=k,f.FpSqrt=q,f.validateField=G,f.FpPow=ue,f.FpInvertBatch=le,f.FpDiv=X,f.FpIsSquare=se,f.nLength=de,f.Field=ye,f.FpSqrtOdd=he,f.FpSqrtEven=K,f.hashToPrivateScalar=B,f.getFieldBytesLength=L,f.getMinHashLength=$,f.mapHashToField=T;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(15939),w=BigInt(0),E=BigInt(1),v=BigInt(2),c=BigInt(3),d=BigInt(4),p=BigInt(5),m=BigInt(8),C=BigInt(9),x=BigInt(16);function R(N,j){const Y=N%j;return Y>=w?Y:j+Y}function S(N,j,Y){if(Y<=w||j<w)throw new Error("Expected power/modulo > 0");if(Y===E)return w;let Z=E;for(;j>w;)j&E&&(Z=Z*N%Y),N=N*N%Y,j>>=E;return Z}function O(N,j,Y){let Z=N;for(;j-- >w;)Z*=Z,Z%=Y;return Z}function M(N,j){if(N===w||j<=w)throw new Error(`invert: expected positive integers, got n=${N} mod=${j}`);let Y=R(N,j),Z=j,z=w,fe=E,te=E,H=w;for(;Y!==w;){const oe=Z/Y,_e=Z%Y,ge=z-te*oe,be=fe-H*oe;Z=Y,Y=_e,z=te,fe=H,te=ge,H=be}if(Z!==E)throw new Error("invert: does not exist");return R(z,j)}function k(N){const j=(N-E)/v;let Y,Z,z;for(Y=N-E,Z=0;Y%v===w;Y/=v,Z++);for(z=v;z<N&&S(z,j,N)!==N-E;z++);if(Z===1){const te=(N+E)/d;return function(Q,oe){const _e=Q.pow(oe,te);if(!Q.eql(Q.sqr(_e),oe))throw new Error("Cannot find square root");return _e}}const fe=(Y+E)/v;return function(H,Q){if(H.pow(Q,j)===H.neg(H.ONE))throw new Error("Cannot find square root");let oe=Z,_e=H.pow(H.mul(H.ONE,z),Y),ge=H.pow(Q,fe),be=H.pow(Q,Y);for(;!H.eql(be,H.ONE);){if(H.eql(be,H.ZERO))return H.ZERO;let we=1;for(let me=H.sqr(be);we<oe&&!H.eql(me,H.ONE);we++)me=H.sqr(me);const Ee=H.pow(_e,E<<BigInt(oe-we-1));_e=H.sqr(Ee),ge=H.mul(ge,Ee),be=H.mul(be,_e),oe=we}return ge}}function q(N){if(N%d===c){const j=(N+E)/d;return function(Z,z){const fe=Z.pow(z,j);if(!Z.eql(Z.sqr(fe),z))throw new Error("Cannot find square root");return fe}}if(N%m===p){const j=(N-p)/m;return function(Z,z){const fe=Z.mul(z,v),te=Z.pow(fe,j),H=Z.mul(z,te),Q=Z.mul(Z.mul(H,v),te),oe=Z.mul(H,Z.sub(Q,Z.ONE));if(!Z.eql(Z.sqr(oe),z))throw new Error("Cannot find square root");return oe}}return N%x,k(N)}const b=(N,j)=>(R(N,j)&E)===E;f.isNegativeLE=b;const F=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function G(N){const j={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},Y=F.reduce((Z,z)=>(Z[z]="function",Z),j);return(0,h.validateObject)(N,Y)}function ue(N,j,Y){if(Y<w)throw new Error("Expected power > 0");if(Y===w)return N.ONE;if(Y===E)return j;let Z=N.ONE,z=j;for(;Y>w;)Y&E&&(Z=N.mul(Z,z)),z=N.sqr(z),Y>>=E;return Z}function le(N,j){const Y=new Array(j.length),Z=j.reduce((fe,te,H)=>N.is0(te)?fe:(Y[H]=fe,N.mul(fe,te)),N.ONE),z=N.inv(Z);return j.reduceRight((fe,te,H)=>N.is0(te)?fe:(Y[H]=N.mul(fe,Y[H]),N.mul(fe,te)),z),Y}function X(N,j,Y){return N.mul(j,typeof Y=="bigint"?M(Y,N.ORDER):N.inv(Y))}function se(N){const j=(N.ORDER-E)/v;return Y=>{const Z=N.pow(Y,j);return N.eql(Z,N.ZERO)||N.eql(Z,N.ONE)}}function de(N,j){const Y=j!==void 0?j:N.toString(2).length,Z=Math.ceil(Y/8);return{nBitLength:Y,nByteLength:Z}}function ye(N,j,Y=!1,Z={}){if(N<=w)throw new Error(`Expected Field ORDER > 0, got ${N}`);const{nBitLength:z,nByteLength:fe}=de(N,j);if(fe>2048)throw new Error("Field lengths over 2048 bytes are not supported");const te=q(N),H=Object.freeze({ORDER:N,BITS:z,BYTES:fe,MASK:(0,h.bitMask)(z),ZERO:w,ONE:E,create:Q=>R(Q,N),isValid:Q=>{if(typeof Q!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof Q}`);return w<=Q&&Q<N},is0:Q=>Q===w,isOdd:Q=>(Q&E)===E,neg:Q=>R(-Q,N),eql:(Q,oe)=>Q===oe,sqr:Q=>R(Q*Q,N),add:(Q,oe)=>R(Q+oe,N),sub:(Q,oe)=>R(Q-oe,N),mul:(Q,oe)=>R(Q*oe,N),pow:(Q,oe)=>ue(H,Q,oe),div:(Q,oe)=>R(Q*M(oe,N),N),sqrN:Q=>Q*Q,addN:(Q,oe)=>Q+oe,subN:(Q,oe)=>Q-oe,mulN:(Q,oe)=>Q*oe,inv:Q=>M(Q,N),sqrt:Z.sqrt||(Q=>te(H,Q)),invertBatch:Q=>le(H,Q),cmov:(Q,oe,_e)=>_e?oe:Q,toBytes:Q=>Y?(0,h.numberToBytesLE)(Q,fe):(0,h.numberToBytesBE)(Q,fe),fromBytes:Q=>{if(Q.length!==fe)throw new Error(`Fp.fromBytes: expected ${fe}, got ${Q.length}`);return Y?(0,h.bytesToNumberLE)(Q):(0,h.bytesToNumberBE)(Q)}});return Object.freeze(H)}function he(N,j){if(!N.isOdd)throw new Error("Field doesn't have isOdd");const Y=N.sqrt(j);return N.isOdd(Y)?Y:N.neg(Y)}function K(N,j){if(!N.isOdd)throw new Error("Field doesn't have isOdd");const Y=N.sqrt(j);return N.isOdd(Y)?N.neg(Y):Y}function B(N,j,Y=!1){N=(0,h.ensureBytes)("privateHash",N);const Z=N.length,z=de(j).nByteLength+8;if(z<24||Z<z||Z>1024)throw new Error(`hashToPrivateScalar: expected ${z}-1024 bytes of input, got ${Z}`);const fe=Y?(0,h.bytesToNumberLE)(N):(0,h.bytesToNumberBE)(N);return R(fe,j-E)+E}function L(N){if(typeof N!="bigint")throw new Error("field order must be bigint");const j=N.toString(2).length;return Math.ceil(j/8)}function $(N){const j=L(N);return j+Math.ceil(j/2)}function T(N,j,Y=!1){const Z=N.length,z=L(j),fe=$(j);if(Z<16||Z<fe||Z>1024)throw new Error(`expected ${fe}-1024 bytes of input, got ${Z}`);const te=Y?(0,h.bytesToNumberBE)(N):(0,h.bytesToNumberLE)(N),H=R(te,j-E)+E;return Y?(0,h.numberToBytesLE)(H,z):(0,h.numberToBytesBE)(H,z)}},15939:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.bitMask=void 0,f.isBytes=E,f.abytes=v,f.bytesToHex=d,f.numberToHexUnpadded=p,f.hexToNumber=m,f.hexToBytes=R,f.bytesToNumberBE=S,f.bytesToNumberLE=O,f.numberToBytesBE=M,f.numberToBytesLE=k,f.numberToVarBytesBE=q,f.ensureBytes=b,f.concatBytes=F,f.equalBytes=G,f.utf8ToBytes=ue,f.bitLen=le,f.bitGet=X,f.bitSet=se,f.createHmacDrbg=K,f.validateObject=L;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _=BigInt(0),h=BigInt(1),w=BigInt(2);function E($){return $ instanceof Uint8Array||$!=null&&typeof $=="object"&&$.constructor.name==="Uint8Array"}function v($){if(!E($))throw new Error("Uint8Array expected")}const c=Array.from({length:256},($,T)=>T.toString(16).padStart(2,"0"));function d($){v($);let T="";for(let N=0;N<$.length;N++)T+=c[$[N]];return T}function p($){const T=$.toString(16);return T.length&1?`0${T}`:T}function m($){if(typeof $!="string")throw new Error("hex string expected, got "+typeof $);return BigInt($===""?"0":`0x${$}`)}const C={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function x($){if($>=C._0&&$<=C._9)return $-C._0;if($>=C._A&&$<=C._F)return $-(C._A-10);if($>=C._a&&$<=C._f)return $-(C._a-10)}function R($){if(typeof $!="string")throw new Error("hex string expected, got "+typeof $);const T=$.length,N=T/2;if(T%2)throw new Error("padded hex string expected, got unpadded hex of length "+T);const j=new Uint8Array(N);for(let Y=0,Z=0;Y<N;Y++,Z+=2){const z=x($.charCodeAt(Z)),fe=x($.charCodeAt(Z+1));if(z===void 0||fe===void 0){const te=$[Z]+$[Z+1];throw new Error('hex string expected, got non-hex character "'+te+'" at index '+Z)}j[Y]=z*16+fe}return j}function S($){return m(d($))}function O($){return v($),m(d(Uint8Array.from($).reverse()))}function M($,T){return R($.toString(16).padStart(T*2,"0"))}function k($,T){return M($,T).reverse()}function q($){return R(p($))}function b($,T,N){let j;if(typeof T=="string")try{j=R(T)}catch(Z){throw new Error(`${$} must be valid hex string, got "${T}". Cause: ${Z}`)}else if(E(T))j=Uint8Array.from(T);else throw new Error(`${$} must be hex string or Uint8Array`);const Y=j.length;if(typeof N=="number"&&Y!==N)throw new Error(`${$} expected ${N} bytes, got ${Y}`);return j}function F(...$){let T=0;for(let j=0;j<$.length;j++){const Y=$[j];v(Y),T+=Y.length}const N=new Uint8Array(T);for(let j=0,Y=0;j<$.length;j++){const Z=$[j];N.set(Z,Y),Y+=Z.length}return N}function G($,T){if($.length!==T.length)return!1;let N=0;for(let j=0;j<$.length;j++)N|=$[j]^T[j];return N===0}function ue($){if(typeof $!="string")throw new Error(`utf8ToBytes expected string, got ${typeof $}`);return new Uint8Array(new TextEncoder().encode($))}function le($){let T;for(T=0;$>_;$>>=h,T+=1);return T}function X($,T){return $>>BigInt(T)&h}function se($,T,N){return $|(N?h:_)<<BigInt(T)}const de=$=>(w<<BigInt($-1))-h;f.bitMask=de;const ye=$=>new Uint8Array($),he=$=>Uint8Array.from($);function K($,T,N){if(typeof $!="number"||$<2)throw new Error("hashLen must be a number");if(typeof T!="number"||T<2)throw new Error("qByteLen must be a number");if(typeof N!="function")throw new Error("hmacFn must be a function");let j=ye($),Y=ye($),Z=0;const z=()=>{j.fill(1),Y.fill(0),Z=0},fe=(...oe)=>N(Y,j,...oe),te=(oe=ye())=>{Y=fe(he([0]),oe),j=fe(),oe.length!==0&&(Y=fe(he([1]),oe),j=fe())},H=()=>{if(Z++>=1e3)throw new Error("drbg: tried 1000 values");let oe=0;const _e=[];for(;oe<T;){j=fe();const ge=j.slice();_e.push(ge),oe+=j.length}return F(..._e)};return(oe,_e)=>{z(),te(oe);let ge;for(;!(ge=_e(H()));)te();return z(),ge}}const B={bigint:$=>typeof $=="bigint",function:$=>typeof $=="function",boolean:$=>typeof $=="boolean",string:$=>typeof $=="string",stringOrUint8Array:$=>typeof $=="string"||E($),isSafeInteger:$=>Number.isSafeInteger($),array:$=>Array.isArray($),field:($,T)=>T.Fp.isValid($),hash:$=>typeof $=="function"&&Number.isSafeInteger($.outputLen)};function L($,T,N={}){const j=(Y,Z,z)=>{const fe=B[Z];if(typeof fe!="function")throw new Error(`Invalid validator "${Z}", expected function`);const te=$[Y];if(!(z&&te===void 0)&&!fe(te,$))throw new Error(`Invalid param ${String(Y)}=${te} (${typeof te}), expected ${Z}`)};for(const[Y,Z]of Object.entries(T))j(Y,Z,!1);for(const[Y,Z]of Object.entries(N))j(Y,Z,!0);return $}},17670:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.DER=void 0,f.weierstrassPoints=O,f.weierstrass=k,f.SWUFpSqrtRatio=q,f.mapToCurveSimpleSWU=b;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(11189),w=_(54136),E=_(15939),v=_(15939);function c(F){const G=(0,h.validateBasic)(F);E.validateObject(G,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:ue,Fp:le,a:X}=G;if(ue){if(!le.eql(X,le.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof ue!="object"||typeof ue.beta!="bigint"||typeof ue.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...G})}const{bytesToNumberBE:d,hexToBytes:p}=E;f.DER={Err:class extends Error{constructor(G=""){super(G)}},_parseInt(F){const{Err:G}=f.DER;if(F.length<2||F[0]!==2)throw new G("Invalid signature integer tag");const ue=F[1],le=F.subarray(2,ue+2);if(!ue||le.length!==ue)throw new G("Invalid signature integer: wrong length");if(le[0]&128)throw new G("Invalid signature integer: negative");if(le[0]===0&&!(le[1]&128))throw new G("Invalid signature integer: unnecessary leading zero");return{d:d(le),l:F.subarray(ue+2)}},toSig(F){const{Err:G}=f.DER,ue=typeof F=="string"?p(F):F;E.abytes(ue);let le=ue.length;if(le<2||ue[0]!=48)throw new G("Invalid signature tag");if(ue[1]!==le-2)throw new G("Invalid signature: incorrect length");const{d:X,l:se}=f.DER._parseInt(ue.subarray(2)),{d:de,l:ye}=f.DER._parseInt(se);if(ye.length)throw new G("Invalid signature: left bytes after parsing");return{r:X,s:de}},hexFromSig(F){const G=K=>Number.parseInt(K[0],16)&8?"00"+K:K,ue=K=>{const B=K.toString(16);return B.length&1?`0${B}`:B},le=G(ue(F.s)),X=G(ue(F.r)),se=le.length/2,de=X.length/2,ye=ue(se),he=ue(de);return`30${ue(de+se+4)}02${he}${X}02${ye}${le}`}};const m=BigInt(0),C=BigInt(1),x=BigInt(2),R=BigInt(3),S=BigInt(4);function O(F){const G=c(F),{Fp:ue}=G,le=G.toBytes||((N,j,Y)=>{const Z=j.toAffine();return E.concatBytes(Uint8Array.from([4]),ue.toBytes(Z.x),ue.toBytes(Z.y))}),X=G.fromBytes||(N=>{const j=N.subarray(1),Y=ue.fromBytes(j.subarray(0,ue.BYTES)),Z=ue.fromBytes(j.subarray(ue.BYTES,2*ue.BYTES));return{x:Y,y:Z}});function se(N){const{a:j,b:Y}=G,Z=ue.sqr(N),z=ue.mul(Z,N);return ue.add(ue.add(z,ue.mul(N,j)),Y)}if(!ue.eql(ue.sqr(G.Gy),se(G.Gx)))throw new Error("bad generator point: equation left != right");function de(N){return typeof N=="bigint"&&m<N&&N<G.n}function ye(N){if(!de(N))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function he(N){const{allowedPrivateKeyLengths:j,nByteLength:Y,wrapPrivateKey:Z,n:z}=G;if(j&&typeof N!="bigint"){if(E.isBytes(N)&&(N=E.bytesToHex(N)),typeof N!="string"||!j.includes(N.length))throw new Error("Invalid key");N=N.padStart(Y*2,"0")}let fe;try{fe=typeof N=="bigint"?N:E.bytesToNumberBE((0,v.ensureBytes)("private key",N,Y))}catch{throw new Error(`private key must be ${Y} bytes, hex or bigint, not ${typeof N}`)}return Z&&(fe=w.mod(fe,z)),ye(fe),fe}const K=new Map;function B(N){if(!(N instanceof L))throw new Error("ProjectivePoint expected")}class L{constructor(j,Y,Z){if(this.px=j,this.py=Y,this.pz=Z,j==null||!ue.isValid(j))throw new Error("x required");if(Y==null||!ue.isValid(Y))throw new Error("y required");if(Z==null||!ue.isValid(Z))throw new Error("z required")}static fromAffine(j){const{x:Y,y:Z}=j||{};if(!j||!ue.isValid(Y)||!ue.isValid(Z))throw new Error("invalid affine point");if(j instanceof L)throw new Error("projective point not allowed");const z=fe=>ue.eql(fe,ue.ZERO);return z(Y)&&z(Z)?L.ZERO:new L(Y,Z,ue.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(j){const Y=ue.invertBatch(j.map(Z=>Z.pz));return j.map((Z,z)=>Z.toAffine(Y[z])).map(L.fromAffine)}static fromHex(j){const Y=L.fromAffine(X((0,v.ensureBytes)("pointHex",j)));return Y.assertValidity(),Y}static fromPrivateKey(j){return L.BASE.multiply(he(j))}_setWindowSize(j){this._WINDOW_SIZE=j,K.delete(this)}assertValidity(){if(this.is0()){if(G.allowInfinityPoint&&!ue.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:j,y:Y}=this.toAffine();if(!ue.isValid(j)||!ue.isValid(Y))throw new Error("bad point: x or y not FE");const Z=ue.sqr(Y),z=se(j);if(!ue.eql(Z,z))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:j}=this.toAffine();if(ue.isOdd)return!ue.isOdd(j);throw new Error("Field doesn't support isOdd")}equals(j){B(j);const{px:Y,py:Z,pz:z}=this,{px:fe,py:te,pz:H}=j,Q=ue.eql(ue.mul(Y,H),ue.mul(fe,z)),oe=ue.eql(ue.mul(Z,H),ue.mul(te,z));return Q&&oe}negate(){return new L(this.px,ue.neg(this.py),this.pz)}double(){const{a:j,b:Y}=G,Z=ue.mul(Y,R),{px:z,py:fe,pz:te}=this;let H=ue.ZERO,Q=ue.ZERO,oe=ue.ZERO,_e=ue.mul(z,z),ge=ue.mul(fe,fe),be=ue.mul(te,te),we=ue.mul(z,fe);return we=ue.add(we,we),oe=ue.mul(z,te),oe=ue.add(oe,oe),H=ue.mul(j,oe),Q=ue.mul(Z,be),Q=ue.add(H,Q),H=ue.sub(ge,Q),Q=ue.add(ge,Q),Q=ue.mul(H,Q),H=ue.mul(we,H),oe=ue.mul(Z,oe),be=ue.mul(j,be),we=ue.sub(_e,be),we=ue.mul(j,we),we=ue.add(we,oe),oe=ue.add(_e,_e),_e=ue.add(oe,_e),_e=ue.add(_e,be),_e=ue.mul(_e,we),Q=ue.add(Q,_e),be=ue.mul(fe,te),be=ue.add(be,be),_e=ue.mul(be,we),H=ue.sub(H,_e),oe=ue.mul(be,ge),oe=ue.add(oe,oe),oe=ue.add(oe,oe),new L(H,Q,oe)}add(j){B(j);const{px:Y,py:Z,pz:z}=this,{px:fe,py:te,pz:H}=j;let Q=ue.ZERO,oe=ue.ZERO,_e=ue.ZERO;const ge=G.a,be=ue.mul(G.b,R);let we=ue.mul(Y,fe),Ee=ue.mul(Z,te),me=ue.mul(z,H),Ke=ue.add(Y,Z),He=ue.add(fe,te);Ke=ue.mul(Ke,He),He=ue.add(we,Ee),Ke=ue.sub(Ke,He),He=ue.add(Y,z);let Ie=ue.add(fe,H);return He=ue.mul(He,Ie),Ie=ue.add(we,me),He=ue.sub(He,Ie),Ie=ue.add(Z,z),Q=ue.add(te,H),Ie=ue.mul(Ie,Q),Q=ue.add(Ee,me),Ie=ue.sub(Ie,Q),_e=ue.mul(ge,He),Q=ue.mul(be,me),_e=ue.add(Q,_e),Q=ue.sub(Ee,_e),_e=ue.add(Ee,_e),oe=ue.mul(Q,_e),Ee=ue.add(we,we),Ee=ue.add(Ee,we),me=ue.mul(ge,me),He=ue.mul(be,He),Ee=ue.add(Ee,me),me=ue.sub(we,me),me=ue.mul(ge,me),He=ue.add(He,me),we=ue.mul(Ee,He),oe=ue.add(oe,we),we=ue.mul(Ie,He),Q=ue.mul(Ke,Q),Q=ue.sub(Q,we),we=ue.mul(Ke,Ee),_e=ue.mul(Ie,_e),_e=ue.add(_e,we),new L(Q,oe,_e)}subtract(j){return this.add(j.negate())}is0(){return this.equals(L.ZERO)}wNAF(j){return T.wNAFCached(this,K,j,Y=>{const Z=ue.invertBatch(Y.map(z=>z.pz));return Y.map((z,fe)=>z.toAffine(Z[fe])).map(L.fromAffine)})}multiplyUnsafe(j){const Y=L.ZERO;if(j===m)return Y;if(ye(j),j===C)return this;const{endo:Z}=G;if(!Z)return T.unsafeLadder(this,j);let{k1neg:z,k1:fe,k2neg:te,k2:H}=Z.splitScalar(j),Q=Y,oe=Y,_e=this;for(;fe>m||H>m;)fe&C&&(Q=Q.add(_e)),H&C&&(oe=oe.add(_e)),_e=_e.double(),fe>>=C,H>>=C;return z&&(Q=Q.negate()),te&&(oe=oe.negate()),oe=new L(ue.mul(oe.px,Z.beta),oe.py,oe.pz),Q.add(oe)}multiply(j){ye(j);let Y=j,Z,z;const{endo:fe}=G;if(fe){const{k1neg:te,k1:H,k2neg:Q,k2:oe}=fe.splitScalar(Y);let{p:_e,f:ge}=this.wNAF(H),{p:be,f:we}=this.wNAF(oe);_e=T.constTimeNegate(te,_e),be=T.constTimeNegate(Q,be),be=new L(ue.mul(be.px,fe.beta),be.py,be.pz),Z=_e.add(be),z=ge.add(we)}else{const{p:te,f:H}=this.wNAF(Y);Z=te,z=H}return L.normalizeZ([Z,z])[0]}multiplyAndAddUnsafe(j,Y,Z){const z=L.BASE,fe=(H,Q)=>Q===m||Q===C||!H.equals(z)?H.multiplyUnsafe(Q):H.multiply(Q),te=fe(this,Y).add(fe(j,Z));return te.is0()?void 0:te}toAffine(j){const{px:Y,py:Z,pz:z}=this,fe=this.is0();j==null&&(j=fe?ue.ONE:ue.inv(z));const te=ue.mul(Y,j),H=ue.mul(Z,j),Q=ue.mul(z,j);if(fe)return{x:ue.ZERO,y:ue.ZERO};if(!ue.eql(Q,ue.ONE))throw new Error("invZ was invalid");return{x:te,y:H}}isTorsionFree(){const{h:j,isTorsionFree:Y}=G;if(j===C)return!0;if(Y)return Y(L,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:j,clearCofactor:Y}=G;return j===C?this:Y?Y(L,this):this.multiplyUnsafe(G.h)}toRawBytes(j=!0){return this.assertValidity(),le(L,this,j)}toHex(j=!0){return E.bytesToHex(this.toRawBytes(j))}}L.BASE=new L(G.Gx,G.Gy,ue.ONE),L.ZERO=new L(ue.ZERO,ue.ONE,ue.ZERO);const $=G.nBitLength,T=(0,h.wNAF)(L,G.endo?Math.ceil($/2):$);return{CURVE:G,ProjectivePoint:L,normPrivateKeyToScalar:he,weierstrassEquation:se,isWithinCurveOrder:de}}function M(F){const G=(0,h.validateBasic)(F);return E.validateObject(G,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...G})}function k(F){const G=M(F),{Fp:ue,n:le}=G,X=ue.BYTES+1,se=2*ue.BYTES+1;function de(He){return m<He&&He<ue.ORDER}function ye(He){return w.mod(He,le)}function he(He){return w.invert(He,le)}const{ProjectivePoint:K,normPrivateKeyToScalar:B,weierstrassEquation:L,isWithinCurveOrder:$}=O({...G,toBytes(He,Ie,Le){const Ge=Ie.toAffine(),Be=ue.toBytes(Ge.x),We=E.concatBytes;return Le?We(Uint8Array.from([Ie.hasEvenY()?2:3]),Be):We(Uint8Array.from([4]),Be,ue.toBytes(Ge.y))},fromBytes(He){const Ie=He.length,Le=He[0],Ge=He.subarray(1);if(Ie===X&&(Le===2||Le===3)){const Be=E.bytesToNumberBE(Ge);if(!de(Be))throw new Error("Point is not on curve");const We=L(Be);let Ze;try{Ze=ue.sqrt(We)}catch(gt){const lt=gt instanceof Error?": "+gt.message:"";throw new Error("Point is not on curve"+lt)}const _t=(Ze&C)===C;return(Le&1)===1!==_t&&(Ze=ue.neg(Ze)),{x:Be,y:Ze}}else if(Ie===se&&Le===4){const Be=ue.fromBytes(Ge.subarray(0,ue.BYTES)),We=ue.fromBytes(Ge.subarray(ue.BYTES,2*ue.BYTES));return{x:Be,y:We}}else throw new Error(`Point of length ${Ie} was invalid. Expected ${X} compressed bytes or ${se} uncompressed bytes`)}}),T=He=>E.bytesToHex(E.numberToBytesBE(He,G.nByteLength));function N(He){const Ie=le>>C;return He>Ie}function j(He){return N(He)?ye(-He):He}const Y=(He,Ie,Le)=>E.bytesToNumberBE(He.slice(Ie,Le));class Z{constructor(Ie,Le,Ge){this.r=Ie,this.s=Le,this.recovery=Ge,this.assertValidity()}static fromCompact(Ie){const Le=G.nByteLength;return Ie=(0,v.ensureBytes)("compactSignature",Ie,Le*2),new Z(Y(Ie,0,Le),Y(Ie,Le,2*Le))}static fromDER(Ie){const{r:Le,s:Ge}=f.DER.toSig((0,v.ensureBytes)("DER",Ie));return new Z(Le,Ge)}assertValidity(){if(!$(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!$(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Ie){return new Z(this.r,this.s,Ie)}recoverPublicKey(Ie){const{r:Le,s:Ge,recovery:Be}=this,We=oe((0,v.ensureBytes)("msgHash",Ie));if(Be==null||![0,1,2,3].includes(Be))throw new Error("recovery id invalid");const Ze=Be===2||Be===3?Le+G.n:Le;if(Ze>=ue.ORDER)throw new Error("recovery id 2 or 3 invalid");const _t=Be&1?"03":"02",Ft=K.fromHex(_t+T(Ze)),gt=he(Ze),lt=ye(-We*gt),dt=ye(Ge*gt),tt=K.BASE.multiplyAndAddUnsafe(Ft,lt,dt);if(!tt)throw new Error("point at infinify");return tt.assertValidity(),tt}hasHighS(){return N(this.s)}normalizeS(){return this.hasHighS()?new Z(this.r,ye(-this.s),this.recovery):this}toDERRawBytes(){return E.hexToBytes(this.toDERHex())}toDERHex(){return f.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return E.hexToBytes(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}const z={isValidPrivateKey(He){try{return B(He),!0}catch{return!1}},normPrivateKeyToScalar:B,randomPrivateKey:()=>{const He=w.getMinHashLength(G.n);return w.mapHashToField(G.randomBytes(He),G.n)},precompute(He=8,Ie=K.BASE){return Ie._setWindowSize(He),Ie.multiply(BigInt(3)),Ie}};function fe(He,Ie=!0){return K.fromPrivateKey(He).toRawBytes(Ie)}function te(He){const Ie=E.isBytes(He),Le=typeof He=="string",Ge=(Ie||Le)&&He.length;return Ie?Ge===X||Ge===se:Le?Ge===2*X||Ge===2*se:He instanceof K}function H(He,Ie,Le=!0){if(te(He))throw new Error("first arg must be private key");if(!te(Ie))throw new Error("second arg must be public key");return K.fromHex(Ie).multiply(B(He)).toRawBytes(Le)}const Q=G.bits2int||function(He){const Ie=E.bytesToNumberBE(He),Le=He.length*8-G.nBitLength;return Le>0?Ie>>BigInt(Le):Ie},oe=G.bits2int_modN||function(He){return ye(Q(He))},_e=E.bitMask(G.nBitLength);function ge(He){if(typeof He!="bigint")throw new Error("bigint expected");if(!(m<=He&&He<_e))throw new Error(`bigint expected < 2^${G.nBitLength}`);return E.numberToBytesBE(He,G.nByteLength)}function be(He,Ie,Le=we){if(["recovered","canonical"].some(ke=>ke in Le))throw new Error("sign() legacy options not supported");const{hash:Ge,randomBytes:Be}=G;let{lowS:We,prehash:Ze,extraEntropy:_t}=Le;We==null&&(We=!0),He=(0,v.ensureBytes)("msgHash",He),Ze&&(He=(0,v.ensureBytes)("prehashed msgHash",Ge(He)));const Ft=oe(He),gt=B(Ie),lt=[ge(gt),ge(Ft)];if(_t!=null&&_t!==!1){const ke=_t===!0?Be(ue.BYTES):_t;lt.push((0,v.ensureBytes)("extraEntropy",ke))}const dt=E.concatBytes(...lt),tt=Ft;function rt(ke){const xe=Q(ke);if(!$(xe))return;const Pe=he(xe),it=K.BASE.multiply(xe).toAffine(),Xe=ye(it.x);if(Xe===m)return;const st=ye(Pe*ye(tt+Xe*gt));if(st===m)return;let It=(it.x===Xe?0:2)|Number(it.y&C),ft=st;return We&&N(st)&&(ft=j(st),It^=1),new Z(Xe,ft,It)}return{seed:dt,k2sig:rt}}const we={lowS:G.lowS,prehash:!1},Ee={lowS:G.lowS,prehash:!1};function me(He,Ie,Le=we){const{seed:Ge,k2sig:Be}=be(He,Ie,Le),We=G;return E.createHmacDrbg(We.hash.outputLen,We.nByteLength,We.hmac)(Ge,Be)}K.BASE._setWindowSize(8);function Ke(He,Ie,Le,Ge=Ee){const Be=He;if(Ie=(0,v.ensureBytes)("msgHash",Ie),Le=(0,v.ensureBytes)("publicKey",Le),"strict"in Ge)throw new Error("options.strict was renamed to lowS");const{lowS:We,prehash:Ze}=Ge;let _t,Ft;try{if(typeof Be=="string"||E.isBytes(Be))try{_t=Z.fromDER(Be)}catch(it){if(!(it instanceof f.DER.Err))throw it;_t=Z.fromCompact(Be)}else if(typeof Be=="object"&&typeof Be.r=="bigint"&&typeof Be.s=="bigint"){const{r:it,s:Xe}=Be;_t=new Z(it,Xe)}else throw new Error("PARSE");Ft=K.fromHex(Le)}catch(it){if(it.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(We&&_t.hasHighS())return!1;Ze&&(Ie=G.hash(Ie));const{r:gt,s:lt}=_t,dt=oe(Ie),tt=he(lt),rt=ye(dt*tt),ke=ye(gt*tt),xe=K.BASE.multiplyAndAddUnsafe(Ft,rt,ke)?.toAffine();return xe?ye(xe.x)===gt:!1}return{CURVE:G,getPublicKey:fe,getSharedSecret:H,sign:me,verify:Ke,ProjectivePoint:K,Signature:Z,utils:z}}function q(F,G){const ue=F.ORDER;let le=m;for(let N=ue-C;N%x===m;N/=x)le+=C;const X=le,se=x<<X-C-C,de=se*x,ye=(ue-C)/de,he=(ye-C)/x,K=de-C,B=se,L=F.pow(G,ye),$=F.pow(G,(ye+C)/x);let T=(N,j)=>{let Y=L,Z=F.pow(j,K),z=F.sqr(Z);z=F.mul(z,j);let fe=F.mul(N,z);fe=F.pow(fe,he),fe=F.mul(fe,Z),Z=F.mul(fe,j),z=F.mul(fe,N);let te=F.mul(z,Z);fe=F.pow(te,B);let H=F.eql(fe,F.ONE);Z=F.mul(z,$),fe=F.mul(te,Y),z=F.cmov(Z,z,H),te=F.cmov(fe,te,H);for(let Q=X;Q>C;Q--){let oe=Q-x;oe=x<<oe-C;let _e=F.pow(te,oe);const ge=F.eql(_e,F.ONE);Z=F.mul(z,Y),Y=F.mul(Y,Y),_e=F.mul(te,Y),z=F.cmov(Z,z,ge),te=F.cmov(_e,te,ge)}return{isValid:H,value:z}};if(F.ORDER%S===R){const N=(F.ORDER-R)/S,j=F.sqrt(F.neg(G));T=(Y,Z)=>{let z=F.sqr(Z);const fe=F.mul(Y,Z);z=F.mul(z,fe);let te=F.pow(z,N);te=F.mul(te,fe);const H=F.mul(te,j),Q=F.mul(F.sqr(te),Z),oe=F.eql(Q,Y);let _e=F.cmov(H,te,oe);return{isValid:oe,value:_e}}}return T}function b(F,G){if(w.validateField(F),!F.isValid(G.A)||!F.isValid(G.B)||!F.isValid(G.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const ue=q(F,G.Z);if(!F.isOdd)throw new Error("Fp.isOdd is not implemented!");return le=>{let X,se,de,ye,he,K,B,L;X=F.sqr(le),X=F.mul(X,G.Z),se=F.sqr(X),se=F.add(se,X),de=F.add(se,F.ONE),de=F.mul(de,G.B),ye=F.cmov(G.Z,F.neg(se),!F.eql(se,F.ZERO)),ye=F.mul(ye,G.A),se=F.sqr(de),K=F.sqr(ye),he=F.mul(K,G.A),se=F.add(se,he),se=F.mul(se,de),K=F.mul(K,ye),he=F.mul(K,G.B),se=F.add(se,he),B=F.mul(X,de);const{isValid:$,value:T}=ue(se,K);L=F.mul(X,le),L=F.mul(L,T),B=F.cmov(B,de,$),L=F.cmov(L,T,$);const N=F.isOdd(le)===F.isOdd(L);return L=F.cmov(F.neg(L),L,N),B=F.div(B,ye),{x:B,y:L}}}},74679:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.encodeToCurve=f.hashToCurve=f.schnorr=f.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(63742),w=_(49724),E=_(9171),v=_(20418),c=_(54136),d=_(15939),p=_(17670),m=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),C=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),x=BigInt(1),R=BigInt(2),S=(Z,z)=>(Z+z/R)/z;function O(Z){const z=m,fe=BigInt(3),te=BigInt(6),H=BigInt(11),Q=BigInt(22),oe=BigInt(23),_e=BigInt(44),ge=BigInt(88),be=Z*Z*Z%z,we=be*be*Z%z,Ee=(0,c.pow2)(we,fe,z)*we%z,me=(0,c.pow2)(Ee,fe,z)*we%z,Ke=(0,c.pow2)(me,R,z)*be%z,He=(0,c.pow2)(Ke,H,z)*Ke%z,Ie=(0,c.pow2)(He,Q,z)*He%z,Le=(0,c.pow2)(Ie,_e,z)*Ie%z,Ge=(0,c.pow2)(Le,ge,z)*Le%z,Be=(0,c.pow2)(Ge,_e,z)*Ie%z,We=(0,c.pow2)(Be,fe,z)*we%z,Ze=(0,c.pow2)(We,oe,z)*He%z,_t=(0,c.pow2)(Ze,te,z)*be%z,Ft=(0,c.pow2)(_t,R,z);if(!M.eql(M.sqr(Ft),Z))throw new Error("Cannot find square root");return Ft}const M=(0,c.Field)(m,void 0,void 0,{sqrt:O});f.secp256k1=(0,E.createCurve)({a:BigInt(0),b:BigInt(7),Fp:M,n:C,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:Z=>{const z=C,fe=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),te=-x*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),H=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),Q=fe,oe=BigInt("0x100000000000000000000000000000000"),_e=S(Q*Z,z),ge=S(-te*Z,z);let be=(0,c.mod)(Z-_e*fe-ge*H,z),we=(0,c.mod)(-_e*te-ge*Q,z);const Ee=be>oe,me=we>oe;if(Ee&&(be=z-be),me&&(we=z-we),be>oe||we>oe)throw new Error("splitScalar: Endomorphism failed, k="+Z);return{k1neg:Ee,k1:be,k2neg:me,k2:we}}}},h.sha256);const k=BigInt(0),q=Z=>typeof Z=="bigint"&&k<Z&&Z<m,b=Z=>typeof Z=="bigint"&&k<Z&&Z<C,F={};function G(Z,...z){let fe=F[Z];if(fe===void 0){const te=(0,h.sha256)(Uint8Array.from(Z,H=>H.charCodeAt(0)));fe=(0,d.concatBytes)(te,te),F[Z]=fe}return(0,h.sha256)((0,d.concatBytes)(fe,...z))}const ue=Z=>Z.toRawBytes(!0).slice(1),le=Z=>(0,d.numberToBytesBE)(Z,32),X=Z=>(0,c.mod)(Z,m),se=Z=>(0,c.mod)(Z,C),de=f.secp256k1.ProjectivePoint,ye=(Z,z,fe)=>de.BASE.multiplyAndAddUnsafe(Z,z,fe);function he(Z){let z=f.secp256k1.utils.normPrivateKeyToScalar(Z),fe=de.fromPrivateKey(z);return{scalar:fe.hasEvenY()?z:se(-z),bytes:ue(fe)}}function K(Z){if(!q(Z))throw new Error("bad x: need 0 < x < p");const z=X(Z*Z),fe=X(z*Z+BigInt(7));let te=O(fe);te%R!==k&&(te=X(-te));const H=new de(Z,te,x);return H.assertValidity(),H}function B(...Z){return se((0,d.bytesToNumberBE)(G("BIP0340/challenge",...Z)))}function L(Z){return he(Z).bytes}function $(Z,z,fe=(0,w.randomBytes)(32)){const te=(0,d.ensureBytes)("message",Z),{bytes:H,scalar:Q}=he(z),oe=(0,d.ensureBytes)("auxRand",fe,32),_e=le(Q^(0,d.bytesToNumberBE)(G("BIP0340/aux",oe))),ge=G("BIP0340/nonce",_e,H,te),be=se((0,d.bytesToNumberBE)(ge));if(be===k)throw new Error("sign failed: k is zero");const{bytes:we,scalar:Ee}=he(be),me=B(we,H,te),Ke=new Uint8Array(64);if(Ke.set(we,0),Ke.set(le(se(Ee+me*Q)),32),!T(Ke,te,H))throw new Error("sign: Invalid signature produced");return Ke}function T(Z,z,fe){const te=(0,d.ensureBytes)("signature",Z,64),H=(0,d.ensureBytes)("message",z),Q=(0,d.ensureBytes)("publicKey",fe,32);try{const oe=K((0,d.bytesToNumberBE)(Q)),_e=(0,d.bytesToNumberBE)(te.subarray(0,32));if(!q(_e))return!1;const ge=(0,d.bytesToNumberBE)(te.subarray(32,64));if(!b(ge))return!1;const be=B(le(_e),ue(oe),H),we=ye(oe,ge,se(-be));return!(!we||!we.hasEvenY()||we.toAffine().x!==_e)}catch{return!1}}f.schnorr={getPublicKey:L,sign:$,verify:T,utils:{randomPrivateKey:f.secp256k1.utils.randomPrivateKey,lift_x:K,pointToBytes:ue,numberToBytesBE:d.numberToBytesBE,bytesToNumberBE:d.bytesToNumberBE,taggedHash:G,mod:c.mod}};const N=(0,v.isogenyMap)(M,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(Z=>Z.map(z=>BigInt(z)))),j=(0,p.mapToCurveSimpleSWU)(M,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:M.create(BigInt("-11"))}),Y=(0,v.createHasher)(f.secp256k1.ProjectivePoint,Z=>{const{x:z,y:fe}=j(M.create(Z[0]));return N(z,fe)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:M.ORDER,m:1,k:128,expand:"xmd",hash:h.sha256});f.hashToCurve=Y.hashToCurve,f.encodeToCurve=Y.encodeToCurve},56918:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getHash=w,f.createCurve=E;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(25205);function w(v){return{hash:v}}function E(v,c){const d=p=>(0,h.weierstrass)({...v,hash:p});return{...d(c),create:d}}},91258:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.wNAF=void 0,f.negateCt=c,f.normalizeZ=d,f.mulEndoUnsafe=b,f.pippenger=F,f.precomputeMSMUnsafe=G,f.validateBasic=ue,f._createCurveFields=X;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(18215),w=_(96795),E=BigInt(0),v=BigInt(1);function c(se,de){const ye=de.negate();return se?ye:de}function d(se,de){const ye=(0,w.FpInvertBatch)(se.Fp,de.map(he=>he.Z));return de.map((he,K)=>se.fromAffine(he.toAffine(ye[K])))}function p(se,de){if(!Number.isSafeInteger(se)||se<=0||se>de)throw new Error("invalid window size, expected [1.."+de+"], got W="+se)}function m(se,de){p(se,de);const ye=Math.ceil(de/se)+1,he=2**(se-1),K=2**se,B=(0,h.bitMask)(se),L=BigInt(se);return{windows:ye,windowSize:he,mask:B,maxNumber:K,shiftBy:L}}function C(se,de,ye){const{windowSize:he,mask:K,maxNumber:B,shiftBy:L}=ye;let $=Number(se&K),T=se>>L;$>he&&($-=B,T+=v);const N=de*he,j=N+Math.abs($)-1,Y=$===0,Z=$<0,z=de%2!==0;return{nextN:T,offset:j,isZero:Y,isNeg:Z,isNegF:z,offsetF:N}}function x(se,de){if(!Array.isArray(se))throw new Error("array expected");se.forEach((ye,he)=>{if(!(ye instanceof de))throw new Error("invalid point at index "+he)})}function R(se,de){if(!Array.isArray(se))throw new Error("array of scalars expected");se.forEach((ye,he)=>{if(!de.isValid(ye))throw new Error("invalid scalar at index "+he)})}const S=new WeakMap,O=new WeakMap;function M(se){return O.get(se)||1}function k(se){if(se!==E)throw new Error("invalid wNAF")}class q{constructor(de,ye){this.BASE=de.BASE,this.ZERO=de.ZERO,this.Fn=de.Fn,this.bits=ye}_unsafeLadder(de,ye,he=this.ZERO){let K=de;for(;ye>E;)ye&v&&(he=he.add(K)),K=K.double(),ye>>=v;return he}precomputeWindow(de,ye){const{windows:he,windowSize:K}=m(ye,this.bits),B=[];let L=de,$=L;for(let T=0;T<he;T++){$=L,B.push($);for(let N=1;N<K;N++)$=$.add(L),B.push($);L=$.double()}return B}wNAF(de,ye,he){if(!this.Fn.isValid(he))throw new Error("invalid scalar");let K=this.ZERO,B=this.BASE;const L=m(de,this.bits);for(let $=0;$<L.windows;$++){const{nextN:T,offset:N,isZero:j,isNeg:Y,isNegF:Z,offsetF:z}=C(he,$,L);he=T,j?B=B.add(c(Z,ye[z])):K=K.add(c(Y,ye[N]))}return k(he),{p:K,f:B}}wNAFUnsafe(de,ye,he,K=this.ZERO){const B=m(de,this.bits);for(let L=0;L<B.windows&&he!==E;L++){const{nextN:$,offset:T,isZero:N,isNeg:j}=C(he,L,B);if(he=$,!N){const Y=ye[T];K=K.add(j?Y.negate():Y)}}return k(he),K}getPrecomputes(de,ye,he){let K=S.get(ye);return K||(K=this.precomputeWindow(ye,de),de!==1&&(typeof he=="function"&&(K=he(K)),S.set(ye,K))),K}cached(de,ye,he){const K=M(de);return this.wNAF(K,this.getPrecomputes(K,de,he),ye)}unsafe(de,ye,he,K){const B=M(de);return B===1?this._unsafeLadder(de,ye,K):this.wNAFUnsafe(B,this.getPrecomputes(B,de,he),ye,K)}createCache(de,ye){p(ye,this.bits),O.set(de,ye),S.delete(de)}hasCache(de){return M(de)!==1}}f.wNAF=q;function b(se,de,ye,he){let K=de,B=se.ZERO,L=se.ZERO;for(;ye>E||he>E;)ye&v&&(B=B.add(K)),he&v&&(L=L.add(K)),K=K.double(),ye>>=v,he>>=v;return{p1:B,p2:L}}function F(se,de,ye,he){x(ye,se),R(he,de);const K=ye.length,B=he.length;if(K!==B)throw new Error("arrays of points and scalars must have equal length");const L=se.ZERO,$=(0,h.bitLen)(BigInt(K));let T=1;$>12?T=$-3:$>4?T=$-2:$>0&&(T=2);const N=(0,h.bitMask)(T),j=new Array(Number(N)+1).fill(L),Y=Math.floor((de.BITS-1)/T)*T;let Z=L;for(let z=Y;z>=0;z-=T){j.fill(L);for(let te=0;te<B;te++){const H=he[te],Q=Number(H>>BigInt(z)&N);j[Q]=j[Q].add(ye[te])}let fe=L;for(let te=j.length-1,H=L;te>0;te--)H=H.add(j[te]),fe=fe.add(H);if(Z=Z.add(fe),z!==0)for(let te=0;te<T;te++)Z=Z.double()}return Z}function G(se,de,ye,he){p(he,de.BITS),x(ye,se);const K=se.ZERO,B=2**he-1,L=Math.ceil(de.BITS/he),$=(0,h.bitMask)(he),T=ye.map(N=>{const j=[];for(let Y=0,Z=N;Y<B;Y++)j.push(Z),Z=Z.add(N);return j});return N=>{if(R(N,de),N.length>ye.length)throw new Error("array of scalars must be smaller than array of points");let j=K;for(let Y=0;Y<L;Y++){if(j!==K)for(let z=0;z<he;z++)j=j.double();const Z=BigInt(L*he-(Y+1)*he);for(let z=0;z<N.length;z++){const fe=N[z],te=Number(fe>>Z&$);te&&(j=j.add(T[z][te-1]))}}return j}}function ue(se){return(0,w.validateField)(se.Fp),(0,h.validateObject)(se,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,w.nLength)(se.n,se.nBitLength),...se,p:se.Fp.ORDER})}function le(se,de,ye){if(de){if(de.ORDER!==se)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,w.validateField)(de),de}else return(0,w.Field)(se,{isLE:ye})}function X(se,de,ye={},he){if(he===void 0&&(he=se==="edwards"),!de||typeof de!="object")throw new Error(`expected valid ${se} CURVE object`);for(const T of["p","n","h"]){const N=de[T];if(!(typeof N=="bigint"&&N>E))throw new Error(`CURVE.${T} must be positive bigint`)}const K=le(de.p,ye.Fp,he),B=le(de.n,ye.Fn,he),$=["Gx","Gy","a",se==="weierstrass"?"b":"d"];for(const T of $)if(!K.isValid(de[T]))throw new Error(`CURVE.${T} must be valid field element of CURVE.Fp`);return de=Object.freeze(Object.assign({},de)),{CURVE:de,Fp:K,Fn:B}}},54549:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.PrimeEdwardsPoint=void 0,f.edwards=C,f.eddsa=R,f.twistedEdwards=M;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(18215),w=_(91258),E=_(96795),v=BigInt(0),c=BigInt(1),d=BigInt(2),p=BigInt(8);function m(k,q,b,F){const G=k.sqr(b),ue=k.sqr(F),le=k.add(k.mul(q.a,G),ue),X=k.add(k.ONE,k.mul(q.d,k.mul(G,ue)));return k.eql(le,X)}function C(k,q={}){const b=(0,w._createCurveFields)("edwards",k,q,q.FpFnLE),{Fp:F,Fn:G}=b;let ue=b.CURVE;const{h:le}=ue;(0,h._validateObject)(q,{},{uvRatio:"function"});const X=d<<BigInt(G.BYTES*8)-c,se=T=>F.create(T),de=q.uvRatio||((T,N)=>{try{return{isValid:!0,value:F.sqrt(F.div(T,N))}}catch{return{isValid:!1,value:v}}});if(!m(F,ue,ue.Gx,ue.Gy))throw new Error("bad curve params: generator point");function ye(T,N,j=!1){const Y=j?c:v;return(0,h.aInRange)("coordinate "+T,N,Y,X),N}function he(T){if(!(T instanceof L))throw new Error("ExtendedPoint expected")}const K=(0,h.memoized)((T,N)=>{const{X:j,Y,Z}=T,z=T.is0();N==null&&(N=z?p:F.inv(Z));const fe=se(j*N),te=se(Y*N),H=F.mul(Z,N);if(z)return{x:v,y:c};if(H!==c)throw new Error("invZ was invalid");return{x:fe,y:te}}),B=(0,h.memoized)(T=>{const{a:N,d:j}=ue;if(T.is0())throw new Error("bad point: ZERO");const{X:Y,Y:Z,Z:z,T:fe}=T,te=se(Y*Y),H=se(Z*Z),Q=se(z*z),oe=se(Q*Q),_e=se(te*N),ge=se(Q*se(_e+H)),be=se(oe+se(j*se(te*H)));if(ge!==be)throw new Error("bad point: equation left != right (1)");const we=se(Y*Z),Ee=se(z*fe);if(we!==Ee)throw new Error("bad point: equation left != right (2)");return!0});class L{constructor(N,j,Y,Z){this.X=ye("x",N),this.Y=ye("y",j),this.Z=ye("z",Y,!0),this.T=ye("t",Z),Object.freeze(this)}static CURVE(){return ue}static fromAffine(N){if(N instanceof L)throw new Error("extended point not allowed");const{x:j,y:Y}=N||{};return ye("x",j),ye("y",Y),new L(j,Y,c,se(j*Y))}static fromBytes(N,j=!1){const Y=F.BYTES,{a:Z,d:z}=ue;N=(0,h.copyBytes)((0,h._abytes2)(N,Y,"point")),(0,h._abool2)(j,"zip215");const fe=(0,h.copyBytes)(N),te=N[Y-1];fe[Y-1]=te&-129;const H=(0,h.bytesToNumberLE)(fe),Q=j?X:F.ORDER;(0,h.aInRange)("point.y",H,v,Q);const oe=se(H*H),_e=se(oe-c),ge=se(z*oe-Z);let{isValid:be,value:we}=de(_e,ge);if(!be)throw new Error("bad point: invalid y coordinate");const Ee=(we&c)===c,me=(te&128)!==0;if(!j&&we===v&&me)throw new Error("bad point: x=0 and x_0=1");return me!==Ee&&(we=se(-we)),L.fromAffine({x:we,y:H})}static fromHex(N,j=!1){return L.fromBytes((0,h.ensureBytes)("point",N),j)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(N=8,j=!0){return $.createCache(this,N),j||this.multiply(d),this}assertValidity(){B(this)}equals(N){he(N);const{X:j,Y,Z}=this,{X:z,Y:fe,Z:te}=N,H=se(j*te),Q=se(z*Z),oe=se(Y*te),_e=se(fe*Z);return H===Q&&oe===_e}is0(){return this.equals(L.ZERO)}negate(){return new L(se(-this.X),this.Y,this.Z,se(-this.T))}double(){const{a:N}=ue,{X:j,Y,Z}=this,z=se(j*j),fe=se(Y*Y),te=se(d*se(Z*Z)),H=se(N*z),Q=j+Y,oe=se(se(Q*Q)-z-fe),_e=H+fe,ge=_e-te,be=H-fe,we=se(oe*ge),Ee=se(_e*be),me=se(oe*be),Ke=se(ge*_e);return new L(we,Ee,Ke,me)}add(N){he(N);const{a:j,d:Y}=ue,{X:Z,Y:z,Z:fe,T:te}=this,{X:H,Y:Q,Z:oe,T:_e}=N,ge=se(Z*H),be=se(z*Q),we=se(te*Y*_e),Ee=se(fe*oe),me=se((Z+z)*(H+Q)-ge-be),Ke=Ee-we,He=Ee+we,Ie=se(be-j*ge),Le=se(me*Ke),Ge=se(He*Ie),Be=se(me*Ie),We=se(Ke*He);return new L(Le,Ge,We,Be)}subtract(N){return this.add(N.negate())}multiply(N){if(!G.isValidNot0(N))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:j,f:Y}=$.cached(this,N,Z=>(0,w.normalizeZ)(L,Z));return(0,w.normalizeZ)(L,[j,Y])[0]}multiplyUnsafe(N,j=L.ZERO){if(!G.isValid(N))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return N===v?L.ZERO:this.is0()||N===c?this:$.unsafe(this,N,Y=>(0,w.normalizeZ)(L,Y),j)}isSmallOrder(){return this.multiplyUnsafe(le).is0()}isTorsionFree(){return $.unsafe(this,ue.n).is0()}toAffine(N){return K(this,N)}clearCofactor(){return le===c?this:this.multiplyUnsafe(le)}toBytes(){const{x:N,y:j}=this.toAffine(),Y=F.toBytes(j);return Y[Y.length-1]|=N&c?128:0,Y}toHex(){return(0,h.bytesToHex)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(N){return(0,w.normalizeZ)(L,N)}static msm(N,j){return(0,w.pippenger)(L,G,N,j)}_setWindowSize(N){this.precompute(N)}toRawBytes(){return this.toBytes()}}L.BASE=new L(ue.Gx,ue.Gy,c,se(ue.Gx*ue.Gy)),L.ZERO=new L(v,c,c,v),L.Fp=F,L.Fn=G;const $=new w.wNAF(L,G.BITS);return L.BASE.precompute(8),L}class x{constructor(q){this.ep=q}static fromBytes(q){(0,h.notImplemented)()}static fromHex(q){(0,h.notImplemented)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(q){return this.ep.toAffine(q)}toHex(){return(0,h.bytesToHex)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(q){return this.assertSame(q),this.init(this.ep.add(q.ep))}subtract(q){return this.assertSame(q),this.init(this.ep.subtract(q.ep))}multiply(q){return this.init(this.ep.multiply(q))}multiplyUnsafe(q){return this.init(this.ep.multiplyUnsafe(q))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(q,b){return this.init(this.ep.precompute(q,b))}toRawBytes(){return this.toBytes()}}f.PrimeEdwardsPoint=x;function R(k,q,b={}){if(typeof q!="function")throw new Error('"hash" function param is required');(0,h._validateObject)(b,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:F}=b,{BASE:G,Fp:ue,Fn:le}=k,X=b.randomBytes||h.randomBytes,se=b.adjustScalarBytes||(Q=>Q),de=b.domain||((Q,oe,_e)=>{if((0,h._abool2)(_e,"phflag"),oe.length||_e)throw new Error("Contexts/pre-hash are not supported");return Q});function ye(Q){return le.create((0,h.bytesToNumberLE)(Q))}function he(Q){const oe=Y.secretKey;Q=(0,h.ensureBytes)("private key",Q,oe);const _e=(0,h.ensureBytes)("hashed private key",q(Q),2*oe),ge=se(_e.slice(0,oe)),be=_e.slice(oe,2*oe),we=ye(ge);return{head:ge,prefix:be,scalar:we}}function K(Q){const{head:oe,prefix:_e,scalar:ge}=he(Q),be=G.multiply(ge),we=be.toBytes();return{head:oe,prefix:_e,scalar:ge,point:be,pointBytes:we}}function B(Q){return K(Q).pointBytes}function L(Q=Uint8Array.of(),...oe){const _e=(0,h.concatBytes)(...oe);return ye(q(de(_e,(0,h.ensureBytes)("context",Q),!!F)))}function $(Q,oe,_e={}){Q=(0,h.ensureBytes)("message",Q),F&&(Q=F(Q));const{prefix:ge,scalar:be,pointBytes:we}=K(oe),Ee=L(_e.context,ge,Q),me=G.multiply(Ee).toBytes(),Ke=L(_e.context,me,we,Q),He=le.create(Ee+Ke*be);if(!le.isValid(He))throw new Error("sign failed: invalid s");const Ie=(0,h.concatBytes)(me,le.toBytes(He));return(0,h._abytes2)(Ie,Y.signature,"result")}const T={zip215:!0};function N(Q,oe,_e,ge=T){const{context:be,zip215:we}=ge,Ee=Y.signature;Q=(0,h.ensureBytes)("signature",Q,Ee),oe=(0,h.ensureBytes)("message",oe),_e=(0,h.ensureBytes)("publicKey",_e,Y.publicKey),we!==void 0&&(0,h._abool2)(we,"zip215"),F&&(oe=F(oe));const me=Ee/2,Ke=Q.subarray(0,me),He=(0,h.bytesToNumberLE)(Q.subarray(me,Ee));let Ie,Le,Ge;try{Ie=k.fromBytes(_e,we),Le=k.fromBytes(Ke,we),Ge=G.multiplyUnsafe(He)}catch{return!1}if(!we&&Ie.isSmallOrder())return!1;const Be=L(be,Le.toBytes(),Ie.toBytes(),oe);return Le.add(Ie.multiplyUnsafe(Be)).subtract(Ge).clearCofactor().is0()}const j=ue.BYTES,Y={secretKey:j,publicKey:j,signature:2*j,seed:j};function Z(Q=X(Y.seed)){return(0,h._abytes2)(Q,Y.seed,"seed")}function z(Q){const oe=H.randomSecretKey(Q);return{secretKey:oe,publicKey:B(oe)}}function fe(Q){return(0,h.isBytes)(Q)&&Q.length===le.BYTES}function te(Q,oe){try{return!!k.fromBytes(Q,oe)}catch{return!1}}const H={getExtendedPublicKey:K,randomSecretKey:Z,isValidSecretKey:fe,isValidPublicKey:te,toMontgomery(Q){const{y:oe}=k.fromBytes(Q),_e=Y.publicKey,ge=_e===32;if(!ge&&_e!==57)throw new Error("only defined for 25519 and 448");const be=ge?ue.div(c+oe,c-oe):ue.div(oe-c,oe+c);return ue.toBytes(be)},toMontgomeryPriv(Q){const oe=Y.secretKey;(0,h._abytes2)(Q,oe);const _e=q(Q.subarray(0,oe));return se(_e).subarray(0,oe)},randomPrivateKey:Z,precompute(Q=8,oe=k.BASE){return oe.precompute(Q,!1)}};return Object.freeze({keygen:z,getPublicKey:B,sign:$,verify:N,utils:H,Point:k,lengths:Y})}function S(k){const q={a:k.a,d:k.d,p:k.Fp.ORDER,n:k.n,h:k.h,Gx:k.Gx,Gy:k.Gy},b=k.Fp,F=(0,E.Field)(q.n,k.nBitLength,!0),G={Fp:b,Fn:F,uvRatio:k.uvRatio},ue={randomBytes:k.randomBytes,adjustScalarBytes:k.adjustScalarBytes,domain:k.domain,prehash:k.prehash,mapToCurve:k.mapToCurve};return{CURVE:q,curveOpts:G,hash:k.hash,eddsaOpts:ue}}function O(k,q){const b=q.Point;return Object.assign({},q,{ExtendedPoint:b,CURVE:k,nBitLength:b.Fn.BITS,nByteLength:b.Fn.BYTES})}function M(k){const{CURVE:q,curveOpts:b,hash:F,eddsaOpts:G}=S(k),ue=C(q,b),le=R(ue,F,G);return O(k,le)}},10853:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f._DST_scalar=void 0,f.expand_message_xmd=m,f.expand_message_xof=C,f.hash_to_field=x,f.isogenyMap=R,f.createHasher=S;const h=_(18215),w=_(96795),E=h.bytesToNumberBE;function v(O,M){if(d(O),d(M),O<0||O>=1<<8*M)throw new Error("invalid I2OSP input: "+O);const k=Array.from({length:M}).fill(0);for(let q=M-1;q>=0;q--)k[q]=O&255,O>>>=8;return new Uint8Array(k)}function c(O,M){const k=new Uint8Array(O.length);for(let q=0;q<O.length;q++)k[q]=O[q]^M[q];return k}function d(O){if(!Number.isSafeInteger(O))throw new Error("number expected")}function p(O){if(!(0,h.isBytes)(O)&&typeof O!="string")throw new Error("DST must be Uint8Array or string");return typeof O=="string"?(0,h.utf8ToBytes)(O):O}function m(O,M,k,q){(0,h.abytes)(O),d(k),M=p(M),M.length>255&&(M=q((0,h.concatBytes)((0,h.utf8ToBytes)("H2C-OVERSIZE-DST-"),M)));const{outputLen:b,blockLen:F}=q,G=Math.ceil(k/b);if(k>65535||G>255)throw new Error("expand_message_xmd: invalid lenInBytes");const ue=(0,h.concatBytes)(M,v(M.length,1)),le=v(0,F),X=v(k,2),se=new Array(G),de=q((0,h.concatBytes)(le,O,X,v(0,1),ue));se[0]=q((0,h.concatBytes)(de,v(1,1),ue));for(let he=1;he<=G;he++){const K=[c(de,se[he-1]),v(he+1,1),ue];se[he]=q((0,h.concatBytes)(...K))}return(0,h.concatBytes)(...se).slice(0,k)}function C(O,M,k,q,b){if((0,h.abytes)(O),d(k),M=p(M),M.length>255){const F=Math.ceil(2*q/8);M=b.create({dkLen:F}).update((0,h.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(M).digest()}if(k>65535||M.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return b.create({dkLen:k}).update(O).update(v(k,2)).update(M).update(v(M.length,1)).digest()}function x(O,M,k){(0,h._validateObject)(k,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:q,k:b,m:F,hash:G,expand:ue,DST:le}=k;if(!(0,h.isHash)(k.hash))throw new Error("expected valid hash");(0,h.abytes)(O),d(M);const X=q.toString(2).length,se=Math.ceil((X+b)/8),de=M*F*se;let ye;if(ue==="xmd")ye=m(O,le,de,G);else if(ue==="xof")ye=C(O,le,de,b,G);else if(ue==="_internal_pass")ye=O;else throw new Error('expand must be "xmd" or "xof"');const he=new Array(M);for(let K=0;K<M;K++){const B=new Array(F);for(let L=0;L<F;L++){const $=se*(L+K*F),T=ye.subarray($,$+se);B[L]=(0,w.mod)(E(T),q)}he[K]=B}return he}function R(O,M){const k=M.map(q=>Array.from(q).reverse());return(q,b)=>{const[F,G,ue,le]=k.map(de=>de.reduce((ye,he)=>O.add(O.mul(ye,q),he))),[X,se]=(0,w.FpInvertBatch)(O,[G,le],!0);return q=O.mul(F,X),b=O.mul(b,O.mul(ue,se)),{x:q,y:b}}}f._DST_scalar=(0,h.utf8ToBytes)("HashToScalar-");function S(O,M,k){if(typeof M!="function")throw new Error("mapToCurve() must be defined");function q(F){return O.fromAffine(M(F))}function b(F){const G=F.clearCofactor();return G.equals(O.ZERO)?O.ZERO:(G.assertValidity(),G)}return{defaults:k,hashToCurve(F,G){const ue=Object.assign({},k,G),le=x(F,2,ue),X=q(le[0]),se=q(le[1]);return b(X.add(se))},encodeToCurve(F,G){const ue=k.encodeDST?{DST:k.encodeDST}:{},le=Object.assign({},k,ue,G),X=x(F,1,le),se=q(X[0]);return b(se)},mapToCurve(F){if(!Array.isArray(F))throw new Error("expected array of bigints");for(const G of F)if(typeof G!="bigint")throw new Error("expected array of bigints");return b(q(F))},hashToScalar(F,G){const ue=O.Fn.ORDER,le=Object.assign({},k,{p:ue,m:1,DST:f._DST_scalar},G);return x(F,1,le)[0][0]}}}},96795:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.isNegativeLE=void 0,f.mod=S,f.pow=O,f.pow2=M,f.invert=k,f.tonelliShanks=ue,f.FpSqrt=le,f.validateField=de,f.FpPow=ye,f.FpInvertBatch=he,f.FpDiv=K,f.FpLegendre=B,f.FpIsSquare=L,f.nLength=$,f.Field=T,f.FpSqrtOdd=N,f.FpSqrtEven=j,f.hashToPrivateScalar=Y,f.getFieldBytesLength=Z,f.getMinHashLength=z,f.mapHashToField=fe;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(18215),w=BigInt(0),E=BigInt(1),v=BigInt(2),c=BigInt(3),d=BigInt(4),p=BigInt(5),m=BigInt(7),C=BigInt(8),x=BigInt(9),R=BigInt(16);function S(te,H){const Q=te%H;return Q>=w?Q:H+Q}function O(te,H,Q){return ye(T(Q),te,H)}function M(te,H,Q){let oe=te;for(;H-- >w;)oe*=oe,oe%=Q;return oe}function k(te,H){if(te===w)throw new Error("invert: expected non-zero number");if(H<=w)throw new Error("invert: expected positive modulus, got "+H);let Q=S(te,H),oe=H,_e=w,ge=E,be=E,we=w;for(;Q!==w;){const me=oe/Q,Ke=oe%Q,He=_e-be*me,Ie=ge-we*me;oe=Q,Q=Ke,_e=be,ge=we,be=He,we=Ie}if(oe!==E)throw new Error("invert: does not exist");return S(_e,H)}function q(te,H,Q){if(!te.eql(te.sqr(H),Q))throw new Error("Cannot find square root")}function b(te,H){const Q=(te.ORDER+E)/d,oe=te.pow(H,Q);return q(te,oe,H),oe}function F(te,H){const Q=(te.ORDER-p)/C,oe=te.mul(H,v),_e=te.pow(oe,Q),ge=te.mul(H,_e),be=te.mul(te.mul(ge,v),_e),we=te.mul(ge,te.sub(be,te.ONE));return q(te,we,H),we}function G(te){const H=T(te),Q=ue(te),oe=Q(H,H.neg(H.ONE)),_e=Q(H,oe),ge=Q(H,H.neg(oe)),be=(te+m)/R;return(we,Ee)=>{let me=we.pow(Ee,be),Ke=we.mul(me,oe);const He=we.mul(me,_e),Ie=we.mul(me,ge),Le=we.eql(we.sqr(Ke),Ee),Ge=we.eql(we.sqr(He),Ee);me=we.cmov(me,Ke,Le),Ke=we.cmov(Ie,He,Ge);const Be=we.eql(we.sqr(Ke),Ee),We=we.cmov(me,Ke,Be);return q(we,We,Ee),We}}function ue(te){if(te<c)throw new Error("sqrt is not defined for small field");let H=te-E,Q=0;for(;H%v===w;)H/=v,Q++;let oe=v;const _e=T(te);for(;B(_e,oe)===1;)if(oe++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(Q===1)return b;let ge=_e.pow(oe,H);const be=(H+E)/v;return function(Ee,me){if(Ee.is0(me))return me;if(B(Ee,me)!==1)throw new Error("Cannot find square root");let Ke=Q,He=Ee.mul(Ee.ONE,ge),Ie=Ee.pow(me,H),Le=Ee.pow(me,be);for(;!Ee.eql(Ie,Ee.ONE);){if(Ee.is0(Ie))return Ee.ZERO;let Ge=1,Be=Ee.sqr(Ie);for(;!Ee.eql(Be,Ee.ONE);)if(Ge++,Be=Ee.sqr(Be),Ge===Ke)throw new Error("Cannot find square root");const We=E<<BigInt(Ke-Ge-1),Ze=Ee.pow(He,We);Ke=Ge,He=Ee.sqr(Ze),Ie=Ee.mul(Ie,He),Le=Ee.mul(Le,Ze)}return Le}}function le(te){return te%d===c?b:te%C===p?F:te%R===x?G(te):ue(te)}const X=(te,H)=>(S(te,H)&E)===E;f.isNegativeLE=X;const se=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function de(te){const H={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},Q=se.reduce((oe,_e)=>(oe[_e]="function",oe),H);return(0,h._validateObject)(te,Q),te}function ye(te,H,Q){if(Q<w)throw new Error("invalid exponent, negatives unsupported");if(Q===w)return te.ONE;if(Q===E)return H;let oe=te.ONE,_e=H;for(;Q>w;)Q&E&&(oe=te.mul(oe,_e)),_e=te.sqr(_e),Q>>=E;return oe}function he(te,H,Q=!1){const oe=new Array(H.length).fill(Q?te.ZERO:void 0),_e=H.reduce((be,we,Ee)=>te.is0(we)?be:(oe[Ee]=be,te.mul(be,we)),te.ONE),ge=te.inv(_e);return H.reduceRight((be,we,Ee)=>te.is0(we)?be:(oe[Ee]=te.mul(be,oe[Ee]),te.mul(be,we)),ge),oe}function K(te,H,Q){return te.mul(H,typeof Q=="bigint"?k(Q,te.ORDER):te.inv(Q))}function B(te,H){const Q=(te.ORDER-E)/v,oe=te.pow(H,Q),_e=te.eql(oe,te.ONE),ge=te.eql(oe,te.ZERO),be=te.eql(oe,te.neg(te.ONE));if(!_e&&!ge&&!be)throw new Error("invalid Legendre symbol result");return _e?1:ge?0:-1}function L(te,H){return B(te,H)===1}function $(te,H){H!==void 0&&(0,h.anumber)(H);const Q=H!==void 0?H:te.toString(2).length,oe=Math.ceil(Q/8);return{nBitLength:Q,nByteLength:oe}}function T(te,H,Q=!1,oe={}){if(te<=w)throw new Error("invalid field: expected ORDER > 0, got "+te);let _e,ge,be=!1,we;if(typeof H=="object"&&H!=null){if(oe.sqrt||Q)throw new Error("cannot specify opts in two arguments");const Ie=H;Ie.BITS&&(_e=Ie.BITS),Ie.sqrt&&(ge=Ie.sqrt),typeof Ie.isLE=="boolean"&&(Q=Ie.isLE),typeof Ie.modFromBytes=="boolean"&&(be=Ie.modFromBytes),we=Ie.allowedLengths}else typeof H=="number"&&(_e=H),oe.sqrt&&(ge=oe.sqrt);const{nBitLength:Ee,nByteLength:me}=$(te,_e);if(me>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let Ke;const He=Object.freeze({ORDER:te,isLE:Q,BITS:Ee,BYTES:me,MASK:(0,h.bitMask)(Ee),ZERO:w,ONE:E,allowedLengths:we,create:Ie=>S(Ie,te),isValid:Ie=>{if(typeof Ie!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof Ie);return w<=Ie&&Ie<te},is0:Ie=>Ie===w,isValidNot0:Ie=>!He.is0(Ie)&&He.isValid(Ie),isOdd:Ie=>(Ie&E)===E,neg:Ie=>S(-Ie,te),eql:(Ie,Le)=>Ie===Le,sqr:Ie=>S(Ie*Ie,te),add:(Ie,Le)=>S(Ie+Le,te),sub:(Ie,Le)=>S(Ie-Le,te),mul:(Ie,Le)=>S(Ie*Le,te),pow:(Ie,Le)=>ye(He,Ie,Le),div:(Ie,Le)=>S(Ie*k(Le,te),te),sqrN:Ie=>Ie*Ie,addN:(Ie,Le)=>Ie+Le,subN:(Ie,Le)=>Ie-Le,mulN:(Ie,Le)=>Ie*Le,inv:Ie=>k(Ie,te),sqrt:ge||(Ie=>(Ke||(Ke=le(te)),Ke(He,Ie))),toBytes:Ie=>Q?(0,h.numberToBytesLE)(Ie,me):(0,h.numberToBytesBE)(Ie,me),fromBytes:(Ie,Le=!0)=>{if(we){if(!we.includes(Ie.length)||Ie.length>me)throw new Error("Field.fromBytes: expected "+we+" bytes, got "+Ie.length);const Be=new Uint8Array(me);Be.set(Ie,Q?0:Be.length-Ie.length),Ie=Be}if(Ie.length!==me)throw new Error("Field.fromBytes: expected "+me+" bytes, got "+Ie.length);let Ge=Q?(0,h.bytesToNumberLE)(Ie):(0,h.bytesToNumberBE)(Ie);if(be&&(Ge=S(Ge,te)),!Le&&!He.isValid(Ge))throw new Error("invalid field element: outside of range 0..ORDER");return Ge},invertBatch:Ie=>he(He,Ie),cmov:(Ie,Le,Ge)=>Ge?Le:Ie});return Object.freeze(He)}function N(te,H){if(!te.isOdd)throw new Error("Field doesn't have isOdd");const Q=te.sqrt(H);return te.isOdd(Q)?Q:te.neg(Q)}function j(te,H){if(!te.isOdd)throw new Error("Field doesn't have isOdd");const Q=te.sqrt(H);return te.isOdd(Q)?te.neg(Q):Q}function Y(te,H,Q=!1){te=(0,h.ensureBytes)("privateHash",te);const oe=te.length,_e=$(H).nByteLength+8;if(_e<24||oe<_e||oe>1024)throw new Error("hashToPrivateScalar: expected "+_e+"-1024 bytes of input, got "+oe);const ge=Q?(0,h.bytesToNumberLE)(te):(0,h.bytesToNumberBE)(te);return S(ge,H-E)+E}function Z(te){if(typeof te!="bigint")throw new Error("field order must be bigint");const H=te.toString(2).length;return Math.ceil(H/8)}function z(te){const H=Z(te);return H+Math.ceil(H/2)}function fe(te,H,Q=!1){const oe=te.length,_e=Z(H),ge=z(H);if(oe<16||oe<ge||oe>1024)throw new Error("expected "+ge+"-1024 bytes of input, got "+oe);const be=Q?(0,h.bytesToNumberLE)(te):(0,h.bytesToNumberBE)(te),we=S(be,H-E)+E;return Q?(0,h.numberToBytesLE)(we,_e):(0,h.numberToBytesBE)(we,_e)}},7786:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.montgomery=p;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(18215),w=_(96795),E=BigInt(0),v=BigInt(1),c=BigInt(2);function d(m){return(0,h._validateObject)(m,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...m})}function p(m){const C=d(m),{P:x,type:R,adjustScalarBytes:S,powPminus2:O,randomBytes:M}=C,k=R==="x25519";if(!k&&R!=="x448")throw new Error("invalid type");const q=M||h.randomBytes,b=k?255:448,F=k?32:56,G=BigInt(k?9:5),ue=BigInt(k?121665:39081),le=k?c**BigInt(254):c**BigInt(447),X=k?BigInt(8)*c**BigInt(251)-v:BigInt(4)*c**BigInt(445)-v,se=le+X+v,de=fe=>(0,w.mod)(fe,x),ye=he(G);function he(fe){return(0,h.numberToBytesLE)(de(fe),F)}function K(fe){const te=(0,h.ensureBytes)("u coordinate",fe,F);return k&&(te[31]&=127),de((0,h.bytesToNumberLE)(te))}function B(fe){return(0,h.bytesToNumberLE)(S((0,h.ensureBytes)("scalar",fe,F)))}function L(fe,te){const H=N(K(te),B(fe));if(H===E)throw new Error("invalid private or public key received");return he(H)}function $(fe){return L(fe,ye)}function T(fe,te,H){const Q=de(fe*(te-H));return te=de(te-Q),H=de(H+Q),{x_2:te,x_3:H}}function N(fe,te){(0,h.aInRange)("u",fe,E,x),(0,h.aInRange)("scalar",te,le,se);const H=te,Q=fe;let oe=v,_e=E,ge=fe,be=v,we=E;for(let me=BigInt(b-1);me>=E;me--){const Ke=H>>me&v;we^=Ke,{x_2:oe,x_3:ge}=T(we,oe,ge),{x_2:_e,x_3:be}=T(we,_e,be),we=Ke;const He=oe+_e,Ie=de(He*He),Le=oe-_e,Ge=de(Le*Le),Be=Ie-Ge,We=ge+be,Ze=ge-be,_t=de(Ze*He),Ft=de(We*Le),gt=_t+Ft,lt=_t-Ft;ge=de(gt*gt),be=de(Q*de(lt*lt)),oe=de(Ie*Ge),_e=de(Be*(Ie+de(ue*Be)))}({x_2:oe,x_3:ge}=T(we,oe,ge)),{x_2:_e,x_3:be}=T(we,_e,be);const Ee=O(_e);return de(oe*Ee)}const j={secretKey:F,publicKey:F,seed:F},Y=(fe=q(F))=>((0,h.abytes)(fe,j.seed),fe);function Z(fe){const te=Y(fe);return{secretKey:te,publicKey:$(te)}}return{keygen:Z,getSharedSecret:(fe,te)=>L(fe,te),getPublicKey:fe=>$(fe),scalarMult:L,scalarMultBase:$,utils:{randomSecretKey:Y,randomPrivateKey:Y},GuBytes:ye.slice(),lengths:j}}},25205:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.DER=f.DERErr=void 0,f._splitEndoScalar=p,f._normFnElement=q,f.weierstrassN=b,f.SWUFpSqrtRatio=G,f.mapToCurveSimpleSWU=ue,f.ecdh=X,f.ecdsa=se,f.weierstrassPoints=de,f._legacyHelperEquat=K,f.weierstrass=$;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(46366),w=_(66624),E=_(18215),v=_(91258),c=_(96795),d=(T,N)=>(T+(T>=0?N:-N)/O)/N;function p(T,N,j){const[[Y,Z],[z,fe]]=N,te=d(fe*T,j),H=d(-Z*T,j);let Q=T-te*Y-H*z,oe=-te*Z-H*fe;const _e=Q<R,ge=oe<R;_e&&(Q=-Q),ge&&(oe=-oe);const be=(0,E.bitMask)(Math.ceil((0,E.bitLen)(j)/2))+S;if(Q<R||Q>=be||oe<R||oe>=be)throw new Error("splitScalar (endomorphism): failed, k="+T);return{k1neg:_e,k1:Q,k2neg:ge,k2:oe}}function m(T){if(!["compact","recovered","der"].includes(T))throw new Error('Signature format must be "compact", "recovered", or "der"');return T}function C(T,N){const j={};for(let Y of Object.keys(N))j[Y]=T[Y]===void 0?N[Y]:T[Y];return(0,E._abool2)(j.lowS,"lowS"),(0,E._abool2)(j.prehash,"prehash"),j.format!==void 0&&m(j.format),j}class x extends Error{constructor(N=""){super(N)}}f.DERErr=x,f.DER={Err:x,_tlv:{encode:(T,N)=>{const{Err:j}=f.DER;if(T<0||T>256)throw new j("tlv.encode: wrong tag");if(N.length&1)throw new j("tlv.encode: unpadded data");const Y=N.length/2,Z=(0,E.numberToHexUnpadded)(Y);if(Z.length/2&128)throw new j("tlv.encode: long form length too big");const z=Y>127?(0,E.numberToHexUnpadded)(Z.length/2|128):"";return(0,E.numberToHexUnpadded)(T)+z+Z+N},decode(T,N){const{Err:j}=f.DER;let Y=0;if(T<0||T>256)throw new j("tlv.encode: wrong tag");if(N.length<2||N[Y++]!==T)throw new j("tlv.decode: wrong tlv");const Z=N[Y++],z=!!(Z&128);let fe=0;if(!z)fe=Z;else{const H=Z&127;if(!H)throw new j("tlv.decode(long): indefinite length not supported");if(H>4)throw new j("tlv.decode(long): byte length is too big");const Q=N.subarray(Y,Y+H);if(Q.length!==H)throw new j("tlv.decode: length bytes not complete");if(Q[0]===0)throw new j("tlv.decode(long): zero leftmost byte");for(const oe of Q)fe=fe<<8|oe;if(Y+=H,fe<128)throw new j("tlv.decode(long): not minimal encoding")}const te=N.subarray(Y,Y+fe);if(te.length!==fe)throw new j("tlv.decode: wrong value length");return{v:te,l:N.subarray(Y+fe)}}},_int:{encode(T){const{Err:N}=f.DER;if(T<R)throw new N("integer: negative integers are not allowed");let j=(0,E.numberToHexUnpadded)(T);if(Number.parseInt(j[0],16)&8&&(j="00"+j),j.length&1)throw new N("unexpected DER parsing assertion: unpadded hex");return j},decode(T){const{Err:N}=f.DER;if(T[0]&128)throw new N("invalid signature integer: negative");if(T[0]===0&&!(T[1]&128))throw new N("invalid signature integer: unnecessary leading zero");return(0,E.bytesToNumberBE)(T)}},toSig(T){const{Err:N,_int:j,_tlv:Y}=f.DER,Z=(0,E.ensureBytes)("signature",T),{v:z,l:fe}=Y.decode(48,Z);if(fe.length)throw new N("invalid signature: left bytes after parsing");const{v:te,l:H}=Y.decode(2,z),{v:Q,l:oe}=Y.decode(2,H);if(oe.length)throw new N("invalid signature: left bytes after parsing");return{r:j.decode(te),s:j.decode(Q)}},hexFromSig(T){const{_tlv:N,_int:j}=f.DER,Y=N.encode(2,j.encode(T.r)),Z=N.encode(2,j.encode(T.s)),z=Y+Z;return N.encode(48,z)}};const R=BigInt(0),S=BigInt(1),O=BigInt(2),M=BigInt(3),k=BigInt(4);function q(T,N){const{BYTES:j}=T;let Y;if(typeof N=="bigint")Y=N;else{let Z=(0,E.ensureBytes)("private key",N);try{Y=T.fromBytes(Z)}catch{throw new Error(`invalid private key: expected ui8a of size ${j}, got ${typeof N}`)}}if(!T.isValidNot0(Y))throw new Error("invalid private key: out of range [1..N-1]");return Y}function b(T,N={}){const j=(0,v._createCurveFields)("weierstrass",T,N),{Fp:Y,Fn:Z}=j;let z=j.CURVE;const{h:fe,n:te}=z;(0,E._validateObject)(N,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:H}=N;if(H&&(!Y.is0(z.a)||typeof H.beta!="bigint"||!Array.isArray(H.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const Q=le(Y,Z);function oe(){if(!Y.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function _e(lt,dt,tt){const{x:rt,y:ke}=dt.toAffine(),xe=Y.toBytes(rt);if((0,E._abool2)(tt,"isCompressed"),tt){oe();const Pe=!Y.isOdd(ke);return(0,E.concatBytes)(F(Pe),xe)}else return(0,E.concatBytes)(Uint8Array.of(4),xe,Y.toBytes(ke))}function ge(lt){(0,E._abytes2)(lt,void 0,"Point");const{publicKey:dt,publicKeyUncompressed:tt}=Q,rt=lt.length,ke=lt[0],xe=lt.subarray(1);if(rt===dt&&(ke===2||ke===3)){const Pe=Y.fromBytes(xe);if(!Y.isValid(Pe))throw new Error("bad point: is not on curve, wrong x");const it=Ee(Pe);let Xe;try{Xe=Y.sqrt(it)}catch(ft){const Jt=ft instanceof Error?": "+ft.message:"";throw new Error("bad point: is not on curve, sqrt error"+Jt)}oe();const st=Y.isOdd(Xe);return(ke&1)===1!==st&&(Xe=Y.neg(Xe)),{x:Pe,y:Xe}}else if(rt===tt&&ke===4){const Pe=Y.BYTES,it=Y.fromBytes(xe.subarray(0,Pe)),Xe=Y.fromBytes(xe.subarray(Pe,Pe*2));if(!me(it,Xe))throw new Error("bad point: is not on curve");return{x:it,y:Xe}}else throw new Error(`bad point: got length ${rt}, expected compressed=${dt} or uncompressed=${tt}`)}const be=N.toBytes||_e,we=N.fromBytes||ge;function Ee(lt){const dt=Y.sqr(lt),tt=Y.mul(dt,lt);return Y.add(Y.add(tt,Y.mul(lt,z.a)),z.b)}function me(lt,dt){const tt=Y.sqr(dt),rt=Ee(lt);return Y.eql(tt,rt)}if(!me(z.Gx,z.Gy))throw new Error("bad curve params: generator point");const Ke=Y.mul(Y.pow(z.a,M),k),He=Y.mul(Y.sqr(z.b),BigInt(27));if(Y.is0(Y.add(Ke,He)))throw new Error("bad curve params: a or b");function Ie(lt,dt,tt=!1){if(!Y.isValid(dt)||tt&&Y.is0(dt))throw new Error(`bad point coordinate ${lt}`);return dt}function Le(lt){if(!(lt instanceof _t))throw new Error("ProjectivePoint expected")}function Ge(lt){if(!H||!H.basises)throw new Error("no endo");return p(lt,H.basises,Z.ORDER)}const Be=(0,E.memoized)((lt,dt)=>{const{X:tt,Y:rt,Z:ke}=lt;if(Y.eql(ke,Y.ONE))return{x:tt,y:rt};const xe=lt.is0();dt==null&&(dt=xe?Y.ONE:Y.inv(ke));const Pe=Y.mul(tt,dt),it=Y.mul(rt,dt),Xe=Y.mul(ke,dt);if(xe)return{x:Y.ZERO,y:Y.ZERO};if(!Y.eql(Xe,Y.ONE))throw new Error("invZ was invalid");return{x:Pe,y:it}}),We=(0,E.memoized)(lt=>{if(lt.is0()){if(N.allowInfinityPoint&&!Y.is0(lt.Y))return;throw new Error("bad point: ZERO")}const{x:dt,y:tt}=lt.toAffine();if(!Y.isValid(dt)||!Y.isValid(tt))throw new Error("bad point: x or y not field elements");if(!me(dt,tt))throw new Error("bad point: equation left != right");if(!lt.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function Ze(lt,dt,tt,rt,ke){return tt=new _t(Y.mul(tt.X,lt),tt.Y,tt.Z),dt=(0,v.negateCt)(rt,dt),tt=(0,v.negateCt)(ke,tt),dt.add(tt)}class _t{constructor(dt,tt,rt){this.X=Ie("x",dt),this.Y=Ie("y",tt,!0),this.Z=Ie("z",rt),Object.freeze(this)}static CURVE(){return z}static fromAffine(dt){const{x:tt,y:rt}=dt||{};if(!dt||!Y.isValid(tt)||!Y.isValid(rt))throw new Error("invalid affine point");if(dt instanceof _t)throw new Error("projective point not allowed");return Y.is0(tt)&&Y.is0(rt)?_t.ZERO:new _t(tt,rt,Y.ONE)}static fromBytes(dt){const tt=_t.fromAffine(we((0,E._abytes2)(dt,void 0,"point")));return tt.assertValidity(),tt}static fromHex(dt){return _t.fromBytes((0,E.ensureBytes)("pointHex",dt))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(dt=8,tt=!0){return gt.createCache(this,dt),tt||this.multiply(M),this}assertValidity(){We(this)}hasEvenY(){const{y:dt}=this.toAffine();if(!Y.isOdd)throw new Error("Field doesn't support isOdd");return!Y.isOdd(dt)}equals(dt){Le(dt);const{X:tt,Y:rt,Z:ke}=this,{X:xe,Y:Pe,Z:it}=dt,Xe=Y.eql(Y.mul(tt,it),Y.mul(xe,ke)),st=Y.eql(Y.mul(rt,it),Y.mul(Pe,ke));return Xe&&st}negate(){return new _t(this.X,Y.neg(this.Y),this.Z)}double(){const{a:dt,b:tt}=z,rt=Y.mul(tt,M),{X:ke,Y:xe,Z:Pe}=this;let it=Y.ZERO,Xe=Y.ZERO,st=Y.ZERO,It=Y.mul(ke,ke),ft=Y.mul(xe,xe),Jt=Y.mul(Pe,Pe),Ot=Y.mul(ke,xe);return Ot=Y.add(Ot,Ot),st=Y.mul(ke,Pe),st=Y.add(st,st),it=Y.mul(dt,st),Xe=Y.mul(rt,Jt),Xe=Y.add(it,Xe),it=Y.sub(ft,Xe),Xe=Y.add(ft,Xe),Xe=Y.mul(it,Xe),it=Y.mul(Ot,it),st=Y.mul(rt,st),Jt=Y.mul(dt,Jt),Ot=Y.sub(It,Jt),Ot=Y.mul(dt,Ot),Ot=Y.add(Ot,st),st=Y.add(It,It),It=Y.add(st,It),It=Y.add(It,Jt),It=Y.mul(It,Ot),Xe=Y.add(Xe,It),Jt=Y.mul(xe,Pe),Jt=Y.add(Jt,Jt),It=Y.mul(Jt,Ot),it=Y.sub(it,It),st=Y.mul(Jt,ft),st=Y.add(st,st),st=Y.add(st,st),new _t(it,Xe,st)}add(dt){Le(dt);const{X:tt,Y:rt,Z:ke}=this,{X:xe,Y:Pe,Z:it}=dt;let Xe=Y.ZERO,st=Y.ZERO,It=Y.ZERO;const ft=z.a,Jt=Y.mul(z.b,M);let Ot=Y.mul(tt,xe),Ct=Y.mul(rt,Pe),qe=Y.mul(ke,it),Yt=Y.add(tt,rt),ot=Y.add(xe,Pe);Yt=Y.mul(Yt,ot),ot=Y.add(Ot,Ct),Yt=Y.sub(Yt,ot),ot=Y.add(tt,ke);let Ae=Y.add(xe,it);return ot=Y.mul(ot,Ae),Ae=Y.add(Ot,qe),ot=Y.sub(ot,Ae),Ae=Y.add(rt,ke),Xe=Y.add(Pe,it),Ae=Y.mul(Ae,Xe),Xe=Y.add(Ct,qe),Ae=Y.sub(Ae,Xe),It=Y.mul(ft,ot),Xe=Y.mul(Jt,qe),It=Y.add(Xe,It),Xe=Y.sub(Ct,It),It=Y.add(Ct,It),st=Y.mul(Xe,It),Ct=Y.add(Ot,Ot),Ct=Y.add(Ct,Ot),qe=Y.mul(ft,qe),ot=Y.mul(Jt,ot),Ct=Y.add(Ct,qe),qe=Y.sub(Ot,qe),qe=Y.mul(ft,qe),ot=Y.add(ot,qe),Ot=Y.mul(Ct,ot),st=Y.add(st,Ot),Ot=Y.mul(Ae,ot),Xe=Y.mul(Yt,Xe),Xe=Y.sub(Xe,Ot),Ot=Y.mul(Yt,Ct),It=Y.mul(Ae,It),It=Y.add(It,Ot),new _t(Xe,st,It)}subtract(dt){return this.add(dt.negate())}is0(){return this.equals(_t.ZERO)}multiply(dt){const{endo:tt}=N;if(!Z.isValidNot0(dt))throw new Error("invalid scalar: out of range");let rt,ke;const xe=Pe=>gt.cached(this,Pe,it=>(0,v.normalizeZ)(_t,it));if(tt){const{k1neg:Pe,k1:it,k2neg:Xe,k2:st}=Ge(dt),{p:It,f:ft}=xe(it),{p:Jt,f:Ot}=xe(st);ke=ft.add(Ot),rt=Ze(tt.beta,It,Jt,Pe,Xe)}else{const{p:Pe,f:it}=xe(dt);rt=Pe,ke=it}return(0,v.normalizeZ)(_t,[rt,ke])[0]}multiplyUnsafe(dt){const{endo:tt}=N,rt=this;if(!Z.isValid(dt))throw new Error("invalid scalar: out of range");if(dt===R||rt.is0())return _t.ZERO;if(dt===S)return rt;if(gt.hasCache(this))return this.multiply(dt);if(tt){const{k1neg:ke,k1:xe,k2neg:Pe,k2:it}=Ge(dt),{p1:Xe,p2:st}=(0,v.mulEndoUnsafe)(_t,rt,xe,it);return Ze(tt.beta,Xe,st,ke,Pe)}else return gt.unsafe(rt,dt)}multiplyAndAddUnsafe(dt,tt,rt){const ke=this.multiplyUnsafe(tt).add(dt.multiplyUnsafe(rt));return ke.is0()?void 0:ke}toAffine(dt){return Be(this,dt)}isTorsionFree(){const{isTorsionFree:dt}=N;return fe===S?!0:dt?dt(_t,this):gt.unsafe(this,te).is0()}clearCofactor(){const{clearCofactor:dt}=N;return fe===S?this:dt?dt(_t,this):this.multiplyUnsafe(fe)}isSmallOrder(){return this.multiplyUnsafe(fe).is0()}toBytes(dt=!0){return(0,E._abool2)(dt,"isCompressed"),this.assertValidity(),be(_t,this,dt)}toHex(dt=!0){return(0,E.bytesToHex)(this.toBytes(dt))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(dt=!0){return this.toBytes(dt)}_setWindowSize(dt){this.precompute(dt)}static normalizeZ(dt){return(0,v.normalizeZ)(_t,dt)}static msm(dt,tt){return(0,v.pippenger)(_t,Z,dt,tt)}static fromPrivateKey(dt){return _t.BASE.multiply(q(Z,dt))}}_t.BASE=new _t(z.Gx,z.Gy,Y.ONE),_t.ZERO=new _t(Y.ZERO,Y.ONE,Y.ZERO),_t.Fp=Y,_t.Fn=Z;const Ft=Z.BITS,gt=new v.wNAF(_t,N.endo?Math.ceil(Ft/2):Ft);return _t.BASE.precompute(8),_t}function F(T){return Uint8Array.of(T?2:3)}function G(T,N){const j=T.ORDER;let Y=R;for(let we=j-S;we%O===R;we/=O)Y+=S;const Z=Y,z=O<<Z-S-S,fe=z*O,te=(j-S)/fe,H=(te-S)/O,Q=fe-S,oe=z,_e=T.pow(N,te),ge=T.pow(N,(te+S)/O);let be=(we,Ee)=>{let me=_e,Ke=T.pow(Ee,Q),He=T.sqr(Ke);He=T.mul(He,Ee);let Ie=T.mul(we,He);Ie=T.pow(Ie,H),Ie=T.mul(Ie,Ke),Ke=T.mul(Ie,Ee),He=T.mul(Ie,we);let Le=T.mul(He,Ke);Ie=T.pow(Le,oe);let Ge=T.eql(Ie,T.ONE);Ke=T.mul(He,ge),Ie=T.mul(Le,me),He=T.cmov(Ke,He,Ge),Le=T.cmov(Ie,Le,Ge);for(let Be=Z;Be>S;Be--){let We=Be-O;We=O<<We-S;let Ze=T.pow(Le,We);const _t=T.eql(Ze,T.ONE);Ke=T.mul(He,me),me=T.mul(me,me),Ze=T.mul(Le,me),He=T.cmov(Ke,He,_t),Le=T.cmov(Ze,Le,_t)}return{isValid:Ge,value:He}};if(T.ORDER%k===M){const we=(T.ORDER-M)/k,Ee=T.sqrt(T.neg(N));be=(me,Ke)=>{let He=T.sqr(Ke);const Ie=T.mul(me,Ke);He=T.mul(He,Ie);let Le=T.pow(He,we);Le=T.mul(Le,Ie);const Ge=T.mul(Le,Ee),Be=T.mul(T.sqr(Le),Ke),We=T.eql(Be,me);let Ze=T.cmov(Ge,Le,We);return{isValid:We,value:Ze}}}return be}function ue(T,N){(0,c.validateField)(T);const{A:j,B:Y,Z}=N;if(!T.isValid(j)||!T.isValid(Y)||!T.isValid(Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const z=G(T,Z);if(!T.isOdd)throw new Error("Field does not have .isOdd()");return fe=>{let te,H,Q,oe,_e,ge,be,we;te=T.sqr(fe),te=T.mul(te,Z),H=T.sqr(te),H=T.add(H,te),Q=T.add(H,T.ONE),Q=T.mul(Q,Y),oe=T.cmov(Z,T.neg(H),!T.eql(H,T.ZERO)),oe=T.mul(oe,j),H=T.sqr(Q),ge=T.sqr(oe),_e=T.mul(ge,j),H=T.add(H,_e),H=T.mul(H,Q),ge=T.mul(ge,oe),_e=T.mul(ge,Y),H=T.add(H,_e),be=T.mul(te,Q);const{isValid:Ee,value:me}=z(H,ge);we=T.mul(te,fe),we=T.mul(we,me),be=T.cmov(be,Q,Ee),we=T.cmov(we,me,Ee);const Ke=T.isOdd(fe)===T.isOdd(we);we=T.cmov(T.neg(we),we,Ke);const He=(0,c.FpInvertBatch)(T,[oe],!0)[0];return be=T.mul(be,He),{x:be,y:we}}}function le(T,N){return{secretKey:N.BYTES,publicKey:1+T.BYTES,publicKeyUncompressed:1+2*T.BYTES,publicKeyHasPrefix:!0,signature:2*N.BYTES}}function X(T,N={}){const{Fn:j}=T,Y=N.randomBytes||E.randomBytes,Z=Object.assign(le(T.Fp,j),{seed:(0,c.getMinHashLength)(j.ORDER)});function z(be){try{return!!q(j,be)}catch{return!1}}function fe(be,we){const{publicKey:Ee,publicKeyUncompressed:me}=Z;try{const Ke=be.length;return we===!0&&Ke!==Ee||we===!1&&Ke!==me?!1:!!T.fromBytes(be)}catch{return!1}}function te(be=Y(Z.seed)){return(0,c.mapHashToField)((0,E._abytes2)(be,Z.seed,"seed"),j.ORDER)}function H(be,we=!0){return T.BASE.multiply(q(j,be)).toBytes(we)}function Q(be){const we=te(be);return{secretKey:we,publicKey:H(we)}}function oe(be){if(typeof be=="bigint")return!1;if(be instanceof T)return!0;const{secretKey:we,publicKey:Ee,publicKeyUncompressed:me}=Z;if(j.allowedLengths||we===Ee)return;const Ke=(0,E.ensureBytes)("key",be).length;return Ke===Ee||Ke===me}function _e(be,we,Ee=!0){if(oe(be)===!0)throw new Error("first arg must be private key");if(oe(we)===!1)throw new Error("second arg must be public key");const me=q(j,be);return T.fromHex(we).multiply(me).toBytes(Ee)}return Object.freeze({getPublicKey:H,getSharedSecret:_e,keygen:Q,Point:T,utils:{isValidSecretKey:z,isValidPublicKey:fe,randomSecretKey:te,isValidPrivateKey:z,randomPrivateKey:te,normPrivateKeyToScalar:be=>q(j,be),precompute(be=8,we=T.BASE){return we.precompute(be,!1)}},lengths:Z})}function se(T,N,j={}){(0,w.ahash)(N),(0,E._validateObject)(j,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const Y=j.randomBytes||E.randomBytes,Z=j.hmac||((tt,...rt)=>(0,h.hmac)(N,tt,(0,E.concatBytes)(...rt))),{Fp:z,Fn:fe}=T,{ORDER:te,BITS:H}=fe,{keygen:Q,getPublicKey:oe,getSharedSecret:_e,utils:ge,lengths:be}=X(T,j),we={prehash:!1,lowS:typeof j.lowS=="boolean"?j.lowS:!1,format:void 0,extraEntropy:!1},Ee="compact";function me(tt){const rt=te>>S;return tt>rt}function Ke(tt,rt){if(!fe.isValidNot0(rt))throw new Error(`invalid signature ${tt}: out of range 1..Point.Fn.ORDER`);return rt}function He(tt,rt){m(rt);const ke=be.signature,xe=rt==="compact"?ke:rt==="recovered"?ke+1:void 0;return(0,E._abytes2)(tt,xe,`${rt} signature`)}class Ie{constructor(rt,ke,xe){this.r=Ke("r",rt),this.s=Ke("s",ke),xe!=null&&(this.recovery=xe),Object.freeze(this)}static fromBytes(rt,ke=Ee){He(rt,ke);let xe;if(ke==="der"){const{r:st,s:It}=f.DER.toSig((0,E._abytes2)(rt));return new Ie(st,It)}ke==="recovered"&&(xe=rt[0],ke="compact",rt=rt.subarray(1));const Pe=fe.BYTES,it=rt.subarray(0,Pe),Xe=rt.subarray(Pe,Pe*2);return new Ie(fe.fromBytes(it),fe.fromBytes(Xe),xe)}static fromHex(rt,ke){return this.fromBytes((0,E.hexToBytes)(rt),ke)}addRecoveryBit(rt){return new Ie(this.r,this.s,rt)}recoverPublicKey(rt){const ke=z.ORDER,{r:xe,s:Pe,recovery:it}=this;if(it==null||![0,1,2,3].includes(it))throw new Error("recovery id invalid");if(te*O<ke&&it>1)throw new Error("recovery id is ambiguous for h>1 curve");const st=it===2||it===3?xe+te:xe;if(!z.isValid(st))throw new Error("recovery id 2 or 3 invalid");const It=z.toBytes(st),ft=T.fromBytes((0,E.concatBytes)(F((it&1)===0),It)),Jt=fe.inv(st),Ot=Ge((0,E.ensureBytes)("msgHash",rt)),Ct=fe.create(-Ot*Jt),qe=fe.create(Pe*Jt),Yt=T.BASE.multiplyUnsafe(Ct).add(ft.multiplyUnsafe(qe));if(Yt.is0())throw new Error("point at infinify");return Yt.assertValidity(),Yt}hasHighS(){return me(this.s)}toBytes(rt=Ee){if(m(rt),rt==="der")return(0,E.hexToBytes)(f.DER.hexFromSig(this));const ke=fe.toBytes(this.r),xe=fe.toBytes(this.s);if(rt==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return(0,E.concatBytes)(Uint8Array.of(this.recovery),ke,xe)}return(0,E.concatBytes)(ke,xe)}toHex(rt){return(0,E.bytesToHex)(this.toBytes(rt))}assertValidity(){}static fromCompact(rt){return Ie.fromBytes((0,E.ensureBytes)("sig",rt),"compact")}static fromDER(rt){return Ie.fromBytes((0,E.ensureBytes)("sig",rt),"der")}normalizeS(){return this.hasHighS()?new Ie(this.r,fe.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,E.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,E.bytesToHex)(this.toBytes("compact"))}}const Le=j.bits2int||function(rt){if(rt.length>8192)throw new Error("input is too large");const ke=(0,E.bytesToNumberBE)(rt),xe=rt.length*8-H;return xe>0?ke>>BigInt(xe):ke},Ge=j.bits2int_modN||function(rt){return fe.create(Le(rt))},Be=(0,E.bitMask)(H);function We(tt){return(0,E.aInRange)("num < 2^"+H,tt,R,Be),fe.toBytes(tt)}function Ze(tt,rt){return(0,E._abytes2)(tt,void 0,"message"),rt?(0,E._abytes2)(N(tt),void 0,"prehashed message"):tt}function _t(tt,rt,ke){if(["recovered","canonical"].some(Ct=>Ct in ke))throw new Error("sign() legacy options not supported");const{lowS:xe,prehash:Pe,extraEntropy:it}=C(ke,we);tt=Ze(tt,Pe);const Xe=Ge(tt),st=q(fe,rt),It=[We(st),We(Xe)];if(it!=null&&it!==!1){const Ct=it===!0?Y(be.secretKey):it;It.push((0,E.ensureBytes)("extraEntropy",Ct))}const ft=(0,E.concatBytes)(...It),Jt=Xe;function Ot(Ct){const qe=Le(Ct);if(!fe.isValidNot0(qe))return;const Yt=fe.inv(qe),ot=T.BASE.multiply(qe).toAffine(),Ae=fe.create(ot.x);if(Ae===R)return;const Rt=fe.create(Yt*fe.create(Jt+Ae*st));if(Rt===R)return;let Ht=(ot.x===Ae?0:2)|Number(ot.y&S),bt=Rt;return xe&&me(Rt)&&(bt=fe.neg(Rt),Ht^=1),new Ie(Ae,bt,Ht)}return{seed:ft,k2sig:Ot}}function Ft(tt,rt,ke={}){tt=(0,E.ensureBytes)("message",tt);const{seed:xe,k2sig:Pe}=_t(tt,rt,ke);return(0,E.createHmacDrbg)(N.outputLen,fe.BYTES,Z)(xe,Pe)}function gt(tt){let rt;const ke=typeof tt=="string"||(0,E.isBytes)(tt),xe=!ke&&tt!==null&&typeof tt=="object"&&typeof tt.r=="bigint"&&typeof tt.s=="bigint";if(!ke&&!xe)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(xe)rt=new Ie(tt.r,tt.s);else if(ke){try{rt=Ie.fromBytes((0,E.ensureBytes)("sig",tt),"der")}catch(Pe){if(!(Pe instanceof f.DER.Err))throw Pe}if(!rt)try{rt=Ie.fromBytes((0,E.ensureBytes)("sig",tt),"compact")}catch{return!1}}return rt||!1}function lt(tt,rt,ke,xe={}){const{lowS:Pe,prehash:it,format:Xe}=C(xe,we);if(ke=(0,E.ensureBytes)("publicKey",ke),rt=Ze((0,E.ensureBytes)("message",rt),it),"strict"in xe)throw new Error("options.strict was renamed to lowS");const st=Xe===void 0?gt(tt):Ie.fromBytes((0,E.ensureBytes)("sig",tt),Xe);if(st===!1)return!1;try{const It=T.fromBytes(ke);if(Pe&&st.hasHighS())return!1;const{r:ft,s:Jt}=st,Ot=Ge(rt),Ct=fe.inv(Jt),qe=fe.create(Ot*Ct),Yt=fe.create(ft*Ct),ot=T.BASE.multiplyUnsafe(qe).add(It.multiplyUnsafe(Yt));return ot.is0()?!1:fe.create(ot.x)===ft}catch{return!1}}function dt(tt,rt,ke={}){const{prehash:xe}=C(ke,we);return rt=Ze(rt,xe),Ie.fromBytes(tt,"recovered").recoverPublicKey(rt).toBytes()}return Object.freeze({keygen:Q,getPublicKey:oe,getSharedSecret:_e,utils:ge,lengths:be,Point:T,sign:Ft,verify:lt,recoverPublicKey:dt,Signature:Ie,hash:N})}function de(T){const{CURVE:N,curveOpts:j}=ye(T),Y=b(N,j);return B(T,Y)}function ye(T){const N={a:T.a,b:T.b,p:T.Fp.ORDER,n:T.n,h:T.h,Gx:T.Gx,Gy:T.Gy},j=T.Fp;let Y=T.allowedPrivateKeyLengths?Array.from(new Set(T.allowedPrivateKeyLengths.map(fe=>Math.ceil(fe/2)))):void 0;const Z=(0,c.Field)(N.n,{BITS:T.nBitLength,allowedLengths:Y,modFromBytes:T.wrapPrivateKey}),z={Fp:j,Fn:Z,allowInfinityPoint:T.allowInfinityPoint,endo:T.endo,isTorsionFree:T.isTorsionFree,clearCofactor:T.clearCofactor,fromBytes:T.fromBytes,toBytes:T.toBytes};return{CURVE:N,curveOpts:z}}function he(T){const{CURVE:N,curveOpts:j}=ye(T),Y={hmac:T.hmac,randomBytes:T.randomBytes,lowS:T.lowS,bits2int:T.bits2int,bits2int_modN:T.bits2int_modN};return{CURVE:N,curveOpts:j,hash:T.hash,ecdsaOpts:Y}}function K(T,N,j){function Y(Z){const z=T.sqr(Z),fe=T.mul(z,Z);return T.add(T.add(fe,T.mul(Z,N)),j)}return Y}function B(T,N){const{Fp:j,Fn:Y}=N;function Z(fe){return(0,E.inRange)(fe,S,Y.ORDER)}const z=K(j,T.a,T.b);return Object.assign({},{CURVE:T,Point:N,ProjectivePoint:N,normPrivateKeyToScalar:fe=>q(Y,fe),weierstrassEquation:z,isWithinCurveOrder:Z})}function L(T,N){const j=N.Point;return Object.assign({},N,{ProjectivePoint:j,CURVE:Object.assign({},T,(0,c.nLength)(j.Fn.ORDER,j.Fn.BITS))})}function $(T){const{CURVE:N,curveOpts:j,hash:Y,ecdsaOpts:Z}=he(T),z=b(N,j),fe=se(z,Y,Z);return L(T,fe)}},12231:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.hash_to_ristretto255=f.hashToRistretto255=f.encodeToCurve=f.hashToCurve=f.RistrettoPoint=f.edwardsToMontgomery=f.ED25519_TORSION_SUBGROUP=f.ristretto255_hasher=f.ristretto255=f.ed25519_hasher=f.x25519=f.ed25519ph=f.ed25519ctx=f.ed25519=void 0,f.edwardsToMontgomeryPub=_e,f.edwardsToMontgomeryPriv=ge;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(63589),w=_(66624),E=_(91258),v=_(54549),c=_(10853),d=_(96795),p=_(7786),m=_(18215),C=BigInt(0),x=BigInt(1),R=BigInt(2),S=BigInt(3),O=BigInt(5),M=BigInt(8),k=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),q={p:k,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:M,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function b(be){const we=BigInt(10),Ee=BigInt(20),me=BigInt(40),Ke=BigInt(80),He=k,Le=be*be%He*be%He,Ge=(0,d.pow2)(Le,R,He)*Le%He,Be=(0,d.pow2)(Ge,x,He)*be%He,We=(0,d.pow2)(Be,O,He)*Be%He,Ze=(0,d.pow2)(We,we,He)*We%He,_t=(0,d.pow2)(Ze,Ee,He)*Ze%He,Ft=(0,d.pow2)(_t,me,He)*_t%He,gt=(0,d.pow2)(Ft,Ke,He)*Ft%He,lt=(0,d.pow2)(gt,Ke,He)*Ft%He,dt=(0,d.pow2)(lt,we,He)*We%He;return{pow_p_5_8:(0,d.pow2)(dt,R,He)*be%He,b2:Le}}function F(be){return be[0]&=248,be[31]&=127,be[31]|=64,be}const G=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function ue(be,we){const Ee=k,me=(0,d.mod)(we*we*we,Ee),Ke=(0,d.mod)(me*me*we,Ee),He=b(be*Ke).pow_p_5_8;let Ie=(0,d.mod)(be*me*He,Ee);const Le=(0,d.mod)(we*Ie*Ie,Ee),Ge=Ie,Be=(0,d.mod)(Ie*G,Ee),We=Le===be,Ze=Le===(0,d.mod)(-be,Ee),_t=Le===(0,d.mod)(-be*G,Ee);return We&&(Ie=Ge),(Ze||_t)&&(Ie=Be),(0,d.isNegativeLE)(Ie,Ee)&&(Ie=(0,d.mod)(-Ie,Ee)),{isValid:We||Ze,value:Ie}}const le=(0,d.Field)(q.p,{isLE:!0}),X=(0,d.Field)(q.n,{isLE:!0}),se={...q,Fp:le,hash:h.sha512,adjustScalarBytes:F,uvRatio:ue};f.ed25519=(0,v.twistedEdwards)(se);function de(be,we,Ee){if(we.length>255)throw new Error("Context is too big");return(0,w.concatBytes)((0,w.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([Ee?1:0,we.length]),we,be)}f.ed25519ctx=(0,v.twistedEdwards)({...se,domain:de}),f.ed25519ph=(0,v.twistedEdwards)(Object.assign({},se,{domain:de,prehash:h.sha512})),f.x25519=(()=>{const be=le.ORDER;return(0,p.montgomery)({P:be,type:"x25519",powPminus2:we=>{const{pow_p_5_8:Ee,b2:me}=b(we);return(0,d.mod)((0,d.pow2)(Ee,S,be)*me,be)},adjustScalarBytes:F})})();const ye=(k+S)/M,he=le.pow(R,ye),K=le.sqrt(le.neg(le.ONE));function B(be){const we=(k-O)/M,Ee=BigInt(486662);let me=le.sqr(be);me=le.mul(me,R);let Ke=le.add(me,le.ONE),He=le.neg(Ee),Ie=le.sqr(Ke),Le=le.mul(Ie,Ke),Ge=le.mul(me,Ee);Ge=le.mul(Ge,He),Ge=le.add(Ge,Ie),Ge=le.mul(Ge,He);let Be=le.sqr(Le);Ie=le.sqr(Be),Be=le.mul(Be,Le),Be=le.mul(Be,Ge),Ie=le.mul(Ie,Be);let We=le.pow(Ie,we);We=le.mul(We,Be);let Ze=le.mul(We,K);Ie=le.sqr(We),Ie=le.mul(Ie,Le);let _t=le.eql(Ie,Ge),Ft=le.cmov(Ze,We,_t),gt=le.mul(He,me),lt=le.mul(We,be);lt=le.mul(lt,he);let dt=le.mul(lt,K),tt=le.mul(Ge,me);Ie=le.sqr(lt),Ie=le.mul(Ie,Le);let rt=le.eql(Ie,tt),ke=le.cmov(dt,lt,rt);Ie=le.sqr(Ft),Ie=le.mul(Ie,Le);let xe=le.eql(Ie,Ge),Pe=le.cmov(gt,He,xe),it=le.cmov(ke,Ft,xe),Xe=le.isOdd(it);return it=le.cmov(it,le.neg(it),xe!==Xe),{xMn:Pe,xMd:Ke,yMn:it,yMd:x}}const L=(0,d.FpSqrtEven)(le,le.neg(BigInt(486664)));function $(be){const{xMn:we,xMd:Ee,yMn:me,yMd:Ke}=B(be);let He=le.mul(we,Ke);He=le.mul(He,L);let Ie=le.mul(Ee,me),Le=le.sub(we,Ee),Ge=le.add(we,Ee),Be=le.mul(Ie,Ge),We=le.eql(Be,le.ZERO);He=le.cmov(He,le.ZERO,We),Ie=le.cmov(Ie,le.ONE,We),Le=le.cmov(Le,le.ONE,We),Ge=le.cmov(Ge,le.ONE,We);const[Ze,_t]=(0,d.FpInvertBatch)(le,[Ie,Ge],!0);return{x:le.mul(He,Ze),y:le.mul(Le,_t)}}f.ed25519_hasher=(0,c.createHasher)(f.ed25519.Point,be=>$(be[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:k,m:1,k:128,expand:"xmd",hash:h.sha512});const T=G,N=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),j=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Y=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Z=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),z=be=>ue(x,be),fe=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),te=be=>f.ed25519.Point.Fp.create((0,m.bytesToNumberLE)(be)&fe);function H(be){const{d:we}=q,Ee=k,me=tt=>le.create(tt),Ke=me(T*be*be),He=me((Ke+x)*Y);let Ie=BigInt(-1);const Le=me((Ie-we*Ke)*me(Ke+we));let{isValid:Ge,value:Be}=ue(He,Le),We=me(Be*be);(0,d.isNegativeLE)(We,Ee)||(We=me(-We)),Ge||(Be=We),Ge||(Ie=Ke);const Ze=me(Ie*(Ke-x)*Z-Le),_t=Be*Be,Ft=me((Be+Be)*Le),gt=me(Ze*N),lt=me(x-_t),dt=me(x+_t);return new f.ed25519.Point(me(Ft*dt),me(lt*gt),me(gt*dt),me(Ft*lt))}function Q(be){(0,w.abytes)(be,64);const we=te(be.subarray(0,32)),Ee=H(we),me=te(be.subarray(32,64)),Ke=H(me);return new oe(Ee.add(Ke))}class oe extends v.PrimeEdwardsPoint{constructor(we){super(we)}static fromAffine(we){return new oe(f.ed25519.Point.fromAffine(we))}assertSame(we){if(!(we instanceof oe))throw new Error("RistrettoPoint expected")}init(we){return new oe(we)}static hashToCurve(we){return Q((0,m.ensureBytes)("ristrettoHash",we,64))}static fromBytes(we){(0,w.abytes)(we,32);const{a:Ee,d:me}=q,Ke=k,He=xe=>le.create(xe),Ie=te(we);if(!(0,m.equalBytes)(le.toBytes(Ie),we)||(0,d.isNegativeLE)(Ie,Ke))throw new Error("invalid ristretto255 encoding 1");const Le=He(Ie*Ie),Ge=He(x+Ee*Le),Be=He(x-Ee*Le),We=He(Ge*Ge),Ze=He(Be*Be),_t=He(Ee*me*We-Ze),{isValid:Ft,value:gt}=z(He(_t*Ze)),lt=He(gt*Be),dt=He(gt*lt*_t);let tt=He((Ie+Ie)*lt);(0,d.isNegativeLE)(tt,Ke)&&(tt=He(-tt));const rt=He(Ge*dt),ke=He(tt*rt);if(!Ft||(0,d.isNegativeLE)(ke,Ke)||rt===C)throw new Error("invalid ristretto255 encoding 2");return new oe(new f.ed25519.Point(tt,rt,x,ke))}static fromHex(we){return oe.fromBytes((0,m.ensureBytes)("ristrettoHex",we,32))}static msm(we,Ee){return(0,E.pippenger)(oe,f.ed25519.Point.Fn,we,Ee)}toBytes(){let{X:we,Y:Ee,Z:me,T:Ke}=this.ep;const He=k,Ie=dt=>le.create(dt),Le=Ie(Ie(me+Ee)*Ie(me-Ee)),Ge=Ie(we*Ee),Be=Ie(Ge*Ge),{value:We}=z(Ie(Le*Be)),Ze=Ie(We*Le),_t=Ie(We*Ge),Ft=Ie(Ze*_t*Ke);let gt;if((0,d.isNegativeLE)(Ke*Ft,He)){let dt=Ie(Ee*T),tt=Ie(we*T);we=dt,Ee=tt,gt=Ie(Ze*j)}else gt=_t;(0,d.isNegativeLE)(we*Ft,He)&&(Ee=Ie(-Ee));let lt=Ie((me-Ee)*gt);return(0,d.isNegativeLE)(lt,He)&&(lt=Ie(-lt)),le.toBytes(lt)}equals(we){this.assertSame(we);const{X:Ee,Y:me}=this.ep,{X:Ke,Y:He}=we.ep,Ie=Be=>le.create(Be),Le=Ie(Ee*He)===Ie(me*Ke),Ge=Ie(me*He)===Ie(Ee*Ke);return Le||Ge}is0(){return this.equals(oe.ZERO)}}oe.BASE=new oe(f.ed25519.Point.BASE),oe.ZERO=new oe(f.ed25519.Point.ZERO),oe.Fp=le,oe.Fn=X,f.ristretto255={Point:oe},f.ristretto255_hasher={hashToCurve(be,we){const Ee=we?.DST||"ristretto255_XMD:SHA-512_R255MAP_RO_",me=(0,c.expand_message_xmd)(be,Ee,64,h.sha512);return Q(me)},hashToScalar(be,we={DST:c._DST_scalar}){const Ee=(0,c.expand_message_xmd)(be,we.DST,64,h.sha512);return X.create((0,m.bytesToNumberLE)(Ee))}},f.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];function _e(be){return f.ed25519.utils.toMontgomery((0,m.ensureBytes)("pub",be))}f.edwardsToMontgomery=_e;function ge(be){return f.ed25519.utils.toMontgomeryPriv((0,m.ensureBytes)("pub",be))}f.RistrettoPoint=oe,f.hashToCurve=f.ed25519_hasher.hashToCurve,f.encodeToCurve=f.ed25519_hasher.encodeToCurve,f.hashToRistretto255=f.ristretto255_hasher.hashToCurve,f.hash_to_ristretto255=f.ristretto255_hasher.hashToCurve},29458:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.encodeToCurve=f.hashToCurve=f.secp256k1_hasher=f.schnorr=f.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(63589),w=_(66624),E=_(56918),v=_(10853),c=_(96795),d=_(25205),p=_(18215),m={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},C={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},x=BigInt(0),R=BigInt(1),S=BigInt(2);function O(L){const $=m.p,T=BigInt(3),N=BigInt(6),j=BigInt(11),Y=BigInt(22),Z=BigInt(23),z=BigInt(44),fe=BigInt(88),te=L*L*L%$,H=te*te*L%$,Q=(0,c.pow2)(H,T,$)*H%$,oe=(0,c.pow2)(Q,T,$)*H%$,_e=(0,c.pow2)(oe,S,$)*te%$,ge=(0,c.pow2)(_e,j,$)*_e%$,be=(0,c.pow2)(ge,Y,$)*ge%$,we=(0,c.pow2)(be,z,$)*be%$,Ee=(0,c.pow2)(we,fe,$)*we%$,me=(0,c.pow2)(Ee,z,$)*be%$,Ke=(0,c.pow2)(me,T,$)*H%$,He=(0,c.pow2)(Ke,Z,$)*ge%$,Ie=(0,c.pow2)(He,N,$)*te%$,Le=(0,c.pow2)(Ie,S,$);if(!M.eql(M.sqr(Le),L))throw new Error("Cannot find square root");return Le}const M=(0,c.Field)(m.p,{sqrt:O});f.secp256k1=(0,E.createCurve)({...m,Fp:M,lowS:!0,endo:C},h.sha256);const k={};function q(L,...$){let T=k[L];if(T===void 0){const N=(0,h.sha256)((0,p.utf8ToBytes)(L));T=(0,p.concatBytes)(N,N),k[L]=T}return(0,h.sha256)((0,p.concatBytes)(T,...$))}const b=L=>L.toBytes(!0).slice(1),F=f.secp256k1.Point,G=L=>L%S===x;function ue(L){const{Fn:$,BASE:T}=F,N=(0,d._normFnElement)($,L),j=T.multiply(N);return{scalar:G(j.y)?N:$.neg(N),bytes:b(j)}}function le(L){const $=M;if(!$.isValidNot0(L))throw new Error("invalid x: Fail if x \u2265 p");const T=$.create(L*L),N=$.create(T*L+BigInt(7));let j=$.sqrt(N);G(j)||(j=$.neg(j));const Y=F.fromAffine({x:L,y:j});return Y.assertValidity(),Y}const X=p.bytesToNumberBE;function se(...L){return F.Fn.create(X(q("BIP0340/challenge",...L)))}function de(L){return ue(L).bytes}function ye(L,$,T=(0,w.randomBytes)(32)){const{Fn:N}=F,j=(0,p.ensureBytes)("message",L),{bytes:Y,scalar:Z}=ue($),z=(0,p.ensureBytes)("auxRand",T,32),fe=N.toBytes(Z^X(q("BIP0340/aux",z))),te=q("BIP0340/nonce",fe,Y,j),{bytes:H,scalar:Q}=ue(te),oe=se(H,Y,j),_e=new Uint8Array(64);if(_e.set(H,0),_e.set(N.toBytes(N.create(Q+oe*Z)),32),!he(_e,j,Y))throw new Error("sign: Invalid signature produced");return _e}function he(L,$,T){const{Fn:N,BASE:j}=F,Y=(0,p.ensureBytes)("signature",L,64),Z=(0,p.ensureBytes)("message",$),z=(0,p.ensureBytes)("publicKey",T,32);try{const fe=le(X(z)),te=X(Y.subarray(0,32));if(!(0,p.inRange)(te,R,m.p))return!1;const H=X(Y.subarray(32,64));if(!(0,p.inRange)(H,R,m.n))return!1;const Q=se(N.toBytes(te),b(fe),Z),oe=j.multiplyUnsafe(H).add(fe.multiplyUnsafe(N.neg(Q))),{x:_e,y:ge}=oe.toAffine();return!(oe.is0()||!G(ge)||_e!==te)}catch{return!1}}f.schnorr=(()=>{const T=(j=(0,w.randomBytes)(48))=>(0,c.mapHashToField)(j,m.n);f.secp256k1.utils.randomSecretKey;function N(j){const Y=T(j);return{secretKey:Y,publicKey:de(Y)}}return{keygen:N,getPublicKey:de,sign:ye,verify:he,Point:F,utils:{randomSecretKey:T,randomPrivateKey:T,taggedHash:q,lift_x:le,pointToBytes:b,numberToBytesBE:p.numberToBytesBE,bytesToNumberBE:p.bytesToNumberBE,mod:c.mod},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();const K=(0,v.isogenyMap)(M,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(L=>L.map($=>BigInt($)))),B=(0,d.mapToCurveSimpleSWU)(M,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:M.create(BigInt("-11"))});f.secp256k1_hasher=(0,v.createHasher)(f.secp256k1.Point,L=>{const{x:$,y:T}=B(M.create(L[0]));return K($,T)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:M.ORDER,m:1,k:128,expand:"xmd",hash:h.sha256}),f.hashToCurve=f.secp256k1_hasher.hashToCurve,f.encodeToCurve=f.secp256k1_hasher.encodeToCurve},18215:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.notImplemented=f.bitMask=f.utf8ToBytes=f.randomBytes=f.isBytes=f.hexToBytes=f.concatBytes=f.bytesToUtf8=f.bytesToHex=f.anumber=f.abytes=void 0,f.abool=c,f._abool2=d,f._abytes2=p,f.numberToHexUnpadded=m,f.hexToNumber=C,f.bytesToNumberBE=x,f.bytesToNumberLE=R,f.numberToBytesBE=S,f.numberToBytesLE=O,f.numberToVarBytesBE=M,f.ensureBytes=k,f.equalBytes=q,f.copyBytes=b,f.asciiToBytes=F,f.inRange=ue,f.aInRange=le,f.bitLen=X,f.bitGet=se,f.bitSet=de,f.createHmacDrbg=he,f.validateObject=B,f.isHash=L,f._validateObject=$,f.memoized=N;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const h=_(66624);var w=_(66624);Object.defineProperty(f,"abytes",{enumerable:!0,get:function(){return w.abytes}}),Object.defineProperty(f,"anumber",{enumerable:!0,get:function(){return w.anumber}}),Object.defineProperty(f,"bytesToHex",{enumerable:!0,get:function(){return w.bytesToHex}}),Object.defineProperty(f,"bytesToUtf8",{enumerable:!0,get:function(){return w.bytesToUtf8}}),Object.defineProperty(f,"concatBytes",{enumerable:!0,get:function(){return w.concatBytes}}),Object.defineProperty(f,"hexToBytes",{enumerable:!0,get:function(){return w.hexToBytes}}),Object.defineProperty(f,"isBytes",{enumerable:!0,get:function(){return w.isBytes}}),Object.defineProperty(f,"randomBytes",{enumerable:!0,get:function(){return w.randomBytes}}),Object.defineProperty(f,"utf8ToBytes",{enumerable:!0,get:function(){return w.utf8ToBytes}});const E=BigInt(0),v=BigInt(1);function c(j,Y){if(typeof Y!="boolean")throw new Error(j+" boolean expected, got "+Y)}function d(j,Y=""){if(typeof j!="boolean"){const Z=Y&&`"${Y}"`;throw new Error(Z+"expected boolean, got type="+typeof j)}return j}function p(j,Y,Z=""){const z=(0,h.isBytes)(j),fe=j?.length,te=Y!==void 0;if(!z||te&&fe!==Y){const H=Z&&`"${Z}" `,Q=te?` of length ${Y}`:"",oe=z?`length=${fe}`:`type=${typeof j}`;throw new Error(H+"expected Uint8Array"+Q+", got "+oe)}return j}function m(j){const Y=j.toString(16);return Y.length&1?"0"+Y:Y}function C(j){if(typeof j!="string")throw new Error("hex string expected, got "+typeof j);return j===""?E:BigInt("0x"+j)}function x(j){return C((0,h.bytesToHex)(j))}function R(j){return(0,h.abytes)(j),C((0,h.bytesToHex)(Uint8Array.from(j).reverse()))}function S(j,Y){return(0,h.hexToBytes)(j.toString(16).padStart(Y*2,"0"))}function O(j,Y){return S(j,Y).reverse()}function M(j){return(0,h.hexToBytes)(m(j))}function k(j,Y,Z){let z;if(typeof Y=="string")try{z=(0,h.hexToBytes)(Y)}catch(te){throw new Error(j+" must be hex string or Uint8Array, cause: "+te)}else if((0,h.isBytes)(Y))z=Uint8Array.from(Y);else throw new Error(j+" must be hex string or Uint8Array");const fe=z.length;if(typeof Z=="number"&&fe!==Z)throw new Error(j+" of length "+Z+" expected, got "+fe);return z}function q(j,Y){if(j.length!==Y.length)return!1;let Z=0;for(let z=0;z<j.length;z++)Z|=j[z]^Y[z];return Z===0}function b(j){return Uint8Array.from(j)}function F(j){return Uint8Array.from(j,(Y,Z)=>{const z=Y.charCodeAt(0);if(Y.length!==1||z>127)throw new Error(`string contains non-ASCII character "${j[Z]}" with code ${z} at position ${Z}`);return z})}const G=j=>typeof j=="bigint"&&E<=j;function ue(j,Y,Z){return G(j)&&G(Y)&&G(Z)&&Y<=j&&j<Z}function le(j,Y,Z,z){if(!ue(Y,Z,z))throw new Error("expected valid "+j+": "+Z+" <= n < "+z+", got "+Y)}function X(j){let Y;for(Y=0;j>E;j>>=v,Y+=1);return Y}function se(j,Y){return j>>BigInt(Y)&v}function de(j,Y,Z){return j|(Z?v:E)<<BigInt(Y)}const ye=j=>(v<<BigInt(j))-v;f.bitMask=ye;function he(j,Y,Z){if(typeof j!="number"||j<2)throw new Error("hashLen must be a number");if(typeof Y!="number"||Y<2)throw new Error("qByteLen must be a number");if(typeof Z!="function")throw new Error("hmacFn must be a function");const z=Ee=>new Uint8Array(Ee),fe=Ee=>Uint8Array.of(Ee);let te=z(j),H=z(j),Q=0;const oe=()=>{te.fill(1),H.fill(0),Q=0},_e=(...Ee)=>Z(H,te,...Ee),ge=(Ee=z(0))=>{H=_e(fe(0),Ee),te=_e(),Ee.length!==0&&(H=_e(fe(1),Ee),te=_e())},be=()=>{if(Q++>=1e3)throw new Error("drbg: tried 1000 values");let Ee=0;const me=[];for(;Ee<Y;){te=_e();const Ke=te.slice();me.push(Ke),Ee+=te.length}return(0,h.concatBytes)(...me)};return(Ee,me)=>{oe(),ge(Ee);let Ke;for(;!(Ke=me(be()));)ge();return oe(),Ke}}const K={bigint:j=>typeof j=="bigint",function:j=>typeof j=="function",boolean:j=>typeof j=="boolean",string:j=>typeof j=="string",stringOrUint8Array:j=>typeof j=="string"||(0,h.isBytes)(j),isSafeInteger:j=>Number.isSafeInteger(j),array:j=>Array.isArray(j),field:(j,Y)=>Y.Fp.isValid(j),hash:j=>typeof j=="function"&&Number.isSafeInteger(j.outputLen)};function B(j,Y,Z={}){const z=(fe,te,H)=>{const Q=K[te];if(typeof Q!="function")throw new Error("invalid validator function");const oe=j[fe];if(!(H&&oe===void 0)&&!Q(oe,j))throw new Error("param "+String(fe)+" is invalid. Expected "+te+", got "+oe)};for(const[fe,te]of Object.entries(Y))z(fe,te,!1);for(const[fe,te]of Object.entries(Z))z(fe,te,!0);return j}function L(j){return typeof j=="function"&&Number.isSafeInteger(j.outputLen)}function $(j,Y,Z={}){if(!j||typeof j!="object")throw new Error("expected valid options object");function z(fe,te,H){const Q=j[fe];if(H&&Q===void 0)return;const oe=typeof Q;if(oe!==te||Q===null)throw new Error(`param "${fe}" is invalid: expected ${te}, got ${oe}`)}Object.entries(Y).forEach(([fe,te])=>z(fe,te,!1)),Object.entries(Z).forEach(([fe,te])=>z(fe,te,!0))}const T=()=>{throw new Error("not implemented")};f.notImplemented=T;function N(j){const Y=new WeakMap;return(Z,...z)=>{const fe=Y.get(Z);if(fe!==void 0)return fe;const te=j(Z,...z);return Y.set(Z,te),te}}},81778:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.output=f.exists=f.hash=f.bytes=f.bool=f.number=f.isBytes=void 0;function _(m){if(!Number.isSafeInteger(m)||m<0)throw new Error(`positive integer expected, not ${m}`)}f.number=_;function h(m){if(typeof m!="boolean")throw new Error(`boolean expected, not ${m}`)}f.bool=h;function w(m){return m instanceof Uint8Array||m!=null&&typeof m=="object"&&m.constructor.name==="Uint8Array"}f.isBytes=w;function E(m,...C){if(!w(m))throw new Error("Uint8Array expected");if(C.length>0&&!C.includes(m.length))throw new Error(`Uint8Array expected of length ${C}, not of length=${m.length}`)}f.bytes=E;function v(m){if(typeof m!="function"||typeof m.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");_(m.outputLen),_(m.blockLen)}f.hash=v;function c(m,C=!0){if(m.destroyed)throw new Error("Hash instance has been destroyed");if(C&&m.finished)throw new Error("Hash#digest() has already been called")}f.exists=c;function d(m,C){E(m);const x=C.outputLen;if(m.length<x)throw new Error(`digestInto() expects output buffer of length at least ${x}`)}f.output=d;const p={number:_,bool:h,bytes:E,hash:v,exists:c,output:d};f.default=p},26601:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.HashMD=f.Maj=f.Chi=void 0;const h=_(81778),w=_(49724);function E(p,m,C,x){if(typeof p.setBigUint64=="function")return p.setBigUint64(m,C,x);const R=BigInt(32),S=BigInt(4294967295),O=Number(C>>R&S),M=Number(C&S),k=x?4:0,q=x?0:4;p.setUint32(m+k,O,x),p.setUint32(m+q,M,x)}const v=(p,m,C)=>p&m^~p&C;f.Chi=v;const c=(p,m,C)=>p&m^p&C^m&C;f.Maj=c;class d extends w.Hash{constructor(m,C,x,R){super(),this.blockLen=m,this.outputLen=C,this.padOffset=x,this.isLE=R,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(m),this.view=(0,w.createView)(this.buffer)}update(m){(0,h.exists)(this);const{view:C,buffer:x,blockLen:R}=this;m=(0,w.toBytes)(m);const S=m.length;for(let O=0;O<S;){const M=Math.min(R-this.pos,S-O);if(M===R){const k=(0,w.createView)(m);for(;R<=S-O;O+=R)this.process(k,O);continue}x.set(m.subarray(O,O+M),this.pos),this.pos+=M,O+=M,this.pos===R&&(this.process(C,0),this.pos=0)}return this.length+=m.length,this.roundClean(),this}digestInto(m){(0,h.exists)(this),(0,h.output)(m,this),this.finished=!0;const{buffer:C,view:x,blockLen:R,isLE:S}=this;let{pos:O}=this;C[O++]=128,this.buffer.subarray(O).fill(0),this.padOffset>R-O&&(this.process(x,0),O=0);for(let F=O;F<R;F++)C[F]=0;E(x,R-8,BigInt(this.length*8),S),this.process(x,0);const M=(0,w.createView)(m),k=this.outputLen;if(k%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const q=k/4,b=this.get();if(q>b.length)throw new Error("_sha2: outputLen bigger than state");for(let F=0;F<q;F++)M.setUint32(4*F,b[F],S)}digest(){const{buffer:m,outputLen:C}=this;this.digestInto(m);const x=m.slice(0,C);return this.destroy(),x}_cloneInto(m){m||(m=new this.constructor),m.set(...this.get());const{blockLen:C,buffer:x,length:R,finished:S,destroyed:O,pos:M}=this;return m.length=R,m.pos=M,m.finished=S,m.destroyed=O,R%C&&m.buffer.set(x),m}}f.HashMD=d},58627:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.add5L=f.add5H=f.add4H=f.add4L=f.add3H=f.add3L=f.add=f.rotlBL=f.rotlBH=f.rotlSL=f.rotlSH=f.rotr32L=f.rotr32H=f.rotrBL=f.rotrBH=f.rotrSL=f.rotrSH=f.shrSL=f.shrSH=f.toBig=f.split=f.fromBig=void 0;const _=BigInt(2**32-1),h=BigInt(32);function w(ye,he=!1){return he?{h:Number(ye&_),l:Number(ye>>h&_)}:{h:Number(ye>>h&_)|0,l:Number(ye&_)|0}}f.fromBig=w;function E(ye,he=!1){let K=new Uint32Array(ye.length),B=new Uint32Array(ye.length);for(let L=0;L<ye.length;L++){const{h:$,l:T}=w(ye[L],he);[K[L],B[L]]=[$,T]}return[K,B]}f.split=E;const v=(ye,he)=>BigInt(ye>>>0)<<h|BigInt(he>>>0);f.toBig=v;const c=(ye,he,K)=>ye>>>K;f.shrSH=c;const d=(ye,he,K)=>ye<<32-K|he>>>K;f.shrSL=d;const p=(ye,he,K)=>ye>>>K|he<<32-K;f.rotrSH=p;const m=(ye,he,K)=>ye<<32-K|he>>>K;f.rotrSL=m;const C=(ye,he,K)=>ye<<64-K|he>>>K-32;f.rotrBH=C;const x=(ye,he,K)=>ye>>>K-32|he<<64-K;f.rotrBL=x;const R=(ye,he)=>he;f.rotr32H=R;const S=(ye,he)=>ye;f.rotr32L=S;const O=(ye,he,K)=>ye<<K|he>>>32-K;f.rotlSH=O;const M=(ye,he,K)=>he<<K|ye>>>32-K;f.rotlSL=M;const k=(ye,he,K)=>he<<K-32|ye>>>64-K;f.rotlBH=k;const q=(ye,he,K)=>ye<<K-32|he>>>64-K;f.rotlBL=q;function b(ye,he,K,B){const L=(he>>>0)+(B>>>0);return{h:ye+K+(L/4294967296|0)|0,l:L|0}}f.add=b;const F=(ye,he,K)=>(ye>>>0)+(he>>>0)+(K>>>0);f.add3L=F;const G=(ye,he,K,B)=>he+K+B+(ye/2**32|0)|0;f.add3H=G;const ue=(ye,he,K,B)=>(ye>>>0)+(he>>>0)+(K>>>0)+(B>>>0);f.add4L=ue;const le=(ye,he,K,B,L)=>he+K+B+L+(ye/2**32|0)|0;f.add4H=le;const X=(ye,he,K,B,L)=>(ye>>>0)+(he>>>0)+(K>>>0)+(B>>>0)+(L>>>0);f.add5L=X;const se=(ye,he,K,B,L,$)=>he+K+B+L+$+(ye/2**32|0)|0;f.add5H=se;const de={fromBig:w,split:E,toBig:v,shrSH:c,shrSL:d,rotrSH:p,rotrSL:m,rotrBH:C,rotrBL:x,rotr32H:R,rotr32L:S,rotlSH:O,rotlSL:M,rotlBH:k,rotlBL:q,add:b,add3L:F,add3H:G,add4L:ue,add4H:le,add5H:se,add5L:X};f.default=de},53644:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.crypto=void 0,f.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0},53026:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.hmac=f.HMAC=void 0;const h=_(81778),w=_(49724);class E extends w.Hash{constructor(d,p){super(),this.finished=!1,this.destroyed=!1,(0,h.hash)(d);const m=(0,w.toBytes)(p);if(this.iHash=d.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const C=this.blockLen,x=new Uint8Array(C);x.set(m.length>C?d.create().update(m).digest():m);for(let R=0;R<x.length;R++)x[R]^=54;this.iHash.update(x),this.oHash=d.create();for(let R=0;R<x.length;R++)x[R]^=106;this.oHash.update(x),x.fill(0)}update(d){return(0,h.exists)(this),this.iHash.update(d),this}digestInto(d){(0,h.exists)(this),(0,h.bytes)(d,this.outputLen),this.finished=!0,this.iHash.digestInto(d),this.oHash.update(d),this.oHash.digestInto(d),this.destroy()}digest(){const d=new Uint8Array(this.oHash.outputLen);return this.digestInto(d),d}_cloneInto(d){d||(d=Object.create(Object.getPrototypeOf(this),{}));const{oHash:p,iHash:m,finished:C,destroyed:x,blockLen:R,outputLen:S}=this;return d=d,d.finished=C,d.destroyed=x,d.blockLen=R,d.outputLen=S,d.oHash=p._cloneInto(d.oHash),d.iHash=m._cloneInto(d.iHash),d}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}f.HMAC=E;const v=(c,d,p)=>new E(c,d).update(p).digest();f.hmac=v,f.hmac.create=(c,d)=>new E(c,d)},63742:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.sha224=f.sha256=void 0;const h=_(26601),w=_(49724),E=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),v=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class d extends h.HashMD{constructor(){super(64,32,8,!1),this.A=v[0]|0,this.B=v[1]|0,this.C=v[2]|0,this.D=v[3]|0,this.E=v[4]|0,this.F=v[5]|0,this.G=v[6]|0,this.H=v[7]|0}get(){const{A:C,B:x,C:R,D:S,E:O,F:M,G:k,H:q}=this;return[C,x,R,S,O,M,k,q]}set(C,x,R,S,O,M,k,q){this.A=C|0,this.B=x|0,this.C=R|0,this.D=S|0,this.E=O|0,this.F=M|0,this.G=k|0,this.H=q|0}process(C,x){for(let G=0;G<16;G++,x+=4)c[G]=C.getUint32(x,!1);for(let G=16;G<64;G++){const ue=c[G-15],le=c[G-2],X=(0,w.rotr)(ue,7)^(0,w.rotr)(ue,18)^ue>>>3,se=(0,w.rotr)(le,17)^(0,w.rotr)(le,19)^le>>>10;c[G]=se+c[G-7]+X+c[G-16]|0}let{A:R,B:S,C:O,D:M,E:k,F:q,G:b,H:F}=this;for(let G=0;G<64;G++){const ue=(0,w.rotr)(k,6)^(0,w.rotr)(k,11)^(0,w.rotr)(k,25),le=F+ue+(0,h.Chi)(k,q,b)+E[G]+c[G]|0,se=((0,w.rotr)(R,2)^(0,w.rotr)(R,13)^(0,w.rotr)(R,22))+(0,h.Maj)(R,S,O)|0;F=b,b=q,q=k,k=M+le|0,M=O,O=S,S=R,R=le+se|0}R=R+this.A|0,S=S+this.B|0,O=O+this.C|0,M=M+this.D|0,k=k+this.E|0,q=q+this.F|0,b=b+this.G|0,F=F+this.H|0,this.set(R,S,O,M,k,q,b,F)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class p extends d{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}f.sha256=(0,w.wrapConstructor)(()=>new d),f.sha224=(0,w.wrapConstructor)(()=>new p)},54658:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.shake256=f.shake128=f.keccak_512=f.keccak_384=f.keccak_256=f.keccak_224=f.sha3_512=f.sha3_384=f.sha3_256=f.sha3_224=f.Keccak=f.keccakP=void 0;const h=_(81778),w=_(58627),E=_(49724),v=[],c=[],d=[],p=BigInt(0),m=BigInt(1),C=BigInt(2),x=BigInt(7),R=BigInt(256),S=BigInt(113);for(let le=0,X=m,se=1,de=0;le<24;le++){[se,de]=[de,(2*se+3*de)%5],v.push(2*(5*de+se)),c.push((le+1)*(le+2)/2%64);let ye=p;for(let he=0;he<7;he++)X=(X<<m^(X>>x)*S)%R,X&C&&(ye^=m<<(m<<BigInt(he))-m);d.push(ye)}const[O,M]=(0,w.split)(d,!0),k=(le,X,se)=>se>32?(0,w.rotlBH)(le,X,se):(0,w.rotlSH)(le,X,se),q=(le,X,se)=>se>32?(0,w.rotlBL)(le,X,se):(0,w.rotlSL)(le,X,se);function b(le,X=24){const se=new Uint32Array(10);for(let de=24-X;de<24;de++){for(let K=0;K<10;K++)se[K]=le[K]^le[K+10]^le[K+20]^le[K+30]^le[K+40];for(let K=0;K<10;K+=2){const B=(K+8)%10,L=(K+2)%10,$=se[L],T=se[L+1],N=k($,T,1)^se[B],j=q($,T,1)^se[B+1];for(let Y=0;Y<50;Y+=10)le[K+Y]^=N,le[K+Y+1]^=j}let ye=le[2],he=le[3];for(let K=0;K<24;K++){const B=c[K],L=k(ye,he,B),$=q(ye,he,B),T=v[K];ye=le[T],he=le[T+1],le[T]=L,le[T+1]=$}for(let K=0;K<50;K+=10){for(let B=0;B<10;B++)se[B]=le[K+B];for(let B=0;B<10;B++)le[K+B]^=~se[(B+2)%10]&se[(B+4)%10]}le[0]^=O[de],le[1]^=M[de]}se.fill(0)}f.keccakP=b;class F extends E.Hash{constructor(X,se,de,ye=!1,he=24){if(super(),this.blockLen=X,this.suffix=se,this.outputLen=de,this.enableXOF=ye,this.rounds=he,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,h.number)(de),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,E.u32)(this.state)}keccak(){E.isLE||(0,E.byteSwap32)(this.state32),b(this.state32,this.rounds),E.isLE||(0,E.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(X){(0,h.exists)(this);const{blockLen:se,state:de}=this;X=(0,E.toBytes)(X);const ye=X.length;for(let he=0;he<ye;){const K=Math.min(se-this.pos,ye-he);for(let B=0;B<K;B++)de[this.pos++]^=X[he++];this.pos===se&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:X,suffix:se,pos:de,blockLen:ye}=this;X[de]^=se,se&128&&de===ye-1&&this.keccak(),X[ye-1]^=128,this.keccak()}writeInto(X){(0,h.exists)(this,!1),(0,h.bytes)(X),this.finish();const se=this.state,{blockLen:de}=this;for(let ye=0,he=X.length;ye<he;){this.posOut>=de&&this.keccak();const K=Math.min(de-this.posOut,he-ye);X.set(se.subarray(this.posOut,this.posOut+K),ye),this.posOut+=K,ye+=K}return X}xofInto(X){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(X)}xof(X){return(0,h.number)(X),this.xofInto(new Uint8Array(X))}digestInto(X){if((0,h.output)(X,this),this.finished)throw new Error("digest() was already called");return this.writeInto(X),this.destroy(),X}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(X){const{blockLen:se,suffix:de,outputLen:ye,rounds:he,enableXOF:K}=this;return X||(X=new F(se,de,ye,K,he)),X.state32.set(this.state32),X.pos=this.pos,X.posOut=this.posOut,X.finished=this.finished,X.rounds=he,X.suffix=de,X.outputLen=ye,X.enableXOF=K,X.destroyed=this.destroyed,X}}f.Keccak=F;const G=(le,X,se)=>(0,E.wrapConstructor)(()=>new F(X,le,se));f.sha3_224=G(6,144,28),f.sha3_256=G(6,136,32),f.sha3_384=G(6,104,48),f.sha3_512=G(6,72,64),f.keccak_224=G(1,144,28),f.keccak_256=G(1,136,32),f.keccak_384=G(1,104,48),f.keccak_512=G(1,72,64);const ue=(le,X,se)=>(0,E.wrapXOFConstructorWithOpts)((de={})=>new F(X,le,de.dkLen===void 0?se:de.dkLen,!0));f.shake128=ue(31,168,16),f.shake256=ue(31,136,32)},49724:function(ie,f,_){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(f,"__esModule",{value:!0}),f.randomBytes=f.wrapXOFConstructorWithOpts=f.wrapConstructorWithOpts=f.wrapConstructor=f.checkOpts=f.Hash=f.concatBytes=f.toBytes=f.utf8ToBytes=f.asyncLoop=f.nextTick=f.hexToBytes=f.bytesToHex=f.byteSwap32=f.byteSwapIfBE=f.byteSwap=f.isLE=f.rotl=f.rotr=f.createView=f.u32=f.u8=f.isBytes=void 0;const h=_(53644),w=_(81778);function E(B){return B instanceof Uint8Array||B!=null&&typeof B=="object"&&B.constructor.name==="Uint8Array"}f.isBytes=E;const v=B=>new Uint8Array(B.buffer,B.byteOffset,B.byteLength);f.u8=v;const c=B=>new Uint32Array(B.buffer,B.byteOffset,Math.floor(B.byteLength/4));f.u32=c;const d=B=>new DataView(B.buffer,B.byteOffset,B.byteLength);f.createView=d;const p=(B,L)=>B<<32-L|B>>>L;f.rotr=p;const m=(B,L)=>B<<L|B>>>32-L>>>0;f.rotl=m,f.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const C=B=>B<<24&4278190080|B<<8&16711680|B>>>8&65280|B>>>24&255;f.byteSwap=C,f.byteSwapIfBE=f.isLE?B=>B:B=>(0,f.byteSwap)(B);function x(B){for(let L=0;L<B.length;L++)B[L]=(0,f.byteSwap)(B[L])}f.byteSwap32=x;const R=Array.from({length:256},(B,L)=>L.toString(16).padStart(2,"0"));function S(B){(0,w.bytes)(B);let L="";for(let $=0;$<B.length;$++)L+=R[B[$]];return L}f.bytesToHex=S;const O={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function M(B){if(B>=O._0&&B<=O._9)return B-O._0;if(B>=O._A&&B<=O._F)return B-(O._A-10);if(B>=O._a&&B<=O._f)return B-(O._a-10)}function k(B){if(typeof B!="string")throw new Error("hex string expected, got "+typeof B);const L=B.length,$=L/2;if(L%2)throw new Error("padded hex string expected, got unpadded hex of length "+L);const T=new Uint8Array($);for(let N=0,j=0;N<$;N++,j+=2){const Y=M(B.charCodeAt(j)),Z=M(B.charCodeAt(j+1));if(Y===void 0||Z===void 0){const z=B[j]+B[j+1];throw new Error('hex string expected, got non-hex character "'+z+'" at index '+j)}T[N]=Y*16+Z}return T}f.hexToBytes=k;const q=async()=>{};f.nextTick=q;async function b(B,L,$){let T=Date.now();for(let N=0;N<B;N++){$(N);const j=Date.now()-T;j>=0&&j<L||(await(0,f.nextTick)(),T+=j)}}f.asyncLoop=b;function F(B){if(typeof B!="string")throw new Error(`utf8ToBytes expected string, got ${typeof B}`);return new Uint8Array(new TextEncoder().encode(B))}f.utf8ToBytes=F;function G(B){return typeof B=="string"&&(B=F(B)),(0,w.bytes)(B),B}f.toBytes=G;function ue(...B){let L=0;for(let T=0;T<B.length;T++){const N=B[T];(0,w.bytes)(N),L+=N.length}const $=new Uint8Array(L);for(let T=0,N=0;T<B.length;T++){const j=B[T];$.set(j,N),N+=j.length}return $}f.concatBytes=ue;class le{clone(){return this._cloneInto()}}f.Hash=le;const X={}.toString;function se(B,L){if(L!==void 0&&X.call(L)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(B,L)}f.checkOpts=se;function de(B){const L=T=>B().update(G(T)).digest(),$=B();return L.outputLen=$.outputLen,L.blockLen=$.blockLen,L.create=()=>B(),L}f.wrapConstructor=de;function ye(B){const L=(T,N)=>B(N).update(G(T)).digest(),$=B({});return L.outputLen=$.outputLen,L.blockLen=$.blockLen,L.create=T=>B(T),L}f.wrapConstructorWithOpts=ye;function he(B){const L=(T,N)=>B(N).update(G(T)).digest(),$=B({});return L.outputLen=$.outputLen,L.blockLen=$.blockLen,L.create=T=>B(T),L}f.wrapXOFConstructorWithOpts=he;function K(B=32){if(h.crypto&&typeof h.crypto.getRandomValues=="function")return h.crypto.getRandomValues(new Uint8Array(B));throw new Error("crypto.getRandomValues must be defined")}f.randomBytes=K},68443:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.isBytes=w,f.number=_,f.bool=h,f.bytes=E,f.hash=v,f.exists=c,f.output=d;function _(m){if(!Number.isSafeInteger(m)||m<0)throw new Error(`positive integer expected, not ${m}`)}function h(m){if(typeof m!="boolean")throw new Error(`boolean expected, not ${m}`)}function w(m){return m instanceof Uint8Array||m!=null&&typeof m=="object"&&m.constructor.name==="Uint8Array"}function E(m,...C){if(!w(m))throw new Error("Uint8Array expected");if(C.length>0&&!C.includes(m.length))throw new Error(`Uint8Array expected of length ${C}, not of length=${m.length}`)}function v(m){if(typeof m!="function"||typeof m.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");_(m.outputLen),_(m.blockLen)}function c(m,C=!0){if(m.destroyed)throw new Error("Hash instance has been destroyed");if(C&&m.finished)throw new Error("Hash#digest() has already been called")}function d(m,C){E(m);const x=C.outputLen;if(m.length<x)throw new Error(`digestInto() expects output buffer of length at least ${x}`)}const p={number:_,bool:h,bytes:E,hash:v,exists:c,output:d};f.default=p},15204:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.HashMD=f.Maj=f.Chi=void 0;const h=_(68443),w=_(86361);function E(p,m,C,x){if(typeof p.setBigUint64=="function")return p.setBigUint64(m,C,x);const R=BigInt(32),S=BigInt(4294967295),O=Number(C>>R&S),M=Number(C&S),k=x?4:0,q=x?0:4;p.setUint32(m+k,O,x),p.setUint32(m+q,M,x)}const v=(p,m,C)=>p&m^~p&C;f.Chi=v;const c=(p,m,C)=>p&m^p&C^m&C;f.Maj=c;class d extends w.Hash{constructor(m,C,x,R){super(),this.blockLen=m,this.outputLen=C,this.padOffset=x,this.isLE=R,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(m),this.view=(0,w.createView)(this.buffer)}update(m){(0,h.exists)(this);const{view:C,buffer:x,blockLen:R}=this;m=(0,w.toBytes)(m);const S=m.length;for(let O=0;O<S;){const M=Math.min(R-this.pos,S-O);if(M===R){const k=(0,w.createView)(m);for(;R<=S-O;O+=R)this.process(k,O);continue}x.set(m.subarray(O,O+M),this.pos),this.pos+=M,O+=M,this.pos===R&&(this.process(C,0),this.pos=0)}return this.length+=m.length,this.roundClean(),this}digestInto(m){(0,h.exists)(this),(0,h.output)(m,this),this.finished=!0;const{buffer:C,view:x,blockLen:R,isLE:S}=this;let{pos:O}=this;C[O++]=128,this.buffer.subarray(O).fill(0),this.padOffset>R-O&&(this.process(x,0),O=0);for(let F=O;F<R;F++)C[F]=0;E(x,R-8,BigInt(this.length*8),S),this.process(x,0);const M=(0,w.createView)(m),k=this.outputLen;if(k%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const q=k/4,b=this.get();if(q>b.length)throw new Error("_sha2: outputLen bigger than state");for(let F=0;F<q;F++)M.setUint32(4*F,b[F],S)}digest(){const{buffer:m,outputLen:C}=this;this.digestInto(m);const x=m.slice(0,C);return this.destroy(),x}_cloneInto(m){m||(m=new this.constructor),m.set(...this.get());const{blockLen:C,buffer:x,length:R,finished:S,destroyed:O,pos:M}=this;return m.length=R,m.pos=M,m.finished=S,m.destroyed=O,R%C&&m.buffer.set(x),m}}f.HashMD=d},57736:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.add5L=f.add5H=f.add4H=f.add4L=f.add3H=f.add3L=f.rotlBL=f.rotlBH=f.rotlSL=f.rotlSH=f.rotr32L=f.rotr32H=f.rotrBL=f.rotrBH=f.rotrSL=f.rotrSH=f.shrSL=f.shrSH=f.toBig=void 0,f.fromBig=w,f.split=E,f.add=b;const _=BigInt(2**32-1),h=BigInt(32);function w(ye,he=!1){return he?{h:Number(ye&_),l:Number(ye>>h&_)}:{h:Number(ye>>h&_)|0,l:Number(ye&_)|0}}function E(ye,he=!1){let K=new Uint32Array(ye.length),B=new Uint32Array(ye.length);for(let L=0;L<ye.length;L++){const{h:$,l:T}=w(ye[L],he);[K[L],B[L]]=[$,T]}return[K,B]}const v=(ye,he)=>BigInt(ye>>>0)<<h|BigInt(he>>>0);f.toBig=v;const c=(ye,he,K)=>ye>>>K;f.shrSH=c;const d=(ye,he,K)=>ye<<32-K|he>>>K;f.shrSL=d;const p=(ye,he,K)=>ye>>>K|he<<32-K;f.rotrSH=p;const m=(ye,he,K)=>ye<<32-K|he>>>K;f.rotrSL=m;const C=(ye,he,K)=>ye<<64-K|he>>>K-32;f.rotrBH=C;const x=(ye,he,K)=>ye>>>K-32|he<<64-K;f.rotrBL=x;const R=(ye,he)=>he;f.rotr32H=R;const S=(ye,he)=>ye;f.rotr32L=S;const O=(ye,he,K)=>ye<<K|he>>>32-K;f.rotlSH=O;const M=(ye,he,K)=>he<<K|ye>>>32-K;f.rotlSL=M;const k=(ye,he,K)=>he<<K-32|ye>>>64-K;f.rotlBH=k;const q=(ye,he,K)=>ye<<K-32|he>>>64-K;f.rotlBL=q;function b(ye,he,K,B){const L=(he>>>0)+(B>>>0);return{h:ye+K+(L/4294967296|0)|0,l:L|0}}const F=(ye,he,K)=>(ye>>>0)+(he>>>0)+(K>>>0);f.add3L=F;const G=(ye,he,K,B)=>he+K+B+(ye/2**32|0)|0;f.add3H=G;const ue=(ye,he,K,B)=>(ye>>>0)+(he>>>0)+(K>>>0)+(B>>>0);f.add4L=ue;const le=(ye,he,K,B,L)=>he+K+B+L+(ye/2**32|0)|0;f.add4H=le;const X=(ye,he,K,B,L)=>(ye>>>0)+(he>>>0)+(K>>>0)+(B>>>0)+(L>>>0);f.add5L=X;const se=(ye,he,K,B,L,$)=>he+K+B+L+$+(ye/2**32|0)|0;f.add5H=se;const de={fromBig:w,split:E,toBig:v,shrSH:c,shrSL:d,rotrSH:p,rotrSL:m,rotrBH:C,rotrBL:x,rotr32H:R,rotr32L:S,rotlSH:O,rotlSL:M,rotlBH:k,rotlBL:q,add:b,add3L:F,add3H:G,add4L:ue,add4H:le,add5H:se,add5L:X};f.default=de},90623:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.crypto=void 0,f.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0},14549:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.hkdf=void 0,f.extract=v,f.expand=p;const h=_(68443),w=_(86361),E=_(44629);function v(C,x,R){return(0,h.hash)(C),R===void 0&&(R=new Uint8Array(C.outputLen)),(0,E.hmac)(C,(0,w.toBytes)(R),(0,w.toBytes)(x))}const c=new Uint8Array([0]),d=new Uint8Array;function p(C,x,R,S=32){if((0,h.hash)(C),(0,h.number)(S),S>255*C.outputLen)throw new Error("Length should be <= 255*HashLen");const O=Math.ceil(S/C.outputLen);R===void 0&&(R=d);const M=new Uint8Array(O*C.outputLen),k=E.hmac.create(C,x),q=k._cloneInto(),b=new Uint8Array(k.outputLen);for(let F=0;F<O;F++)c[0]=F+1,q.update(F===0?d:b).update(R).update(c).digestInto(b),M.set(b,C.outputLen*F),k._cloneInto(q);return k.destroy(),q.destroy(),b.fill(0),c.fill(0),M.slice(0,S)}const m=(C,x,R,S,O)=>p(C,v(C,x,R),S,O);f.hkdf=m},44629:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.hmac=f.HMAC=void 0;const h=_(68443),w=_(86361);class E extends w.Hash{constructor(d,p){super(),this.finished=!1,this.destroyed=!1,(0,h.hash)(d);const m=(0,w.toBytes)(p);if(this.iHash=d.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const C=this.blockLen,x=new Uint8Array(C);x.set(m.length>C?d.create().update(m).digest():m);for(let R=0;R<x.length;R++)x[R]^=54;this.iHash.update(x),this.oHash=d.create();for(let R=0;R<x.length;R++)x[R]^=106;this.oHash.update(x),x.fill(0)}update(d){return(0,h.exists)(this),this.iHash.update(d),this}digestInto(d){(0,h.exists)(this),(0,h.bytes)(d,this.outputLen),this.finished=!0,this.iHash.digestInto(d),this.oHash.update(d),this.oHash.digestInto(d),this.destroy()}digest(){const d=new Uint8Array(this.oHash.outputLen);return this.digestInto(d),d}_cloneInto(d){d||(d=Object.create(Object.getPrototypeOf(this),{}));const{oHash:p,iHash:m,finished:C,destroyed:x,blockLen:R,outputLen:S}=this;return d=d,d.finished=C,d.destroyed=x,d.blockLen=R,d.outputLen=S,d.oHash=p._cloneInto(d.oHash),d.iHash=m._cloneInto(d.iHash),d}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}f.HMAC=E;const v=(c,d,p)=>new E(c,d).update(p).digest();f.hmac=v,f.hmac.create=(c,d)=>new E(c,d)},23741:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.sha224=f.sha256=f.SHA256=void 0;const h=_(15204),w=_(86361),E=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),v=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class d extends h.HashMD{constructor(){super(64,32,8,!1),this.A=v[0]|0,this.B=v[1]|0,this.C=v[2]|0,this.D=v[3]|0,this.E=v[4]|0,this.F=v[5]|0,this.G=v[6]|0,this.H=v[7]|0}get(){const{A:C,B:x,C:R,D:S,E:O,F:M,G:k,H:q}=this;return[C,x,R,S,O,M,k,q]}set(C,x,R,S,O,M,k,q){this.A=C|0,this.B=x|0,this.C=R|0,this.D=S|0,this.E=O|0,this.F=M|0,this.G=k|0,this.H=q|0}process(C,x){for(let G=0;G<16;G++,x+=4)c[G]=C.getUint32(x,!1);for(let G=16;G<64;G++){const ue=c[G-15],le=c[G-2],X=(0,w.rotr)(ue,7)^(0,w.rotr)(ue,18)^ue>>>3,se=(0,w.rotr)(le,17)^(0,w.rotr)(le,19)^le>>>10;c[G]=se+c[G-7]+X+c[G-16]|0}let{A:R,B:S,C:O,D:M,E:k,F:q,G:b,H:F}=this;for(let G=0;G<64;G++){const ue=(0,w.rotr)(k,6)^(0,w.rotr)(k,11)^(0,w.rotr)(k,25),le=F+ue+(0,h.Chi)(k,q,b)+E[G]+c[G]|0,se=((0,w.rotr)(R,2)^(0,w.rotr)(R,13)^(0,w.rotr)(R,22))+(0,h.Maj)(R,S,O)|0;F=b,b=q,q=k,k=M+le|0,M=O,O=S,S=R,R=le+se|0}R=R+this.A|0,S=S+this.B|0,O=O+this.C|0,M=M+this.D|0,k=k+this.E|0,q=q+this.F|0,b=b+this.G|0,F=F+this.H|0,this.set(R,S,O,M,k,q,b,F)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}f.SHA256=d;class p extends d{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}f.sha256=(0,w.wrapConstructor)(()=>new d),f.sha224=(0,w.wrapConstructor)(()=>new p)},44525:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.shake256=f.shake128=f.keccak_512=f.keccak_384=f.keccak_256=f.keccak_224=f.sha3_512=f.sha3_384=f.sha3_256=f.sha3_224=f.Keccak=void 0,f.keccakP=b;const h=_(68443),w=_(57736),E=_(86361),v=[],c=[],d=[],p=BigInt(0),m=BigInt(1),C=BigInt(2),x=BigInt(7),R=BigInt(256),S=BigInt(113);for(let le=0,X=m,se=1,de=0;le<24;le++){[se,de]=[de,(2*se+3*de)%5],v.push(2*(5*de+se)),c.push((le+1)*(le+2)/2%64);let ye=p;for(let he=0;he<7;he++)X=(X<<m^(X>>x)*S)%R,X&C&&(ye^=m<<(m<<BigInt(he))-m);d.push(ye)}const[O,M]=(0,w.split)(d,!0),k=(le,X,se)=>se>32?(0,w.rotlBH)(le,X,se):(0,w.rotlSH)(le,X,se),q=(le,X,se)=>se>32?(0,w.rotlBL)(le,X,se):(0,w.rotlSL)(le,X,se);function b(le,X=24){const se=new Uint32Array(10);for(let de=24-X;de<24;de++){for(let K=0;K<10;K++)se[K]=le[K]^le[K+10]^le[K+20]^le[K+30]^le[K+40];for(let K=0;K<10;K+=2){const B=(K+8)%10,L=(K+2)%10,$=se[L],T=se[L+1],N=k($,T,1)^se[B],j=q($,T,1)^se[B+1];for(let Y=0;Y<50;Y+=10)le[K+Y]^=N,le[K+Y+1]^=j}let ye=le[2],he=le[3];for(let K=0;K<24;K++){const B=c[K],L=k(ye,he,B),$=q(ye,he,B),T=v[K];ye=le[T],he=le[T+1],le[T]=L,le[T+1]=$}for(let K=0;K<50;K+=10){for(let B=0;B<10;B++)se[B]=le[K+B];for(let B=0;B<10;B++)le[K+B]^=~se[(B+2)%10]&se[(B+4)%10]}le[0]^=O[de],le[1]^=M[de]}se.fill(0)}class F extends E.Hash{constructor(X,se,de,ye=!1,he=24){if(super(),this.blockLen=X,this.suffix=se,this.outputLen=de,this.enableXOF=ye,this.rounds=he,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,h.number)(de),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,E.u32)(this.state)}keccak(){E.isLE||(0,E.byteSwap32)(this.state32),b(this.state32,this.rounds),E.isLE||(0,E.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(X){(0,h.exists)(this);const{blockLen:se,state:de}=this;X=(0,E.toBytes)(X);const ye=X.length;for(let he=0;he<ye;){const K=Math.min(se-this.pos,ye-he);for(let B=0;B<K;B++)de[this.pos++]^=X[he++];this.pos===se&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:X,suffix:se,pos:de,blockLen:ye}=this;X[de]^=se,se&128&&de===ye-1&&this.keccak(),X[ye-1]^=128,this.keccak()}writeInto(X){(0,h.exists)(this,!1),(0,h.bytes)(X),this.finish();const se=this.state,{blockLen:de}=this;for(let ye=0,he=X.length;ye<he;){this.posOut>=de&&this.keccak();const K=Math.min(de-this.posOut,he-ye);X.set(se.subarray(this.posOut,this.posOut+K),ye),this.posOut+=K,ye+=K}return X}xofInto(X){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(X)}xof(X){return(0,h.number)(X),this.xofInto(new Uint8Array(X))}digestInto(X){if((0,h.output)(X,this),this.finished)throw new Error("digest() was already called");return this.writeInto(X),this.destroy(),X}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(X){const{blockLen:se,suffix:de,outputLen:ye,rounds:he,enableXOF:K}=this;return X||(X=new F(se,de,ye,K,he)),X.state32.set(this.state32),X.pos=this.pos,X.posOut=this.posOut,X.finished=this.finished,X.rounds=he,X.suffix=de,X.outputLen=ye,X.enableXOF=K,X.destroyed=this.destroyed,X}}f.Keccak=F;const G=(le,X,se)=>(0,E.wrapConstructor)(()=>new F(X,le,se));f.sha3_224=G(6,144,28),f.sha3_256=G(6,136,32),f.sha3_384=G(6,104,48),f.sha3_512=G(6,72,64),f.keccak_224=G(1,144,28),f.keccak_256=G(1,136,32),f.keccak_384=G(1,104,48),f.keccak_512=G(1,72,64);const ue=(le,X,se)=>(0,E.wrapXOFConstructorWithOpts)((de={})=>new F(X,le,de.dkLen===void 0?se:de.dkLen,!0));f.shake128=ue(31,168,16),f.shake256=ue(31,136,32)},86361:function(ie,f,_){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(f,"__esModule",{value:!0}),f.Hash=f.nextTick=f.byteSwapIfBE=f.byteSwap=f.isLE=f.rotl=f.rotr=f.createView=f.u32=f.u8=void 0,f.isBytes=E,f.byteSwap32=x,f.bytesToHex=S,f.hexToBytes=k,f.asyncLoop=b,f.utf8ToBytes=F,f.toBytes=G,f.concatBytes=ue,f.checkOpts=se,f.wrapConstructor=de,f.wrapConstructorWithOpts=ye,f.wrapXOFConstructorWithOpts=he,f.randomBytes=K;const h=_(90623),w=_(68443);function E(B){return B instanceof Uint8Array||B!=null&&typeof B=="object"&&B.constructor.name==="Uint8Array"}const v=B=>new Uint8Array(B.buffer,B.byteOffset,B.byteLength);f.u8=v;const c=B=>new Uint32Array(B.buffer,B.byteOffset,Math.floor(B.byteLength/4));f.u32=c;const d=B=>new DataView(B.buffer,B.byteOffset,B.byteLength);f.createView=d;const p=(B,L)=>B<<32-L|B>>>L;f.rotr=p;const m=(B,L)=>B<<L|B>>>32-L>>>0;f.rotl=m,f.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const C=B=>B<<24&4278190080|B<<8&16711680|B>>>8&65280|B>>>24&255;f.byteSwap=C,f.byteSwapIfBE=f.isLE?B=>B:B=>(0,f.byteSwap)(B);function x(B){for(let L=0;L<B.length;L++)B[L]=(0,f.byteSwap)(B[L])}const R=Array.from({length:256},(B,L)=>L.toString(16).padStart(2,"0"));function S(B){(0,w.bytes)(B);let L="";for(let $=0;$<B.length;$++)L+=R[B[$]];return L}const O={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function M(B){if(B>=O._0&&B<=O._9)return B-O._0;if(B>=O._A&&B<=O._F)return B-(O._A-10);if(B>=O._a&&B<=O._f)return B-(O._a-10)}function k(B){if(typeof B!="string")throw new Error("hex string expected, got "+typeof B);const L=B.length,$=L/2;if(L%2)throw new Error("padded hex string expected, got unpadded hex of length "+L);const T=new Uint8Array($);for(let N=0,j=0;N<$;N++,j+=2){const Y=M(B.charCodeAt(j)),Z=M(B.charCodeAt(j+1));if(Y===void 0||Z===void 0){const z=B[j]+B[j+1];throw new Error('hex string expected, got non-hex character "'+z+'" at index '+j)}T[N]=Y*16+Z}return T}const q=async()=>{};f.nextTick=q;async function b(B,L,$){let T=Date.now();for(let N=0;N<B;N++){$(N);const j=Date.now()-T;j>=0&&j<L||(await(0,f.nextTick)(),T+=j)}}function F(B){if(typeof B!="string")throw new Error(`utf8ToBytes expected string, got ${typeof B}`);return new Uint8Array(new TextEncoder().encode(B))}function G(B){return typeof B=="string"&&(B=F(B)),(0,w.bytes)(B),B}function ue(...B){let L=0;for(let T=0;T<B.length;T++){const N=B[T];(0,w.bytes)(N),L+=N.length}const $=new Uint8Array(L);for(let T=0,N=0;T<B.length;T++){const j=B[T];$.set(j,N),N+=j.length}return $}class le{clone(){return this._cloneInto()}}f.Hash=le;const X={}.toString;function se(B,L){if(L!==void 0&&X.call(L)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(B,L)}function de(B){const L=T=>B().update(G(T)).digest(),$=B();return L.outputLen=$.outputLen,L.blockLen=$.blockLen,L.create=()=>B(),L}function ye(B){const L=(T,N)=>B(N).update(G(T)).digest(),$=B({});return L.outputLen=$.outputLen,L.blockLen=$.blockLen,L.create=T=>B(T),L}function he(B){const L=(T,N)=>B(N).update(G(T)).digest(),$=B({});return L.outputLen=$.outputLen,L.blockLen=$.blockLen,L.create=T=>B(T),L}function K(B=32){if(h.crypto&&typeof h.crypto.getRandomValues=="function")return h.crypto.getRandomValues(new Uint8Array(B));if(h.crypto&&typeof h.crypto.randomBytes=="function")return h.crypto.randomBytes(B);throw new Error("crypto.getRandomValues must be defined")}},92973:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.SHA512_IV=f.SHA384_IV=f.SHA224_IV=f.SHA256_IV=f.HashMD=void 0,f.setBigUint64=w,f.Chi=E,f.Maj=v;const h=_(66624);function w(d,p,m,C){if(typeof d.setBigUint64=="function")return d.setBigUint64(p,m,C);const x=BigInt(32),R=BigInt(4294967295),S=Number(m>>x&R),O=Number(m&R),M=C?4:0,k=C?0:4;d.setUint32(p+M,S,C),d.setUint32(p+k,O,C)}function E(d,p,m){return d&p^~d&m}function v(d,p,m){return d&p^d&m^p&m}class c extends h.Hash{constructor(p,m,C,x){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=p,this.outputLen=m,this.padOffset=C,this.isLE=x,this.buffer=new Uint8Array(p),this.view=(0,h.createView)(this.buffer)}update(p){(0,h.aexists)(this),p=(0,h.toBytes)(p),(0,h.abytes)(p);const{view:m,buffer:C,blockLen:x}=this,R=p.length;for(let S=0;S<R;){const O=Math.min(x-this.pos,R-S);if(O===x){const M=(0,h.createView)(p);for(;x<=R-S;S+=x)this.process(M,S);continue}C.set(p.subarray(S,S+O),this.pos),this.pos+=O,S+=O,this.pos===x&&(this.process(m,0),this.pos=0)}return this.length+=p.length,this.roundClean(),this}digestInto(p){(0,h.aexists)(this),(0,h.aoutput)(p,this),this.finished=!0;const{buffer:m,view:C,blockLen:x,isLE:R}=this;let{pos:S}=this;m[S++]=128,(0,h.clean)(this.buffer.subarray(S)),this.padOffset>x-S&&(this.process(C,0),S=0);for(let b=S;b<x;b++)m[b]=0;w(C,x-8,BigInt(this.length*8),R),this.process(C,0);const O=(0,h.createView)(p),M=this.outputLen;if(M%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const k=M/4,q=this.get();if(k>q.length)throw new Error("_sha2: outputLen bigger than state");for(let b=0;b<k;b++)O.setUint32(4*b,q[b],R)}digest(){const{buffer:p,outputLen:m}=this;this.digestInto(p);const C=p.slice(0,m);return this.destroy(),C}_cloneInto(p){p||(p=new this.constructor),p.set(...this.get());const{blockLen:m,buffer:C,length:x,finished:R,destroyed:S,pos:O}=this;return p.destroyed=S,p.finished=R,p.length=x,p.pos=O,x%m&&p.buffer.set(C),p}clone(){return this._cloneInto()}}f.HashMD=c,f.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),f.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),f.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),f.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])},31639:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.toBig=f.shrSL=f.shrSH=f.rotrSL=f.rotrSH=f.rotrBL=f.rotrBH=f.rotr32L=f.rotr32H=f.rotlSL=f.rotlSH=f.rotlBL=f.rotlBH=f.add5L=f.add5H=f.add4L=f.add4H=f.add3L=f.add3H=void 0,f.add=b,f.fromBig=w,f.split=E;const _=BigInt(2**32-1),h=BigInt(32);function w(ye,he=!1){return he?{h:Number(ye&_),l:Number(ye>>h&_)}:{h:Number(ye>>h&_)|0,l:Number(ye&_)|0}}function E(ye,he=!1){const K=ye.length;let B=new Uint32Array(K),L=new Uint32Array(K);for(let $=0;$<K;$++){const{h:T,l:N}=w(ye[$],he);[B[$],L[$]]=[T,N]}return[B,L]}const v=(ye,he)=>BigInt(ye>>>0)<<h|BigInt(he>>>0);f.toBig=v;const c=(ye,he,K)=>ye>>>K;f.shrSH=c;const d=(ye,he,K)=>ye<<32-K|he>>>K;f.shrSL=d;const p=(ye,he,K)=>ye>>>K|he<<32-K;f.rotrSH=p;const m=(ye,he,K)=>ye<<32-K|he>>>K;f.rotrSL=m;const C=(ye,he,K)=>ye<<64-K|he>>>K-32;f.rotrBH=C;const x=(ye,he,K)=>ye>>>K-32|he<<64-K;f.rotrBL=x;const R=(ye,he)=>he;f.rotr32H=R;const S=(ye,he)=>ye;f.rotr32L=S;const O=(ye,he,K)=>ye<<K|he>>>32-K;f.rotlSH=O;const M=(ye,he,K)=>he<<K|ye>>>32-K;f.rotlSL=M;const k=(ye,he,K)=>he<<K-32|ye>>>64-K;f.rotlBH=k;const q=(ye,he,K)=>ye<<K-32|he>>>64-K;f.rotlBL=q;function b(ye,he,K,B){const L=(he>>>0)+(B>>>0);return{h:ye+K+(L/4294967296|0)|0,l:L|0}}const F=(ye,he,K)=>(ye>>>0)+(he>>>0)+(K>>>0);f.add3L=F;const G=(ye,he,K,B)=>he+K+B+(ye/2**32|0)|0;f.add3H=G;const ue=(ye,he,K,B)=>(ye>>>0)+(he>>>0)+(K>>>0)+(B>>>0);f.add4L=ue;const le=(ye,he,K,B,L)=>he+K+B+L+(ye/2**32|0)|0;f.add4H=le;const X=(ye,he,K,B,L)=>(ye>>>0)+(he>>>0)+(K>>>0)+(B>>>0)+(L>>>0);f.add5L=X;const se=(ye,he,K,B,L,$)=>he+K+B+L+$+(ye/2**32|0)|0;f.add5H=se;const de={fromBig:w,split:E,toBig:v,shrSH:c,shrSL:d,rotrSH:p,rotrSL:m,rotrBH:C,rotrBL:x,rotr32H:R,rotr32L:S,rotlSH:O,rotlSL:M,rotlBH:k,rotlBL:q,add:b,add3L:F,add3H:G,add4L:ue,add4H:le,add5H:se,add5L:X};f.default=de},65136:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.crypto=void 0,f.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0},46366:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.hmac=f.HMAC=void 0;const h=_(66624);class w extends h.Hash{constructor(c,d){super(),this.finished=!1,this.destroyed=!1,(0,h.ahash)(c);const p=(0,h.toBytes)(d);if(this.iHash=c.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const m=this.blockLen,C=new Uint8Array(m);C.set(p.length>m?c.create().update(p).digest():p);for(let x=0;x<C.length;x++)C[x]^=54;this.iHash.update(C),this.oHash=c.create();for(let x=0;x<C.length;x++)C[x]^=106;this.oHash.update(C),(0,h.clean)(C)}update(c){return(0,h.aexists)(this),this.iHash.update(c),this}digestInto(c){(0,h.aexists)(this),(0,h.abytes)(c,this.outputLen),this.finished=!0,this.iHash.digestInto(c),this.oHash.update(c),this.oHash.digestInto(c),this.destroy()}digest(){const c=new Uint8Array(this.oHash.outputLen);return this.digestInto(c),c}_cloneInto(c){c||(c=Object.create(Object.getPrototypeOf(this),{}));const{oHash:d,iHash:p,finished:m,destroyed:C,blockLen:x,outputLen:R}=this;return c=c,c.finished=m,c.destroyed=C,c.blockLen=x,c.outputLen=R,c.oHash=d._cloneInto(c.oHash),c.iHash=p._cloneInto(c.iHash),c}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}f.HMAC=w;const E=(v,c,d)=>new w(v,c).update(d).digest();f.hmac=E,f.hmac.create=(v,c)=>new w(v,c)},63589:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.sha512_224=f.sha512_256=f.sha384=f.sha512=f.sha224=f.sha256=f.SHA512_256=f.SHA512_224=f.SHA384=f.SHA512=f.SHA224=f.SHA256=void 0;const h=_(92973),w=_(31639),E=_(66624),v=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),c=new Uint32Array(64);class d extends h.HashMD{constructor(ue=32){super(64,ue,8,!1),this.A=h.SHA256_IV[0]|0,this.B=h.SHA256_IV[1]|0,this.C=h.SHA256_IV[2]|0,this.D=h.SHA256_IV[3]|0,this.E=h.SHA256_IV[4]|0,this.F=h.SHA256_IV[5]|0,this.G=h.SHA256_IV[6]|0,this.H=h.SHA256_IV[7]|0}get(){const{A:ue,B:le,C:X,D:se,E:de,F:ye,G:he,H:K}=this;return[ue,le,X,se,de,ye,he,K]}set(ue,le,X,se,de,ye,he,K){this.A=ue|0,this.B=le|0,this.C=X|0,this.D=se|0,this.E=de|0,this.F=ye|0,this.G=he|0,this.H=K|0}process(ue,le){for(let $=0;$<16;$++,le+=4)c[$]=ue.getUint32(le,!1);for(let $=16;$<64;$++){const T=c[$-15],N=c[$-2],j=(0,E.rotr)(T,7)^(0,E.rotr)(T,18)^T>>>3,Y=(0,E.rotr)(N,17)^(0,E.rotr)(N,19)^N>>>10;c[$]=Y+c[$-7]+j+c[$-16]|0}let{A:X,B:se,C:de,D:ye,E:he,F:K,G:B,H:L}=this;for(let $=0;$<64;$++){const T=(0,E.rotr)(he,6)^(0,E.rotr)(he,11)^(0,E.rotr)(he,25),N=L+T+(0,h.Chi)(he,K,B)+v[$]+c[$]|0,Y=((0,E.rotr)(X,2)^(0,E.rotr)(X,13)^(0,E.rotr)(X,22))+(0,h.Maj)(X,se,de)|0;L=B,B=K,K=he,he=ye+N|0,ye=de,de=se,se=X,X=N+Y|0}X=X+this.A|0,se=se+this.B|0,de=de+this.C|0,ye=ye+this.D|0,he=he+this.E|0,K=K+this.F|0,B=B+this.G|0,L=L+this.H|0,this.set(X,se,de,ye,he,K,B,L)}roundClean(){(0,E.clean)(c)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,E.clean)(this.buffer)}}f.SHA256=d;class p extends d{constructor(){super(28),this.A=h.SHA224_IV[0]|0,this.B=h.SHA224_IV[1]|0,this.C=h.SHA224_IV[2]|0,this.D=h.SHA224_IV[3]|0,this.E=h.SHA224_IV[4]|0,this.F=h.SHA224_IV[5]|0,this.G=h.SHA224_IV[6]|0,this.H=h.SHA224_IV[7]|0}}f.SHA224=p;const m=w.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(G=>BigInt(G))),C=m[0],x=m[1],R=new Uint32Array(80),S=new Uint32Array(80);class O extends h.HashMD{constructor(ue=64){super(128,ue,16,!1),this.Ah=h.SHA512_IV[0]|0,this.Al=h.SHA512_IV[1]|0,this.Bh=h.SHA512_IV[2]|0,this.Bl=h.SHA512_IV[3]|0,this.Ch=h.SHA512_IV[4]|0,this.Cl=h.SHA512_IV[5]|0,this.Dh=h.SHA512_IV[6]|0,this.Dl=h.SHA512_IV[7]|0,this.Eh=h.SHA512_IV[8]|0,this.El=h.SHA512_IV[9]|0,this.Fh=h.SHA512_IV[10]|0,this.Fl=h.SHA512_IV[11]|0,this.Gh=h.SHA512_IV[12]|0,this.Gl=h.SHA512_IV[13]|0,this.Hh=h.SHA512_IV[14]|0,this.Hl=h.SHA512_IV[15]|0}get(){const{Ah:ue,Al:le,Bh:X,Bl:se,Ch:de,Cl:ye,Dh:he,Dl:K,Eh:B,El:L,Fh:$,Fl:T,Gh:N,Gl:j,Hh:Y,Hl:Z}=this;return[ue,le,X,se,de,ye,he,K,B,L,$,T,N,j,Y,Z]}set(ue,le,X,se,de,ye,he,K,B,L,$,T,N,j,Y,Z){this.Ah=ue|0,this.Al=le|0,this.Bh=X|0,this.Bl=se|0,this.Ch=de|0,this.Cl=ye|0,this.Dh=he|0,this.Dl=K|0,this.Eh=B|0,this.El=L|0,this.Fh=$|0,this.Fl=T|0,this.Gh=N|0,this.Gl=j|0,this.Hh=Y|0,this.Hl=Z|0}process(ue,le){for(let te=0;te<16;te++,le+=4)R[te]=ue.getUint32(le),S[te]=ue.getUint32(le+=4);for(let te=16;te<80;te++){const H=R[te-15]|0,Q=S[te-15]|0,oe=w.rotrSH(H,Q,1)^w.rotrSH(H,Q,8)^w.shrSH(H,Q,7),_e=w.rotrSL(H,Q,1)^w.rotrSL(H,Q,8)^w.shrSL(H,Q,7),ge=R[te-2]|0,be=S[te-2]|0,we=w.rotrSH(ge,be,19)^w.rotrBH(ge,be,61)^w.shrSH(ge,be,6),Ee=w.rotrSL(ge,be,19)^w.rotrBL(ge,be,61)^w.shrSL(ge,be,6),me=w.add4L(_e,Ee,S[te-7],S[te-16]),Ke=w.add4H(me,oe,we,R[te-7],R[te-16]);R[te]=Ke|0,S[te]=me|0}let{Ah:X,Al:se,Bh:de,Bl:ye,Ch:he,Cl:K,Dh:B,Dl:L,Eh:$,El:T,Fh:N,Fl:j,Gh:Y,Gl:Z,Hh:z,Hl:fe}=this;for(let te=0;te<80;te++){const H=w.rotrSH($,T,14)^w.rotrSH($,T,18)^w.rotrBH($,T,41),Q=w.rotrSL($,T,14)^w.rotrSL($,T,18)^w.rotrBL($,T,41),oe=$&N^~$&Y,_e=T&j^~T&Z,ge=w.add5L(fe,Q,_e,x[te],S[te]),be=w.add5H(ge,z,H,oe,C[te],R[te]),we=ge|0,Ee=w.rotrSH(X,se,28)^w.rotrBH(X,se,34)^w.rotrBH(X,se,39),me=w.rotrSL(X,se,28)^w.rotrBL(X,se,34)^w.rotrBL(X,se,39),Ke=X&de^X&he^de&he,He=se&ye^se&K^ye&K;z=Y|0,fe=Z|0,Y=N|0,Z=j|0,N=$|0,j=T|0,{h:$,l:T}=w.add(B|0,L|0,be|0,we|0),B=he|0,L=K|0,he=de|0,K=ye|0,de=X|0,ye=se|0;const Ie=w.add3L(we,me,He);X=w.add3H(Ie,be,Ee,Ke),se=Ie|0}({h:X,l:se}=w.add(this.Ah|0,this.Al|0,X|0,se|0)),{h:de,l:ye}=w.add(this.Bh|0,this.Bl|0,de|0,ye|0),{h:he,l:K}=w.add(this.Ch|0,this.Cl|0,he|0,K|0),{h:B,l:L}=w.add(this.Dh|0,this.Dl|0,B|0,L|0),{h:$,l:T}=w.add(this.Eh|0,this.El|0,$|0,T|0),{h:N,l:j}=w.add(this.Fh|0,this.Fl|0,N|0,j|0),{h:Y,l:Z}=w.add(this.Gh|0,this.Gl|0,Y|0,Z|0),{h:z,l:fe}=w.add(this.Hh|0,this.Hl|0,z|0,fe|0),this.set(X,se,de,ye,he,K,B,L,$,T,N,j,Y,Z,z,fe)}roundClean(){(0,E.clean)(R,S)}destroy(){(0,E.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}f.SHA512=O;class M extends O{constructor(){super(48),this.Ah=h.SHA384_IV[0]|0,this.Al=h.SHA384_IV[1]|0,this.Bh=h.SHA384_IV[2]|0,this.Bl=h.SHA384_IV[3]|0,this.Ch=h.SHA384_IV[4]|0,this.Cl=h.SHA384_IV[5]|0,this.Dh=h.SHA384_IV[6]|0,this.Dl=h.SHA384_IV[7]|0,this.Eh=h.SHA384_IV[8]|0,this.El=h.SHA384_IV[9]|0,this.Fh=h.SHA384_IV[10]|0,this.Fl=h.SHA384_IV[11]|0,this.Gh=h.SHA384_IV[12]|0,this.Gl=h.SHA384_IV[13]|0,this.Hh=h.SHA384_IV[14]|0,this.Hl=h.SHA384_IV[15]|0}}f.SHA384=M;const k=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),q=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class b extends O{constructor(){super(28),this.Ah=k[0]|0,this.Al=k[1]|0,this.Bh=k[2]|0,this.Bl=k[3]|0,this.Ch=k[4]|0,this.Cl=k[5]|0,this.Dh=k[6]|0,this.Dl=k[7]|0,this.Eh=k[8]|0,this.El=k[9]|0,this.Fh=k[10]|0,this.Fl=k[11]|0,this.Gh=k[12]|0,this.Gl=k[13]|0,this.Hh=k[14]|0,this.Hl=k[15]|0}}f.SHA512_224=b;class F extends O{constructor(){super(32),this.Ah=q[0]|0,this.Al=q[1]|0,this.Bh=q[2]|0,this.Bl=q[3]|0,this.Ch=q[4]|0,this.Cl=q[5]|0,this.Dh=q[6]|0,this.Dl=q[7]|0,this.Eh=q[8]|0,this.El=q[9]|0,this.Fh=q[10]|0,this.Fl=q[11]|0,this.Gh=q[12]|0,this.Gl=q[13]|0,this.Hh=q[14]|0,this.Hl=q[15]|0}}f.SHA512_256=F,f.sha256=(0,E.createHasher)(()=>new d),f.sha224=(0,E.createHasher)(()=>new p),f.sha512=(0,E.createHasher)(()=>new O),f.sha384=(0,E.createHasher)(()=>new M),f.sha512_256=(0,E.createHasher)(()=>new F),f.sha512_224=(0,E.createHasher)(()=>new b)},66624:function(ie,f,_){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(f,"__esModule",{value:!0}),f.wrapXOFConstructorWithOpts=f.wrapConstructorWithOpts=f.wrapConstructor=f.Hash=f.nextTick=f.swap32IfBE=f.byteSwapIfBE=f.swap8IfBE=f.isLE=void 0,f.isBytes=w,f.anumber=E,f.abytes=v,f.ahash=c,f.aexists=d,f.aoutput=p,f.u8=m,f.u32=C,f.clean=x,f.createView=R,f.rotr=S,f.rotl=O,f.byteSwap=M,f.byteSwap32=k,f.bytesToHex=F,f.hexToBytes=le,f.asyncLoop=se,f.utf8ToBytes=de,f.bytesToUtf8=ye,f.toBytes=he,f.kdfInputToBytes=K,f.concatBytes=B,f.checkOpts=L,f.createHasher=T,f.createOptHasher=N,f.createXOFer=j,f.randomBytes=Y;const h=_(65136);function w(Z){return Z instanceof Uint8Array||ArrayBuffer.isView(Z)&&Z.constructor.name==="Uint8Array"}function E(Z){if(!Number.isSafeInteger(Z)||Z<0)throw new Error("positive integer expected, got "+Z)}function v(Z,...z){if(!w(Z))throw new Error("Uint8Array expected");if(z.length>0&&!z.includes(Z.length))throw new Error("Uint8Array expected of length "+z+", got length="+Z.length)}function c(Z){if(typeof Z!="function"||typeof Z.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");E(Z.outputLen),E(Z.blockLen)}function d(Z,z=!0){if(Z.destroyed)throw new Error("Hash instance has been destroyed");if(z&&Z.finished)throw new Error("Hash#digest() has already been called")}function p(Z,z){v(Z);const fe=z.outputLen;if(Z.length<fe)throw new Error("digestInto() expects output buffer of length at least "+fe)}function m(Z){return new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength)}function C(Z){return new Uint32Array(Z.buffer,Z.byteOffset,Math.floor(Z.byteLength/4))}function x(...Z){for(let z=0;z<Z.length;z++)Z[z].fill(0)}function R(Z){return new DataView(Z.buffer,Z.byteOffset,Z.byteLength)}function S(Z,z){return Z<<32-z|Z>>>z}function O(Z,z){return Z<<z|Z>>>32-z>>>0}f.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function M(Z){return Z<<24&4278190080|Z<<8&16711680|Z>>>8&65280|Z>>>24&255}f.swap8IfBE=f.isLE?Z=>Z:Z=>M(Z),f.byteSwapIfBE=f.swap8IfBE;function k(Z){for(let z=0;z<Z.length;z++)Z[z]=M(Z[z]);return Z}f.swap32IfBE=f.isLE?Z=>Z:k;const q=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",b=Array.from({length:256},(Z,z)=>z.toString(16).padStart(2,"0"));function F(Z){if(v(Z),q)return Z.toHex();let z="";for(let fe=0;fe<Z.length;fe++)z+=b[Z[fe]];return z}const G={_0:48,_9:57,A:65,F:70,a:97,f:102};function ue(Z){if(Z>=G._0&&Z<=G._9)return Z-G._0;if(Z>=G.A&&Z<=G.F)return Z-(G.A-10);if(Z>=G.a&&Z<=G.f)return Z-(G.a-10)}function le(Z){if(typeof Z!="string")throw new Error("hex string expected, got "+typeof Z);if(q)return Uint8Array.fromHex(Z);const z=Z.length,fe=z/2;if(z%2)throw new Error("hex string expected, got unpadded hex of length "+z);const te=new Uint8Array(fe);for(let H=0,Q=0;H<fe;H++,Q+=2){const oe=ue(Z.charCodeAt(Q)),_e=ue(Z.charCodeAt(Q+1));if(oe===void 0||_e===void 0){const ge=Z[Q]+Z[Q+1];throw new Error('hex string expected, got non-hex character "'+ge+'" at index '+Q)}te[H]=oe*16+_e}return te}const X=async()=>{};f.nextTick=X;async function se(Z,z,fe){let te=Date.now();for(let H=0;H<Z;H++){fe(H);const Q=Date.now()-te;Q>=0&&Q<z||(await(0,f.nextTick)(),te+=Q)}}function de(Z){if(typeof Z!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(Z))}function ye(Z){return new TextDecoder().decode(Z)}function he(Z){return typeof Z=="string"&&(Z=de(Z)),v(Z),Z}function K(Z){return typeof Z=="string"&&(Z=de(Z)),v(Z),Z}function B(...Z){let z=0;for(let te=0;te<Z.length;te++){const H=Z[te];v(H),z+=H.length}const fe=new Uint8Array(z);for(let te=0,H=0;te<Z.length;te++){const Q=Z[te];fe.set(Q,H),H+=Q.length}return fe}function L(Z,z){if(z!==void 0&&{}.toString.call(z)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(Z,z)}class ${}f.Hash=$;function T(Z){const z=te=>Z().update(he(te)).digest(),fe=Z();return z.outputLen=fe.outputLen,z.blockLen=fe.blockLen,z.create=()=>Z(),z}function N(Z){const z=(te,H)=>Z(H).update(he(te)).digest(),fe=Z({});return z.outputLen=fe.outputLen,z.blockLen=fe.blockLen,z.create=te=>Z(te),z}function j(Z){const z=(te,H)=>Z(H).update(he(te)).digest(),fe=Z({});return z.outputLen=fe.outputLen,z.blockLen=fe.blockLen,z.create=te=>Z(te),z}f.wrapConstructor=T,f.wrapConstructorWithOpts=N,f.wrapXOFConstructorWithOpts=j;function Y(Z=32){if(h.crypto&&typeof h.crypto.getRandomValues=="function")return h.crypto.getRandomValues(new Uint8Array(Z));if(h.crypto&&typeof h.crypto.randomBytes=="function")return Uint8Array.from(h.crypto.randomBytes(Z));throw new Error("crypto.getRandomValues must be defined")}},62723:function(ie,f){"use strict";/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(f,"__esModule",{value:!0}),f.bytes=f.stringToBytes=f.str=f.bytesToString=f.hex=f.utf8=f.bech32m=f.bech32=f.base58check=f.createBase58check=f.base58xmr=f.base58xrp=f.base58flickr=f.base58=f.base64urlnopad=f.base64url=f.base64nopad=f.base64=f.base32crockford=f.base32hexnopad=f.base32hex=f.base32nopad=f.base32=f.base16=f.utils=void 0,f.assertNumber=_;function _(K){if(!Number.isSafeInteger(K))throw new Error(`Wrong integer: ${K}`)}function h(K){return K instanceof Uint8Array||K!=null&&typeof K=="object"&&K.constructor.name==="Uint8Array"}function w(...K){const B=N=>N,L=(N,j)=>Y=>N(j(Y)),$=K.map(N=>N.encode).reduceRight(L,B),T=K.map(N=>N.decode).reduce(L,B);return{encode:$,decode:T}}function E(K){return{encode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return B.map(L=>{if(L<0||L>=K.length)throw new Error(`Digit index outside alphabet: ${L} (alphabet: ${K.length})`);return K[L]})},decode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="string")throw new Error("alphabet.decode input should be array of strings");return B.map(L=>{if(typeof L!="string")throw new Error(`alphabet.decode: not string element=${L}`);const $=K.indexOf(L);if($===-1)throw new Error(`Unknown letter: "${L}". Allowed: ${K}`);return $})}}}function v(K=""){if(typeof K!="string")throw new Error("join separator should be string");return{encode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="string")throw new Error("join.encode input should be array of strings");for(let L of B)if(typeof L!="string")throw new Error(`join.encode: non-string input=${L}`);return B.join(K)},decode:B=>{if(typeof B!="string")throw new Error("join.decode input should be string");return B.split(K)}}}function c(K,B="="){if(typeof B!="string")throw new Error("padding chr should be string");return{encode(L){if(!Array.isArray(L)||L.length&&typeof L[0]!="string")throw new Error("padding.encode input should be array of strings");for(let $ of L)if(typeof $!="string")throw new Error(`padding.encode: non-string input=${$}`);for(;L.length*K%8;)L.push(B);return L},decode(L){if(!Array.isArray(L)||L.length&&typeof L[0]!="string")throw new Error("padding.encode input should be array of strings");for(let T of L)if(typeof T!="string")throw new Error(`padding.decode: non-string input=${T}`);let $=L.length;if($*K%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;$>0&&L[$-1]===B;$--)if(!(($-1)*K%8))throw new Error("Invalid padding: string has too much padding");return L.slice(0,$)}}}function d(K){if(typeof K!="function")throw new Error("normalize fn should be function");return{encode:B=>B,decode:B=>K(B)}}function p(K,B,L){if(B<2)throw new Error(`convertRadix: wrong from=${B}, base cannot be less than 2`);if(L<2)throw new Error(`convertRadix: wrong to=${L}, base cannot be less than 2`);if(!Array.isArray(K))throw new Error("convertRadix: data should be array");if(!K.length)return[];let $=0;const T=[],N=Array.from(K);for(N.forEach(j=>{if(j<0||j>=B)throw new Error(`Wrong integer: ${j}`)});;){let j=0,Y=!0;for(let Z=$;Z<N.length;Z++){const z=N[Z],fe=B*j+z;if(!Number.isSafeInteger(fe)||B*j/B!==j||fe-z!==B*j)throw new Error("convertRadix: carry overflow");j=fe%L;const te=Math.floor(fe/L);if(N[Z]=te,!Number.isSafeInteger(te)||te*L+j!==fe)throw new Error("convertRadix: carry overflow");if(Y)te?Y=!1:$=Z;else continue}if(T.push(j),Y)break}for(let j=0;j<K.length-1&&K[j]===0;j++)T.push(0);return T.reverse()}const m=(K,B)=>B?m(B,K%B):K,C=(K,B)=>K+(B-m(K,B));function x(K,B,L,$){if(!Array.isArray(K))throw new Error("convertRadix2: data should be array");if(B<=0||B>32)throw new Error(`convertRadix2: wrong from=${B}`);if(L<=0||L>32)throw new Error(`convertRadix2: wrong to=${L}`);if(C(B,L)>32)throw new Error(`convertRadix2: carry overflow from=${B} to=${L} carryBits=${C(B,L)}`);let T=0,N=0;const j=2**L-1,Y=[];for(const Z of K){if(Z>=2**B)throw new Error(`convertRadix2: invalid data word=${Z} from=${B}`);if(T=T<<B|Z,N+B>32)throw new Error(`convertRadix2: carry overflow pos=${N} from=${B}`);for(N+=B;N>=L;N-=L)Y.push((T>>N-L&j)>>>0);T&=2**N-1}if(T=T<<L-N&j,!$&&N>=B)throw new Error("Excess padding");if(!$&&T)throw new Error(`Non-zero padding: ${T}`);return $&&N>0&&Y.push(T>>>0),Y}function R(K){return{encode:B=>{if(!h(B))throw new Error("radix.encode input should be Uint8Array");return p(Array.from(B),256,K)},decode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(p(B,K,256))}}}function S(K,B=!1){if(K<=0||K>32)throw new Error("radix2: bits should be in (0..32]");if(C(8,K)>32||C(K,8)>32)throw new Error("radix2: carry overflow");return{encode:L=>{if(!h(L))throw new Error("radix2.encode input should be Uint8Array");return x(Array.from(L),8,K,!B)},decode:L=>{if(!Array.isArray(L)||L.length&&typeof L[0]!="number")throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(x(L,K,8,B))}}}function O(K){if(typeof K!="function")throw new Error("unsafeWrapper fn should be function");return function(...B){try{return K.apply(null,B)}catch{}}}function M(K,B){if(typeof B!="function")throw new Error("checksum fn should be function");return{encode(L){if(!h(L))throw new Error("checksum.encode: input should be Uint8Array");const $=B(L).slice(0,K),T=new Uint8Array(L.length+K);return T.set(L),T.set($,L.length),T},decode(L){if(!h(L))throw new Error("checksum.decode: input should be Uint8Array");const $=L.slice(0,-K),T=B($).slice(0,K),N=L.slice(-K);for(let j=0;j<K;j++)if(T[j]!==N[j])throw new Error("Invalid checksum");return $}}}f.utils={alphabet:E,chain:w,checksum:M,convertRadix:p,convertRadix2:x,radix:R,radix2:S,join:v,padding:c},f.base16=w(S(4),E("0123456789ABCDEF"),v("")),f.base32=w(S(5),E("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),c(5),v("")),f.base32nopad=w(S(5),E("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),v("")),f.base32hex=w(S(5),E("0123456789ABCDEFGHIJKLMNOPQRSTUV"),c(5),v("")),f.base32hexnopad=w(S(5),E("0123456789ABCDEFGHIJKLMNOPQRSTUV"),v("")),f.base32crockford=w(S(5),E("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),v(""),d(K=>K.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),f.base64=w(S(6),E("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),c(6),v("")),f.base64nopad=w(S(6),E("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),v("")),f.base64url=w(S(6),E("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),c(6),v("")),f.base64urlnopad=w(S(6),E("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),v(""));const k=K=>w(R(58),E(K),v(""));f.base58=k("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),f.base58flickr=k("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),f.base58xrp=k("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const q=[0,2,3,5,6,7,9,10,11];f.base58xmr={encode(K){let B="";for(let L=0;L<K.length;L+=8){const $=K.subarray(L,L+8);B+=f.base58.encode($).padStart(q[$.length],"1")}return B},decode(K){let B=[];for(let L=0;L<K.length;L+=11){const $=K.slice(L,L+11),T=q.indexOf($.length),N=f.base58.decode($);for(let j=0;j<N.length-T;j++)if(N[j]!==0)throw new Error("base58xmr: wrong padding");B=B.concat(Array.from(N.slice(N.length-T)))}return Uint8Array.from(B)}};const b=K=>w(M(4,B=>K(K(B))),f.base58);f.createBase58check=b,f.base58check=f.createBase58check;const F=w(E("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),v("")),G=[996825010,642813549,513874426,1027748829,705979059];function ue(K){const B=K>>25;let L=(K&33554431)<<5;for(let $=0;$<G.length;$++)(B>>$&1)===1&&(L^=G[$]);return L}function le(K,B,L=1){const $=K.length;let T=1;for(let N=0;N<$;N++){const j=K.charCodeAt(N);if(j<33||j>126)throw new Error(`Invalid prefix (${K})`);T=ue(T)^j>>5}T=ue(T);for(let N=0;N<$;N++)T=ue(T)^K.charCodeAt(N)&31;for(let N of B)T=ue(T)^N;for(let N=0;N<6;N++)T=ue(T);return T^=L,F.encode(x([T%1073741824],30,5,!1))}function X(K){const B=K==="bech32"?1:734539939,L=S(5),$=L.decode,T=L.encode,N=O($);function j(te,H,Q=90){if(typeof te!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof te}`);if(H instanceof Uint8Array&&(H=Array.from(H)),!Array.isArray(H)||H.length&&typeof H[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof H}`);if(te.length===0)throw new TypeError(`Invalid prefix length ${te.length}`);const oe=te.length+7+H.length;if(Q!==!1&&oe>Q)throw new TypeError(`Length ${oe} exceeds limit ${Q}`);const _e=te.toLowerCase(),ge=le(_e,H,B);return`${_e}1${F.encode(H)}${ge}`}function Y(te,H=90){if(typeof te!="string")throw new Error(`bech32.decode input should be string, not ${typeof te}`);if(te.length<8||H!==!1&&te.length>H)throw new TypeError(`Wrong string length: ${te.length} (${te}). Expected (8..${H})`);const Q=te.toLowerCase();if(te!==Q&&te!==te.toUpperCase())throw new Error("String must be lowercase or uppercase");const oe=Q.lastIndexOf("1");if(oe===0||oe===-1)throw new Error('Letter "1" must be present between prefix and data only');const _e=Q.slice(0,oe),ge=Q.slice(oe+1);if(ge.length<6)throw new Error("Data must be at least 6 characters long");const be=F.decode(ge).slice(0,-6),we=le(_e,be,B);if(!ge.endsWith(we))throw new Error(`Invalid checksum in ${te}: expected "${we}"`);return{prefix:_e,words:be}}const Z=O(Y);function z(te){const{prefix:H,words:Q}=Y(te,!1);return{prefix:H,words:Q,bytes:$(Q)}}function fe(te,H){return j(te,T(H))}return{encode:j,decode:Y,encodeFromBytes:fe,decodeToBytes:z,decodeUnsafe:Z,fromWords:$,fromWordsUnsafe:N,toWords:T}}f.bech32=X("bech32"),f.bech32m=X("bech32m"),f.utf8={encode:K=>new TextDecoder().decode(K),decode:K=>new TextEncoder().encode(K)},f.hex=w(S(4),E("0123456789abcdef"),v(""),d(K=>{if(typeof K!="string"||K.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof K} with length ${K.length}`);return K.toLowerCase()}));const se={utf8:f.utf8,hex:f.hex,base16:f.base16,base32:f.base32,base64:f.base64,base64url:f.base64url,base58:f.base58,base58xmr:f.base58xmr},de="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",ye=(K,B)=>{if(typeof K!="string"||!se.hasOwnProperty(K))throw new TypeError(de);if(!h(B))throw new TypeError("bytesToString() expects Uint8Array");return se[K].encode(B)};f.bytesToString=ye,f.str=f.bytesToString;const he=(K,B)=>{if(!se.hasOwnProperty(K))throw new TypeError(de);if(typeof B!="string")throw new TypeError("stringToBytes() expects string");return se[K].decode(B)};f.stringToBytes=he,f.bytes=f.stringToBytes},42243:function(ie,f){"use strict";/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(f,"__esModule",{value:!0}),f.bytes=f.stringToBytes=f.str=f.bytesToString=f.hex=f.utf8=f.bech32m=f.bech32=f.base58check=f.createBase58check=f.base58xmr=f.base58xrp=f.base58flickr=f.base58=f.base64urlnopad=f.base64url=f.base64nopad=f.base64=f.base32crockford=f.base32hexnopad=f.base32hex=f.base32nopad=f.base32=f.base16=f.utils=void 0;function _(H){return H instanceof Uint8Array||ArrayBuffer.isView(H)&&H.constructor.name==="Uint8Array"}function h(H,...Q){if(!_(H))throw new Error("Uint8Array expected");if(Q.length>0&&!Q.includes(H.length))throw new Error("Uint8Array expected of length "+Q+", got length="+H.length)}function w(H,Q){return Array.isArray(Q)?Q.length===0?!0:H?Q.every(oe=>typeof oe=="string"):Q.every(oe=>Number.isSafeInteger(oe)):!1}function E(H){if(typeof H!="function")throw new Error("function expected");return!0}function v(H,Q){if(typeof Q!="string")throw new Error(`${H}: string expected`);return!0}function c(H){if(!Number.isSafeInteger(H))throw new Error(`invalid integer: ${H}`)}function d(H){if(!Array.isArray(H))throw new Error("array expected")}function p(H,Q){if(!w(!0,Q))throw new Error(`${H}: array of strings expected`)}function m(H,Q){if(!w(!1,Q))throw new Error(`${H}: array of numbers expected`)}function C(...H){const Q=be=>be,oe=(be,we)=>Ee=>be(we(Ee)),_e=H.map(be=>be.encode).reduceRight(oe,Q),ge=H.map(be=>be.decode).reduce(oe,Q);return{encode:_e,decode:ge}}function x(H){const Q=typeof H=="string"?H.split(""):H,oe=Q.length;p("alphabet",Q);const _e=new Map(Q.map((ge,be)=>[ge,be]));return{encode:ge=>(d(ge),ge.map(be=>{if(!Number.isSafeInteger(be)||be<0||be>=oe)throw new Error(`alphabet.encode: digit index outside alphabet "${be}". Allowed: ${H}`);return Q[be]})),decode:ge=>(d(ge),ge.map(be=>{v("alphabet.decode",be);const we=_e.get(be);if(we===void 0)throw new Error(`Unknown letter: "${be}". Allowed: ${H}`);return we}))}}function R(H=""){return v("join",H),{encode:Q=>(p("join.decode",Q),Q.join(H)),decode:Q=>(v("join.decode",Q),Q.split(H))}}function S(H,Q="="){return c(H),v("padding",Q),{encode(oe){for(p("padding.encode",oe);oe.length*H%8;)oe.push(Q);return oe},decode(oe){p("padding.decode",oe);let _e=oe.length;if(_e*H%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;_e>0&&oe[_e-1]===Q;_e--)if((_e-1)*H%8===0)throw new Error("padding: invalid, string has too much padding");return oe.slice(0,_e)}}}function O(H){return E(H),{encode:Q=>Q,decode:Q=>H(Q)}}function M(H,Q,oe){if(Q<2)throw new Error(`convertRadix: invalid from=${Q}, base cannot be less than 2`);if(oe<2)throw new Error(`convertRadix: invalid to=${oe}, base cannot be less than 2`);if(d(H),!H.length)return[];let _e=0;const ge=[],be=Array.from(H,Ee=>{if(c(Ee),Ee<0||Ee>=Q)throw new Error(`invalid integer: ${Ee}`);return Ee}),we=be.length;for(;;){let Ee=0,me=!0;for(let Ke=_e;Ke<we;Ke++){const He=be[Ke],Ie=Q*Ee,Le=Ie+He;if(!Number.isSafeInteger(Le)||Ie/Q!==Ee||Le-He!==Ie)throw new Error("convertRadix: carry overflow");const Ge=Le/oe;Ee=Le%oe;const Be=Math.floor(Ge);if(be[Ke]=Be,!Number.isSafeInteger(Be)||Be*oe+Ee!==Le)throw new Error("convertRadix: carry overflow");if(me)Be?me=!1:_e=Ke;else continue}if(ge.push(Ee),me)break}for(let Ee=0;Ee<H.length-1&&H[Ee]===0;Ee++)ge.push(0);return ge.reverse()}const k=(H,Q)=>Q===0?H:k(Q,H%Q),q=(H,Q)=>H+(Q-k(H,Q)),b=(()=>{let H=[];for(let Q=0;Q<40;Q++)H.push(2**Q);return H})();function F(H,Q,oe,_e){if(d(H),Q<=0||Q>32)throw new Error(`convertRadix2: wrong from=${Q}`);if(oe<=0||oe>32)throw new Error(`convertRadix2: wrong to=${oe}`);if(q(Q,oe)>32)throw new Error(`convertRadix2: carry overflow from=${Q} to=${oe} carryBits=${q(Q,oe)}`);let ge=0,be=0;const we=b[Q],Ee=b[oe]-1,me=[];for(const Ke of H){if(c(Ke),Ke>=we)throw new Error(`convertRadix2: invalid data word=${Ke} from=${Q}`);if(ge=ge<<Q|Ke,be+Q>32)throw new Error(`convertRadix2: carry overflow pos=${be} from=${Q}`);for(be+=Q;be>=oe;be-=oe)me.push((ge>>be-oe&Ee)>>>0);const He=b[be];if(He===void 0)throw new Error("invalid carry");ge&=He-1}if(ge=ge<<oe-be&Ee,!_e&&be>=Q)throw new Error("Excess padding");if(!_e&&ge>0)throw new Error(`Non-zero padding: ${ge}`);return _e&&be>0&&me.push(ge>>>0),me}function G(H){c(H);const Q=2**8;return{encode:oe=>{if(!_(oe))throw new Error("radix.encode input should be Uint8Array");return M(Array.from(oe),Q,H)},decode:oe=>(m("radix.decode",oe),Uint8Array.from(M(oe,H,Q)))}}function ue(H,Q=!1){if(c(H),H<=0||H>32)throw new Error("radix2: bits should be in (0..32]");if(q(8,H)>32||q(H,8)>32)throw new Error("radix2: carry overflow");return{encode:oe=>{if(!_(oe))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(oe),8,H,!Q)},decode:oe=>(m("radix2.decode",oe),Uint8Array.from(F(oe,H,8,Q)))}}function le(H){return E(H),function(...Q){try{return H.apply(null,Q)}catch{}}}function X(H,Q){return c(H),E(Q),{encode(oe){if(!_(oe))throw new Error("checksum.encode: input should be Uint8Array");const _e=Q(oe).slice(0,H),ge=new Uint8Array(oe.length+H);return ge.set(oe),ge.set(_e,oe.length),ge},decode(oe){if(!_(oe))throw new Error("checksum.decode: input should be Uint8Array");const _e=oe.slice(0,-H),ge=oe.slice(-H),be=Q(_e).slice(0,H);for(let we=0;we<H;we++)if(be[we]!==ge[we])throw new Error("Invalid checksum");return _e}}}f.utils={alphabet:x,chain:C,checksum:X,convertRadix:M,convertRadix2:F,radix:G,radix2:ue,join:R,padding:S},f.base16=C(ue(4),x("0123456789ABCDEF"),R("")),f.base32=C(ue(5),x("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),S(5),R("")),f.base32nopad=C(ue(5),x("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),R("")),f.base32hex=C(ue(5),x("0123456789ABCDEFGHIJKLMNOPQRSTUV"),S(5),R("")),f.base32hexnopad=C(ue(5),x("0123456789ABCDEFGHIJKLMNOPQRSTUV"),R("")),f.base32crockford=C(ue(5),x("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),R(""),O(H=>H.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const se=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",de=(H,Q)=>{v("base64",H);const oe=Q?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,_e=Q?"base64url":"base64";if(H.length>0&&!oe.test(H))throw new Error("invalid base64");return Uint8Array.fromBase64(H,{alphabet:_e,lastChunkHandling:"strict"})};f.base64=se?{encode(H){return h(H),H.toBase64()},decode(H){return de(H,!1)}}:C(ue(6),x("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),S(6),R("")),f.base64nopad=C(ue(6),x("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),R("")),f.base64url=se?{encode(H){return h(H),H.toBase64({alphabet:"base64url"})},decode(H){return de(H,!0)}}:C(ue(6),x("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),S(6),R("")),f.base64urlnopad=C(ue(6),x("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),R(""));const ye=H=>C(G(58),x(H),R(""));f.base58=ye("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),f.base58flickr=ye("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),f.base58xrp=ye("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const he=[0,2,3,5,6,7,9,10,11];f.base58xmr={encode(H){let Q="";for(let oe=0;oe<H.length;oe+=8){const _e=H.subarray(oe,oe+8);Q+=f.base58.encode(_e).padStart(he[_e.length],"1")}return Q},decode(H){let Q=[];for(let oe=0;oe<H.length;oe+=11){const _e=H.slice(oe,oe+11),ge=he.indexOf(_e.length),be=f.base58.decode(_e);for(let we=0;we<be.length-ge;we++)if(be[we]!==0)throw new Error("base58xmr: wrong padding");Q=Q.concat(Array.from(be.slice(be.length-ge)))}return Uint8Array.from(Q)}};const K=H=>C(X(4,Q=>H(H(Q))),f.base58);f.createBase58check=K,f.base58check=f.createBase58check;const B=C(x("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),R("")),L=[996825010,642813549,513874426,1027748829,705979059];function $(H){const Q=H>>25;let oe=(H&33554431)<<5;for(let _e=0;_e<L.length;_e++)(Q>>_e&1)===1&&(oe^=L[_e]);return oe}function T(H,Q,oe=1){const _e=H.length;let ge=1;for(let be=0;be<_e;be++){const we=H.charCodeAt(be);if(we<33||we>126)throw new Error(`Invalid prefix (${H})`);ge=$(ge)^we>>5}ge=$(ge);for(let be=0;be<_e;be++)ge=$(ge)^H.charCodeAt(be)&31;for(let be of Q)ge=$(ge)^be;for(let be=0;be<6;be++)ge=$(ge);return ge^=oe,B.encode(F([ge%b[30]],30,5,!1))}function N(H){const Q=H==="bech32"?1:734539939,oe=ue(5),_e=oe.decode,ge=oe.encode,be=le(_e);function we(Ie,Le,Ge=90){v("bech32.encode prefix",Ie),_(Le)&&(Le=Array.from(Le)),m("bech32.encode",Le);const Be=Ie.length;if(Be===0)throw new TypeError(`Invalid prefix length ${Be}`);const We=Be+7+Le.length;if(Ge!==!1&&We>Ge)throw new TypeError(`Length ${We} exceeds limit ${Ge}`);const Ze=Ie.toLowerCase(),_t=T(Ze,Le,Q);return`${Ze}1${B.encode(Le)}${_t}`}function Ee(Ie,Le=90){v("bech32.decode input",Ie);const Ge=Ie.length;if(Ge<8||Le!==!1&&Ge>Le)throw new TypeError(`invalid string length: ${Ge} (${Ie}). Expected (8..${Le})`);const Be=Ie.toLowerCase();if(Ie!==Be&&Ie!==Ie.toUpperCase())throw new Error("String must be lowercase or uppercase");const We=Be.lastIndexOf("1");if(We===0||We===-1)throw new Error('Letter "1" must be present between prefix and data only');const Ze=Be.slice(0,We),_t=Be.slice(We+1);if(_t.length<6)throw new Error("Data must be at least 6 characters long");const Ft=B.decode(_t).slice(0,-6),gt=T(Ze,Ft,Q);if(!_t.endsWith(gt))throw new Error(`Invalid checksum in ${Ie}: expected "${gt}"`);return{prefix:Ze,words:Ft}}const me=le(Ee);function Ke(Ie){const{prefix:Le,words:Ge}=Ee(Ie,!1);return{prefix:Le,words:Ge,bytes:_e(Ge)}}function He(Ie,Le){return we(Ie,ge(Le))}return{encode:we,decode:Ee,encodeFromBytes:He,decodeToBytes:Ke,decodeUnsafe:me,fromWords:_e,fromWordsUnsafe:be,toWords:ge}}f.bech32=N("bech32"),f.bech32m=N("bech32m"),f.utf8={encode:H=>new TextDecoder().decode(H),decode:H=>new TextEncoder().encode(H)};const j=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Y={encode(H){return h(H),H.toHex()},decode(H){return v("hex",H),Uint8Array.fromHex(H)}};f.hex=j?Y:C(ue(4),x("0123456789abcdef"),R(""),O(H=>{if(typeof H!="string"||H.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof H} with length ${H.length}`);return H.toLowerCase()}));const Z={utf8:f.utf8,hex:f.hex,base16:f.base16,base32:f.base32,base64:f.base64,base64url:f.base64url,base58:f.base58,base58xmr:f.base58xmr},z="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",fe=(H,Q)=>{if(typeof H!="string"||!Z.hasOwnProperty(H))throw new TypeError(z);if(!_(Q))throw new TypeError("bytesToString() expects Uint8Array");return Z[H].encode(Q)};f.bytesToString=fe,f.str=f.bytesToString;const te=(H,Q)=>{if(!Z.hasOwnProperty(H))throw new TypeError(z);if(typeof Q!="string")throw new TypeError("stringToBytes() expects string");return Z[H].decode(Q)};f.stringToBytes=te,f.bytes=f.stringToBytes},38660:function(ie,f,_){"use strict";_.d(f,{Ay:()=>Mt,Dh:()=>he,HK:()=>se,Op:()=>ye,Xq:()=>de,g_:()=>x,qx:()=>le,yy:()=>K});var h=_(45323),w=_(73243),E=_(72092),v=_(9495),c=_(55493),d=_(68675),p=_(39212),m=_.n(p);ie=_.hmd(ie);var C=function(){"use strict";function Vt(Et,Ye,Tt,Wt,dr){(0,w.A)(this,Vt);var at=Xe(Et,ot.__wbindgen_malloc,ot.__wbindgen_realloc),wt=qe,At=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Je=qe,Lt=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),sr=qe,ur=Xe(Wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),vr=qe,kr=Xe(dr,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Jr=qe,hr=ot.attestationdocumentwasm_new(at,wt,At,Je,Lt,sr,ur,vr,kr,Jr);return this.__wbg_ptr=hr>>>0,te.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,te.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_attestationdocumentwasm_free(Ye,0)}},{key:"nonce",get:function(){var Ye,Tt;try{var Wt=ot.attestationdocumentwasm_nonce(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}},{key:"pcr0",get:function(){var Ye,Tt;try{var Wt=ot.attestationdocumentwasm_pcr0(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}},{key:"pcr8",get:function(){var Ye,Tt;try{var Wt=ot.attestationdocumentwasm_pcr8(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}},{key:"public_key",get:function(){var Ye,Tt;try{var Wt=ot.attestationdocumentwasm_public_key(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}},{key:"user_data",get:function(){var Ye,Tt;try{var Wt=ot.attestationdocumentwasm_user_data(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,te.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(C.prototype[Symbol.dispose]=C.prototype.free);var x=function(){"use strict";function Vt(){(0,w.A)(this,Vt);var Et=ot.ecdhexchanger_new_ecdh_exchanger();if(Et[2])throw st(Et[1]);return this.__wbg_ptr=Et[0]>>>0,H.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_ecdhexchanger_free(Ye,0)}},{key:"ecdh",value:function(Ye){var Tt=Pe(Ye,ot.__wbindgen_malloc),Wt=qe,dr=ot.ecdhexchanger_ecdh(this.__wbg_ptr,Tt,Wt);if(dr[3])throw st(dr[2]);var at=_t(dr[0],dr[1]).slice();return ot.__wbindgen_free(dr[0],dr[1]*1,1),at}},{key:"publicKey",value:function(){var Ye=ot.ecdhexchanger_publicKey(this.__wbg_ptr);if(Ye[3])throw st(Ye[2]);var Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"verify",value:function(Ye,Tt){var Wt=Pe(Ye,ot.__wbindgen_malloc),dr=qe,at=Pe(Tt,ot.__wbindgen_malloc),wt=qe,At=ot.ecdhexchanger_verify(this.__wbg_ptr,Wt,dr,at,wt);return At!==0}}]),Vt}();Symbol.dispose&&(x.prototype[Symbol.dispose]=x.prototype.free);var R=function(){"use strict";function Vt(){(0,w.A)(this,Vt)}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_ecdsaasyncpresignresult_free(Ye,0)}},{key:"dumpData",get:function(){var Ye=ot.ecdsaasyncpresignresult_dumpData(this.__wbg_ptr),Tt;return Ye[0]!==0&&(Tt=_t(Ye[0],Ye[1]).slice(),ot.__wbindgen_free(Ye[0],Ye[1]*1,1)),Tt}},{key:"outputMessages",get:function(){var Ye=ot.ecdsaasyncpresignresult_outputMessages(this.__wbg_ptr);return Ye}},{key:"presignData",get:function(){var Ye=ot.ecdsaasyncpresignresult_presignData(this.__wbg_ptr),Tt;return Ye[0]!==0&&(Tt=_t(Ye[0],Ye[1]).slice(),ot.__wbindgen_free(Ye[0],Ye[1]*1,1)),Tt}},{key:"type",get:function(){var Ye,Tt;try{var Wt=ot.ecdsaasyncpresignresult_type(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,Q.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(R.prototype[Symbol.dispose]=R.prototype.free);var S=function(){"use strict";function Vt(){(0,w.A)(this,Vt)}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,oe.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_ecdsaoneroundsignresult_free(Ye,0)}},{key:"output_data",get:function(){var Ye=ot.ecdsaoneroundsignresult_output_data(this.__wbg_ptr);return Ye}}]),Vt}();Symbol.dispose&&(S.prototype[Symbol.dispose]=S.prototype.free);var O=function(){"use strict";function Vt(Et,Ye){(0,w.A)(this,Vt);var Tt=Pe(Et,ot.__wbindgen_malloc),Wt=qe,dr=Pe(Ye,ot.__wbindgen_malloc),at=qe,wt=ot.ecdsapresignresult_new(Tt,Wt,dr,at);return this.__wbg_ptr=wt>>>0,_e.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,_e.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_ecdsapresignresult_free(Ye,0)}},{key:"e2ee_data",get:function(){var Ye=ot.ecdsapresignresult_e2ee_data(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"presign_data",get:function(){var Ye=ot.ecdsapresignresult_presign_data(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,_e.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(O.prototype[Symbol.dispose]=O.prototype.free);var M=function(){"use strict";function Vt(Et,Ye){(0,w.A)(this,Vt);var Tt=Pe(Et,ot.__wbindgen_malloc),Wt=qe,dr=Pe(Ye,ot.__wbindgen_malloc),at=qe,wt=ot.ecdsasignresult_new(Tt,Wt,dr,at);return this.__wbg_ptr=wt>>>0,ge.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,ge.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_ecdsasignresult_free(Ye,0)}},{key:"e2ee_data",get:function(){var Ye=ot.ecdsasignresult_e2ee_data(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"signature",get:function(){var Ye=ot.ecdsasignresult_signature(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,ge.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(M.prototype[Symbol.dispose]=M.prototype.free);var k=function(){"use strict";function Vt(){(0,w.A)(this,Vt)}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,be.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_eddsaasyncsignresult_free(Ye,0)}},{key:"dumpData",get:function(){var Ye=ot.eddsaasyncsignresult_dumpData(this.__wbg_ptr),Tt;return Ye[0]!==0&&(Tt=_t(Ye[0],Ye[1]).slice(),ot.__wbindgen_free(Ye[0],Ye[1]*1,1)),Tt}},{key:"outputMessages",get:function(){var Ye=ot.eddsaasyncsignresult_outputMessages(this.__wbg_ptr);return Ye}},{key:"signature",get:function(){var Ye=ot.eddsaasyncsignresult_signature(this.__wbg_ptr),Tt;return Ye[0]!==0&&(Tt=_t(Ye[0],Ye[1]).slice(),ot.__wbindgen_free(Ye[0],Ye[1]*1,1)),Tt}},{key:"type",get:function(){var Ye,Tt;try{var Wt=ot.eddsaasyncsignresult_type(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,be.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(k.prototype[Symbol.dispose]=k.prototype.free);var q=function(){"use strict";function Vt(){(0,w.A)(this,Vt)}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,we.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_eddsaoneroundsignresult_free(Ye,0)}},{key:"output_data",get:function(){var Ye=ot.eddsaoneroundsignresult_output_data(this.__wbg_ptr);return Ye}}]),Vt}();Symbol.dispose&&(q.prototype[Symbol.dispose]=q.prototype.free);var b=function(){"use strict";function Vt(Et,Ye){(0,w.A)(this,Vt);var Tt=Pe(Et,ot.__wbindgen_malloc),Wt=qe,dr=Pe(Ye,ot.__wbindgen_malloc),at=qe,wt=ot.eddsasignresult_new(Tt,Wt,dr,at);return this.__wbg_ptr=wt>>>0,Ee.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,Ee.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_eddsasignresult_free(Ye,0)}},{key:"e2ee_data",get:function(){var Ye=ot.eddsasignresult_e2ee_data(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"signature",get:function(){var Ye=ot.eddsasignresult_signature(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,Ee.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(b.prototype[Symbol.dispose]=b.prototype.free);var F=function(){"use strict";function Vt(){(0,w.A)(this,Vt)}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,me.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_frostasyncpresignresult_free(Ye,0)}},{key:"dumpData",get:function(){var Ye=ot.frostasyncpresignresult_dumpData(this.__wbg_ptr),Tt;return Ye[0]!==0&&(Tt=_t(Ye[0],Ye[1]).slice(),ot.__wbindgen_free(Ye[0],Ye[1]*1,1)),Tt}},{key:"outputMessages",get:function(){var Ye=ot.frostasyncpresignresult_outputMessages(this.__wbg_ptr);return Ye}},{key:"presignData",get:function(){var Ye=ot.frostasyncpresignresult_presignData(this.__wbg_ptr),Tt;return Ye[0]!==0&&(Tt=_t(Ye[0],Ye[1]).slice(),ot.__wbindgen_free(Ye[0],Ye[1]*1,1)),Tt}},{key:"type",get:function(){var Ye,Tt;try{var Wt=ot.frostasyncpresignresult_type(this.__wbg_ptr);return Ye=Wt[0],Tt=Wt[1],lt(Wt[0],Wt[1])}finally{ot.__wbindgen_free(Ye,Tt,1)}}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,me.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free);var G=function(){"use strict";function Vt(Et,Ye){(0,w.A)(this,Vt);var Tt=Pe(Et,ot.__wbindgen_malloc),Wt=qe,dr=Pe(Ye,ot.__wbindgen_malloc),at=qe,wt=ot.frostpresignresult_new(Tt,Wt,dr,at);return this.__wbg_ptr=wt>>>0,Ke.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,Ke.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_frostpresignresult_free(Ye,0)}},{key:"e2ee_data",get:function(){var Ye=ot.frostpresignresult_e2ee_data(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"presign_data",get:function(){var Ye=ot.frostpresignresult_presign_data(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,Ke.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(G.prototype[Symbol.dispose]=G.prototype.free);var ue=function(){"use strict";function Vt(Et,Ye){(0,w.A)(this,Vt);var Tt=Pe(Et,ot.__wbindgen_malloc),Wt=qe,dr=Pe(Ye,ot.__wbindgen_malloc),at=qe,wt=ot.frostsignresult_new(Tt,Wt,dr,at);return this.__wbg_ptr=wt>>>0,He.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,He.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_frostsignresult_free(Ye,0)}},{key:"e2ee_data",get:function(){var Ye=ot.frostsignresult_e2ee_data(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"signature",get:function(){var Ye=ot.frostsignresult_signature(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,He.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(ue.prototype[Symbol.dispose]=ue.prototype.free);var le=function(){"use strict";function Vt(){(0,w.A)(this,Vt);var Et=ot.partymanager_new();return this.__wbg_ptr=Et>>>0,Ie.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,Ie.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_partymanager_free(Ye,0)}},{key:"cancel",value:function(Ye){var Tt=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Wt=qe,dr=ot.partymanager_cancel(this.__wbg_ptr,Tt,Wt);return dr}},{key:"createParty",value:function(Ye,Tt,Wt){var dr=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),at=qe,wt=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),At=qe,Je=Xe(Wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Lt=qe,sr=ot.partymanager_createParty(this.__wbg_ptr,dr,at,wt,At,Je,Lt);return sr}},{key:"destroyParty",value:function(Ye){var Tt=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Wt=qe,dr=ot.partymanager_destroyParty(this.__wbg_ptr,Tt,Wt);return dr}},{key:"ecdsaAsyncPresign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je,Lt,sr){var ur=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),vr=qe,kr=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Jr=qe,hr=Pe(Wt,ot.__wbindgen_malloc),$r=qe,Hr=it(at,ot.__wbindgen_malloc),rn=qe,_r=it(wt,ot.__wbindgen_malloc),pn=qe,$t=Xe(At,ot.__wbindgen_malloc,ot.__wbindgen_realloc),In=qe,ln=ke(sr)?0:Pe(sr,ot.__wbindgen_malloc),yn=qe,Fr=ot.partymanager_ecdsaAsyncPresign(this.__wbg_ptr,ur,vr,kr,Jr,hr,$r,dr,Hr,rn,_r,pn,$t,In,!ke(Je),ke(Je)?BigInt(0):Je,Lt,ln,yn);return Fr}},{key:"ecdsaAsyncSign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je,Lt,sr,ur,vr){var kr=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Jr=qe,hr=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),$r=qe,Hr=it(Wt,ot.__wbindgen_malloc),rn=qe,_r=Pe(dr,ot.__wbindgen_malloc),pn=qe,$t=Xe(at,ot.__wbindgen_malloc,ot.__wbindgen_realloc),In=qe,ln=Pe(wt,ot.__wbindgen_malloc),yn=qe,Fr=Pe(Je,ot.__wbindgen_malloc),On=qe,En=ke(Lt)?0:Pe(Lt,ot.__wbindgen_malloc),ee=qe,ve=it(ur,ot.__wbindgen_malloc),ze=qe,yt=ot.partymanager_ecdsaAsyncSign(this.__wbg_ptr,kr,Jr,hr,$r,Hr,rn,_r,pn,$t,In,ln,yn,At,Fr,On,En,ee,!ke(sr),ke(sr)?BigInt(0):sr,ve,ze,vr);return yt}},{key:"ecdsaPresign",value:function(Ye,Tt,Wt,dr,at,wt,At){var Je=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Lt=qe,sr=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),ur=qe,vr=it(Wt,ot.__wbindgen_malloc),kr=qe,Jr=it(dr,ot.__wbindgen_malloc),hr=qe,$r=Pe(at,ot.__wbindgen_malloc),Hr=qe,rn=Xe(wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),_r=qe,pn=ot.partymanager_ecdsaPresign(this.__wbg_ptr,Je,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,rn,_r,At);return pn}},{key:"ecdsaSign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je,Lt,sr,ur){var vr=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),kr=qe,Jr=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),hr=qe,$r=it(Wt,ot.__wbindgen_malloc),Hr=qe,rn=it(dr,ot.__wbindgen_malloc),_r=qe,pn=Pe(at,ot.__wbindgen_malloc),$t=qe,In=Xe(wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),ln=qe,yn=Pe(At,ot.__wbindgen_malloc),Fr=qe,On=ke(Lt)?0:Pe(Lt,ot.__wbindgen_malloc),En=qe,ee=ke(sr)?0:Pe(sr,ot.__wbindgen_malloc),ve=qe,ze=ot.partymanager_ecdsaSign(this.__wbg_ptr,vr,kr,Jr,hr,$r,Hr,rn,_r,pn,$t,In,ln,yn,Fr,Je,On,En,ee,ve,!ke(ur),ke(ur)?BigInt(0):ur);return ze}},{key:"eddsaAsyncSign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je,Lt){var sr=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),ur=qe,vr=Pe(Tt,ot.__wbindgen_malloc),kr=qe,Jr=it(dr,ot.__wbindgen_malloc),hr=qe,$r=it(at,ot.__wbindgen_malloc),Hr=qe,rn=Pe(wt,ot.__wbindgen_malloc),_r=qe,pn=ke(At)?0:Pe(At,ot.__wbindgen_malloc),$t=qe,In=ke(Lt)?0:Pe(Lt,ot.__wbindgen_malloc),ln=qe,yn=ot.partymanager_eddsaAsyncSign(this.__wbg_ptr,sr,ur,vr,kr,Wt,Jr,hr,$r,Hr,rn,_r,pn,$t,Je,In,ln);return yn}},{key:"eddsaSign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je){var Lt=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),sr=qe,ur=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),vr=qe,kr=it(Wt,ot.__wbindgen_malloc),Jr=qe,hr=it(dr,ot.__wbindgen_malloc),$r=qe,Hr=Pe(at,ot.__wbindgen_malloc),rn=qe,_r=Pe(wt,ot.__wbindgen_malloc),pn=qe,$t=ke(Je)?0:Pe(Je,ot.__wbindgen_malloc),In=qe,ln=ot.partymanager_eddsaSign(this.__wbg_ptr,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,rn,_r,pn,At,$t,In);return ln}},{key:"frostAsyncPresign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je,Lt,sr){var ur=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),vr=qe,kr=Pe(Tt,ot.__wbindgen_malloc),Jr=qe,hr=it(dr,ot.__wbindgen_malloc),$r=qe,Hr=it(at,ot.__wbindgen_malloc),rn=qe,_r=Xe(wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),pn=qe,$t=Xe(Je,ot.__wbindgen_malloc,ot.__wbindgen_realloc),In=qe,ln=ke(sr)?0:Pe(sr,ot.__wbindgen_malloc),yn=qe,Fr=ot.partymanager_frostAsyncPresign(this.__wbg_ptr,ur,vr,kr,Jr,Wt,hr,$r,Hr,rn,_r,pn,!ke(At),ke(At)?BigInt(0):At,$t,In,Lt,ln,yn);return Fr}},{key:"frostAsyncSign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je,Lt,sr,ur,vr){var kr=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Jr=qe,hr=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),$r=qe,Hr=it(Wt,ot.__wbindgen_malloc),rn=qe,_r=Pe(dr,ot.__wbindgen_malloc),pn=qe,$t=Pe(at,ot.__wbindgen_malloc),In=qe,ln=Pe(At,ot.__wbindgen_malloc),yn=qe,Fr=ke(Je)?0:Pe(Je,ot.__wbindgen_malloc),On=qe,En=it(sr,ot.__wbindgen_malloc),ee=qe,ve=Xe(vr,ot.__wbindgen_malloc,ot.__wbindgen_realloc),ze=qe,yt=ot.partymanager_frostAsyncSign(this.__wbg_ptr,kr,Jr,hr,$r,Hr,rn,_r,pn,$t,In,wt,ln,yn,Fr,On,!ke(Lt),ke(Lt)?BigInt(0):Lt,En,ee,ur,ve,ze);return yt}},{key:"frostPresign",value:function(Ye,Tt,Wt,dr,at,wt,At){var Je=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Lt=qe,sr=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),ur=qe,vr=it(Wt,ot.__wbindgen_malloc),kr=qe,Jr=it(dr,ot.__wbindgen_malloc),hr=qe,$r=Pe(at,ot.__wbindgen_malloc),Hr=qe,rn=Xe(At,ot.__wbindgen_malloc,ot.__wbindgen_realloc),_r=qe,pn=ot.partymanager_frostPresign(this.__wbg_ptr,Je,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,wt,rn,_r);return pn}},{key:"frostSign",value:function(Ye,Tt,Wt,dr,at,wt,At,Je,Lt,sr,ur){var vr=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),kr=qe,Jr=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),hr=qe,$r=it(Wt,ot.__wbindgen_malloc),Hr=qe,rn=it(dr,ot.__wbindgen_malloc),_r=qe,pn=Pe(at,ot.__wbindgen_malloc),$t=qe,In=Pe(wt,ot.__wbindgen_malloc),ln=qe,yn=Pe(Je,ot.__wbindgen_malloc),Fr=qe,On=ke(Lt)?0:Pe(Lt,ot.__wbindgen_malloc),En=qe,ee=Xe(ur,ot.__wbindgen_malloc,ot.__wbindgen_realloc),ve=qe,ze=ot.partymanager_frostSign(this.__wbg_ptr,vr,kr,Jr,hr,$r,Hr,rn,_r,pn,$t,In,ln,At,yn,Fr,On,En,!ke(sr),ke(sr)?BigInt(0):sr,ee,ve);return ze}},{key:"isConnected",value:function(Ye){var Tt=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Wt=qe,dr=ot.partymanager_isConnected(this.__wbg_ptr,Tt,Wt);return dr}},{key:"listParties",value:function(){var Ye=ot.partymanager_listParties(this.__wbg_ptr);return Ye}},{key:"partyExists",value:function(Ye){var Tt=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Wt=qe,dr=ot.partymanager_partyExists(this.__wbg_ptr,Tt,Wt);return dr}},{key:"reject",value:function(Ye,Tt,Wt,dr,at,wt){var At=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Je=qe,Lt=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),sr=qe,ur=it(Wt,ot.__wbindgen_malloc),vr=qe,kr=it(dr,ot.__wbindgen_malloc),Jr=qe,hr=Xe(at,ot.__wbindgen_malloc,ot.__wbindgen_realloc),$r=qe,Hr=Xe(wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),rn=qe,_r=ot.partymanager_reject(this.__wbg_ptr,At,Je,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,rn);return _r}},{key:"setPartyInfo",value:function(Ye,Tt,Wt,dr,at,wt){var At=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Je=qe,Lt=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),sr=qe,ur=Xe(Wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),vr=qe,kr=Xe(dr,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Jr=qe,hr=Xe(at,ot.__wbindgen_malloc,ot.__wbindgen_realloc),$r=qe,Hr=Xe(wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),rn=qe,_r=ot.partymanager_setPartyInfo(this.__wbg_ptr,At,Je,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,rn);return _r}},{key:"vote",value:function(Ye,Tt,Wt,dr,at,wt){var At=Xe(Ye,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Je=qe,Lt=Xe(Tt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),sr=qe,ur=it(Wt,ot.__wbindgen_malloc),vr=qe,kr=it(dr,ot.__wbindgen_malloc),Jr=qe,hr=Pe(at,ot.__wbindgen_malloc),$r=qe,Hr=Pe(wt,ot.__wbindgen_malloc),rn=qe,_r=ot.partymanager_vote(this.__wbg_ptr,At,Je,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,rn);return _r}}]),Vt}();Symbol.dispose&&(le.prototype[Symbol.dispose]=le.prototype.free);var X=function(){"use strict";function Vt(Et,Ye,Tt,Wt,dr){(0,w.A)(this,Vt);var at=Pe(Et,ot.__wbindgen_malloc),wt=qe,At=Pe(Ye,ot.__wbindgen_malloc),Je=qe,Lt=Pe(Tt,ot.__wbindgen_malloc),sr=qe,ur=Pe(Wt,ot.__wbindgen_malloc),vr=qe,kr=Pe(dr,ot.__wbindgen_malloc),Jr=qe,hr=ot.signaturedata_new(at,wt,At,Je,Lt,sr,ur,vr,kr,Jr);return this.__wbg_ptr=hr>>>0,Le.register(this,this.__wbg_ptr,this),this}return(0,E.A)(Vt,[{key:"__destroy_into_raw",value:function(){var Ye=this.__wbg_ptr;return this.__wbg_ptr=0,Le.unregister(this),Ye}},{key:"free",value:function(){var Ye=this.__destroy_into_raw();ot.__wbg_signaturedata_free(Ye,0)}},{key:"m",get:function(){var Ye=ot.signaturedata_m(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"r",get:function(){var Ye=ot.signaturedata_r(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"s",get:function(){var Ye=ot.signaturedata_s(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"signature",get:function(){var Ye=ot.signaturedata_signature(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}},{key:"signature_recovery",get:function(){var Ye=ot.signaturedata_signature_recovery(this.__wbg_ptr),Tt=_t(Ye[0],Ye[1]).slice();return ot.__wbindgen_free(Ye[0],Ye[1]*1,1),Tt}}],[{key:"__wrap",value:function(Ye){Ye=Ye>>>0;var Tt=Object.create(Vt.prototype);return Tt.__wbg_ptr=Ye,Le.register(Tt,Tt.__wbg_ptr,Tt),Tt}}]),Vt}();Symbol.dispose&&(X.prototype[Symbol.dispose]=X.prototype.free);function se(Vt,Et){var Ye=Pe(Vt,ot.__wbindgen_malloc),Tt=qe,Wt=Pe(Et,ot.__wbindgen_malloc),dr=qe,at=ot.decryptAES256GCM(Ye,Tt,Wt,dr);if(at[3])throw st(at[2]);var wt=_t(at[0],at[1]).slice();return ot.__wbindgen_free(at[0],at[1]*1,1),wt}function de(Vt,Et){var Ye=Pe(Vt,ot.__wbindgen_malloc),Tt=qe,Wt=Pe(Et,ot.__wbindgen_malloc),dr=qe,at=ot.encryptAES256GCM(Ye,Tt,Wt,dr);if(at[3])throw st(at[2]);var wt=_t(at[0],at[1]).slice();return ot.__wbindgen_free(at[0],at[1]*1,1),wt}function ye(Vt){var Et=Pe(Vt,ot.__wbindgen_malloc),Ye=qe,Tt=ot.parseSignatureData(Et,Ye);if(Tt[2])throw st(Tt[1]);return X.__wrap(Tt[0])}function he(Vt,Et,Ye){var Tt,Wt;try{var dr=Xe(Vt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),at=qe,wt=Xe(Et,ot.__wbindgen_malloc,ot.__wbindgen_realloc),At=qe,Je=ot.splitPrivateKeyIntoShamirShares(dr,at,wt,At,Ye),Lt=Je[0],sr=Je[1];if(Je[3])throw Lt=0,sr=0,st(Je[2]);return Tt=Lt,Wt=sr,lt(Lt,sr)}finally{ot.__wbindgen_free(Tt,Wt,1)}}function K(Vt,Et){var Ye=Xe(Et,ot.__wbindgen_malloc,ot.__wbindgen_realloc),Tt=qe,Wt=ot.verifyAttestationReport(Vt,Ye,Tt);if(Wt[2])throw st(Wt[1]);return C.__wrap(Wt[0])}function B(){var Vt={__proto__:null,__wbg_Error_4577686b3a6d9b3a:function(Ye,Tt){var Wt=Error(lt(Ye,Tt));return Wt},__wbg_Number_e89e48a2fe1a6355:function(Ye){var Tt=Number(Ye);return Tt},__wbg___wbindgen_boolean_get_18c4ed9422296fff:function(Ye){var Tt=Ye,Wt=typeof Tt=="boolean"?Tt:void 0;return ke(Wt)?16777215:Wt?1:0},__wbg___wbindgen_debug_string_ddde1867f49c2442:function(Ye,Tt){var Wt=We(Tt),dr=Xe(Wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),at=qe;gt().setInt32(Ye+4,at,!0),gt().setInt32(Ye+0,dr,!0)},__wbg___wbindgen_is_function_d633e708baf0d146:function(Ye){var Tt=typeof Ye=="function";return Tt},__wbg___wbindgen_is_object_4b3de556756ee8a8:function(Ye){var Tt=Ye,Wt=typeof Tt=="object"&&Tt!==null;return Wt},__wbg___wbindgen_is_string_7debe47dc1e045c2:function(Ye){var Tt=typeof Ye=="string";return Tt},__wbg___wbindgen_is_undefined_c18285b9fc34cb7d:function(Ye){var Tt=Ye===void 0;return Tt},__wbg___wbindgen_jsval_loose_eq_1562ceb9af84e990:function(Ye,Tt){var Wt=Ye==Tt;return Wt},__wbg___wbindgen_number_get_5854912275df1894:function(Ye,Tt){var Wt=Tt,dr=typeof Wt=="number"?Wt:void 0;gt().setFloat64(Ye+8,ke(dr)?0:dr,!0),gt().setInt32(Ye+0,!ke(dr),!0)},__wbg___wbindgen_string_get_3e5751597f39a112:function(Ye,Tt){var Wt=Tt,dr=typeof Wt=="string"?Wt:void 0,at=ke(dr)?0:Xe(dr,ot.__wbindgen_malloc,ot.__wbindgen_realloc),wt=qe;gt().setInt32(Ye+4,wt,!0),gt().setInt32(Ye+0,at,!0)},__wbg___wbindgen_throw_39bc967c0e5a9b58:function(Ye,Tt){throw new Error(lt(Ye,Tt))},__wbg__wbg_cb_unref_b6d832240a919168:function(Ye){Ye._wbg_cb_unref()},__wbg_call_08ad0d89caa7cb79:function(){return rt(function(Ye,Tt,Wt){var dr=Ye.call(Tt,Wt);return dr},arguments)},__wbg_call_73af281463ec8b58:function(){return rt(function(Ye,Tt){var Wt=Ye.call(Tt);return Wt},arguments)},__wbg_clearInterval_16e8cbbce92291d0:function(Ye){var Tt=clearInterval(Ye);return Tt},__wbg_clearTimeout_01406e55473040f6:function(Ye){var Tt=clearTimeout(Ye);return Tt},__wbg_clearTimeout_113b1cde814ec762:function(Ye){var Tt=clearTimeout(Ye);return Tt},__wbg_close_ba12380718fe17a2:function(){return rt(function(Ye){Ye.close()},arguments)},__wbg_code_45592b542c772768:function(Ye){var Tt=Ye.code;return Tt},__wbg_crypto_38df2bab126b63dc:function(Ye){var Tt=Ye.crypto;return Tt},__wbg_data_826b7d645a40043f:function(Ye){var Tt=Ye.data;return Tt},__wbg_debug_e69ad32e6af73f94:function(Ye){console.debug(Ye)},__wbg_done_5aad55ec6b1954b1:function(Ye){var Tt=Ye.done;return Tt},__wbg_ecdsaasyncpresignresult_new:function(Ye){var Tt=R.__wrap(Ye);return Tt},__wbg_ecdsapresignresult_new:function(Ye){var Tt=O.__wrap(Ye);return Tt},__wbg_ecdsasignresult_new:function(Ye){var Tt=M.__wrap(Ye);return Tt},__wbg_eddsaasyncsignresult_new:function(Ye){var Tt=k.__wrap(Ye);return Tt},__wbg_eddsasignresult_new:function(Ye){var Tt=b.__wrap(Ye);return Tt},__wbg_error_a6fa202b58aa1cd3:function(Ye,Tt){var Wt,dr;try{Wt=Ye,dr=Tt,console.error(lt(Ye,Tt))}finally{ot.__wbindgen_free(Wt,dr,1)}},__wbg_error_ad28debb48b5c6bb:function(Ye){console.error(Ye)},__wbg_frostasyncpresignresult_new:function(Ye){var Tt=F.__wrap(Ye);return Tt},__wbg_frostpresignresult_new:function(Ye){var Tt=G.__wrap(Ye);return Tt},__wbg_frostsignresult_new:function(Ye){var Tt=ue.__wrap(Ye);return Tt},__wbg_getRandomValues_3dda8830c2565714:function(){return rt(function(Ye,Tt){globalThis.crypto.getRandomValues(_t(Ye,Tt))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return rt(function(Ye,Tt){Ye.getRandomValues(Tt)},arguments)},__wbg_get_4920fefd3451364b:function(){return rt(function(Ye,Tt){var Wt=Reflect.get(Ye,Tt);return Wt},arguments)},__wbg_get_unchecked_3d0f4b91c8eca4f0:function(Ye,Tt){var Wt=Ye[Tt>>>0];return Wt},__wbg_instanceof_ArrayBuffer_15859862b80b732d:function(Ye){var Tt;try{Tt=(0,v.A)(Ye,ArrayBuffer)}catch{Tt=!1}var Wt=Tt;return Wt},__wbg_instanceof_Uint8Array_2240b7046ac16f05:function(Ye){var Tt;try{Tt=(0,v.A)(Ye,Uint8Array)}catch{Tt=!1}var Wt=Tt;return Wt},__wbg_isArray_fad08a0d12828686:function(Ye){var Tt=Array.isArray(Ye);return Tt},__wbg_isSafeInteger_10e4151eb694e42a:function(Ye){var Tt=Number.isSafeInteger(Ye);return Tt},__wbg_iterator_fc7ad8d33bab9e26:function(){var Ye=Symbol.iterator;return Ye},__wbg_length_5855c1f289dfffc1:function(Ye){var Tt=Ye.length;return Tt},__wbg_length_a31e05262e09b7f8:function(Ye){var Tt=Ye.length;return Tt},__wbg_log_3c5e4b64af29e724:function(Ye){console.log(Ye)},__wbg_message_f15188e9b2f39470:function(Ye,Tt){var Wt=Tt.message,dr=Xe(Wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),at=qe;gt().setInt32(Ye+4,at,!0),gt().setInt32(Ye+0,dr,!0)},__wbg_msCrypto_bd5a034af96bcba6:function(Ye){var Tt=Ye.msCrypto;return Tt},__wbg_new_09959f7b4c92c246:function(Ye){var Tt=new Uint8Array(Ye);return Tt},__wbg_new_227d7c05414eb861:function(){var Ye=new Error;return Ye},__wbg_new_92df58a8ec3bfb6b:function(){var Ye=new Map;return Ye},__wbg_new_cbee8c0d5c479eac:function(){var Ye=new Array;return Ye},__wbg_new_ed69e637b553a997:function(){var Ye=new Object;return Ye},__wbg_new_fc4d5b17b0f1a4cb:function(){return rt(function(Ye,Tt){var Wt=new WebSocket(lt(Ye,Tt));return Wt},arguments)},__wbg_new_typed_8258a0d8488ef2a2:function(Ye,Tt){try{var Wt={a:Ye,b:Tt},dr=function(wt,At){var Je=Wt.a;Wt.a=0;try{return z(Je,Wt.b,wt,At)}finally{Wt.a=Je}},at=new Promise(dr);return at}finally{Wt.a=Wt.b=0}},__wbg_new_with_length_c8449d782396d344:function(Ye){var Tt=new Uint8Array(Ye>>>0);return Tt},__wbg_next_a5fe6f328f7affc2:function(Ye){var Tt=Ye.next;return Tt},__wbg_next_e592122bb4ed4c67:function(){return rt(function(Ye){var Tt=Ye.next();return Tt},arguments)},__wbg_node_84ea875411254db1:function(Ye){var Tt=Ye.node;return Tt},__wbg_now_edd718b3004d8631:function(){var Ye=Date.now();return Ye},__wbg_process_44c7a14e11e9f69e:function(Ye){var Tt=Ye.process;return Tt},__wbg_prototypesetcall_f034d444741426c3:function(Ye,Tt,Wt){Uint8Array.prototype.set.call(_t(Ye,Tt),Wt)},__wbg_queueMicrotask_2c8dfd1056f24fdc:function(Ye){var Tt=Ye.queueMicrotask;return Tt},__wbg_queueMicrotask_8985ad63815852e7:function(Ye){queueMicrotask(Ye)},__wbg_randomFillSync_6c25eac9869eb53c:function(){return rt(function(Ye,Tt){Ye.randomFillSync(Tt)},arguments)},__wbg_reason_83f48e094cd19328:function(Ye,Tt){var Wt=Tt.reason,dr=Xe(Wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),at=qe;gt().setInt32(Ye+4,at,!0),gt().setInt32(Ye+0,dr,!0)},__wbg_require_b4edbdcf3e2a1ef0:function(){return rt(function(){var Ye=ie.require;return Ye},arguments)},__wbg_resolve_5d61e0d10c14730a:function(Ye){var Tt=Promise.resolve(Ye);return Tt},__wbg_send_b7d2dc9c231d3eb3:function(){return rt(function(Ye,Tt,Wt){Ye.send(_t(Tt,Wt))},arguments)},__wbg_setInterval_84b64f01452a246e:function(){return rt(function(Ye,Tt){var Wt=setInterval(Ye,Tt);return Wt},arguments)},__wbg_setTimeout_613a21b62dc655a1:function(){return rt(function(Ye,Tt){var Wt=setTimeout(Ye,Tt);return Wt},arguments)},__wbg_setTimeout_ef24d2fc3ad97385:function(){return rt(function(Ye,Tt){var Wt=setTimeout(Ye,Tt);return Wt},arguments)},__wbg_set_4c81cfb5dc3a333c:function(Ye,Tt,Wt){Ye[Tt>>>0]=Wt},__wbg_set_6be42768c690e380:function(Ye,Tt,Wt){Ye[Tt]=Wt},__wbg_set_binaryType_ee9186e9e9c98376:function(Ye,Tt){Ye.binaryType=fe[Tt]},__wbg_set_cfc6de03f990decf:function(Ye,Tt,Wt){var dr=Ye.set(Tt,Wt);return dr},__wbg_set_onclose_9e7a850dd4c00263:function(Ye,Tt){Ye.onclose=Tt},__wbg_set_onerror_00bcdee7bf806a30:function(Ye,Tt){Ye.onerror=Tt},__wbg_set_onmessage_3579a04e3b06c86a:function(Ye,Tt){Ye.onmessage=Tt},__wbg_set_onopen_60d5c65fa1d328c9:function(Ye,Tt){Ye.onopen=Tt},__wbg_stack_3b0d974bbf31e44f:function(Ye,Tt){var Wt=Tt.stack,dr=Xe(Wt,ot.__wbindgen_malloc,ot.__wbindgen_realloc),at=qe;gt().setInt32(Ye+4,at,!0),gt().setInt32(Ye+0,dr,!0)},__wbg_static_accessor_GLOBAL_THIS_14325d8cca34bb77:function(){var Ye=typeof globalThis>"u"?null:globalThis;return ke(Ye)?0:Ge(Ye)},__wbg_static_accessor_GLOBAL_f3a1e69f9c5a7e8e:function(){var Ye=typeof _.g>"u"?null:_.g;return ke(Ye)?0:Ge(Ye)},__wbg_static_accessor_SELF_50cdb5b517789aca:function(){var Ye=typeof self>"u"?null:self;return ke(Ye)?0:Ge(Ye)},__wbg_static_accessor_WINDOW_d6c4126e4c244380:function(){var Ye=self;return ke(Ye)?0:Ge(Ye)},__wbg_subarray_7ad5f01d4a9c1c4d:function(Ye,Tt,Wt){var dr=Ye.subarray(Tt>>>0,Wt>>>0);return dr},__wbg_then_d4163530723f56f4:function(Ye,Tt,Wt){var dr=Ye.then(Tt,Wt);return dr},__wbg_then_f1c954fe00733701:function(Ye,Tt){var Wt=Ye.then(Tt);return Wt},__wbg_value_667dcb90597486a6:function(Ye){var Tt=Ye.value;return Tt},__wbg_versions_276b2795b1c6a219:function(Ye){var Tt=Ye.versions;return Tt},__wbg_warn_3310c7343993c074:function(Ye){console.warn(Ye)},__wbindgen_cast_0000000000000001:function(Ye,Tt){var Wt=xe(Ye,Tt,ot.wasm_bindgen__closure__destroy__he63632618aa5f17b,L);return Wt},__wbindgen_cast_0000000000000002:function(Ye,Tt){var Wt=xe(Ye,Tt,ot.wasm_bindgen__closure__destroy__he433dada6d9f7766,Z);return Wt},__wbindgen_cast_0000000000000003:function(Ye,Tt){var Wt=xe(Ye,Tt,ot.wasm_bindgen__closure__destroy__h00f143546e2a6fc8,$);return Wt},__wbindgen_cast_0000000000000004:function(Ye,Tt){var Wt=xe(Ye,Tt,ot.wasm_bindgen__closure__destroy__h3d76a7d9ab3cf331,T);return Wt},__wbindgen_cast_0000000000000005:function(Ye,Tt){var Wt=xe(Ye,Tt,ot.wasm_bindgen__closure__destroy__h3d76a7d9ab3cf331,N);return Wt},__wbindgen_cast_0000000000000006:function(Ye,Tt){var Wt=xe(Ye,Tt,ot.wasm_bindgen__closure__destroy__h3d76a7d9ab3cf331,j);return Wt},__wbindgen_cast_0000000000000007:function(Ye,Tt){var Wt=xe(Ye,Tt,ot.wasm_bindgen__closure__destroy__h3d76a7d9ab3cf331,Y);return Wt},__wbindgen_cast_0000000000000008:function(Ye){var Tt=Ye;return Tt},__wbindgen_cast_0000000000000009:function(Ye,Tt){var Wt=_t(Ye,Tt);return Wt},__wbindgen_cast_000000000000000a:function(Ye,Tt){var Wt=lt(Ye,Tt);return Wt},__wbindgen_cast_000000000000000b:function(Ye,Tt){var Wt=Ze(Ye,Tt).slice();ot.__wbindgen_free(Ye,Tt*4,4);var dr=Wt;return dr},__wbindgen_init_externref_table:function(){var Ye=ot.__wbindgen_externrefs,Tt=Ye.grow(4);Ye.set(0,void 0),Ye.set(Tt+0,void 0),Ye.set(Tt+1,null),Ye.set(Tt+2,!0),Ye.set(Tt+3,!1)}};return{__proto__:null,"./tss_mpc_sdk_rs_bg.js":Vt}}function L(Vt,Et){ot.wasm_bindgen__convert__closures_____invoke__he95bfeea9eb340a9(Vt,Et)}function $(Vt,Et){ot.wasm_bindgen__convert__closures_____invoke__heb148e6b751ac59e(Vt,Et)}function T(Vt,Et,Ye){ot.wasm_bindgen__convert__closures_____invoke__h6f13d5993c647867(Vt,Et,Ye)}function N(Vt,Et,Ye){ot.wasm_bindgen__convert__closures_____invoke__h6f13d5993c647867_4(Vt,Et,Ye)}function j(Vt,Et,Ye){ot.wasm_bindgen__convert__closures_____invoke__h6f13d5993c647867_5(Vt,Et,Ye)}function Y(Vt,Et,Ye){ot.wasm_bindgen__convert__closures_____invoke__h6f13d5993c647867_6(Vt,Et,Ye)}function Z(Vt,Et,Ye){var Tt=ot.wasm_bindgen__convert__closures_____invoke__hcf4a9310905efce9(Vt,Et,Ye);if(Tt[1])throw st(Tt[0])}function z(Vt,Et,Ye,Tt){ot.wasm_bindgen__convert__closures_____invoke__h3b20616cd6fb247d(Vt,Et,Ye,Tt)}var fe=["blob","arraybuffer"],te=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_attestationdocumentwasm_free(Vt>>>0,1)}),H=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_ecdhexchanger_free(Vt>>>0,1)}),Q=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_ecdsaasyncpresignresult_free(Vt>>>0,1)}),oe=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_ecdsaoneroundsignresult_free(Vt>>>0,1)}),_e=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_ecdsapresignresult_free(Vt>>>0,1)}),ge=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_ecdsasignresult_free(Vt>>>0,1)}),be=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_eddsaasyncsignresult_free(Vt>>>0,1)}),we=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_eddsaoneroundsignresult_free(Vt>>>0,1)}),Ee=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_eddsasignresult_free(Vt>>>0,1)}),me=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_frostasyncpresignresult_free(Vt>>>0,1)}),Ke=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_frostpresignresult_free(Vt>>>0,1)}),He=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_frostsignresult_free(Vt>>>0,1)}),Ie=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_partymanager_free(Vt>>>0,1)}),Le=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return ot.__wbg_signaturedata_free(Vt>>>0,1)});function Ge(Vt){var Et=ot.__externref_table_alloc();return ot.__wbindgen_externrefs.set(Et,Vt),Et}var Be=typeof FinalizationRegistry>"u"?{register:function(){},unregister:function(){}}:new FinalizationRegistry(function(Vt){return Vt.dtor(Vt.a,Vt.b)});function We(Vt){var Et=typeof Vt>"u"?"undefined":(0,d.A)(Vt);if(Et=="number"||Et=="boolean"||Vt==null)return"".concat(Vt);if(Et=="string")return'"'.concat(Vt,'"');if(Et=="symbol"){var Ye=Vt.description;return Ye==null?"Symbol":"Symbol(".concat(Ye,")")}if(Et=="function"){var Tt=Vt.name;return typeof Tt=="string"&&Tt.length>0?"Function(".concat(Tt,")"):"Function"}if(Array.isArray(Vt)){var Wt=Vt.length,dr="[";Wt>0&&(dr+=We(Vt[0]));for(var at=1;at<Wt;at++)dr+=", "+We(Vt[at]);return dr+="]",dr}var wt=/\[object ([^\]]+)\]/.exec(toString.call(Vt)),At;if(wt&&wt.length>1)At=wt[1];else return toString.call(Vt);if(At=="Object")try{return"Object("+JSON.stringify(Vt)+")"}catch{return"Object"}return(0,v.A)(Vt,Error)?"".concat(Vt.name,": ").concat(Vt.message,`
|
||
`).concat(Vt.stack):At}function Ze(Vt,Et){Vt=Vt>>>0;for(var Ye=gt(),Tt=[],Wt=Vt;Wt<Vt+4*Et;Wt+=4)Tt.push(ot.__wbindgen_externrefs.get(Ye.getUint32(Wt,!0)));return ot.__externref_drop_slice(Vt,Et),Tt}function _t(Vt,Et){return Vt=Vt>>>0,tt().subarray(Vt/1,Vt/1+Et)}var Ft=null;function gt(){return(Ft===null||Ft.buffer.detached===!0||Ft.buffer.detached===void 0&&Ft.buffer!==ot.memory.buffer)&&(Ft=new DataView(ot.memory.buffer)),Ft}function lt(Vt,Et){return Vt=Vt>>>0,Ot(Vt,Et)}var dt=null;function tt(){return(dt===null||dt.byteLength===0)&&(dt=new Uint8Array(ot.memory.buffer)),dt}function rt(Vt,Et){try{return Vt.apply(this,Et)}catch(Tt){var Ye=Ge(Tt);ot.__wbindgen_exn_store(Ye)}}function ke(Vt){return Vt==null}function xe(Vt,Et,Ye,Tt){var Wt={a:Vt,b:Et,cnt:1,dtor:Ye},dr=function(){for(var at=arguments.length,wt=new Array(at),At=0;At<at;At++)wt[At]=arguments[At];Wt.cnt++;var Je=Wt.a;Wt.a=0;try{return Tt.apply(void 0,[Je,Wt.b].concat((0,c.A)(wt)))}finally{Wt.a=Je,dr._wbg_cb_unref()}};return dr._wbg_cb_unref=function(){--Wt.cnt===0&&(Wt.dtor(Wt.a,Wt.b),Wt.a=0,Be.unregister(Wt))},Be.register(dr,Wt,Wt),dr}function Pe(Vt,Et){var Ye=Et(Vt.length*1,1)>>>0;return tt().set(Vt,Ye/1),qe=Vt.length,Ye}function it(Vt,Et){for(var Ye=Et(Vt.length*4,4)>>>0,Tt=0;Tt<Vt.length;Tt++){var Wt=Ge(Vt[Tt]);gt().setUint32(Ye+4*Tt,Wt,!0)}return qe=Vt.length,Ye}function Xe(Vt,Et,Ye){if(Ye===void 0){var Tt=Ct.encode(Vt),Wt=Et(Tt.length,1)>>>0;return tt().subarray(Wt,Wt+Tt.length).set(Tt),qe=Tt.length,Wt}for(var dr=Vt.length,at=Et(dr,1)>>>0,wt=tt(),At=0;At<dr;At++){var Je=Vt.charCodeAt(At);if(Je>127)break;wt[at+At]=Je}if(At!==dr){At!==0&&(Vt=Vt.slice(At)),at=Ye(at,dr,dr=At+Vt.length*3,1)>>>0;var Lt=tt().subarray(at+At,at+dr),sr=Ct.encodeInto(Vt,Lt);At+=sr.written,at=Ye(at,dr,At,1)>>>0}return qe=At,at}function st(Vt){var Et=ot.__wbindgen_externrefs.get(Vt);return ot.__externref_table_dealloc(Vt),Et}var It=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});It.decode();var ft=2146435072,Jt=0;function Ot(Vt,Et){return Jt+=Et,Jt>=ft&&(It=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),It.decode(),Jt=Et),It.decode(tt().subarray(Vt,Vt+Et))}var Ct=new TextEncoder;"encodeInto"in Ct||(Ct.encodeInto=function(Vt,Et){var Ye=Ct.encode(Vt);return Et.set(Ye),{read:Vt.length,written:Ye.length}});var qe=0,Yt,ot;function Ae(Vt,Et){return ot=Vt.exports,Yt=Et,Ft=null,dt=null,ot.__wbindgen_start(),ot}function Rt(Vt,Et){return Ht.apply(this,arguments)}function Ht(){return Ht=(0,h.A)(m().mark(function Vt(Et,Ye){var Tt,Wt,dr,at;return m().wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(at=function(Lt){switch(Lt){case"basic":case"cors":case"default":return!0}return!1},!(typeof Response=="function"&&(0,v.A)(Et,Response))){At.next=25;break}if(typeof WebAssembly.instantiateStreaming!="function"){At.next=17;break}return At.prev=3,At.next=6,WebAssembly.instantiateStreaming(Et,Ye);case 6:return At.abrupt("return",At.sent);case 9:if(At.prev=9,At.t0=At.catch(3),Tt=Et.ok&&at(Et.type),!(Tt&&Et.headers.get("Content-Type")!=="application/wasm")){At.next=16;break}console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",At.t0),At.next=17;break;case 16:throw At.t0;case 17:return At.next=19,Et.arrayBuffer();case 19:return Wt=At.sent,At.next=22,WebAssembly.instantiate(Wt,Ye);case 22:return At.abrupt("return",At.sent);case 25:return At.next=27,WebAssembly.instantiate(Et,Ye);case 27:if(dr=At.sent,!(0,v.A)(dr,WebAssembly.Instance)){At.next=32;break}return At.abrupt("return",{instance:dr,module:Et});case 32:return At.abrupt("return",dr);case 33:case 34:case"end":return At.stop()}},Vt,null,[[3,9]])})),Ht.apply(this,arguments)}function bt(Vt){if(ot!==void 0)return ot;Vt!==void 0&&(Object.getPrototypeOf(Vt)===Object.prototype?Vt=Vt.module:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));var Et=B();_instanceof(Vt,WebAssembly.Module)||(Vt=new WebAssembly.Module(Vt));var Ye=new WebAssembly.Instance(Vt,Et);return Ae(Ye,Vt)}function Mt(Vt){return tr.apply(this,arguments)}function tr(){return tr=(0,h.A)(m().mark(function Vt(Et){var Ye,Tt,Wt,dr;return m().wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(ot===void 0){wt.next=2;break}return wt.abrupt("return",ot);case 2:if(Et!==void 0&&(Object.getPrototypeOf(Et)===Object.prototype?Et=Et.module_or_path:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),!(typeof Et>"u")){wt.next=5;break}throw new Error("`init` function requires to be passed a module or a path to a module");case 5:return Ye=B(),(typeof Et=="string"||typeof Request=="function"&&(0,v.A)(Et,Request)||typeof URL=="function"&&(0,v.A)(Et,URL))&&(Et=fetch(Et)),wt.t0=Rt,wt.next=10,Et;case 10:return wt.t1=wt.sent,wt.t2=Ye,wt.next=14,(0,wt.t0)(wt.t1,wt.t2);case 14:return Tt=wt.sent,Wt=Tt.instance,dr=Tt.module,wt.abrupt("return",Ae(Wt,dr));case 18:case"end":return wt.stop()}},Vt)})),tr.apply(this,arguments)}},53857:function(ie,f,_){"use strict";var h;/**
|
||
* Support for translating between Uint8Array instances and JavaScript
|
||
* native types.
|
||
*
|
||
* {@link module:Layout~Layout|Layout} is the basis of a class
|
||
* hierarchy that associates property names with sequences of encoded
|
||
* bytes.
|
||
*
|
||
* Layouts are supported for these scalar (numeric) types:
|
||
* * {@link module:Layout~UInt|Unsigned integers in little-endian
|
||
* format} with {@link module:Layout.u8|8-bit}, {@link
|
||
* module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},
|
||
* {@link module:Layout.u32|32-bit}, {@link
|
||
* module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}
|
||
* representation ranges;
|
||
* * {@link module:Layout~UIntBE|Unsigned integers in big-endian
|
||
* format} with {@link module:Layout.u16be|16-bit}, {@link
|
||
* module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},
|
||
* {@link module:Layout.u40be|40-bit}, and {@link
|
||
* module:Layout.u48be|48-bit} representation ranges;
|
||
* * {@link module:Layout~Int|Signed integers in little-endian
|
||
* format} with {@link module:Layout.s8|8-bit}, {@link
|
||
* module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},
|
||
* {@link module:Layout.s32|32-bit}, {@link
|
||
* module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}
|
||
* representation ranges;
|
||
* * {@link module:Layout~IntBE|Signed integers in big-endian format}
|
||
* with {@link module:Layout.s16be|16-bit}, {@link
|
||
* module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},
|
||
* {@link module:Layout.s40be|40-bit}, and {@link
|
||
* module:Layout.s48be|48-bit} representation ranges;
|
||
* * 64-bit integral values that decode to an exact (if magnitude is
|
||
* less than 2^53) or nearby integral Number in {@link
|
||
* module:Layout.nu64|unsigned little-endian}, {@link
|
||
* module:Layout.nu64be|unsigned big-endian}, {@link
|
||
* module:Layout.ns64|signed little-endian}, and {@link
|
||
* module:Layout.ns64be|unsigned big-endian} encodings;
|
||
* * 32-bit floating point values with {@link
|
||
* module:Layout.f32|little-endian} and {@link
|
||
* module:Layout.f32be|big-endian} representations;
|
||
* * 64-bit floating point values with {@link
|
||
* module:Layout.f64|little-endian} and {@link
|
||
* module:Layout.f64be|big-endian} representations;
|
||
* * {@link module:Layout.const|Constants} that take no space in the
|
||
* encoded expression.
|
||
*
|
||
* and for these aggregate types:
|
||
* * {@link module:Layout.seq|Sequence}s of instances of a {@link
|
||
* module:Layout~Layout|Layout}, with JavaScript representation as
|
||
* an Array and constant or data-dependent {@link
|
||
* module:Layout~Sequence#count|length};
|
||
* * {@link module:Layout.struct|Structure}s that aggregate a
|
||
* heterogeneous sequence of {@link module:Layout~Layout|Layout}
|
||
* instances, with JavaScript representation as an Object;
|
||
* * {@link module:Layout.union|Union}s that support multiple {@link
|
||
* module:Layout~VariantLayout|variant layouts} over a fixed
|
||
* (padded) or variable (not padded) span of bytes, using an
|
||
* unsigned integer at the start of the data or a separate {@link
|
||
* module:Layout.unionLayoutDiscriminator|layout element} to
|
||
* determine which layout to use when interpreting the buffer
|
||
* contents;
|
||
* * {@link module:Layout.bits|BitStructure}s that contain a sequence
|
||
* of individual {@link
|
||
* module:Layout~BitStructure#addField|BitField}s packed into an 8,
|
||
* 16, 24, or 32-bit unsigned integer starting at the least- or
|
||
* most-significant bit;
|
||
* * {@link module:Layout.cstr|C strings} of varying length;
|
||
* * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link
|
||
* module:Layout~Blob#length|length} raw data.
|
||
*
|
||
* All {@link module:Layout~Layout|Layout} instances are immutable
|
||
* after construction, to prevent internal state from becoming
|
||
* inconsistent.
|
||
*
|
||
* @local Layout
|
||
* @local ExternalLayout
|
||
* @local GreedyCount
|
||
* @local OffsetLayout
|
||
* @local UInt
|
||
* @local UIntBE
|
||
* @local Int
|
||
* @local IntBE
|
||
* @local NearUInt64
|
||
* @local NearUInt64BE
|
||
* @local NearInt64
|
||
* @local NearInt64BE
|
||
* @local Float
|
||
* @local FloatBE
|
||
* @local Double
|
||
* @local DoubleBE
|
||
* @local Sequence
|
||
* @local Structure
|
||
* @local UnionDiscriminator
|
||
* @local UnionLayoutDiscriminator
|
||
* @local Union
|
||
* @local VariantLayout
|
||
* @local BitStructure
|
||
* @local BitField
|
||
* @local Boolean
|
||
* @local Blob
|
||
* @local CString
|
||
* @local Constant
|
||
* @local bindConstructorLayout
|
||
* @module Layout
|
||
* @license MIT
|
||
* @author Peter A. Bigot
|
||
* @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}
|
||
*/h={value:!0},h=h=h=h=h=h=h=h=f.nu64=h=h=f.u32=h=f.u16=f.u8=f.offset=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=void 0,h=h=h=f.blob=h=h=f.seq=h=f.struct=h=h=h=h=h=h=h=h=h=h=f.ns64=h=h=h=h=void 0;const w=_(36533);function E(Q){if(!(Q instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}h=E;function v(Q){return E(Q),w.Buffer.from(Q.buffer,Q.byteOffset,Q.length)}h=v;class c{constructor(oe,_e){if(!Number.isInteger(oe))throw new TypeError("span must be an integer");this.span=oe,this.property=_e}makeDestinationObject(){return{}}getSpan(oe,_e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(oe){const _e=Object.create(this.constructor.prototype);return Object.assign(_e,this),_e.property=oe,_e}fromArray(oe){}}h=c;function d(Q,oe){return oe.property?Q+"["+oe.property+"]":Q}h=d;function p(Q,oe){if(typeof Q!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(Q,"layout_"))throw new Error("Class is already bound to a layout");if(!(oe&&oe instanceof c))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(oe,"boundConstructor_"))throw new Error("layout is already bound to a constructor");Q.layout_=oe,oe.boundConstructor_=Q,oe.makeDestinationObject=()=>new Q,Object.defineProperty(Q.prototype,"encode",{value(_e,ge){return oe.encode(this,_e,ge)},writable:!0}),Object.defineProperty(Q,"decode",{value(_e,ge){return oe.decode(_e,ge)},writable:!0})}h=p;class m extends c{isCount(){throw new Error("ExternalLayout is abstract")}}h=m;class C extends m{constructor(oe=1,_e){if(!Number.isInteger(oe)||0>=oe)throw new TypeError("elementSpan must be a (positive) integer");super(-1,_e),this.elementSpan=oe}isCount(){return!0}decode(oe,_e=0){E(oe);const ge=oe.length-_e;return Math.floor(ge/this.elementSpan)}encode(oe,_e,ge){return 0}}h=C;class x extends m{constructor(oe,_e=0,ge){if(!(oe instanceof c))throw new TypeError("layout must be a Layout");if(!Number.isInteger(_e))throw new TypeError("offset must be integer or undefined");super(oe.span,ge||oe.property),this.layout=oe,this.offset=_e}isCount(){return this.layout instanceof R||this.layout instanceof S}decode(oe,_e=0){return this.layout.decode(oe,_e+this.offset)}encode(oe,_e,ge=0){return this.layout.encode(oe,_e,ge+this.offset)}}h=x;class R extends c{constructor(oe,_e){if(super(oe,_e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(oe,_e=0){return v(oe).readUIntLE(_e,this.span)}encode(oe,_e,ge=0){return v(_e).writeUIntLE(oe,ge,this.span),this.span}}h=R;class S extends c{constructor(oe,_e){if(super(oe,_e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(oe,_e=0){return v(oe).readUIntBE(_e,this.span)}encode(oe,_e,ge=0){return v(_e).writeUIntBE(oe,ge,this.span),this.span}}h=S;class O extends c{constructor(oe,_e){if(super(oe,_e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(oe,_e=0){return v(oe).readIntLE(_e,this.span)}encode(oe,_e,ge=0){return v(_e).writeIntLE(oe,ge,this.span),this.span}}h=O;class M extends c{constructor(oe,_e){if(super(oe,_e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(oe,_e=0){return v(oe).readIntBE(_e,this.span)}encode(oe,_e,ge=0){return v(_e).writeIntBE(oe,ge,this.span),this.span}}h=M;const k=Math.pow(2,32);function q(Q){const oe=Math.floor(Q/k),_e=Q-oe*k;return{hi32:oe,lo32:_e}}function b(Q,oe){return Q*k+oe}class F extends c{constructor(oe){super(8,oe)}decode(oe,_e=0){const ge=v(oe),be=ge.readUInt32LE(_e),we=ge.readUInt32LE(_e+4);return b(we,be)}encode(oe,_e,ge=0){const be=q(oe),we=v(_e);return we.writeUInt32LE(be.lo32,ge),we.writeUInt32LE(be.hi32,ge+4),8}}h=F;class G extends c{constructor(oe){super(8,oe)}decode(oe,_e=0){const ge=v(oe),be=ge.readUInt32BE(_e),we=ge.readUInt32BE(_e+4);return b(be,we)}encode(oe,_e,ge=0){const be=q(oe),we=v(_e);return we.writeUInt32BE(be.hi32,ge),we.writeUInt32BE(be.lo32,ge+4),8}}h=G;class ue extends c{constructor(oe){super(8,oe)}decode(oe,_e=0){const ge=v(oe),be=ge.readUInt32LE(_e),we=ge.readInt32LE(_e+4);return b(we,be)}encode(oe,_e,ge=0){const be=q(oe),we=v(_e);return we.writeUInt32LE(be.lo32,ge),we.writeInt32LE(be.hi32,ge+4),8}}h=ue;class le extends c{constructor(oe){super(8,oe)}decode(oe,_e=0){const ge=v(oe),be=ge.readInt32BE(_e),we=ge.readUInt32BE(_e+4);return b(be,we)}encode(oe,_e,ge=0){const be=q(oe),we=v(_e);return we.writeInt32BE(be.hi32,ge),we.writeUInt32BE(be.lo32,ge+4),8}}h=le;class X extends c{constructor(oe){super(4,oe)}decode(oe,_e=0){return v(oe).readFloatLE(_e)}encode(oe,_e,ge=0){return v(_e).writeFloatLE(oe,ge),4}}h=X;class se extends c{constructor(oe){super(4,oe)}decode(oe,_e=0){return v(oe).readFloatBE(_e)}encode(oe,_e,ge=0){return v(_e).writeFloatBE(oe,ge),4}}h=se;class de extends c{constructor(oe){super(8,oe)}decode(oe,_e=0){return v(oe).readDoubleLE(_e)}encode(oe,_e,ge=0){return v(_e).writeDoubleLE(oe,ge),8}}h=de;class ye extends c{constructor(oe){super(8,oe)}decode(oe,_e=0){return v(oe).readDoubleBE(_e)}encode(oe,_e,ge=0){return v(_e).writeDoubleBE(oe,ge),8}}h=ye;class he extends c{constructor(oe,_e,ge){if(!(oe instanceof c))throw new TypeError("elementLayout must be a Layout");if(!(_e instanceof m&&_e.isCount()||Number.isInteger(_e)&&0<=_e))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let be=-1;!(_e instanceof m)&&0<oe.span&&(be=_e*oe.span),super(be,ge),this.elementLayout=oe,this.count=_e}getSpan(oe,_e=0){if(0<=this.span)return this.span;let ge=0,be=this.count;if(be instanceof m&&(be=be.decode(oe,_e)),0<this.elementLayout.span)ge=be*this.elementLayout.span;else{let we=0;for(;we<be;)ge+=this.elementLayout.getSpan(oe,_e+ge),++we}return ge}decode(oe,_e=0){const ge=[];let be=0,we=this.count;for(we instanceof m&&(we=we.decode(oe,_e));be<we;)ge.push(this.elementLayout.decode(oe,_e)),_e+=this.elementLayout.getSpan(oe,_e),be+=1;return ge}encode(oe,_e,ge=0){const be=this.elementLayout,we=oe.reduce((Ee,me)=>Ee+be.encode(me,_e,ge+Ee),0);return this.count instanceof m&&this.count.encode(oe.length,_e,ge),we}}h=he;class K extends c{constructor(oe,_e,ge){if(!(Array.isArray(oe)&&oe.reduce((we,Ee)=>we&&Ee instanceof c,!0)))throw new TypeError("fields must be array of Layout instances");typeof _e=="boolean"&&ge===void 0&&(ge=_e,_e=void 0);for(const we of oe)if(0>we.span&&we.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let be=-1;try{be=oe.reduce((we,Ee)=>we+Ee.getSpan(),0)}catch{}super(be,_e),this.fields=oe,this.decodePrefixes=!!ge}getSpan(oe,_e=0){if(0<=this.span)return this.span;let ge=0;try{ge=this.fields.reduce((be,we)=>{const Ee=we.getSpan(oe,_e);return _e+=Ee,be+Ee},0)}catch{throw new RangeError("indeterminate span")}return ge}decode(oe,_e=0){E(oe);const ge=this.makeDestinationObject();for(const be of this.fields)if(be.property!==void 0&&(ge[be.property]=be.decode(oe,_e)),_e+=be.getSpan(oe,_e),this.decodePrefixes&&oe.length===_e)break;return ge}encode(oe,_e,ge=0){const be=ge;let we=0,Ee=0;for(const me of this.fields){let Ke=me.span;if(Ee=0<Ke?Ke:0,me.property!==void 0){const He=oe[me.property];He!==void 0&&(Ee=me.encode(He,_e,ge),0>Ke&&(Ke=me.getSpan(_e,ge)))}we=ge,ge+=Ke}return we+Ee-be}fromArray(oe){const _e=this.makeDestinationObject();for(const ge of this.fields)ge.property!==void 0&&0<oe.length&&(_e[ge.property]=oe.shift());return _e}layoutFor(oe){if(typeof oe!="string")throw new TypeError("property must be string");for(const _e of this.fields)if(_e.property===oe)return _e}offsetOf(oe){if(typeof oe!="string")throw new TypeError("property must be string");let _e=0;for(const ge of this.fields){if(ge.property===oe)return _e;0>ge.span?_e=-1:0<=_e&&(_e+=ge.span)}}}h=K;class B{constructor(oe){this.property=oe}decode(oe,_e){throw new Error("UnionDiscriminator is abstract")}encode(oe,_e,ge){throw new Error("UnionDiscriminator is abstract")}}h=B;class L extends B{constructor(oe,_e){if(!(oe instanceof m&&oe.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(_e||oe.property||"variant"),this.layout=oe}decode(oe,_e){return this.layout.decode(oe,_e)}encode(oe,_e,ge){return this.layout.encode(oe,_e,ge)}}h=L;class $ extends c{constructor(oe,_e,ge){let be;if(oe instanceof R||oe instanceof S)be=new L(new x(oe));else if(oe instanceof m&&oe.isCount())be=new L(oe);else if(oe instanceof B)be=oe;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(_e===void 0&&(_e=null),!(_e===null||_e instanceof c))throw new TypeError("defaultLayout must be null or a Layout");if(_e!==null){if(0>_e.span)throw new Error("defaultLayout must have constant span");_e.property===void 0&&(_e=_e.replicate("content"))}let we=-1;_e&&(we=_e.span,0<=we&&(oe instanceof R||oe instanceof S)&&(we+=be.layout.span)),super(we,ge),this.discriminator=be,this.usesPrefixDiscriminator=oe instanceof R||oe instanceof S,this.defaultLayout=_e,this.registry={};let Ee=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(me){return Ee(me)},this.configGetSourceVariant=function(me){Ee=me.bind(this)}}getSpan(oe,_e=0){if(0<=this.span)return this.span;const ge=this.getVariant(oe,_e);if(!ge)throw new Error("unable to determine span for unrecognized variant");return ge.getSpan(oe,_e)}defaultGetSourceVariant(oe){if(Object.prototype.hasOwnProperty.call(oe,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(oe,this.defaultLayout.property))return;const _e=this.registry[oe[this.discriminator.property]];if(_e&&(!_e.layout||_e.property&&Object.prototype.hasOwnProperty.call(oe,_e.property)))return _e}else for(const _e in this.registry){const ge=this.registry[_e];if(ge.property&&Object.prototype.hasOwnProperty.call(oe,ge.property))return ge}throw new Error("unable to infer src variant")}decode(oe,_e=0){let ge;const be=this.discriminator,we=be.decode(oe,_e),Ee=this.registry[we];if(Ee===void 0){const me=this.defaultLayout;let Ke=0;this.usesPrefixDiscriminator&&(Ke=be.layout.span),ge=this.makeDestinationObject(),ge[be.property]=we,ge[me.property]=me.decode(oe,_e+Ke)}else ge=Ee.decode(oe,_e);return ge}encode(oe,_e,ge=0){const be=this.getSourceVariant(oe);if(be===void 0){const we=this.discriminator,Ee=this.defaultLayout;let me=0;return this.usesPrefixDiscriminator&&(me=we.layout.span),we.encode(oe[we.property],_e,ge),me+Ee.encode(oe[Ee.property],_e,ge+me)}return be.encode(oe,_e,ge)}addVariant(oe,_e,ge){const be=new T(this,oe,_e,ge);return this.registry[oe]=be,be}getVariant(oe,_e=0){let ge;return oe instanceof Uint8Array?ge=this.discriminator.decode(oe,_e):ge=oe,this.registry[ge]}}h=$;class T extends c{constructor(oe,_e,ge,be){if(!(oe instanceof $))throw new TypeError("union must be a Union");if(!Number.isInteger(_e)||0>_e)throw new TypeError("variant must be a (non-negative) integer");if(typeof ge=="string"&&be===void 0&&(be=ge,ge=null),ge){if(!(ge instanceof c))throw new TypeError("layout must be a Layout");if(oe.defaultLayout!==null&&0<=ge.span&&ge.span>oe.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof be!="string")throw new TypeError("variant must have a String property")}let we=oe.span;0>oe.span&&(we=ge?ge.span:0,0<=we&&oe.usesPrefixDiscriminator&&(we+=oe.discriminator.layout.span)),super(we,be),this.union=oe,this.variant=_e,this.layout=ge||null}getSpan(oe,_e=0){if(0<=this.span)return this.span;let ge=0;this.union.usesPrefixDiscriminator&&(ge=this.union.discriminator.layout.span);let be=0;return this.layout&&(be=this.layout.getSpan(oe,_e+ge)),ge+be}decode(oe,_e=0){const ge=this.makeDestinationObject();if(this!==this.union.getVariant(oe,_e))throw new Error("variant mismatch");let be=0;return this.union.usesPrefixDiscriminator&&(be=this.union.discriminator.layout.span),this.layout?ge[this.property]=this.layout.decode(oe,_e+be):this.property?ge[this.property]=!0:this.union.usesPrefixDiscriminator&&(ge[this.union.discriminator.property]=this.variant),ge}encode(oe,_e,ge=0){let be=0;if(this.union.usesPrefixDiscriminator&&(be=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(oe,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,_e,ge);let we=be;if(this.layout&&(this.layout.encode(oe[this.property],_e,ge+be),we+=this.layout.getSpan(_e,ge+be),0<=this.union.span&&we>this.union.span))throw new Error("encoded variant overruns containing union");return we}fromArray(oe){if(this.layout)return this.layout.fromArray(oe)}}h=T;function N(Q){return 0>Q&&(Q+=4294967296),Q}class j extends c{constructor(oe,_e,ge){if(!(oe instanceof R||oe instanceof S))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof _e=="string"&&ge===void 0&&(ge=_e,_e=!1),4<oe.span)throw new RangeError("word cannot exceed 32 bits");super(oe.span,ge),this.word=oe,this.msb=!!_e,this.fields=[];let be=0;this._packedSetValue=function(we){return be=N(we),this},this._packedGetValue=function(){return be}}decode(oe,_e=0){const ge=this.makeDestinationObject(),be=this.word.decode(oe,_e);this._packedSetValue(be);for(const we of this.fields)we.property!==void 0&&(ge[we.property]=we.decode(oe));return ge}encode(oe,_e,ge=0){const be=this.word.decode(_e,ge);this._packedSetValue(be);for(const we of this.fields)if(we.property!==void 0){const Ee=oe[we.property];Ee!==void 0&&we.encode(Ee)}return this.word.encode(this._packedGetValue(),_e,ge)}addField(oe,_e){const ge=new Y(this,oe,_e);return this.fields.push(ge),ge}addBoolean(oe){const _e=new Z(this,oe);return this.fields.push(_e),_e}fieldFor(oe){if(typeof oe!="string")throw new TypeError("property must be string");for(const _e of this.fields)if(_e.property===oe)return _e}}h=j;class Y{constructor(oe,_e,ge){if(!(oe instanceof j))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(_e)||0>=_e)throw new TypeError("bits must be positive integer");const be=8*oe.span,we=oe.fields.reduce((Ee,me)=>Ee+me.bits,0);if(_e+we>be)throw new Error("bits too long for span remainder ("+(be-we)+" of "+be+" remain)");this.container=oe,this.bits=_e,this.valueMask=(1<<_e)-1,_e===32&&(this.valueMask=4294967295),this.start=we,this.container.msb&&(this.start=be-we-_e),this.wordMask=N(this.valueMask<<this.start),this.property=ge}decode(oe,_e){const ge=this.container._packedGetValue();return N(ge&this.wordMask)>>>this.start}encode(oe){if(typeof oe!="number"||!Number.isInteger(oe)||oe!==N(oe&this.valueMask))throw new TypeError(d("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const _e=this.container._packedGetValue(),ge=N(oe<<this.start);this.container._packedSetValue(N(_e&~this.wordMask)|ge)}}h=Y;class Z extends Y{constructor(oe,_e){super(oe,1,_e)}decode(oe,_e){return!!super.decode(oe,_e)}encode(oe){typeof oe=="boolean"&&(oe=+oe),super.encode(oe)}}h=Z;class z extends c{constructor(oe,_e){if(!(oe instanceof m&&oe.isCount()||Number.isInteger(oe)&&0<=oe))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let ge=-1;oe instanceof m||(ge=oe),super(ge,_e),this.length=oe}getSpan(oe,_e){let ge=this.span;return 0>ge&&(ge=this.length.decode(oe,_e)),ge}decode(oe,_e=0){let ge=this.span;return 0>ge&&(ge=this.length.decode(oe,_e)),v(oe).slice(_e,_e+ge)}encode(oe,_e,ge){let be=this.length;if(this.length instanceof m&&(be=oe.length),!(oe instanceof Uint8Array&&be===oe.length))throw new TypeError(d("Blob.encode",this)+" requires (length "+be+") Uint8Array as src");if(ge+be>_e.length)throw new RangeError("encoding overruns Uint8Array");const we=v(oe);return v(_e).write(we.toString("hex"),ge,be,"hex"),this.length instanceof m&&this.length.encode(be,_e,ge),be}}h=z;class fe extends c{constructor(oe){super(-1,oe)}getSpan(oe,_e=0){E(oe);let ge=_e;for(;ge<oe.length&&oe[ge]!==0;)ge+=1;return 1+ge-_e}decode(oe,_e=0){const ge=this.getSpan(oe,_e);return v(oe).slice(_e,_e+ge-1).toString("utf-8")}encode(oe,_e,ge=0){typeof oe!="string"&&(oe=String(oe));const be=w.Buffer.from(oe,"utf8"),we=be.length;if(ge+we>_e.length)throw new RangeError("encoding overruns Buffer");const Ee=v(_e);return be.copy(Ee,ge),Ee[ge+we]=0,we+1}}h=fe;class te extends c{constructor(oe,_e){if(typeof oe=="string"&&_e===void 0&&(_e=oe,oe=void 0),oe===void 0)oe=-1;else if(!Number.isInteger(oe))throw new TypeError("maxSpan must be an integer");super(-1,_e),this.maxSpan=oe}getSpan(oe,_e=0){return E(oe),oe.length-_e}decode(oe,_e=0){const ge=this.getSpan(oe,_e);if(0<=this.maxSpan&&this.maxSpan<ge)throw new RangeError("text length exceeds maxSpan");return v(oe).slice(_e,_e+ge).toString("utf-8")}encode(oe,_e,ge=0){typeof oe!="string"&&(oe=String(oe));const be=w.Buffer.from(oe,"utf8"),we=be.length;if(0<=this.maxSpan&&this.maxSpan<we)throw new RangeError("text length exceeds maxSpan");if(ge+we>_e.length)throw new RangeError("encoding overruns Buffer");return be.copy(v(_e),ge),we}}h=te;class H extends c{constructor(oe,_e){super(0,_e),this.value=oe}decode(oe,_e){return this.value}encode(oe,_e,ge){return 0}}h=H,h=(Q,oe)=>new C(Q,oe),f.offset=(Q,oe,_e)=>new x(Q,oe,_e),f.u8=Q=>new R(1,Q),f.u16=Q=>new R(2,Q),h=Q=>new R(3,Q),f.u32=Q=>new R(4,Q),h=Q=>new R(5,Q),h=Q=>new R(6,Q),f.nu64=Q=>new F(Q),h=Q=>new S(2,Q),h=Q=>new S(3,Q),h=Q=>new S(4,Q),h=Q=>new S(5,Q),h=Q=>new S(6,Q),h=Q=>new G(Q),h=Q=>new O(1,Q),h=Q=>new O(2,Q),h=Q=>new O(3,Q),h=Q=>new O(4,Q),h=Q=>new O(5,Q),h=Q=>new O(6,Q),f.ns64=Q=>new ue(Q),h=Q=>new M(2,Q),h=Q=>new M(3,Q),h=Q=>new M(4,Q),h=Q=>new M(5,Q),h=Q=>new M(6,Q),h=Q=>new le(Q),h=Q=>new X(Q),h=Q=>new se(Q),h=Q=>new de(Q),h=Q=>new ye(Q),f.struct=(Q,oe,_e)=>new K(Q,oe,_e),h=(Q,oe,_e)=>new j(Q,oe,_e),f.seq=(Q,oe,_e)=>new he(Q,oe,_e),h=(Q,oe,_e)=>new $(Q,oe,_e),h=(Q,oe)=>new L(Q,oe),f.blob=(Q,oe)=>new z(Q,oe),h=Q=>new fe(Q),h=(Q,oe)=>new te(Q,oe),h=(Q,oe)=>new H(Q,oe)},74570:function(ie,f,_){"use strict";var h=_(36533).Buffer,w;Object.defineProperty(f,"__esModule",{value:!0}),f.ADNLAddress=void 0;const E=_(86332),v=_(4988),c=_(33475);class d{static parseFriendly(m){if(m.length!==55)throw Error("Invalid address");m="f"+m;let C=(0,v.base32Decode)(m);if(C[0]!==45)throw Error("Invalid address");let x=C.slice(33);if(!(0,c.crc16)(C.slice(0,33)).equals(x))throw Error("Invalid address");return new d(C.slice(1,33))}static parseRaw(m){const C=h.from(m,"base64");return new d(C)}constructor(m){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let C=h.concat([h.from([45]),this.address]),x=(0,c.crc16)(C);return C=h.concat([C,x]),(0,v.base32Encode)(C).slice(1)},this[w]=()=>this.toString(),m.length!==32)throw Error("Invalid address");this.address=m}equals(m){return this.address.equals(m.address)}}f.ADNLAddress=d,w=E.inspectSymbol},82483:function(ie,f,_){"use strict";var h=_(36533).Buffer,w;Object.defineProperty(f,"__esModule",{value:!0}),f.address=f.Address=void 0;const E=_(86332),v=_(33475),c=17,d=81,p=128;function m(R){if(typeof R=="string"&&!C.isFriendly(R))throw new Error("Unknown address type");const S=h.isBuffer(R)?R:h.from(R,"base64");if(S.length!==36)throw new Error("Unknown address type: byte length is not equal to 36");const O=S.subarray(0,34),M=S.subarray(34,36),k=(0,v.crc16)(O);if(!(k[0]===M[0]&&k[1]===M[1]))throw new Error("Invalid checksum: "+R);let q=O[0],b=!1,F=!1;if(q&p&&(b=!0,q=q^p),q!==c&&q!==d)throw"Unknown address tag";F=q===c;let G=null;O[1]===255?G=-1:G=O[1];const ue=O.subarray(2,34);return{isTestOnly:b,isBounceable:F,workchain:G,hashPart:ue}}class C{static isAddress(S){return S instanceof C}static isFriendly(S){return!(S.length!==48||!/^[A-Za-z0-9+/_-]+$/.test(S))}static isRaw(S){if(S.indexOf(":")===-1)return!1;let[O,M]=S.split(":");return!(!Number.isInteger(parseFloat(O))||!/[a-f0-9]+/.test(M.toLowerCase())||M.length!==64)}static normalize(S){return typeof S=="string"?C.parse(S).toString():S.toString()}static parse(S){if(C.isFriendly(S))return this.parseFriendly(S).address;if(C.isRaw(S))return this.parseRaw(S);throw new Error("Unknown address type: "+S)}static parseRaw(S){let O=parseInt(S.split(":")[0]),M=h.from(S.split(":")[1],"hex");return new C(O,M)}static parseFriendly(S){if(h.isBuffer(S)){let O=m(S);return{isBounceable:O.isBounceable,isTestOnly:O.isTestOnly,address:new C(O.workchain,O.hashPart)}}else{let O=S.replace(/\-/g,"+").replace(/_/g,"/"),M=m(O);return{isBounceable:M.isBounceable,isTestOnly:M.isTestOnly,address:new C(M.workchain,M.hashPart)}}}constructor(S,O){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const M=h.alloc(36);return M.set(this.hash),M.set([this.workChain,this.workChain,this.workChain,this.workChain],32),M},this.toStringBuffer=M=>{let k=M&&M.testOnly!==void 0?M.testOnly:!1,b=(M&&M.bounceable!==void 0?M.bounceable:!0)?c:d;k&&(b|=p);const F=h.alloc(34);F[0]=b,F[1]=this.workChain,F.set(this.hash,2);const G=h.alloc(36);return G.set(F),G.set((0,v.crc16)(F),34),G},this.toString=M=>{let k=M&&M.urlSafe!==void 0?M.urlSafe:!0,q=this.toStringBuffer(M);return k?q.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):q.toString("base64")},this[w]=()=>this.toString(),O.length!==32)throw new Error("Invalid address hash length: "+O.length);this.workChain=S,this.hash=O,Object.freeze(this)}equals(S){return S.workChain!==this.workChain?!1:S.hash.equals(this.hash)}}f.Address=C,w=E.inspectSymbol;function x(R){return C.parse(R)}f.address=x},25610:function(ie,f,_){"use strict";var h;Object.defineProperty(f,"__esModule",{value:!0}),f.ExternalAddress=void 0;const w=_(86332);class E{static isAddress(c){return c instanceof E}constructor(c,d){this[h]=()=>this.toString(),this.value=c,this.bits=d}toString(){return`External<${this.bits}:${this.value}>`}}f.ExternalAddress=E,h=w.inspectSymbol},54529:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.contractAddress=void 0;const h=_(44460),w=_(17669),E=_(82483);function v(c,d){let p=(0,h.beginCell)().store((0,w.storeStateInit)(d)).endCell().hash();return new E.Address(c,p)}f.contractAddress=v},30677:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.BitBuilder=void 0;const w=_(82483),E=_(25610),v=_(49377);class c{constructor(p=1023){this._buffer=h.alloc(Math.ceil(p/8)),this._length=0}get length(){return this._length}writeBit(p){let m=this._length;if(m>this._buffer.length*8)throw new Error("BitBuilder overflow");(typeof p=="boolean"&&p===!0||typeof p=="number"&&p>0)&&(this._buffer[m/8|0]|=1<<7-m%8),this._length++}writeBits(p){for(let m=0;m<p.length;m++)this.writeBit(p.at(m))}writeBuffer(p){if(this._length%8===0){if(this._length+p.length*8>this._buffer.length*8)throw new Error("BitBuilder overflow");p.copy(this._buffer,this._length/8),this._length+=p.length*8}else for(let m=0;m<p.length;m++)this.writeUint(p[m],8)}writeUint(p,m){if(m<0||!Number.isSafeInteger(m))throw Error(`invalid bit length. Got ${m}`);const C=BigInt(p);if(m===0){if(C!==0n)throw Error(`value is not zero for ${m} bits. Got ${p}`);return}const x=1n<<BigInt(m);if(C<0||C>=x)throw Error(`bitLength is too small for a value ${p}. Got ${m}`);if(this._length+m>this._buffer.length*8)throw new Error("BitBuilder overflow");const R=8-this._length%8;if(R>0){const S=Math.floor(this._length/8);if(m<R){const O=Number(C);this._buffer[S]|=O<<R-m,this._length+=m}else{const O=Number(C>>BigInt(m-R));this._buffer[S]|=O,this._length+=R}}for(m-=R;m>0;)m>=8?(this._buffer[this._length/8]=Number(C>>BigInt(m-8)&0xffn),this._length+=8,m-=8):(this._buffer[this._length/8]=Number(C<<BigInt(8-m)&0xffn),this._length+=m,m=0)}writeInt(p,m){let C=BigInt(p);if(m<0||!Number.isSafeInteger(m))throw Error(`invalid bit length. Got ${m}`);if(m===0){if(C!==0n)throw Error(`value is not zero for ${m} bits. Got ${p}`);return}if(m===1){if(C!==-1n&&C!==0n)throw Error(`value is not zero or -1 for ${m} bits. Got ${p}`);this.writeBit(C===-1n);return}let x=1n<<BigInt(m)-1n;if(C<-x||C>=x)throw Error(`value is out of range for ${m} bits. Got ${p}`);C<0?(this.writeBit(!0),C=x+C):this.writeBit(!1),this.writeUint(C,m-1)}writeVarUint(p,m){let C=BigInt(p);if(m<0||!Number.isSafeInteger(m))throw Error(`invalid bit length. Got ${m}`);if(C<0)throw Error(`value is negative. Got ${p}`);if(C===0n){this.writeUint(0,m);return}const x=Math.ceil(C.toString(2).length/8),R=x*8;this.writeUint(x,m),this.writeUint(C,R)}writeVarInt(p,m){let C=BigInt(p);if(m<0||!Number.isSafeInteger(m))throw Error(`invalid bit length. Got ${m}`);if(C===0n){this.writeUint(0,m);return}let x=C>0?C:-C;const R=Math.ceil((x.toString(2).length+1)/8),S=R*8;this.writeUint(R,m),this.writeInt(C,S)}writeCoins(p){this.writeVarUint(p,4)}writeAddress(p){if(p==null){this.writeUint(0,2);return}if(w.Address.isAddress(p)){this.writeUint(2,2),this.writeUint(0,1),this.writeInt(p.workChain,8),this.writeBuffer(p.hash);return}if(E.ExternalAddress.isAddress(p)){this.writeUint(1,2),this.writeUint(p.bits,9),this.writeUint(p.value,p.bits);return}throw Error(`Invalid address. Got ${p}`)}build(){return new v.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!==0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}}f.BitBuilder=c},75907:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.BitReader=void 0;const w=_(82483),E=_(25610);class v{constructor(d,p=0){this._checkpoints=[],this._bits=d,this._offset=p}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(d){if(d<0||this._offset+d>this._bits.length)throw new Error(`Index ${this._offset+d} is out of bounds`);this._offset+=d}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let d=this._bits.at(this._offset);return this._offset++,d}preloadBit(){return this._bits.at(this._offset)}loadBits(d){let p=this._bits.substring(this._offset,d);return this._offset+=d,p}preloadBits(d){return this._bits.substring(this._offset,d)}loadBuffer(d){let p=this._preloadBuffer(d,this._offset);return this._offset+=d*8,p}preloadBuffer(d){return this._preloadBuffer(d,this._offset)}loadUint(d){return this._toSafeInteger(this.loadUintBig(d),"loadUintBig")}loadUintBig(d){let p=this.preloadUintBig(d);return this._offset+=d,p}preloadUint(d){return this._toSafeInteger(this._preloadUint(d,this._offset),"preloadUintBig")}preloadUintBig(d){return this._preloadUint(d,this._offset)}loadInt(d){let p=this._preloadInt(d,this._offset);return this._offset+=d,this._toSafeInteger(p,"loadUintBig")}loadIntBig(d){let p=this._preloadInt(d,this._offset);return this._offset+=d,p}preloadInt(d){return this._toSafeInteger(this._preloadInt(d,this._offset),"preloadIntBig")}preloadIntBig(d){return this._preloadInt(d,this._offset)}loadVarUint(d){let p=Number(this.loadUint(d));return this._toSafeInteger(this.loadUintBig(p*8),"loadVarUintBig")}loadVarUintBig(d){let p=Number(this.loadUint(d));return this.loadUintBig(p*8)}preloadVarUint(d){let p=Number(this._preloadUint(d,this._offset));return this._toSafeInteger(this._preloadUint(p*8,this._offset+d),"preloadVarUintBig")}preloadVarUintBig(d){let p=Number(this._preloadUint(d,this._offset));return this._preloadUint(p*8,this._offset+d)}loadVarInt(d){let p=Number(this.loadUint(d));return this._toSafeInteger(this.loadIntBig(p*8),"loadVarIntBig")}loadVarIntBig(d){let p=Number(this.loadUint(d));return this.loadIntBig(p*8)}preloadVarInt(d){let p=Number(this._preloadUint(d,this._offset));return this._toSafeInteger(this._preloadInt(p*8,this._offset+d),"preloadVarIntBig")}preloadVarIntBig(d){let p=Number(this._preloadUint(d,this._offset));return this._preloadInt(p*8,this._offset+d)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let d=Number(this._preloadUint(2,this._offset));if(d===2)return this._loadInternalAddress();throw new Error("Invalid address: "+d)}loadMaybeAddress(){let d=Number(this._preloadUint(2,this._offset));if(d===0)return this._offset+=2,null;if(d===2)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let d=Number(this._preloadUint(2,this._offset));if(d===0)return this._offset+=2,null;if(d===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let d=Number(this._preloadUint(2,this._offset));if(d===0)return this._offset+=2,null;if(d===2)return this._loadInternalAddress();if(d===1)return this._loadExternalAddress();throw Error(d===3?"Unsupported":"Unreachable")}loadPaddedBits(d){if(d%8!==0)throw new Error("Invalid number of bits");let p=d;for(;;)if(this._bits.at(this._offset+p-1)){p--;break}else p--;let m=this._bits.substring(this._offset,p);return this._offset+=d,m}clone(){return new v(this._bits,this._offset)}_preloadInt(d,p){if(d==0)return 0n;let m=this._bits.at(p),C=0n;for(let x=0;x<d-1;x++)this._bits.at(p+1+x)&&(C+=1n<<BigInt(d-x-1-1));return m&&(C=C-(1n<<BigInt(d-1))),C}_preloadUint(d,p){if(d==0)return 0n;let m=0n;for(let C=0;C<d;C++)this._bits.at(p+C)&&(m+=1n<<BigInt(d-C-1));return m}_preloadBuffer(d,p){let m=this._bits.subbuffer(p,d*8);if(m)return m;let C=h.alloc(d);for(let x=0;x<d;x++)C[x]=Number(this._preloadUint(8,p+x*8));return C}_loadInternalAddress(){if(Number(this._preloadUint(2,this._offset))!==2)throw Error("Invalid address");let p,m;this._preloadUint(1,this._offset+2)!==0n&&(m=Number(this._preloadUint(5,this._offset+3)),p=this._preloadUint(m,this._offset+8),this._offset+=5+m);let C=Number(this._preloadInt(8,this._offset+3)),x=this._preloadBuffer(32,this._offset+11);if(m!==void 0&&p!==void 0){let R=Number(p),S=0,O=0,M=m;for(;M>0;){let k=Math.min(8-O,M),q=(1<<k)-1<<8-O-k,b=(R>>M-k&(1<<k)-1)<<8-O-k;x[S]=x[S]&~q|b,M-=k,O+=k,O===8&&(S++,O=0)}}return this._offset+=267,new w.Address(C,x)}_loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))!==1)throw Error("Invalid address");let p=Number(this._preloadUint(9,this._offset+2)),m=this._preloadUint(p,this._offset+11);return this._offset+=11+p,new E.ExternalAddress(m,p)}_toSafeInteger(d,p){if(BigInt(Number.MAX_SAFE_INTEGER)<d||d<BigInt(Number.MIN_SAFE_INTEGER))throw new TypeError(`${d} is out of safe integer range. Use ${p} instead`);return Number(d)}}f.BitReader=v},49377:function(ie,f,_){"use strict";var h=_(36533).Buffer,w;Object.defineProperty(f,"__esModule",{value:!0}),f.BitString=void 0;const E=_(86095),v=_(86332);class c{static isBitString(p){return p instanceof c}constructor(p,m,C){if(this[w]=()=>this.toString(),C<0)throw new Error(`Length ${C} is out of bounds`);this._length=C,this._data=p,this._offset=m}get length(){return this._length}at(p){if(p>=this._length)throw new Error(`Index ${p} > ${this._length} is out of bounds`);if(p<0)throw new Error(`Index ${p} < 0 is out of bounds`);let m=this._offset+p>>3,C=7-(this._offset+p)%8;return(this._data[m]&1<<C)!==0}substring(p,m){if(p>this._length)throw new Error(`Offset(${p}) > ${this._length} is out of bounds`);if(p<0)throw new Error(`Offset(${p}) < 0 is out of bounds`);if(m===0)return c.EMPTY;if(p+m>this._length)throw new Error(`Offset ${p} + Length ${m} > ${this._length} is out of bounds`);return new c(this._data,this._offset+p,m)}subbuffer(p,m){if(p>this._length)throw new Error(`Offset ${p} is out of bounds`);if(p<0)throw new Error(`Offset ${p} is out of bounds`);if(p+m>this._length)throw new Error(`Offset + Length = ${p+m} is out of bounds`);if(m%8!==0||(this._offset+p)%8!==0)return null;let C=this._offset+p>>3,x=C+(m>>3);return this._data.subarray(C,x)}equals(p){if(this._length!==p._length)return!1;for(let m=0;m<this._length;m++)if(this.at(m)!==p.at(m))return!1;return!0}toString(){const p=(0,E.bitsToPaddedBuffer)(this);if(this._length%4===0){const m=p.subarray(0,Math.ceil(this._length/8)).toString("hex").toUpperCase();return this._length%8===0?m:m.substring(0,m.length-1)}else{const m=p.toString("hex").toUpperCase();return this._length%8<=4?m.substring(0,m.length-1)+"_":m+"_"}}}f.BitString=c,w=v.inspectSymbol,c.EMPTY=new c(h.alloc(0),0,0)},44460:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.Builder=f.beginCell=void 0;const h=_(30677),w=_(48587),E=_(24195);function v(){return new c}f.beginCell=v;class c{constructor(){this._bits=new h.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(p){return this._bits.writeBit(p),this}storeBits(p){return this._bits.writeBits(p),this}storeBuffer(p,m){if(m!=null&&p.length!==m)throw Error(`Buffer length ${p.length} is not equal to ${m}`);return this._bits.writeBuffer(p),this}storeMaybeBuffer(p,m){return p!==null?(this.storeBit(1),this.storeBuffer(p,m)):this.storeBit(0),this}storeUint(p,m){return this._bits.writeUint(p,m),this}storeMaybeUint(p,m){return p!=null?(this.storeBit(1),this.storeUint(p,m)):this.storeBit(0),this}storeInt(p,m){return this._bits.writeInt(p,m),this}storeMaybeInt(p,m){return p!=null?(this.storeBit(1),this.storeInt(p,m)):this.storeBit(0),this}storeVarUint(p,m){return this._bits.writeVarUint(p,m),this}storeMaybeVarUint(p,m){return p!=null?(this.storeBit(1),this.storeVarUint(p,m)):this.storeBit(0),this}storeVarInt(p,m){return this._bits.writeVarInt(p,m),this}storeMaybeVarInt(p,m){return p!=null?(this.storeBit(1),this.storeVarInt(p,m)):this.storeBit(0),this}storeCoins(p){return this._bits.writeCoins(p),this}storeMaybeCoins(p){return p!=null?(this.storeBit(1),this.storeCoins(p)):this.storeBit(0),this}storeAddress(p){return this._bits.writeAddress(p),this}storeRef(p){if(this._refs.length>=4)throw new Error("Too many references");if(p instanceof w.Cell)this._refs.push(p);else if(p instanceof c)this._refs.push(p.endCell());else throw new Error("Invalid argument");return this}storeMaybeRef(p){return p?(this.storeBit(1),this.storeRef(p)):this.storeBit(0),this}storeSlice(p){let m=p.clone();for(m.remainingBits>0&&this.storeBits(m.loadBits(m.remainingBits));m.remainingRefs>0;)this.storeRef(m.loadRef());return this}storeMaybeSlice(p){return p?(this.storeBit(1),this.storeSlice(p)):this.storeBit(0),this}storeBuilder(p){return this.storeSlice(p.endCell().beginParse())}storeMaybeBuilder(p){return p?(this.storeBit(1),this.storeBuilder(p)):this.storeBit(0),this}storeWritable(p){return typeof p=="object"?p.writeTo(this):p(this),this}storeMaybeWritable(p){return p?(this.storeBit(1),this.storeWritable(p)):this.storeBit(0),this}store(p){return this.storeWritable(p),this}storeStringTail(p){return(0,E.writeString)(p,this),this}storeMaybeStringTail(p){return p!=null?(this.storeBit(1),(0,E.writeString)(p,this)):this.storeBit(0),this}storeStringRefTail(p){return this.storeRef(v().storeStringTail(p)),this}storeMaybeStringRefTail(p){return p!=null?(this.storeBit(1),this.storeStringRefTail(p)):this.storeBit(0),this}storeDict(p,m,C){return p?p.store(this,m,C):this.storeBit(0),this}storeDictDirect(p,m,C){return p.storeDirect(this,m,C),this}endCell(p){return new w.Cell({bits:this._bits.build(),refs:this._refs,exotic:p?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}}f.Builder=c},48587:function(ie,f,_){"use strict";var h=_(36533).Buffer,w;Object.defineProperty(f,"__esModule",{value:!0}),f.Cell=void 0;const E=_(86332),v=_(49377),c=_(42739),d=_(22269),p=_(81418),m=_(43945),C=_(11488),x=_(75907),R=_(44460);class S{static fromBoc(M){return(0,C.deserializeBoc)(M)}static fromBase64(M){let k=S.fromBoc(h.from(M,"base64"));if(k.length!==1)throw new Error("Deserialized more than one cell");return k[0]}static fromHex(M){let k=S.fromBoc(h.from(M,"hex"));if(k.length!==1)throw new Error("Deserialized more than one cell");return k[0]}constructor(M){this._hashes=[],this._depths=[],this.beginParse=(le=!1)=>{if(this.isExotic&&!le)throw new Error("Exotic cells cannot be parsed");return new d.Slice(new x.BitReader(this.bits),this.refs)},this.hash=(le=3)=>this._hashes[Math.min(this._hashes.length-1,le)],this.depth=(le=3)=>this._depths[Math.min(this._depths.length-1,le)],this.level=()=>this.mask.level,this.equals=le=>this.hash().equals(le.hash()),this[w]=()=>this.toString();let k=v.BitString.EMPTY;M&&M.bits&&(k=M.bits);let q=[];M&&M.refs&&(q=[...M.refs]);let b,F,G,ue=c.CellType.Ordinary;if(M&&M.exotic){let le=(0,p.resolveExotic)(k,q),X=(0,m.wonderCalculator)(le.type,k,q);G=X.mask,F=X.depths,b=X.hashes,ue=le.type}else{if(q.length>4)throw new Error("Invalid number of references");if(k.length>1023)throw new Error(`Bits overflow: ${k.length} > 1023`);let le=(0,m.wonderCalculator)(c.CellType.Ordinary,k,q);G=le.mask,F=le.depths,b=le.hashes,ue=c.CellType.Ordinary}this.type=ue,this.bits=k,this.refs=q,this.mask=G,this._depths=F,this._hashes=b,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==c.CellType.Ordinary}toBoc(M){let k=M&&M.idx!==null&&M.idx!==void 0?M.idx:!1,q=M&&M.crc32!==null&&M.crc32!==void 0?M.crc32:!0;return(0,C.serializeBoc)(this,{idx:k,crc32:q})}toString(M){let k=M||"",q="x";this.isExotic&&(this.type===c.CellType.MerkleProof?q="p":this.type===c.CellType.MerkleUpdate?q="u":this.type===c.CellType.PrunedBranch&&(q="p"));let b=k+(this.isExotic?q:"x")+"{"+this.bits.toString()+"}";for(let F in this.refs){const G=this.refs[F];b+=`
|
||
`+G.toString(k+" ")}return b}asSlice(){return this.beginParse()}asBuilder(){return(0,R.beginCell)().storeSlice(this.asSlice())}}f.Cell=S,w=E.inspectSymbol,S.EMPTY=new S},42739:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.CellType=void 0;var _;(function(h){h[h.Ordinary=-1]="Ordinary",h[h.PrunedBranch=1]="PrunedBranch",h[h.Library=2]="Library",h[h.MerkleProof=3]="MerkleProof",h[h.MerkleUpdate=4]="MerkleUpdate"})(_||(f.CellType=_={}))},22269:function(ie,f,_){"use strict";var h;Object.defineProperty(f,"__esModule",{value:!0}),f.Slice=void 0;const w=_(86332),E=_(24201),v=_(44460),c=_(24195);class d{constructor(m,C){this[h]=()=>this.toString(),this._reader=m.clone(),this._refs=[...C],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(m){return this._reader.skip(m),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(m){return this._reader.loadBits(m)}preloadBits(m){return this._reader.preloadBits(m)}loadUint(m){return this._reader.loadUint(m)}loadUintBig(m){return this._reader.loadUintBig(m)}preloadUint(m){return this._reader.preloadUint(m)}preloadUintBig(m){return this._reader.preloadUintBig(m)}loadMaybeUint(m){return this.loadBit()?this.loadUint(m):null}loadMaybeUintBig(m){return this.loadBit()?this.loadUintBig(m):null}loadInt(m){return this._reader.loadInt(m)}loadIntBig(m){return this._reader.loadIntBig(m)}preloadInt(m){return this._reader.preloadInt(m)}preloadIntBig(m){return this._reader.preloadIntBig(m)}loadMaybeInt(m){return this.loadBit()?this.loadInt(m):null}loadMaybeIntBig(m){return this.loadBit()?this.loadIntBig(m):null}loadVarUint(m){return this._reader.loadVarUint(m)}loadVarUintBig(m){return this._reader.loadVarUintBig(m)}preloadVarUint(m){return this._reader.preloadVarUint(m)}preloadVarUintBig(m){return this._reader.preloadVarUintBig(m)}loadVarInt(m){return this._reader.loadVarInt(m)}loadVarIntBig(m){return this._reader.loadVarIntBig(m)}preloadVarInt(m){return this._reader.preloadVarInt(m)}preloadVarIntBig(m){return this._reader.preloadVarIntBig(m)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(m){return this._reader.loadBuffer(m)}preloadBuffer(m){return this._reader.preloadBuffer(m)}loadStringTail(){return(0,c.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,c.readString)(this):null}loadStringRefTail(){return(0,c.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const m=this.loadMaybeRef();return m?(0,c.readString)(m.beginParse()):null}loadDict(m,C){return E.Dictionary.load(m,C,this)}loadDictDirect(m,C){return E.Dictionary.loadDirect(m,C,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,v.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,v.beginCell)().storeSlice(this)}clone(m=!1){if(m){let C=this._reader.clone();return C.reset(),new d(C,this._refs)}else{let C=new d(this._reader,this._refs);return C._refsOffset=this._refsOffset,C}}toString(){return this.asCell().toString()}}f.Slice=d,h=w.inspectSymbol},99742:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.LevelMask=void 0;class _{constructor(E=0){this._mask=0,this._mask=E,this._hashIndex=h(this._mask),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(E){return new _(this._mask&(1<<E)-1)}isSignificant(E){return E===0||(this._mask>>E-1)%2!==0}}f.LevelMask=_;function h(w){return w=w-(w>>1&1431655765),w=(w&858993459)+(w>>2&858993459),(w+(w>>4)&252645135)*16843009>>24}},63619:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.getRepr=f.getBitsDescriptor=f.getRefsDescriptor=void 0;const w=_(42739),E=_(86095);function v(p,m,C){return p.length+(C!==w.CellType.Ordinary?1:0)*8+m*32}f.getRefsDescriptor=v;function c(p){let m=p.length;return Math.ceil(m/8)+Math.floor(m/8)}f.getBitsDescriptor=c;function d(p,m,C,x,R,S){const O=Math.ceil(m.length/8),M=h.alloc(2+O+34*C.length);let k=0;M[k++]=v(C,R,S),M[k++]=c(p),(0,E.bitsToPaddedBuffer)(m).copy(M,k),k+=O;for(const q of C){let b;S==w.CellType.MerkleProof||S==w.CellType.MerkleUpdate?b=q.depth(x+1):b=q.depth(x),M[k++]=Math.floor(b/256),M[k++]=b%256}for(const q of C){let b;S==w.CellType.MerkleProof||S==w.CellType.MerkleUpdate?b=q.hash(x+1):b=q.hash(x),b.copy(M,k),k+=32}return M}f.getRepr=d},15377:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.exoticLibrary=void 0;const h=_(75907);function w(E,v){const c=new h.BitReader(E);if(E.length!==264)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${E.length}"`);let p=c.loadUint(8);if(p!==2)throw new Error(`Library cell must have type 2, got "${p}"`);return{}}f.exoticLibrary=w},98138:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.convertToMerkleProof=f.exoticMerkleProof=void 0;const h=_(75907),w=_(44460);function E(c,d){const p=new h.BitReader(c);if(c.length!==280)throw new Error(`Merkle Proof cell must have exactly (8 + 256 + 16) bits, got "${c.length}"`);if(d.length!==1)throw new Error(`Merkle Proof cell must have exactly 1 ref, got "${d.length}"`);let C=p.loadUint(8);if(C!==3)throw new Error(`Merkle Proof cell must have type 3, got "${C}"`);const x=p.loadBuffer(32),R=p.loadUint(16),S=d[0].hash(0),O=d[0].depth(0);if(R!==O)throw new Error(`Merkle Proof cell ref depth must be exactly "${R}", got "${O}"`);if(!x.equals(S))throw new Error(`Merkle Proof cell ref hash must be exactly "${x.toString("hex")}", got "${S.toString("hex")}"`);return{proofDepth:R,proofHash:x}}f.exoticMerkleProof=E;function v(c){return(0,w.beginCell)().storeUint(3,8).storeBuffer(c.hash(0)).storeUint(c.depth(0),16).storeRef(c).endCell({exotic:!0})}f.convertToMerkleProof=v},72291:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.exoticMerkleUpdate=void 0;const h=_(75907);function w(E,v){const c=new h.BitReader(E),d=8+2*272;if(E.length!==d)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${E.length}"`);if(v.length!==2)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${v.length}"`);let p=c.loadUint(8);if(p!==4)throw new Error(`Merkle Update cell type must be exactly 4, got "${p}"`);const m=c.loadBuffer(32),C=c.loadBuffer(32),x=c.loadUint(16),R=c.loadUint(16);if(x!==v[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${x}", got "${v[0].depth(0)}"`);if(!m.equals(v[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${m.toString("hex")}", got "${v[0].hash(0).toString("hex")}"`);if(R!==v[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${R}", got "${v[1].depth(0)}"`);if(!C.equals(v[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${C.toString("hex")}", got "${v[1].hash(0).toString("hex")}"`);return{proofDepth1:x,proofDepth2:R,proofHash1:m,proofHash2:C}}f.exoticMerkleUpdate=w},24020:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.exoticPruned=void 0;const h=_(75907),w=_(99742);function E(v,c){let d=new h.BitReader(v),p=d.loadUint(8);if(p!==1)throw new Error(`Pruned branch cell must have type 1, got "${p}"`);if(c.length!==0)throw new Error(`Pruned Branch cell can't has refs, got "${c.length}"`);let m;if(v.length===280)m=new w.LevelMask(1);else{if(m=new w.LevelMask(d.loadUint(8)),m.level<1||m.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${m.level}/${m.value}"`);const S=16+m.apply(m.level-1).hashCount*272;if(v.length!==S)throw new Error(`Pruned branch cell must have exactly ${S} bits, got "${v.length}"`)}let C=[],x=[],R=[];for(let S=0;S<m.level;S++)x.push(d.loadBuffer(32));for(let S=0;S<m.level;S++)R.push(d.loadUint(16));for(let S=0;S<m.level;S++)C.push({depth:R[S],hash:x[S]});return{mask:m.value,pruned:C}}f.exoticPruned=E},81418:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.resolveExotic=void 0;const h=_(75907),w=_(42739),E=_(15377),v=_(98138),c=_(72291),d=_(24020),p=_(99742);function m(O,M){let k=(0,d.exoticPruned)(O,M),q=[],b=[],F=new p.LevelMask(k.mask);for(let G=0;G<k.pruned.length;G++)q.push(k.pruned[G].depth),b.push(k.pruned[G].hash);return{type:w.CellType.PrunedBranch,depths:q,hashes:b,mask:F}}function C(O,M){let k=(0,E.exoticLibrary)(O,M),q=[],b=[],F=new p.LevelMask;return{type:w.CellType.Library,depths:q,hashes:b,mask:F}}function x(O,M){let k=(0,v.exoticMerkleProof)(O,M),q=[],b=[],F=new p.LevelMask(M[0].level()>>1);return{type:w.CellType.MerkleProof,depths:q,hashes:b,mask:F}}function R(O,M){let k=(0,c.exoticMerkleUpdate)(O,M),q=[],b=[],F=new p.LevelMask((M[0].level()|M[1].level())>>1);return{type:w.CellType.MerkleUpdate,depths:q,hashes:b,mask:F}}function S(O,M){let q=new h.BitReader(O).preloadUint(8);if(q===1)return m(O,M);if(q===2)return C(O,M);if(q===3)return x(O,M);if(q===4)return R(O,M);throw Error("Invalid exotic cell type: "+q)}f.resolveExotic=S},11488:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.serializeBoc=f.deserializeBoc=f.parseBoc=void 0;const h=_(75907),w=_(49377),E=_(48587),v=_(30717),c=_(55044),d=_(30677),p=_(63619),m=_(86095),C=_(88224);function x(F){return R(F&7)}function R(F){let G=0;for(let ue=0;ue<3;ue++)G+=F&1,F=F>>1;return G+1}function S(F,G){const ue=F.loadUint(8),le=ue%8,X=!!(ue&8),se=F.loadUint(8),de=Math.ceil(se/2),ye=!!(se%2),he=ue>>5,K=(ue&16)!=0,L=K?x(he)*32:0,$=K?x(he)*2:0;F.skip(L*8),F.skip($*8);let T=w.BitString.EMPTY;de>0&&(ye?T=F.loadPaddedBits(de*8):T=F.loadBits(de*8));let N=[];for(let j=0;j<le;j++)N.push(F.loadUint(G*8));return{bits:T,refs:N,exotic:X}}function O(F,G){return 2+Math.ceil(F.bits.length/8)+F.refs.length*G}function M(F){let G=new h.BitReader(new w.BitString(F,0,F.length*8)),ue=G.loadUint(32);if(ue===1761568243){let le=G.loadUint(8),X=G.loadUint(8),se=G.loadUint(le*8),de=G.loadUint(le*8),ye=G.loadUint(le*8),he=G.loadUint(X*8),K=G.loadBuffer(se*X),B=G.loadBuffer(he);return{size:le,offBytes:X,cells:se,roots:de,absent:ye,totalCellSize:he,index:K,cellData:B,root:[0]}}else if(ue===2898503464){let le=G.loadUint(8),X=G.loadUint(8),se=G.loadUint(le*8),de=G.loadUint(le*8),ye=G.loadUint(le*8),he=G.loadUint(X*8),K=G.loadBuffer(se*X),B=G.loadBuffer(he),L=G.loadBuffer(4);if(!(0,C.crc32c)(F.subarray(0,F.length-4)).equals(L))throw Error("Invalid CRC32C");return{size:le,offBytes:X,cells:se,roots:de,absent:ye,totalCellSize:he,index:K,cellData:B,root:[0]}}else if(ue===3052313714){let le=G.loadUint(1),X=G.loadUint(1),se=G.loadUint(1),de=G.loadUint(2),ye=G.loadUint(3),he=G.loadUint(8),K=G.loadUint(ye*8),B=G.loadUint(ye*8),L=G.loadUint(ye*8),$=G.loadUint(he*8),T=[];for(let Y=0;Y<B;Y++)T.push(G.loadUint(ye*8));let N=null;le&&(N=G.loadBuffer(K*he));let j=G.loadBuffer($);if(X){let Y=G.loadBuffer(4);if(!(0,C.crc32c)(F.subarray(0,F.length-4)).equals(Y))throw Error("Invalid CRC32C")}return{size:ye,offBytes:he,cells:K,roots:B,absent:L,totalCellSize:$,index:N,cellData:j,root:T}}else throw Error("Invalid magic")}f.parseBoc=M;function k(F){let G=M(F),ue=new h.BitReader(new w.BitString(G.cellData,0,G.cellData.length*8)),le=[];for(let se=0;se<G.cells;se++){let de=S(ue,G.size);le.push({...de,result:null})}for(let se=le.length-1;se>=0;se--){if(le[se].result)throw Error("Impossible");let de=[];for(let ye of le[se].refs){if(!le[ye].result)throw Error("Invalid BOC file");de.push(le[ye].result)}le[se].result=new E.Cell({bits:le[se].bits,refs:de,exotic:le[se].exotic})}let X=[];for(let se=0;se<G.root.length;se++)X.push(le[G.root[se]].result);return X}f.deserializeBoc=k;function q(F,G,ue,le){let X=(0,p.getRefsDescriptor)(F.refs,F.mask.value,F.type),se=(0,p.getBitsDescriptor)(F.bits);le.writeUint(X,8),le.writeUint(se,8),le.writeBuffer((0,m.bitsToPaddedBuffer)(F.bits));for(let de of G)le.writeUint(de,ue*8)}function b(F,G){let ue=(0,v.topologicalSort)(F),le=ue.length,X=G.idx,se=G.crc32,de=!1,ye=0,he=Math.max(Math.ceil((0,c.bitsForNumber)(le,"uint")/8),1),K=0,B=[];for(let j of ue){let Y=O(j.cell,he);K+=Y,B.push(K)}let L=Math.max(Math.ceil((0,c.bitsForNumber)(K,"uint")/8),1),$=(6+3*he+L+1*he+(X?le*L:0)+K+(se?4:0))*8,T=new d.BitBuilder($);if(T.writeUint(3052313714,32),T.writeBit(X),T.writeBit(se),T.writeBit(de),T.writeUint(ye,2),T.writeUint(he,3),T.writeUint(L,8),T.writeUint(le,he*8),T.writeUint(1,he*8),T.writeUint(0,he*8),T.writeUint(K,L*8),T.writeUint(0,he*8),X)for(let j=0;j<le;j++)T.writeUint(B[j],L*8);for(let j=0;j<le;j++)q(ue[j].cell,ue[j].refs,he,T);if(se){let j=(0,C.crc32c)(T.buffer());T.writeBuffer(j)}let N=T.buffer();if(N.length!==$/8)throw Error("Internal error");return N}f.serializeBoc=b},30717:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.topologicalSort=void 0;function _(h){let w=[h],E=new Map,v=new Set,c=[];for(;w.length>0;){const x=[...w];w=[];for(let R of x){const S=R.hash().toString("hex");if(!E.has(S)){v.add(S),E.set(S,{cell:R,refs:R.refs.map(O=>O.hash().toString("hex"))});for(let O of R.refs)w.push(O)}}}let d=new Set;function p(x){if(!v.has(x))return;if(d.has(x))throw Error("Not a DAG");d.add(x);let R=E.get(x).refs;for(let S=R.length-1;S>=0;S--)p(R[S]);c.push(x),d.delete(x),v.delete(x)}for(;v.size>0;){const x=Array.from(v)[0];p(x)}let m=new Map;for(let x=0;x<c.length;x++)m.set(c[c.length-x-1],x);let C=[];for(let x=c.length-1;x>=0;x--){let R=c[x];const S=E.get(R);C.push({cell:S.cell,refs:S.refs.map(O=>m.get(O))})}return C}f.topologicalSort=_},43945:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.wonderCalculator=void 0;const h=_(49377),w=_(42739),E=_(99742),v=_(24020),c=_(98138),d=_(63619),p=_(88473),m=_(72291),C=_(15377);function x(R,S,O){let M,k=null;if(R===w.CellType.Ordinary){let se=0;for(let de of O)se=se|de.mask.value;M=new E.LevelMask(se)}else if(R===w.CellType.PrunedBranch)k=(0,v.exoticPruned)(S,O),M=new E.LevelMask(k.mask);else if(R===w.CellType.MerkleProof){let se=(0,c.exoticMerkleProof)(S,O);M=new E.LevelMask(O[0].mask.value>>1)}else if(R===w.CellType.MerkleUpdate){let se=(0,m.exoticMerkleUpdate)(S,O);M=new E.LevelMask((O[0].mask.value|O[1].mask.value)>>1)}else if(R===w.CellType.Library){let se=(0,C.exoticLibrary)(S,O);M=new E.LevelMask}else throw new Error("Unsupported exotic type");let q=[],b=[],F=R===w.CellType.PrunedBranch?1:M.hashCount,ue=M.hashCount-F;for(let se=0,de=0;se<=M.level;se++){if(!M.isSignificant(se))continue;if(de<ue){de++;continue}let ye;if(de===ue){if(!(se===0||R===w.CellType.PrunedBranch))throw Error("Invalid");ye=S}else{if(!(se!==0&&R!==w.CellType.PrunedBranch))throw Error("Invalid: "+se+", "+R);ye=new h.BitString(b[de-ue-1],0,256)}let he=0;for(let $ of O){let T;R==w.CellType.MerkleProof||R==w.CellType.MerkleUpdate?T=$.depth(se+1):T=$.depth(se),he=Math.max(he,T)}O.length>0&&he++;let K=(0,d.getRepr)(S,ye,O,se,M.apply(se).value,R),B=(0,p.sha256_sync)(K),L=de-ue;q[L]=he,b[L]=B,de++}let le=[],X=[];if(k)for(let se=0;se<4;se++){const{hashIndex:de}=M.apply(se),{hashIndex:ye}=M;de!==ye?(le.push(k.pruned[de].hash),X.push(k.pruned[de].depth)):(le.push(b[0]),X.push(q[0]))}else for(let se=0;se<4;se++)le.push(b[M.apply(se).hashIndex]),X.push(q[M.apply(se).hashIndex]);return{mask:M,hashes:le,depths:X}}f.wonderCalculator=x},86095:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.paddedBufferToBits=f.bitsToPaddedBuffer=void 0;const h=_(30677),w=_(49377);function E(c){let d=new h.BitBuilder(Math.ceil(c.length/8)*8);d.writeBits(c);let p=Math.ceil(c.length/8)*8-c.length;for(let m=0;m<p;m++)m===0?d.writeBit(1):d.writeBit(0);return d.buffer()}f.bitsToPaddedBuffer=E;function v(c){let d=0;for(let p=c.length-1;p>=0;p--)if(c[p]!==0){const m=c[p];let C=m&-m;C&1||(C=Math.log2(C)+1),p>0&&(d=p<<3),d+=8-C;break}return new w.BitString(c,0,d)}f.paddedBufferToBits=v},24195:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.writeString=f.stringToCell=f.readString=void 0;const w=_(44460);function E(m){if(m.remainingBits%8!==0)throw new Error(`Invalid string length: ${m.remainingBits}`);if(m.remainingRefs!==0&&m.remainingRefs!==1)throw new Error(`invalid number of refs: ${m.remainingRefs}`);let C;return m.remainingBits===0?C=h.alloc(0):C=m.loadBuffer(m.remainingBits/8),m.remainingRefs===1&&(C=h.concat([C,E(m.loadRef().beginParse())])),C}function v(m){return E(m).toString()}f.readString=v;function c(m,C){if(m.length>0){let x=Math.floor(C.availableBits/8);if(m.length>x){let R=m.subarray(0,x),S=m.subarray(x);C=C.storeBuffer(R);let O=(0,w.beginCell)();c(S,O),C=C.storeRef(O.endCell())}else C=C.storeBuffer(m)}}function d(m){let C=(0,w.beginCell)();return c(h.from(m),C),C.endCell()}f.stringToCell=d;function p(m,C){c(h.from(m),C)}f.writeString=p},54306:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.ComputeError=void 0;class _ extends Error{constructor(w,E,v){super(w),this.exitCode=E,this.debugLogs=v&&v.debugLogs?v.debugLogs:null,this.logs=v&&v.logs?v.logs:null,Object.setPrototypeOf(this,_.prototype)}}f.ComputeError=_},28481:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.openContract=void 0;const h=_(82483),w=_(48587);function E(v,c){let d,p=null;if(!h.Address.isAddress(v.address))throw Error("Invalid address");if(d=v.address,v.init){if(!(v.init.code instanceof w.Cell))throw Error("Invalid init.code");if(!(v.init.data instanceof w.Cell))throw Error("Invalid init.data");p=v.init}let m=c({address:d,init:p});return new Proxy(v,{get(C,x){const R=C[x];return typeof x=="string"&&(x.startsWith("get")||x.startsWith("send")||x.startsWith("is"))&&typeof R=="function"?(...S)=>R.apply(C,[m,...S]):R}})}f.openContract=E},84754:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.safeSignVerify=f.safeSign=void 0;const w=_(88473),E=8,v=64;function c(m,C){let x=h.from(C);if(x.length>v)throw Error("Seed can be longer than 64 bytes");if(x.length<E)throw Error("Seed must be at least 8 bytes");return(0,w.sha256_sync)(h.concat([h.from([255,255]),x,m.hash()]))}function d(m,C,x="ton-safe-sign-magic"){return(0,w.sign)(c(m,x),C)}f.safeSign=d;function p(m,C,x,R="ton-safe-sign-magic"){return(0,w.signVerify)(c(m,R),C,x)}f.safeSignVerify=p},24201:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.Dictionary=void 0;const w=_(82483),E=_(44460),v=_(48587),c=_(49377),d=_(47388),p=_(79569),m=_(49450),C=_(26327),x=_(90307);class R{static empty(N,j){return N&&j?new R(new Map,N,j):new R(new Map,null,null)}static load(N,j,Y){let Z;if(Y instanceof v.Cell){if(Y.isExotic)return R.empty(N,j);Z=Y.beginParse()}else Z=Y;let z=Z.loadMaybeRef();return z&&!z.isExotic?R.loadDirect(N,j,z.beginParse()):R.empty(N,j)}static loadDirect(N,j,Y){if(!Y)return R.empty(N,j);let Z;Y instanceof v.Cell?Z=Y.beginParse():Z=Y;let z=(0,m.parseDict)(Z,N.bits,j.parse),fe=new Map;for(let[te,H]of z)fe.set((0,x.serializeInternalKey)(N.parse(te)),H);return new R(fe,N,j)}constructor(N,j,Y){this._key=j,this._value=Y,this._map=N}get size(){return this._map.size}get(N){return this._map.get((0,x.serializeInternalKey)(N))}has(N){return this._map.has((0,x.serializeInternalKey)(N))}set(N,j){return this._map.set((0,x.serializeInternalKey)(N),j),this}delete(N){const j=(0,x.serializeInternalKey)(N);return this._map.delete(j)}clear(){this._map.clear()}*[Symbol.iterator](){for(const[N,j]of this._map)yield[(0,x.deserializeInternalKey)(N),j]}keys(){return Array.from(this._map.keys()).map(N=>(0,x.deserializeInternalKey)(N))}values(){return Array.from(this._map.values())}store(N,j,Y){if(this._map.size===0)N.storeBit(0);else{let Z=this._key;j!=null&&(Z=j);let z=this._value;if(Y!=null&&(z=Y),!Z)throw Error("Key serializer is not defined");if(!z)throw Error("Value serializer is not defined");let fe=new Map;for(const[H,Q]of this._map)fe.set(Z.serialize((0,x.deserializeInternalKey)(H)),Q);N.storeBit(1);let te=(0,E.beginCell)();(0,C.serializeDict)(fe,Z.bits,z.serialize,te),N.storeRef(te.endCell())}}storeDirect(N,j,Y){if(this._map.size===0)throw Error("Cannot store empty dictionary directly");let Z=this._key;j!=null&&(Z=j);let z=this._value;if(Y!=null&&(z=Y),!Z)throw Error("Key serializer is not defined");if(!z)throw Error("Value serializer is not defined");let fe=new Map;for(const[te,H]of this._map)fe.set(Z.serialize((0,x.deserializeInternalKey)(te)),H);(0,C.serializeDict)(fe,Z.bits,z.serialize,N)}generateMerkleProof(N){return(0,d.generateMerkleProof)(this,N,this._key)}generateMerkleProofDirect(N){return(0,d.generateMerkleProofDirect)(this,N,this._key)}generateMerkleUpdate(N,j){return(0,p.generateMerkleUpdate)(this,N,this._key,j)}}f.Dictionary=R,R.Keys={Address:()=>S(),BigInt:T=>O(T),Int:T=>M(T),BigUint:T=>k(T),Uint:T=>q(T),Buffer:T=>b(T),BitString:T=>F(T)},R.Values={BigInt:T=>ue(T),Int:T=>G(T),BigVarInt:T=>le(T),BigUint:T=>de(T),Uint:T=>se(T),BigVarUint:T=>X(T),Bool:()=>ye(),Address:()=>he(),Cell:()=>K(),Buffer:T=>L(T),BitString:T=>$(T),Dictionary:(T,N)=>B(T,N)};function S(){return{bits:267,serialize:T=>{if(!w.Address.isAddress(T))throw Error("Key is not an address");return(0,E.beginCell)().storeAddress(T).endCell().beginParse().preloadUintBig(267)},parse:T=>(0,E.beginCell)().storeUint(T,267).endCell().beginParse().loadAddress()}}function O(T){return{bits:T,serialize:N=>{if(typeof N!="bigint")throw Error("Key is not a bigint");return(0,E.beginCell)().storeInt(N,T).endCell().beginParse().loadUintBig(T)},parse:N=>(0,E.beginCell)().storeUint(N,T).endCell().beginParse().loadIntBig(T)}}function M(T){return{bits:T,serialize:N=>{if(typeof N!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(N))throw Error("Key is not a safe integer: "+N);return(0,E.beginCell)().storeInt(N,T).endCell().beginParse().loadUintBig(T)},parse:N=>(0,E.beginCell)().storeUint(N,T).endCell().beginParse().loadInt(T)}}function k(T){return{bits:T,serialize:N=>{if(typeof N!="bigint")throw Error("Key is not a bigint");if(N<0)throw Error("Key is negative: "+N);return(0,E.beginCell)().storeUint(N,T).endCell().beginParse().loadUintBig(T)},parse:N=>(0,E.beginCell)().storeUint(N,T).endCell().beginParse().loadUintBig(T)}}function q(T){return{bits:T,serialize:N=>{if(typeof N!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(N))throw Error("Key is not a safe integer: "+N);if(N<0)throw Error("Key is negative: "+N);return(0,E.beginCell)().storeUint(N,T).endCell().beginParse().loadUintBig(T)},parse:N=>Number((0,E.beginCell)().storeUint(N,T).endCell().beginParse().loadUint(T))}}function b(T){return{bits:T*8,serialize:N=>{if(!h.isBuffer(N))throw Error("Key is not a buffer");return(0,E.beginCell)().storeBuffer(N).endCell().beginParse().loadUintBig(T*8)},parse:N=>(0,E.beginCell)().storeUint(N,T*8).endCell().beginParse().loadBuffer(T)}}function F(T){return{bits:T,serialize:N=>{if(!c.BitString.isBitString(N))throw Error("Key is not a BitString");return(0,E.beginCell)().storeBits(N).endCell().beginParse().loadUintBig(T)},parse:N=>(0,E.beginCell)().storeUint(N,T).endCell().beginParse().loadBits(T)}}function G(T){return{serialize:(N,j)=>{j.storeInt(N,T)},parse:N=>{let j=N.loadInt(T);return N.endParse(),j}}}function ue(T){return{serialize:(N,j)=>{j.storeInt(N,T)},parse:N=>{let j=N.loadIntBig(T);return N.endParse(),j}}}function le(T){return{serialize:(N,j)=>{j.storeVarInt(N,T)},parse:N=>{let j=N.loadVarIntBig(T);return N.endParse(),j}}}function X(T){return{serialize:(N,j)=>{j.storeVarUint(N,T)},parse:N=>{let j=N.loadVarUintBig(T);return N.endParse(),j}}}function se(T){return{serialize:(N,j)=>{j.storeUint(N,T)},parse:N=>{let j=N.loadUint(T);return N.endParse(),j}}}function de(T){return{serialize:(N,j)=>{j.storeUint(N,T)},parse:N=>{let j=N.loadUintBig(T);return N.endParse(),j}}}function ye(){return{serialize:(T,N)=>{N.storeBit(T)},parse:T=>{let N=T.loadBit();return T.endParse(),N}}}function he(){return{serialize:(T,N)=>{N.storeAddress(T)},parse:T=>{let N=T.loadAddress();return T.endParse(),N}}}function K(){return{serialize:(T,N)=>{N.storeRef(T)},parse:T=>{let N=T.loadRef();return T.endParse(),N}}}function B(T,N){return{serialize:(j,Y)=>{j.store(Y)},parse:j=>{let Y=R.load(T,N,j);return j.endParse(),Y}}}function L(T){return{serialize:(N,j)=>{if(N.length!==T)throw Error("Invalid buffer size");j.storeBuffer(N)},parse:N=>{let j=N.loadBuffer(T);return N.endParse(),j}}}function $(T){return{serialize:(N,j)=>{if(N.length!==T)throw Error("Invalid BitString size");j.storeBits(N)},parse:N=>{let j=N.loadBits(T);return N.endParse(),j}}}},47388:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.generateMerkleProof=f.generateMerkleProofDirect=void 0;const h=_(44460),w=_(79968),E=_(98138);function v(m){return(0,h.beginCell)().storeUint(1,8).storeUint(1,8).storeBuffer(m.hash(0)).storeUint(m.depth(0),16).endCell({exotic:!0})}function c(m,C,x,R){const S=C.asCell();if(R.length==0)return v(S);let O=C.loadBit()?1:0,M=0,k=m;if(O===0){M=(0,w.readUnaryLength)(C);for(let q=0;q<M;q++)k+=C.loadBit()?"1":"0"}else if((C.loadBit()?1:0)===0){M=C.loadUint(Math.ceil(Math.log2(x+1)));for(let b=0;b<M;b++)k+=C.loadBit()?"1":"0"}else{let b=C.loadBit()?"1":"0";M=C.loadUint(Math.ceil(Math.log2(x+1)));for(let F=0;F<M;F++)k+=b}if(x-M===0)return S;{let q=S.beginParse(),b=q.loadRef(),F=q.loadRef();if(!b.isExotic){const G=R.filter(ue=>k+"0"===ue.slice(0,k.length+1));b=c(k+"0",b.beginParse(),x-M-1,G)}if(!F.isExotic){const G=R.filter(ue=>k+"1"===ue.slice(0,k.length+1));F=c(k+"1",F.beginParse(),x-M-1,G)}return(0,h.beginCell)().storeSlice(q).storeRef(b).storeRef(F).endCell()}}function d(m,C,x){C.forEach(S=>{if(!m.has(S))throw new Error(`Trying to generate merkle proof for a missing key "${S}"`)});const R=(0,h.beginCell)().storeDictDirect(m).asSlice();return c("",R,x.bits,C.map(S=>x.serialize(S).toString(2).padStart(x.bits,"0")))}f.generateMerkleProofDirect=d;function p(m,C,x){return(0,E.convertToMerkleProof)(d(m,C,x))}f.generateMerkleProof=p},79569:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.generateMerkleUpdate=void 0;const h=_(44460),w=_(47388);function E(c,d){return(0,h.beginCell)().storeUint(4,8).storeBuffer(c.hash(0)).storeBuffer(d.hash(0)).storeUint(c.depth(0),16).storeUint(d.depth(0),16).storeRef(c).storeRef(d).endCell({exotic:!0})}function v(c,d,p,m){const C=(0,w.generateMerkleProof)(c,[d],p).refs[0];c.set(d,m);const x=(0,w.generateMerkleProof)(c,[d],p).refs[0];return E(C,x)}f.generateMerkleUpdate=v},49450:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.parseDict=void 0;function _(E){let v=0;for(;E.loadBit();)v++;return v}function h(E,v,c,d,p){let m=v.loadBit()?1:0,C=0,x=E;if(m===0){C=_(v);for(let R=0;R<C;R++)x+=v.loadBit()?"1":"0"}else if((v.loadBit()?1:0)===0){C=v.loadUint(Math.ceil(Math.log2(c+1)));for(let S=0;S<C;S++)x+=v.loadBit()?"1":"0"}else{let S=v.loadBit()?"1":"0";C=v.loadUint(Math.ceil(Math.log2(c+1)));for(let O=0;O<C;O++)x+=S}if(c-C===0)d.set(BigInt("0b"+x),p(v));else{let R=v.loadRef(),S=v.loadRef();R.isExotic||h(x+"0",R.beginParse(),c-C-1,d,p),S.isExotic||h(x+"1",S.beginParse(),c-C-1,d,p)}}function w(E,v,c){let d=new Map;return E&&h("",E,v,d,c),d}f.parseDict=w},26327:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.serializeDict=f.detectLabelType=f.writeLabelSame=f.writeLabelLong=f.writeLabelShort=f.buildTree=void 0;const h=_(44460),w=_(6001);function E(le,X){for(;le.length<X;)le="0"+le;return le}function v(le,X){if(X===0)return le;{let se=new Map;for(let de of le.keys()){let ye=le.get(de);se.set(de.slice(X),ye)}return se}}function c(le,X){if(le.size===0)throw Error("Internal inconsistency");let se=new Map,de=new Map;for(let[ye,he]of le.entries())ye[X]==="0"?se.set(ye,he):de.set(ye,he);if(se.size===0)throw Error("Internal inconsistency. Left emtpy.");if(de.size===0)throw Error("Internal inconsistency. Right emtpy.");return{left:se,right:de}}function d(le,X){if(le.size===0)throw Error("Internal inconsistency");if(le.size===1)return{type:"leaf",value:Array.from(le.values())[0]};let{left:se,right:de}=c(le,X);return{type:"fork",left:p(se,X+1),right:p(de,X+1)}}function p(le,X=0){if(le.size===0)throw Error("Internal inconsistency");const se=(0,w.findCommonPrefix)(Array.from(le.keys()),X);return{label:se,node:d(le,se.length+X)}}function m(le,X){let se=new Map;for(let de of Array.from(le.keys())){const ye=E(de.toString(2),X);se.set(ye,le.get(de))}return p(se)}f.buildTree=m;function C(le,X){X.storeBit(0);for(let se=0;se<le.length;se++)X.storeBit(1);return X.storeBit(0),le.length>0&&X.storeUint(BigInt("0b"+le),le.length),X}f.writeLabelShort=C;function x(le){return 1+le.length+1+le.length}function R(le,X,se){se.storeBit(1),se.storeBit(0);let de=Math.ceil(Math.log2(X+1));return se.storeUint(le.length,de),le.length>0&&se.storeUint(BigInt("0b"+le),le.length),se}f.writeLabelLong=R;function S(le,X){return 2+Math.ceil(Math.log2(X+1))+le.length}function O(le,X,se,de){de.storeBit(1),de.storeBit(1),de.storeBit(le);let ye=Math.ceil(Math.log2(se+1));de.storeUint(X,ye)}f.writeLabelSame=O;function M(le){return 3+Math.ceil(Math.log2(le+1))}function k(le){if(le.length===0||le.length===1)return!0;for(let X=1;X<le.length;X++)if(le[X]!==le[0])return!1;return!0}function q(le,X){let se="short",de=x(le),ye=S(le,X);if(ye<de&&(de=ye,se="long"),k(le)){let he=M(X);he<de&&(de=he,se="same")}return se}f.detectLabelType=q;function b(le,X,se){let de=q(le,X);de==="short"?C(le,se):de==="long"?R(le,X,se):de==="same"&&O(le[0]==="1",le.length,X,se)}function F(le,X,se,de){if(le.type==="leaf"&&se(le.value,de),le.type==="fork"){const ye=(0,h.beginCell)(),he=(0,h.beginCell)();G(le.left,X-1,se,ye),G(le.right,X-1,se,he),de.storeRef(ye),de.storeRef(he)}}function G(le,X,se,de){b(le.label,X,de),F(le.node,X-le.label.length,se,de)}function ue(le,X,se,de){const ye=m(le,X);G(ye,X,se,de)}f.serializeDict=ue},6001:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.findCommonPrefix=void 0;function _(h,w=0){if(h.length===0)return"";let E=h[0].slice(w);for(let v=1;v<h.length;v++){const c=h[v];for(;c.indexOf(E,w)!==w;)if(E=E.substring(0,E.length-1),E==="")return E}return E}f.findCommonPrefix=_},90307:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.deserializeInternalKey=f.serializeInternalKey=void 0;const w=_(82483),E=_(49377),v=_(86095);function c(p){if(typeof p=="number"){if(!Number.isSafeInteger(p))throw Error("Invalid key type: not a safe integer: "+p);return"n:"+p.toString(10)}else{if(typeof p=="bigint")return"b:"+p.toString(10);if(w.Address.isAddress(p))return"a:"+p.toString();if(h.isBuffer(p))return"f:"+p.toString("hex");if(E.BitString.isBitString(p))return"B:"+p.toString();throw Error("Invalid key type")}}f.serializeInternalKey=c;function d(p){let m=p.slice(0,2),C=p.slice(2);if(m==="n:")return parseInt(C,10);if(m==="b:")return BigInt(C);if(m==="a:")return w.Address.parse(C);if(m==="f:")return h.from(C,"hex");if(m==="B:"){const x=C.slice(-1)=="_";if(x||C.length%2!=0){let S=x?C.length-1:C.length;const O=C.substr(0,S)+"0";return!x&&S&1?new E.BitString(h.from(O,"hex"),0,S<<2):(0,v.paddedBufferToBits)(h.from(O,"hex"))}else return new E.BitString(h.from(C,"hex"),0,C.length<<2)}throw Error("Invalid key type: "+m)}f.deserializeInternalKey=d},79968:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.readUnaryLength=void 0;function _(h){let w=0;for(;h.loadBit();)w++;return w}f.readUnaryLength=_},21224:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(T,N,j,Y){Y===void 0&&(Y=j);var Z=Object.getOwnPropertyDescriptor(N,j);(!Z||("get"in Z?!N.__esModule:Z.writable||Z.configurable))&&(Z={enumerable:!0,get:function(){return N[j]}}),Object.defineProperty(T,Y,Z)}:function(T,N,j,Y){Y===void 0&&(Y=j),T[Y]=N[j]}),w=this&&this.__exportStar||function(T,N){for(var j in T)j!=="default"&&!Object.prototype.hasOwnProperty.call(N,j)&&h(N,T,j)};Object.defineProperty(f,"__esModule",{value:!0}),f.safeSignVerify=f.safeSign=f.getMethodId=f.base32Encode=f.base32Decode=f.crc32c=f.crc16=f.fromNano=f.toNano=f.ComputeError=f.openContract=f.TupleBuilder=f.TupleReader=f.serializeTupleItem=f.parseTupleItem=f.serializeTuple=f.parseTuple=f.generateMerkleUpdate=f.generateMerkleProofDirect=f.generateMerkleProof=f.exoticPruned=f.exoticMerkleUpdate=f.convertToMerkleProof=f.exoticMerkleProof=f.Dictionary=f.Cell=f.CellType=f.Slice=f.beginCell=f.Builder=f.BitBuilder=f.BitReader=f.BitString=f.contractAddress=f.ADNLAddress=f.ExternalAddress=f.address=f.Address=void 0;var E=_(82483);Object.defineProperty(f,"Address",{enumerable:!0,get:function(){return E.Address}}),Object.defineProperty(f,"address",{enumerable:!0,get:function(){return E.address}});var v=_(25610);Object.defineProperty(f,"ExternalAddress",{enumerable:!0,get:function(){return v.ExternalAddress}});var c=_(74570);Object.defineProperty(f,"ADNLAddress",{enumerable:!0,get:function(){return c.ADNLAddress}});var d=_(54529);Object.defineProperty(f,"contractAddress",{enumerable:!0,get:function(){return d.contractAddress}});var p=_(49377);Object.defineProperty(f,"BitString",{enumerable:!0,get:function(){return p.BitString}});var m=_(75907);Object.defineProperty(f,"BitReader",{enumerable:!0,get:function(){return m.BitReader}});var C=_(30677);Object.defineProperty(f,"BitBuilder",{enumerable:!0,get:function(){return C.BitBuilder}});var x=_(44460);Object.defineProperty(f,"Builder",{enumerable:!0,get:function(){return x.Builder}}),Object.defineProperty(f,"beginCell",{enumerable:!0,get:function(){return x.beginCell}});var R=_(22269);Object.defineProperty(f,"Slice",{enumerable:!0,get:function(){return R.Slice}});var S=_(42739);Object.defineProperty(f,"CellType",{enumerable:!0,get:function(){return S.CellType}});var O=_(48587);Object.defineProperty(f,"Cell",{enumerable:!0,get:function(){return O.Cell}});var M=_(24201);Object.defineProperty(f,"Dictionary",{enumerable:!0,get:function(){return M.Dictionary}});var k=_(98138);Object.defineProperty(f,"exoticMerkleProof",{enumerable:!0,get:function(){return k.exoticMerkleProof}}),Object.defineProperty(f,"convertToMerkleProof",{enumerable:!0,get:function(){return k.convertToMerkleProof}});var q=_(72291);Object.defineProperty(f,"exoticMerkleUpdate",{enumerable:!0,get:function(){return q.exoticMerkleUpdate}});var b=_(24020);Object.defineProperty(f,"exoticPruned",{enumerable:!0,get:function(){return b.exoticPruned}});var F=_(47388);Object.defineProperty(f,"generateMerkleProof",{enumerable:!0,get:function(){return F.generateMerkleProof}}),Object.defineProperty(f,"generateMerkleProofDirect",{enumerable:!0,get:function(){return F.generateMerkleProofDirect}});var G=_(79569);Object.defineProperty(f,"generateMerkleUpdate",{enumerable:!0,get:function(){return G.generateMerkleUpdate}});var ue=_(15259);Object.defineProperty(f,"parseTuple",{enumerable:!0,get:function(){return ue.parseTuple}}),Object.defineProperty(f,"serializeTuple",{enumerable:!0,get:function(){return ue.serializeTuple}}),Object.defineProperty(f,"parseTupleItem",{enumerable:!0,get:function(){return ue.parseTupleItem}}),Object.defineProperty(f,"serializeTupleItem",{enumerable:!0,get:function(){return ue.serializeTupleItem}});var le=_(58446);Object.defineProperty(f,"TupleReader",{enumerable:!0,get:function(){return le.TupleReader}});var X=_(84686);Object.defineProperty(f,"TupleBuilder",{enumerable:!0,get:function(){return X.TupleBuilder}}),w(_(59209),f);var se=_(28481);Object.defineProperty(f,"openContract",{enumerable:!0,get:function(){return se.openContract}});var de=_(54306);Object.defineProperty(f,"ComputeError",{enumerable:!0,get:function(){return de.ComputeError}});var ye=_(69329);Object.defineProperty(f,"toNano",{enumerable:!0,get:function(){return ye.toNano}}),Object.defineProperty(f,"fromNano",{enumerable:!0,get:function(){return ye.fromNano}});var he=_(33475);Object.defineProperty(f,"crc16",{enumerable:!0,get:function(){return he.crc16}});var K=_(88224);Object.defineProperty(f,"crc32c",{enumerable:!0,get:function(){return K.crc32c}});var B=_(4988);Object.defineProperty(f,"base32Decode",{enumerable:!0,get:function(){return B.base32Decode}}),Object.defineProperty(f,"base32Encode",{enumerable:!0,get:function(){return B.base32Encode}});var L=_(44238);Object.defineProperty(f,"getMethodId",{enumerable:!0,get:function(){return L.getMethodId}});var $=_(84754);Object.defineProperty(f,"safeSign",{enumerable:!0,get:function(){return $.safeSign}}),Object.defineProperty(f,"safeSignVerify",{enumerable:!0,get:function(){return $.safeSignVerify}})},86332:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.inspectSymbol=void 0,f.inspectSymbol=Symbol.for("nodejs.util.inspect.custom")},84686:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.TupleBuilder=void 0;const h=_(44460),w=_(48587),E=_(22269);class v{constructor(){this._tuple=[]}writeNumber(d){d==null?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:BigInt(d)})}writeBoolean(d){d==null?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:d?-1n:0n})}writeBuffer(d){d==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,h.beginCell)().storeBuffer(d).endCell()})}writeString(d){d==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,h.beginCell)().storeStringTail(d).endCell()})}writeCell(d){d==null?this._tuple.push({type:"null"}):d instanceof w.Cell?this._tuple.push({type:"cell",cell:d}):d instanceof E.Slice&&this._tuple.push({type:"cell",cell:d.asCell()})}writeSlice(d){d==null?this._tuple.push({type:"null"}):d instanceof w.Cell?this._tuple.push({type:"slice",cell:d}):d instanceof E.Slice&&this._tuple.push({type:"slice",cell:d.asCell()})}writeBuilder(d){d==null?this._tuple.push({type:"null"}):d instanceof w.Cell?this._tuple.push({type:"builder",cell:d}):d instanceof E.Slice&&this._tuple.push({type:"builder",cell:d.asCell()})}writeTuple(d){d==null?this._tuple.push({type:"null"}):this._tuple.push({type:"tuple",items:d})}writeAddress(d){d==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,h.beginCell)().storeAddress(d).endCell()})}build(){return[...this._tuple]}}f.TupleBuilder=v},58446:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.TupleReader=void 0;class _{constructor(w){this.items=[...w]}get remaining(){return this.items.length}peek(){if(this.items.length===0)throw Error("EOF");return this.items[0]}pop(){if(this.items.length===0)throw Error("EOF");let w=this.items[0];return this.items.splice(0,1),w}skip(w=1){for(let E=0;E<w;E++)this.pop();return this}readBigNumber(){let w=this.pop();if(w.type!=="int")throw Error("Not a number");return w.value}readBigNumberOpt(){let w=this.pop();if(w.type==="null")return null;if(w.type!=="int")throw Error("Not a number");return w.value}readNumber(){return Number(this.readBigNumber())}readNumberOpt(){let w=this.readBigNumberOpt();return w!==null?Number(w):null}readBoolean(){return this.readNumber()!==0}readBooleanOpt(){let w=this.readNumberOpt();return w!==null?w!==0:null}readAddress(){let w=this.readCell().beginParse().loadAddress();if(w!==null)return w;throw Error("Not an address")}readAddressOpt(){let w=this.readCellOpt();return w!==null?w.beginParse().loadMaybeAddress():null}readCell(){let w=this.pop();if(w.type!=="cell"&&w.type!=="slice"&&w.type!=="builder")throw Error("Not a cell: "+w.type);return w.cell}readCellOpt(){let w=this.pop();if(w.type==="null")return null;if(w.type!=="cell"&&w.type!=="slice"&&w.type!=="builder")throw Error("Not a cell");return w.cell}readTuple(){let w=this.pop();if(w.type!=="tuple")throw Error("Not a tuple");return new _(w.items)}readTupleOpt(){let w=this.pop();if(w.type==="null")return null;if(w.type!=="tuple")throw Error("Not a tuple");return new _(w.items)}static readLispList(w){const E=[];let v=w;for(;v!==null;){var c=v.pop();if(v.items.length===0||v.items[0].type!=="tuple"&&v.items[0].type!=="null")throw Error("Lisp list consists only from (any, tuple) elements and ends with null");v=v.readTupleOpt(),E.push(c)}return E}readLispListDirect(){return this.items.length===1&&this.items[0].type==="null"?[]:_.readLispList(this)}readLispList(){return _.readLispList(this.readTupleOpt())}readBuffer(){let w=this.readCell().beginParse();if(w.remainingRefs!==0||w.remainingBits%8!==0)throw Error("Not a buffer");return w.loadBuffer(w.remainingBits/8)}readBufferOpt(){let w=this.readCellOpt();if(w!==null){let E=w.beginParse();if(E.remainingRefs!==0||E.remainingBits%8!==0)throw Error("Not a buffer");return E.loadBuffer(E.remainingBits/8)}else return null}readString(){return this.readCell().beginParse().loadStringTail()}readStringOpt(){let w=this.readCellOpt();return w!==null?w.beginParse().loadStringTail():null}}f.TupleReader=_},15259:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.parseTuple=f.serializeTuple=f.parseTupleItem=f.serializeTupleItem=void 0;const h=_(44460),w=BigInt("-9223372036854775808"),E=BigInt("9223372036854775807");function v(C,x){if(C.type==="null")x.storeUint(0,8);else if(C.type==="int")C.value<=E&&C.value>=w?(x.storeUint(1,8),x.storeInt(C.value,64)):(x.storeUint(256,15),x.storeInt(C.value,257));else if(C.type==="nan")x.storeInt(767,16);else if(C.type==="cell")x.storeUint(3,8),x.storeRef(C.cell);else if(C.type==="slice")x.storeUint(4,8),x.storeUint(0,10),x.storeUint(C.cell.bits.length,10),x.storeUint(0,3),x.storeUint(C.cell.refs.length,3),x.storeRef(C.cell);else if(C.type==="builder")x.storeUint(5,8),x.storeRef(C.cell);else if(C.type==="tuple"){let R=null,S=null;for(let O=0;O<C.items.length;O++){let M=R;R=S,S=M,O>1&&(R=(0,h.beginCell)().storeRef(S).storeRef(R).endCell());let k=(0,h.beginCell)();v(C.items[O],k),S=k.endCell()}x.storeUint(7,8),x.storeUint(C.items.length,16),R&&x.storeRef(R),S&&x.storeRef(S)}else throw Error("Invalid value")}f.serializeTupleItem=v;function c(C){let x=C.loadUint(8);if(x===0)return{type:"null"};if(x===1)return{type:"int",value:C.loadIntBig(64)};if(x===2)return C.loadUint(7)===0?{type:"int",value:C.loadIntBig(257)}:(C.loadBit(),{type:"nan"});if(x===3)return{type:"cell",cell:C.loadRef()};if(x===4){let R=C.loadUint(10),S=C.loadUint(10),O=C.loadUint(3),M=C.loadUint(3),k=C.loadRef().beginParse();k.skip(R);let q=k.loadBits(S-R),b=(0,h.beginCell)().storeBits(q);if(O<M){for(let F=0;F<O;F++)k.loadRef();for(let F=0;F<M-O;F++)b.storeRef(k.loadRef())}return{type:"slice",cell:b.endCell()}}else{if(x===5)return{type:"builder",cell:C.loadRef()};if(x===7){let R=C.loadUint(16),S=[];if(R>1){let O=C.loadRef().beginParse(),M=C.loadRef().beginParse();S.unshift(c(M));for(let k=0;k<R-2;k++){let q=O;O=q.loadRef().beginParse(),M=q.loadRef().beginParse(),S.unshift(c(M))}S.unshift(c(O))}else R===1&&S.push(c(C.loadRef().beginParse()));return{type:"tuple",items:S}}else throw Error("Unsupported stack item")}}f.parseTupleItem=c;function d(C,x){if(C.length>0){let R=(0,h.beginCell)();d(C.slice(0,C.length-1),R),x.storeRef(R.endCell()),v(C[C.length-1],x)}}function p(C){let x=(0,h.beginCell)();x.storeUint(C.length,24);let R=[...C];return d(R,x),x.endCell()}f.serializeTuple=p;function m(C){let x=[],R=C.beginParse(),S=R.loadUint(24);for(let O=0;O<S;O++){let M=R.loadRef();x.unshift(c(R)),R=M.beginParse()}return x}f.parseTuple=m},36805:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeAccount=f.loadAccount=void 0;const h=_(41404),w=_(18503);function E(c){return{addr:c.loadAddress(),storageStats:(0,w.loadStorageInfo)(c),storage:(0,h.loadAccountStorage)(c)}}f.loadAccount=E;function v(c){return d=>{d.storeAddress(c.addr),d.store((0,w.storeStorageInfo)(c.storageStats)),d.store((0,h.storeAccountStorage)(c.storage))}}f.storeAccount=v},71540:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeAccountState=f.loadAccountState=void 0;const h=_(17669);function w(v){return v.loadBit()?{type:"active",state:(0,h.loadStateInit)(v)}:v.loadBit()?{type:"frozen",stateHash:v.loadUintBig(256)}:{type:"uninit"}}f.loadAccountState=w;function E(v){return c=>{v.type==="active"?(c.storeBit(!0),c.store((0,h.storeStateInit)(v.state))):v.type==="frozen"?(c.storeBit(!1),c.storeBit(!0),c.storeUint(v.stateHash,256)):v.type==="uninit"&&(c.storeBit(!1),c.storeBit(!1))}}f.storeAccountState=E},47051:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeAccountStatus=f.loadAccountStatus=void 0;function _(w){const E=w.loadUint(2);if(E===0)return"uninitialized";if(E===1)return"frozen";if(E===2)return"active";if(E===3)return"non-existing";throw Error("Invalid data")}f.loadAccountStatus=_;function h(w){return E=>{if(w==="uninitialized")E.storeUint(0,2);else if(w==="frozen")E.storeUint(1,2);else if(w==="active")E.storeUint(2,2);else if(w==="non-existing")E.storeUint(3,2);else throw Error("Invalid data");return E}}f.storeAccountStatus=h},41923:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeAccountStatusChange=f.loadAccountStatusChange=void 0;function _(w){return w.loadBit()?w.loadBit()?"deleted":"frozen":"unchanged"}f.loadAccountStatusChange=_;function h(w){return E=>{if(w=="unchanged")E.storeBit(0);else if(w==="frozen")E.storeBit(1),E.storeBit(0);else if(w==="deleted")E.storeBit(1),E.storeBit(1);else throw Error("Invalid account status change")}}f.storeAccountStatusChange=h},41404:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeAccountStorage=f.loadAccountStorage=void 0;const h=_(71540),w=_(70935);function E(c){return{lastTransLt:c.loadUintBig(64),balance:(0,w.loadCurrencyCollection)(c),state:(0,h.loadAccountState)(c)}}f.loadAccountStorage=E;function v(c){return d=>{d.storeUint(c.lastTransLt,64),d.store((0,w.storeCurrencyCollection)(c.balance)),d.store((0,h.storeAccountState)(c.state))}}f.storeAccountStorage=v},61038:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeCommonMessageInfo=f.loadCommonMessageInfo=void 0;const h=_(70935);function w(v){if(!v.loadBit()){const C=v.loadBit(),x=v.loadBit(),R=v.loadBit(),S=v.loadAddress(),O=v.loadAddress(),M=(0,h.loadCurrencyCollection)(v),k=v.loadCoins(),q=v.loadCoins(),b=v.loadUintBig(64),F=v.loadUint(32);return{type:"internal",ihrDisabled:C,bounce:x,bounced:R,src:S,dest:O,value:M,ihrFee:k,forwardFee:q,createdLt:b,createdAt:F}}if(!v.loadBit()){const C=v.loadMaybeExternalAddress(),x=v.loadAddress(),R=v.loadCoins();return{type:"external-in",src:C,dest:x,importFee:R}}const c=v.loadAddress(),d=v.loadMaybeExternalAddress(),p=v.loadUintBig(64),m=v.loadUint(32);return{type:"external-out",src:c,dest:d,createdLt:p,createdAt:m}}f.loadCommonMessageInfo=w;function E(v){return c=>{if(v.type==="internal")c.storeBit(0),c.storeBit(v.ihrDisabled),c.storeBit(v.bounce),c.storeBit(v.bounced),c.storeAddress(v.src),c.storeAddress(v.dest),c.store((0,h.storeCurrencyCollection)(v.value)),c.storeCoins(v.ihrFee),c.storeCoins(v.forwardFee),c.storeUint(v.createdLt,64),c.storeUint(v.createdAt,32);else if(v.type==="external-in")c.storeBit(1),c.storeBit(0),c.storeAddress(v.src),c.storeAddress(v.dest),c.storeCoins(v.importFee);else if(v.type==="external-out")c.storeBit(1),c.storeBit(1),c.storeAddress(v.src),c.storeAddress(v.dest),c.storeUint(v.createdLt,64),c.storeUint(v.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}f.storeCommonMessageInfo=E},12688:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeCommonMessageInfoRelaxed=f.loadCommonMessageInfoRelaxed=void 0;const h=_(70935);function w(v){if(!v.loadBit()){const C=v.loadBit(),x=v.loadBit(),R=v.loadBit(),S=v.loadMaybeAddress(),O=v.loadAddress(),M=(0,h.loadCurrencyCollection)(v),k=v.loadCoins(),q=v.loadCoins(),b=v.loadUintBig(64),F=v.loadUint(32);return{type:"internal",ihrDisabled:C,bounce:x,bounced:R,src:S,dest:O,value:M,ihrFee:k,forwardFee:q,createdLt:b,createdAt:F}}if(!v.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");const c=v.loadMaybeAddress(),d=v.loadMaybeExternalAddress(),p=v.loadUintBig(64),m=v.loadUint(32);return{type:"external-out",src:c,dest:d,createdLt:p,createdAt:m}}f.loadCommonMessageInfoRelaxed=w;function E(v){return c=>{if(v.type==="internal")c.storeBit(0),c.storeBit(v.ihrDisabled),c.storeBit(v.bounce),c.storeBit(v.bounced),c.storeAddress(v.src),c.storeAddress(v.dest),c.store((0,h.storeCurrencyCollection)(v.value)),c.storeCoins(v.ihrFee),c.storeCoins(v.forwardFee),c.storeUint(v.createdLt,64),c.storeUint(v.createdAt,32);else if(v.type==="external-out")c.storeBit(1),c.storeBit(1),c.storeAddress(v.src),c.storeAddress(v.dest),c.storeUint(v.createdLt,64),c.storeUint(v.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}f.storeCommonMessageInfoRelaxed=E},97176:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeComputeSkipReason=f.loadComputeSkipReason=void 0;function _(w){let E=w.loadUint(2);if(E===0)return"no-state";if(E===1)return"bad-state";if(E===2)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${E}`)}f.loadComputeSkipReason=_;function h(w){return E=>{if(w==="no-state")E.storeUint(0,2);else if(w==="bad-state")E.storeUint(1,2);else if(w==="no-gas")E.storeUint(2,2);else throw new Error(`Unknown ComputeSkipReason: ${w}`)}}f.storeComputeSkipReason=h},70935:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeCurrencyCollection=f.loadCurrencyCollection=void 0;const h=_(24201);function w(v){const c=v.loadCoins(),d=v.loadDict(h.Dictionary.Keys.Uint(32),h.Dictionary.Values.BigVarUint(5));return d.size===0?{coins:c}:{other:d,coins:c}}f.loadCurrencyCollection=w;function E(v){return c=>{c.storeCoins(v.coins),v.other?c.storeDict(v.other):c.storeBit(0)}}f.storeCurrencyCollection=E},38007:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeDepthBalanceInfo=f.loadDepthBalanceInfo=void 0;const h=_(70935);function w(v){return{splitDepth:v.loadUint(5),balance:(0,h.loadCurrencyCollection)(v)}}f.loadDepthBalanceInfo=w;function E(v){return c=>{c.storeUint(v.splitDepth,5),c.store((0,h.storeCurrencyCollection)(v.balance))}}f.storeDepthBalanceInfo=E},90879:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.packExtraCurrencyCell=f.packExtraCurrencyDict=f.storeExtraCurrency=f.loadMaybeExtraCurrency=f.loadExtraCurrency=void 0;const h=_(44460),w=_(24201);function E(m){let C=m instanceof w.Dictionary?m:w.Dictionary.loadDirect(w.Dictionary.Keys.Uint(32),w.Dictionary.Values.BigVarUint(5),m),x={};for(let[R,S]of C)x[R]=S;return x}f.loadExtraCurrency=E;function v(m){const C=m.loadMaybeRef();return C===null?C:E(C)}f.loadMaybeExtraCurrency=v;function c(m){return C=>{C.storeDict(d(m))}}f.storeExtraCurrency=c;function d(m){const C=w.Dictionary.empty(w.Dictionary.Keys.Uint(32),w.Dictionary.Values.BigVarUint(5));return Object.entries(m).map(([x,R])=>C.set(Number(x),R)),C}f.packExtraCurrencyDict=d;function p(m){return(0,h.beginCell)().storeDictDirect(d(m)).endCell()}f.packExtraCurrencyCell=p},79273:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeHashUpdate=f.loadHashUpdate=void 0;function _(w){if(w.loadUint(8)!==114)throw Error("Invalid data");const E=w.loadBuffer(32),v=w.loadBuffer(32);return{oldHash:E,newHash:v}}f.loadHashUpdate=_;function h(w){return E=>{E.storeUint(114,8),E.storeBuffer(w.oldHash),E.storeBuffer(w.newHash)}}f.storeHashUpdate=h},27372:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeLibRef=f.loadLibRef=void 0;function _(w){return w.loadUint(1)===0?{type:"hash",libHash:w.loadBuffer(32)}:{type:"ref",library:w.loadRef()}}f.loadLibRef=_;function h(w){return E=>{w.type==="hash"?(E.storeUint(0,1),E.storeBuffer(w.libHash)):(E.storeUint(1,1),E.storeRef(w.library))}}f.storeLibRef=h},15828:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.loadMasterchainStateExtra=void 0;const h=_(24201),w=_(70935);function E(v){if(v.loadUint(16)!==52262)throw Error("Invalid data");v.loadBit()&&v.loadRef();let c=v.loadUintBig(256),d=h.Dictionary.load(h.Dictionary.Keys.Int(32),h.Dictionary.Values.Cell(),v);const p=(0,w.loadCurrencyCollection)(v);return{config:d,configAddress:c,globalBalance:p}}f.loadMasterchainStateExtra=E},72913:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.MessageValue=f.storeMessage=f.loadMessage=void 0;const h=_(44460),w=_(61038),E=_(17669);function v(d){const p=(0,w.loadCommonMessageInfo)(d);let m=null;d.loadBit()&&(d.loadBit()?m=(0,E.loadStateInit)(d.loadRef().beginParse()):m=(0,E.loadStateInit)(d));const C=d.loadBit()?d.loadRef():d.asCell();return{info:p,init:m,body:C}}f.loadMessage=v;function c(d,p){return m=>{if(m.store((0,w.storeCommonMessageInfo)(d.info)),d.init){m.storeBit(!0);let x=(0,h.beginCell)().store((0,E.storeStateInit)(d.init)),R=!1;p&&p.forceRef?R=!0:R=m.availableBits-2<x.bits+d.body.bits.length,R?(m.storeBit(!0),m.storeRef(x)):(m.storeBit(!1),m.storeBuilder(x))}else m.storeBit(!1);let C=!1;p&&p.forceRef?C=!0:C=m.availableBits-1<d.body.bits.length||m.refs+d.body.refs.length>4,C?(m.storeBit(!0),m.storeRef(d.body)):(m.storeBit(!1),m.storeBuilder(d.body.asBuilder()))}}f.storeMessage=c,f.MessageValue={serialize(d,p){p.storeRef((0,h.beginCell)().store(c(d)))},parse(d){return v(d.loadRef().beginParse())}}},92374:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeMessageRelaxed=f.loadMessageRelaxed=void 0;const h=_(44460),w=_(12688),E=_(17669);function v(d){const p=(0,w.loadCommonMessageInfoRelaxed)(d);let m=null;d.loadBit()&&(d.loadBit()?m=(0,E.loadStateInit)(d.loadRef().beginParse()):m=(0,E.loadStateInit)(d));const C=d.loadBit()?d.loadRef():d.asCell();return{info:p,init:m,body:C}}f.loadMessageRelaxed=v;function c(d,p){return m=>{if(m.store((0,w.storeCommonMessageInfoRelaxed)(d.info)),d.init){m.storeBit(!0);let x=(0,h.beginCell)().store((0,E.storeStateInit)(d.init)),R=!1;p&&p.forceRef?R=!0:m.availableBits-2>=x.bits?R=!1:R=!0,R?(m.storeBit(!0),m.storeRef(x)):(m.storeBit(!1),m.storeBuilder(x))}else m.storeBit(!1);let C=!1;p&&p.forceRef?C=!0:m.availableBits-1>=d.body.bits.length&&m.refs+d.body.refs.length<=4&&!d.body.isExotic?C=!1:C=!0,C?(m.storeBit(!0),m.storeRef(d.body)):(m.storeBit(!1),m.storeBuilder(d.body.asBuilder()))}}f.storeMessageRelaxed=c},45326:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.loadOutList=f.storeOutList=f.loadOutAction=f.storeOutAction=void 0;const h=_(92374),w=_(44460),E=_(70935),v=_(27372);function c(b){switch(b.type){case"sendMsg":return p(b);case"setCode":return C(b);case"reserve":return R(b);case"changeLibrary":return O(b);default:throw new Error(`Unknown action type ${b.type}`)}}f.storeOutAction=c;const d=247711853;function p(b){return F=>{F.storeUint(d,32).storeUint(b.mode,8).storeRef((0,w.beginCell)().store((0,h.storeMessageRelaxed)(b.outMsg)).endCell())}}const m=2907562126;function C(b){return F=>{F.storeUint(m,32).storeRef(b.newCode)}}const x=921090057;function R(b){return F=>{F.storeUint(x,32).storeUint(b.mode,8).store((0,E.storeCurrencyCollection)(b.currency))}}const S=653925844;function O(b){return F=>{F.storeUint(S,32).storeUint(b.mode,7).store((0,v.storeLibRef)(b.libRef))}}function M(b){const F=b.loadUint(32);if(F===d){const G=b.loadUint(8),ue=(0,h.loadMessageRelaxed)(b.loadRef().beginParse());return{type:"sendMsg",mode:G,outMsg:ue}}if(F===m)return{type:"setCode",newCode:b.loadRef()};if(F===x){const G=b.loadUint(8),ue=(0,E.loadCurrencyCollection)(b);return{type:"reserve",mode:G,currency:ue}}if(F===S){const G=b.loadUint(7),ue=(0,v.loadLibRef)(b);return{type:"changeLibrary",mode:G,libRef:ue}}throw new Error(`Unknown out action tag 0x${F.toString(16)}`)}f.loadOutAction=M;function k(b){const F=b.reduce((G,ue)=>(0,w.beginCell)().storeRef(G).store(c(ue)).endCell(),(0,w.beginCell)().endCell());return G=>{G.storeSlice(F.beginParse())}}f.storeOutList=k;function q(b){const F=[];for(;b.remainingRefs;){const G=b.loadRef();F.push(M(b)),b=G.beginParse()}return F.reverse()}f.loadOutList=q},10713:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.ReserveMode=void 0;var _;(function(h){h[h.THIS_AMOUNT=0]="THIS_AMOUNT",h[h.LEAVE_THIS_AMOUNT=1]="LEAVE_THIS_AMOUNT",h[h.AT_MOST_THIS_AMOUNT=2]="AT_MOST_THIS_AMOUNT",h[h.LEAVE_MAX_THIS_AMOUNT=3]="LEAVE_MAX_THIS_AMOUNT",h[h.BEFORE_BALANCE_PLUS_THIS_AMOUNT=4]="BEFORE_BALANCE_PLUS_THIS_AMOUNT",h[h.LEAVE_BBALANCE_PLUS_THIS_AMOUNT=5]="LEAVE_BBALANCE_PLUS_THIS_AMOUNT",h[h.BEFORE_BALANCE_MINUS_THIS_AMOUNT=12]="BEFORE_BALANCE_MINUS_THIS_AMOUNT",h[h.LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT=13]="LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT"})(_||(f.ReserveMode=_={}))},64345:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.SendMode=void 0;var _;(function(h){h[h.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",h[h.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",h[h.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",h[h.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",h[h.IGNORE_ERRORS=2]="IGNORE_ERRORS",h[h.NONE=0]="NONE"})(_||(f.SendMode=_={}))},46223:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeShardAccount=f.loadShardAccount=void 0;const h=_(44460),w=_(36805);function E(c){let d=c.loadRef(),p;if(!d.isExotic){let m=d.beginParse();m.loadBit()&&(p=(0,w.loadAccount)(m))}return{account:p,lastTransactionHash:c.loadUintBig(256),lastTransactionLt:c.loadUintBig(64)}}f.loadShardAccount=E;function v(c){return d=>{c.account?d.storeRef((0,h.beginCell)().storeBit(!0).store((0,w.storeAccount)(c.account))):d.storeRef((0,h.beginCell)().storeBit(!1)),d.storeUint(c.lastTransactionHash,256),d.storeUint(c.lastTransactionLt,64)}}f.storeShardAccount=v},61258:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeShardAccounts=f.loadShardAccounts=f.ShardAccountRefValue=void 0;const h=_(24201),w=_(38007),E=_(46223);f.ShardAccountRefValue={parse:d=>{let p=(0,w.loadDepthBalanceInfo)(d),m=(0,E.loadShardAccount)(d);return{depthBalanceInfo:p,shardAccount:m}},serialize(d,p){p.store((0,w.storeDepthBalanceInfo)(d.depthBalanceInfo)),p.store((0,E.storeShardAccount)(d.shardAccount))}};function v(d){return h.Dictionary.load(h.Dictionary.Keys.BigUint(256),f.ShardAccountRefValue,d)}f.loadShardAccounts=v;function c(d){return p=>{p.storeDict(d)}}f.storeShardAccounts=c},39586:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeShardIdent=f.loadShardIdent=void 0;function _(w){if(w.loadUint(2)!==0)throw Error("Invalid data");return{shardPrefixBits:w.loadUint(6),workchainId:w.loadInt(32),shardPrefix:w.loadUintBig(64)}}f.loadShardIdent=_;function h(w){return E=>{E.storeUint(0,2),E.storeUint(w.shardPrefixBits,6),E.storeInt(w.workchainId,32),E.storeUint(w.shardPrefix,64)}}f.storeShardIdent=h},62164:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.loadShardStateUnsplit=void 0;const h=_(15828),w=_(61258),E=_(39586);function v(c){if(c.loadUint(32)!==2418257890)throw Error("Invalid data");let d=c.loadInt(32),p=(0,E.loadShardIdent)(c),m=c.loadUint(32),C=c.loadUint(32),x=c.loadUint(32),R=c.loadUintBig(64),S=c.loadUint(32);c.loadRef();let O=c.loadBit(),M=c.loadRef(),k;M.isExotic||(k=(0,w.loadShardAccounts)(M.beginParse())),c.loadRef();let q=c.loadBit(),b=null;if(q){let F=c.loadRef();F.isExotic||(b=(0,h.loadMasterchainStateExtra)(F.beginParse()))}return{globalId:d,shardId:p,seqno:m,vertSeqNo:C,genUtime:x,genLt:R,minRefMcSeqno:S,beforeSplit:O,accounts:k,extras:b}}f.loadShardStateUnsplit=v},51319:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.SimpleLibraryValue=f.storeSimpleLibrary=f.loadSimpleLibrary=void 0;function _(w){return{public:w.loadBit(),root:w.loadRef()}}f.loadSimpleLibrary=_;function h(w){return E=>{E.storeBit(w.public),E.storeRef(w.root)}}f.storeSimpleLibrary=h,f.SimpleLibraryValue={serialize(w,E){h(w)(E)},parse(w){return _(w)}}},26312:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeSplitMergeInfo=f.loadSplitMergeInfo=void 0;function _(w){let E=w.loadUint(6),v=w.loadUint(6),c=w.loadUintBig(256),d=w.loadUintBig(256);return{currentShardPrefixLength:E,accountSplitDepth:v,thisAddress:c,siblingAddress:d}}f.loadSplitMergeInfo=_;function h(w){return E=>{E.storeUint(w.currentShardPrefixLength,6),E.storeUint(w.accountSplitDepth,6),E.storeUint(w.thisAddress,256),E.storeUint(w.siblingAddress,256)}}f.storeSplitMergeInfo=h},17669:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeStateInit=f.loadStateInit=void 0;const h=_(24201),w=_(51319),E=_(48210);function v(d){let p;d.loadBit()&&(p=d.loadUint(5));let m;d.loadBit()&&(m=(0,E.loadTickTock)(d));let C=d.loadMaybeRef(),x=d.loadMaybeRef(),R=d.loadDict(h.Dictionary.Keys.BigUint(256),w.SimpleLibraryValue);return R.size===0&&(R=void 0),{splitDepth:p,special:m,code:C,data:x,libraries:R}}f.loadStateInit=v;function c(d){return p=>{d.splitDepth!==null&&d.splitDepth!==void 0?(p.storeBit(!0),p.storeUint(d.splitDepth,5)):p.storeBit(!1),d.special!==null&&d.special!==void 0?(p.storeBit(!0),p.store((0,E.storeTickTock)(d.special))):p.storeBit(!1),p.storeMaybeRef(d.code),p.storeMaybeRef(d.data),p.storeDict(d.libraries)}}f.storeStateInit=c},11877:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeStorageExtraInfo=f.loadStorageExtraInfo=void 0;function _(w){let E=w.loadUint(3);if(E===0)return null;if(E===1)return{dictHash:w.loadUintBig(256)};throw new Error(`Invalid storage extra info header: ${E}`)}f.loadStorageExtraInfo=_;function h(w){return E=>{w===null||typeof w>"u"?E.storeUint(0,3):(E.storeUint(1,3),E.storeUint(w.dictHash,256))}}f.storeStorageExtraInfo=h},18503:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeStorageInfo=f.loadStorageInfo=void 0;const h=_(11877),w=_(42202);function E(c){return{used:(0,w.loadStorageUsed)(c),storageExtra:(0,h.loadStorageExtraInfo)(c),lastPaid:c.loadUint(32),duePayment:c.loadMaybeCoins()}}f.loadStorageInfo=E;function v(c){return d=>{d.store((0,w.storeStorageUsed)(c.used)),d.store((0,h.storeStorageExtraInfo)(c.storageExtra)),d.storeUint(c.lastPaid,32),d.storeMaybeCoins(c.duePayment)}}f.storeStorageInfo=v},42202:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeStorageUsed=f.loadStorageUsed=void 0;function _(w){return{cells:w.loadVarUintBig(3),bits:w.loadVarUintBig(3)}}f.loadStorageUsed=_;function h(w){return E=>{E.storeVarUint(w.cells,3),E.storeVarUint(w.bits,3)}}f.storeStorageUsed=h},48210:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTickTock=f.loadTickTock=void 0;function _(w){return{tick:w.loadBit(),tock:w.loadBit()}}f.loadTickTock=_;function h(w){return E=>{E.storeBit(w.tick),E.storeBit(w.tock)}}f.storeTickTock=h},59786:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTransaction=f.loadTransaction=void 0;const h=_(44460),w=_(24201),E=_(47051),v=_(70935),c=_(79273),d=_(72913),p=_(57110);function m(x){let R=x.asCell();if(x.loadUint(4)!==7)throw Error("Invalid data");let S=x.loadUintBig(256),O=x.loadUintBig(64),M=x.loadUintBig(256),k=x.loadUintBig(64),q=x.loadUint(32),b=x.loadUint(15),F=(0,E.loadAccountStatus)(x),G=(0,E.loadAccountStatus)(x),le=x.loadRef().beginParse(),X=le.loadBit()?(0,d.loadMessage)(le.loadRef().beginParse()):void 0,se=le.loadDict(w.Dictionary.Keys.Uint(15),d.MessageValue);le.endParse();let de=(0,v.loadCurrencyCollection)(x),ye=(0,c.loadHashUpdate)(x.loadRef().beginParse()),he=(0,p.loadTransactionDescription)(x.loadRef().beginParse());return{address:S,lt:O,prevTransactionHash:M,prevTransactionLt:k,now:q,outMessagesCount:b,oldStatus:F,endStatus:G,inMessage:X,outMessages:se,totalFees:de,stateUpdate:ye,description:he,raw:R,hash:()=>R.hash()}}f.loadTransaction=m;function C(x){return R=>{R.storeUint(7,4),R.storeUint(x.address,256),R.storeUint(x.lt,64),R.storeUint(x.prevTransactionHash,256),R.storeUint(x.prevTransactionLt,64),R.storeUint(x.now,32),R.storeUint(x.outMessagesCount,15),R.store((0,E.storeAccountStatus)(x.oldStatus)),R.store((0,E.storeAccountStatus)(x.endStatus));let S=(0,h.beginCell)();x.inMessage?(S.storeBit(!0),S.storeRef((0,h.beginCell)().store((0,d.storeMessage)(x.inMessage)))):S.storeBit(!1),S.storeDict(x.outMessages),R.storeRef(S),R.store((0,v.storeCurrencyCollection)(x.totalFees)),R.storeRef((0,h.beginCell)().store((0,c.storeHashUpdate)(x.stateUpdate))),R.storeRef((0,h.beginCell)().store((0,p.storeTransactionDescription)(x.description)))}}f.storeTransaction=C},93425:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTransactionActionPhase=f.loadTransactionActionPhase=void 0;const h=_(41923),w=_(42202);function E(c){let d=c.loadBit(),p=c.loadBit(),m=c.loadBit(),C=(0,h.loadAccountStatusChange)(c),x=c.loadBit()?c.loadCoins():void 0,R=c.loadBit()?c.loadCoins():void 0,S=c.loadInt(32),O=c.loadBit()?c.loadInt(32):void 0,M=c.loadUint(16),k=c.loadUint(16),q=c.loadUint(16),b=c.loadUint(16),F=c.loadUintBig(256),G=(0,w.loadStorageUsed)(c);return{success:d,valid:p,noFunds:m,statusChange:C,totalFwdFees:x,totalActionFees:R,resultCode:S,resultArg:O,totalActions:M,specActions:k,skippedActions:q,messagesCreated:b,actionListHash:F,totalMessageSize:G}}f.loadTransactionActionPhase=E;function v(c){return d=>{d.storeBit(c.success),d.storeBit(c.valid),d.storeBit(c.noFunds),d.store((0,h.storeAccountStatusChange)(c.statusChange)),d.storeMaybeCoins(c.totalFwdFees),d.storeMaybeCoins(c.totalActionFees),d.storeInt(c.resultCode,32),d.storeMaybeInt(c.resultArg,32),d.storeUint(c.totalActions,16),d.storeUint(c.specActions,16),d.storeUint(c.skippedActions,16),d.storeUint(c.messagesCreated,16),d.storeUint(c.actionListHash,256),d.store((0,w.storeStorageUsed)(c.totalMessageSize))}}f.storeTransactionActionPhase=v},56579:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTransactionBouncePhase=f.loadTransactionBouncePhase=void 0;const h=_(42202);function w(v){if(v.loadBit()){let c=(0,h.loadStorageUsed)(v),d=v.loadCoins(),p=v.loadCoins();return{type:"ok",messageSize:c,messageFees:d,forwardFees:p}}if(v.loadBit()){let c=(0,h.loadStorageUsed)(v),d=v.loadCoins();return{type:"no-funds",messageSize:c,requiredForwardFees:d}}return{type:"negative-funds"}}f.loadTransactionBouncePhase=w;function E(v){return c=>{if(v.type==="ok")c.storeBit(!0),c.store((0,h.storeStorageUsed)(v.messageSize)),c.storeCoins(v.messageFees),c.storeCoins(v.forwardFees);else if(v.type==="negative-funds")c.storeBit(!1),c.storeBit(!1);else if(v.type==="no-funds")c.storeBit(!1),c.storeBit(!0),c.store((0,h.storeStorageUsed)(v.messageSize)),c.storeCoins(v.requiredForwardFees);else throw new Error("Invalid TransactionBouncePhase type")}}f.storeTransactionBouncePhase=E},42446:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTransactionComputePhase=f.loadTransactionComputePhase=void 0;const h=_(44460),w=_(97176);function E(c){if(!c.loadBit())return{type:"skipped",reason:(0,w.loadComputeSkipReason)(c)};let d=c.loadBit(),p=c.loadBit(),m=c.loadBit(),C=c.loadCoins();const x=c.loadRef().beginParse();let R=x.loadVarUintBig(3),S=x.loadVarUintBig(3),O=x.loadBit()?x.loadVarUintBig(2):void 0,M=x.loadUint(8),k=x.loadInt(32),q=x.loadBit()?x.loadInt(32):void 0,b=x.loadUint(32),F=x.loadUintBig(256),G=x.loadUintBig(256);return{type:"vm",success:d,messageStateUsed:p,accountActivated:m,gasFees:C,gasUsed:R,gasLimit:S,gasCredit:O,mode:M,exitCode:k,exitArg:q,vmSteps:b,vmInitStateHash:F,vmFinalStateHash:G}}f.loadTransactionComputePhase=E;function v(c){return d=>{if(c.type==="skipped"){d.storeBit(0),d.store((0,w.storeComputeSkipReason)(c.reason));return}d.storeBit(1),d.storeBit(c.success),d.storeBit(c.messageStateUsed),d.storeBit(c.accountActivated),d.storeCoins(c.gasFees),d.storeRef((0,h.beginCell)().storeVarUint(c.gasUsed,3).storeVarUint(c.gasLimit,3).store(p=>c.gasCredit!==void 0&&c.gasCredit!==null?p.storeBit(1).storeVarUint(c.gasCredit,2):p.storeBit(0)).storeUint(c.mode,8).storeInt(c.exitCode,32).store(p=>c.exitArg!==void 0&&c.exitArg!==null?p.storeBit(1).storeInt(c.exitArg,32):p.storeBit(0)).storeUint(c.vmSteps,32).storeUint(c.vmInitStateHash,256).storeUint(c.vmFinalStateHash,256).endCell())}}f.storeTransactionComputePhase=v},93828:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTransactionCreditPhase=f.loadTransactionCreditPhase=void 0;const h=_(70935);function w(v){const c=v.loadBit()?v.loadCoins():void 0,d=(0,h.loadCurrencyCollection)(v);return{dueFeesColelcted:c,credit:d}}f.loadTransactionCreditPhase=w;function E(v){return c=>{v.dueFeesColelcted===null||v.dueFeesColelcted===void 0?c.storeBit(!1):(c.storeBit(!0),c.storeCoins(v.dueFeesColelcted)),c.store((0,h.storeCurrencyCollection)(v.credit))}}f.storeTransactionCreditPhase=E},57110:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTransactionDescription=f.loadTransactionDescription=void 0;const h=_(44460),w=_(26312),E=_(59786),v=_(93425),c=_(56579),d=_(42446),p=_(93828),m=_(85970);function C(R){let S=R.loadUint(4);if(S===0){const O=R.loadBit();let M;R.loadBit()&&(M=(0,m.loadTransactionStoragePhase)(R));let k;R.loadBit()&&(k=(0,p.loadTransactionCreditPhase)(R));let q=(0,d.loadTransactionComputePhase)(R),b;R.loadBit()&&(b=(0,v.loadTransactionActionPhase)(R.loadRef().beginParse()));let F=R.loadBit(),G;R.loadBit()&&(G=(0,c.loadTransactionBouncePhase)(R));const ue=R.loadBit();return{type:"generic",creditFirst:O,storagePhase:M,creditPhase:k,computePhase:q,actionPhase:b,bouncePhase:G,aborted:F,destroyed:ue}}if(S===1)return{type:"storage",storagePhase:(0,m.loadTransactionStoragePhase)(R)};if(S===2||S===3){const O=S===3;let M=(0,m.loadTransactionStoragePhase)(R),k=(0,d.loadTransactionComputePhase)(R),q;R.loadBit()&&(q=(0,v.loadTransactionActionPhase)(R.loadRef().beginParse()));const b=R.loadBit(),F=R.loadBit();return{type:"tick-tock",isTock:O,storagePhase:M,computePhase:k,actionPhase:q,aborted:b,destroyed:F}}if(S===4){let O=(0,w.loadSplitMergeInfo)(R),M;R.loadBit()&&(M=(0,m.loadTransactionStoragePhase)(R));let k=(0,d.loadTransactionComputePhase)(R),q;R.loadBit()&&(q=(0,v.loadTransactionActionPhase)(R.loadRef().beginParse()));const b=R.loadBit(),F=R.loadBit();return{type:"split-prepare",splitInfo:O,storagePhase:M,computePhase:k,actionPhase:q,aborted:b,destroyed:F}}if(S===5){let O=(0,w.loadSplitMergeInfo)(R),M=(0,E.loadTransaction)(R.loadRef().beginParse());const k=R.loadBit();return{type:"split-install",splitInfo:O,prepareTransaction:M,installed:k}}throw Error(`Unsupported transaction description type ${S}`)}f.loadTransactionDescription=C;function x(R){return S=>{if(R.type==="generic")S.storeUint(0,4),S.storeBit(R.creditFirst),R.storagePhase?(S.storeBit(!0),S.store((0,m.storeTransactionsStoragePhase)(R.storagePhase))):S.storeBit(!1),R.creditPhase?(S.storeBit(!0),S.store((0,p.storeTransactionCreditPhase)(R.creditPhase))):S.storeBit(!1),S.store((0,d.storeTransactionComputePhase)(R.computePhase)),R.actionPhase?(S.storeBit(!0),S.storeRef((0,h.beginCell)().store((0,v.storeTransactionActionPhase)(R.actionPhase)))):S.storeBit(!1),S.storeBit(R.aborted),R.bouncePhase?(S.storeBit(!0),S.store((0,c.storeTransactionBouncePhase)(R.bouncePhase))):S.storeBit(!1),S.storeBit(R.destroyed);else if(R.type==="storage")S.storeUint(1,4),S.store((0,m.storeTransactionsStoragePhase)(R.storagePhase));else if(R.type==="tick-tock")S.storeUint(R.isTock?3:2,4),S.store((0,m.storeTransactionsStoragePhase)(R.storagePhase)),S.store((0,d.storeTransactionComputePhase)(R.computePhase)),R.actionPhase?(S.storeBit(!0),S.storeRef((0,h.beginCell)().store((0,v.storeTransactionActionPhase)(R.actionPhase)))):S.storeBit(!1),S.storeBit(R.aborted),S.storeBit(R.destroyed);else if(R.type==="split-prepare")S.storeUint(4,4),S.store((0,w.storeSplitMergeInfo)(R.splitInfo)),R.storagePhase?(S.storeBit(!0),S.store((0,m.storeTransactionsStoragePhase)(R.storagePhase))):S.storeBit(!1),S.store((0,d.storeTransactionComputePhase)(R.computePhase)),R.actionPhase?(S.storeBit(!0),S.store((0,v.storeTransactionActionPhase)(R.actionPhase))):S.storeBit(!1),S.storeBit(R.aborted),S.storeBit(R.destroyed);else if(R.type==="split-install")S.storeUint(5,4),S.store((0,w.storeSplitMergeInfo)(R.splitInfo)),S.storeRef((0,h.beginCell)().store((0,E.storeTransaction)(R.prepareTransaction))),S.storeBit(R.installed);else throw Error(`Unsupported transaction description type ${R.type}`)}}f.storeTransactionDescription=x},85970:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeTransactionsStoragePhase=f.loadTransactionStoragePhase=void 0;const h=_(41923);function w(v){const c=v.loadCoins();let d;v.loadBit()&&(d=v.loadCoins());const p=(0,h.loadAccountStatusChange)(v);return{storageFeesCollected:c,storageFeesDue:d,statusChange:p}}f.loadTransactionStoragePhase=w;function E(v){return c=>{c.storeCoins(v.storageFeesCollected),v.storageFeesDue===null||v.storageFeesDue===void 0?c.storeBit(!1):(c.storeBit(!0),c.storeCoins(v.storageFeesDue)),c.store((0,h.storeAccountStatusChange)(v.statusChange))}}f.storeTransactionsStoragePhase=E},59209:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.loadSimpleLibrary=f.loadShardStateUnsplit=f.storeShardIdent=f.loadShardIdent=f.storeShardAccounts=f.loadShardAccounts=f.ShardAccountRefValue=f.storeShardAccount=f.loadShardAccount=f.ReserveMode=f.SendMode=f.storeMessageRelaxed=f.loadMessageRelaxed=f.storeMessage=f.loadMessage=f.loadMasterchainStateExtra=f.storeHashUpdate=f.loadHashUpdate=f.storeExtraCurrency=f.loadMaybeExtraCurrency=f.loadExtraCurrency=f.packExtraCurrencyDict=f.packExtraCurrencyCell=f.storeDepthBalanceInfo=f.loadDepthBalanceInfo=f.storeCurrencyCollection=f.loadCurrencyCollection=f.storeComputeSkipReason=f.loadComputeSkipReason=f.storeCommonMessageInfoRelaxed=f.loadCommonMessageInfoRelaxed=f.storeCommonMessageInfo=f.loadCommonMessageInfo=f.storeOutList=f.loadOutList=f.storeOutAction=f.loadOutAction=f.storeAccountStorage=f.loadAccountStorage=f.storeAccountStatusChange=f.loadAccountStatusChange=f.storeAccountStatus=f.loadAccountStatus=f.storeAccountState=f.loadAccountState=f.storeAccount=f.loadAccount=f.comment=f.external=f.internal=void 0,f.storeTransactionsStoragePhase=f.loadTransactionStoragePhase=f.storeTransactionDescription=f.loadTransactionDescription=f.storeTransactionCreditPhase=f.loadTransactionCreditPhase=f.storeTransactionComputePhase=f.loadTransactionComputePhase=f.storeTransactionBouncePhase=f.loadTransactionBouncePhase=f.storeTransactionActionPhase=f.loadTransactionActionPhase=f.storeTransaction=f.loadTransaction=f.storeTickTock=f.loadTickTock=f.storeStorageUsed=f.loadStorageUsed=f.storeStorageInfo=f.loadStorageInfo=f.storeStateInit=f.loadStateInit=f.storeSplitMergeInfo=f.loadSplitMergeInfo=f.storeLibRef=f.loadLibRef=f.storeSimpleLibrary=void 0;var h=_(5154);Object.defineProperty(f,"internal",{enumerable:!0,get:function(){return h.internal}}),Object.defineProperty(f,"external",{enumerable:!0,get:function(){return h.external}}),Object.defineProperty(f,"comment",{enumerable:!0,get:function(){return h.comment}});var w=_(36805);Object.defineProperty(f,"loadAccount",{enumerable:!0,get:function(){return w.loadAccount}}),Object.defineProperty(f,"storeAccount",{enumerable:!0,get:function(){return w.storeAccount}});var E=_(71540);Object.defineProperty(f,"loadAccountState",{enumerable:!0,get:function(){return E.loadAccountState}}),Object.defineProperty(f,"storeAccountState",{enumerable:!0,get:function(){return E.storeAccountState}});var v=_(47051);Object.defineProperty(f,"loadAccountStatus",{enumerable:!0,get:function(){return v.loadAccountStatus}}),Object.defineProperty(f,"storeAccountStatus",{enumerable:!0,get:function(){return v.storeAccountStatus}});var c=_(41923);Object.defineProperty(f,"loadAccountStatusChange",{enumerable:!0,get:function(){return c.loadAccountStatusChange}}),Object.defineProperty(f,"storeAccountStatusChange",{enumerable:!0,get:function(){return c.storeAccountStatusChange}});var d=_(41404);Object.defineProperty(f,"loadAccountStorage",{enumerable:!0,get:function(){return d.loadAccountStorage}}),Object.defineProperty(f,"storeAccountStorage",{enumerable:!0,get:function(){return d.storeAccountStorage}});var p=_(45326);Object.defineProperty(f,"loadOutAction",{enumerable:!0,get:function(){return p.loadOutAction}}),Object.defineProperty(f,"storeOutAction",{enumerable:!0,get:function(){return p.storeOutAction}}),Object.defineProperty(f,"loadOutList",{enumerable:!0,get:function(){return p.loadOutList}}),Object.defineProperty(f,"storeOutList",{enumerable:!0,get:function(){return p.storeOutList}});var m=_(61038);Object.defineProperty(f,"loadCommonMessageInfo",{enumerable:!0,get:function(){return m.loadCommonMessageInfo}}),Object.defineProperty(f,"storeCommonMessageInfo",{enumerable:!0,get:function(){return m.storeCommonMessageInfo}});var C=_(12688);Object.defineProperty(f,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return C.loadCommonMessageInfoRelaxed}}),Object.defineProperty(f,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return C.storeCommonMessageInfoRelaxed}});var x=_(97176);Object.defineProperty(f,"loadComputeSkipReason",{enumerable:!0,get:function(){return x.loadComputeSkipReason}}),Object.defineProperty(f,"storeComputeSkipReason",{enumerable:!0,get:function(){return x.storeComputeSkipReason}});var R=_(70935);Object.defineProperty(f,"loadCurrencyCollection",{enumerable:!0,get:function(){return R.loadCurrencyCollection}}),Object.defineProperty(f,"storeCurrencyCollection",{enumerable:!0,get:function(){return R.storeCurrencyCollection}});var S=_(38007);Object.defineProperty(f,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return S.loadDepthBalanceInfo}}),Object.defineProperty(f,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return S.storeDepthBalanceInfo}});var O=_(90879);Object.defineProperty(f,"packExtraCurrencyCell",{enumerable:!0,get:function(){return O.packExtraCurrencyCell}}),Object.defineProperty(f,"packExtraCurrencyDict",{enumerable:!0,get:function(){return O.packExtraCurrencyDict}}),Object.defineProperty(f,"loadExtraCurrency",{enumerable:!0,get:function(){return O.loadExtraCurrency}}),Object.defineProperty(f,"loadMaybeExtraCurrency",{enumerable:!0,get:function(){return O.loadMaybeExtraCurrency}}),Object.defineProperty(f,"storeExtraCurrency",{enumerable:!0,get:function(){return O.storeExtraCurrency}});var M=_(79273);Object.defineProperty(f,"loadHashUpdate",{enumerable:!0,get:function(){return M.loadHashUpdate}}),Object.defineProperty(f,"storeHashUpdate",{enumerable:!0,get:function(){return M.storeHashUpdate}});var k=_(15828);Object.defineProperty(f,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return k.loadMasterchainStateExtra}});var q=_(72913);Object.defineProperty(f,"loadMessage",{enumerable:!0,get:function(){return q.loadMessage}}),Object.defineProperty(f,"storeMessage",{enumerable:!0,get:function(){return q.storeMessage}});var b=_(92374);Object.defineProperty(f,"loadMessageRelaxed",{enumerable:!0,get:function(){return b.loadMessageRelaxed}}),Object.defineProperty(f,"storeMessageRelaxed",{enumerable:!0,get:function(){return b.storeMessageRelaxed}});var F=_(64345);Object.defineProperty(f,"SendMode",{enumerable:!0,get:function(){return F.SendMode}});var G=_(10713);Object.defineProperty(f,"ReserveMode",{enumerable:!0,get:function(){return G.ReserveMode}});var ue=_(46223);Object.defineProperty(f,"loadShardAccount",{enumerable:!0,get:function(){return ue.loadShardAccount}}),Object.defineProperty(f,"storeShardAccount",{enumerable:!0,get:function(){return ue.storeShardAccount}});var le=_(61258);Object.defineProperty(f,"ShardAccountRefValue",{enumerable:!0,get:function(){return le.ShardAccountRefValue}}),Object.defineProperty(f,"loadShardAccounts",{enumerable:!0,get:function(){return le.loadShardAccounts}}),Object.defineProperty(f,"storeShardAccounts",{enumerable:!0,get:function(){return le.storeShardAccounts}});var X=_(39586);Object.defineProperty(f,"loadShardIdent",{enumerable:!0,get:function(){return X.loadShardIdent}}),Object.defineProperty(f,"storeShardIdent",{enumerable:!0,get:function(){return X.storeShardIdent}});var se=_(62164);Object.defineProperty(f,"loadShardStateUnsplit",{enumerable:!0,get:function(){return se.loadShardStateUnsplit}});var de=_(51319);Object.defineProperty(f,"loadSimpleLibrary",{enumerable:!0,get:function(){return de.loadSimpleLibrary}}),Object.defineProperty(f,"storeSimpleLibrary",{enumerable:!0,get:function(){return de.storeSimpleLibrary}});var ye=_(27372);Object.defineProperty(f,"loadLibRef",{enumerable:!0,get:function(){return ye.loadLibRef}}),Object.defineProperty(f,"storeLibRef",{enumerable:!0,get:function(){return ye.storeLibRef}});var he=_(26312);Object.defineProperty(f,"loadSplitMergeInfo",{enumerable:!0,get:function(){return he.loadSplitMergeInfo}}),Object.defineProperty(f,"storeSplitMergeInfo",{enumerable:!0,get:function(){return he.storeSplitMergeInfo}});var K=_(17669);Object.defineProperty(f,"loadStateInit",{enumerable:!0,get:function(){return K.loadStateInit}}),Object.defineProperty(f,"storeStateInit",{enumerable:!0,get:function(){return K.storeStateInit}});var B=_(18503);Object.defineProperty(f,"loadStorageInfo",{enumerable:!0,get:function(){return B.loadStorageInfo}}),Object.defineProperty(f,"storeStorageInfo",{enumerable:!0,get:function(){return B.storeStorageInfo}});var L=_(42202);Object.defineProperty(f,"loadStorageUsed",{enumerable:!0,get:function(){return L.loadStorageUsed}}),Object.defineProperty(f,"storeStorageUsed",{enumerable:!0,get:function(){return L.storeStorageUsed}});var $=_(48210);Object.defineProperty(f,"loadTickTock",{enumerable:!0,get:function(){return $.loadTickTock}}),Object.defineProperty(f,"storeTickTock",{enumerable:!0,get:function(){return $.storeTickTock}});var T=_(59786);Object.defineProperty(f,"loadTransaction",{enumerable:!0,get:function(){return T.loadTransaction}}),Object.defineProperty(f,"storeTransaction",{enumerable:!0,get:function(){return T.storeTransaction}});var N=_(93425);Object.defineProperty(f,"loadTransactionActionPhase",{enumerable:!0,get:function(){return N.loadTransactionActionPhase}}),Object.defineProperty(f,"storeTransactionActionPhase",{enumerable:!0,get:function(){return N.storeTransactionActionPhase}});var j=_(56579);Object.defineProperty(f,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return j.loadTransactionBouncePhase}}),Object.defineProperty(f,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return j.storeTransactionBouncePhase}});var Y=_(42446);Object.defineProperty(f,"loadTransactionComputePhase",{enumerable:!0,get:function(){return Y.loadTransactionComputePhase}}),Object.defineProperty(f,"storeTransactionComputePhase",{enumerable:!0,get:function(){return Y.storeTransactionComputePhase}});var Z=_(93828);Object.defineProperty(f,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return Z.loadTransactionCreditPhase}}),Object.defineProperty(f,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return Z.storeTransactionCreditPhase}});var z=_(57110);Object.defineProperty(f,"loadTransactionDescription",{enumerable:!0,get:function(){return z.loadTransactionDescription}}),Object.defineProperty(f,"storeTransactionDescription",{enumerable:!0,get:function(){return z.storeTransactionDescription}});var fe=_(85970);Object.defineProperty(f,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return fe.loadTransactionStoragePhase}}),Object.defineProperty(f,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return fe.storeTransactionsStoragePhase}})},5154:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.comment=f.external=f.internal=void 0;const h=_(82483),w=_(48587),E=_(44460),v=_(69329),c=_(90879);function d(C){let x=!0;C.bounce!==null&&C.bounce!==void 0&&(x=C.bounce);let R;if(typeof C.to=="string")R=h.Address.parse(C.to);else if(h.Address.isAddress(C.to))R=C.to;else throw new Error(`Invalid address ${C.to}`);let S;typeof C.value=="string"?S=(0,v.toNano)(C.value):S=C.value;let O;C.extracurrency&&(O=(0,c.packExtraCurrencyDict)(C.extracurrency));let M=w.Cell.EMPTY;return typeof C.body=="string"?M=(0,E.beginCell)().storeUint(0,32).storeStringTail(C.body).endCell():C.body&&(M=C.body),{info:{type:"internal",dest:R,value:{coins:S,other:O},bounce:x,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:C.init??void 0,body:M}}f.internal=d;function p(C){let x;if(typeof C.to=="string")x=h.Address.parse(C.to);else if(h.Address.isAddress(C.to))x=C.to;else throw new Error(`Invalid address ${C.to}`);return{info:{type:"external-in",dest:x,importFee:0n},init:C.init??void 0,body:C.body||w.Cell.EMPTY}}f.external=p;function m(C){return(0,E.beginCell)().storeUint(0,32).storeStringTail(C).endCell()}f.comment=m},4988:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.base32Decode=f.base32Encode=void 0;const w="abcdefghijklmnopqrstuvwxyz234567";function E(d){const p=d.byteLength;let m=0,C=0,x="";for(let R=0;R<p;R++)for(C=C<<8|d[R],m+=8;m>=5;)x+=w[C>>>m-5&31],m-=5;return m>0&&(x+=w[C<<5-m&31]),x}f.base32Encode=E;function v(d,p){const m=d.indexOf(p);if(m===-1)throw new Error("Invalid character found: "+p);return m}function c(d){let p;p=d.toLowerCase();const{length:m}=p;let C=0,x=0,R=0;const S=h.alloc(m*5/8|0);for(let O=0;O<m;O++)x=x<<5|v(w,p[O]),C+=5,C>=8&&(S[R++]=x>>>C-8&255,C-=8);return S}f.base32Decode=c},55044:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.bitsForNumber=void 0;function _(h,w){let E=BigInt(h);if(w==="int")return E===0n||E===-1n?1:(E>0?E:-E).toString(2).length+1;if(w==="uint"){if(E<0)throw Error(`value is negative. Got ${h}`);return E.toString(2).length}else throw Error(`invalid mode. Got ${w}`)}f.bitsForNumber=_},69329:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.fromNano=f.toNano=void 0;function _(w){if(typeof w=="bigint")return w*1000000000n;{if(typeof w=="number"){if(!Number.isFinite(w))throw Error("Invalid number");if(Math.log10(w)<=6)w=w.toLocaleString("en",{minimumFractionDigits:9,useGrouping:!1});else if(w-Math.trunc(w)===0)w=w.toLocaleString("en",{maximumFractionDigits:0,useGrouping:!1});else throw Error("Not enough precision for a number value. Use string value instead")}let E=!1;for(;w.startsWith("-");)E=!E,w=w.slice(1);if(w===".")throw Error("Invalid number");let v=w.split(".");if(v.length>2)throw Error("Invalid number");let c=v[0],d=v[1];if(c||(c="0"),d||(d="0"),d.length>9)throw Error("Invalid number");for(;d.length<9;)d+="0";let p=BigInt(c)*1000000000n+BigInt(d);return E&&(p=-p),p}}f.toNano=_;function h(w){let E=BigInt(w),v=!1;E<0&&(v=!0,E=-E);let d=(E%1000000000n).toString();for(;d.length<9;)d="0"+d;d=d.match(/^([0-9]*[1-9]|0)(0*)/)[1];let C=`${(E/1000000000n).toString()}${d==="0"?"":`.${d}`}`;return v&&(C="-"+C),C}f.fromNano=h},33475:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.crc16=void 0;function w(E){let c=0;const d=h.alloc(E.length+2);d.set(E);for(let p of d){let m=128;for(;m>0;)c<<=1,p&m&&(c+=1),m>>=1,c>65535&&(c&=65535,c^=4129)}return h.from([Math.floor(c/256),c%256])}f.crc16=w},88224:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.crc32c=void 0;const w=2197175160;function E(v){let c=-1;for(let p=0;p<v.length;p++)c^=v[p],c=c&1?c>>>1^w:c>>>1,c=c&1?c>>>1^w:c>>>1,c=c&1?c>>>1^w:c>>>1,c=c&1?c>>>1^w:c>>>1,c=c&1?c>>>1^w:c>>>1,c=c&1?c>>>1^w:c>>>1,c=c&1?c>>>1^w:c>>>1,c=c&1?c>>>1^w:c>>>1;c=c^4294967295;let d=h.alloc(4);return d.writeInt32LE(c),d}f.crc32c=E},44238:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.getMethodId=void 0;const w=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);function E(c){c instanceof h||(c=h.from(c));let d=0;for(let p=0;p<c.length;p++){const m=c[p];d=(w[(d>>8^m)&255]^d<<8)&65535}return d}function v(c){return E(c)&65535|65536}f.getMethodId=v},12080:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.sha512=f.sha256=f.pbkdf2_sha512=f.hmac_sha512=f.getSecureRandomWords=f.getSecureRandomBytes=void 0;var h=_(94817);Object.defineProperty(f,"getSecureRandomBytes",{enumerable:!0,get:function(){return h.getSecureRandomBytes}}),Object.defineProperty(f,"getSecureRandomWords",{enumerable:!0,get:function(){return h.getSecureRandomWords}});var w=_(4777);Object.defineProperty(f,"hmac_sha512",{enumerable:!0,get:function(){return w.hmac_sha512}});var E=_(78687);Object.defineProperty(f,"pbkdf2_sha512",{enumerable:!0,get:function(){return E.pbkdf2_sha512}});var v=_(50824);Object.defineProperty(f,"sha256",{enumerable:!0,get:function(){return v.sha256}});var c=_(36125);Object.defineProperty(f,"sha512",{enumerable:!0,get:function(){return c.sha512}})},94817:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.getSecureRandomWords=f.getSecureRandomBytes=void 0;function w(v){return h.from(self.crypto.getRandomValues(new Uint8Array(v)))}f.getSecureRandomBytes=w;function E(v){return self.crypto.getRandomValues(new Uint16Array(v))}f.getSecureRandomWords=E},4777:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.hmac_sha512=void 0;async function w(E,v){let c=typeof E=="string"?h.from(E,"utf-8"):E,d=typeof v=="string"?h.from(v,"utf-8"):v;const p={name:"HMAC",hash:"SHA-512"},m=await self.crypto.subtle.importKey("raw",c,p,!1,["sign"]);return h.from(await crypto.subtle.sign(p,m,d))}f.hmac_sha512=w},78687:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.pbkdf2_sha512=void 0;async function w(E,v,c,d){const p=typeof E=="string"?h.from(E,"utf-8"):E,m=typeof v=="string"?h.from(v,"utf-8"):v,C=await self.crypto.subtle.importKey("raw",p,{name:"PBKDF2"},!1,["deriveBits"]),x=await self.crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:m,iterations:c},C,d*8);return h.from(x)}f.pbkdf2_sha512=w},50824:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.sha256=void 0;async function w(E){return typeof E=="string"?h.from(await crypto.subtle.digest("SHA-256",h.from(E,"utf-8"))):h.from(await crypto.subtle.digest("SHA-256",E))}f.sha256=w},36125:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.sha512=void 0;async function w(E){return typeof E=="string"?h.from(await crypto.subtle.digest("SHA-512",h.from(E,"utf-8"))):h.from(await crypto.subtle.digest("SHA-512",E))}f.sha512=w},94123:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.deriveEd25519Path=f.deriveED25519HardenedKey=f.getED25519MasterKeyFromSeed=void 0;const w=_(11258),E="ed25519 seed",v=2147483648;async function c(m){const C=await(0,w.hmac_sha512)(E,m),x=C.slice(0,32),R=C.slice(32);return{key:x,chainCode:R}}f.getED25519MasterKeyFromSeed=c;async function d(m,C){if(C>=v)throw Error("Key index must be less than offset");const x=h.alloc(4);x.writeUInt32BE(C+v,0);const R=h.concat([h.alloc(1,0),m.key,x]),S=await(0,w.hmac_sha512)(m.chainCode,R),O=S.slice(0,32),M=S.slice(32);return{key:O,chainCode:M}}f.deriveED25519HardenedKey=d;async function p(m,C){let x=await c(m),R=[...C];for(;R.length>0;){let S=R[0];R=R.slice(1),x=await d(x,S)}return x.key}f.deriveEd25519Path=p},36931:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.deriveMnemonicsPath=f.deriveMnemonicHardenedKey=f.getMnemonicsMasterKeyFromSeed=void 0;const w=_(32600),E=_(11258),v=2147483648,c="TON Mnemonics HD seed";async function d(C){const x=await(0,E.hmac_sha512)(c,C),R=x.slice(0,32),S=x.slice(32);return{key:R,chainCode:S}}f.getMnemonicsMasterKeyFromSeed=d;async function p(C,x){if(x>=v)throw Error("Key index must be less than offset");const R=h.alloc(4);R.writeUInt32BE(x+v,0);const S=h.concat([h.alloc(1,0),C.key,R]),O=await(0,E.hmac_sha512)(C.chainCode,S),M=O.slice(0,32),k=O.slice(32);return{key:M,chainCode:k}}f.deriveMnemonicHardenedKey=p;async function m(C,x,R=24,S){let O=await d(C),M=[...x];for(;M.length>0;){let k=M[0];M=M.slice(1),O=await p(O,k)}return await(0,w.mnemonicFromRandomSeed)(O.key,R,S)}f.deriveMnemonicsPath=m},30089:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.deriveSymmetricPath=f.deriveSymmetricHardenedKey=f.getSymmetricMasterKeyFromSeed=void 0;const w=_(11258),E="Symmetric key seed";async function v(p){const m=await(0,w.hmac_sha512)(E,p),C=m.slice(32),x=m.slice(0,32);return{key:C,chainCode:x}}f.getSymmetricMasterKeyFromSeed=v;async function c(p,m){const C=h.concat([h.alloc(1,0),h.from(m)]),x=await(0,w.hmac_sha512)(p.chainCode,C),R=x.slice(32),S=x.slice(0,32);return{key:R,chainCode:S}}f.deriveSymmetricHardenedKey=c;async function d(p,m){let C=await v(p),x=[...m];for(;x.length>0;){let R=x[0];x=x.slice(1),C=await c(C,R)}return C.key}f.deriveSymmetricPath=d},88473:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getMnemonicsMasterKeyFromSeed=f.deriveMnemonicHardenedKey=f.deriveMnemonicsPath=f.deriveSymmetricPath=f.deriveSymmetricHardenedKey=f.getSymmetricMasterKeyFromSeed=f.deriveEd25519Path=f.deriveED25519HardenedKey=f.getED25519MasterKeyFromSeed=f.signVerify=f.sign=f.keyPairFromSecretKey=f.keyPairFromSeed=f.openBox=f.sealBox=f.mnemonicWordList=f.mnemonicToHDSeed=f.mnemonicToSeed=f.mnemonicToWalletKey=f.mnemonicToPrivateKey=f.mnemonicValidate=f.mnemonicNew=f.newSecurePassphrase=f.newSecureWords=f.getSecureRandomNumber=f.getSecureRandomWords=f.getSecureRandomBytes=f.hmac_sha512=f.pbkdf2_sha512=f.sha512_sync=f.sha512=f.sha256_sync=f.sha256=void 0;var h=_(80825);Object.defineProperty(f,"sha256",{enumerable:!0,get:function(){return h.sha256}}),Object.defineProperty(f,"sha256_sync",{enumerable:!0,get:function(){return h.sha256_sync}});var w=_(22332);Object.defineProperty(f,"sha512",{enumerable:!0,get:function(){return w.sha512}}),Object.defineProperty(f,"sha512_sync",{enumerable:!0,get:function(){return w.sha512_sync}});var E=_(17572);Object.defineProperty(f,"pbkdf2_sha512",{enumerable:!0,get:function(){return E.pbkdf2_sha512}});var v=_(11258);Object.defineProperty(f,"hmac_sha512",{enumerable:!0,get:function(){return v.hmac_sha512}});var c=_(66542);Object.defineProperty(f,"getSecureRandomBytes",{enumerable:!0,get:function(){return c.getSecureRandomBytes}}),Object.defineProperty(f,"getSecureRandomWords",{enumerable:!0,get:function(){return c.getSecureRandomWords}}),Object.defineProperty(f,"getSecureRandomNumber",{enumerable:!0,get:function(){return c.getSecureRandomNumber}});var d=_(71242);Object.defineProperty(f,"newSecureWords",{enumerable:!0,get:function(){return d.newSecureWords}});var p=_(52187);Object.defineProperty(f,"newSecurePassphrase",{enumerable:!0,get:function(){return p.newSecurePassphrase}});var m=_(32600);Object.defineProperty(f,"mnemonicNew",{enumerable:!0,get:function(){return m.mnemonicNew}}),Object.defineProperty(f,"mnemonicValidate",{enumerable:!0,get:function(){return m.mnemonicValidate}}),Object.defineProperty(f,"mnemonicToPrivateKey",{enumerable:!0,get:function(){return m.mnemonicToPrivateKey}}),Object.defineProperty(f,"mnemonicToWalletKey",{enumerable:!0,get:function(){return m.mnemonicToWalletKey}}),Object.defineProperty(f,"mnemonicToSeed",{enumerable:!0,get:function(){return m.mnemonicToSeed}}),Object.defineProperty(f,"mnemonicToHDSeed",{enumerable:!0,get:function(){return m.mnemonicToHDSeed}});var C=_(95648);Object.defineProperty(f,"mnemonicWordList",{enumerable:!0,get:function(){return C.wordlist}});var x=_(83704);Object.defineProperty(f,"sealBox",{enumerable:!0,get:function(){return x.sealBox}}),Object.defineProperty(f,"openBox",{enumerable:!0,get:function(){return x.openBox}});var R=_(83704);Object.defineProperty(f,"keyPairFromSeed",{enumerable:!0,get:function(){return R.keyPairFromSeed}}),Object.defineProperty(f,"keyPairFromSecretKey",{enumerable:!0,get:function(){return R.keyPairFromSecretKey}}),Object.defineProperty(f,"sign",{enumerable:!0,get:function(){return R.sign}}),Object.defineProperty(f,"signVerify",{enumerable:!0,get:function(){return R.signVerify}});var S=_(94123);Object.defineProperty(f,"getED25519MasterKeyFromSeed",{enumerable:!0,get:function(){return S.getED25519MasterKeyFromSeed}}),Object.defineProperty(f,"deriveED25519HardenedKey",{enumerable:!0,get:function(){return S.deriveED25519HardenedKey}}),Object.defineProperty(f,"deriveEd25519Path",{enumerable:!0,get:function(){return S.deriveEd25519Path}});var O=_(30089);Object.defineProperty(f,"getSymmetricMasterKeyFromSeed",{enumerable:!0,get:function(){return O.getSymmetricMasterKeyFromSeed}}),Object.defineProperty(f,"deriveSymmetricHardenedKey",{enumerable:!0,get:function(){return O.deriveSymmetricHardenedKey}}),Object.defineProperty(f,"deriveSymmetricPath",{enumerable:!0,get:function(){return O.deriveSymmetricPath}});var M=_(36931);Object.defineProperty(f,"deriveMnemonicsPath",{enumerable:!0,get:function(){return M.deriveMnemonicsPath}}),Object.defineProperty(f,"deriveMnemonicHardenedKey",{enumerable:!0,get:function(){return M.deriveMnemonicHardenedKey}}),Object.defineProperty(f,"getMnemonicsMasterKeyFromSeed",{enumerable:!0,get:function(){return M.getMnemonicsMasterKeyFromSeed}})},32600:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__importDefault||function(ye){return ye&&ye.__esModule?ye:{default:ye}};Object.defineProperty(f,"__esModule",{value:!0}),f.mnemonicFromRandomSeed=f.mnemonicIndexesToBytes=f.bytesToMnemonics=f.bytesToMnemonicIndexes=f.mnemonicNew=f.mnemonicValidate=f.mnemonicToHDSeed=f.mnemonicToWalletKey=f.mnemonicToPrivateKey=f.mnemonicToSeed=f.mnemonicToEntropy=void 0;const E=w(_(18861)),v=_(66542),c=_(11258),d=_(17572),p=_(17926),m=_(95648),C=1e5;async function x(ye){const he=await M(ye);return await O(he)&&!await S(he)}function R(ye){return ye.map(he=>he.toLowerCase().trim())}async function S(ye){return(await(0,d.pbkdf2_sha512)(ye,"TON seed version",Math.max(1,Math.floor(C/256)),64))[0]==0}async function O(ye){return(await(0,d.pbkdf2_sha512)(ye,"TON fast seed version",1,64))[0]==1}async function M(ye,he){return await(0,c.hmac_sha512)(ye.join(" "),he&&he.length>0?he:"")}f.mnemonicToEntropy=M;async function k(ye,he,K){const B=await M(ye,K);return await(0,d.pbkdf2_sha512)(B,he,C,64)}f.mnemonicToSeed=k;async function q(ye,he){ye=R(ye);const K=await k(ye,"TON default seed",he);let B=E.default.sign.keyPair.fromSeed(K.slice(0,32));return{publicKey:h.from(B.publicKey),secretKey:h.from(B.secretKey)}}f.mnemonicToPrivateKey=q;async function b(ye,he){let B=(await q(ye,he)).secretKey.slice(0,32);const L=E.default.sign.keyPair.fromSeed(B);return{publicKey:h.from(L.publicKey),secretKey:h.from(L.secretKey)}}f.mnemonicToWalletKey=b;async function F(ye,he){return ye=R(ye),await k(ye,"TON HD Keys seed",he)}f.mnemonicToHDSeed=F;async function G(ye,he){ye=R(ye);for(let K of ye)if(m.wordlist.indexOf(K)<0)return!1;return he&&he.length>0&&!await x(ye)?!1:await S(await M(ye,he))}f.mnemonicValidate=G;async function ue(ye=24,he){let K=[];for(;;){K=[];for(let B=0;B<ye;B++){let L=await(0,v.getSecureRandomNumber)(0,m.wordlist.length);K.push(m.wordlist[L])}if(!(he&&he.length>0&&!await x(K))&&await S(await M(K,he)))break}return K}f.mnemonicNew=ue;function le(ye,he){let K=(0,p.bytesToBits)(ye),B=[];for(let L=0;L<he;L++){let $=K.slice(L*11,L*11+11);B.push(parseInt($,2))}return B}f.bytesToMnemonicIndexes=le;function X(ye,he){let K=le(ye,he),B=[];for(let L of K)B.push(m.wordlist[L]);return B}f.bytesToMnemonics=X;function se(ye){let he="";for(let K of ye){if(!Number.isSafeInteger(K)||K<0||K>=2028)throw Error("Invalid input");he+=(0,p.lpad)(K.toString(2),"0",11)}for(;he.length%8!==0;)he=he+"0";return(0,p.bitsToBytes)(he)}f.mnemonicIndexesToBytes=se;async function de(ye,he=24,K){const B=Math.ceil(he*11/8);let L=ye;for(;;){let $=await(0,d.pbkdf2_sha512)(L,"TON mnemonic seed",Math.max(1,Math.floor(C/256)),B),T=X($,he);if(await G(T,K))return T;L=$}}f.mnemonicFromRandomSeed=de},95648:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.wordlist=void 0;const _=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];f.wordlist=_},52187:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.newSecurePassphrase=void 0;const h=_(88473);async function w(E=6){return(await(0,h.newSecureWords)(E)).join("-")}f.newSecurePassphrase=w},71242:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.newSecureWords=void 0;const h=_(66542),w=_(44398);async function E(v=6){let c=[];for(let d=0;d<v;d++)c.push(w.wordlist[await(0,h.getSecureRandomNumber)(0,w.wordlist.length)]);return c}f.newSecureWords=E},44398:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.wordlist=void 0,f.wordlist=["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]},66542:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getSecureRandomNumber=f.getSecureRandomWords=f.getSecureRandomBytes=void 0;const h=_(12080);async function w(c){return(0,h.getSecureRandomBytes)(c)}f.getSecureRandomBytes=w;async function E(c){return E(c)}f.getSecureRandomWords=E;async function v(c,d){let p=d-c;var m=Math.ceil(Math.log2(p));if(m>53)throw new Error("Range is too large");for(var C=Math.ceil(m/8),x=Math.pow(2,m)-1;;){let S=await w(m),O=(C-1)*8,M=0;for(var R=0;R<C;R++)M+=S[R]*Math.pow(2,O),O-=8;if(M=M&x,!(M>=p))return c+M}}f.getSecureRandomNumber=v},11258:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(f,"__esModule",{value:!0}),f.hmac_sha512=f.hmac_sha512_fallback=void 0;const E=w(_(77308)),v=_(12080);async function c(p,m){let C=typeof p=="string"?h.from(p,"utf-8"):p,x=typeof m=="string"?h.from(m,"utf-8"):m;const R=new E.default("SHA-512","HEX",{hmacKey:{value:C.toString("hex"),format:"HEX"}});R.update(x.toString("hex"));const S=R.getHash("HEX");return h.from(S,"hex")}f.hmac_sha512_fallback=c;function d(p,m){return(0,v.hmac_sha512)(p,m)}f.hmac_sha512=d},83704:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(f,"__esModule",{value:!0}),f.openBox=f.sealBox=f.signVerify=f.sign=f.keyPairFromSeed=f.keyPairFromSecretKey=void 0;const E=w(_(18861));function v(x){let R=E.default.sign.keyPair.fromSecretKey(new Uint8Array(x));return{publicKey:h.from(R.publicKey),secretKey:h.from(R.secretKey)}}f.keyPairFromSecretKey=v;function c(x){let R=E.default.sign.keyPair.fromSeed(new Uint8Array(x));return{publicKey:h.from(R.publicKey),secretKey:h.from(R.secretKey)}}f.keyPairFromSeed=c;function d(x,R){return h.from(E.default.sign.detached(new Uint8Array(x),new Uint8Array(R)))}f.sign=d;function p(x,R,S){return E.default.sign.detached.verify(new Uint8Array(x),new Uint8Array(R),new Uint8Array(S))}f.signVerify=p;function m(x,R,S){return h.from(E.default.secretbox(x,R,S))}f.sealBox=m;function C(x,R,S){let O=E.default.secretbox.open(x,R,S);return O?h.from(O):null}f.openBox=C},17572:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.pbkdf2_sha512=void 0;const h=_(12080);function w(E,v,c,d){return(0,h.pbkdf2_sha512)(E,v,c,d)}f.pbkdf2_sha512=w},80825:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(f,"__esModule",{value:!0}),f.sha256=f.sha256_fallback=f.sha256_sync=void 0;const E=w(_(77308)),v=_(12080);function c(m){let C;typeof m=="string"?C=h.from(m,"utf-8").toString("hex"):C=m.toString("hex");let x=new E.default("SHA-256","HEX");x.update(C);let R=x.getHash("HEX");return h.from(R,"hex")}f.sha256_sync=c;async function d(m){return c(m)}f.sha256_fallback=d;function p(m){return(0,v.sha256)(m)}f.sha256=p},22332:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(f,"__esModule",{value:!0}),f.sha512=f.sha512_fallback=f.sha512_sync=void 0;const E=w(_(77308)),v=_(12080);function c(m){let C;typeof m=="string"?C=h.from(m,"utf-8").toString("hex"):C=m.toString("hex");let x=new E.default("SHA-512","HEX");x.update(C);let R=x.getHash("HEX");return h.from(R,"hex")}f.sha512_sync=c;async function d(m){return c(m)}f.sha512_fallback=d;async function p(m){return(0,v.sha512)(m)}f.sha512=p},17926:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.bitsToBytes=f.bytesToBits=f.lpad=void 0;function w(c,d,p){for(;c.length<p;)c=d+c;return c}f.lpad=w;function E(c){let d="";for(let p=0;p<c.length;p++){let m=c.at(p);d+=w(m.toString(2),"0",8)}return d}f.bytesToBits=E;function v(c){if(c.length%8!==0)throw Error("Uneven bits");let d=[];for(;c.length>0;)d.push(parseInt(c.slice(0,8),2)),c=c.slice(8);return h.from(d)}f.bitsToBytes=v},66564:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.TonClient=void 0;const w=_(76985),E=_(21224);class v{constructor(x){this.parameters={endpoint:x.endpoint},this.api=new w.HttpApi(this.parameters.endpoint,{timeout:x.timeout,apiKey:x.apiKey,adapter:x.httpAdapter})}async getBalance(x){return(await this.getContractState(x)).balance}async runMethod(x,R,S=[]){let O=await this.api.callGetMethod(x,R,S);if(O.exit_code!==0)throw Error("Unable to execute get method. Got exit_code: "+O.exit_code);return{gas_used:O.gas_used,stack:p(O.stack)}}async callGetMethod(x,R,S=[]){return this.runMethod(x,R,S)}async runMethodWithError(x,R,S=[]){let O=await this.api.callGetMethod(x,R,S);return{gas_used:O.gas_used,stack:p(O.stack),exit_code:O.exit_code}}async callGetMethodWithError(x,R,S=[]){return this.runMethodWithError(x,R,S)}async getTransactions(x,R){let S=await this.api.getTransactions(x,R),O=[];for(let M of S)O.push((0,E.loadTransaction)(E.Cell.fromBoc(h.from(M.data,"base64"))[0].beginParse()));return O}async getTransaction(x,R,S){let O=await this.api.getTransaction(x,R,S);return O?(0,E.loadTransaction)(E.Cell.fromBoc(h.from(O.data,"base64"))[0].beginParse()):null}async tryLocateResultTx(x,R,S){let O=await this.api.tryLocateResultTx(x,R,S);return(0,E.loadTransaction)(E.Cell.fromBase64(O.data).beginParse())}async tryLocateSourceTx(x,R,S){let O=await this.api.tryLocateSourceTx(x,R,S);return(0,E.loadTransaction)(E.Cell.fromBase64(O.data).beginParse())}async getMasterchainInfo(){let x=await this.api.getMasterchainInfo();return{workchain:x.init.workchain,shard:x.last.shard,initSeqno:x.init.seqno,latestSeqno:x.last.seqno}}async getWorkchainShards(x){return(await this.api.getShards(x)).map(S=>({workchain:S.workchain,shard:S.shard,seqno:S.seqno}))}async getShardTransactions(x,R,S){let O=await this.api.getBlockTransactions(x,R,S);if(O.incomplete)throw Error("Unsupported");return O.transactions.map(M=>({account:E.Address.parseRaw(M.account),lt:M.lt,hash:M.hash}))}async sendMessage(x){const R=(0,E.beginCell)().store((0,E.storeMessage)(x)).endCell().toBoc();await this.api.sendBoc(R)}async sendFile(x){await this.api.sendBoc(x)}async estimateExternalMessageFee(x,R){return await this.api.estimateFee(x,{body:R.body,initCode:R.initCode,initData:R.initData,ignoreSignature:R.ignoreSignature})}async sendExternalMessage(x,R){if(await this.isContractDeployed(x.address)||!x.init){const S=(0,E.external)({to:x.address,body:R});await this.sendMessage(S)}else{const S=(0,E.external)({to:x.address,init:x.init,body:R});await this.sendMessage(S)}}async isContractDeployed(x){return(await this.getContractState(x)).state==="active"}async getContractState(x){let R=await this.api.getAddressInformation(x),S=BigInt(R.balance),O=R.state;return{balance:S,extra_currencies:R.extra_currencies,state:O,code:R.code!==""?h.from(R.code,"base64"):null,data:R.data!==""?h.from(R.data,"base64"):null,lastTransaction:R.last_transaction_id.lt!=="0"?{lt:R.last_transaction_id.lt,hash:R.last_transaction_id.hash}:null,blockId:{workchain:R.block_id.workchain,shard:R.block_id.shard,seqno:R.block_id.seqno},timestampt:R.sync_utime}}open(x){return(0,E.openContract)(x,R=>m(this,R.address,R.init))}provider(x,R){return m(this,x,R??null)}}f.TonClient=v;function c(C){const x=C["@type"];switch(x){case"tvm.list":case"tvm.tuple":return C.elements.map(c);case"tvm.cell":return E.Cell.fromBoc(h.from(C.bytes,"base64"))[0];case"tvm.slice":return E.Cell.fromBoc(h.from(C.bytes,"base64"))[0];case"tvm.stackEntryCell":return c(C.cell);case"tvm.stackEntrySlice":return c(C.slice);case"tvm.stackEntryTuple":return c(C.tuple);case"tvm.stackEntryList":return c(C.list);case"tvm.stackEntryNumber":return c(C.number);case"tvm.numberDecimal":return BigInt(C.number);default:throw Error("Unsupported item type: "+x)}}function d(C){if(C[0]==="num"){let x=C[1];return x.startsWith("-")?{type:"int",value:-BigInt(x.slice(1))}:{type:"int",value:BigInt(x)}}else{if(C[0]==="null")return{type:"null"};if(C[0]==="cell")return{type:"cell",cell:E.Cell.fromBoc(h.from(C[1].bytes,"base64"))[0]};if(C[0]==="slice")return{type:"slice",cell:E.Cell.fromBoc(h.from(C[1].bytes,"base64"))[0]};if(C[0]==="builder")return{type:"builder",cell:E.Cell.fromBoc(h.from(C[1].bytes,"base64"))[0]};if(C[0]==="tuple"||C[0]==="list")return C[1].elements.length===0?{type:"null"}:{type:"tuple",items:C[1].elements.map(c)};throw Error("Unsupported stack item type: "+C[0])}}function p(C){let x=[];for(let R of C)x.push(d(R));return new E.TupleReader(x)}function m(C,x,R){return{async getState(){let S=await C.getContractState(x),O=S.balance,M=S.lastTransaction?{lt:BigInt(S.lastTransaction.lt),hash:h.from(S.lastTransaction.hash,"base64")}:null,k=null,q;if(S.state==="active")q={type:"active",code:S.code?S.code:null,data:S.data?S.data:null};else if(S.state==="uninitialized")q={type:"uninit"};else if(S.state==="frozen")q={type:"frozen",stateHash:h.alloc(0)};else throw Error("Unsupported state");if(S.extra_currencies&&S.extra_currencies.length>0){k={};for(let b of S.extra_currencies)k[b.id]=BigInt(b.amount)}return{balance:O,extracurrency:k,last:M,state:q}},async get(S,O){if(typeof S!="string")throw new Error("Method name must be a string for TonClient provider");return{stack:(await C.runMethod(x,S,O)).stack}},async external(S){let O=null;R&&!await C.isContractDeployed(x)&&(O=R);const M=(0,E.external)({to:x,init:O,body:S});let k=(0,E.beginCell)().store((0,E.storeMessage)(M)).endCell().toBoc();await C.sendFile(k)},async internal(S,O){let M=null;R&&!await C.isContractDeployed(x)&&(M=R);let k=!0;O.bounce!==null&&O.bounce!==void 0&&(k=O.bounce);let q;typeof O.value=="string"?q=(0,E.toNano)(O.value):q=O.value;let b=null;typeof O.body=="string"?b=(0,E.comment)(O.body):O.body&&(b=O.body),await S.send({to:x,value:q,bounce:k,sendMode:O.sendMode,extracurrency:O.extracurrency,init:M,body:b})},open(S){return(0,E.openContract)(S,O=>m(C,O.address,O.init??null))},getTransactions(S,O,M,k){return C.getTransactions(S,{limit:k??100,lt:O.toString(),hash:M.toString("base64"),inclusive:!0})}}}},95458:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__classPrivateFieldSet||function(te,H,Q,oe,_e){if(oe==="m")throw new TypeError("Private method is not writable");if(oe==="a"&&!_e)throw new TypeError("Private accessor was defined without a setter");if(typeof H=="function"?te!==H||!_e:!H.has(te))throw new TypeError("Cannot write private member to an object whose class did not declare it");return oe==="a"?_e.call(te,Q):_e?_e.value=Q:H.set(te,Q),Q},E=this&&this.__classPrivateFieldGet||function(te,H,Q,oe){if(Q==="a"&&!oe)throw new TypeError("Private accessor was defined without a getter");if(typeof H=="function"?te!==H||!oe:!H.has(te))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Q==="m"?oe:Q==="a"?oe.call(te):oe?oe.value:H.get(te)},v=this&&this.__importDefault||function(te){return te&&te.__esModule?te:{default:te}},c,d,p,m;Object.defineProperty(f,"__esModule",{value:!0}),f.TonClient4=void 0;const C=v(_(23966)),x=_(21224),R=_(74973),S=_(78211);class O{constructor(H){c.set(this,void 0),d.set(this,void 0),p.set(this,void 0),m.set(this,void 0),w(this,m,C.default.create(),"f"),w(this,c,H.endpoint,"f"),w(this,d,H.timeout||5e3,"f"),w(this,p,H.httpAdapter,"f"),H.requestInterceptor&&E(this,m,"f").interceptors.request.use(H.requestInterceptor)}async getLastBlock(){let H=await E(this,m,"f").get(E(this,c,"f")+"/block/latest",{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),Q=k.safeParse(H.data);if(!Q.success)throw Error("Mailformed response: "+Q.error.format()._errors.join(", "));return Q.data}async getBlock(H){let Q=await E(this,m,"f").get(E(this,c,"f")+"/block/"+H,{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),oe=q.safeParse(Q.data);if(!oe.success)throw Error("Mailformed response");if(!oe.data.exist)throw Error("Block is out of scope");return oe.data.block}async getBlockByUtime(H){let Q=await E(this,m,"f").get(E(this,c,"f")+"/block/utime/"+H,{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),oe=q.safeParse(Q.data);if(!oe.success)throw Error("Mailformed response");if(!oe.data.exist)throw Error("Block is out of scope");return oe.data.block}async getAccount(H,Q){let oe=await E(this,m,"f").get(E(this,c,"f")+"/block/"+H+"/"+Q.toString({urlSafe:!0}),{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),_e=F.safeParse(oe.data);if(!_e.success)throw Error("Mailformed response");return _e.data}async getAccountLite(H,Q){let oe=await E(this,m,"f").get(E(this,c,"f")+"/block/"+H+"/"+Q.toString({urlSafe:!0})+"/lite",{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),_e=G.safeParse(oe.data);if(!_e.success)throw Error("Mailformed response");return _e.data}async isContractDeployed(H,Q){return(await this.getAccountLite(H,Q)).account.state.type==="active"}async isAccountChanged(H,Q,oe){let _e=await E(this,m,"f").get(E(this,c,"f")+"/block/"+H+"/"+Q.toString({urlSafe:!0})+"/changed/"+oe.toString(10),{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),ge=ue.safeParse(_e.data);if(!ge.success)throw Error("Mailformed response");return ge.data}async getAccountTransactions(H,Q,oe){let _e=await E(this,m,"f").get(E(this,c,"f")+"/account/"+H.toString({urlSafe:!0})+"/tx/"+Q.toString(10)+"/"+(0,R.toUrlSafe)(oe.toString("base64")),{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),ge=ye.safeParse(_e.data);if(!ge.success)throw Error("Mailformed response");let be=ge.data,we=[],Ee=x.Cell.fromBoc(h.from(be.boc,"base64"));for(let me=0;me<be.blocks.length;me++)we.push({block:be.blocks[me],tx:(0,x.loadTransaction)(Ee[me].beginParse())});return we}async getAccountTransactionsParsed(H,Q,oe,_e=20){let ge=await E(this,m,"f").get(E(this,c,"f")+"/account/"+H.toString({urlSafe:!0})+"/tx/parsed/"+Q.toString(10)+"/"+(0,R.toUrlSafe)(oe.toString("base64")),{adapter:E(this,p,"f"),timeout:E(this,d,"f"),params:{count:_e}}),be=fe.safeParse(ge.data);if(!be.success)throw Error("Mailformed response");return be.data}async getConfig(H,Q){let oe="";Q&&Q.length>0&&(oe="/"+[...Q].sort().join(","));let _e=await E(this,m,"f").get(E(this,c,"f")+"/block/"+H+"/config"+oe,{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),ge=X.safeParse(_e.data);if(!ge.success)throw Error("Mailformed response");return ge.data}async runMethod(H,Q,oe,_e){let ge=_e&&_e.length>0?"/"+(0,R.toUrlSafe)((0,x.serializeTuple)(_e).toBoc({idx:!1,crc32:!1}).toString("base64")):"",be=E(this,c,"f")+"/block/"+H+"/"+Q.toString({urlSafe:!0})+"/run/"+encodeURIComponent(oe)+ge,we=await E(this,m,"f").get(be,{adapter:E(this,p,"f"),timeout:E(this,d,"f")}),Ee=le.safeParse(we.data);if(!Ee.success)throw Error("Mailformed response");let me=Ee.data.resultRaw?(0,x.parseTuple)(x.Cell.fromBoc(h.from(Ee.data.resultRaw,"base64"))[0]):[];return{exitCode:Ee.data.exitCode,result:me,resultRaw:Ee.data.resultRaw,block:Ee.data.block,shardBlock:Ee.data.shardBlock,reader:new x.TupleReader(me)}}async sendMessage(H){let Q=await E(this,m,"f").post(E(this,c,"f")+"/send",{boc:H.toString("base64")},{adapter:E(this,p,"f"),timeout:E(this,d,"f")});if(!se.safeParse(Q.data).success)throw Error("Mailformed response");return{status:Q.data.status}}open(H){return(0,x.openContract)(H,Q=>M(this,null,Q.address,Q.init))}openAt(H,Q){return(0,x.openContract)(Q,oe=>M(this,H,oe.address,oe.init))}provider(H,Q){return M(this,null,H,Q??null)}providerAt(H,Q,oe){return M(this,H,Q,oe??null)}}f.TonClient4=O,c=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap;function M(te,H,Q,oe){return{async getState(){let _e=H;_e===null&&(_e=(await te.getLastBlock()).last.seqno);let ge=await te.getAccount(_e,Q),be=ge.account.last?{lt:BigInt(ge.account.last.lt),hash:h.from(ge.account.last.hash,"base64")}:null,we;if(ge.account.state.type==="active")we={type:"active",code:ge.account.state.code?h.from(ge.account.state.code,"base64"):null,data:ge.account.state.data?h.from(ge.account.state.data,"base64"):null};else if(ge.account.state.type==="uninit")we={type:"uninit"};else if(ge.account.state.type==="frozen")we={type:"frozen",stateHash:h.from(ge.account.state.stateHash,"base64")};else throw Error("Unsupported state");let Ee=null;if(ge.account.balance.currencies){Ee={};let me=ge.account.balance.currencies;for(let[Ke,He]of Object.entries(me))Ee[Number(Ke)]=BigInt(He)}return{balance:BigInt(ge.account.balance.coins),extracurrency:Ee,last:be,state:we}},async get(_e,ge){if(typeof _e!="string")throw new Error("Method name must be a string for TonClient4 provider");let be=H;be===null&&(be=(await te.getLastBlock()).last.seqno);let we=await te.runMethod(be,Q,_e,ge);if(we.exitCode!==0&&we.exitCode!==1)throw Error("Exit code: "+we.exitCode);return{stack:new x.TupleReader(we.result)}},async external(_e){let ge=await te.getLastBlock(),be=null;oe&&(await te.getAccountLite(ge.last.seqno,Q)).account.state.type!=="active"&&(be=oe);const we=(0,x.external)({to:Q,init:be,body:_e});let Ee=(0,x.beginCell)().store((0,x.storeMessage)(we)).endCell().toBoc();await te.sendMessage(Ee)},async internal(_e,ge){let be=await te.getLastBlock(),we=null;oe&&(await te.getAccountLite(be.last.seqno,Q)).account.state.type!=="active"&&(we=oe);let Ee=!0;ge.bounce!==null&&ge.bounce!==void 0&&(Ee=ge.bounce);let me;typeof ge.value=="string"?me=(0,x.toNano)(ge.value):me=ge.value;let Ke=null;typeof ge.body=="string"?Ke=(0,x.comment)(ge.body):ge.body&&(Ke=ge.body),await _e.send({to:Q,value:me,extracurrency:ge.extracurrency,bounce:Ee,sendMode:ge.sendMode,init:we,body:Ke})},open(_e){return(0,x.openContract)(_e,ge=>M(te,H,ge.address,ge.init??null))},async getTransactions(_e,ge,be,we){const Ee=typeof we=="number";if(Ee&&we<=0)return[];let me=[];do{const Ke=await te.getAccountTransactions(_e,ge,be),He=Ke[0].tx,[Ie,Le]=[He.lt,He.hash()];if(me.length>0&&Ie===ge&&Le.equals(be)&&Ke.shift(),Ke.length===0)break;const Be=Ke[Ke.length-1].tx,[We,Ze]=[Be.lt,Be.hash()];if(We===ge&&Ze.equals(be))break;me.push(...Ke.map(_t=>_t.tx)),ge=We,be=Ze}while(Ee&&me.length<we);return Ee&&(me=me.slice(0,we)),me}}}const k=S.z.object({last:S.z.object({seqno:S.z.number(),shard:S.z.string(),workchain:S.z.number(),fileHash:S.z.string(),rootHash:S.z.string()}),init:S.z.object({fileHash:S.z.string(),rootHash:S.z.string()}),stateRootHash:S.z.string(),now:S.z.number()}),q=S.z.union([S.z.object({exist:S.z.literal(!1)}),S.z.object({exist:S.z.literal(!0),block:S.z.object({shards:S.z.array(S.z.object({workchain:S.z.number(),seqno:S.z.number(),shard:S.z.string(),rootHash:S.z.string(),fileHash:S.z.string(),transactions:S.z.array(S.z.object({account:S.z.string(),hash:S.z.string(),lt:S.z.string()}))}))})})]),b=S.z.object({lastPaid:S.z.number(),duePayment:S.z.union([S.z.null(),S.z.string()]),used:S.z.object({bits:S.z.number(),cells:S.z.number(),publicCells:S.z.number().optional()})}),F=S.z.object({account:S.z.object({state:S.z.union([S.z.object({type:S.z.literal("uninit")}),S.z.object({type:S.z.literal("active"),code:S.z.union([S.z.string(),S.z.null()]),data:S.z.union([S.z.string(),S.z.null()])}),S.z.object({type:S.z.literal("frozen"),stateHash:S.z.string()})]),balance:S.z.object({coins:S.z.string(),currencies:S.z.record(S.z.string(),S.z.string())}),last:S.z.union([S.z.null(),S.z.object({lt:S.z.string(),hash:S.z.string()})]),storageStat:S.z.union([S.z.null(),b])}),block:S.z.object({workchain:S.z.number(),seqno:S.z.number(),shard:S.z.string(),rootHash:S.z.string(),fileHash:S.z.string()})}),G=S.z.object({account:S.z.object({state:S.z.union([S.z.object({type:S.z.literal("uninit")}),S.z.object({type:S.z.literal("active"),codeHash:S.z.string(),dataHash:S.z.string()}),S.z.object({type:S.z.literal("frozen"),stateHash:S.z.string()})]),balance:S.z.object({coins:S.z.string(),currencies:S.z.record(S.z.string(),S.z.string())}),last:S.z.union([S.z.null(),S.z.object({lt:S.z.string(),hash:S.z.string()})]),storageStat:S.z.union([S.z.null(),b])})}),ue=S.z.object({changed:S.z.boolean(),block:S.z.object({workchain:S.z.number(),seqno:S.z.number(),shard:S.z.string(),rootHash:S.z.string(),fileHash:S.z.string()})}),le=S.z.object({exitCode:S.z.number(),resultRaw:S.z.union([S.z.string(),S.z.null()]),block:S.z.object({workchain:S.z.number(),seqno:S.z.number(),shard:S.z.string(),rootHash:S.z.string(),fileHash:S.z.string()}),shardBlock:S.z.object({workchain:S.z.number(),seqno:S.z.number(),shard:S.z.string(),rootHash:S.z.string(),fileHash:S.z.string()})}),X=S.z.object({config:S.z.object({cell:S.z.string(),address:S.z.string(),globalBalance:S.z.object({coins:S.z.string()})})}),se=S.z.object({status:S.z.number()}),de=S.z.array(S.z.object({workchain:S.z.number(),seqno:S.z.number(),shard:S.z.string(),rootHash:S.z.string(),fileHash:S.z.string()})),ye=S.z.object({blocks:de,boc:S.z.string()}),he=S.z.object({bits:S.z.number(),data:S.z.string()}),K=S.z.union([S.z.object({type:S.z.literal("internal"),value:S.z.string(),dest:S.z.string(),src:S.z.string(),bounced:S.z.boolean(),bounce:S.z.boolean(),ihrDisabled:S.z.boolean(),createdAt:S.z.number(),createdLt:S.z.string(),fwdFee:S.z.string(),ihrFee:S.z.string()}),S.z.object({type:S.z.literal("external-in"),dest:S.z.string(),src:S.z.union([he,S.z.null()]),importFee:S.z.string()}),S.z.object({type:S.z.literal("external-out"),dest:S.z.union([he,S.z.null()])})]),B=S.z.object({splitDepth:S.z.union([S.z.number(),S.z.null()]),code:S.z.union([S.z.string(),S.z.null()]),data:S.z.union([S.z.string(),S.z.null()]),special:S.z.union([S.z.object({tick:S.z.boolean(),tock:S.z.boolean()}),S.z.null()])}),L=S.z.object({body:S.z.string(),info:K,init:S.z.union([B,S.z.null()])}),$=S.z.union([S.z.literal("uninitialized"),S.z.literal("frozen"),S.z.literal("active"),S.z.literal("non-existing")]),T=S.z.union([S.z.object({type:S.z.literal("comment"),comment:S.z.string()}),S.z.object({type:S.z.literal("payload"),cell:S.z.string()})]),N=S.z.union([S.z.object({kind:S.z.literal("ton"),amount:S.z.string()}),S.z.object({kind:S.z.literal("token"),amount:S.z.string()})]),j=S.z.union([S.z.literal("jetton::excesses"),S.z.literal("jetton::transfer"),S.z.literal("jetton::transfer_notification"),S.z.literal("deposit"),S.z.literal("deposit::ok"),S.z.literal("withdraw"),S.z.literal("withdraw::all"),S.z.literal("withdraw::delayed"),S.z.literal("withdraw::ok"),S.z.literal("airdrop")]),Y=S.z.object({type:j,options:S.z.optional(S.z.record(S.z.string()))}),Z=S.z.object({address:S.z.string(),comment:S.z.optional(S.z.string()),items:S.z.array(N),op:S.z.optional(Y)}),z=S.z.object({address:S.z.string(),lt:S.z.string(),hash:S.z.string(),prevTransaction:S.z.object({lt:S.z.string(),hash:S.z.string()}),time:S.z.number(),outMessagesCount:S.z.number(),oldStatus:$,newStatus:$,fees:S.z.string(),update:S.z.object({oldHash:S.z.string(),newHash:S.z.string()}),inMessage:S.z.union([L,S.z.null()]),outMessages:S.z.array(L),parsed:S.z.object({seqno:S.z.union([S.z.number(),S.z.null()]),body:S.z.union([T,S.z.null()]),status:S.z.union([S.z.literal("success"),S.z.literal("failed"),S.z.literal("pending")]),dest:S.z.union([S.z.string(),S.z.null()]),kind:S.z.union([S.z.literal("out"),S.z.literal("in")]),amount:S.z.string(),resolvedAddress:S.z.string(),bounced:S.z.boolean(),mentioned:S.z.array(S.z.string())}),operation:Z}),fe=S.z.object({blocks:de,transactions:S.z.array(z)})},76985:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__importDefault||function(de){return de&&de.__esModule?de:{default:de}};Object.defineProperty(f,"__esModule",{value:!0}),f.HttpApi=void 0;const E=_(69684),v=w(_(20136)),c=w(_(23966)),d=_(78211),p=_(8386).rE,m=d.z.object({"@type":d.z.literal("ton.blockIdExt"),workchain:d.z.number(),shard:d.z.string(),seqno:d.z.number(),root_hash:d.z.string(),file_hash:d.z.string()}),C=d.z.object({balance:d.z.union([d.z.number(),d.z.string()]),extra_currencies:d.z.optional(d.z.array(d.z.object({"@type":d.z.literal("extraCurrency"),id:d.z.number(),amount:d.z.string()}))),state:d.z.union([d.z.literal("active"),d.z.literal("uninitialized"),d.z.literal("frozen")]),data:d.z.string(),code:d.z.string(),last_transaction_id:d.z.object({"@type":d.z.literal("internal.transactionId"),lt:d.z.string(),hash:d.z.string()}),block_id:m,sync_utime:d.z.number()}),x=d.z.object({"@type":d.z.literal("ok")}),R=d.z.object({"@type":d.z.literal("query.fees"),source_fees:d.z.object({"@type":d.z.literal("fees"),in_fwd_fee:d.z.number(),storage_fee:d.z.number(),gas_fee:d.z.number(),fwd_fee:d.z.number()})}),S=d.z.object({gas_used:d.z.number(),exit_code:d.z.number(),stack:d.z.array(d.z.unknown())}),O=d.z.union([d.z.object({"@type":d.z.literal("msg.dataRaw"),body:d.z.string()}),d.z.object({"@type":d.z.literal("msg.dataText"),text:d.z.string()}),d.z.object({"@type":d.z.literal("msg.dataDecryptedText"),text:d.z.string()}),d.z.object({"@type":d.z.literal("msg.dataEncryptedText"),text:d.z.string()})]),M=d.z.object({source:d.z.string(),destination:d.z.string(),value:d.z.string(),fwd_fee:d.z.string(),ihr_fee:d.z.string(),created_lt:d.z.string(),body_hash:d.z.string(),msg_data:O,message:d.z.string().optional()}),k=d.z.object({data:d.z.string(),utime:d.z.number(),transaction_id:d.z.object({lt:d.z.string(),hash:d.z.string()}),fee:d.z.string(),storage_fee:d.z.string(),other_fee:d.z.string(),in_msg:d.z.union([d.z.undefined(),M]),out_msgs:d.z.array(M)}),q=d.z.array(k),b=d.z.object({state_root_hash:d.z.string(),last:m,init:m}),F=d.z.object({shards:d.z.array(m)}),G=d.z.object({"@type":d.z.literal("blocks.shortTxId"),mode:d.z.number(),account:d.z.string(),lt:d.z.string(),hash:d.z.string()}),ue=d.z.object({id:m,req_count:d.z.number(),incomplete:d.z.boolean(),transactions:d.z.array(G)});class le{constructor(ye,he,K,B){this.namespace=ye,this.cache=he,this.codec=K,this.keyEncoder=B}async get(ye){let he=await this.cache.get(this.namespace,this.keyEncoder(ye));if(he){let K=this.codec.safeParse(JSON.parse(he));if(K.success)return K.data}return null}async set(ye,he){he!==null?await this.cache.set(this.namespace,this.keyEncoder(ye),JSON.stringify(he)):await this.cache.set(this.namespace,this.keyEncoder(ye),null)}}class X{constructor(ye,he){this.endpoint=ye,this.cache=new E.InMemoryCache,this.parameters={timeout:he?.timeout||3e4,apiKey:he?.apiKey,adapter:he?.adapter},this.shardCache=new le("ton-shard",this.cache,d.z.array(m),K=>K+""),this.shardLoader=new v.default(async K=>await Promise.all(K.map(async B=>{const L=await this.shardCache.get(B);if(L)return L;let $=(await this.doCall("shards",{seqno:B},F)).shards;return await this.shardCache.set(B,$),$}))),this.shardTransactionsCache=new le("ton-shard-tx",this.cache,ue,K=>K.workchain+":"+K.shard+":"+K.seqno),this.shardTransactionsLoader=new v.default(async K=>await Promise.all(K.map(async B=>{const L=await this.shardTransactionsCache.get(B);if(L)return L;let $=await this.doCall("getBlockTransactions",{workchain:B.workchain,seqno:B.seqno,shard:B.shard},ue);return await this.shardTransactionsCache.set(B,$),$})),{cacheKeyFn:K=>K.workchain+":"+K.shard+":"+K.seqno})}getAddressInformation(ye){return this.doCall("getAddressInformation",{address:ye.toString()},C)}async getTransactions(ye,he){const K=he.inclusive;delete he.inclusive;let B;he.hash&&(B=h.from(he.hash,"base64").toString("hex"));let L=he.limit;he.hash&&he.lt&&K!==!0&&L++;let $=await this.doCall("getTransactions",{address:ye.toString(),...he,limit:L,hash:B},q);return $.length>L&&($=$.slice(0,L)),he.hash&&he.lt&&K!==!0&&$.shift(),$}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},b)}async getShards(ye){return await this.shardLoader.load(ye)}async getBlockTransactions(ye,he,K){return await this.shardTransactionsLoader.load({workchain:ye,seqno:he,shard:K})}async getTransaction(ye,he,K){let B=h.from(K,"base64").toString("hex"),$=(await this.doCall("getTransactions",{address:ye.toString(),lt:he,hash:B,limit:1},q)).find(T=>T.transaction_id.lt===he&&T.transaction_id.hash===K);return $||null}async callGetMethod(ye,he,K){return await this.doCall("runGetMethod",{address:ye.toString(),method:he,stack:se(K)},S)}async sendBoc(ye){await this.doCall("sendBoc",{boc:ye.toString("base64")},x)}async estimateFee(ye,he){return await this.doCall("estimateFee",{address:ye.toString(),body:he.body.toBoc().toString("base64"),init_data:he.initData?he.initData.toBoc().toString("base64"):"",init_code:he.initCode?he.initCode.toBoc().toString("base64"):"",ignore_chksig:he.ignoreSignature},R)}async tryLocateResultTx(ye,he,K){return await this.doCall("tryLocateResultTx",{source:ye.toString(),destination:he.toString(),created_lt:K},k)}async tryLocateSourceTx(ye,he,K){return await this.doCall("tryLocateSourceTx",{source:ye.toString(),destination:he.toString(),created_lt:K},k)}async doCall(ye,he,K){let B={"Content-Type":"application/json","X-Ton-Client-Version":p};this.parameters.apiKey&&(B["X-API-Key"]=this.parameters.apiKey);let L=await c.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:ye,params:he}),{headers:B,timeout:this.parameters.timeout,adapter:this.parameters.adapter});if(L.status!==200||!L.data.ok)throw Error("Received error: "+JSON.stringify(L.data));let $=K.safeParse(L.data.result);if($.success)return $.data;throw Error("Malformed response: "+$.error.format()._errors.join(", "))}}f.HttpApi=X;function se(de){let ye=[];for(let he of de)if(he.type==="int")ye.push(["num",he.value.toString()]);else if(he.type==="cell")ye.push(["tvm.Cell",he.cell.toBoc().toString("base64")]);else if(he.type==="slice")ye.push(["tvm.Slice",he.cell.toBoc().toString("base64")]);else if(he.type==="builder")ye.push(["tvm.Builder",he.cell.toBoc().toString("base64")]);else throw Error("Unsupported stack item type: "+he.type);return ye}},69684:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.InMemoryCache=void 0;class _{constructor(){this.cache=new Map,this.set=async(w,E,v)=>{v!==null?this.cache.set(w+"$$"+E,v):this.cache.delete(w+"$$"+E)},this.get=async(w,E)=>{let v=this.cache.get(w+"$$"+E);return v!==void 0?v:null}}}f.InMemoryCache=_},59994:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.configParseMasterAddress=w,f.parseValidatorSet=c,f.parseBridge=d,f.configParseMasterAddressRequired=p,f.configParse5=m,f.configParse6=C,f.configParse7=x,f.configParse9=R,f.configParse10=S,f.configParse13=O,f.configParse14=M,f.configParse15=k,f.configParse16=q,f.configParse17=b,f.configParse18=G,f.configParse8=ue,f.configParse40=le,f.configParseWorkchainDescriptor=X,f.configParse12=ye,f.configParseValidatorSet=he,f.configParseBridge=K,f.loadJettonBridgeParams=B,f.configParseGasLimitsPrices=$,f.configParseBlockLimits=N,f.configParseMsgPrices=j,f.configParse28=Y,f.configParse29=Z,f.configParse31=z,f.configParse44=fe,f.configParse45=H,f.parseProposalSetup=Q,f.parseVotingSetup=oe,f.loadConfigParamById=ge,f.loadConfigParamsAsSlice=be,f.parseFullConfig=we,f.parseFullerConfig=Ee;const h=_(21224);function w(me){return me?new h.Address(-1,me.loadBuffer(32)):null}function E(me){if(me.loadUint(32)!==2390828938)throw Error("Invalid publicKey");return me.loadBuffer(32)}const v={serialize(me,Ke){throw Error("not implemented")},parse(me){const Ke=me.loadUint(8);if(Ke===83)return{publicKey:E(me),weight:me.loadUintBig(64),adnlAddress:null};if(Ke===115)return{publicKey:E(me),weight:me.loadUintBig(64),adnlAddress:me.loadBuffer(32)};throw Error("Invalid validator description dict")}};function c(me){const Ke=me.loadUint(8);if(Ke===17){const He=me.loadUint(32),Ie=me.loadUint(32),Le=me.loadUint(16),Ge=me.loadUint(16),Be=me.loadDictDirect(h.Dictionary.Keys.Uint(16),v);return{timeSince:He,timeUntil:Ie,total:Le,main:Ge,totalWeight:null,list:Be}}else if(Ke===18){const He=me.loadUint(32),Ie=me.loadUint(32),Le=me.loadUint(16),Ge=me.loadUint(16),Be=me.loadUintBig(64),We=me.loadDict(h.Dictionary.Keys.Uint(16),v);return{timeSince:He,timeUntil:Ie,total:Le,main:Ge,totalWeight:Be,list:We}}return null}function d(me){const Ke=new h.Address(-1,me.loadBuffer(32)),He=new h.Address(-1,me.loadBuffer(32)),Ie=me.loadDict(h.Dictionary.Keys.Buffer(32),h.Dictionary.Values.Buffer(32)),Le=new Map;for(const[Be,We]of Ie)Le.set(new h.Address(-1,Be).toString(),We);const Ge=me.loadBuffer(32);return{bridgeAddress:Ke,oracleMultisigAddress:He,oracles:Le,externalChainAddress:Ge}}function p(me){if(!me)throw Error("Invalid master address");return w(me)}function m(me){if(!me)throw Error("No config5 slice");if(me.loadUint(8)===1){const He=me.loadBit()?new h.Address(-1,me.loadBuffer(32)):null,Ie=me.loadUint(32),Le=me.loadUint(32);return{blackholeAddr:He,feeBurnNominator:Ie,feeBurnDenominator:Le}}throw new Error("Invalid config5")}function C(me){if(!me)return null;const Ke=me.loadCoins(),He=me.loadCoins();return{mintNewPrice:Ke,mintAddPrice:He}}function x(me){if(!me)throw Error("No config7 slice");return{toMint:(0,h.loadExtraCurrency)(me.loadRef())}}function R(me){if(!me)throw Error("No config9 slice");return new Set(me.loadDictDirect(h.Dictionary.Keys.Int(32),h.Dictionary.Values.Uint(0)).keys())}function S(me){if(!me)throw Error("No config10 slice");return new Set(me.loadDictDirect(h.Dictionary.Keys.Int(32),h.Dictionary.Values.Uint(0)).keys())}function O(me){if(!me)throw Error("No config13 slice");if(me.loadUint(8)!==26)throw new Error("Invalid config13");const He=me.loadCoins(),Ie=me.loadCoins(),Le=me.loadCoins();return{deposit:He,bitPrice:Ie,cellPrice:Le}}function M(me){if(!me)throw Error("No config14 slice");if(me.loadUint(8)!==107)throw new Error("Invalid config14");const He=me.loadCoins(),Ie=me.loadCoins();return{masterchainBlockFee:He,workchainBlockFee:Ie}}function k(me){if(!me)throw Error("No config15 slice");const Ke=me.loadUint(32),He=me.loadUint(32),Ie=me.loadUint(32),Le=me.loadUint(32);return{validatorsElectedFor:Ke,electorsStartBefore:He,electorsEndBefore:Ie,stakeHeldFor:Le}}function q(me){if(!me)throw Error("No config16 slice");const Ke=me.loadUint(16),He=me.loadUint(16),Ie=me.loadUint(16);return{maxValidators:Ke,maxMainValidators:He,minValidators:Ie}}function b(me){if(!me)throw Error("No config17 slice");const Ke=me.loadCoins(),He=me.loadCoins(),Ie=me.loadCoins(),Le=me.loadUint(32);return{minStake:Ke,maxStake:He,minTotalStake:Ie,maxStakeFactor:Le}}const F={serialize(me,Ke){throw Error("not implemented")},parse(me){if(me.loadUint(8)!==204)throw Error("Invalid storage prices dict");const He=me.loadUint(32),Ie=me.loadUintBig(64),Le=me.loadUintBig(64),Ge=me.loadUintBig(64),Be=me.loadUintBig(64);return{utime_since:He,bit_price_ps:Ie,cell_price_ps:Le,mc_bit_price_ps:Ge,mc_cell_price_ps:Be}}};function G(me){if(!me)throw Error("No config18 slice");return me.loadDictDirect(h.Dictionary.Keys.Buffer(4),F).values()}function ue(me){if(!me)return{version:0,capabilities:0n};const Ke=me.loadUint(32),He=me.loadUintBig(64);return{version:Ke,capabilities:He}}function le(me){if(!me)return null;if(me.loadUint(8)!==1)throw Error("Invalid config40");const He=me.loadCoins(),Ie=me.loadCoins(),Le=me.loadUint(16),Ge=me.loadUint(16),Be=me.loadUint(16),We=me.loadUint(16),Ze=me.loadUint(16),_t=me.loadUint(16),Ft=me.loadUint(16),gt=me.loadUint(16),lt=me.loadUint(16);return{defaultFlatFine:He,defaultProportionaFine:Ie,severityFlatMult:Le,severityProportionalMult:Ge,unfunishableInterval:Be,longInterval:We,longFlatMult:Ze,longProportionalMult:_t,mediumInterval:Ft,mediumFlatMult:gt,mediumProportionalMult:lt}}function X(me){const Ke=me.loadUint(8);if(!(Ke==166||Ke==167))throw Error("Invalid workchain descriptor");const He=me.loadUint(32),Ie=me.loadUint(8),Le=me.loadUint(8),Ge=me.loadUint(8),Be=me.loadBit(),We=me.loadBit(),Ze=me.loadBit(),_t=me.loadUint(13),Ft=me.loadBuffer(32),gt=me.loadBuffer(32),lt=me.loadUint(32);if(!me.loadUint(4))throw Error("Not basic workchain descriptor");const dt=me.loadInt(32),tt=me.loadUintBig(64);let rt;if(Ke==167){const ke=se(me),xe=me.loadUint(8);if(xe>63)throw RangeError(`Invalid persistent_state_split_depth: ${xe} expected <= 63`);rt={split_merge_timings:ke,persistent_state_split_depth:xe}}return{enabledSince:He,actialMinSplit:Ie,min_split:Le,max_split:Ge,basic:Be,active:We,accept_msgs:Ze,flags:_t,zerostateRootHash:Ft,zerostateFileHash:gt,version:lt,format:{vmVersion:dt,vmMode:tt},workchain_v2:rt}}function se(me){if(me.loadUint(4)!==0)throw Error("Invalid WcSplitMergeTimings tag expected 0!");return{split_merge_delay:me.loadUint(32),split_merge_interval:me.loadUint(32),min_split_merge_interval:me.loadUint(32),max_split_merge_delay:me.loadUint(32)}}const de={serialize(me,Ke){throw Error("not implemented")},parse(me){return X(me)}};function ye(me){if(!me)throw Error("No config12 slice");const Ke=me.loadDict(h.Dictionary.Keys.Uint(32),de);if(Ke)return Ke;throw Error("No workchains exist")}function he(me){return me?c(me):null}function K(me){return me?d(me):null}function B(me){if(!me)return null;const Ke=me.loadUint(8);if(Ke===0){const He=new h.Address(-1,me.loadBuffer(32)),Ie=new h.Address(-1,me.loadBuffer(32)),Ge=[...me.loadDict(h.Dictionary.Keys.Buffer(32),h.Dictionary.Values.Buffer(32))].map(Ze=>({addr:new h.Address(-1,Ze[0]),pubkey:Ze[1]})),Be=me.loadUint(8),We=me.loadCoins();return{bridgeAddress:He,oracleAddress:Ie,oracles:Ge,flags:Be,bridgeBurnFee:We}}if(Ke===1){const He=new h.Address(-1,me.loadBuffer(32)),Ie=new h.Address(-1,me.loadBuffer(32)),Ge=[...me.loadDict(h.Dictionary.Keys.Buffer(32),h.Dictionary.Values.Buffer(32))].map(rt=>({addr:new h.Address(-1,rt[0]),pubkey:rt[1]})),Be=me.loadUint(8),We=me.loadRef().beginParse(),Ze=We.loadCoins(),_t=We.loadCoins(),Ft=We.loadCoins(),gt=We.loadCoins(),lt=We.loadCoins(),dt=We.loadCoins(),tt=me.loadBuffer(32);return{bridgeAddress:He,oracleAddress:Ie,oracles:Ge,flags:Be,jettonBridgePrices:{bridgeBurnFee:Ze,bridgeMintFee:_t,walletMinTonsForStorage:Ft,walletGasConsumption:gt,minterMinTonsForStorage:lt,discoverGasConsumption:dt},externalChainAddress:tt}}throw new Error("Invalid msg prices param")}function L(me){const Ke=me.loadUint(8);if(Ke===222){const He=me.loadUintBig(64),Ie=me.loadUintBig(64),Le=me.loadUintBig(64),Ge=me.loadUintBig(64),Be=me.loadUintBig(64),We=me.loadUintBig(64),Ze=me.loadUintBig(64);return{gasPrice:He,gasLimit:Ie,specialGasLimit:Le,gasCredit:Ge,blockGasLimit:Be,freezeDueLimit:We,deleteDueLimit:Ze}}else if(Ke===221){const He=me.loadUintBig(64),Ie=me.loadUintBig(64),Le=me.loadUintBig(64),Ge=me.loadUintBig(64),Be=me.loadUintBig(64),We=me.loadUintBig(64);return{gasPrice:He,gasLimit:Ie,gasCredit:Le,blockGasLimit:Ge,freezeDueLimit:Be,deleteDueLimit:We}}else throw Error("Invalid gas limits internal")}function $(me){if(!me)throw Error("No gas limits slice");if(me.loadUint(8)===209){const He=me.loadUintBig(64),Ie=me.loadUintBig(64),Le=L(me);return{flatLimit:He,flatGasPrice:Ie,other:Le}}else throw Error("Invalid gas limits")}function T(me){if(me.loadUint(8)!==195)throw Error("Invalid params limit slice");const He=me.loadUint(32),Ie=me.loadUint(32),Le=me.loadUint(32);if(He>Ie||Ie>Le)throw Error("Incosistent limitParams");return{underload:He,softLimit:Ie,hardLimit:Le}}function N(me){if(!me)throw Error("No block limits slice");const Ke=me.loadUint(8);if(Ke===93){const He=T(me),Ie=T(me),Le=T(me);return{bytes:He,gas:Ie,ltDelta:Le}}if(Ke===94){const He=T(me),Ie=T(me),Le=T(me),Ge=T(me);if(me.loadUint(8)!==211)throw Error("Invalid importedMsgQueue");const We=me.loadUint(32),Ze=me.loadUint(32);return{bytes:He,gas:Ie,ltDelta:Le,collatedData:Ge,importedMsgQueue:{maxBytes:We,maxMsgs:Ze}}}throw Error("Invalid block limits")}function j(me){if(!me)throw new Error("No msg prices slice");if(me.loadUint(8)!==234)throw new Error("Invalid msg prices param");return{lumpPrice:me.loadUintBig(64),bitPrice:me.loadUintBig(64),cellPrice:me.loadUintBig(64),ihrPriceFactor:me.loadUint(32),firstFrac:me.loadUint(16),nextFrac:me.loadUint(16)}}function Y(me){if(!me)throw new Error("No config28 slice");const Ke=me.loadUint(8);if(Ke===193){const He=me.loadUint(32),Ie=me.loadUint(32),Le=me.loadUint(32),Ge=me.loadUint(32);return{masterCatchainLifetime:He,shardCatchainLifetime:Ie,shardValidatorsLifetime:Le,shardValidatorsCount:Ge}}if(Ke===194){const He=me.loadUint(7),Ie=me.loadBit(),Le=me.loadUint(32),Ge=me.loadUint(32),Be=me.loadUint(32),We=me.loadUint(32);return{flags:He,suffleMasterValidators:Ie,masterCatchainLifetime:Le,shardCatchainLifetime:Ge,shardValidatorsLifetime:Be,shardValidatorsCount:We}}throw new Error("Invalid config28")}function Z(me){if(!me)throw new Error("No config29 slice");const Ke=me.loadUint(8);if(Ke===214){const He=me.loadUint(32),Ie=me.loadUint(32),Le=me.loadUint(32),Ge=me.loadUint(32),Be=me.loadUint(32),We=me.loadUint(32),Ze=me.loadUint(32),_t=me.loadUint(32);return{roundCandidates:He,nextCandidateDelay:Ie,consensusTimeout:Le,fastAttempts:Ge,attemptDuration:Be,catchainMaxDeps:We,maxBlockBytes:Ze,maxColaltedBytes:_t}}else if(Ke===215){const He=me.loadUint(7),Ie=me.loadBit(),Le=me.loadUint(8),Ge=me.loadUint(32),Be=me.loadUint(32),We=me.loadUint(32),Ze=me.loadUint(32),_t=me.loadUint(32),Ft=me.loadUint(32),gt=me.loadUint(32);return{flags:He,newCatchainIds:Ie,roundCandidates:Le,nextCandidateDelay:Ge,consensusTimeout:Be,fastAttempts:We,attemptDuration:Ze,catchainMaxDeps:_t,maxBlockBytes:Ft,maxColaltedBytes:gt}}else if(Ke===216){const He=me.loadUint(7),Ie=me.loadBit(),Le=me.loadUint(8),Ge=me.loadUint(32),Be=me.loadUint(32),We=me.loadUint(32),Ze=me.loadUint(32),_t=me.loadUint(32),Ft=me.loadUint(32),gt=me.loadUint(32),lt=me.loadUint(16);return{flags:He,newCatchainIds:Ie,roundCandidates:Le,nextCandidateDelay:Ge,consensusTimeout:Be,fastAttempts:We,attemptDuration:Ze,catchainMaxDeps:_t,maxBlockBytes:Ft,maxColaltedBytes:gt,protoVersion:lt}}else if(Ke===217){const He=me.loadUint(7),Ie=me.loadBit(),Le=me.loadUint(8),Ge=me.loadUint(32),Be=me.loadUint(32),We=me.loadUint(32),Ze=me.loadUint(32),_t=me.loadUint(32),Ft=me.loadUint(32),gt=me.loadUint(32),lt=me.loadUint(16),dt=me.loadUint(32);return{flags:He,newCatchainIds:Ie,roundCandidates:Le,nextCandidateDelay:Ge,consensusTimeout:Be,fastAttempts:We,attemptDuration:Ze,catchainMaxDeps:_t,maxBlockBytes:Ft,maxColaltedBytes:gt,protoVersion:lt,catchainMaxBlocksCoeff:dt}}throw new Error("Invalid config29")}function z(me){if(!me)throw Error("No config31 slice");return[...me.loadDict(h.Dictionary.Keys.Buffer(32),h.Dictionary.Values.Uint(0))].map(He=>new h.Address(-1,He[0]))}function fe(me){if(!me)throw Error("No config44 slice");if(me.loadUint(8)!==0)throw new Error("Invalid config44");const He=me.loadDict(h.Dictionary.Keys.Buffer(36),h.Dictionary.Values.Uint(0)),Ie=me.loadUint(32);return{addresses:[...He].map(Ge=>new h.Address(Ge[0].readInt32BE(),Ge[0].subarray(4))),suspendedUntil:Ie}}const te={serialize:()=>{throw Error("not implemented")},parse:me=>{if(me.loadUint(8)!==176)throw new Error("Invalid precompiled contracts dict");return me.loadUintBig(64)}};function H(me){if(!me)throw Error("No config45 slice");if(me.loadUint(8)!==192)throw new Error("Invalid config45");return[...me.loadDict(h.Dictionary.Keys.Buffer(32),te)].map(Ie=>({hash:Ie[0],gasUsed:Ie[1]}))}function Q(me){if(me.loadUint(8)!==54)throw new Error("Invalid proposal setup");const He=me.loadUint(8),Ie=me.loadUint(8),Le=me.loadUint(8),Ge=me.loadUint(8),Be=me.loadUint(32),We=me.loadUint(32),Ze=me.loadUint(32),_t=me.loadUint(32);return{minTotalRounds:He,maxTotalRounds:Ie,minWins:Le,maxLoses:Ge,minStoreSec:Be,maxStoreSec:We,bitPrice:Ze,cellPrice:_t}}function oe(me){if(!me)throw new Error("No voting setup");if(me.loadUint(8)!==145)throw new Error("Invalid voting setup");const He=Q(me.loadRef().beginParse()),Ie=Q(me.loadRef().beginParse());return{normalParams:He,criticalParams:Ie}}function _e(me){return h.Cell.fromBase64(me).beginParse().loadDictDirect(h.Dictionary.Keys.Int(32),h.Dictionary.Values.Cell())}function ge(me,Ke){return _e(me).get(Ke)}function be(me){const Ke=_e(me),He=new Map;for(const[Ie,Le]of Ke)He.set(Ie,Le.beginParse());return He}function we(me){return{configAddress:p(me.get(0)),electorAddress:p(me.get(1)),minterAddress:w(me.get(2)),feeCollectorAddress:w(me.get(3)),dnsRootAddress:w(me.get(4)),burningConfig:m(me.get(5)),globalVersion:ue(me.get(8)),workchains:ye(me.get(12)),voting:oe(me.get(11)),validators:{...k(me.get(15)),...q(me.get(16)),...b(me.get(17))},storagePrices:G(me.get(18)),gasPrices:{masterchain:$(me.get(20)),workchain:$(me.get(21))},msgPrices:{masterchain:j(me.get(24)),workchain:j(me.get(25))},validatorSets:{prevValidators:he(me.get(32)),prevTempValidators:he(me.get(33)),currentValidators:he(me.get(34)),currentTempValidators:he(me.get(35)),nextValidators:he(me.get(36)),nextTempValidators:he(me.get(37))},validatorsPunish:le(me.get(40)),bridges:{ethereum:K(me.get(71)),binance:K(me.get(72)),polygon:K(me.get(73))},catchain:Y(me.get(28)),consensus:Z(me.get(29))}}function Ee(me){return{configAddress:p(me.get(0)),electorAddress:p(me.get(1)),minterAddress:w(me.get(2)),feeCollectorAddress:w(me.get(3)),dnsRootAddress:w(me.get(4)),burningConfig:m(me.get(5)),extraCurrenciesMintPrices:C(me.get(6)),extraCurrencies:x(me.get(7)),globalVersion:ue(me.get(8)),configMandatoryParams:R(me.get(9)),configCriticalParams:S(me.get(10)),voting:oe(me.get(11)),workchains:ye(me.get(12)),complaintCost:O(me.get(13)),blockCreationRewards:M(me.get(14)),validators:{...k(me.get(15)),...q(me.get(16)),...b(me.get(17))},storagePrices:G(me.get(18)),gasPrices:{masterchain:$(me.get(20)),workchain:$(me.get(21))},blockLimits:{masterchain:N(me.get(22)),workchain:N(me.get(23))},msgPrices:{masterchain:j(me.get(24)),workchain:j(me.get(25))},catchain:Y(me.get(28)),consensus:Z(me.get(29)),fundamentalSmcAddr:z(me.get(31)),validatorSets:{prevValidators:he(me.get(32)),prevTempValidators:he(me.get(33)),currentValidators:he(me.get(34)),currentTempValidators:he(me.get(35)),nextValidators:he(me.get(36)),nextTempValidators:he(me.get(37))},validatorsPunish:le(me.get(40)),suspended:fe(me.get(44)),precompiledContracts:H(me.get(45)),bridges:{ethereum:K(me.get(71)),binance:K(me.get(72)),polygon:K(me.get(73))},tokenBridges:{ethereum:B(me.get(79)),binance:B(me.get(81)),polygon:B(me.get(82))}}}},74089:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.ElectorContract=void 0;const w=_(21224),E={serialize(d,p){throw Error("not implemented")},parse(d){const p=new w.Address(-1,d.loadBuffer(32)),m=d.loadUintBig(64),C=d.loadCoins();return{address:p,weight:m,stake:C}}},v={serialize(d,p){throw Error("not implemented")},parse(d){const p=d.loadCoins();d.skip(64);const m=new w.Address(-1,d.loadBuffer(32)),C=d.loadBuffer(32);return{stake:p,address:m,adnl:C}}};class c{static create(){return new c}constructor(){this.address=w.Address.parseRaw("-1:3333333333333333333333333333333333333333333333333333333333333333")}async getReturnedStake(p,m){if(m.workChain!==-1)throw Error("Only masterchain addresses could have stake");return(await p.get("compute_returned_stake",[{type:"int",value:BigInt("0x"+m.hash.toString("hex"))}])).stack.readBigNumber()}async getPastElectionsList(p){const m=await p.get("past_elections_list",[]),C=new w.TupleReader(m.stack.readLispList()),x=[];for(;C.remaining>0;){const R=C.readTuple(),S=R.readNumber(),O=R.readNumber();R.pop();const M=R.readNumber();x.push({id:S,unfreezeAt:O,stakeHeld:M})}return x}async getPastElections(p){const m=await p.get("past_elections",[]),C=new w.TupleReader(m.stack.readLispList()),x=[];for(;C.remaining>0;){const R=C.readTuple(),S=R.readNumber(),O=R.readNumber(),M=R.readNumber();R.pop();const k=R.readCell(),q=R.readBigNumber(),b=R.readBigNumber();let F=new Map;const G=k.beginParse().loadDictDirect(w.Dictionary.Keys.Buffer(32),E);for(const[ue,le]of G)F.set(BigInt("0x"+ue.toString("hex")).toString(10),{address:le.address,weight:le.weight,stake:le.stake});x.push({id:S,unfreezeAt:O,stakeHeld:M,totalStake:q,bonuses:b,frozen:F})}return x}async getElectionEntities(p){const m=await p.getState();if(m.state.type!=="active")throw Error("Unexpected error");const x=w.Cell.fromBoc(m.state.data)[0].beginParse();if(!x.loadBit())return null;const R=x.loadRef().beginParse(),S=R.loadUint(32),O=R.loadUint(32),M=R.loadCoins(),k=R.loadCoins(),q=R.loadDict(w.Dictionary.Keys.Buffer(32),v);let b=[];if(q)for(const[F,G]of q)b.push({pubkey:F,stake:G.stake,address:G.address,adnl:G.adnl});return{minStake:M,allStakes:k,endElectionsTime:O,startWorkTime:S,entities:b}}async getActiveElectionId(p){const C=(await p.get("active_election_id",[])).stack.readNumber();return C>0?C:null}async getComplaints(p,m){const C=new w.TupleBuilder;C.writeNumber(m);const x=await p.get("list_complaints",C.build());if(x.stack.peek().type==="null")return[];const R=new w.TupleReader(x.stack.readLispList()),S=[];for(;R.remaining>0;){const O=R.readTuple(),M=O.readBigNumber(),k=O.readTuple(),q=k.readTuple(),b=h.from(q.readBigNumber().toString(16),"hex"),F=q.readCell(),G=q.readNumber(),ue=q.readNumber(),le=new w.Address(-1,h.from(q.readBigNumber().toString(16),"hex")),X=q.readBigNumber(),se=q.readBigNumber(),de=q.readBigNumber(),ye=[],he=new w.TupleReader(k.readLispList());for(;he.remaining>0;)ye.push(he.readNumber());const K=k.readBigNumber(),B=k.readBigNumber();S.push({id:M,publicKey:b,createdAt:G,severity:ue,paid:X,suggestedFine:se,suggestedFinePart:de,rewardAddress:le,votes:ye,remainingWeight:B,vsetId:K})}return S}}f.ElectorContract=c},58872:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(de,ye,he,K){K===void 0&&(K=he);var B=Object.getOwnPropertyDescriptor(ye,he);(!B||("get"in B?!ye.__esModule:B.writable||B.configurable))&&(B={enumerable:!0,get:function(){return ye[he]}}),Object.defineProperty(de,K,B)}:function(de,ye,he,K){K===void 0&&(K=he),de[K]=ye[he]}),w=this&&this.__exportStar||function(de,ye){for(var he in de)he!=="default"&&!Object.prototype.hasOwnProperty.call(ye,he)&&h(ye,de,he)};Object.defineProperty(f,"__esModule",{value:!0}),f.computeStorageFees=f.computeMessageForwardFees=f.computeGasPrices=f.computeFwdFees=f.computeExternalMessageFees=f.loadConfigParamsAsSlice=f.loadConfigParamById=f.parseFullerConfig=f.parseFullConfig=f.parseVotingSetup=f.parseValidatorSet=f.parseProposalSetup=f.parseBridge=f.configParseWorkchainDescriptor=f.configParseValidatorSet=f.configParseMsgPrices=f.configParseMasterAddressRequired=f.configParseMasterAddress=f.configParseGasLimitsPrices=f.configParseBridge=f.configParse40=f.configParse29=f.configParse28=f.configParse18=f.configParse17=f.configParse16=f.configParse15=f.configParse13=f.configParse12=f.configParse8=f.configParse5=f.ElectorContract=f.MultisigWallet=f.MultisigOrderBuilder=f.MultisigOrder=f.JettonWallet=f.JettonMaster=f.WalletContractV5R1=f.WalletContractV5Beta=f.WalletContractV4=f.WalletContractV3R2=f.WalletContractV3R1=f.WalletContractV2R2=f.WalletContractV2R1=f.WalletContractV1R3=f.WalletContractV1R2=f.WalletContractV1R1=f.TonClient4=f.TonClient=f.HttpApi=void 0,w(_(21224),f);var E=_(76985);Object.defineProperty(f,"HttpApi",{enumerable:!0,get:function(){return E.HttpApi}});var v=_(66564);Object.defineProperty(f,"TonClient",{enumerable:!0,get:function(){return v.TonClient}});var c=_(95458);Object.defineProperty(f,"TonClient4",{enumerable:!0,get:function(){return c.TonClient4}});var d=_(74578);Object.defineProperty(f,"WalletContractV1R1",{enumerable:!0,get:function(){return d.WalletContractV1R1}});var p=_(81375);Object.defineProperty(f,"WalletContractV1R2",{enumerable:!0,get:function(){return p.WalletContractV1R2}});var m=_(46760);Object.defineProperty(f,"WalletContractV1R3",{enumerable:!0,get:function(){return m.WalletContractV1R3}});var C=_(94491);Object.defineProperty(f,"WalletContractV2R1",{enumerable:!0,get:function(){return C.WalletContractV2R1}});var x=_(83166);Object.defineProperty(f,"WalletContractV2R2",{enumerable:!0,get:function(){return x.WalletContractV2R2}});var R=_(44320);Object.defineProperty(f,"WalletContractV3R1",{enumerable:!0,get:function(){return R.WalletContractV3R1}});var S=_(64601);Object.defineProperty(f,"WalletContractV3R2",{enumerable:!0,get:function(){return S.WalletContractV3R2}});var O=_(27944);Object.defineProperty(f,"WalletContractV4",{enumerable:!0,get:function(){return O.WalletContractV4}});var M=_(85941);Object.defineProperty(f,"WalletContractV5Beta",{enumerable:!0,get:function(){return M.WalletContractV5Beta}});var k=_(71350);Object.defineProperty(f,"WalletContractV5R1",{enumerable:!0,get:function(){return k.WalletContractV5R1}});var q=_(84879);Object.defineProperty(f,"JettonMaster",{enumerable:!0,get:function(){return q.JettonMaster}});var b=_(43328);Object.defineProperty(f,"JettonWallet",{enumerable:!0,get:function(){return b.JettonWallet}});var F=_(66097);Object.defineProperty(f,"MultisigOrder",{enumerable:!0,get:function(){return F.MultisigOrder}});var G=_(47290);Object.defineProperty(f,"MultisigOrderBuilder",{enumerable:!0,get:function(){return G.MultisigOrderBuilder}});var ue=_(1284);Object.defineProperty(f,"MultisigWallet",{enumerable:!0,get:function(){return ue.MultisigWallet}});var le=_(74089);Object.defineProperty(f,"ElectorContract",{enumerable:!0,get:function(){return le.ElectorContract}});var X=_(59994);Object.defineProperty(f,"configParse5",{enumerable:!0,get:function(){return X.configParse5}}),Object.defineProperty(f,"configParse8",{enumerable:!0,get:function(){return X.configParse8}}),Object.defineProperty(f,"configParse12",{enumerable:!0,get:function(){return X.configParse12}}),Object.defineProperty(f,"configParse13",{enumerable:!0,get:function(){return X.configParse13}}),Object.defineProperty(f,"configParse15",{enumerable:!0,get:function(){return X.configParse15}}),Object.defineProperty(f,"configParse16",{enumerable:!0,get:function(){return X.configParse16}}),Object.defineProperty(f,"configParse17",{enumerable:!0,get:function(){return X.configParse17}}),Object.defineProperty(f,"configParse18",{enumerable:!0,get:function(){return X.configParse18}}),Object.defineProperty(f,"configParse28",{enumerable:!0,get:function(){return X.configParse28}}),Object.defineProperty(f,"configParse29",{enumerable:!0,get:function(){return X.configParse29}}),Object.defineProperty(f,"configParse40",{enumerable:!0,get:function(){return X.configParse40}}),Object.defineProperty(f,"configParseBridge",{enumerable:!0,get:function(){return X.configParseBridge}}),Object.defineProperty(f,"configParseGasLimitsPrices",{enumerable:!0,get:function(){return X.configParseGasLimitsPrices}}),Object.defineProperty(f,"configParseMasterAddress",{enumerable:!0,get:function(){return X.configParseMasterAddress}}),Object.defineProperty(f,"configParseMasterAddressRequired",{enumerable:!0,get:function(){return X.configParseMasterAddressRequired}}),Object.defineProperty(f,"configParseMsgPrices",{enumerable:!0,get:function(){return X.configParseMsgPrices}}),Object.defineProperty(f,"configParseValidatorSet",{enumerable:!0,get:function(){return X.configParseValidatorSet}}),Object.defineProperty(f,"configParseWorkchainDescriptor",{enumerable:!0,get:function(){return X.configParseWorkchainDescriptor}}),Object.defineProperty(f,"parseBridge",{enumerable:!0,get:function(){return X.parseBridge}}),Object.defineProperty(f,"parseProposalSetup",{enumerable:!0,get:function(){return X.parseProposalSetup}}),Object.defineProperty(f,"parseValidatorSet",{enumerable:!0,get:function(){return X.parseValidatorSet}}),Object.defineProperty(f,"parseVotingSetup",{enumerable:!0,get:function(){return X.parseVotingSetup}}),Object.defineProperty(f,"parseFullConfig",{enumerable:!0,get:function(){return X.parseFullConfig}}),Object.defineProperty(f,"parseFullerConfig",{enumerable:!0,get:function(){return X.parseFullerConfig}}),Object.defineProperty(f,"loadConfigParamById",{enumerable:!0,get:function(){return X.loadConfigParamById}}),Object.defineProperty(f,"loadConfigParamsAsSlice",{enumerable:!0,get:function(){return X.loadConfigParamsAsSlice}});var se=_(37553);Object.defineProperty(f,"computeExternalMessageFees",{enumerable:!0,get:function(){return se.computeExternalMessageFees}}),Object.defineProperty(f,"computeFwdFees",{enumerable:!0,get:function(){return se.computeFwdFees}}),Object.defineProperty(f,"computeGasPrices",{enumerable:!0,get:function(){return se.computeGasPrices}}),Object.defineProperty(f,"computeMessageForwardFees",{enumerable:!0,get:function(){return se.computeMessageForwardFees}}),Object.defineProperty(f,"computeStorageFees",{enumerable:!0,get:function(){return se.computeStorageFees}})},84879:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.JettonMaster=void 0;const h=_(21224);class w{static create(v){return new w(v)}constructor(v){this.address=v}async getWalletAddress(v,c){return(await v.get("get_wallet_address",[{type:"slice",cell:(0,h.beginCell)().storeAddress(c).endCell()}])).stack.readAddress()}async getJettonData(v){let c=await v.get("get_jetton_data",[]),d=c.stack.readBigNumber(),p=c.stack.readBoolean(),m=c.stack.readAddress(),C=c.stack.readCell(),x=c.stack.readCell();return{totalSupply:d,mintable:p,adminAddress:m,content:C,walletCode:x}}}f.JettonMaster=w},43328:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.JettonWallet=void 0;class _{static create(w){return new _(w)}constructor(w){this.address=w}async getBalance(w){return(await w.getState()).state.type!=="active"?0n:(await w.get("get_wallet_data",[])).stack.readBigNumber()}}f.JettonWallet=_},66097:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.MultisigOrder=void 0;const h=_(88473),w=_(21224);class E{constructor(c){this.signatures={},this.payload=c}static fromCell(c){let d=c.beginParse(),p=d.loadMaybeRef()?.beginParse();const m=d.asCell();let C=new E(m);if(p){for(;p.remainingBits>0;){const x=p.loadBuffer(64),R=p.loadUint(8);C.signatures[R]=x,p.remainingRefs>0?p=p.loadRef().asSlice():p.skip(1)}p.endParse()}return C}static fromPayload(c){return new E(c)}addSignature(c,d,p){const m=this.payload.hash();if(!(0,h.signVerify)(m,d,p.owners.get(c).slice(0,-1)))throw Error("invalid signature");this.signatures[c]=d}sign(c,d){const p=this.payload.hash();return this.signatures[c]=(0,h.sign)(p,d),p}unionSignatures(c){this.signatures=Object.assign({},this.signatures,c.signatures)}clearSignatures(){this.signatures={}}toCell(c){let d=(0,w.beginCell)().storeBit(0);for(const p in this.signatures){const m=this.signatures[p];d=(0,w.beginCell)().storeBit(1).storeRef((0,w.beginCell)().storeBuffer(m).storeUint(parseInt(p),8).storeBuilder(d).endCell())}return(0,w.beginCell)().storeUint(c,8).storeBuilder(d).storeBuilder(this.payload.asBuilder()).endCell()}}f.MultisigOrder=E},47290:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.MultisigOrderBuilder=void 0;const h=_(21224),w=_(66097);class E{constructor(c,d){this.messages=(0,h.beginCell)(),this.queryId=0n,this.walletId=c,this.queryOffset=d||7200}addMessage(c,d){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(d,8),this.messages.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(c)).endCell())}clearMessages(){this.messages=(0,h.beginCell)()}build(){return w.MultisigOrder.fromPayload((0,h.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const c=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=c<<32n}}f.MultisigOrderBuilder=E},1284:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.MultisigWallet=void 0;const w=_(88473),E=_(21224),v=E.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class c{constructor(p,m,C,x,R){this.provider=null,this.owners=E.Dictionary.empty(),this.workchain=m,this.walletId=C,this.k=x;for(let S=0;S<p.length;S+=1)this.owners.set(S,h.concat([p[S],h.alloc(1)]));this.init={code:v,data:(0,E.beginCell)().storeUint(this.walletId,32).storeUint(this.owners.size,8).storeUint(this.k,8).storeUint(0,64).storeDict(this.owners,E.Dictionary.Keys.Uint(8),E.Dictionary.Values.Buffer(33)).storeBit(0).endCell()},this.address=R?.address||(0,E.contractAddress)(m,this.init),R?.provider?this.provider=R.provider:R?.client&&(this.provider=R.client.provider(this.address,{code:this.init.code,data:this.init.data}))}static async fromAddress(p,m){let C;if(m.provider)C=m.provider;else{if(!m.client)throw Error("Either provider or client must be specified");C=m.client.provider(p,{code:null,data:null})}const x=(await C.getState()).state;if(x.type!=="active")throw Error("Contract must be active");const R=E.Cell.fromBoc(x.data)[0].beginParse(),S=R.loadUint(32);R.skip(8);const O=R.loadUint(8);R.skip(64);const M=R.loadDict(E.Dictionary.Keys.Uint(8),E.Dictionary.Values.Buffer(33));let k=[];for(const[q,b]of M){const F=b.subarray(0,32);k.push(F)}return new c(k,p.workChain,S,O,{address:p,provider:C,client:m.client})}async deployExternal(p){if(!p&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");p||(p=this.provider),await p.external(E.Cell.EMPTY)}async deployInternal(p,m=1000000000n){await p.send({sendMode:E.SendMode.PAY_GAS_SEPARATELY+E.SendMode.IGNORE_ERRORS,to:this.address,value:m,init:this.init,body:E.Cell.EMPTY,bounce:!0})}async sendOrder(p,m,C){if(!C&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");C||(C=this.provider);let x=(0,w.keyPairFromSecretKey)(m).publicKey,R=this.getOwnerIdByPubkey(x),S=p.toCell(R),O=(0,w.sign)(S.hash(),m);S=(0,E.beginCell)().storeBuffer(O).storeSlice(S.asSlice()).endCell(),await C.external(S)}async sendOrderWithoutSecretKey(p,m,C,x){if(!x&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");x||(x=this.provider);let R=p.toCell(C);R=(0,E.beginCell)().storeBuffer(m).storeSlice(R.asSlice()).endCell(),await x.external(R)}getOwnerIdByPubkey(p){for(const[m,C]of this.owners)if(C.subarray(0,32).equals(p))return m;throw Error("public key is not an owner")}}f.MultisigWallet=c},37553:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.computeStorageFees=w,f.computeFwdFees=E,f.computeGasPrices=v,f.computeExternalMessageFees=c,f.computeMessageForwardFees=d;const h=_(21224);function w(C){const{lastPaid:x,now:R,storagePrices:S,storageStat:O,special:M,masterchain:k}=C;if(R<=x||S.length===0||R<S[0].utime_since||M)return BigInt(0);let q=Math.max(x,S[0].utime_since),b=BigInt(0);for(let F=0;F<S.length&&q<R;F++){let G=F<S.length-1?Math.min(R,S[F+1].utime_since):R,ue=BigInt(0);if(q<G){let le=G-q;ue+=BigInt(O.cells)*(k?S[F].mc_cell_price_ps:S[F].cell_price_ps),ue+=BigInt(O.bits)*(k?S[F].mc_bit_price_ps:S[F].bit_price_ps),ue=ue*BigInt(le)}q=G,b+=ue}return m(b)}function E(C,x,R){return C.lumpPrice+m(C.bitPrice*R+C.cellPrice*x)}function v(C,x){return C<=x.flatLimit?x.flatPrice:x.flatPrice+(x.price*(C-x.flatLimit)>>16n)}function c(C,x){let R=p(x);return R.bits-=x.bits.length,R.cells-=1,E(C,BigInt(R.cells),BigInt(R.bits))}function d(C,x){let R=(0,h.loadMessageRelaxed)(x.beginParse()),S={bits:0,cells:0};if(R.init){const b=new h.Cell().asBuilder();(0,h.storeStateInit)(R.init)(b);const F=b.endCell();let G=p(F);G.bits-=F.bits.length,G.cells-=1,S.bits+=G.bits,S.cells+=G.cells}let O=p(R.body);O.bits-=R.body.bits.length,O.cells-=1,S.bits+=O.bits,S.cells+=O.cells;let M=E(C,BigInt(S.cells),BigInt(S.bits)),k=M*BigInt(C.firstFrac)>>16n,q=M-k;return{fees:k,remaining:q}}function p(C){let x=C.bits.length,R=1;for(let S of C.refs){let O=p(S);R+=O.cells,x+=O.bits}return{bits:x,cells:R}}function m(C){let x=C%65536n,R=C>>16n;return x!==0n&&(R+=1n),R}},74973:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.toUrlSafe=_;function _(h){for(;h.indexOf("/")>=0;)h=h.replace("/","_");for(;h.indexOf("+")>=0;)h=h.replace("+","-");for(;h.indexOf("=")>=0;)h=h.replace("=","");return h}},74578:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV1R1=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey)}constructor(d,p){this.workchain=d,this.publicKey=p;let m=w.Cell.fromBoc(h.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],C=(0,w.beginCell)().storeUint(0,32).storeBuffer(p).endCell();this.init={code:m,data:C},this.address=(0,w.contractAddress)(d,{code:m,data:C})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){let p=await d.getState();return p.state.type==="active"?w.Cell.fromBoc(p.state.data)[0].beginParse().loadUint(32):0}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){let p=w.SendMode.PAY_GAS_SEPARATELY;return d.sendMode!==null&&d.sendMode!==void 0&&(p=d.sendMode),(0,E.createWalletTransferV1)({seqno:d.seqno,sendMode:p,secretKey:d.secretKey,message:d.message})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,message:(0,w.internal)({to:m.to,value:m.value,extracurrency:m.extracurrency,init:m.init,body:m.body,bounce:m.bounce})});await this.send(d,x)}}}}f.WalletContractV1R1=v},81375:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV1R2=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey)}constructor(d,p){this.workchain=d,this.publicKey=p;let m=w.Cell.fromBoc(h.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],C=(0,w.beginCell)().storeUint(0,32).storeBuffer(p).endCell();this.init={code:m,data:C},this.address=(0,w.contractAddress)(d,{code:m,data:C})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){return(await d.getState()).state.type==="active"?(await d.get("seqno",[])).stack.readNumber():0}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){let p=w.SendMode.PAY_GAS_SEPARATELY;return d.sendMode!==null&&d.sendMode!==void 0&&(p=d.sendMode),(0,E.createWalletTransferV1)({seqno:d.seqno,sendMode:p,secretKey:d.secretKey,message:d.message})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,message:(0,w.internal)({to:m.to,value:m.value,extracurrency:m.extracurrency,init:m.init,body:m.body,bounce:m.bounce})});await this.send(d,x)}}}}f.WalletContractV1R2=v},46760:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV1R3=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey)}constructor(d,p){this.workchain=d,this.publicKey=p;let m=w.Cell.fromBoc(h.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],C=(0,w.beginCell)().storeUint(0,32).storeBuffer(p).endCell();this.init={code:m,data:C},this.address=(0,w.contractAddress)(d,{code:m,data:C})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){return(await d.getState()).state.type==="active"?(await d.get("seqno",[])).stack.readNumber():0}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){let p=w.SendMode.PAY_GAS_SEPARATELY;return d.sendMode!==null&&d.sendMode!==void 0&&(p=d.sendMode),(0,E.createWalletTransferV1)({seqno:d.seqno,sendMode:p,secretKey:d.secretKey,message:d.message})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,message:(0,w.internal)({to:m.to,value:m.value,init:m.init,body:m.body,bounce:m.bounce})});await this.send(d,x)}}}}f.WalletContractV1R3=v},94491:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV2R1=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey)}constructor(d,p){this.workchain=d,this.publicKey=p;let m=w.Cell.fromBoc(h.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],C=(0,w.beginCell)().storeUint(0,32).storeBuffer(p).endCell();this.init={code:m,data:C},this.address=(0,w.contractAddress)(d,{code:m,data:C})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){return(await d.getState()).state.type==="active"?(await d.get("seqno",[])).stack.readNumber():0}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){let p=w.SendMode.PAY_GAS_SEPARATELY;return d.sendMode!==null&&d.sendMode!==void 0&&(p=d.sendMode),(0,E.createWalletTransferV2)({seqno:d.seqno,sendMode:p,secretKey:d.secretKey,messages:d.messages,timeout:d.timeout})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,messages:[(0,w.internal)({to:m.to,value:m.value,extracurrency:m.extracurrency,init:m.init,body:m.body,bounce:m.bounce})]});await this.send(d,x)}}}}f.WalletContractV2R1=v},83166:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV2R2=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey)}constructor(d,p){this.workchain=d,this.publicKey=p;let m=w.Cell.fromBoc(h.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],C=(0,w.beginCell)().storeUint(0,32).storeBuffer(p).endCell();this.init={code:m,data:C},this.address=(0,w.contractAddress)(d,{code:m,data:C})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){return(await d.getState()).state.type==="active"?(await d.get("seqno",[])).stack.readNumber():0}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){let p=w.SendMode.PAY_GAS_SEPARATELY;return d.sendMode!==null&&d.sendMode!==void 0&&(p=d.sendMode),(0,E.createWalletTransferV2)({seqno:d.seqno,sendMode:p,secretKey:d.secretKey,messages:d.messages,timeout:d.timeout})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,messages:[(0,w.internal)({to:m.to,value:m.value,extracurrency:m.extracurrency,init:m.init,body:m.body,bounce:m.bounce})]});await this.send(d,x)}}}}f.WalletContractV2R2=v},44320:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV3R1=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey,d.walletId)}constructor(d,p,m){this.workchain=d,this.publicKey=p,m!=null?this.walletId=m:this.walletId=698983191+d;let C=w.Cell.fromBoc(h.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],x=(0,w.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(p).endCell();this.init={code:C,data:x},this.address=(0,w.contractAddress)(d,{code:C,data:x})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){return(await d.getState()).state.type==="active"?(await d.get("seqno",[])).stack.readNumber():0}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){return(0,E.createWalletTransferV3)({...d,sendMode:d.sendMode??w.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,messages:[(0,w.internal)({to:m.to,value:m.value,extracurrency:m.extracurrency,init:m.init,body:m.body,bounce:m.bounce})]});await this.send(d,x)}}}}f.WalletContractV3R1=v},64601:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV3R2=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey,d.walletId)}constructor(d,p,m){this.workchain=d,this.publicKey=p,m!=null?this.walletId=m:this.walletId=698983191+d;let C=w.Cell.fromBoc(h.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],x=(0,w.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(p).endCell();this.init={code:C,data:x},this.address=(0,w.contractAddress)(d,{code:C,data:x})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){return(await d.getState()).state.type==="active"?(await d.get("seqno",[])).stack.readNumber():0}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){return(0,E.createWalletTransferV3)({...d,sendMode:d.sendMode??w.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,messages:[(0,w.internal)({to:m.to,value:m.value,extracurrency:m.extracurrency,init:m.init,body:m.body,bounce:m.bounce})]});await this.send(d,x)}}}}f.WalletContractV3R2=v},27944:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(92831),f),w(_(65376),f)},85941:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(99677),f),w(_(58552),f),w(_(56039),f)},71350:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(99715),f),w(_(59702),f),w(_(86901),f)},75655:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.createWalletTransferV1=R,f.createWalletTransferV2=S,f.createWalletTransferV3=O,f.createWalletTransferV4=M,f.createWalletTransferV5Beta=k,f.createWalletTransferV5R1=q;const h=_(21224),w=_(88473),E=_(99677),v=_(58552),c=_(59093),d=_(99715),p=_(59702),m=_(65376);function C(b,F){return(0,h.beginCell)().storeBuffer(b).storeBuilder(F).endCell()}function x(b,F){return(0,h.beginCell)().storeBuilder(F).storeBuffer(b).endCell()}function R(b){let F=(0,h.beginCell)().storeUint(b.seqno,32);b.message&&(F.storeUint(b.sendMode,8),F.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(b.message))));let G=(0,w.sign)(F.endCell().hash(),b.secretKey);return(0,h.beginCell)().storeBuffer(G).storeBuilder(F).endCell()}function S(b){if(b.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let F=(0,h.beginCell)().storeUint(b.seqno,32);if(b.seqno===0)for(let le=0;le<32;le++)F.storeBit(1);else F.storeUint(b.timeout||Math.floor(Date.now()/1e3)+60,32);for(let le of b.messages)F.storeUint(b.sendMode,8),F.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(le)));let G=(0,w.sign)(F.endCell().hash(),b.secretKey);return(0,h.beginCell)().storeBuffer(G).storeBuilder(F).endCell()}function O(b){if(b.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let F=(0,h.beginCell)().storeUint(b.walletId,32);if(b.seqno===0)for(let G=0;G<32;G++)F.storeBit(1);else F.storeUint(b.timeout||Math.floor(Date.now()/1e3)+60,32);F.storeUint(b.seqno,32);for(let G of b.messages)F.storeUint(b.sendMode,8),F.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(G)));return(0,c.signPayload)(b,F,C)}function M(b){let F=(0,h.beginCell)().storeUint(b.walletId,32);if(b.seqno===0)for(let G=0;G<32;G++)F.storeBit(1);else F.storeUint(b.timeout||Math.floor(Date.now()/1e3)+60,32);return F.storeUint(b.seqno,32),F.store((0,m.storeExtendedAction)(b.action)),(0,c.signPayload)(b,F,C)}function k(b){if(b.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if(b.authType==="extension")return(0,h.beginCell)().storeUint(E.WalletContractV5Beta.OpCodes.auth_extension,32).store((0,v.storeOutListExtendedV5Beta)(b.actions)).endCell();const F=(0,h.beginCell)().storeUint(b.authType==="internal"?E.WalletContractV5Beta.OpCodes.auth_signed_internal:E.WalletContractV5Beta.OpCodes.auth_signed_external,32).store(b.walletId);if(b.seqno===0)for(let G=0;G<32;G++)F.storeBit(1);else F.storeUint(b.timeout||Math.floor(Date.now()/1e3)+60,32);return F.storeUint(b.seqno,32).store((0,v.storeOutListExtendedV5Beta)(b.actions)),(0,c.signPayload)(b,F,x)}function q(b){if(b.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if(b={...b},b.authType==="extension")return(0,h.beginCell)().storeUint(d.WalletContractV5R1.OpCodes.auth_extension,32).storeUint(b.queryId??0,64).store((0,p.storeOutListExtendedV5R1)(b.actions)).endCell();b.actions=(0,p.patchV5R1ActionsSendMode)(b.actions,b.authType);const F=(0,h.beginCell)().storeUint(b.authType==="internal"?d.WalletContractV5R1.OpCodes.auth_signed_internal:d.WalletContractV5R1.OpCodes.auth_signed_external,32).store(b.walletId);if(b.seqno===0)for(let G=0;G<32;G++)F.storeBit(1);else F.storeUint(b.timeout||Math.floor(Date.now()/1e3)+60,32);return F.storeUint(b.seqno,32).store((0,p.storeOutListExtendedV5R1)(b.actions)),(0,c.signPayload)(b,F,x)}},59093:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.signPayload=w;const h=_(88473);function w(E,v,c){return"secretKey"in E?c((0,h.sign)(v.endCell().hash(),E.secretKey),v):E.signer(v.endCell()).then(d=>c(d,v))}},92831:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV4=void 0;const w=_(21224),E=_(75655);class v{static create(d){return new v(d.workchain,d.publicKey,d.walletId)}constructor(d,p,m){this.workchain=d,this.publicKey=p,m!=null?this.walletId=m:this.walletId=698983191+d;let C=w.Cell.fromBoc(h.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],x=(0,w.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:C,data:x},this.address=(0,w.contractAddress)(d,{code:C,data:x})}async getBalance(d){return(await d.getState()).balance}async getSeqno(d){return(await d.getState()).state.type==="active"?(await d.get("seqno",[])).stack.readNumber():0}async getIsPluginInstalled(d,p){if((await d.getState()).state.type!=="active")return!1;const C=BigInt(p.workChain),x=BigInt("0x"+p.hash.toString("hex"));return(await d.get("is_plugin_installed",[{type:"int",value:C},{type:"int",value:x}])).stack.readBoolean()}async getPluginsArray(d){return(await d.getState()).state.type!=="active"?[]:(await d.get("get_plugin_list",[])).stack.readLispList().map(C=>{if(C.type!=="tuple")throw Error("Not a tuple");const x=new w.TupleReader(C.items),R=x.readNumber(),O=x.readBigNumber().toString(16).padStart(64,"0");return w.Address.parseRaw(`${R}:${O}`)})}async send(d,p){await d.external(p)}async sendTransfer(d,p){let m=this.createTransfer(p);await this.send(d,m)}createTransfer(d){return this.createRequest({seqno:d.seqno,timeout:d.timeout,action:{type:"sendMsg",messages:d.messages,sendMode:d.sendMode},..."secretKey"in d?{secretKey:d.secretKey}:{signer:d.signer}})}async sendRequest(d,p){const m=await this.createRequest(p);await this.send(d,m)}createRequest(d){return(0,E.createWalletTransferV4)({...d,walletId:this.walletId})}sender(d,p){return{send:async m=>{let C=await this.getSeqno(d),x=this.createTransfer({seqno:C,secretKey:p,sendMode:m.sendMode,messages:[(0,w.internal)({to:m.to,value:m.value,extracurrency:m.extracurrency,init:m.init,body:m.body,bounce:m.bounce})]});await this.send(d,x)}}}async sendAddPlugin(d,p){const m=await this.createAddPlugin(p);return await this.send(d,m)}async sendRemovePlugin(d,p){const m=await this.createRemovePlugin(p);return await this.send(d,m)}async sendAddAndDeployPlugin(d,p){const m=await this.createAddAndDeployPlugin(p);return await this.send(d,m)}createAddPlugin(d){return this.createRequest({action:{type:"addPlugin",address:d.address,forwardAmount:d.forwardAmount,queryId:d.queryId},...d})}createRemovePlugin(d){return this.createRequest({action:{type:"removePlugin",address:d.address,forwardAmount:d.forwardAmount,queryId:d.queryId},...d})}createAddAndDeployPlugin(d){return this.createRequest({action:{type:"addAndDeployPlugin",workchain:d.workchain,stateInit:d.stateInit,body:d.body,forwardAmount:d.forwardAmount},...d})}async sendPluginRequestFunds(d,p,m){await d.internal(p,{value:m.forwardAmount,body:this.createPluginRequestFundsMessage(m),sendMode:m.sendMode})}createPluginRequestFundsMessage(d){return(0,w.beginCell)().storeUint(1886156135,32).storeUint(d.queryId??0,64).storeCoins(d.toncoinsToWithdraw).storeDict(null).endCell()}async sendPluginRemovePlugin(d,p,m,C){await d.internal(p,{value:m,body:this.createPluginRemovePluginMessage(C)})}createPluginRemovePluginMessage(d){return(0,w.beginCell)().storeUint(1685288050,32).storeUint(d??0,64).endCell()}}f.WalletContractV4=v},65376:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeExtendedAction=w,f.loadExtendedAction=E;const h=_(21224);function w(v){return c=>{switch(v.type){case"sendMsg":c.storeUint(0,8);for(let d of v.messages)c.storeUint(v.sendMode??h.SendMode.NONE,8),c.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(d)));break;case"addAndDeployPlugin":c.storeUint(1,8),c.storeInt(v.workchain,8),c.storeCoins(v.forwardAmount),c.storeRef((0,h.beginCell)().store((0,h.storeStateInit)(v.stateInit))),c.storeRef(v.body);break;case"addPlugin":c.storeUint(2,8),c.storeInt(v.address.workChain,8),c.storeBuffer(v.address.hash),c.storeCoins(v.forwardAmount),c.storeUint(v.queryId??0n,64);break;case"removePlugin":c.storeUint(3,8),c.storeInt(v.address.workChain,8),c.storeBuffer(v.address.hash),c.storeCoins(v.forwardAmount),c.storeUint(v.queryId??0n,64);break;default:throw new Error("Unsupported plugin action")}}}function E(v){const c=v.loadUint(8);switch(c){case 0:{const d=[];let p;for(;v.remainingRefs>0;){if(v.remainingBits<8)throw new Error("Invalid sendMsg action: insufficient bits for send mode");const m=v.loadUint(8),C=v.loadRef(),x=(0,h.loadMessageRelaxed)(C.beginParse());if(p===void 0)p=m;else if(p!==m)throw new Error("Invalid sendMsg action: mixed send modes are not supported");d.push(x)}return{type:"sendMsg",messages:d,sendMode:p}}case 1:{const d=v.loadInt(8),p=v.loadCoins(),m=(0,h.loadStateInit)(v.loadRef().beginParse()),C=v.loadRef();return{type:"addAndDeployPlugin",workchain:d,stateInit:m,body:C,forwardAmount:p}}case 2:{const d=v.loadInt(8),p=v.loadBuffer(32),m=v.loadCoins(),C=v.loadUintBig(64);return{type:"addPlugin",address:new h.Address(d,p),forwardAmount:m,queryId:C===0n?void 0:C}}case 3:{const d=v.loadInt(8),p=v.loadBuffer(32),m=v.loadCoins(),C=v.loadUintBig(64);return{type:"removePlugin",address:new h.Address(d,p),forwardAmount:m,queryId:C===0n?void 0:C}}default:throw new Error(`Unsupported action with opcode ${c}`)}}},99677:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV5Beta=void 0;const w=_(21224),E=_(75655),v=_(56039);class c{static create(p){const m={networkGlobalId:p.walletId?.networkGlobalId??-239,workchain:p?.walletId?.workchain??0,subwalletNumber:p?.walletId?.subwalletNumber??0,walletVersion:p?.walletId?.walletVersion??"v5"};return new c(m,p.publicKey)}constructor(p,m){this.walletId=p,this.publicKey=m,this.walletId=p;let C=w.Cell.fromBoc(h.from("te6cckEBAQEAIwAIQgLkzzsvTG1qYeoPK1RH0mZ4WyavNjfbLe7mvNGqgm80Eg3NjhE=","base64"))[0],x=(0,w.beginCell)().storeInt(0,33).store((0,v.storeWalletIdV5Beta)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:C,data:x},this.address=(0,w.contractAddress)(this.walletId.workchain,{code:C,data:x})}async getBalance(p){return(await p.getState()).balance}async getSeqno(p){return(await p.getState()).state.type==="active"?(await p.get("seqno",[])).stack.readNumber():0}async getExtensions(p){return(await p.getState()).state.type==="active"?(await p.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(p){const m=await this.getExtensions(p);if(!m)return[];const C=w.Dictionary.loadDirect(w.Dictionary.Keys.BigUint(256),w.Dictionary.Values.BigInt(8),m);return C.keys().map(x=>{const R=C.get(x),S=x^R+1n;return w.Address.parseRaw(`${R}:${S.toString(16).padStart(64,"0")}`)})}async getIsSecretKeyAuthEnabled(p){return(await p.get("get_is_signature_auth_allowed",[])).stack.readNumber()!==0}async send(p,m){await p.external(m)}async sendTransfer(p,m){const C=await this.createTransfer(m);await this.send(p,C)}async sendAddExtension(p,m){const C=await this.createAddExtension(m);await this.send(p,C)}async sendRemoveExtension(p,m){const C=await this.createRemoveExtension(m);await this.send(p,C)}async sendActionsBatch(p,m){const C=await this.createRequest(m);await this.send(p,C)}createActions(p){return p.messages.map(C=>({type:"sendMsg",mode:p.sendMode,outMsg:C}))}createTransfer(p){return this.createRequest({...p,actions:this.createActions({messages:p.messages,sendMode:p.sendMode})})}createAddExtension(p){return this.createRequest({...p,actions:[{type:"addExtension",address:p.extensionAddress}]})}createRemoveExtension(p){return this.createRequest({...p,actions:[{type:"removeExtension",address:p.extensionAddress}]})}createRequest(p){return p.authType==="extension"?(0,E.createWalletTransferV5Beta)(p):(0,E.createWalletTransferV5Beta)({...p,walletId:(0,v.storeWalletIdV5Beta)(this.walletId)})}sender(p,m){return{send:async C=>{let x=await this.getSeqno(p),R=this.createTransfer({seqno:x,secretKey:m,sendMode:C.sendMode??w.SendMode.PAY_GAS_SEPARATELY+w.SendMode.IGNORE_ERRORS,messages:[(0,w.internal)({to:C.to,value:C.value,extracurrency:C.extracurrency,init:C.init,body:C.body,bounce:C.bounce})]});await this.send(p,R)}}}}f.WalletContractV5Beta=c,c.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396}},58552:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeOutActionExtendedV5Beta=C,f.loadOutActionV5BetaExtended=x,f.storeOutListExtendedV5Beta=R,f.loadOutListExtendedV5Beta=S;const h=_(21224),w=_(16198),E=550222170;function v(O){return M=>{M.storeUint(E,32).storeUint(O.isEnabled?1:0,1)}}const c=474012575;function d(O){return M=>{M.storeUint(c,32).storeAddress(O.address)}}const p=1588524196;function m(O){return M=>{M.storeUint(p,32).storeAddress(O.address)}}function C(O){switch(O.type){case"setIsPublicKeyEnabled":return v(O);case"addExtension":return d(O);case"removeExtension":return m(O);default:throw new Error("Unknown action type"+O?.type)}}function x(O){const M=O.loadUint(32);switch(M){case E:return{type:"setIsPublicKeyEnabled",isEnabled:!!O.loadUint(1)};case c:return{type:"addExtension",address:O.loadAddress()};case p:return{type:"removeExtension",address:O.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${M.toString(16)}`)}}function R(O){const[M,...k]=O;if(!M||!(0,w.isOutActionExtended)(M)){if(O.some(w.isOutActionExtended))throw new Error("Can't serialize actions list: all extended actions must be placed before out actions");return q=>{q.storeUint(0,1).storeRef((0,h.beginCell)().store((0,h.storeOutList)(O)).endCell())}}return q=>{q.storeUint(1,1).store(C(M)).storeRef((0,h.beginCell)().store(R(k)).endCell())}}function S(O){const M=[];for(;O.loadUint(1);){const q=x(O);M.push(q),O=O.loadRef().beginParse()}const k=(0,h.loadOutList)(O.loadRef().beginParse());if(k.some(q=>q.type==="setCode"))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5");return M.concat(k)}},56039:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.loadWalletIdV5Beta=v,f.storeWalletIdV5Beta=c;const w=_(21224),E={v5:0};function v(d){const p=new w.BitReader(new w.BitString(typeof d=="bigint"?h.from(d.toString(16),"hex"):d instanceof w.Slice?d.loadBuffer(10):d,0,80)),m=p.loadInt(32),C=p.loadInt(8),x=p.loadUint(8),R=p.loadUint(32),S=Object.entries(E).find(([O,M])=>M===x)?.[0];if(S===void 0)throw new Error(`Can't deserialize walletId: unknown wallet version ${x}`);return{networkGlobalId:m,workchain:C,walletVersion:S,subwalletNumber:R}}function c(d){return p=>{p.storeInt(d.networkGlobalId,32),p.storeInt(d.workchain,8),p.storeUint(E[d.walletVersion],8),p.storeUint(d.subwalletNumber,32)}}},16198:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.isOutActionExtended=_,f.isOutActionBasic=h;function _(w){return w.type==="setIsPublicKeyEnabled"||w.type==="addExtension"||w.type==="removeExtension"}function h(w){return!_(w)}},99715:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.WalletContractV5R1=void 0;const w=_(21224),E=_(75655),v=_(86901);class c{static create(p){let m=0;return"workchain"in p&&p.workchain!=null&&(m=p.workchain),p.walletId?.context&&(0,v.isWalletIdV5R1ClientContext)(p.walletId.context)&&p.walletId.context.workchain!=null&&(m=p.walletId.context.workchain),new c(m,p.publicKey,{networkGlobalId:p.walletId?.networkGlobalId??-239,context:p.walletId?.context??{workchain:0,walletVersion:"v5r1",subwalletNumber:0}})}constructor(p,m,C){this.publicKey=m,this.walletId=C,this.walletId=C;let x=w.Cell.fromBoc(h.from("b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e","hex"))[0],R=(0,w.beginCell)().storeUint(1,1).storeUint(0,32).store((0,v.storeWalletIdV5R1)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:x,data:R},this.address=(0,w.contractAddress)(p,{code:x,data:R})}async getBalance(p){return(await p.getState()).balance}async getSeqno(p){return(await p.getState()).state.type==="active"?(await p.get("seqno",[])).stack.readNumber():0}async getExtensions(p){return(await p.getState()).state.type==="active"?(await p.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(p){const m=await this.getExtensions(p);return m?w.Dictionary.loadDirect(w.Dictionary.Keys.BigUint(256),w.Dictionary.Values.BigInt(1),m).keys().map(x=>{const R=this.address.workChain;return w.Address.parseRaw(`${R}:${x.toString(16).padStart(64,"0")}`)}):[]}async getIsSecretKeyAuthEnabled(p){return(await p.get("is_signature_allowed",[])).stack.readBoolean()}async send(p,m){await p.external(m)}async sendTransfer(p,m){const C=await this.createTransfer(m);await this.send(p,C)}async sendAddExtension(p,m){const C=await this.createAddExtension(m);await this.send(p,C)}async sendRemoveExtension(p,m){const C=await this.createRemoveExtension(m);await this.send(p,C)}createActions(p){return p.messages.map(C=>({type:"sendMsg",mode:p.sendMode,outMsg:C}))}createTransfer(p){return this.createRequest({actions:this.createActions({messages:p.messages,sendMode:p.sendMode}),...p})}createAddExtension(p){return this.createRequest({actions:[{type:"addExtension",address:p.extensionAddress}],...p})}createRemoveExtension(p){return this.createRequest({actions:[{type:"removeExtension",address:p.extensionAddress}],...p})}createRequest(p){return p.authType==="extension"?(0,E.createWalletTransferV5R1)(p):(0,E.createWalletTransferV5R1)({...p,walletId:(0,v.storeWalletIdV5R1)(this.walletId)})}sender(p,m){return{send:async C=>{let x=await this.getSeqno(p),R=this.createTransfer({seqno:x,secretKey:m,sendMode:C.sendMode??w.SendMode.PAY_GAS_SEPARATELY+w.SendMode.IGNORE_ERRORS,messages:[(0,w.internal)({to:C.to,value:C.value,extracurrency:C.extracurrency,init:C.init,body:C.body,bounce:C.bounce})]});await this.send(p,R)}}}}f.WalletContractV5R1=c,c.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396}},59702:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.storeOutActionExtendedV5R1=C,f.loadOutActionExtendedV5R1=x,f.storeOutListExtendedV5R1=R,f.loadOutListExtendedV5R1=O,f.toSafeV5R1SendMode=M,f.patchV5R1ActionsSendMode=k;const h=_(21224),w=_(16198),E=4;function v(q){return b=>{b.storeUint(E,8).storeUint(q.isEnabled?1:0,1)}}const c=2;function d(q){return b=>{b.storeUint(c,8).storeAddress(q.address)}}const p=3;function m(q){return b=>{b.storeUint(p,8).storeAddress(q.address)}}function C(q){switch(q.type){case"setIsPublicKeyEnabled":return v(q);case"addExtension":return d(q);case"removeExtension":return m(q);default:throw new Error("Unknown action type"+q?.type)}}function x(q){const b=q.loadUint(8);switch(b){case E:return{type:"setIsPublicKeyEnabled",isEnabled:!!q.loadUint(1)};case c:return{type:"addExtension",address:q.loadAddress()};case p:return{type:"removeExtension",address:q.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${b.toString(16)}`)}}function R(q){const b=q.filter(w.isOutActionExtended),F=q.filter(w.isOutActionBasic);return G=>{const ue=F.length?(0,h.beginCell)().store((0,h.storeOutList)(F)):null;if(G.storeMaybeRef(ue),b.length===0)G.storeUint(0,1);else{const[le,...X]=b;G.storeUint(1,1).store(C(le)),X.length>0&&G.storeRef(S(X))}}}function S(q){const[b,...F]=q;let G=(0,h.beginCell)().store(C(b));return F.length>0&&(G=G.storeRef(S(F))),G.endCell()}function O(q){const b=[],F=q.loadMaybeRef();if(F){const G=(0,h.loadOutList)(F.beginParse());if(G.some(ue=>ue.type!=="sendMsg"))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5r1");b.push(...G)}if(q.loadBoolean()){const G=x(q);b.push(G)}for(;q.remainingRefs>0;){q=q.loadRef().beginParse();const G=x(q);b.push(G)}return b}function M(q,b){return b==="internal"||b==="extension"?q:q|h.SendMode.IGNORE_ERRORS}function k(q,b){return q.map(F=>F.type==="sendMsg"?{...F,mode:M(F.mode,b)}:F)}},86901:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.isWalletIdV5R1ClientContext=E,f.loadWalletIdV5R1=c,f.storeWalletIdV5R1=d;const w=_(21224);function E(p){return typeof p!="number"}const v={v5r1:0};function c(p,m){const C=new w.BitReader(new w.BitString(typeof p=="bigint"?h.from(p.toString(16).padStart(8,"0"),"hex"):p instanceof w.Slice?p.loadBuffer(4):p,0,32)).loadInt(32),x=BigInt(C)^BigInt(m),R=(0,w.beginCell)().storeInt(x,32).endCell().beginParse();if(R.loadUint(1)){const O=R.loadInt(8),M=R.loadUint(8),k=R.loadUint(15),q=Object.entries(v).find(([b,F])=>F===M)?.[0];if(q===void 0)throw new Error(`Can't deserialize walletId: unknown wallet version ${M}`);return{networkGlobalId:m,context:{walletVersion:q,workchain:O,subwalletNumber:k}}}else{const O=R.loadUint(31);return{networkGlobalId:m,context:O}}}function d(p){return m=>{let C;return E(p.context)?C=(0,w.beginCell)().storeUint(1,1).storeInt(p.context.workchain,8).storeUint(v[p.context.walletVersion],8).storeUint(p.context.subwalletNumber,15).endCell().beginParse().loadInt(32):C=(0,w.beginCell)().storeUint(0,1).storeUint(p.context,31).endCell().beginParse().loadInt(32),m.storeInt(BigInt(p.networkGlobalId)^BigInt(C),32)}}},46732:function(ie,f,_){"use strict";var h=_(85409);function w(Ge){"@babel/helpers - typeof";return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Be){return typeof Be}:function(Be){return Be&&typeof Symbol=="function"&&Be.constructor===Symbol&&Be!==Symbol.prototype?"symbol":typeof Be},w(Ge)}function E(Ge,Be){for(var We=0;We<Be.length;We++){var Ze=Be[We];Ze.enumerable=Ze.enumerable||!1,Ze.configurable=!0,"value"in Ze&&(Ze.writable=!0),Object.defineProperty(Ge,c(Ze.key),Ze)}}function v(Ge,Be,We){return Be&&E(Ge.prototype,Be),We&&E(Ge,We),Object.defineProperty(Ge,"prototype",{writable:!1}),Ge}function c(Ge){var Be=d(Ge,"string");return w(Be)==="symbol"?Be:String(Be)}function d(Ge,Be){if(w(Ge)!=="object"||Ge===null)return Ge;var We=Ge[Symbol.toPrimitive];if(We!==void 0){var Ze=We.call(Ge,Be||"default");if(w(Ze)!=="object")return Ze;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Be==="string"?String:Number)(Ge)}function p(Ge,Be){if(!(Ge instanceof Be))throw new TypeError("Cannot call a class as a function")}var m=_(35349),C=m.codes,x=C.ERR_AMBIGUOUS_ARGUMENT,R=C.ERR_INVALID_ARG_TYPE,S=C.ERR_INVALID_ARG_VALUE,O=C.ERR_INVALID_RETURN_VALUE,M=C.ERR_MISSING_ARGS,k=_(96342),q=_(1344),b=q.inspect,F=_(1344).types,G=F.isPromise,ue=F.isRegExp,le=_(43921)(),X=_(12197)(),se=_(11187)("RegExp.prototype.test"),de=new Map,ye,he,K,B,L;function $(){var Ge=_(31235);ye=Ge.isDeepEqual,he=Ge.isDeepStrictEqual}var T=/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,N=null,j=function(Be){return N[Be.charCodeAt(0)]},Y=!1,Z=ie.exports=Q,z={};function fe(Ge){throw Ge.message instanceof Error?Ge.message:new k(Ge)}function te(Ge,Be,We,Ze,_t){var Ft=arguments.length,gt;if(Ft===0)gt="Failed";else if(Ft===1)We=Ge,Ge=void 0;else{if(Y===!1){Y=!0;var lt=h.emitWarning?h.emitWarning:console.warn.bind(console);lt("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}Ft===2&&(Ze="!=")}if(We instanceof Error)throw We;var dt={actual:Ge,expected:Be,operator:Ze===void 0?"fail":Ze,stackStartFn:_t||te};We!==void 0&&(dt.message=We);var tt=new k(dt);throw gt&&(tt.message=gt,tt.generatedMessage=!0),tt}Z.fail=te,Z.AssertionError=k;function H(Ge,Be,We,Ze){if(!We){var _t=!1;if(Be===0)_t=!0,Ze="No value argument passed to `assert.ok()`";else if(Ze instanceof Error)throw Ze;var Ft=new k({actual:We,expected:!0,message:Ze,operator:"==",stackStartFn:Ge});throw Ft.generatedMessage=_t,Ft}}function Q(){for(var Ge=arguments.length,Be=new Array(Ge),We=0;We<Ge;We++)Be[We]=arguments[We];H.apply(void 0,[Q,Be.length].concat(Be))}Z.ok=Q,Z.equal=function Ge(Be,We,Ze){if(arguments.length<2)throw new M("actual","expected");Be!=We&&fe({actual:Be,expected:We,message:Ze,operator:"==",stackStartFn:Ge})},Z.notEqual=function Ge(Be,We,Ze){if(arguments.length<2)throw new M("actual","expected");Be==We&&fe({actual:Be,expected:We,message:Ze,operator:"!=",stackStartFn:Ge})},Z.deepEqual=function Ge(Be,We,Ze){if(arguments.length<2)throw new M("actual","expected");ye===void 0&&$(),ye(Be,We)||fe({actual:Be,expected:We,message:Ze,operator:"deepEqual",stackStartFn:Ge})},Z.notDeepEqual=function Ge(Be,We,Ze){if(arguments.length<2)throw new M("actual","expected");ye===void 0&&$(),ye(Be,We)&&fe({actual:Be,expected:We,message:Ze,operator:"notDeepEqual",stackStartFn:Ge})},Z.deepStrictEqual=function Ge(Be,We,Ze){if(arguments.length<2)throw new M("actual","expected");ye===void 0&&$(),he(Be,We)||fe({actual:Be,expected:We,message:Ze,operator:"deepStrictEqual",stackStartFn:Ge})},Z.notDeepStrictEqual=oe;function oe(Ge,Be,We){if(arguments.length<2)throw new M("actual","expected");ye===void 0&&$(),he(Ge,Be)&&fe({actual:Ge,expected:Be,message:We,operator:"notDeepStrictEqual",stackStartFn:oe})}Z.strictEqual=function Ge(Be,We,Ze){if(arguments.length<2)throw new M("actual","expected");X(Be,We)||fe({actual:Be,expected:We,message:Ze,operator:"strictEqual",stackStartFn:Ge})},Z.notStrictEqual=function Ge(Be,We,Ze){if(arguments.length<2)throw new M("actual","expected");X(Be,We)&&fe({actual:Be,expected:We,message:Ze,operator:"notStrictEqual",stackStartFn:Ge})};var _e=v(function Ge(Be,We,Ze){var _t=this;p(this,Ge),We.forEach(function(Ft){Ft in Be&&(Ze!==void 0&&typeof Ze[Ft]=="string"&&ue(Be[Ft])&&se(Be[Ft],Ze[Ft])?_t[Ft]=Ze[Ft]:_t[Ft]=Be[Ft])})});function ge(Ge,Be,We,Ze,_t,Ft){if(!(We in Ge)||!he(Ge[We],Be[We])){if(!Ze){var gt=new _e(Ge,_t),lt=new _e(Be,_t,Ge),dt=new k({actual:gt,expected:lt,operator:"deepStrictEqual",stackStartFn:Ft});throw dt.actual=Ge,dt.expected=Be,dt.operator=Ft.name,dt}fe({actual:Ge,expected:Be,message:Ze,operator:Ft.name,stackStartFn:Ft})}}function be(Ge,Be,We,Ze){if(typeof Be!="function"){if(ue(Be))return se(Be,Ge);if(arguments.length===2)throw new R("expected",["Function","RegExp"],Be);if(w(Ge)!=="object"||Ge===null){var _t=new k({actual:Ge,expected:Be,message:We,operator:"deepStrictEqual",stackStartFn:Ze});throw _t.operator=Ze.name,_t}var Ft=Object.keys(Be);if(Be instanceof Error)Ft.push("name","message");else if(Ft.length===0)throw new S("error",Be,"may not be an empty object");return ye===void 0&&$(),Ft.forEach(function(gt){typeof Ge[gt]=="string"&&ue(Be[gt])&&se(Be[gt],Ge[gt])||ge(Ge,Be,gt,We,Ft,Ze)}),!0}return Be.prototype!==void 0&&Ge instanceof Be?!0:Error.isPrototypeOf(Be)?!1:Be.call({},Ge)===!0}function we(Ge){if(typeof Ge!="function")throw new R("fn","Function",Ge);try{Ge()}catch(Be){return Be}return z}function Ee(Ge){return G(Ge)||Ge!==null&&w(Ge)==="object"&&typeof Ge.then=="function"&&typeof Ge.catch=="function"}function me(Ge){return Promise.resolve().then(function(){var Be;if(typeof Ge=="function"){if(Be=Ge(),!Ee(Be))throw new O("instance of Promise","promiseFn",Be)}else if(Ee(Ge))Be=Ge;else throw new R("promiseFn",["Function","Promise"],Ge);return Promise.resolve().then(function(){return Be}).then(function(){return z}).catch(function(We){return We})})}function Ke(Ge,Be,We,Ze){if(typeof We=="string"){if(arguments.length===4)throw new R("error",["Object","Error","Function","RegExp"],We);if(w(Be)==="object"&&Be!==null){if(Be.message===We)throw new x("error/message",'The error message "'.concat(Be.message,'" is identical to the message.'))}else if(Be===We)throw new x("error/message",'The error "'.concat(Be,'" is identical to the message.'));Ze=We,We=void 0}else if(We!=null&&w(We)!=="object"&&typeof We!="function")throw new R("error",["Object","Error","Function","RegExp"],We);if(Be===z){var _t="";We&&We.name&&(_t+=" (".concat(We.name,")")),_t+=Ze?": ".concat(Ze):".";var Ft=Ge.name==="rejects"?"rejection":"exception";fe({actual:void 0,expected:We,operator:Ge.name,message:"Missing expected ".concat(Ft).concat(_t),stackStartFn:Ge})}if(We&&!be(Be,We,Ze,Ge))throw Be}function He(Ge,Be,We,Ze){if(Be!==z){if(typeof We=="string"&&(Ze=We,We=void 0),!We||be(Be,We)){var _t=Ze?": ".concat(Ze):".",Ft=Ge.name==="doesNotReject"?"rejection":"exception";fe({actual:Be,expected:We,operator:Ge.name,message:"Got unwanted ".concat(Ft).concat(_t,`
|
||
`)+'Actual message: "'.concat(Be&&Be.message,'"'),stackStartFn:Ge})}throw Be}}Z.throws=function Ge(Be){for(var We=arguments.length,Ze=new Array(We>1?We-1:0),_t=1;_t<We;_t++)Ze[_t-1]=arguments[_t];Ke.apply(void 0,[Ge,we(Be)].concat(Ze))},Z.rejects=function Ge(Be){for(var We=arguments.length,Ze=new Array(We>1?We-1:0),_t=1;_t<We;_t++)Ze[_t-1]=arguments[_t];return me(Be).then(function(Ft){return Ke.apply(void 0,[Ge,Ft].concat(Ze))})},Z.doesNotThrow=function Ge(Be){for(var We=arguments.length,Ze=new Array(We>1?We-1:0),_t=1;_t<We;_t++)Ze[_t-1]=arguments[_t];He.apply(void 0,[Ge,we(Be)].concat(Ze))},Z.doesNotReject=function Ge(Be){for(var We=arguments.length,Ze=new Array(We>1?We-1:0),_t=1;_t<We;_t++)Ze[_t-1]=arguments[_t];return me(Be).then(function(Ft){return He.apply(void 0,[Ge,Ft].concat(Ze))})},Z.ifError=function Ge(Be){if(Be!=null){var We="ifError got unwanted exception: ";w(Be)==="object"&&typeof Be.message=="string"?Be.message.length===0&&Be.constructor?We+=Be.constructor.name:We+=Be.message:We+=b(Be);var Ze=new k({actual:Be,expected:null,operator:"ifError",message:We,stackStartFn:Ge}),_t=Be.stack;if(typeof _t=="string"){var Ft=_t.split(`
|
||
`);Ft.shift();for(var gt=Ze.stack.split(`
|
||
`),lt=0;lt<Ft.length;lt++){var dt=gt.indexOf(Ft[lt]);if(dt!==-1){gt=gt.slice(0,dt);break}}Ze.stack="".concat(gt.join(`
|
||
`),`
|
||
`).concat(Ft.join(`
|
||
`))}throw Ze}};function Ie(Ge,Be,We,Ze,_t){if(!ue(Be))throw new R("regexp","RegExp",Be);var Ft=_t==="match";if(typeof Ge!="string"||se(Be,Ge)!==Ft){if(We instanceof Error)throw We;var gt=!We;We=We||(typeof Ge!="string"?'The "string" argument must be of type string. Received type '+"".concat(w(Ge)," (").concat(b(Ge),")"):(Ft?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(b(Be),`. Input:
|
||
|
||
`).concat(b(Ge),`
|
||
`));var lt=new k({actual:Ge,expected:Be,message:We,operator:_t,stackStartFn:Ze});throw lt.generatedMessage=gt,lt}}Z.match=function Ge(Be,We,Ze){Ie(Be,We,Ze,Ge,"match")},Z.doesNotMatch=function Ge(Be,We,Ze){Ie(Be,We,Ze,Ge,"doesNotMatch")};function Le(){for(var Ge=arguments.length,Be=new Array(Ge),We=0;We<Ge;We++)Be[We]=arguments[We];H.apply(void 0,[Le,Be.length].concat(Be))}Z.strict=le(Le,Z,{equal:Z.strictEqual,deepEqual:Z.deepStrictEqual,notEqual:Z.notStrictEqual,notDeepEqual:Z.notDeepStrictEqual}),Z.strict.strict=Z.strict},96342:function(ie,f,_){"use strict";var h=_(85409);function w(fe,te){var H=Object.keys(fe);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(fe);te&&(Q=Q.filter(function(oe){return Object.getOwnPropertyDescriptor(fe,oe).enumerable})),H.push.apply(H,Q)}return H}function E(fe){for(var te=1;te<arguments.length;te++){var H=arguments[te]!=null?arguments[te]:{};te%2?w(Object(H),!0).forEach(function(Q){v(fe,Q,H[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(fe,Object.getOwnPropertyDescriptors(H)):w(Object(H)).forEach(function(Q){Object.defineProperty(fe,Q,Object.getOwnPropertyDescriptor(H,Q))})}return fe}function v(fe,te,H){return te=m(te),te in fe?Object.defineProperty(fe,te,{value:H,enumerable:!0,configurable:!0,writable:!0}):fe[te]=H,fe}function c(fe,te){if(!(fe instanceof te))throw new TypeError("Cannot call a class as a function")}function d(fe,te){for(var H=0;H<te.length;H++){var Q=te[H];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(fe,m(Q.key),Q)}}function p(fe,te,H){return te&&d(fe.prototype,te),H&&d(fe,H),Object.defineProperty(fe,"prototype",{writable:!1}),fe}function m(fe){var te=C(fe,"string");return ue(te)==="symbol"?te:String(te)}function C(fe,te){if(ue(fe)!=="object"||fe===null)return fe;var H=fe[Symbol.toPrimitive];if(H!==void 0){var Q=H.call(fe,te||"default");if(ue(Q)!=="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(te==="string"?String:Number)(fe)}function x(fe,te){if(typeof te!="function"&&te!==null)throw new TypeError("Super expression must either be null or a function");fe.prototype=Object.create(te&&te.prototype,{constructor:{value:fe,writable:!0,configurable:!0}}),Object.defineProperty(fe,"prototype",{writable:!1}),te&&F(fe,te)}function R(fe){var te=q();return function(){var Q=G(fe),oe;if(te){var _e=G(this).constructor;oe=Reflect.construct(Q,arguments,_e)}else oe=Q.apply(this,arguments);return S(this,oe)}}function S(fe,te){if(te&&(ue(te)==="object"||typeof te=="function"))return te;if(te!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O(fe)}function O(fe){if(fe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe}function M(fe){var te=typeof Map=="function"?new Map:void 0;return M=function(Q){if(Q===null||!b(Q))return Q;if(typeof Q!="function")throw new TypeError("Super expression must either be null or a function");if(typeof te<"u"){if(te.has(Q))return te.get(Q);te.set(Q,oe)}function oe(){return k(Q,arguments,G(this).constructor)}return oe.prototype=Object.create(Q.prototype,{constructor:{value:oe,enumerable:!1,writable:!0,configurable:!0}}),F(oe,Q)},M(fe)}function k(fe,te,H){return q()?k=Reflect.construct.bind():k=function(oe,_e,ge){var be=[null];be.push.apply(be,_e);var we=Function.bind.apply(oe,be),Ee=new we;return ge&&F(Ee,ge.prototype),Ee},k.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(fe){return Function.toString.call(fe).indexOf("[native code]")!==-1}function F(fe,te){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,oe){return Q.__proto__=oe,Q},F(fe,te)}function G(fe){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(H){return H.__proto__||Object.getPrototypeOf(H)},G(fe)}function ue(fe){"@babel/helpers - typeof";return ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},ue(fe)}var le=_(1344),X=le.inspect,se=_(35349),de=se.codes.ERR_INVALID_ARG_TYPE;function ye(fe,te,H){return(H===void 0||H>fe.length)&&(H=fe.length),fe.substring(H-te.length,H)===te}function he(fe,te){if(te=Math.floor(te),fe.length==0||te==0)return"";var H=fe.length*te;for(te=Math.floor(Math.log(te)/Math.log(2));te;)fe+=fe,te--;return fe+=fe.substring(0,H-fe.length),fe}var K="",B="",L="",$="",T={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},N=10;function j(fe){var te=Object.keys(fe),H=Object.create(Object.getPrototypeOf(fe));return te.forEach(function(Q){H[Q]=fe[Q]}),Object.defineProperty(H,"message",{value:fe.message}),H}function Y(fe){return X(fe,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Z(fe,te,H){var Q="",oe="",_e=0,ge="",be=!1,we=Y(fe),Ee=we.split(`
|
||
`),me=Y(te).split(`
|
||
`),Ke=0,He="";if(H==="strictEqual"&&ue(fe)==="object"&&ue(te)==="object"&&fe!==null&&te!==null&&(H="strictEqualObject"),Ee.length===1&&me.length===1&&Ee[0]!==me[0]){var Ie=Ee[0].length+me[0].length;if(Ie<=N){if((ue(fe)!=="object"||fe===null)&&(ue(te)!=="object"||te===null)&&(fe!==0||te!==0))return"".concat(T[H],`
|
||
|
||
`)+"".concat(Ee[0]," !== ").concat(me[0],`
|
||
`)}else if(H!=="strictEqualObject"){var Le=h.stderr&&h.stderr.isTTY?h.stderr.columns:80;if(Ie<Le){for(;Ee[0][Ke]===me[0][Ke];)Ke++;Ke>2&&(He=`
|
||
`.concat(he(" ",Ke),"^"),Ke=0)}}}for(var Ge=Ee[Ee.length-1],Be=me[me.length-1];Ge===Be&&(Ke++<2?ge=`
|
||
`.concat(Ge).concat(ge):Q=Ge,Ee.pop(),me.pop(),!(Ee.length===0||me.length===0));)Ge=Ee[Ee.length-1],Be=me[me.length-1];var We=Math.max(Ee.length,me.length);if(We===0){var Ze=we.split(`
|
||
`);if(Ze.length>30)for(Ze[26]="".concat(K,"...").concat($);Ze.length>27;)Ze.pop();return"".concat(T.notIdentical,`
|
||
|
||
`).concat(Ze.join(`
|
||
`),`
|
||
`)}Ke>3&&(ge=`
|
||
`.concat(K,"...").concat($).concat(ge),be=!0),Q!==""&&(ge=`
|
||
`.concat(Q).concat(ge),Q="");var _t=0,Ft=T[H]+`
|
||
`.concat(B,"+ actual").concat($," ").concat(L,"- expected").concat($),gt=" ".concat(K,"...").concat($," Lines skipped");for(Ke=0;Ke<We;Ke++){var lt=Ke-_e;if(Ee.length<Ke+1)lt>1&&Ke>2&&(lt>4?(oe+=`
|
||
`.concat(K,"...").concat($),be=!0):lt>3&&(oe+=`
|
||
`.concat(me[Ke-2]),_t++),oe+=`
|
||
`.concat(me[Ke-1]),_t++),_e=Ke,Q+=`
|
||
`.concat(L,"-").concat($," ").concat(me[Ke]),_t++;else if(me.length<Ke+1)lt>1&&Ke>2&&(lt>4?(oe+=`
|
||
`.concat(K,"...").concat($),be=!0):lt>3&&(oe+=`
|
||
`.concat(Ee[Ke-2]),_t++),oe+=`
|
||
`.concat(Ee[Ke-1]),_t++),_e=Ke,oe+=`
|
||
`.concat(B,"+").concat($," ").concat(Ee[Ke]),_t++;else{var dt=me[Ke],tt=Ee[Ke],rt=tt!==dt&&(!ye(tt,",")||tt.slice(0,-1)!==dt);rt&&ye(dt,",")&&dt.slice(0,-1)===tt&&(rt=!1,tt+=","),rt?(lt>1&&Ke>2&&(lt>4?(oe+=`
|
||
`.concat(K,"...").concat($),be=!0):lt>3&&(oe+=`
|
||
`.concat(Ee[Ke-2]),_t++),oe+=`
|
||
`.concat(Ee[Ke-1]),_t++),_e=Ke,oe+=`
|
||
`.concat(B,"+").concat($," ").concat(tt),Q+=`
|
||
`.concat(L,"-").concat($," ").concat(dt),_t+=2):(oe+=Q,Q="",(lt===1||Ke===0)&&(oe+=`
|
||
`.concat(tt),_t++))}if(_t>20&&Ke<We-2)return"".concat(Ft).concat(gt,`
|
||
`).concat(oe,`
|
||
`).concat(K,"...").concat($).concat(Q,`
|
||
`)+"".concat(K,"...").concat($)}return"".concat(Ft).concat(be?gt:"",`
|
||
`).concat(oe).concat(Q).concat(ge).concat(He)}var z=function(fe,te){x(Q,fe);var H=R(Q);function Q(oe){var _e;if(c(this,Q),ue(oe)!=="object"||oe===null)throw new de("options","Object",oe);var ge=oe.message,be=oe.operator,we=oe.stackStartFn,Ee=oe.actual,me=oe.expected,Ke=Error.stackTraceLimit;if(Error.stackTraceLimit=0,ge!=null)_e=H.call(this,String(ge));else if(h.stderr&&h.stderr.isTTY&&(h.stderr&&h.stderr.getColorDepth&&h.stderr.getColorDepth()!==1?(K="\x1B[34m",B="\x1B[32m",$="\x1B[39m",L="\x1B[31m"):(K="",B="",$="",L="")),ue(Ee)==="object"&&Ee!==null&&ue(me)==="object"&&me!==null&&"stack"in Ee&&Ee instanceof Error&&"stack"in me&&me instanceof Error&&(Ee=j(Ee),me=j(me)),be==="deepStrictEqual"||be==="strictEqual")_e=H.call(this,Z(Ee,me,be));else if(be==="notDeepStrictEqual"||be==="notStrictEqual"){var He=T[be],Ie=Y(Ee).split(`
|
||
`);if(be==="notStrictEqual"&&ue(Ee)==="object"&&Ee!==null&&(He=T.notStrictEqualObject),Ie.length>30)for(Ie[26]="".concat(K,"...").concat($);Ie.length>27;)Ie.pop();Ie.length===1?_e=H.call(this,"".concat(He," ").concat(Ie[0])):_e=H.call(this,"".concat(He,`
|
||
|
||
`).concat(Ie.join(`
|
||
`),`
|
||
`))}else{var Le=Y(Ee),Ge="",Be=T[be];be==="notDeepEqual"||be==="notEqual"?(Le="".concat(T[be],`
|
||
|
||
`).concat(Le),Le.length>1024&&(Le="".concat(Le.slice(0,1021),"..."))):(Ge="".concat(Y(me)),Le.length>512&&(Le="".concat(Le.slice(0,509),"...")),Ge.length>512&&(Ge="".concat(Ge.slice(0,509),"...")),be==="deepEqual"||be==="equal"?Le="".concat(Be,`
|
||
|
||
`).concat(Le,`
|
||
|
||
should equal
|
||
|
||
`):Ge=" ".concat(be," ").concat(Ge)),_e=H.call(this,"".concat(Le).concat(Ge))}return Error.stackTraceLimit=Ke,_e.generatedMessage=!ge,Object.defineProperty(O(_e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),_e.code="ERR_ASSERTION",_e.actual=Ee,_e.expected=me,_e.operator=be,Error.captureStackTrace&&Error.captureStackTrace(O(_e),we),_e.stack,_e.name="AssertionError",S(_e)}return p(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:te,value:function(_e,ge){return X(this,E(E({},ge),{},{customInspect:!1,depth:0}))}}]),Q}(M(Error),X.custom);ie.exports=z},35349:function(ie,f,_){"use strict";function h(X){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},h(X)}function w(X,se){for(var de=0;de<se.length;de++){var ye=se[de];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(X,v(ye.key),ye)}}function E(X,se,de){return se&&w(X.prototype,se),de&&w(X,de),Object.defineProperty(X,"prototype",{writable:!1}),X}function v(X){var se=c(X,"string");return h(se)==="symbol"?se:String(se)}function c(X,se){if(h(X)!=="object"||X===null)return X;var de=X[Symbol.toPrimitive];if(de!==void 0){var ye=de.call(X,se||"default");if(h(ye)!=="object")return ye;throw new TypeError("@@toPrimitive must return a primitive value.")}return(se==="string"?String:Number)(X)}function d(X,se){if(!(X instanceof se))throw new TypeError("Cannot call a class as a function")}function p(X,se){if(typeof se!="function"&&se!==null)throw new TypeError("Super expression must either be null or a function");X.prototype=Object.create(se&&se.prototype,{constructor:{value:X,writable:!0,configurable:!0}}),Object.defineProperty(X,"prototype",{writable:!1}),se&&m(X,se)}function m(X,se){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ye,he){return ye.__proto__=he,ye},m(X,se)}function C(X){var se=S();return function(){var ye=O(X),he;if(se){var K=O(this).constructor;he=Reflect.construct(ye,arguments,K)}else he=ye.apply(this,arguments);return x(this,he)}}function x(X,se){if(se&&(h(se)==="object"||typeof se=="function"))return se;if(se!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R(X)}function R(X){if(X===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return X}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(X){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(de){return de.__proto__||Object.getPrototypeOf(de)},O(X)}var M={},k,q;function b(X,se,de){de||(de=Error);function ye(K,B,L){return typeof se=="string"?se:se(K,B,L)}var he=function(K){p(L,K);var B=C(L);function L($,T,N){var j;return d(this,L),j=B.call(this,ye($,T,N)),j.code=X,j}return E(L)}(de);M[X]=he}function F(X,se){if(Array.isArray(X)){var de=X.length;return X=X.map(function(ye){return String(ye)}),de>2?"one of ".concat(se," ").concat(X.slice(0,de-1).join(", "),", or ")+X[de-1]:de===2?"one of ".concat(se," ").concat(X[0]," or ").concat(X[1]):"of ".concat(se," ").concat(X[0])}else return"of ".concat(se," ").concat(String(X))}function G(X,se,de){return X.substr(!de||de<0?0:+de,se.length)===se}function ue(X,se,de){return(de===void 0||de>X.length)&&(de=X.length),X.substring(de-se.length,de)===se}function le(X,se,de){return typeof de!="number"&&(de=0),de+se.length>X.length?!1:X.indexOf(se,de)!==-1}b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",function(X,se,de){k===void 0&&(k=_(46732)),k(typeof X=="string","'name' must be a string");var ye;typeof se=="string"&&G(se,"not ")?(ye="must not be",se=se.replace(/^not /,"")):ye="must be";var he;if(ue(X," argument"))he="The ".concat(X," ").concat(ye," ").concat(F(se,"type"));else{var K=le(X,".")?"property":"argument";he='The "'.concat(X,'" ').concat(K," ").concat(ye," ").concat(F(se,"type"))}return he+=". Received type ".concat(h(de)),he},TypeError),b("ERR_INVALID_ARG_VALUE",function(X,se){var de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";q===void 0&&(q=_(1344));var ye=q.inspect(se);return ye.length>128&&(ye="".concat(ye.slice(0,128),"...")),"The argument '".concat(X,"' ").concat(de,". Received ").concat(ye)},TypeError,RangeError),b("ERR_INVALID_RETURN_VALUE",function(X,se,de){var ye;return de&&de.constructor&&de.constructor.name?ye="instance of ".concat(de.constructor.name):ye="type ".concat(h(de)),"Expected ".concat(X,' to be returned from the "').concat(se,'"')+" function but got ".concat(ye,".")},TypeError),b("ERR_MISSING_ARGS",function(){for(var X=arguments.length,se=new Array(X),de=0;de<X;de++)se[de]=arguments[de];k===void 0&&(k=_(46732)),k(se.length>0,"At least one arg needs to be specified");var ye="The ",he=se.length;switch(se=se.map(function(K){return'"'.concat(K,'"')}),he){case 1:ye+="".concat(se[0]," argument");break;case 2:ye+="".concat(se[0]," and ").concat(se[1]," arguments");break;default:ye+=se.slice(0,he-1).join(", "),ye+=", and ".concat(se[he-1]," arguments");break}return"".concat(ye," must be specified")},TypeError),ie.exports.codes=M},31235:function(ie,f,_){"use strict";function h(rt,ke){return d(rt)||c(rt,ke)||E(rt,ke)||w()}function w(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E(rt,ke){if(rt){if(typeof rt=="string")return v(rt,ke);var xe=Object.prototype.toString.call(rt).slice(8,-1);if(xe==="Object"&&rt.constructor&&(xe=rt.constructor.name),xe==="Map"||xe==="Set")return Array.from(rt);if(xe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xe))return v(rt,ke)}}function v(rt,ke){(ke==null||ke>rt.length)&&(ke=rt.length);for(var xe=0,Pe=new Array(ke);xe<ke;xe++)Pe[xe]=rt[xe];return Pe}function c(rt,ke){var xe=rt==null?null:typeof Symbol<"u"&&rt[Symbol.iterator]||rt["@@iterator"];if(xe!=null){var Pe,it,Xe,st,It=[],ft=!0,Jt=!1;try{if(Xe=(xe=xe.call(rt)).next,ke===0){if(Object(xe)!==xe)return;ft=!1}else for(;!(ft=(Pe=Xe.call(xe)).done)&&(It.push(Pe.value),It.length!==ke);ft=!0);}catch(Ot){Jt=!0,it=Ot}finally{try{if(!ft&&xe.return!=null&&(st=xe.return(),Object(st)!==st))return}finally{if(Jt)throw it}}return It}}function d(rt){if(Array.isArray(rt))return rt}function p(rt){"@babel/helpers - typeof";return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ke){return typeof ke}:function(ke){return ke&&typeof Symbol=="function"&&ke.constructor===Symbol&&ke!==Symbol.prototype?"symbol":typeof ke},p(rt)}var m=/a/g.flags!==void 0,C=function(ke){var xe=[];return ke.forEach(function(Pe){return xe.push(Pe)}),xe},x=function(ke){var xe=[];return ke.forEach(function(Pe,it){return xe.push([it,Pe])}),xe},R=Object.is?Object.is:_(19068),S=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},O=Number.isNaN?Number.isNaN:_(14954);function M(rt){return rt.call.bind(rt)}var k=M(Object.prototype.hasOwnProperty),q=M(Object.prototype.propertyIsEnumerable),b=M(Object.prototype.toString),F=_(1344).types,G=F.isAnyArrayBuffer,ue=F.isArrayBufferView,le=F.isDate,X=F.isMap,se=F.isRegExp,de=F.isSet,ye=F.isNativeError,he=F.isBoxedPrimitive,K=F.isNumberObject,B=F.isStringObject,L=F.isBooleanObject,$=F.isBigIntObject,T=F.isSymbolObject,N=F.isFloat32Array,j=F.isFloat64Array;function Y(rt){if(rt.length===0||rt.length>10)return!0;for(var ke=0;ke<rt.length;ke++){var xe=rt.charCodeAt(ke);if(xe<48||xe>57)return!0}return rt.length===10&&rt>=Math.pow(2,32)}function Z(rt){return Object.keys(rt).filter(Y).concat(S(rt).filter(Object.prototype.propertyIsEnumerable.bind(rt)))}/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
* @license MIT
|
||
*/function z(rt,ke){if(rt===ke)return 0;for(var xe=rt.length,Pe=ke.length,it=0,Xe=Math.min(xe,Pe);it<Xe;++it)if(rt[it]!==ke[it]){xe=rt[it],Pe=ke[it];break}return xe<Pe?-1:Pe<xe?1:0}var fe=void 0,te=!0,H=!1,Q=0,oe=1,_e=2,ge=3;function be(rt,ke){return m?rt.source===ke.source&&rt.flags===ke.flags:RegExp.prototype.toString.call(rt)===RegExp.prototype.toString.call(ke)}function we(rt,ke){if(rt.byteLength!==ke.byteLength)return!1;for(var xe=0;xe<rt.byteLength;xe++)if(rt[xe]!==ke[xe])return!1;return!0}function Ee(rt,ke){return rt.byteLength!==ke.byteLength?!1:z(new Uint8Array(rt.buffer,rt.byteOffset,rt.byteLength),new Uint8Array(ke.buffer,ke.byteOffset,ke.byteLength))===0}function me(rt,ke){return rt.byteLength===ke.byteLength&&z(new Uint8Array(rt),new Uint8Array(ke))===0}function Ke(rt,ke){return K(rt)?K(ke)&&R(Number.prototype.valueOf.call(rt),Number.prototype.valueOf.call(ke)):B(rt)?B(ke)&&String.prototype.valueOf.call(rt)===String.prototype.valueOf.call(ke):L(rt)?L(ke)&&Boolean.prototype.valueOf.call(rt)===Boolean.prototype.valueOf.call(ke):$(rt)?$(ke)&&BigInt.prototype.valueOf.call(rt)===BigInt.prototype.valueOf.call(ke):T(ke)&&Symbol.prototype.valueOf.call(rt)===Symbol.prototype.valueOf.call(ke)}function He(rt,ke,xe,Pe){if(rt===ke)return rt!==0?!0:xe?R(rt,ke):!0;if(xe){if(p(rt)!=="object")return typeof rt=="number"&&O(rt)&&O(ke);if(p(ke)!=="object"||rt===null||ke===null||Object.getPrototypeOf(rt)!==Object.getPrototypeOf(ke))return!1}else{if(rt===null||p(rt)!=="object")return ke===null||p(ke)!=="object"?rt==ke:!1;if(ke===null||p(ke)!=="object")return!1}var it=b(rt),Xe=b(ke);if(it!==Xe)return!1;if(Array.isArray(rt)){if(rt.length!==ke.length)return!1;var st=Z(rt,fe),It=Z(ke,fe);return st.length!==It.length?!1:Le(rt,ke,xe,Pe,oe,st)}if(it==="[object Object]"&&(!X(rt)&&X(ke)||!de(rt)&&de(ke)))return!1;if(le(rt)){if(!le(ke)||Date.prototype.getTime.call(rt)!==Date.prototype.getTime.call(ke))return!1}else if(se(rt)){if(!se(ke)||!be(rt,ke))return!1}else if(ye(rt)||rt instanceof Error){if(rt.message!==ke.message||rt.name!==ke.name)return!1}else if(ue(rt)){if(!xe&&(N(rt)||j(rt))){if(!we(rt,ke))return!1}else if(!Ee(rt,ke))return!1;var ft=Z(rt,fe),Jt=Z(ke,fe);return ft.length!==Jt.length?!1:Le(rt,ke,xe,Pe,Q,ft)}else{if(de(rt))return!de(ke)||rt.size!==ke.size?!1:Le(rt,ke,xe,Pe,_e);if(X(rt))return!X(ke)||rt.size!==ke.size?!1:Le(rt,ke,xe,Pe,ge);if(G(rt)){if(!me(rt,ke))return!1}else if(he(rt)&&!Ke(rt,ke))return!1}return Le(rt,ke,xe,Pe,Q)}function Ie(rt,ke){return ke.filter(function(xe){return q(rt,xe)})}function Le(rt,ke,xe,Pe,it,Xe){if(arguments.length===5){Xe=Object.keys(rt);var st=Object.keys(ke);if(Xe.length!==st.length)return!1}for(var It=0;It<Xe.length;It++)if(!k(ke,Xe[It]))return!1;if(xe&&arguments.length===5){var ft=S(rt);if(ft.length!==0){var Jt=0;for(It=0;It<ft.length;It++){var Ot=ft[It];if(q(rt,Ot)){if(!q(ke,Ot))return!1;Xe.push(Ot),Jt++}else if(q(ke,Ot))return!1}var Ct=S(ke);if(ft.length!==Ct.length&&Ie(ke,Ct).length!==Jt)return!1}else{var qe=S(ke);if(qe.length!==0&&Ie(ke,qe).length!==0)return!1}}if(Xe.length===0&&(it===Q||it===oe&&rt.length===0||rt.size===0))return!0;if(Pe===void 0)Pe={val1:new Map,val2:new Map,position:0};else{var Yt=Pe.val1.get(rt);if(Yt!==void 0){var ot=Pe.val2.get(ke);if(ot!==void 0)return Yt===ot}Pe.position++}Pe.val1.set(rt,Pe.position),Pe.val2.set(ke,Pe.position);var Ae=lt(rt,ke,xe,Xe,Pe,it);return Pe.val1.delete(rt),Pe.val2.delete(ke),Ae}function Ge(rt,ke,xe,Pe){for(var it=C(rt),Xe=0;Xe<it.length;Xe++){var st=it[Xe];if(He(ke,st,xe,Pe))return rt.delete(st),!0}return!1}function Be(rt){switch(p(rt)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":rt=+rt;case"number":if(O(rt))return!1}return!0}function We(rt,ke,xe){var Pe=Be(xe);return Pe??(ke.has(Pe)&&!rt.has(Pe))}function Ze(rt,ke,xe,Pe,it){var Xe=Be(xe);if(Xe!=null)return Xe;var st=ke.get(Xe);return st===void 0&&!ke.has(Xe)||!He(Pe,st,!1,it)?!1:!rt.has(Xe)&&He(Pe,st,!1,it)}function _t(rt,ke,xe,Pe){for(var it=null,Xe=C(rt),st=0;st<Xe.length;st++){var It=Xe[st];if(p(It)==="object"&&It!==null)it===null&&(it=new Set),it.add(It);else if(!ke.has(It)){if(xe||!We(rt,ke,It))return!1;it===null&&(it=new Set),it.add(It)}}if(it!==null){for(var ft=C(ke),Jt=0;Jt<ft.length;Jt++){var Ot=ft[Jt];if(p(Ot)==="object"&&Ot!==null){if(!Ge(it,Ot,xe,Pe))return!1}else if(!xe&&!rt.has(Ot)&&!Ge(it,Ot,xe,Pe))return!1}return it.size===0}return!0}function Ft(rt,ke,xe,Pe,it,Xe){for(var st=C(rt),It=0;It<st.length;It++){var ft=st[It];if(He(xe,ft,it,Xe)&&He(Pe,ke.get(ft),it,Xe))return rt.delete(ft),!0}return!1}function gt(rt,ke,xe,Pe){for(var it=null,Xe=x(rt),st=0;st<Xe.length;st++){var It=h(Xe[st],2),ft=It[0],Jt=It[1];if(p(ft)==="object"&&ft!==null)it===null&&(it=new Set),it.add(ft);else{var Ot=ke.get(ft);if(Ot===void 0&&!ke.has(ft)||!He(Jt,Ot,xe,Pe)){if(xe||!Ze(rt,ke,ft,Jt,Pe))return!1;it===null&&(it=new Set),it.add(ft)}}}if(it!==null){for(var Ct=x(ke),qe=0;qe<Ct.length;qe++){var Yt=h(Ct[qe],2),ot=Yt[0],Ae=Yt[1];if(p(ot)==="object"&&ot!==null){if(!Ft(it,rt,ot,Ae,xe,Pe))return!1}else if(!xe&&(!rt.has(ot)||!He(rt.get(ot),Ae,!1,Pe))&&!Ft(it,rt,ot,Ae,!1,Pe))return!1}return it.size===0}return!0}function lt(rt,ke,xe,Pe,it,Xe){var st=0;if(Xe===_e){if(!_t(rt,ke,xe,it))return!1}else if(Xe===ge){if(!gt(rt,ke,xe,it))return!1}else if(Xe===oe)for(;st<rt.length;st++)if(k(rt,st)){if(!k(ke,st)||!He(rt[st],ke[st],xe,it))return!1}else{if(k(ke,st))return!1;for(var It=Object.keys(rt);st<It.length;st++){var ft=It[st];if(!k(ke,ft)||!He(rt[ft],ke[ft],xe,it))return!1}return It.length===Object.keys(ke).length}for(st=0;st<Pe.length;st++){var Jt=Pe[st];if(!He(rt[Jt],ke[Jt],xe,it))return!1}return!0}function dt(rt,ke){return He(rt,ke,H)}function tt(rt,ke){return He(rt,ke,te)}ie.exports={isDeepEqual:dt,isDeepStrictEqual:tt}},29622:function(ie,f,_){"use strict";var h=_(56608).Buffer;function w(E){if(E.length>=255)throw new TypeError("Alphabet too long");for(var v=new Uint8Array(256),c=0;c<v.length;c++)v[c]=255;for(var d=0;d<E.length;d++){var p=E.charAt(d),m=p.charCodeAt(0);if(v[m]!==255)throw new TypeError(p+" is ambiguous");v[m]=d}var C=E.length,x=E.charAt(0),R=Math.log(C)/Math.log(256),S=Math.log(256)/Math.log(C);function O(q){if((Array.isArray(q)||q instanceof Uint8Array)&&(q=h.from(q)),!h.isBuffer(q))throw new TypeError("Expected Buffer");if(q.length===0)return"";for(var b=0,F=0,G=0,ue=q.length;G!==ue&&q[G]===0;)G++,b++;for(var le=(ue-G)*S+1>>>0,X=new Uint8Array(le);G!==ue;){for(var se=q[G],de=0,ye=le-1;(se!==0||de<F)&&ye!==-1;ye--,de++)se+=256*X[ye]>>>0,X[ye]=se%C>>>0,se=se/C>>>0;if(se!==0)throw new Error("Non-zero carry");F=de,G++}for(var he=le-F;he!==le&&X[he]===0;)he++;for(var K=x.repeat(b);he<le;++he)K+=E.charAt(X[he]);return K}function M(q){if(typeof q!="string")throw new TypeError("Expected String");if(q.length===0)return h.alloc(0);for(var b=0,F=0,G=0;q[b]===x;)F++,b++;for(var ue=(q.length-b)*R+1>>>0,le=new Uint8Array(ue);b<q.length;){var X=q.charCodeAt(b);if(X>255)return;var se=v[X];if(se===255)return;for(var de=0,ye=ue-1;(se!==0||de<G)&&ye!==-1;ye--,de++)se+=C*le[ye]>>>0,le[ye]=se%256>>>0,se=se/256>>>0;if(se!==0)throw new Error("Non-zero carry");G=de,b++}for(var he=ue-G;he!==ue&&le[he]===0;)he++;var K=h.allocUnsafe(F+(ue-he));K.fill(0,0,F);for(var B=F;he!==ue;)K[B++]=le[he++];return K}function k(q){var b=M(q);if(b)return b;throw new Error("Non-base"+C+" character")}return{encode:O,decodeUnsafe:M,decode:k}}ie.exports=w},84933:function(ie,f){"use strict";f.byteLength=p,f.toByteArray=C,f.fromByteArray=S;for(var _=[],h=[],w=typeof Uint8Array<"u"?Uint8Array:Array,E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v=0,c=E.length;v<c;++v)_[v]=E[v],h[E.charCodeAt(v)]=v;h[45]=62,h[95]=63;function d(O){var M=O.length;if(M%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=O.indexOf("=");k===-1&&(k=M);var q=k===M?0:4-k%4;return[k,q]}function p(O){var M=d(O),k=M[0],q=M[1];return(k+q)*3/4-q}function m(O,M,k){return(M+k)*3/4-k}function C(O){var M,k=d(O),q=k[0],b=k[1],F=new w(m(O,q,b)),G=0,ue=b>0?q-4:q,le;for(le=0;le<ue;le+=4)M=h[O.charCodeAt(le)]<<18|h[O.charCodeAt(le+1)]<<12|h[O.charCodeAt(le+2)]<<6|h[O.charCodeAt(le+3)],F[G++]=M>>16&255,F[G++]=M>>8&255,F[G++]=M&255;return b===2&&(M=h[O.charCodeAt(le)]<<2|h[O.charCodeAt(le+1)]>>4,F[G++]=M&255),b===1&&(M=h[O.charCodeAt(le)]<<10|h[O.charCodeAt(le+1)]<<4|h[O.charCodeAt(le+2)]>>2,F[G++]=M>>8&255,F[G++]=M&255),F}function x(O){return _[O>>18&63]+_[O>>12&63]+_[O>>6&63]+_[O&63]}function R(O,M,k){for(var q,b=[],F=M;F<k;F+=3)q=(O[F]<<16&16711680)+(O[F+1]<<8&65280)+(O[F+2]&255),b.push(x(q));return b.join("")}function S(O){for(var M,k=O.length,q=k%3,b=[],F=16383,G=0,ue=k-q;G<ue;G+=F)b.push(R(O,G,G+F>ue?ue:G+F));return q===1?(M=O[k-1],b.push(_[M>>2]+_[M<<4&63]+"==")):q===2&&(M=(O[k-2]<<8)+O[k-1],b.push(_[M>>10]+_[M>>4&63]+_[M<<2&63]+"=")),b.join("")}},19808:function(ie,f,_){"use strict";var h,w=_(36533).Buffer;h={value:!0};let E;function v(m){{const C=w.from(m);C.reverse();const x=C.toString("hex");return x.length===0?BigInt(0):BigInt(`0x${x}`)}return E.toBigInt(m,!1)}f.toBigIntLE=v;function c(m){{const C=m.toString("hex");return C.length===0?BigInt(0):BigInt(`0x${C}`)}return E.toBigInt(m,!0)}h=c;function d(m,C){{const x=m.toString(16),R=w.from(x.padStart(C*2,"0").slice(0,C*2),"hex");return R.reverse(),R}return E.fromBigInt(m,w.allocUnsafe(C),!1)}f.toBufferLE=d;function p(m,C){{const x=m.toString(16);return w.from(x.padStart(C*2,"0").slice(0,C*2),"hex")}return E.fromBigInt(m,w.allocUnsafe(C),!0)}h=p},90172:function(ie){(function(f){"use strict";var _,h=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,w=Math.ceil,E=Math.floor,v="[BigNumber Error] ",c=v+"Number primitive has more than 15 significant digits: ",d=1e14,p=14,m=9007199254740991,C=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],x=1e7,R=1e9;function S(ue){var le,X,se,de=te.prototype={constructor:te,toString:null,valueOf:null},ye=new te(1),he=20,K=4,B=-7,L=21,$=-1e7,T=1e7,N=!1,j=1,Y=0,Z={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz",fe=!0;function te(be,we){var Ee,me,Ke,He,Ie,Le,Ge,Be,We=this;if(!(We instanceof te))return new te(be,we);if(we==null){if(be&&be._isBigNumber===!0){We.s=be.s,!be.c||be.e>T?We.c=We.e=null:be.e<$?We.c=[We.e=0]:(We.e=be.e,We.c=be.c.slice());return}if((Le=typeof be=="number")&&be*0==0){if(We.s=1/be<0?(be=-be,-1):1,be===~~be){for(He=0,Ie=be;Ie>=10;Ie/=10,He++);He>T?We.c=We.e=null:(We.e=He,We.c=[be]);return}Be=String(be)}else{if(!h.test(Be=String(be)))return se(We,Be,Le);We.s=Be.charCodeAt(0)==45?(Be=Be.slice(1),-1):1}(He=Be.indexOf("."))>-1&&(Be=Be.replace(".","")),(Ie=Be.search(/e/i))>0?(He<0&&(He=Ie),He+=+Be.slice(Ie+1),Be=Be.substring(0,Ie)):He<0&&(He=Be.length)}else{if(q(we,2,z.length,"Base"),we==10&&fe)return We=new te(be),_e(We,he+We.e+1,K);if(Be=String(be),Le=typeof be=="number"){if(be*0!=0)return se(We,Be,Le,we);if(We.s=1/be<0?(Be=Be.slice(1),-1):1,te.DEBUG&&Be.replace(/^0\.0*|\./,"").length>15)throw Error(c+be)}else We.s=Be.charCodeAt(0)===45?(Be=Be.slice(1),-1):1;for(Ee=z.slice(0,we),He=Ie=0,Ge=Be.length;Ie<Ge;Ie++)if(Ee.indexOf(me=Be.charAt(Ie))<0){if(me=="."){if(Ie>He){He=Ge;continue}}else if(!Ke&&(Be==Be.toUpperCase()&&(Be=Be.toLowerCase())||Be==Be.toLowerCase()&&(Be=Be.toUpperCase()))){Ke=!0,Ie=-1,He=0;continue}return se(We,String(be),Le,we)}Le=!1,Be=X(Be,we,10,We.s),(He=Be.indexOf("."))>-1?Be=Be.replace(".",""):He=Be.length}for(Ie=0;Be.charCodeAt(Ie)===48;Ie++);for(Ge=Be.length;Be.charCodeAt(--Ge)===48;);if(Be=Be.slice(Ie,++Ge)){if(Ge-=Ie,Le&&te.DEBUG&&Ge>15&&(be>m||be!==E(be)))throw Error(c+We.s*be);if((He=He-Ie-1)>T)We.c=We.e=null;else if(He<$)We.c=[We.e=0];else{if(We.e=He,We.c=[],Ie=(He+1)%p,He<0&&(Ie+=p),Ie<Ge){for(Ie&&We.c.push(+Be.slice(0,Ie)),Ge-=p;Ie<Ge;)We.c.push(+Be.slice(Ie,Ie+=p));Ie=p-(Be=Be.slice(Ie)).length}else Ie-=Ge;for(;Ie--;Be+="0");We.c.push(+Be)}}else We.c=[We.e=0]}te.clone=S,te.ROUND_UP=0,te.ROUND_DOWN=1,te.ROUND_CEIL=2,te.ROUND_FLOOR=3,te.ROUND_HALF_UP=4,te.ROUND_HALF_DOWN=5,te.ROUND_HALF_EVEN=6,te.ROUND_HALF_CEIL=7,te.ROUND_HALF_FLOOR=8,te.EUCLID=9,te.config=te.set=function(be){var we,Ee;if(be!=null)if(typeof be=="object"){if(be.hasOwnProperty(we="DECIMAL_PLACES")&&(Ee=be[we],q(Ee,0,R,we),he=Ee),be.hasOwnProperty(we="ROUNDING_MODE")&&(Ee=be[we],q(Ee,0,8,we),K=Ee),be.hasOwnProperty(we="EXPONENTIAL_AT")&&(Ee=be[we],Ee&&Ee.pop?(q(Ee[0],-R,0,we),q(Ee[1],0,R,we),B=Ee[0],L=Ee[1]):(q(Ee,-R,R,we),B=-(L=Ee<0?-Ee:Ee))),be.hasOwnProperty(we="RANGE"))if(Ee=be[we],Ee&&Ee.pop)q(Ee[0],-R,-1,we),q(Ee[1],1,R,we),$=Ee[0],T=Ee[1];else if(q(Ee,-R,R,we),Ee)$=-(T=Ee<0?-Ee:Ee);else throw Error(v+we+" cannot be zero: "+Ee);if(be.hasOwnProperty(we="CRYPTO"))if(Ee=be[we],Ee===!!Ee)if(Ee)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))N=Ee;else throw N=!Ee,Error(v+"crypto unavailable");else N=Ee;else throw Error(v+we+" not true or false: "+Ee);if(be.hasOwnProperty(we="MODULO_MODE")&&(Ee=be[we],q(Ee,0,9,we),j=Ee),be.hasOwnProperty(we="POW_PRECISION")&&(Ee=be[we],q(Ee,0,R,we),Y=Ee),be.hasOwnProperty(we="FORMAT"))if(Ee=be[we],typeof Ee=="object")Z=Ee;else throw Error(v+we+" not an object: "+Ee);if(be.hasOwnProperty(we="ALPHABET"))if(Ee=be[we],typeof Ee=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(Ee))fe=Ee.slice(0,10)=="0123456789",z=Ee;else throw Error(v+we+" invalid: "+Ee)}else throw Error(v+"Object expected: "+be);return{DECIMAL_PLACES:he,ROUNDING_MODE:K,EXPONENTIAL_AT:[B,L],RANGE:[$,T],CRYPTO:N,MODULO_MODE:j,POW_PRECISION:Y,FORMAT:Z,ALPHABET:z}},te.isBigNumber=function(be){if(!be||be._isBigNumber!==!0)return!1;if(!te.DEBUG)return!0;var we,Ee,me=be.c,Ke=be.e,He=be.s;e:if({}.toString.call(me)=="[object Array]"){if((He===1||He===-1)&&Ke>=-R&&Ke<=R&&Ke===E(Ke)){if(me[0]===0){if(Ke===0&&me.length===1)return!0;break e}if(we=(Ke+1)%p,we<1&&(we+=p),String(me[0]).length==we){for(we=0;we<me.length;we++)if(Ee=me[we],Ee<0||Ee>=d||Ee!==E(Ee))break e;if(Ee!==0)return!0}}}else if(me===null&&Ke===null&&(He===null||He===1||He===-1))return!0;throw Error(v+"Invalid BigNumber: "+be)},te.maximum=te.max=function(){return Q(arguments,-1)},te.minimum=te.min=function(){return Q(arguments,1)},te.random=function(){var be=9007199254740992,we=Math.random()*be&2097151?function(){return E(Math.random()*be)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Ee){var me,Ke,He,Ie,Le,Ge=0,Be=[],We=new te(ye);if(Ee==null?Ee=he:q(Ee,0,R),Ie=w(Ee/p),N)if(crypto.getRandomValues){for(me=crypto.getRandomValues(new Uint32Array(Ie*=2));Ge<Ie;)Le=me[Ge]*131072+(me[Ge+1]>>>11),Le>=9e15?(Ke=crypto.getRandomValues(new Uint32Array(2)),me[Ge]=Ke[0],me[Ge+1]=Ke[1]):(Be.push(Le%1e14),Ge+=2);Ge=Ie/2}else if(crypto.randomBytes){for(me=crypto.randomBytes(Ie*=7);Ge<Ie;)Le=(me[Ge]&31)*281474976710656+me[Ge+1]*1099511627776+me[Ge+2]*4294967296+me[Ge+3]*16777216+(me[Ge+4]<<16)+(me[Ge+5]<<8)+me[Ge+6],Le>=9e15?crypto.randomBytes(7).copy(me,Ge):(Be.push(Le%1e14),Ge+=7);Ge=Ie/7}else throw N=!1,Error(v+"crypto unavailable");if(!N)for(;Ge<Ie;)Le=we(),Le<9e15&&(Be[Ge++]=Le%1e14);for(Ie=Be[--Ge],Ee%=p,Ie&&Ee&&(Le=C[p-Ee],Be[Ge]=E(Ie/Le)*Le);Be[Ge]===0;Be.pop(),Ge--);if(Ge<0)Be=[He=0];else{for(He=-1;Be[0]===0;Be.splice(0,1),He-=p);for(Ge=1,Le=Be[0];Le>=10;Le/=10,Ge++);Ge<p&&(He-=p-Ge)}return We.e=He,We.c=Be,We}}(),te.sum=function(){for(var be=1,we=arguments,Ee=new te(we[0]);be<we.length;)Ee=Ee.plus(we[be++]);return Ee},X=function(){var be="0123456789";function we(Ee,me,Ke,He){for(var Ie,Le=[0],Ge,Be=0,We=Ee.length;Be<We;){for(Ge=Le.length;Ge--;Le[Ge]*=me);for(Le[0]+=He.indexOf(Ee.charAt(Be++)),Ie=0;Ie<Le.length;Ie++)Le[Ie]>Ke-1&&(Le[Ie+1]==null&&(Le[Ie+1]=0),Le[Ie+1]+=Le[Ie]/Ke|0,Le[Ie]%=Ke)}return Le.reverse()}return function(Ee,me,Ke,He,Ie){var Le,Ge,Be,We,Ze,_t,Ft,gt,lt=Ee.indexOf("."),dt=he,tt=K;for(lt>=0&&(We=Y,Y=0,Ee=Ee.replace(".",""),gt=new te(me),_t=gt.pow(Ee.length-lt),Y=We,gt.c=we(G(M(_t.c),_t.e,"0"),10,Ke,be),gt.e=gt.c.length),Ft=we(Ee,me,Ke,Ie?(Le=z,be):(Le=be,z)),Be=We=Ft.length;Ft[--We]==0;Ft.pop());if(!Ft[0])return Le.charAt(0);if(lt<0?--Be:(_t.c=Ft,_t.e=Be,_t.s=He,_t=le(_t,gt,dt,tt,Ke),Ft=_t.c,Ze=_t.r,Be=_t.e),Ge=Be+dt+1,lt=Ft[Ge],We=Ke/2,Ze=Ze||Ge<0||Ft[Ge+1]!=null,Ze=tt<4?(lt!=null||Ze)&&(tt==0||tt==(_t.s<0?3:2)):lt>We||lt==We&&(tt==4||Ze||tt==6&&Ft[Ge-1]&1||tt==(_t.s<0?8:7)),Ge<1||!Ft[0])Ee=Ze?G(Le.charAt(1),-dt,Le.charAt(0)):Le.charAt(0);else{if(Ft.length=Ge,Ze)for(--Ke;++Ft[--Ge]>Ke;)Ft[Ge]=0,Ge||(++Be,Ft=[1].concat(Ft));for(We=Ft.length;!Ft[--We];);for(lt=0,Ee="";lt<=We;Ee+=Le.charAt(Ft[lt++]));Ee=G(Ee,Be,Le.charAt(0))}return Ee}}(),le=function(){function be(me,Ke,He){var Ie,Le,Ge,Be,We=0,Ze=me.length,_t=Ke%x,Ft=Ke/x|0;for(me=me.slice();Ze--;)Ge=me[Ze]%x,Be=me[Ze]/x|0,Ie=Ft*Ge+Be*_t,Le=_t*Ge+Ie%x*x+We,We=(Le/He|0)+(Ie/x|0)+Ft*Be,me[Ze]=Le%He;return We&&(me=[We].concat(me)),me}function we(me,Ke,He,Ie){var Le,Ge;if(He!=Ie)Ge=He>Ie?1:-1;else for(Le=Ge=0;Le<He;Le++)if(me[Le]!=Ke[Le]){Ge=me[Le]>Ke[Le]?1:-1;break}return Ge}function Ee(me,Ke,He,Ie){for(var Le=0;He--;)me[He]-=Le,Le=me[He]<Ke[He]?1:0,me[He]=Le*Ie+me[He]-Ke[He];for(;!me[0]&&me.length>1;me.splice(0,1));}return function(me,Ke,He,Ie,Le){var Ge,Be,We,Ze,_t,Ft,gt,lt,dt,tt,rt,ke,xe,Pe,it,Xe,st,It=me.s==Ke.s?1:-1,ft=me.c,Jt=Ke.c;if(!ft||!ft[0]||!Jt||!Jt[0])return new te(!me.s||!Ke.s||(ft?Jt&&ft[0]==Jt[0]:!Jt)?NaN:ft&&ft[0]==0||!Jt?It*0:It/0);for(lt=new te(It),dt=lt.c=[],Be=me.e-Ke.e,It=He+Be+1,Le||(Le=d,Be=O(me.e/p)-O(Ke.e/p),It=It/p|0),We=0;Jt[We]==(ft[We]||0);We++);if(Jt[We]>(ft[We]||0)&&Be--,It<0)dt.push(1),Ze=!0;else{for(Pe=ft.length,Xe=Jt.length,We=0,It+=2,_t=E(Le/(Jt[0]+1)),_t>1&&(Jt=be(Jt,_t,Le),ft=be(ft,_t,Le),Xe=Jt.length,Pe=ft.length),xe=Xe,tt=ft.slice(0,Xe),rt=tt.length;rt<Xe;tt[rt++]=0);st=Jt.slice(),st=[0].concat(st),it=Jt[0],Jt[1]>=Le/2&&it++;do{if(_t=0,Ge=we(Jt,tt,Xe,rt),Ge<0){if(ke=tt[0],Xe!=rt&&(ke=ke*Le+(tt[1]||0)),_t=E(ke/it),_t>1)for(_t>=Le&&(_t=Le-1),Ft=be(Jt,_t,Le),gt=Ft.length,rt=tt.length;we(Ft,tt,gt,rt)==1;)_t--,Ee(Ft,Xe<gt?st:Jt,gt,Le),gt=Ft.length,Ge=1;else _t==0&&(Ge=_t=1),Ft=Jt.slice(),gt=Ft.length;if(gt<rt&&(Ft=[0].concat(Ft)),Ee(tt,Ft,rt,Le),rt=tt.length,Ge==-1)for(;we(Jt,tt,Xe,rt)<1;)_t++,Ee(tt,Xe<rt?st:Jt,rt,Le),rt=tt.length}else Ge===0&&(_t++,tt=[0]);dt[We++]=_t,tt[0]?tt[rt++]=ft[xe]||0:(tt=[ft[xe]],rt=1)}while((xe++<Pe||tt[0]!=null)&&It--);Ze=tt[0]!=null,dt[0]||dt.splice(0,1)}if(Le==d){for(We=1,It=dt[0];It>=10;It/=10,We++);_e(lt,He+(lt.e=We+Be*p-1)+1,Ie,Ze)}else lt.e=Be,lt.r=+Ze;return lt}}();function H(be,we,Ee,me){var Ke,He,Ie,Le,Ge;if(Ee==null?Ee=K:q(Ee,0,8),!be.c)return be.toString();if(Ke=be.c[0],Ie=be.e,we==null)Ge=M(be.c),Ge=me==1||me==2&&(Ie<=B||Ie>=L)?F(Ge,Ie):G(Ge,Ie,"0");else if(be=_e(new te(be),we,Ee),He=be.e,Ge=M(be.c),Le=Ge.length,me==1||me==2&&(we<=He||He<=B)){for(;Le<we;Ge+="0",Le++);Ge=F(Ge,He)}else if(we-=Ie+(me===2&&He>Ie),Ge=G(Ge,He,"0"),He+1>Le){if(--we>0)for(Ge+=".";we--;Ge+="0");}else if(we+=He-Le,we>0)for(He+1==Le&&(Ge+=".");we--;Ge+="0");return be.s<0&&Ke?"-"+Ge:Ge}function Q(be,we){for(var Ee,me,Ke=1,He=new te(be[0]);Ke<be.length;Ke++)me=new te(be[Ke]),(!me.s||(Ee=k(He,me))===we||Ee===0&&He.s===we)&&(He=me);return He}function oe(be,we,Ee){for(var me=1,Ke=we.length;!we[--Ke];we.pop());for(Ke=we[0];Ke>=10;Ke/=10,me++);return(Ee=me+Ee*p-1)>T?be.c=be.e=null:Ee<$?be.c=[be.e=0]:(be.e=Ee,be.c=we),be}se=function(){var be=/^(-?)0([xbo])(?=\w[\w.]*$)/i,we=/^([^.]+)\.$/,Ee=/^\.([^.]+)$/,me=/^-?(Infinity|NaN)$/,Ke=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(He,Ie,Le,Ge){var Be,We=Le?Ie:Ie.replace(Ke,"");if(me.test(We))He.s=isNaN(We)?null:We<0?-1:1;else{if(!Le&&(We=We.replace(be,function(Ze,_t,Ft){return Be=(Ft=Ft.toLowerCase())=="x"?16:Ft=="b"?2:8,!Ge||Ge==Be?_t:Ze}),Ge&&(Be=Ge,We=We.replace(we,"$1").replace(Ee,"0.$1")),Ie!=We))return new te(We,Be);if(te.DEBUG)throw Error(v+"Not a"+(Ge?" base "+Ge:"")+" number: "+Ie);He.s=null}He.c=He.e=null}}();function _e(be,we,Ee,me){var Ke,He,Ie,Le,Ge,Be,We,Ze=be.c,_t=C;if(Ze){e:{for(Ke=1,Le=Ze[0];Le>=10;Le/=10,Ke++);if(He=we-Ke,He<0)He+=p,Ie=we,Ge=Ze[Be=0],We=E(Ge/_t[Ke-Ie-1]%10);else if(Be=w((He+1)/p),Be>=Ze.length)if(me){for(;Ze.length<=Be;Ze.push(0));Ge=We=0,Ke=1,He%=p,Ie=He-p+1}else break e;else{for(Ge=Le=Ze[Be],Ke=1;Le>=10;Le/=10,Ke++);He%=p,Ie=He-p+Ke,We=Ie<0?0:E(Ge/_t[Ke-Ie-1]%10)}if(me=me||we<0||Ze[Be+1]!=null||(Ie<0?Ge:Ge%_t[Ke-Ie-1]),me=Ee<4?(We||me)&&(Ee==0||Ee==(be.s<0?3:2)):We>5||We==5&&(Ee==4||me||Ee==6&&(He>0?Ie>0?Ge/_t[Ke-Ie]:0:Ze[Be-1])%10&1||Ee==(be.s<0?8:7)),we<1||!Ze[0])return Ze.length=0,me?(we-=be.e+1,Ze[0]=_t[(p-we%p)%p],be.e=-we||0):Ze[0]=be.e=0,be;if(He==0?(Ze.length=Be,Le=1,Be--):(Ze.length=Be+1,Le=_t[p-He],Ze[Be]=Ie>0?E(Ge/_t[Ke-Ie]%_t[Ie])*Le:0),me)for(;;)if(Be==0){for(He=1,Ie=Ze[0];Ie>=10;Ie/=10,He++);for(Ie=Ze[0]+=Le,Le=1;Ie>=10;Ie/=10,Le++);He!=Le&&(be.e++,Ze[0]==d&&(Ze[0]=1));break}else{if(Ze[Be]+=Le,Ze[Be]!=d)break;Ze[Be--]=0,Le=1}for(He=Ze.length;Ze[--He]===0;Ze.pop());}be.e>T?be.c=be.e=null:be.e<$&&(be.c=[be.e=0])}return be}function ge(be){var we,Ee=be.e;return Ee===null?be.toString():(we=M(be.c),we=Ee<=B||Ee>=L?F(we,Ee):G(we,Ee,"0"),be.s<0?"-"+we:we)}return de.absoluteValue=de.abs=function(){var be=new te(this);return be.s<0&&(be.s=1),be},de.comparedTo=function(be,we){return k(this,new te(be,we))},de.decimalPlaces=de.dp=function(be,we){var Ee,me,Ke,He=this;if(be!=null)return q(be,0,R),we==null?we=K:q(we,0,8),_e(new te(He),be+He.e+1,we);if(!(Ee=He.c))return null;if(me=((Ke=Ee.length-1)-O(this.e/p))*p,Ke=Ee[Ke])for(;Ke%10==0;Ke/=10,me--);return me<0&&(me=0),me},de.dividedBy=de.div=function(be,we){return le(this,new te(be,we),he,K)},de.dividedToIntegerBy=de.idiv=function(be,we){return le(this,new te(be,we),0,1)},de.exponentiatedBy=de.pow=function(be,we){var Ee,me,Ke,He,Ie,Le,Ge,Be,We,Ze=this;if(be=new te(be),be.c&&!be.isInteger())throw Error(v+"Exponent not an integer: "+ge(be));if(we!=null&&(we=new te(we)),Le=be.e>14,!Ze.c||!Ze.c[0]||Ze.c[0]==1&&!Ze.e&&Ze.c.length==1||!be.c||!be.c[0])return We=new te(Math.pow(+ge(Ze),Le?be.s*(2-b(be)):+ge(be))),we?We.mod(we):We;if(Ge=be.s<0,we){if(we.c?!we.c[0]:!we.s)return new te(NaN);me=!Ge&&Ze.isInteger()&&we.isInteger(),me&&(Ze=Ze.mod(we))}else{if(be.e>9&&(Ze.e>0||Ze.e<-1||(Ze.e==0?Ze.c[0]>1||Le&&Ze.c[1]>=24e7:Ze.c[0]<8e13||Le&&Ze.c[0]<=9999975e7)))return He=Ze.s<0&&b(be)?-0:0,Ze.e>-1&&(He=1/He),new te(Ge?1/He:He);Y&&(He=w(Y/p+2))}for(Le?(Ee=new te(.5),Ge&&(be.s=1),Be=b(be)):(Ke=Math.abs(+ge(be)),Be=Ke%2),We=new te(ye);;){if(Be){if(We=We.times(Ze),!We.c)break;He?We.c.length>He&&(We.c.length=He):me&&(We=We.mod(we))}if(Ke){if(Ke=E(Ke/2),Ke===0)break;Be=Ke%2}else if(be=be.times(Ee),_e(be,be.e+1,1),be.e>14)Be=b(be);else{if(Ke=+ge(be),Ke===0)break;Be=Ke%2}Ze=Ze.times(Ze),He?Ze.c&&Ze.c.length>He&&(Ze.c.length=He):me&&(Ze=Ze.mod(we))}return me?We:(Ge&&(We=ye.div(We)),we?We.mod(we):He?_e(We,Y,K,Ie):We)},de.integerValue=function(be){var we=new te(this);return be==null?be=K:q(be,0,8),_e(we,we.e+1,be)},de.isEqualTo=de.eq=function(be,we){return k(this,new te(be,we))===0},de.isFinite=function(){return!!this.c},de.isGreaterThan=de.gt=function(be,we){return k(this,new te(be,we))>0},de.isGreaterThanOrEqualTo=de.gte=function(be,we){return(we=k(this,new te(be,we)))===1||we===0},de.isInteger=function(){return!!this.c&&O(this.e/p)>this.c.length-2},de.isLessThan=de.lt=function(be,we){return k(this,new te(be,we))<0},de.isLessThanOrEqualTo=de.lte=function(be,we){return(we=k(this,new te(be,we)))===-1||we===0},de.isNaN=function(){return!this.s},de.isNegative=function(){return this.s<0},de.isPositive=function(){return this.s>0},de.isZero=function(){return!!this.c&&this.c[0]==0},de.minus=function(be,we){var Ee,me,Ke,He,Ie=this,Le=Ie.s;if(be=new te(be,we),we=be.s,!Le||!we)return new te(NaN);if(Le!=we)return be.s=-we,Ie.plus(be);var Ge=Ie.e/p,Be=be.e/p,We=Ie.c,Ze=be.c;if(!Ge||!Be){if(!We||!Ze)return We?(be.s=-we,be):new te(Ze?Ie:NaN);if(!We[0]||!Ze[0])return Ze[0]?(be.s=-we,be):new te(We[0]?Ie:K==3?-0:0)}if(Ge=O(Ge),Be=O(Be),We=We.slice(),Le=Ge-Be){for((He=Le<0)?(Le=-Le,Ke=We):(Be=Ge,Ke=Ze),Ke.reverse(),we=Le;we--;Ke.push(0));Ke.reverse()}else for(me=(He=(Le=We.length)<(we=Ze.length))?Le:we,Le=we=0;we<me;we++)if(We[we]!=Ze[we]){He=We[we]<Ze[we];break}if(He&&(Ke=We,We=Ze,Ze=Ke,be.s=-be.s),we=(me=Ze.length)-(Ee=We.length),we>0)for(;we--;We[Ee++]=0);for(we=d-1;me>Le;){if(We[--me]<Ze[me]){for(Ee=me;Ee&&!We[--Ee];We[Ee]=we);--We[Ee],We[me]+=d}We[me]-=Ze[me]}for(;We[0]==0;We.splice(0,1),--Be);return We[0]?oe(be,We,Be):(be.s=K==3?-1:1,be.c=[be.e=0],be)},de.modulo=de.mod=function(be,we){var Ee,me,Ke=this;return be=new te(be,we),!Ke.c||!be.s||be.c&&!be.c[0]?new te(NaN):!be.c||Ke.c&&!Ke.c[0]?new te(Ke):(j==9?(me=be.s,be.s=1,Ee=le(Ke,be,0,3),be.s=me,Ee.s*=me):Ee=le(Ke,be,0,j),be=Ke.minus(Ee.times(be)),!be.c[0]&&j==1&&(be.s=Ke.s),be)},de.multipliedBy=de.times=function(be,we){var Ee,me,Ke,He,Ie,Le,Ge,Be,We,Ze,_t,Ft,gt,lt,dt,tt=this,rt=tt.c,ke=(be=new te(be,we)).c;if(!rt||!ke||!rt[0]||!ke[0])return!tt.s||!be.s||rt&&!rt[0]&&!ke||ke&&!ke[0]&&!rt?be.c=be.e=be.s=null:(be.s*=tt.s,!rt||!ke?be.c=be.e=null:(be.c=[0],be.e=0)),be;for(me=O(tt.e/p)+O(be.e/p),be.s*=tt.s,Ge=rt.length,Ze=ke.length,Ge<Ze&&(gt=rt,rt=ke,ke=gt,Ke=Ge,Ge=Ze,Ze=Ke),Ke=Ge+Ze,gt=[];Ke--;gt.push(0));for(lt=d,dt=x,Ke=Ze;--Ke>=0;){for(Ee=0,_t=ke[Ke]%dt,Ft=ke[Ke]/dt|0,Ie=Ge,He=Ke+Ie;He>Ke;)Be=rt[--Ie]%dt,We=rt[Ie]/dt|0,Le=Ft*Be+We*_t,Be=_t*Be+Le%dt*dt+gt[He]+Ee,Ee=(Be/lt|0)+(Le/dt|0)+Ft*We,gt[He--]=Be%lt;gt[He]=Ee}return Ee?++me:gt.splice(0,1),oe(be,gt,me)},de.negated=function(){var be=new te(this);return be.s=-be.s||null,be},de.plus=function(be,we){var Ee,me=this,Ke=me.s;if(be=new te(be,we),we=be.s,!Ke||!we)return new te(NaN);if(Ke!=we)return be.s=-we,me.minus(be);var He=me.e/p,Ie=be.e/p,Le=me.c,Ge=be.c;if(!He||!Ie){if(!Le||!Ge)return new te(Ke/0);if(!Le[0]||!Ge[0])return Ge[0]?be:new te(Le[0]?me:Ke*0)}if(He=O(He),Ie=O(Ie),Le=Le.slice(),Ke=He-Ie){for(Ke>0?(Ie=He,Ee=Ge):(Ke=-Ke,Ee=Le),Ee.reverse();Ke--;Ee.push(0));Ee.reverse()}for(Ke=Le.length,we=Ge.length,Ke-we<0&&(Ee=Ge,Ge=Le,Le=Ee,we=Ke),Ke=0;we;)Ke=(Le[--we]=Le[we]+Ge[we]+Ke)/d|0,Le[we]=d===Le[we]?0:Le[we]%d;return Ke&&(Le=[Ke].concat(Le),++Ie),oe(be,Le,Ie)},de.precision=de.sd=function(be,we){var Ee,me,Ke,He=this;if(be!=null&&be!==!!be)return q(be,1,R),we==null?we=K:q(we,0,8),_e(new te(He),be,we);if(!(Ee=He.c))return null;if(Ke=Ee.length-1,me=Ke*p+1,Ke=Ee[Ke]){for(;Ke%10==0;Ke/=10,me--);for(Ke=Ee[0];Ke>=10;Ke/=10,me++);}return be&&He.e+1>me&&(me=He.e+1),me},de.shiftedBy=function(be){return q(be,-m,m),this.times("1e"+be)},de.squareRoot=de.sqrt=function(){var be,we,Ee,me,Ke,He=this,Ie=He.c,Le=He.s,Ge=He.e,Be=he+4,We=new te("0.5");if(Le!==1||!Ie||!Ie[0])return new te(!Le||Le<0&&(!Ie||Ie[0])?NaN:Ie?He:1/0);if(Le=Math.sqrt(+ge(He)),Le==0||Le==1/0?(we=M(Ie),(we.length+Ge)%2==0&&(we+="0"),Le=Math.sqrt(+we),Ge=O((Ge+1)/2)-(Ge<0||Ge%2),Le==1/0?we="5e"+Ge:(we=Le.toExponential(),we=we.slice(0,we.indexOf("e")+1)+Ge),Ee=new te(we)):Ee=new te(Le+""),Ee.c[0]){for(Ge=Ee.e,Le=Ge+Be,Le<3&&(Le=0);;)if(Ke=Ee,Ee=We.times(Ke.plus(le(He,Ke,Be,1))),M(Ke.c).slice(0,Le)===(we=M(Ee.c)).slice(0,Le))if(Ee.e<Ge&&--Le,we=we.slice(Le-3,Le+1),we=="9999"||!me&&we=="4999"){if(!me&&(_e(Ke,Ke.e+he+2,0),Ke.times(Ke).eq(He))){Ee=Ke;break}Be+=4,Le+=4,me=1}else{(!+we||!+we.slice(1)&&we.charAt(0)=="5")&&(_e(Ee,Ee.e+he+2,1),be=!Ee.times(Ee).eq(He));break}}return _e(Ee,Ee.e+he+1,K,be)},de.toExponential=function(be,we){return be!=null&&(q(be,0,R),be++),H(this,be,we,1)},de.toFixed=function(be,we){return be!=null&&(q(be,0,R),be=be+this.e+1),H(this,be,we)},de.toFormat=function(be,we,Ee){var me,Ke=this;if(Ee==null)be!=null&&we&&typeof we=="object"?(Ee=we,we=null):be&&typeof be=="object"?(Ee=be,be=we=null):Ee=Z;else if(typeof Ee!="object")throw Error(v+"Argument not an object: "+Ee);if(me=Ke.toFixed(be,we),Ke.c){var He,Ie=me.split("."),Le=+Ee.groupSize,Ge=+Ee.secondaryGroupSize,Be=Ee.groupSeparator||"",We=Ie[0],Ze=Ie[1],_t=Ke.s<0,Ft=_t?We.slice(1):We,gt=Ft.length;if(Ge&&(He=Le,Le=Ge,Ge=He,gt-=He),Le>0&>>0){for(He=gt%Le||Le,We=Ft.substr(0,He);He<gt;He+=Le)We+=Be+Ft.substr(He,Le);Ge>0&&(We+=Be+Ft.slice(He)),_t&&(We="-"+We)}me=Ze?We+(Ee.decimalSeparator||"")+((Ge=+Ee.fractionGroupSize)?Ze.replace(new RegExp("\\d{"+Ge+"}\\B","g"),"$&"+(Ee.fractionGroupSeparator||"")):Ze):We}return(Ee.prefix||"")+me+(Ee.suffix||"")},de.toFraction=function(be){var we,Ee,me,Ke,He,Ie,Le,Ge,Be,We,Ze,_t,Ft=this,gt=Ft.c;if(be!=null&&(Le=new te(be),!Le.isInteger()&&(Le.c||Le.s!==1)||Le.lt(ye)))throw Error(v+"Argument "+(Le.isInteger()?"out of range: ":"not an integer: ")+ge(Le));if(!gt)return new te(Ft);for(we=new te(ye),Be=Ee=new te(ye),me=Ge=new te(ye),_t=M(gt),He=we.e=_t.length-Ft.e-1,we.c[0]=C[(Ie=He%p)<0?p+Ie:Ie],be=!be||Le.comparedTo(we)>0?He>0?we:Be:Le,Ie=T,T=1/0,Le=new te(_t),Ge.c[0]=0;We=le(Le,we,0,1),Ke=Ee.plus(We.times(me)),Ke.comparedTo(be)!=1;)Ee=me,me=Ke,Be=Ge.plus(We.times(Ke=Be)),Ge=Ke,we=Le.minus(We.times(Ke=we)),Le=Ke;return Ke=le(be.minus(Ee),me,0,1),Ge=Ge.plus(Ke.times(Be)),Ee=Ee.plus(Ke.times(me)),Ge.s=Be.s=Ft.s,He=He*2,Ze=le(Be,me,He,K).minus(Ft).abs().comparedTo(le(Ge,Ee,He,K).minus(Ft).abs())<1?[Be,me]:[Ge,Ee],T=Ie,Ze},de.toNumber=function(){return+ge(this)},de.toPrecision=function(be,we){return be!=null&&q(be,1,R),H(this,be,we,2)},de.toString=function(be){var we,Ee=this,me=Ee.s,Ke=Ee.e;return Ke===null?me?(we="Infinity",me<0&&(we="-"+we)):we="NaN":(be==null?we=Ke<=B||Ke>=L?F(M(Ee.c),Ke):G(M(Ee.c),Ke,"0"):be===10&&fe?(Ee=_e(new te(Ee),he+Ke+1,K),we=G(M(Ee.c),Ee.e,"0")):(q(be,2,z.length,"Base"),we=X(G(M(Ee.c),Ke,"0"),10,be,me,!0)),me<0&&Ee.c[0]&&(we="-"+we)),we},de.valueOf=de.toJSON=function(){return ge(this)},de._isBigNumber=!0,ue!=null&&te.set(ue),te}function O(ue){var le=ue|0;return ue>0||ue===le?le:le-1}function M(ue){for(var le,X,se=1,de=ue.length,ye=ue[0]+"";se<de;){for(le=ue[se++]+"",X=p-le.length;X--;le="0"+le);ye+=le}for(de=ye.length;ye.charCodeAt(--de)===48;);return ye.slice(0,de+1||1)}function k(ue,le){var X,se,de=ue.c,ye=le.c,he=ue.s,K=le.s,B=ue.e,L=le.e;if(!he||!K)return null;if(X=de&&!de[0],se=ye&&!ye[0],X||se)return X?se?0:-K:he;if(he!=K)return he;if(X=he<0,se=B==L,!de||!ye)return se?0:!de^X?1:-1;if(!se)return B>L^X?1:-1;for(K=(B=de.length)<(L=ye.length)?B:L,he=0;he<K;he++)if(de[he]!=ye[he])return de[he]>ye[he]^X?1:-1;return B==L?0:B>L^X?1:-1}function q(ue,le,X,se){if(ue<le||ue>X||ue!==E(ue))throw Error(v+(se||"Argument")+(typeof ue=="number"?ue<le||ue>X?" out of range: ":" not an integer: ":" not a primitive number: ")+String(ue))}function b(ue){var le=ue.c.length-1;return O(ue.e/p)==le&&ue.c[le]%2!=0}function F(ue,le){return(ue.length>1?ue.charAt(0)+"."+ue.slice(1):ue)+(le<0?"e":"e+")+le}function G(ue,le,X){var se,de;if(le<0){for(de=X+".";++le;de+=X);ue=de+ue}else if(se=ue.length,++le>se){for(de=X,le-=se;--le;de+=X);ue+=de}else le<se&&(ue=ue.slice(0,le)+"."+ue.slice(le));return ue}_=S(),_.default=_.BigNumber=_,typeof define=="function"&&define.amd?define(function(){return _}):ie.exports?ie.exports=_:(f||(f=self),f.BigNumber=_)})(this)},73548:function(ie){(function(f){"use strict";function _(G,ue){var le=(G&65535)+(ue&65535),X=(G>>16)+(ue>>16)+(le>>16);return X<<16|le&65535}function h(G,ue){return G<<ue|G>>>32-ue}function w(G,ue,le,X,se,de){return _(h(_(_(ue,G),_(X,de)),se),le)}function E(G,ue,le,X,se,de,ye){return w(ue&le|~ue&X,G,ue,se,de,ye)}function v(G,ue,le,X,se,de,ye){return w(ue&X|le&~X,G,ue,se,de,ye)}function c(G,ue,le,X,se,de,ye){return w(ue^le^X,G,ue,se,de,ye)}function d(G,ue,le,X,se,de,ye){return w(le^(ue|~X),G,ue,se,de,ye)}function p(G,ue){G[ue>>5]|=128<<ue%32,G[(ue+64>>>9<<4)+14]=ue;var le,X,se,de,ye,he=1732584193,K=-271733879,B=-1732584194,L=271733878;for(le=0;le<G.length;le+=16)X=he,se=K,de=B,ye=L,he=E(he,K,B,L,G[le],7,-680876936),L=E(L,he,K,B,G[le+1],12,-389564586),B=E(B,L,he,K,G[le+2],17,606105819),K=E(K,B,L,he,G[le+3],22,-1044525330),he=E(he,K,B,L,G[le+4],7,-176418897),L=E(L,he,K,B,G[le+5],12,1200080426),B=E(B,L,he,K,G[le+6],17,-1473231341),K=E(K,B,L,he,G[le+7],22,-45705983),he=E(he,K,B,L,G[le+8],7,1770035416),L=E(L,he,K,B,G[le+9],12,-1958414417),B=E(B,L,he,K,G[le+10],17,-42063),K=E(K,B,L,he,G[le+11],22,-1990404162),he=E(he,K,B,L,G[le+12],7,1804603682),L=E(L,he,K,B,G[le+13],12,-40341101),B=E(B,L,he,K,G[le+14],17,-1502002290),K=E(K,B,L,he,G[le+15],22,1236535329),he=v(he,K,B,L,G[le+1],5,-165796510),L=v(L,he,K,B,G[le+6],9,-1069501632),B=v(B,L,he,K,G[le+11],14,643717713),K=v(K,B,L,he,G[le],20,-373897302),he=v(he,K,B,L,G[le+5],5,-701558691),L=v(L,he,K,B,G[le+10],9,38016083),B=v(B,L,he,K,G[le+15],14,-660478335),K=v(K,B,L,he,G[le+4],20,-405537848),he=v(he,K,B,L,G[le+9],5,568446438),L=v(L,he,K,B,G[le+14],9,-1019803690),B=v(B,L,he,K,G[le+3],14,-187363961),K=v(K,B,L,he,G[le+8],20,1163531501),he=v(he,K,B,L,G[le+13],5,-1444681467),L=v(L,he,K,B,G[le+2],9,-51403784),B=v(B,L,he,K,G[le+7],14,1735328473),K=v(K,B,L,he,G[le+12],20,-1926607734),he=c(he,K,B,L,G[le+5],4,-378558),L=c(L,he,K,B,G[le+8],11,-2022574463),B=c(B,L,he,K,G[le+11],16,1839030562),K=c(K,B,L,he,G[le+14],23,-35309556),he=c(he,K,B,L,G[le+1],4,-1530992060),L=c(L,he,K,B,G[le+4],11,1272893353),B=c(B,L,he,K,G[le+7],16,-155497632),K=c(K,B,L,he,G[le+10],23,-1094730640),he=c(he,K,B,L,G[le+13],4,681279174),L=c(L,he,K,B,G[le],11,-358537222),B=c(B,L,he,K,G[le+3],16,-722521979),K=c(K,B,L,he,G[le+6],23,76029189),he=c(he,K,B,L,G[le+9],4,-640364487),L=c(L,he,K,B,G[le+12],11,-421815835),B=c(B,L,he,K,G[le+15],16,530742520),K=c(K,B,L,he,G[le+2],23,-995338651),he=d(he,K,B,L,G[le],6,-198630844),L=d(L,he,K,B,G[le+7],10,1126891415),B=d(B,L,he,K,G[le+14],15,-1416354905),K=d(K,B,L,he,G[le+5],21,-57434055),he=d(he,K,B,L,G[le+12],6,1700485571),L=d(L,he,K,B,G[le+3],10,-1894986606),B=d(B,L,he,K,G[le+10],15,-1051523),K=d(K,B,L,he,G[le+1],21,-2054922799),he=d(he,K,B,L,G[le+8],6,1873313359),L=d(L,he,K,B,G[le+15],10,-30611744),B=d(B,L,he,K,G[le+6],15,-1560198380),K=d(K,B,L,he,G[le+13],21,1309151649),he=d(he,K,B,L,G[le+4],6,-145523070),L=d(L,he,K,B,G[le+11],10,-1120210379),B=d(B,L,he,K,G[le+2],15,718787259),K=d(K,B,L,he,G[le+9],21,-343485551),he=_(he,X),K=_(K,se),B=_(B,de),L=_(L,ye);return[he,K,B,L]}function m(G){var ue,le="",X=G.length*32;for(ue=0;ue<X;ue+=8)le+=String.fromCharCode(G[ue>>5]>>>ue%32&255);return le}function C(G){var ue,le=[];for(le[(G.length>>2)-1]=void 0,ue=0;ue<le.length;ue+=1)le[ue]=0;var X=G.length*8;for(ue=0;ue<X;ue+=8)le[ue>>5]|=(G.charCodeAt(ue/8)&255)<<ue%32;return le}function x(G){return m(p(C(G),G.length*8))}function R(G,ue){var le,X=C(G),se=[],de=[],ye;for(se[15]=de[15]=void 0,X.length>16&&(X=p(X,G.length*8)),le=0;le<16;le+=1)se[le]=X[le]^909522486,de[le]=X[le]^1549556828;return ye=p(se.concat(C(ue)),512+ue.length*8),m(p(de.concat(ye),640))}function S(G){var ue="0123456789abcdef",le="",X,se;for(se=0;se<G.length;se+=1)X=G.charCodeAt(se),le+=ue.charAt(X>>>4&15)+ue.charAt(X&15);return le}function O(G){return unescape(encodeURIComponent(G))}function M(G){return x(O(G))}function k(G){return S(M(G))}function q(G,ue){return R(O(G),O(ue))}function b(G,ue){return S(q(G,ue))}function F(G,ue,le){return ue?le?q(ue,G):b(ue,G):le?M(G):k(G)}typeof define=="function"&&define.amd?define(function(){return F}):ie.exports?ie.exports=F:f.md5=F})(this)},23364:function(ie,f,_){ie=_.nmd(ie),function(h,w){"use strict";function E(K,B){if(!K)throw new Error(B||"Assertion failed")}function v(K,B){K.super_=B;var L=function(){};L.prototype=B.prototype,K.prototype=new L,K.prototype.constructor=K}function c(K,B,L){if(c.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((B==="le"||B==="be")&&(L=B,B=10),this._init(K||0,B||10,L||"be"))}typeof h=="object"?h.exports=c:w.BN=c,c.BN=c,c.wordSize=26;var d;try{d=_(65943).Buffer}catch{}c.isBN=function(B){return B instanceof c?!0:B!==null&&typeof B=="object"&&B.constructor.wordSize===c.wordSize&&Array.isArray(B.words)},c.max=function(B,L){return B.cmp(L)>0?B:L},c.min=function(B,L){return B.cmp(L)<0?B:L},c.prototype._init=function(B,L,$){if(typeof B=="number")return this._initNumber(B,L,$);if(typeof B=="object")return this._initArray(B,L,$);L==="hex"&&(L=16),E(L===(L|0)&&L>=2&&L<=36),B=B.toString().replace(/\s+/g,"");var T=0;B[0]==="-"&&(T++,this.negative=1),T<B.length&&(L===16?this._parseHex(B,T,$):(this._parseBase(B,L,T),$==="le"&&this._initArray(this.toArray(),L,$)))},c.prototype._initNumber=function(B,L,$){B<0&&(this.negative=1,B=-B),B<67108864?(this.words=[B&67108863],this.length=1):B<4503599627370496?(this.words=[B&67108863,B/67108864&67108863],this.length=2):(E(B<9007199254740992),this.words=[B&67108863,B/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),L,$)},c.prototype._initArray=function(B,L,$){if(E(typeof B.length=="number"),B.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(B.length/3),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var N,j,Y=0;if($==="be")for(T=B.length-1,N=0;T>=0;T-=3)j=B[T]|B[T-1]<<8|B[T-2]<<16,this.words[N]|=j<<Y&67108863,this.words[N+1]=j>>>26-Y&67108863,Y+=24,Y>=26&&(Y-=26,N++);else if($==="le")for(T=0,N=0;T<B.length;T+=3)j=B[T]|B[T+1]<<8|B[T+2]<<16,this.words[N]|=j<<Y&67108863,this.words[N+1]=j>>>26-Y&67108863,Y+=24,Y>=26&&(Y-=26,N++);return this.strip()};function p(K,B){var L=K.charCodeAt(B);return L>=65&&L<=70?L-55:L>=97&&L<=102?L-87:L-48&15}function m(K,B,L){var $=p(K,L);return L-1>=B&&($|=p(K,L-1)<<4),$}c.prototype._parseHex=function(B,L,$){this.length=Math.ceil((B.length-L)/6),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var N=0,j=0,Y;if($==="be")for(T=B.length-1;T>=L;T-=2)Y=m(B,L,T)<<N,this.words[j]|=Y&67108863,N>=18?(N-=18,j+=1,this.words[j]|=Y>>>26):N+=8;else{var Z=B.length-L;for(T=Z%2===0?L+1:L;T<B.length;T+=2)Y=m(B,L,T)<<N,this.words[j]|=Y&67108863,N>=18?(N-=18,j+=1,this.words[j]|=Y>>>26):N+=8}this.strip()};function C(K,B,L,$){for(var T=0,N=Math.min(K.length,L),j=B;j<N;j++){var Y=K.charCodeAt(j)-48;T*=$,Y>=49?T+=Y-49+10:Y>=17?T+=Y-17+10:T+=Y}return T}c.prototype._parseBase=function(B,L,$){this.words=[0],this.length=1;for(var T=0,N=1;N<=67108863;N*=L)T++;T--,N=N/L|0;for(var j=B.length-$,Y=j%T,Z=Math.min(j,j-Y)+$,z=0,fe=$;fe<Z;fe+=T)z=C(B,fe,fe+T,L),this.imuln(N),this.words[0]+z<67108864?this.words[0]+=z:this._iaddn(z);if(Y!==0){var te=1;for(z=C(B,fe,B.length,L),fe=0;fe<Y;fe++)te*=L;this.imuln(te),this.words[0]+z<67108864?this.words[0]+=z:this._iaddn(z)}this.strip()},c.prototype.copy=function(B){B.words=new Array(this.length);for(var L=0;L<this.length;L++)B.words[L]=this.words[L];B.length=this.length,B.negative=this.negative,B.red=this.red},c.prototype.clone=function(){var B=new c(null);return this.copy(B),B},c.prototype._expand=function(B){for(;this.length<B;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],R=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],S=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(B,L){B=B||10,L=L|0||1;var $;if(B===16||B==="hex"){$="";for(var T=0,N=0,j=0;j<this.length;j++){var Y=this.words[j],Z=((Y<<T|N)&16777215).toString(16);N=Y>>>24-T&16777215,T+=2,T>=26&&(T-=26,j--),N!==0||j!==this.length-1?$=x[6-Z.length]+Z+$:$=Z+$}for(N!==0&&($=N.toString(16)+$);$.length%L!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(B===(B|0)&&B>=2&&B<=36){var z=R[B],fe=S[B];$="";var te=this.clone();for(te.negative=0;!te.isZero();){var H=te.modn(fe).toString(B);te=te.idivn(fe),te.isZero()?$=H+$:$=x[z-H.length]+H+$}for(this.isZero()&&($="0"+$);$.length%L!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}E(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var B=this.words[0];return this.length===2?B+=this.words[1]*67108864:this.length===3&&this.words[2]===1?B+=4503599627370496+this.words[1]*67108864:this.length>2&&E(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-B:B},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(B,L){return E(typeof d<"u"),this.toArrayLike(d,B,L)},c.prototype.toArray=function(B,L){return this.toArrayLike(Array,B,L)},c.prototype.toArrayLike=function(B,L,$){var T=this.byteLength(),N=$||Math.max(1,T);E(T<=N,"byte array longer than desired length"),E(N>0,"Requested array length <= 0"),this.strip();var j=L==="le",Y=new B(N),Z,z,fe=this.clone();if(j){for(z=0;!fe.isZero();z++)Z=fe.andln(255),fe.iushrn(8),Y[z]=Z;for(;z<N;z++)Y[z]=0}else{for(z=0;z<N-T;z++)Y[z]=0;for(z=0;!fe.isZero();z++)Z=fe.andln(255),fe.iushrn(8),Y[N-z-1]=Z}return Y},Math.clz32?c.prototype._countBits=function(B){return 32-Math.clz32(B)}:c.prototype._countBits=function(B){var L=B,$=0;return L>=4096&&($+=13,L>>>=13),L>=64&&($+=7,L>>>=7),L>=8&&($+=4,L>>>=4),L>=2&&($+=2,L>>>=2),$+L},c.prototype._zeroBits=function(B){if(B===0)return 26;var L=B,$=0;return L&8191||($+=13,L>>>=13),L&127||($+=7,L>>>=7),L&15||($+=4,L>>>=4),L&3||($+=2,L>>>=2),L&1||$++,$},c.prototype.bitLength=function(){var B=this.words[this.length-1],L=this._countBits(B);return(this.length-1)*26+L};function O(K){for(var B=new Array(K.bitLength()),L=0;L<B.length;L++){var $=L/26|0,T=L%26;B[L]=(K.words[$]&1<<T)>>>T}return B}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var B=0,L=0;L<this.length;L++){var $=this._zeroBits(this.words[L]);if(B+=$,$!==26)break}return B},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(B){return this.negative!==0?this.abs().inotn(B).iaddn(1):this.clone()},c.prototype.fromTwos=function(B){return this.testn(B-1)?this.notn(B).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(B){for(;this.length<B.length;)this.words[this.length++]=0;for(var L=0;L<B.length;L++)this.words[L]=this.words[L]|B.words[L];return this.strip()},c.prototype.ior=function(B){return E((this.negative|B.negative)===0),this.iuor(B)},c.prototype.or=function(B){return this.length>B.length?this.clone().ior(B):B.clone().ior(this)},c.prototype.uor=function(B){return this.length>B.length?this.clone().iuor(B):B.clone().iuor(this)},c.prototype.iuand=function(B){var L;this.length>B.length?L=B:L=this;for(var $=0;$<L.length;$++)this.words[$]=this.words[$]&B.words[$];return this.length=L.length,this.strip()},c.prototype.iand=function(B){return E((this.negative|B.negative)===0),this.iuand(B)},c.prototype.and=function(B){return this.length>B.length?this.clone().iand(B):B.clone().iand(this)},c.prototype.uand=function(B){return this.length>B.length?this.clone().iuand(B):B.clone().iuand(this)},c.prototype.iuxor=function(B){var L,$;this.length>B.length?(L=this,$=B):(L=B,$=this);for(var T=0;T<$.length;T++)this.words[T]=L.words[T]^$.words[T];if(this!==L)for(;T<L.length;T++)this.words[T]=L.words[T];return this.length=L.length,this.strip()},c.prototype.ixor=function(B){return E((this.negative|B.negative)===0),this.iuxor(B)},c.prototype.xor=function(B){return this.length>B.length?this.clone().ixor(B):B.clone().ixor(this)},c.prototype.uxor=function(B){return this.length>B.length?this.clone().iuxor(B):B.clone().iuxor(this)},c.prototype.inotn=function(B){E(typeof B=="number"&&B>=0);var L=Math.ceil(B/26)|0,$=B%26;this._expand(L),$>0&&L--;for(var T=0;T<L;T++)this.words[T]=~this.words[T]&67108863;return $>0&&(this.words[T]=~this.words[T]&67108863>>26-$),this.strip()},c.prototype.notn=function(B){return this.clone().inotn(B)},c.prototype.setn=function(B,L){E(typeof B=="number"&&B>=0);var $=B/26|0,T=B%26;return this._expand($+1),L?this.words[$]=this.words[$]|1<<T:this.words[$]=this.words[$]&~(1<<T),this.strip()},c.prototype.iadd=function(B){var L;if(this.negative!==0&&B.negative===0)return this.negative=0,L=this.isub(B),this.negative^=1,this._normSign();if(this.negative===0&&B.negative!==0)return B.negative=0,L=this.isub(B),B.negative=1,L._normSign();var $,T;this.length>B.length?($=this,T=B):($=B,T=this);for(var N=0,j=0;j<T.length;j++)L=($.words[j]|0)+(T.words[j]|0)+N,this.words[j]=L&67108863,N=L>>>26;for(;N!==0&&j<$.length;j++)L=($.words[j]|0)+N,this.words[j]=L&67108863,N=L>>>26;if(this.length=$.length,N!==0)this.words[this.length]=N,this.length++;else if($!==this)for(;j<$.length;j++)this.words[j]=$.words[j];return this},c.prototype.add=function(B){var L;return B.negative!==0&&this.negative===0?(B.negative=0,L=this.sub(B),B.negative^=1,L):B.negative===0&&this.negative!==0?(this.negative=0,L=B.sub(this),this.negative=1,L):this.length>B.length?this.clone().iadd(B):B.clone().iadd(this)},c.prototype.isub=function(B){if(B.negative!==0){B.negative=0;var L=this.iadd(B);return B.negative=1,L._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(B),this.negative=1,this._normSign();var $=this.cmp(B);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var T,N;$>0?(T=this,N=B):(T=B,N=this);for(var j=0,Y=0;Y<N.length;Y++)L=(T.words[Y]|0)-(N.words[Y]|0)+j,j=L>>26,this.words[Y]=L&67108863;for(;j!==0&&Y<T.length;Y++)L=(T.words[Y]|0)+j,j=L>>26,this.words[Y]=L&67108863;if(j===0&&Y<T.length&&T!==this)for(;Y<T.length;Y++)this.words[Y]=T.words[Y];return this.length=Math.max(this.length,Y),T!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(B){return this.clone().isub(B)};function M(K,B,L){L.negative=B.negative^K.negative;var $=K.length+B.length|0;L.length=$,$=$-1|0;var T=K.words[0]|0,N=B.words[0]|0,j=T*N,Y=j&67108863,Z=j/67108864|0;L.words[0]=Y;for(var z=1;z<$;z++){for(var fe=Z>>>26,te=Z&67108863,H=Math.min(z,B.length-1),Q=Math.max(0,z-K.length+1);Q<=H;Q++){var oe=z-Q|0;T=K.words[oe]|0,N=B.words[Q]|0,j=T*N+te,fe+=j/67108864|0,te=j&67108863}L.words[z]=te|0,Z=fe|0}return Z!==0?L.words[z]=Z|0:L.length--,L.strip()}var k=function(B,L,$){var T=B.words,N=L.words,j=$.words,Y=0,Z,z,fe,te=T[0]|0,H=te&8191,Q=te>>>13,oe=T[1]|0,_e=oe&8191,ge=oe>>>13,be=T[2]|0,we=be&8191,Ee=be>>>13,me=T[3]|0,Ke=me&8191,He=me>>>13,Ie=T[4]|0,Le=Ie&8191,Ge=Ie>>>13,Be=T[5]|0,We=Be&8191,Ze=Be>>>13,_t=T[6]|0,Ft=_t&8191,gt=_t>>>13,lt=T[7]|0,dt=lt&8191,tt=lt>>>13,rt=T[8]|0,ke=rt&8191,xe=rt>>>13,Pe=T[9]|0,it=Pe&8191,Xe=Pe>>>13,st=N[0]|0,It=st&8191,ft=st>>>13,Jt=N[1]|0,Ot=Jt&8191,Ct=Jt>>>13,qe=N[2]|0,Yt=qe&8191,ot=qe>>>13,Ae=N[3]|0,Rt=Ae&8191,Ht=Ae>>>13,bt=N[4]|0,Mt=bt&8191,tr=bt>>>13,Vt=N[5]|0,Et=Vt&8191,Ye=Vt>>>13,Tt=N[6]|0,Wt=Tt&8191,dr=Tt>>>13,at=N[7]|0,wt=at&8191,At=at>>>13,Je=N[8]|0,Lt=Je&8191,sr=Je>>>13,ur=N[9]|0,vr=ur&8191,kr=ur>>>13;$.negative=B.negative^L.negative,$.length=19,Z=Math.imul(H,It),z=Math.imul(H,ft),z=z+Math.imul(Q,It)|0,fe=Math.imul(Q,ft);var Jr=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Z=Math.imul(_e,It),z=Math.imul(_e,ft),z=z+Math.imul(ge,It)|0,fe=Math.imul(ge,ft),Z=Z+Math.imul(H,Ot)|0,z=z+Math.imul(H,Ct)|0,z=z+Math.imul(Q,Ot)|0,fe=fe+Math.imul(Q,Ct)|0;var hr=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(hr>>>26)|0,hr&=67108863,Z=Math.imul(we,It),z=Math.imul(we,ft),z=z+Math.imul(Ee,It)|0,fe=Math.imul(Ee,ft),Z=Z+Math.imul(_e,Ot)|0,z=z+Math.imul(_e,Ct)|0,z=z+Math.imul(ge,Ot)|0,fe=fe+Math.imul(ge,Ct)|0,Z=Z+Math.imul(H,Yt)|0,z=z+Math.imul(H,ot)|0,z=z+Math.imul(Q,Yt)|0,fe=fe+Math.imul(Q,ot)|0;var $r=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+($r>>>26)|0,$r&=67108863,Z=Math.imul(Ke,It),z=Math.imul(Ke,ft),z=z+Math.imul(He,It)|0,fe=Math.imul(He,ft),Z=Z+Math.imul(we,Ot)|0,z=z+Math.imul(we,Ct)|0,z=z+Math.imul(Ee,Ot)|0,fe=fe+Math.imul(Ee,Ct)|0,Z=Z+Math.imul(_e,Yt)|0,z=z+Math.imul(_e,ot)|0,z=z+Math.imul(ge,Yt)|0,fe=fe+Math.imul(ge,ot)|0,Z=Z+Math.imul(H,Rt)|0,z=z+Math.imul(H,Ht)|0,z=z+Math.imul(Q,Rt)|0,fe=fe+Math.imul(Q,Ht)|0;var Hr=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Z=Math.imul(Le,It),z=Math.imul(Le,ft),z=z+Math.imul(Ge,It)|0,fe=Math.imul(Ge,ft),Z=Z+Math.imul(Ke,Ot)|0,z=z+Math.imul(Ke,Ct)|0,z=z+Math.imul(He,Ot)|0,fe=fe+Math.imul(He,Ct)|0,Z=Z+Math.imul(we,Yt)|0,z=z+Math.imul(we,ot)|0,z=z+Math.imul(Ee,Yt)|0,fe=fe+Math.imul(Ee,ot)|0,Z=Z+Math.imul(_e,Rt)|0,z=z+Math.imul(_e,Ht)|0,z=z+Math.imul(ge,Rt)|0,fe=fe+Math.imul(ge,Ht)|0,Z=Z+Math.imul(H,Mt)|0,z=z+Math.imul(H,tr)|0,z=z+Math.imul(Q,Mt)|0,fe=fe+Math.imul(Q,tr)|0;var rn=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(rn>>>26)|0,rn&=67108863,Z=Math.imul(We,It),z=Math.imul(We,ft),z=z+Math.imul(Ze,It)|0,fe=Math.imul(Ze,ft),Z=Z+Math.imul(Le,Ot)|0,z=z+Math.imul(Le,Ct)|0,z=z+Math.imul(Ge,Ot)|0,fe=fe+Math.imul(Ge,Ct)|0,Z=Z+Math.imul(Ke,Yt)|0,z=z+Math.imul(Ke,ot)|0,z=z+Math.imul(He,Yt)|0,fe=fe+Math.imul(He,ot)|0,Z=Z+Math.imul(we,Rt)|0,z=z+Math.imul(we,Ht)|0,z=z+Math.imul(Ee,Rt)|0,fe=fe+Math.imul(Ee,Ht)|0,Z=Z+Math.imul(_e,Mt)|0,z=z+Math.imul(_e,tr)|0,z=z+Math.imul(ge,Mt)|0,fe=fe+Math.imul(ge,tr)|0,Z=Z+Math.imul(H,Et)|0,z=z+Math.imul(H,Ye)|0,z=z+Math.imul(Q,Et)|0,fe=fe+Math.imul(Q,Ye)|0;var _r=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(_r>>>26)|0,_r&=67108863,Z=Math.imul(Ft,It),z=Math.imul(Ft,ft),z=z+Math.imul(gt,It)|0,fe=Math.imul(gt,ft),Z=Z+Math.imul(We,Ot)|0,z=z+Math.imul(We,Ct)|0,z=z+Math.imul(Ze,Ot)|0,fe=fe+Math.imul(Ze,Ct)|0,Z=Z+Math.imul(Le,Yt)|0,z=z+Math.imul(Le,ot)|0,z=z+Math.imul(Ge,Yt)|0,fe=fe+Math.imul(Ge,ot)|0,Z=Z+Math.imul(Ke,Rt)|0,z=z+Math.imul(Ke,Ht)|0,z=z+Math.imul(He,Rt)|0,fe=fe+Math.imul(He,Ht)|0,Z=Z+Math.imul(we,Mt)|0,z=z+Math.imul(we,tr)|0,z=z+Math.imul(Ee,Mt)|0,fe=fe+Math.imul(Ee,tr)|0,Z=Z+Math.imul(_e,Et)|0,z=z+Math.imul(_e,Ye)|0,z=z+Math.imul(ge,Et)|0,fe=fe+Math.imul(ge,Ye)|0,Z=Z+Math.imul(H,Wt)|0,z=z+Math.imul(H,dr)|0,z=z+Math.imul(Q,Wt)|0,fe=fe+Math.imul(Q,dr)|0;var pn=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(pn>>>26)|0,pn&=67108863,Z=Math.imul(dt,It),z=Math.imul(dt,ft),z=z+Math.imul(tt,It)|0,fe=Math.imul(tt,ft),Z=Z+Math.imul(Ft,Ot)|0,z=z+Math.imul(Ft,Ct)|0,z=z+Math.imul(gt,Ot)|0,fe=fe+Math.imul(gt,Ct)|0,Z=Z+Math.imul(We,Yt)|0,z=z+Math.imul(We,ot)|0,z=z+Math.imul(Ze,Yt)|0,fe=fe+Math.imul(Ze,ot)|0,Z=Z+Math.imul(Le,Rt)|0,z=z+Math.imul(Le,Ht)|0,z=z+Math.imul(Ge,Rt)|0,fe=fe+Math.imul(Ge,Ht)|0,Z=Z+Math.imul(Ke,Mt)|0,z=z+Math.imul(Ke,tr)|0,z=z+Math.imul(He,Mt)|0,fe=fe+Math.imul(He,tr)|0,Z=Z+Math.imul(we,Et)|0,z=z+Math.imul(we,Ye)|0,z=z+Math.imul(Ee,Et)|0,fe=fe+Math.imul(Ee,Ye)|0,Z=Z+Math.imul(_e,Wt)|0,z=z+Math.imul(_e,dr)|0,z=z+Math.imul(ge,Wt)|0,fe=fe+Math.imul(ge,dr)|0,Z=Z+Math.imul(H,wt)|0,z=z+Math.imul(H,At)|0,z=z+Math.imul(Q,wt)|0,fe=fe+Math.imul(Q,At)|0;var $t=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+($t>>>26)|0,$t&=67108863,Z=Math.imul(ke,It),z=Math.imul(ke,ft),z=z+Math.imul(xe,It)|0,fe=Math.imul(xe,ft),Z=Z+Math.imul(dt,Ot)|0,z=z+Math.imul(dt,Ct)|0,z=z+Math.imul(tt,Ot)|0,fe=fe+Math.imul(tt,Ct)|0,Z=Z+Math.imul(Ft,Yt)|0,z=z+Math.imul(Ft,ot)|0,z=z+Math.imul(gt,Yt)|0,fe=fe+Math.imul(gt,ot)|0,Z=Z+Math.imul(We,Rt)|0,z=z+Math.imul(We,Ht)|0,z=z+Math.imul(Ze,Rt)|0,fe=fe+Math.imul(Ze,Ht)|0,Z=Z+Math.imul(Le,Mt)|0,z=z+Math.imul(Le,tr)|0,z=z+Math.imul(Ge,Mt)|0,fe=fe+Math.imul(Ge,tr)|0,Z=Z+Math.imul(Ke,Et)|0,z=z+Math.imul(Ke,Ye)|0,z=z+Math.imul(He,Et)|0,fe=fe+Math.imul(He,Ye)|0,Z=Z+Math.imul(we,Wt)|0,z=z+Math.imul(we,dr)|0,z=z+Math.imul(Ee,Wt)|0,fe=fe+Math.imul(Ee,dr)|0,Z=Z+Math.imul(_e,wt)|0,z=z+Math.imul(_e,At)|0,z=z+Math.imul(ge,wt)|0,fe=fe+Math.imul(ge,At)|0,Z=Z+Math.imul(H,Lt)|0,z=z+Math.imul(H,sr)|0,z=z+Math.imul(Q,Lt)|0,fe=fe+Math.imul(Q,sr)|0;var In=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(In>>>26)|0,In&=67108863,Z=Math.imul(it,It),z=Math.imul(it,ft),z=z+Math.imul(Xe,It)|0,fe=Math.imul(Xe,ft),Z=Z+Math.imul(ke,Ot)|0,z=z+Math.imul(ke,Ct)|0,z=z+Math.imul(xe,Ot)|0,fe=fe+Math.imul(xe,Ct)|0,Z=Z+Math.imul(dt,Yt)|0,z=z+Math.imul(dt,ot)|0,z=z+Math.imul(tt,Yt)|0,fe=fe+Math.imul(tt,ot)|0,Z=Z+Math.imul(Ft,Rt)|0,z=z+Math.imul(Ft,Ht)|0,z=z+Math.imul(gt,Rt)|0,fe=fe+Math.imul(gt,Ht)|0,Z=Z+Math.imul(We,Mt)|0,z=z+Math.imul(We,tr)|0,z=z+Math.imul(Ze,Mt)|0,fe=fe+Math.imul(Ze,tr)|0,Z=Z+Math.imul(Le,Et)|0,z=z+Math.imul(Le,Ye)|0,z=z+Math.imul(Ge,Et)|0,fe=fe+Math.imul(Ge,Ye)|0,Z=Z+Math.imul(Ke,Wt)|0,z=z+Math.imul(Ke,dr)|0,z=z+Math.imul(He,Wt)|0,fe=fe+Math.imul(He,dr)|0,Z=Z+Math.imul(we,wt)|0,z=z+Math.imul(we,At)|0,z=z+Math.imul(Ee,wt)|0,fe=fe+Math.imul(Ee,At)|0,Z=Z+Math.imul(_e,Lt)|0,z=z+Math.imul(_e,sr)|0,z=z+Math.imul(ge,Lt)|0,fe=fe+Math.imul(ge,sr)|0,Z=Z+Math.imul(H,vr)|0,z=z+Math.imul(H,kr)|0,z=z+Math.imul(Q,vr)|0,fe=fe+Math.imul(Q,kr)|0;var ln=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(ln>>>26)|0,ln&=67108863,Z=Math.imul(it,Ot),z=Math.imul(it,Ct),z=z+Math.imul(Xe,Ot)|0,fe=Math.imul(Xe,Ct),Z=Z+Math.imul(ke,Yt)|0,z=z+Math.imul(ke,ot)|0,z=z+Math.imul(xe,Yt)|0,fe=fe+Math.imul(xe,ot)|0,Z=Z+Math.imul(dt,Rt)|0,z=z+Math.imul(dt,Ht)|0,z=z+Math.imul(tt,Rt)|0,fe=fe+Math.imul(tt,Ht)|0,Z=Z+Math.imul(Ft,Mt)|0,z=z+Math.imul(Ft,tr)|0,z=z+Math.imul(gt,Mt)|0,fe=fe+Math.imul(gt,tr)|0,Z=Z+Math.imul(We,Et)|0,z=z+Math.imul(We,Ye)|0,z=z+Math.imul(Ze,Et)|0,fe=fe+Math.imul(Ze,Ye)|0,Z=Z+Math.imul(Le,Wt)|0,z=z+Math.imul(Le,dr)|0,z=z+Math.imul(Ge,Wt)|0,fe=fe+Math.imul(Ge,dr)|0,Z=Z+Math.imul(Ke,wt)|0,z=z+Math.imul(Ke,At)|0,z=z+Math.imul(He,wt)|0,fe=fe+Math.imul(He,At)|0,Z=Z+Math.imul(we,Lt)|0,z=z+Math.imul(we,sr)|0,z=z+Math.imul(Ee,Lt)|0,fe=fe+Math.imul(Ee,sr)|0,Z=Z+Math.imul(_e,vr)|0,z=z+Math.imul(_e,kr)|0,z=z+Math.imul(ge,vr)|0,fe=fe+Math.imul(ge,kr)|0;var yn=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(yn>>>26)|0,yn&=67108863,Z=Math.imul(it,Yt),z=Math.imul(it,ot),z=z+Math.imul(Xe,Yt)|0,fe=Math.imul(Xe,ot),Z=Z+Math.imul(ke,Rt)|0,z=z+Math.imul(ke,Ht)|0,z=z+Math.imul(xe,Rt)|0,fe=fe+Math.imul(xe,Ht)|0,Z=Z+Math.imul(dt,Mt)|0,z=z+Math.imul(dt,tr)|0,z=z+Math.imul(tt,Mt)|0,fe=fe+Math.imul(tt,tr)|0,Z=Z+Math.imul(Ft,Et)|0,z=z+Math.imul(Ft,Ye)|0,z=z+Math.imul(gt,Et)|0,fe=fe+Math.imul(gt,Ye)|0,Z=Z+Math.imul(We,Wt)|0,z=z+Math.imul(We,dr)|0,z=z+Math.imul(Ze,Wt)|0,fe=fe+Math.imul(Ze,dr)|0,Z=Z+Math.imul(Le,wt)|0,z=z+Math.imul(Le,At)|0,z=z+Math.imul(Ge,wt)|0,fe=fe+Math.imul(Ge,At)|0,Z=Z+Math.imul(Ke,Lt)|0,z=z+Math.imul(Ke,sr)|0,z=z+Math.imul(He,Lt)|0,fe=fe+Math.imul(He,sr)|0,Z=Z+Math.imul(we,vr)|0,z=z+Math.imul(we,kr)|0,z=z+Math.imul(Ee,vr)|0,fe=fe+Math.imul(Ee,kr)|0;var Fr=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Z=Math.imul(it,Rt),z=Math.imul(it,Ht),z=z+Math.imul(Xe,Rt)|0,fe=Math.imul(Xe,Ht),Z=Z+Math.imul(ke,Mt)|0,z=z+Math.imul(ke,tr)|0,z=z+Math.imul(xe,Mt)|0,fe=fe+Math.imul(xe,tr)|0,Z=Z+Math.imul(dt,Et)|0,z=z+Math.imul(dt,Ye)|0,z=z+Math.imul(tt,Et)|0,fe=fe+Math.imul(tt,Ye)|0,Z=Z+Math.imul(Ft,Wt)|0,z=z+Math.imul(Ft,dr)|0,z=z+Math.imul(gt,Wt)|0,fe=fe+Math.imul(gt,dr)|0,Z=Z+Math.imul(We,wt)|0,z=z+Math.imul(We,At)|0,z=z+Math.imul(Ze,wt)|0,fe=fe+Math.imul(Ze,At)|0,Z=Z+Math.imul(Le,Lt)|0,z=z+Math.imul(Le,sr)|0,z=z+Math.imul(Ge,Lt)|0,fe=fe+Math.imul(Ge,sr)|0,Z=Z+Math.imul(Ke,vr)|0,z=z+Math.imul(Ke,kr)|0,z=z+Math.imul(He,vr)|0,fe=fe+Math.imul(He,kr)|0;var On=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(On>>>26)|0,On&=67108863,Z=Math.imul(it,Mt),z=Math.imul(it,tr),z=z+Math.imul(Xe,Mt)|0,fe=Math.imul(Xe,tr),Z=Z+Math.imul(ke,Et)|0,z=z+Math.imul(ke,Ye)|0,z=z+Math.imul(xe,Et)|0,fe=fe+Math.imul(xe,Ye)|0,Z=Z+Math.imul(dt,Wt)|0,z=z+Math.imul(dt,dr)|0,z=z+Math.imul(tt,Wt)|0,fe=fe+Math.imul(tt,dr)|0,Z=Z+Math.imul(Ft,wt)|0,z=z+Math.imul(Ft,At)|0,z=z+Math.imul(gt,wt)|0,fe=fe+Math.imul(gt,At)|0,Z=Z+Math.imul(We,Lt)|0,z=z+Math.imul(We,sr)|0,z=z+Math.imul(Ze,Lt)|0,fe=fe+Math.imul(Ze,sr)|0,Z=Z+Math.imul(Le,vr)|0,z=z+Math.imul(Le,kr)|0,z=z+Math.imul(Ge,vr)|0,fe=fe+Math.imul(Ge,kr)|0;var En=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(En>>>26)|0,En&=67108863,Z=Math.imul(it,Et),z=Math.imul(it,Ye),z=z+Math.imul(Xe,Et)|0,fe=Math.imul(Xe,Ye),Z=Z+Math.imul(ke,Wt)|0,z=z+Math.imul(ke,dr)|0,z=z+Math.imul(xe,Wt)|0,fe=fe+Math.imul(xe,dr)|0,Z=Z+Math.imul(dt,wt)|0,z=z+Math.imul(dt,At)|0,z=z+Math.imul(tt,wt)|0,fe=fe+Math.imul(tt,At)|0,Z=Z+Math.imul(Ft,Lt)|0,z=z+Math.imul(Ft,sr)|0,z=z+Math.imul(gt,Lt)|0,fe=fe+Math.imul(gt,sr)|0,Z=Z+Math.imul(We,vr)|0,z=z+Math.imul(We,kr)|0,z=z+Math.imul(Ze,vr)|0,fe=fe+Math.imul(Ze,kr)|0;var ee=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(ee>>>26)|0,ee&=67108863,Z=Math.imul(it,Wt),z=Math.imul(it,dr),z=z+Math.imul(Xe,Wt)|0,fe=Math.imul(Xe,dr),Z=Z+Math.imul(ke,wt)|0,z=z+Math.imul(ke,At)|0,z=z+Math.imul(xe,wt)|0,fe=fe+Math.imul(xe,At)|0,Z=Z+Math.imul(dt,Lt)|0,z=z+Math.imul(dt,sr)|0,z=z+Math.imul(tt,Lt)|0,fe=fe+Math.imul(tt,sr)|0,Z=Z+Math.imul(Ft,vr)|0,z=z+Math.imul(Ft,kr)|0,z=z+Math.imul(gt,vr)|0,fe=fe+Math.imul(gt,kr)|0;var ve=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(ve>>>26)|0,ve&=67108863,Z=Math.imul(it,wt),z=Math.imul(it,At),z=z+Math.imul(Xe,wt)|0,fe=Math.imul(Xe,At),Z=Z+Math.imul(ke,Lt)|0,z=z+Math.imul(ke,sr)|0,z=z+Math.imul(xe,Lt)|0,fe=fe+Math.imul(xe,sr)|0,Z=Z+Math.imul(dt,vr)|0,z=z+Math.imul(dt,kr)|0,z=z+Math.imul(tt,vr)|0,fe=fe+Math.imul(tt,kr)|0;var ze=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(ze>>>26)|0,ze&=67108863,Z=Math.imul(it,Lt),z=Math.imul(it,sr),z=z+Math.imul(Xe,Lt)|0,fe=Math.imul(Xe,sr),Z=Z+Math.imul(ke,vr)|0,z=z+Math.imul(ke,kr)|0,z=z+Math.imul(xe,vr)|0,fe=fe+Math.imul(xe,kr)|0;var yt=(Y+Z|0)+((z&8191)<<13)|0;Y=(fe+(z>>>13)|0)+(yt>>>26)|0,yt&=67108863,Z=Math.imul(it,vr),z=Math.imul(it,kr),z=z+Math.imul(Xe,vr)|0,fe=Math.imul(Xe,kr);var vt=(Y+Z|0)+((z&8191)<<13)|0;return Y=(fe+(z>>>13)|0)+(vt>>>26)|0,vt&=67108863,j[0]=Jr,j[1]=hr,j[2]=$r,j[3]=Hr,j[4]=rn,j[5]=_r,j[6]=pn,j[7]=$t,j[8]=In,j[9]=ln,j[10]=yn,j[11]=Fr,j[12]=On,j[13]=En,j[14]=ee,j[15]=ve,j[16]=ze,j[17]=yt,j[18]=vt,Y!==0&&(j[19]=Y,$.length++),$};Math.imul||(k=M);function q(K,B,L){L.negative=B.negative^K.negative,L.length=K.length+B.length;for(var $=0,T=0,N=0;N<L.length-1;N++){var j=T;T=0;for(var Y=$&67108863,Z=Math.min(N,B.length-1),z=Math.max(0,N-K.length+1);z<=Z;z++){var fe=N-z,te=K.words[fe]|0,H=B.words[z]|0,Q=te*H,oe=Q&67108863;j=j+(Q/67108864|0)|0,oe=oe+Y|0,Y=oe&67108863,j=j+(oe>>>26)|0,T+=j>>>26,j&=67108863}L.words[N]=Y,$=j,j=T}return $!==0?L.words[N]=$:L.length--,L.strip()}function b(K,B,L){var $=new F;return $.mulp(K,B,L)}c.prototype.mulTo=function(B,L){var $,T=this.length+B.length;return this.length===10&&B.length===10?$=k(this,B,L):T<63?$=M(this,B,L):T<1024?$=q(this,B,L):$=b(this,B,L),$};function F(K,B){this.x=K,this.y=B}F.prototype.makeRBT=function(B){for(var L=new Array(B),$=c.prototype._countBits(B)-1,T=0;T<B;T++)L[T]=this.revBin(T,$,B);return L},F.prototype.revBin=function(B,L,$){if(B===0||B===$-1)return B;for(var T=0,N=0;N<L;N++)T|=(B&1)<<L-N-1,B>>=1;return T},F.prototype.permute=function(B,L,$,T,N,j){for(var Y=0;Y<j;Y++)T[Y]=L[B[Y]],N[Y]=$[B[Y]]},F.prototype.transform=function(B,L,$,T,N,j){this.permute(j,B,L,$,T,N);for(var Y=1;Y<N;Y<<=1)for(var Z=Y<<1,z=Math.cos(2*Math.PI/Z),fe=Math.sin(2*Math.PI/Z),te=0;te<N;te+=Z)for(var H=z,Q=fe,oe=0;oe<Y;oe++){var _e=$[te+oe],ge=T[te+oe],be=$[te+oe+Y],we=T[te+oe+Y],Ee=H*be-Q*we;we=H*we+Q*be,be=Ee,$[te+oe]=_e+be,T[te+oe]=ge+we,$[te+oe+Y]=_e-be,T[te+oe+Y]=ge-we,oe!==Z&&(Ee=z*H-fe*Q,Q=z*Q+fe*H,H=Ee)}},F.prototype.guessLen13b=function(B,L){var $=Math.max(L,B)|1,T=$&1,N=0;for($=$/2|0;$;$=$>>>1)N++;return 1<<N+1+T},F.prototype.conjugate=function(B,L,$){if(!($<=1))for(var T=0;T<$/2;T++){var N=B[T];B[T]=B[$-T-1],B[$-T-1]=N,N=L[T],L[T]=-L[$-T-1],L[$-T-1]=-N}},F.prototype.normalize13b=function(B,L){for(var $=0,T=0;T<L/2;T++){var N=Math.round(B[2*T+1]/L)*8192+Math.round(B[2*T]/L)+$;B[T]=N&67108863,N<67108864?$=0:$=N/67108864|0}return B},F.prototype.convert13b=function(B,L,$,T){for(var N=0,j=0;j<L;j++)N=N+(B[j]|0),$[2*j]=N&8191,N=N>>>13,$[2*j+1]=N&8191,N=N>>>13;for(j=2*L;j<T;++j)$[j]=0;E(N===0),E((N&-8192)===0)},F.prototype.stub=function(B){for(var L=new Array(B),$=0;$<B;$++)L[$]=0;return L},F.prototype.mulp=function(B,L,$){var T=2*this.guessLen13b(B.length,L.length),N=this.makeRBT(T),j=this.stub(T),Y=new Array(T),Z=new Array(T),z=new Array(T),fe=new Array(T),te=new Array(T),H=new Array(T),Q=$.words;Q.length=T,this.convert13b(B.words,B.length,Y,T),this.convert13b(L.words,L.length,fe,T),this.transform(Y,j,Z,z,T,N),this.transform(fe,j,te,H,T,N);for(var oe=0;oe<T;oe++){var _e=Z[oe]*te[oe]-z[oe]*H[oe];z[oe]=Z[oe]*H[oe]+z[oe]*te[oe],Z[oe]=_e}return this.conjugate(Z,z,T),this.transform(Z,z,Q,j,T,N),this.conjugate(Q,j,T),this.normalize13b(Q,T),$.negative=B.negative^L.negative,$.length=B.length+L.length,$.strip()},c.prototype.mul=function(B){var L=new c(null);return L.words=new Array(this.length+B.length),this.mulTo(B,L)},c.prototype.mulf=function(B){var L=new c(null);return L.words=new Array(this.length+B.length),b(this,B,L)},c.prototype.imul=function(B){return this.clone().mulTo(B,this)},c.prototype.imuln=function(B){E(typeof B=="number"),E(B<67108864);for(var L=0,$=0;$<this.length;$++){var T=(this.words[$]|0)*B,N=(T&67108863)+(L&67108863);L>>=26,L+=T/67108864|0,L+=N>>>26,this.words[$]=N&67108863}return L!==0&&(this.words[$]=L,this.length++),this},c.prototype.muln=function(B){return this.clone().imuln(B)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(B){var L=O(B);if(L.length===0)return new c(1);for(var $=this,T=0;T<L.length&&L[T]===0;T++,$=$.sqr());if(++T<L.length)for(var N=$.sqr();T<L.length;T++,N=N.sqr())L[T]!==0&&($=$.mul(N));return $},c.prototype.iushln=function(B){E(typeof B=="number"&&B>=0);var L=B%26,$=(B-L)/26,T=67108863>>>26-L<<26-L,N;if(L!==0){var j=0;for(N=0;N<this.length;N++){var Y=this.words[N]&T,Z=(this.words[N]|0)-Y<<L;this.words[N]=Z|j,j=Y>>>26-L}j&&(this.words[N]=j,this.length++)}if($!==0){for(N=this.length-1;N>=0;N--)this.words[N+$]=this.words[N];for(N=0;N<$;N++)this.words[N]=0;this.length+=$}return this.strip()},c.prototype.ishln=function(B){return E(this.negative===0),this.iushln(B)},c.prototype.iushrn=function(B,L,$){E(typeof B=="number"&&B>=0);var T;L?T=(L-L%26)/26:T=0;var N=B%26,j=Math.min((B-N)/26,this.length),Y=67108863^67108863>>>N<<N,Z=$;if(T-=j,T=Math.max(0,T),Z){for(var z=0;z<j;z++)Z.words[z]=this.words[z];Z.length=j}if(j!==0)if(this.length>j)for(this.length-=j,z=0;z<this.length;z++)this.words[z]=this.words[z+j];else this.words[0]=0,this.length=1;var fe=0;for(z=this.length-1;z>=0&&(fe!==0||z>=T);z--){var te=this.words[z]|0;this.words[z]=fe<<26-N|te>>>N,fe=te&Y}return Z&&fe!==0&&(Z.words[Z.length++]=fe),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(B,L,$){return E(this.negative===0),this.iushrn(B,L,$)},c.prototype.shln=function(B){return this.clone().ishln(B)},c.prototype.ushln=function(B){return this.clone().iushln(B)},c.prototype.shrn=function(B){return this.clone().ishrn(B)},c.prototype.ushrn=function(B){return this.clone().iushrn(B)},c.prototype.testn=function(B){E(typeof B=="number"&&B>=0);var L=B%26,$=(B-L)/26,T=1<<L;if(this.length<=$)return!1;var N=this.words[$];return!!(N&T)},c.prototype.imaskn=function(B){E(typeof B=="number"&&B>=0);var L=B%26,$=(B-L)/26;if(E(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(L!==0&&$++,this.length=Math.min($,this.length),L!==0){var T=67108863^67108863>>>L<<L;this.words[this.length-1]&=T}return this.strip()},c.prototype.maskn=function(B){return this.clone().imaskn(B)},c.prototype.iaddn=function(B){return E(typeof B=="number"),E(B<67108864),B<0?this.isubn(-B):this.negative!==0?this.length===1&&(this.words[0]|0)<B?(this.words[0]=B-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(B),this.negative=1,this):this._iaddn(B)},c.prototype._iaddn=function(B){this.words[0]+=B;for(var L=0;L<this.length&&this.words[L]>=67108864;L++)this.words[L]-=67108864,L===this.length-1?this.words[L+1]=1:this.words[L+1]++;return this.length=Math.max(this.length,L+1),this},c.prototype.isubn=function(B){if(E(typeof B=="number"),E(B<67108864),B<0)return this.iaddn(-B);if(this.negative!==0)return this.negative=0,this.iaddn(B),this.negative=1,this;if(this.words[0]-=B,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var L=0;L<this.length&&this.words[L]<0;L++)this.words[L]+=67108864,this.words[L+1]-=1;return this.strip()},c.prototype.addn=function(B){return this.clone().iaddn(B)},c.prototype.subn=function(B){return this.clone().isubn(B)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(B,L,$){var T=B.length+$,N;this._expand(T);var j,Y=0;for(N=0;N<B.length;N++){j=(this.words[N+$]|0)+Y;var Z=(B.words[N]|0)*L;j-=Z&67108863,Y=(j>>26)-(Z/67108864|0),this.words[N+$]=j&67108863}for(;N<this.length-$;N++)j=(this.words[N+$]|0)+Y,Y=j>>26,this.words[N+$]=j&67108863;if(Y===0)return this.strip();for(E(Y===-1),Y=0,N=0;N<this.length;N++)j=-(this.words[N]|0)+Y,Y=j>>26,this.words[N]=j&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(B,L){var $=this.length-B.length,T=this.clone(),N=B,j=N.words[N.length-1]|0,Y=this._countBits(j);$=26-Y,$!==0&&(N=N.ushln($),T.iushln($),j=N.words[N.length-1]|0);var Z=T.length-N.length,z;if(L!=="mod"){z=new c(null),z.length=Z+1,z.words=new Array(z.length);for(var fe=0;fe<z.length;fe++)z.words[fe]=0}var te=T.clone()._ishlnsubmul(N,1,Z);te.negative===0&&(T=te,z&&(z.words[Z]=1));for(var H=Z-1;H>=0;H--){var Q=(T.words[N.length+H]|0)*67108864+(T.words[N.length+H-1]|0);for(Q=Math.min(Q/j|0,67108863),T._ishlnsubmul(N,Q,H);T.negative!==0;)Q--,T.negative=0,T._ishlnsubmul(N,1,H),T.isZero()||(T.negative^=1);z&&(z.words[H]=Q)}return z&&z.strip(),T.strip(),L!=="div"&&$!==0&&T.iushrn($),{div:z||null,mod:T}},c.prototype.divmod=function(B,L,$){if(E(!B.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var T,N,j;return this.negative!==0&&B.negative===0?(j=this.neg().divmod(B,L),L!=="mod"&&(T=j.div.neg()),L!=="div"&&(N=j.mod.neg(),$&&N.negative!==0&&N.iadd(B)),{div:T,mod:N}):this.negative===0&&B.negative!==0?(j=this.divmod(B.neg(),L),L!=="mod"&&(T=j.div.neg()),{div:T,mod:j.mod}):this.negative&B.negative?(j=this.neg().divmod(B.neg(),L),L!=="div"&&(N=j.mod.neg(),$&&N.negative!==0&&N.isub(B)),{div:j.div,mod:N}):B.length>this.length||this.cmp(B)<0?{div:new c(0),mod:this}:B.length===1?L==="div"?{div:this.divn(B.words[0]),mod:null}:L==="mod"?{div:null,mod:new c(this.modn(B.words[0]))}:{div:this.divn(B.words[0]),mod:new c(this.modn(B.words[0]))}:this._wordDiv(B,L)},c.prototype.div=function(B){return this.divmod(B,"div",!1).div},c.prototype.mod=function(B){return this.divmod(B,"mod",!1).mod},c.prototype.umod=function(B){return this.divmod(B,"mod",!0).mod},c.prototype.divRound=function(B){var L=this.divmod(B);if(L.mod.isZero())return L.div;var $=L.div.negative!==0?L.mod.isub(B):L.mod,T=B.ushrn(1),N=B.andln(1),j=$.cmp(T);return j<0||N===1&&j===0?L.div:L.div.negative!==0?L.div.isubn(1):L.div.iaddn(1)},c.prototype.modn=function(B){E(B<=67108863);for(var L=(1<<26)%B,$=0,T=this.length-1;T>=0;T--)$=(L*$+(this.words[T]|0))%B;return $},c.prototype.idivn=function(B){E(B<=67108863);for(var L=0,$=this.length-1;$>=0;$--){var T=(this.words[$]|0)+L*67108864;this.words[$]=T/B|0,L=T%B}return this.strip()},c.prototype.divn=function(B){return this.clone().idivn(B)},c.prototype.egcd=function(B){E(B.negative===0),E(!B.isZero());var L=this,$=B.clone();L.negative!==0?L=L.umod(B):L=L.clone();for(var T=new c(1),N=new c(0),j=new c(0),Y=new c(1),Z=0;L.isEven()&&$.isEven();)L.iushrn(1),$.iushrn(1),++Z;for(var z=$.clone(),fe=L.clone();!L.isZero();){for(var te=0,H=1;!(L.words[0]&H)&&te<26;++te,H<<=1);if(te>0)for(L.iushrn(te);te-- >0;)(T.isOdd()||N.isOdd())&&(T.iadd(z),N.isub(fe)),T.iushrn(1),N.iushrn(1);for(var Q=0,oe=1;!($.words[0]&oe)&&Q<26;++Q,oe<<=1);if(Q>0)for($.iushrn(Q);Q-- >0;)(j.isOdd()||Y.isOdd())&&(j.iadd(z),Y.isub(fe)),j.iushrn(1),Y.iushrn(1);L.cmp($)>=0?(L.isub($),T.isub(j),N.isub(Y)):($.isub(L),j.isub(T),Y.isub(N))}return{a:j,b:Y,gcd:$.iushln(Z)}},c.prototype._invmp=function(B){E(B.negative===0),E(!B.isZero());var L=this,$=B.clone();L.negative!==0?L=L.umod(B):L=L.clone();for(var T=new c(1),N=new c(0),j=$.clone();L.cmpn(1)>0&&$.cmpn(1)>0;){for(var Y=0,Z=1;!(L.words[0]&Z)&&Y<26;++Y,Z<<=1);if(Y>0)for(L.iushrn(Y);Y-- >0;)T.isOdd()&&T.iadd(j),T.iushrn(1);for(var z=0,fe=1;!($.words[0]&fe)&&z<26;++z,fe<<=1);if(z>0)for($.iushrn(z);z-- >0;)N.isOdd()&&N.iadd(j),N.iushrn(1);L.cmp($)>=0?(L.isub($),T.isub(N)):($.isub(L),N.isub(T))}var te;return L.cmpn(1)===0?te=T:te=N,te.cmpn(0)<0&&te.iadd(B),te},c.prototype.gcd=function(B){if(this.isZero())return B.abs();if(B.isZero())return this.abs();var L=this.clone(),$=B.clone();L.negative=0,$.negative=0;for(var T=0;L.isEven()&&$.isEven();T++)L.iushrn(1),$.iushrn(1);do{for(;L.isEven();)L.iushrn(1);for(;$.isEven();)$.iushrn(1);var N=L.cmp($);if(N<0){var j=L;L=$,$=j}else if(N===0||$.cmpn(1)===0)break;L.isub($)}while(!0);return $.iushln(T)},c.prototype.invm=function(B){return this.egcd(B).a.umod(B)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(B){return this.words[0]&B},c.prototype.bincn=function(B){E(typeof B=="number");var L=B%26,$=(B-L)/26,T=1<<L;if(this.length<=$)return this._expand($+1),this.words[$]|=T,this;for(var N=T,j=$;N!==0&&j<this.length;j++){var Y=this.words[j]|0;Y+=N,N=Y>>>26,Y&=67108863,this.words[j]=Y}return N!==0&&(this.words[j]=N,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(B){var L=B<0;if(this.negative!==0&&!L)return-1;if(this.negative===0&&L)return 1;this.strip();var $;if(this.length>1)$=1;else{L&&(B=-B),E(B<=67108863,"Number is too big");var T=this.words[0]|0;$=T===B?0:T<B?-1:1}return this.negative!==0?-$|0:$},c.prototype.cmp=function(B){if(this.negative!==0&&B.negative===0)return-1;if(this.negative===0&&B.negative!==0)return 1;var L=this.ucmp(B);return this.negative!==0?-L|0:L},c.prototype.ucmp=function(B){if(this.length>B.length)return 1;if(this.length<B.length)return-1;for(var L=0,$=this.length-1;$>=0;$--){var T=this.words[$]|0,N=B.words[$]|0;if(T!==N){T<N?L=-1:T>N&&(L=1);break}}return L},c.prototype.gtn=function(B){return this.cmpn(B)===1},c.prototype.gt=function(B){return this.cmp(B)===1},c.prototype.gten=function(B){return this.cmpn(B)>=0},c.prototype.gte=function(B){return this.cmp(B)>=0},c.prototype.ltn=function(B){return this.cmpn(B)===-1},c.prototype.lt=function(B){return this.cmp(B)===-1},c.prototype.lten=function(B){return this.cmpn(B)<=0},c.prototype.lte=function(B){return this.cmp(B)<=0},c.prototype.eqn=function(B){return this.cmpn(B)===0},c.prototype.eq=function(B){return this.cmp(B)===0},c.red=function(B){return new ye(B)},c.prototype.toRed=function(B){return E(!this.red,"Already a number in reduction context"),E(this.negative===0,"red works only with positives"),B.convertTo(this)._forceRed(B)},c.prototype.fromRed=function(){return E(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(B){return this.red=B,this},c.prototype.forceRed=function(B){return E(!this.red,"Already a number in reduction context"),this._forceRed(B)},c.prototype.redAdd=function(B){return E(this.red,"redAdd works only with red numbers"),this.red.add(this,B)},c.prototype.redIAdd=function(B){return E(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,B)},c.prototype.redSub=function(B){return E(this.red,"redSub works only with red numbers"),this.red.sub(this,B)},c.prototype.redISub=function(B){return E(this.red,"redISub works only with red numbers"),this.red.isub(this,B)},c.prototype.redShl=function(B){return E(this.red,"redShl works only with red numbers"),this.red.shl(this,B)},c.prototype.redMul=function(B){return E(this.red,"redMul works only with red numbers"),this.red._verify2(this,B),this.red.mul(this,B)},c.prototype.redIMul=function(B){return E(this.red,"redMul works only with red numbers"),this.red._verify2(this,B),this.red.imul(this,B)},c.prototype.redSqr=function(){return E(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return E(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return E(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return E(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return E(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(B){return E(this.red&&!B.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,B)};var G={k256:null,p224:null,p192:null,p25519:null};function ue(K,B){this.name=K,this.p=new c(B,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}ue.prototype._tmp=function(){var B=new c(null);return B.words=new Array(Math.ceil(this.n/13)),B},ue.prototype.ireduce=function(B){var L=B,$;do this.split(L,this.tmp),L=this.imulK(L),L=L.iadd(this.tmp),$=L.bitLength();while($>this.n);var T=$<this.n?-1:L.ucmp(this.p);return T===0?(L.words[0]=0,L.length=1):T>0?L.isub(this.p):L.strip!==void 0?L.strip():L._strip(),L},ue.prototype.split=function(B,L){B.iushrn(this.n,0,L)},ue.prototype.imulK=function(B){return B.imul(this.k)};function le(){ue.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(le,ue),le.prototype.split=function(B,L){for(var $=4194303,T=Math.min(B.length,9),N=0;N<T;N++)L.words[N]=B.words[N];if(L.length=T,B.length<=9){B.words[0]=0,B.length=1;return}var j=B.words[9];for(L.words[L.length++]=j&$,N=10;N<B.length;N++){var Y=B.words[N]|0;B.words[N-10]=(Y&$)<<4|j>>>22,j=Y}j>>>=22,B.words[N-10]=j,j===0&&B.length>10?B.length-=10:B.length-=9},le.prototype.imulK=function(B){B.words[B.length]=0,B.words[B.length+1]=0,B.length+=2;for(var L=0,$=0;$<B.length;$++){var T=B.words[$]|0;L+=T*977,B.words[$]=L&67108863,L=T*64+(L/67108864|0)}return B.words[B.length-1]===0&&(B.length--,B.words[B.length-1]===0&&B.length--),B};function X(){ue.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(X,ue);function se(){ue.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(se,ue);function de(){ue.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(de,ue),de.prototype.imulK=function(B){for(var L=0,$=0;$<B.length;$++){var T=(B.words[$]|0)*19+L,N=T&67108863;T>>>=26,B.words[$]=N,L=T}return L!==0&&(B.words[B.length++]=L),B},c._prime=function(B){if(G[B])return G[B];var L;if(B==="k256")L=new le;else if(B==="p224")L=new X;else if(B==="p192")L=new se;else if(B==="p25519")L=new de;else throw new Error("Unknown prime "+B);return G[B]=L,L};function ye(K){if(typeof K=="string"){var B=c._prime(K);this.m=B.p,this.prime=B}else E(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ye.prototype._verify1=function(B){E(B.negative===0,"red works only with positives"),E(B.red,"red works only with red numbers")},ye.prototype._verify2=function(B,L){E((B.negative|L.negative)===0,"red works only with positives"),E(B.red&&B.red===L.red,"red works only with red numbers")},ye.prototype.imod=function(B){return this.prime?this.prime.ireduce(B)._forceRed(this):B.umod(this.m)._forceRed(this)},ye.prototype.neg=function(B){return B.isZero()?B.clone():this.m.sub(B)._forceRed(this)},ye.prototype.add=function(B,L){this._verify2(B,L);var $=B.add(L);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},ye.prototype.iadd=function(B,L){this._verify2(B,L);var $=B.iadd(L);return $.cmp(this.m)>=0&&$.isub(this.m),$},ye.prototype.sub=function(B,L){this._verify2(B,L);var $=B.sub(L);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},ye.prototype.isub=function(B,L){this._verify2(B,L);var $=B.isub(L);return $.cmpn(0)<0&&$.iadd(this.m),$},ye.prototype.shl=function(B,L){return this._verify1(B),this.imod(B.ushln(L))},ye.prototype.imul=function(B,L){return this._verify2(B,L),this.imod(B.imul(L))},ye.prototype.mul=function(B,L){return this._verify2(B,L),this.imod(B.mul(L))},ye.prototype.isqr=function(B){return this.imul(B,B.clone())},ye.prototype.sqr=function(B){return this.mul(B,B)},ye.prototype.sqrt=function(B){if(B.isZero())return B.clone();var L=this.m.andln(3);if(E(L%2===1),L===3){var $=this.m.add(new c(1)).iushrn(2);return this.pow(B,$)}for(var T=this.m.subn(1),N=0;!T.isZero()&&T.andln(1)===0;)N++,T.iushrn(1);E(!T.isZero());var j=new c(1).toRed(this),Y=j.redNeg(),Z=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new c(2*z*z).toRed(this);this.pow(z,Z).cmp(Y)!==0;)z.redIAdd(Y);for(var fe=this.pow(z,T),te=this.pow(B,T.addn(1).iushrn(1)),H=this.pow(B,T),Q=N;H.cmp(j)!==0;){for(var oe=H,_e=0;oe.cmp(j)!==0;_e++)oe=oe.redSqr();E(_e<Q);var ge=this.pow(fe,new c(1).iushln(Q-_e-1));te=te.redMul(ge),fe=ge.redSqr(),H=H.redMul(fe),Q=_e}return te},ye.prototype.invm=function(B){var L=B._invmp(this.m);return L.negative!==0?(L.negative=0,this.imod(L).redNeg()):this.imod(L)},ye.prototype.pow=function(B,L){if(L.isZero())return new c(1).toRed(this);if(L.cmpn(1)===0)return B.clone();var $=4,T=new Array(1<<$);T[0]=new c(1).toRed(this),T[1]=B;for(var N=2;N<T.length;N++)T[N]=this.mul(T[N-1],B);var j=T[0],Y=0,Z=0,z=L.bitLength()%26;for(z===0&&(z=26),N=L.length-1;N>=0;N--){for(var fe=L.words[N],te=z-1;te>=0;te--){var H=fe>>te&1;if(j!==T[0]&&(j=this.sqr(j)),H===0&&Y===0){Z=0;continue}Y<<=1,Y|=H,Z++,!(Z!==$&&(N!==0||te!==0))&&(j=this.mul(j,T[Y]),Z=0,Y=0)}z=26}return j},ye.prototype.convertTo=function(B){var L=B.umod(this.m);return L===B?L.clone():L},ye.prototype.convertFrom=function(B){var L=B.clone();return L.red=null,L},c.mont=function(B){return new he(B)};function he(K){ye.call(this,K),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(he,ye),he.prototype.convertTo=function(B){return this.imod(B.ushln(this.shift))},he.prototype.convertFrom=function(B){var L=this.imod(B.mul(this.rinv));return L.red=null,L},he.prototype.imul=function(B,L){if(B.isZero()||L.isZero())return B.words[0]=0,B.length=1,B;var $=B.imul(L),T=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=$.isub(T).iushrn(this.shift),j=N;return N.cmp(this.m)>=0?j=N.isub(this.m):N.cmpn(0)<0&&(j=N.iadd(this.m)),j._forceRed(this)},he.prototype.mul=function(B,L){if(B.isZero()||L.isZero())return new c(0)._forceRed(this);var $=B.mul(L),T=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=$.isub(T).iushrn(this.shift),j=N;return N.cmp(this.m)>=0?j=N.isub(this.m):N.cmpn(0)<0&&(j=N.iadd(this.m)),j._forceRed(this)},he.prototype.invm=function(B){var L=this.imod(B._invmp(this.m).mul(this.r2));return L._forceRed(this)}}(ie,this)},83900:function(ie,f,_){ie=_.nmd(ie),function(h,w){"use strict";function E($,T){if(!$)throw new Error(T||"Assertion failed")}function v($,T){$.super_=T;var N=function(){};N.prototype=T.prototype,$.prototype=new N,$.prototype.constructor=$}function c($,T,N){if(c.isBN($))return $;this.negative=0,this.words=null,this.length=0,this.red=null,$!==null&&((T==="le"||T==="be")&&(N=T,T=10),this._init($||0,T||10,N||"be"))}typeof h=="object"?h.exports=c:w.BN=c,c.BN=c,c.wordSize=26;var d;try{d=_(53263).Buffer}catch{}c.isBN=function(T){return T instanceof c?!0:T!==null&&typeof T=="object"&&T.constructor.wordSize===c.wordSize&&Array.isArray(T.words)},c.max=function(T,N){return T.cmp(N)>0?T:N},c.min=function(T,N){return T.cmp(N)<0?T:N},c.prototype._init=function(T,N,j){if(typeof T=="number")return this._initNumber(T,N,j);if(typeof T=="object")return this._initArray(T,N,j);N==="hex"&&(N=16),E(N===(N|0)&&N>=2&&N<=36),T=T.toString().replace(/\s+/g,"");var Y=0;T[0]==="-"&&(Y++,this.negative=1),Y<T.length&&(N===16?this._parseHex(T,Y,j):(this._parseBase(T,N,Y),j==="le"&&this._initArray(this.toArray(),N,j)))},c.prototype._initNumber=function(T,N,j){T<0&&(this.negative=1,T=-T),T<67108864?(this.words=[T&67108863],this.length=1):T<4503599627370496?(this.words=[T&67108863,T/67108864&67108863],this.length=2):(E(T<9007199254740992),this.words=[T&67108863,T/67108864&67108863,1],this.length=3),j==="le"&&this._initArray(this.toArray(),N,j)},c.prototype._initArray=function(T,N,j){if(E(typeof T.length=="number"),T.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(T.length/3),this.words=new Array(this.length);for(var Y=0;Y<this.length;Y++)this.words[Y]=0;var Z,z,fe=0;if(j==="be")for(Y=T.length-1,Z=0;Y>=0;Y-=3)z=T[Y]|T[Y-1]<<8|T[Y-2]<<16,this.words[Z]|=z<<fe&67108863,this.words[Z+1]=z>>>26-fe&67108863,fe+=24,fe>=26&&(fe-=26,Z++);else if(j==="le")for(Y=0,Z=0;Y<T.length;Y+=3)z=T[Y]|T[Y+1]<<8|T[Y+2]<<16,this.words[Z]|=z<<fe&67108863,this.words[Z+1]=z>>>26-fe&67108863,fe+=24,fe>=26&&(fe-=26,Z++);return this._strip()};function p($,T){var N=$.charCodeAt(T);if(N>=48&&N<=57)return N-48;if(N>=65&&N<=70)return N-55;if(N>=97&&N<=102)return N-87;E(!1,"Invalid character in "+$)}function m($,T,N){var j=p($,N);return N-1>=T&&(j|=p($,N-1)<<4),j}c.prototype._parseHex=function(T,N,j){this.length=Math.ceil((T.length-N)/6),this.words=new Array(this.length);for(var Y=0;Y<this.length;Y++)this.words[Y]=0;var Z=0,z=0,fe;if(j==="be")for(Y=T.length-1;Y>=N;Y-=2)fe=m(T,N,Y)<<Z,this.words[z]|=fe&67108863,Z>=18?(Z-=18,z+=1,this.words[z]|=fe>>>26):Z+=8;else{var te=T.length-N;for(Y=te%2===0?N+1:N;Y<T.length;Y+=2)fe=m(T,N,Y)<<Z,this.words[z]|=fe&67108863,Z>=18?(Z-=18,z+=1,this.words[z]|=fe>>>26):Z+=8}this._strip()};function C($,T,N,j){for(var Y=0,Z=0,z=Math.min($.length,N),fe=T;fe<z;fe++){var te=$.charCodeAt(fe)-48;Y*=j,te>=49?Z=te-49+10:te>=17?Z=te-17+10:Z=te,E(te>=0&&Z<j,"Invalid character"),Y+=Z}return Y}c.prototype._parseBase=function(T,N,j){this.words=[0],this.length=1;for(var Y=0,Z=1;Z<=67108863;Z*=N)Y++;Y--,Z=Z/N|0;for(var z=T.length-j,fe=z%Y,te=Math.min(z,z-fe)+j,H=0,Q=j;Q<te;Q+=Y)H=C(T,Q,Q+Y,N),this.imuln(Z),this.words[0]+H<67108864?this.words[0]+=H:this._iaddn(H);if(fe!==0){var oe=1;for(H=C(T,Q,T.length,N),Q=0;Q<fe;Q++)oe*=N;this.imuln(oe),this.words[0]+H<67108864?this.words[0]+=H:this._iaddn(H)}this._strip()},c.prototype.copy=function(T){T.words=new Array(this.length);for(var N=0;N<this.length;N++)T.words[N]=this.words[N];T.length=this.length,T.negative=this.negative,T.red=this.red};function x($,T){$.words=T.words,$.length=T.length,$.negative=T.negative,$.red=T.red}if(c.prototype._move=function(T){x(T,this)},c.prototype.clone=function(){var T=new c(null);return this.copy(T),T},c.prototype._expand=function(T){for(;this.length<T;)this.words[this.length++]=0;return this},c.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{c.prototype[Symbol.for("nodejs.util.inspect.custom")]=R}catch{c.prototype.inspect=R}else c.prototype.inspect=R;function R(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(T,N){T=T||10,N=N|0||1;var j;if(T===16||T==="hex"){j="";for(var Y=0,Z=0,z=0;z<this.length;z++){var fe=this.words[z],te=((fe<<Y|Z)&16777215).toString(16);Z=fe>>>24-Y&16777215,Y+=2,Y>=26&&(Y-=26,z--),Z!==0||z!==this.length-1?j=S[6-te.length]+te+j:j=te+j}for(Z!==0&&(j=Z.toString(16)+j);j.length%N!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}if(T===(T|0)&&T>=2&&T<=36){var H=O[T],Q=M[T];j="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var _e=oe.modrn(Q).toString(T);oe=oe.idivn(Q),oe.isZero()?j=_e+j:j=S[H-_e.length]+_e+j}for(this.isZero()&&(j="0"+j);j.length%N!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}E(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var T=this.words[0];return this.length===2?T+=this.words[1]*67108864:this.length===3&&this.words[2]===1?T+=4503599627370496+this.words[1]*67108864:this.length>2&&E(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-T:T},c.prototype.toJSON=function(){return this.toString(16,2)},d&&(c.prototype.toBuffer=function(T,N){return this.toArrayLike(d,T,N)}),c.prototype.toArray=function(T,N){return this.toArrayLike(Array,T,N)};var k=function(T,N){return T.allocUnsafe?T.allocUnsafe(N):new T(N)};c.prototype.toArrayLike=function(T,N,j){this._strip();var Y=this.byteLength(),Z=j||Math.max(1,Y);E(Y<=Z,"byte array longer than desired length"),E(Z>0,"Requested array length <= 0");var z=k(T,Z),fe=N==="le"?"LE":"BE";return this["_toArrayLike"+fe](z,Y),z},c.prototype._toArrayLikeLE=function(T,N){for(var j=0,Y=0,Z=0,z=0;Z<this.length;Z++){var fe=this.words[Z]<<z|Y;T[j++]=fe&255,j<T.length&&(T[j++]=fe>>8&255),j<T.length&&(T[j++]=fe>>16&255),z===6?(j<T.length&&(T[j++]=fe>>24&255),Y=0,z=0):(Y=fe>>>24,z+=2)}if(j<T.length)for(T[j++]=Y;j<T.length;)T[j++]=0},c.prototype._toArrayLikeBE=function(T,N){for(var j=T.length-1,Y=0,Z=0,z=0;Z<this.length;Z++){var fe=this.words[Z]<<z|Y;T[j--]=fe&255,j>=0&&(T[j--]=fe>>8&255),j>=0&&(T[j--]=fe>>16&255),z===6?(j>=0&&(T[j--]=fe>>24&255),Y=0,z=0):(Y=fe>>>24,z+=2)}if(j>=0)for(T[j--]=Y;j>=0;)T[j--]=0},Math.clz32?c.prototype._countBits=function(T){return 32-Math.clz32(T)}:c.prototype._countBits=function(T){var N=T,j=0;return N>=4096&&(j+=13,N>>>=13),N>=64&&(j+=7,N>>>=7),N>=8&&(j+=4,N>>>=4),N>=2&&(j+=2,N>>>=2),j+N},c.prototype._zeroBits=function(T){if(T===0)return 26;var N=T,j=0;return N&8191||(j+=13,N>>>=13),N&127||(j+=7,N>>>=7),N&15||(j+=4,N>>>=4),N&3||(j+=2,N>>>=2),N&1||j++,j},c.prototype.bitLength=function(){var T=this.words[this.length-1],N=this._countBits(T);return(this.length-1)*26+N};function q($){for(var T=new Array($.bitLength()),N=0;N<T.length;N++){var j=N/26|0,Y=N%26;T[N]=$.words[j]>>>Y&1}return T}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var T=0,N=0;N<this.length;N++){var j=this._zeroBits(this.words[N]);if(T+=j,j!==26)break}return T},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(T){return this.negative!==0?this.abs().inotn(T).iaddn(1):this.clone()},c.prototype.fromTwos=function(T){return this.testn(T-1)?this.notn(T).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(T){for(;this.length<T.length;)this.words[this.length++]=0;for(var N=0;N<T.length;N++)this.words[N]=this.words[N]|T.words[N];return this._strip()},c.prototype.ior=function(T){return E((this.negative|T.negative)===0),this.iuor(T)},c.prototype.or=function(T){return this.length>T.length?this.clone().ior(T):T.clone().ior(this)},c.prototype.uor=function(T){return this.length>T.length?this.clone().iuor(T):T.clone().iuor(this)},c.prototype.iuand=function(T){var N;this.length>T.length?N=T:N=this;for(var j=0;j<N.length;j++)this.words[j]=this.words[j]&T.words[j];return this.length=N.length,this._strip()},c.prototype.iand=function(T){return E((this.negative|T.negative)===0),this.iuand(T)},c.prototype.and=function(T){return this.length>T.length?this.clone().iand(T):T.clone().iand(this)},c.prototype.uand=function(T){return this.length>T.length?this.clone().iuand(T):T.clone().iuand(this)},c.prototype.iuxor=function(T){var N,j;this.length>T.length?(N=this,j=T):(N=T,j=this);for(var Y=0;Y<j.length;Y++)this.words[Y]=N.words[Y]^j.words[Y];if(this!==N)for(;Y<N.length;Y++)this.words[Y]=N.words[Y];return this.length=N.length,this._strip()},c.prototype.ixor=function(T){return E((this.negative|T.negative)===0),this.iuxor(T)},c.prototype.xor=function(T){return this.length>T.length?this.clone().ixor(T):T.clone().ixor(this)},c.prototype.uxor=function(T){return this.length>T.length?this.clone().iuxor(T):T.clone().iuxor(this)},c.prototype.inotn=function(T){E(typeof T=="number"&&T>=0);var N=Math.ceil(T/26)|0,j=T%26;this._expand(N),j>0&&N--;for(var Y=0;Y<N;Y++)this.words[Y]=~this.words[Y]&67108863;return j>0&&(this.words[Y]=~this.words[Y]&67108863>>26-j),this._strip()},c.prototype.notn=function(T){return this.clone().inotn(T)},c.prototype.setn=function(T,N){E(typeof T=="number"&&T>=0);var j=T/26|0,Y=T%26;return this._expand(j+1),N?this.words[j]=this.words[j]|1<<Y:this.words[j]=this.words[j]&~(1<<Y),this._strip()},c.prototype.iadd=function(T){var N;if(this.negative!==0&&T.negative===0)return this.negative=0,N=this.isub(T),this.negative^=1,this._normSign();if(this.negative===0&&T.negative!==0)return T.negative=0,N=this.isub(T),T.negative=1,N._normSign();var j,Y;this.length>T.length?(j=this,Y=T):(j=T,Y=this);for(var Z=0,z=0;z<Y.length;z++)N=(j.words[z]|0)+(Y.words[z]|0)+Z,this.words[z]=N&67108863,Z=N>>>26;for(;Z!==0&&z<j.length;z++)N=(j.words[z]|0)+Z,this.words[z]=N&67108863,Z=N>>>26;if(this.length=j.length,Z!==0)this.words[this.length]=Z,this.length++;else if(j!==this)for(;z<j.length;z++)this.words[z]=j.words[z];return this},c.prototype.add=function(T){var N;return T.negative!==0&&this.negative===0?(T.negative=0,N=this.sub(T),T.negative^=1,N):T.negative===0&&this.negative!==0?(this.negative=0,N=T.sub(this),this.negative=1,N):this.length>T.length?this.clone().iadd(T):T.clone().iadd(this)},c.prototype.isub=function(T){if(T.negative!==0){T.negative=0;var N=this.iadd(T);return T.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(T),this.negative=1,this._normSign();var j=this.cmp(T);if(j===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Y,Z;j>0?(Y=this,Z=T):(Y=T,Z=this);for(var z=0,fe=0;fe<Z.length;fe++)N=(Y.words[fe]|0)-(Z.words[fe]|0)+z,z=N>>26,this.words[fe]=N&67108863;for(;z!==0&&fe<Y.length;fe++)N=(Y.words[fe]|0)+z,z=N>>26,this.words[fe]=N&67108863;if(z===0&&fe<Y.length&&Y!==this)for(;fe<Y.length;fe++)this.words[fe]=Y.words[fe];return this.length=Math.max(this.length,fe),Y!==this&&(this.negative=1),this._strip()},c.prototype.sub=function(T){return this.clone().isub(T)};function b($,T,N){N.negative=T.negative^$.negative;var j=$.length+T.length|0;N.length=j,j=j-1|0;var Y=$.words[0]|0,Z=T.words[0]|0,z=Y*Z,fe=z&67108863,te=z/67108864|0;N.words[0]=fe;for(var H=1;H<j;H++){for(var Q=te>>>26,oe=te&67108863,_e=Math.min(H,T.length-1),ge=Math.max(0,H-$.length+1);ge<=_e;ge++){var be=H-ge|0;Y=$.words[be]|0,Z=T.words[ge]|0,z=Y*Z+oe,Q+=z/67108864|0,oe=z&67108863}N.words[H]=oe|0,te=Q|0}return te!==0?N.words[H]=te|0:N.length--,N._strip()}var F=function(T,N,j){var Y=T.words,Z=N.words,z=j.words,fe=0,te,H,Q,oe=Y[0]|0,_e=oe&8191,ge=oe>>>13,be=Y[1]|0,we=be&8191,Ee=be>>>13,me=Y[2]|0,Ke=me&8191,He=me>>>13,Ie=Y[3]|0,Le=Ie&8191,Ge=Ie>>>13,Be=Y[4]|0,We=Be&8191,Ze=Be>>>13,_t=Y[5]|0,Ft=_t&8191,gt=_t>>>13,lt=Y[6]|0,dt=lt&8191,tt=lt>>>13,rt=Y[7]|0,ke=rt&8191,xe=rt>>>13,Pe=Y[8]|0,it=Pe&8191,Xe=Pe>>>13,st=Y[9]|0,It=st&8191,ft=st>>>13,Jt=Z[0]|0,Ot=Jt&8191,Ct=Jt>>>13,qe=Z[1]|0,Yt=qe&8191,ot=qe>>>13,Ae=Z[2]|0,Rt=Ae&8191,Ht=Ae>>>13,bt=Z[3]|0,Mt=bt&8191,tr=bt>>>13,Vt=Z[4]|0,Et=Vt&8191,Ye=Vt>>>13,Tt=Z[5]|0,Wt=Tt&8191,dr=Tt>>>13,at=Z[6]|0,wt=at&8191,At=at>>>13,Je=Z[7]|0,Lt=Je&8191,sr=Je>>>13,ur=Z[8]|0,vr=ur&8191,kr=ur>>>13,Jr=Z[9]|0,hr=Jr&8191,$r=Jr>>>13;j.negative=T.negative^N.negative,j.length=19,te=Math.imul(_e,Ot),H=Math.imul(_e,Ct),H=H+Math.imul(ge,Ot)|0,Q=Math.imul(ge,Ct);var Hr=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,te=Math.imul(we,Ot),H=Math.imul(we,Ct),H=H+Math.imul(Ee,Ot)|0,Q=Math.imul(Ee,Ct),te=te+Math.imul(_e,Yt)|0,H=H+Math.imul(_e,ot)|0,H=H+Math.imul(ge,Yt)|0,Q=Q+Math.imul(ge,ot)|0;var rn=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(rn>>>26)|0,rn&=67108863,te=Math.imul(Ke,Ot),H=Math.imul(Ke,Ct),H=H+Math.imul(He,Ot)|0,Q=Math.imul(He,Ct),te=te+Math.imul(we,Yt)|0,H=H+Math.imul(we,ot)|0,H=H+Math.imul(Ee,Yt)|0,Q=Q+Math.imul(Ee,ot)|0,te=te+Math.imul(_e,Rt)|0,H=H+Math.imul(_e,Ht)|0,H=H+Math.imul(ge,Rt)|0,Q=Q+Math.imul(ge,Ht)|0;var _r=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(_r>>>26)|0,_r&=67108863,te=Math.imul(Le,Ot),H=Math.imul(Le,Ct),H=H+Math.imul(Ge,Ot)|0,Q=Math.imul(Ge,Ct),te=te+Math.imul(Ke,Yt)|0,H=H+Math.imul(Ke,ot)|0,H=H+Math.imul(He,Yt)|0,Q=Q+Math.imul(He,ot)|0,te=te+Math.imul(we,Rt)|0,H=H+Math.imul(we,Ht)|0,H=H+Math.imul(Ee,Rt)|0,Q=Q+Math.imul(Ee,Ht)|0,te=te+Math.imul(_e,Mt)|0,H=H+Math.imul(_e,tr)|0,H=H+Math.imul(ge,Mt)|0,Q=Q+Math.imul(ge,tr)|0;var pn=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(pn>>>26)|0,pn&=67108863,te=Math.imul(We,Ot),H=Math.imul(We,Ct),H=H+Math.imul(Ze,Ot)|0,Q=Math.imul(Ze,Ct),te=te+Math.imul(Le,Yt)|0,H=H+Math.imul(Le,ot)|0,H=H+Math.imul(Ge,Yt)|0,Q=Q+Math.imul(Ge,ot)|0,te=te+Math.imul(Ke,Rt)|0,H=H+Math.imul(Ke,Ht)|0,H=H+Math.imul(He,Rt)|0,Q=Q+Math.imul(He,Ht)|0,te=te+Math.imul(we,Mt)|0,H=H+Math.imul(we,tr)|0,H=H+Math.imul(Ee,Mt)|0,Q=Q+Math.imul(Ee,tr)|0,te=te+Math.imul(_e,Et)|0,H=H+Math.imul(_e,Ye)|0,H=H+Math.imul(ge,Et)|0,Q=Q+Math.imul(ge,Ye)|0;var $t=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+($t>>>26)|0,$t&=67108863,te=Math.imul(Ft,Ot),H=Math.imul(Ft,Ct),H=H+Math.imul(gt,Ot)|0,Q=Math.imul(gt,Ct),te=te+Math.imul(We,Yt)|0,H=H+Math.imul(We,ot)|0,H=H+Math.imul(Ze,Yt)|0,Q=Q+Math.imul(Ze,ot)|0,te=te+Math.imul(Le,Rt)|0,H=H+Math.imul(Le,Ht)|0,H=H+Math.imul(Ge,Rt)|0,Q=Q+Math.imul(Ge,Ht)|0,te=te+Math.imul(Ke,Mt)|0,H=H+Math.imul(Ke,tr)|0,H=H+Math.imul(He,Mt)|0,Q=Q+Math.imul(He,tr)|0,te=te+Math.imul(we,Et)|0,H=H+Math.imul(we,Ye)|0,H=H+Math.imul(Ee,Et)|0,Q=Q+Math.imul(Ee,Ye)|0,te=te+Math.imul(_e,Wt)|0,H=H+Math.imul(_e,dr)|0,H=H+Math.imul(ge,Wt)|0,Q=Q+Math.imul(ge,dr)|0;var In=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(In>>>26)|0,In&=67108863,te=Math.imul(dt,Ot),H=Math.imul(dt,Ct),H=H+Math.imul(tt,Ot)|0,Q=Math.imul(tt,Ct),te=te+Math.imul(Ft,Yt)|0,H=H+Math.imul(Ft,ot)|0,H=H+Math.imul(gt,Yt)|0,Q=Q+Math.imul(gt,ot)|0,te=te+Math.imul(We,Rt)|0,H=H+Math.imul(We,Ht)|0,H=H+Math.imul(Ze,Rt)|0,Q=Q+Math.imul(Ze,Ht)|0,te=te+Math.imul(Le,Mt)|0,H=H+Math.imul(Le,tr)|0,H=H+Math.imul(Ge,Mt)|0,Q=Q+Math.imul(Ge,tr)|0,te=te+Math.imul(Ke,Et)|0,H=H+Math.imul(Ke,Ye)|0,H=H+Math.imul(He,Et)|0,Q=Q+Math.imul(He,Ye)|0,te=te+Math.imul(we,Wt)|0,H=H+Math.imul(we,dr)|0,H=H+Math.imul(Ee,Wt)|0,Q=Q+Math.imul(Ee,dr)|0,te=te+Math.imul(_e,wt)|0,H=H+Math.imul(_e,At)|0,H=H+Math.imul(ge,wt)|0,Q=Q+Math.imul(ge,At)|0;var ln=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(ln>>>26)|0,ln&=67108863,te=Math.imul(ke,Ot),H=Math.imul(ke,Ct),H=H+Math.imul(xe,Ot)|0,Q=Math.imul(xe,Ct),te=te+Math.imul(dt,Yt)|0,H=H+Math.imul(dt,ot)|0,H=H+Math.imul(tt,Yt)|0,Q=Q+Math.imul(tt,ot)|0,te=te+Math.imul(Ft,Rt)|0,H=H+Math.imul(Ft,Ht)|0,H=H+Math.imul(gt,Rt)|0,Q=Q+Math.imul(gt,Ht)|0,te=te+Math.imul(We,Mt)|0,H=H+Math.imul(We,tr)|0,H=H+Math.imul(Ze,Mt)|0,Q=Q+Math.imul(Ze,tr)|0,te=te+Math.imul(Le,Et)|0,H=H+Math.imul(Le,Ye)|0,H=H+Math.imul(Ge,Et)|0,Q=Q+Math.imul(Ge,Ye)|0,te=te+Math.imul(Ke,Wt)|0,H=H+Math.imul(Ke,dr)|0,H=H+Math.imul(He,Wt)|0,Q=Q+Math.imul(He,dr)|0,te=te+Math.imul(we,wt)|0,H=H+Math.imul(we,At)|0,H=H+Math.imul(Ee,wt)|0,Q=Q+Math.imul(Ee,At)|0,te=te+Math.imul(_e,Lt)|0,H=H+Math.imul(_e,sr)|0,H=H+Math.imul(ge,Lt)|0,Q=Q+Math.imul(ge,sr)|0;var yn=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(yn>>>26)|0,yn&=67108863,te=Math.imul(it,Ot),H=Math.imul(it,Ct),H=H+Math.imul(Xe,Ot)|0,Q=Math.imul(Xe,Ct),te=te+Math.imul(ke,Yt)|0,H=H+Math.imul(ke,ot)|0,H=H+Math.imul(xe,Yt)|0,Q=Q+Math.imul(xe,ot)|0,te=te+Math.imul(dt,Rt)|0,H=H+Math.imul(dt,Ht)|0,H=H+Math.imul(tt,Rt)|0,Q=Q+Math.imul(tt,Ht)|0,te=te+Math.imul(Ft,Mt)|0,H=H+Math.imul(Ft,tr)|0,H=H+Math.imul(gt,Mt)|0,Q=Q+Math.imul(gt,tr)|0,te=te+Math.imul(We,Et)|0,H=H+Math.imul(We,Ye)|0,H=H+Math.imul(Ze,Et)|0,Q=Q+Math.imul(Ze,Ye)|0,te=te+Math.imul(Le,Wt)|0,H=H+Math.imul(Le,dr)|0,H=H+Math.imul(Ge,Wt)|0,Q=Q+Math.imul(Ge,dr)|0,te=te+Math.imul(Ke,wt)|0,H=H+Math.imul(Ke,At)|0,H=H+Math.imul(He,wt)|0,Q=Q+Math.imul(He,At)|0,te=te+Math.imul(we,Lt)|0,H=H+Math.imul(we,sr)|0,H=H+Math.imul(Ee,Lt)|0,Q=Q+Math.imul(Ee,sr)|0,te=te+Math.imul(_e,vr)|0,H=H+Math.imul(_e,kr)|0,H=H+Math.imul(ge,vr)|0,Q=Q+Math.imul(ge,kr)|0;var Fr=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,te=Math.imul(It,Ot),H=Math.imul(It,Ct),H=H+Math.imul(ft,Ot)|0,Q=Math.imul(ft,Ct),te=te+Math.imul(it,Yt)|0,H=H+Math.imul(it,ot)|0,H=H+Math.imul(Xe,Yt)|0,Q=Q+Math.imul(Xe,ot)|0,te=te+Math.imul(ke,Rt)|0,H=H+Math.imul(ke,Ht)|0,H=H+Math.imul(xe,Rt)|0,Q=Q+Math.imul(xe,Ht)|0,te=te+Math.imul(dt,Mt)|0,H=H+Math.imul(dt,tr)|0,H=H+Math.imul(tt,Mt)|0,Q=Q+Math.imul(tt,tr)|0,te=te+Math.imul(Ft,Et)|0,H=H+Math.imul(Ft,Ye)|0,H=H+Math.imul(gt,Et)|0,Q=Q+Math.imul(gt,Ye)|0,te=te+Math.imul(We,Wt)|0,H=H+Math.imul(We,dr)|0,H=H+Math.imul(Ze,Wt)|0,Q=Q+Math.imul(Ze,dr)|0,te=te+Math.imul(Le,wt)|0,H=H+Math.imul(Le,At)|0,H=H+Math.imul(Ge,wt)|0,Q=Q+Math.imul(Ge,At)|0,te=te+Math.imul(Ke,Lt)|0,H=H+Math.imul(Ke,sr)|0,H=H+Math.imul(He,Lt)|0,Q=Q+Math.imul(He,sr)|0,te=te+Math.imul(we,vr)|0,H=H+Math.imul(we,kr)|0,H=H+Math.imul(Ee,vr)|0,Q=Q+Math.imul(Ee,kr)|0,te=te+Math.imul(_e,hr)|0,H=H+Math.imul(_e,$r)|0,H=H+Math.imul(ge,hr)|0,Q=Q+Math.imul(ge,$r)|0;var On=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(On>>>26)|0,On&=67108863,te=Math.imul(It,Yt),H=Math.imul(It,ot),H=H+Math.imul(ft,Yt)|0,Q=Math.imul(ft,ot),te=te+Math.imul(it,Rt)|0,H=H+Math.imul(it,Ht)|0,H=H+Math.imul(Xe,Rt)|0,Q=Q+Math.imul(Xe,Ht)|0,te=te+Math.imul(ke,Mt)|0,H=H+Math.imul(ke,tr)|0,H=H+Math.imul(xe,Mt)|0,Q=Q+Math.imul(xe,tr)|0,te=te+Math.imul(dt,Et)|0,H=H+Math.imul(dt,Ye)|0,H=H+Math.imul(tt,Et)|0,Q=Q+Math.imul(tt,Ye)|0,te=te+Math.imul(Ft,Wt)|0,H=H+Math.imul(Ft,dr)|0,H=H+Math.imul(gt,Wt)|0,Q=Q+Math.imul(gt,dr)|0,te=te+Math.imul(We,wt)|0,H=H+Math.imul(We,At)|0,H=H+Math.imul(Ze,wt)|0,Q=Q+Math.imul(Ze,At)|0,te=te+Math.imul(Le,Lt)|0,H=H+Math.imul(Le,sr)|0,H=H+Math.imul(Ge,Lt)|0,Q=Q+Math.imul(Ge,sr)|0,te=te+Math.imul(Ke,vr)|0,H=H+Math.imul(Ke,kr)|0,H=H+Math.imul(He,vr)|0,Q=Q+Math.imul(He,kr)|0,te=te+Math.imul(we,hr)|0,H=H+Math.imul(we,$r)|0,H=H+Math.imul(Ee,hr)|0,Q=Q+Math.imul(Ee,$r)|0;var En=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(En>>>26)|0,En&=67108863,te=Math.imul(It,Rt),H=Math.imul(It,Ht),H=H+Math.imul(ft,Rt)|0,Q=Math.imul(ft,Ht),te=te+Math.imul(it,Mt)|0,H=H+Math.imul(it,tr)|0,H=H+Math.imul(Xe,Mt)|0,Q=Q+Math.imul(Xe,tr)|0,te=te+Math.imul(ke,Et)|0,H=H+Math.imul(ke,Ye)|0,H=H+Math.imul(xe,Et)|0,Q=Q+Math.imul(xe,Ye)|0,te=te+Math.imul(dt,Wt)|0,H=H+Math.imul(dt,dr)|0,H=H+Math.imul(tt,Wt)|0,Q=Q+Math.imul(tt,dr)|0,te=te+Math.imul(Ft,wt)|0,H=H+Math.imul(Ft,At)|0,H=H+Math.imul(gt,wt)|0,Q=Q+Math.imul(gt,At)|0,te=te+Math.imul(We,Lt)|0,H=H+Math.imul(We,sr)|0,H=H+Math.imul(Ze,Lt)|0,Q=Q+Math.imul(Ze,sr)|0,te=te+Math.imul(Le,vr)|0,H=H+Math.imul(Le,kr)|0,H=H+Math.imul(Ge,vr)|0,Q=Q+Math.imul(Ge,kr)|0,te=te+Math.imul(Ke,hr)|0,H=H+Math.imul(Ke,$r)|0,H=H+Math.imul(He,hr)|0,Q=Q+Math.imul(He,$r)|0;var ee=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(ee>>>26)|0,ee&=67108863,te=Math.imul(It,Mt),H=Math.imul(It,tr),H=H+Math.imul(ft,Mt)|0,Q=Math.imul(ft,tr),te=te+Math.imul(it,Et)|0,H=H+Math.imul(it,Ye)|0,H=H+Math.imul(Xe,Et)|0,Q=Q+Math.imul(Xe,Ye)|0,te=te+Math.imul(ke,Wt)|0,H=H+Math.imul(ke,dr)|0,H=H+Math.imul(xe,Wt)|0,Q=Q+Math.imul(xe,dr)|0,te=te+Math.imul(dt,wt)|0,H=H+Math.imul(dt,At)|0,H=H+Math.imul(tt,wt)|0,Q=Q+Math.imul(tt,At)|0,te=te+Math.imul(Ft,Lt)|0,H=H+Math.imul(Ft,sr)|0,H=H+Math.imul(gt,Lt)|0,Q=Q+Math.imul(gt,sr)|0,te=te+Math.imul(We,vr)|0,H=H+Math.imul(We,kr)|0,H=H+Math.imul(Ze,vr)|0,Q=Q+Math.imul(Ze,kr)|0,te=te+Math.imul(Le,hr)|0,H=H+Math.imul(Le,$r)|0,H=H+Math.imul(Ge,hr)|0,Q=Q+Math.imul(Ge,$r)|0;var ve=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(ve>>>26)|0,ve&=67108863,te=Math.imul(It,Et),H=Math.imul(It,Ye),H=H+Math.imul(ft,Et)|0,Q=Math.imul(ft,Ye),te=te+Math.imul(it,Wt)|0,H=H+Math.imul(it,dr)|0,H=H+Math.imul(Xe,Wt)|0,Q=Q+Math.imul(Xe,dr)|0,te=te+Math.imul(ke,wt)|0,H=H+Math.imul(ke,At)|0,H=H+Math.imul(xe,wt)|0,Q=Q+Math.imul(xe,At)|0,te=te+Math.imul(dt,Lt)|0,H=H+Math.imul(dt,sr)|0,H=H+Math.imul(tt,Lt)|0,Q=Q+Math.imul(tt,sr)|0,te=te+Math.imul(Ft,vr)|0,H=H+Math.imul(Ft,kr)|0,H=H+Math.imul(gt,vr)|0,Q=Q+Math.imul(gt,kr)|0,te=te+Math.imul(We,hr)|0,H=H+Math.imul(We,$r)|0,H=H+Math.imul(Ze,hr)|0,Q=Q+Math.imul(Ze,$r)|0;var ze=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(ze>>>26)|0,ze&=67108863,te=Math.imul(It,Wt),H=Math.imul(It,dr),H=H+Math.imul(ft,Wt)|0,Q=Math.imul(ft,dr),te=te+Math.imul(it,wt)|0,H=H+Math.imul(it,At)|0,H=H+Math.imul(Xe,wt)|0,Q=Q+Math.imul(Xe,At)|0,te=te+Math.imul(ke,Lt)|0,H=H+Math.imul(ke,sr)|0,H=H+Math.imul(xe,Lt)|0,Q=Q+Math.imul(xe,sr)|0,te=te+Math.imul(dt,vr)|0,H=H+Math.imul(dt,kr)|0,H=H+Math.imul(tt,vr)|0,Q=Q+Math.imul(tt,kr)|0,te=te+Math.imul(Ft,hr)|0,H=H+Math.imul(Ft,$r)|0,H=H+Math.imul(gt,hr)|0,Q=Q+Math.imul(gt,$r)|0;var yt=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(yt>>>26)|0,yt&=67108863,te=Math.imul(It,wt),H=Math.imul(It,At),H=H+Math.imul(ft,wt)|0,Q=Math.imul(ft,At),te=te+Math.imul(it,Lt)|0,H=H+Math.imul(it,sr)|0,H=H+Math.imul(Xe,Lt)|0,Q=Q+Math.imul(Xe,sr)|0,te=te+Math.imul(ke,vr)|0,H=H+Math.imul(ke,kr)|0,H=H+Math.imul(xe,vr)|0,Q=Q+Math.imul(xe,kr)|0,te=te+Math.imul(dt,hr)|0,H=H+Math.imul(dt,$r)|0,H=H+Math.imul(tt,hr)|0,Q=Q+Math.imul(tt,$r)|0;var vt=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(vt>>>26)|0,vt&=67108863,te=Math.imul(It,Lt),H=Math.imul(It,sr),H=H+Math.imul(ft,Lt)|0,Q=Math.imul(ft,sr),te=te+Math.imul(it,vr)|0,H=H+Math.imul(it,kr)|0,H=H+Math.imul(Xe,vr)|0,Q=Q+Math.imul(Xe,kr)|0,te=te+Math.imul(ke,hr)|0,H=H+Math.imul(ke,$r)|0,H=H+Math.imul(xe,hr)|0,Q=Q+Math.imul(xe,$r)|0;var ar=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(ar>>>26)|0,ar&=67108863,te=Math.imul(It,vr),H=Math.imul(It,kr),H=H+Math.imul(ft,vr)|0,Q=Math.imul(ft,kr),te=te+Math.imul(it,hr)|0,H=H+Math.imul(it,$r)|0,H=H+Math.imul(Xe,hr)|0,Q=Q+Math.imul(Xe,$r)|0;var wr=(fe+te|0)+((H&8191)<<13)|0;fe=(Q+(H>>>13)|0)+(wr>>>26)|0,wr&=67108863,te=Math.imul(It,hr),H=Math.imul(It,$r),H=H+Math.imul(ft,hr)|0,Q=Math.imul(ft,$r);var zt=(fe+te|0)+((H&8191)<<13)|0;return fe=(Q+(H>>>13)|0)+(zt>>>26)|0,zt&=67108863,z[0]=Hr,z[1]=rn,z[2]=_r,z[3]=pn,z[4]=$t,z[5]=In,z[6]=ln,z[7]=yn,z[8]=Fr,z[9]=On,z[10]=En,z[11]=ee,z[12]=ve,z[13]=ze,z[14]=yt,z[15]=vt,z[16]=ar,z[17]=wr,z[18]=zt,fe!==0&&(z[19]=fe,j.length++),j};Math.imul||(F=b);function G($,T,N){N.negative=T.negative^$.negative,N.length=$.length+T.length;for(var j=0,Y=0,Z=0;Z<N.length-1;Z++){var z=Y;Y=0;for(var fe=j&67108863,te=Math.min(Z,T.length-1),H=Math.max(0,Z-$.length+1);H<=te;H++){var Q=Z-H,oe=$.words[Q]|0,_e=T.words[H]|0,ge=oe*_e,be=ge&67108863;z=z+(ge/67108864|0)|0,be=be+fe|0,fe=be&67108863,z=z+(be>>>26)|0,Y+=z>>>26,z&=67108863}N.words[Z]=fe,j=z,z=Y}return j!==0?N.words[Z]=j:N.length--,N._strip()}function ue($,T,N){return G($,T,N)}c.prototype.mulTo=function(T,N){var j,Y=this.length+T.length;return this.length===10&&T.length===10?j=F(this,T,N):Y<63?j=b(this,T,N):Y<1024?j=G(this,T,N):j=ue(this,T,N),j};function le($,T){this.x=$,this.y=T}le.prototype.makeRBT=function(T){for(var N=new Array(T),j=c.prototype._countBits(T)-1,Y=0;Y<T;Y++)N[Y]=this.revBin(Y,j,T);return N},le.prototype.revBin=function(T,N,j){if(T===0||T===j-1)return T;for(var Y=0,Z=0;Z<N;Z++)Y|=(T&1)<<N-Z-1,T>>=1;return Y},le.prototype.permute=function(T,N,j,Y,Z,z){for(var fe=0;fe<z;fe++)Y[fe]=N[T[fe]],Z[fe]=j[T[fe]]},le.prototype.transform=function(T,N,j,Y,Z,z){this.permute(z,T,N,j,Y,Z);for(var fe=1;fe<Z;fe<<=1)for(var te=fe<<1,H=Math.cos(2*Math.PI/te),Q=Math.sin(2*Math.PI/te),oe=0;oe<Z;oe+=te)for(var _e=H,ge=Q,be=0;be<fe;be++){var we=j[oe+be],Ee=Y[oe+be],me=j[oe+be+fe],Ke=Y[oe+be+fe],He=_e*me-ge*Ke;Ke=_e*Ke+ge*me,me=He,j[oe+be]=we+me,Y[oe+be]=Ee+Ke,j[oe+be+fe]=we-me,Y[oe+be+fe]=Ee-Ke,be!==te&&(He=H*_e-Q*ge,ge=H*ge+Q*_e,_e=He)}},le.prototype.guessLen13b=function(T,N){var j=Math.max(N,T)|1,Y=j&1,Z=0;for(j=j/2|0;j;j=j>>>1)Z++;return 1<<Z+1+Y},le.prototype.conjugate=function(T,N,j){if(!(j<=1))for(var Y=0;Y<j/2;Y++){var Z=T[Y];T[Y]=T[j-Y-1],T[j-Y-1]=Z,Z=N[Y],N[Y]=-N[j-Y-1],N[j-Y-1]=-Z}},le.prototype.normalize13b=function(T,N){for(var j=0,Y=0;Y<N/2;Y++){var Z=Math.round(T[2*Y+1]/N)*8192+Math.round(T[2*Y]/N)+j;T[Y]=Z&67108863,Z<67108864?j=0:j=Z/67108864|0}return T},le.prototype.convert13b=function(T,N,j,Y){for(var Z=0,z=0;z<N;z++)Z=Z+(T[z]|0),j[2*z]=Z&8191,Z=Z>>>13,j[2*z+1]=Z&8191,Z=Z>>>13;for(z=2*N;z<Y;++z)j[z]=0;E(Z===0),E((Z&-8192)===0)},le.prototype.stub=function(T){for(var N=new Array(T),j=0;j<T;j++)N[j]=0;return N},le.prototype.mulp=function(T,N,j){var Y=2*this.guessLen13b(T.length,N.length),Z=this.makeRBT(Y),z=this.stub(Y),fe=new Array(Y),te=new Array(Y),H=new Array(Y),Q=new Array(Y),oe=new Array(Y),_e=new Array(Y),ge=j.words;ge.length=Y,this.convert13b(T.words,T.length,fe,Y),this.convert13b(N.words,N.length,Q,Y),this.transform(fe,z,te,H,Y,Z),this.transform(Q,z,oe,_e,Y,Z);for(var be=0;be<Y;be++){var we=te[be]*oe[be]-H[be]*_e[be];H[be]=te[be]*_e[be]+H[be]*oe[be],te[be]=we}return this.conjugate(te,H,Y),this.transform(te,H,ge,z,Y,Z),this.conjugate(ge,z,Y),this.normalize13b(ge,Y),j.negative=T.negative^N.negative,j.length=T.length+N.length,j._strip()},c.prototype.mul=function(T){var N=new c(null);return N.words=new Array(this.length+T.length),this.mulTo(T,N)},c.prototype.mulf=function(T){var N=new c(null);return N.words=new Array(this.length+T.length),ue(this,T,N)},c.prototype.imul=function(T){return this.clone().mulTo(T,this)},c.prototype.imuln=function(T){var N=T<0;N&&(T=-T),E(typeof T=="number"),E(T<67108864);for(var j=0,Y=0;Y<this.length;Y++){var Z=(this.words[Y]|0)*T,z=(Z&67108863)+(j&67108863);j>>=26,j+=Z/67108864|0,j+=z>>>26,this.words[Y]=z&67108863}return j!==0&&(this.words[Y]=j,this.length++),N?this.ineg():this},c.prototype.muln=function(T){return this.clone().imuln(T)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(T){var N=q(T);if(N.length===0)return new c(1);for(var j=this,Y=0;Y<N.length&&N[Y]===0;Y++,j=j.sqr());if(++Y<N.length)for(var Z=j.sqr();Y<N.length;Y++,Z=Z.sqr())N[Y]!==0&&(j=j.mul(Z));return j},c.prototype.iushln=function(T){E(typeof T=="number"&&T>=0);var N=T%26,j=(T-N)/26,Y=67108863>>>26-N<<26-N,Z;if(N!==0){var z=0;for(Z=0;Z<this.length;Z++){var fe=this.words[Z]&Y,te=(this.words[Z]|0)-fe<<N;this.words[Z]=te|z,z=fe>>>26-N}z&&(this.words[Z]=z,this.length++)}if(j!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+j]=this.words[Z];for(Z=0;Z<j;Z++)this.words[Z]=0;this.length+=j}return this._strip()},c.prototype.ishln=function(T){return E(this.negative===0),this.iushln(T)},c.prototype.iushrn=function(T,N,j){E(typeof T=="number"&&T>=0);var Y;N?Y=(N-N%26)/26:Y=0;var Z=T%26,z=Math.min((T-Z)/26,this.length),fe=67108863^67108863>>>Z<<Z,te=j;if(Y-=z,Y=Math.max(0,Y),te){for(var H=0;H<z;H++)te.words[H]=this.words[H];te.length=z}if(z!==0)if(this.length>z)for(this.length-=z,H=0;H<this.length;H++)this.words[H]=this.words[H+z];else this.words[0]=0,this.length=1;var Q=0;for(H=this.length-1;H>=0&&(Q!==0||H>=Y);H--){var oe=this.words[H]|0;this.words[H]=Q<<26-Z|oe>>>Z,Q=oe&fe}return te&&Q!==0&&(te.words[te.length++]=Q),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},c.prototype.ishrn=function(T,N,j){return E(this.negative===0),this.iushrn(T,N,j)},c.prototype.shln=function(T){return this.clone().ishln(T)},c.prototype.ushln=function(T){return this.clone().iushln(T)},c.prototype.shrn=function(T){return this.clone().ishrn(T)},c.prototype.ushrn=function(T){return this.clone().iushrn(T)},c.prototype.testn=function(T){E(typeof T=="number"&&T>=0);var N=T%26,j=(T-N)/26,Y=1<<N;if(this.length<=j)return!1;var Z=this.words[j];return!!(Z&Y)},c.prototype.imaskn=function(T){E(typeof T=="number"&&T>=0);var N=T%26,j=(T-N)/26;if(E(this.negative===0,"imaskn works only with positive numbers"),this.length<=j)return this;if(N!==0&&j++,this.length=Math.min(j,this.length),N!==0){var Y=67108863^67108863>>>N<<N;this.words[this.length-1]&=Y}return this._strip()},c.prototype.maskn=function(T){return this.clone().imaskn(T)},c.prototype.iaddn=function(T){return E(typeof T=="number"),E(T<67108864),T<0?this.isubn(-T):this.negative!==0?this.length===1&&(this.words[0]|0)<=T?(this.words[0]=T-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(T),this.negative=1,this):this._iaddn(T)},c.prototype._iaddn=function(T){this.words[0]+=T;for(var N=0;N<this.length&&this.words[N]>=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},c.prototype.isubn=function(T){if(E(typeof T=="number"),E(T<67108864),T<0)return this.iaddn(-T);if(this.negative!==0)return this.negative=0,this.iaddn(T),this.negative=1,this;if(this.words[0]-=T,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var N=0;N<this.length&&this.words[N]<0;N++)this.words[N]+=67108864,this.words[N+1]-=1;return this._strip()},c.prototype.addn=function(T){return this.clone().iaddn(T)},c.prototype.subn=function(T){return this.clone().isubn(T)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(T,N,j){var Y=T.length+j,Z;this._expand(Y);var z,fe=0;for(Z=0;Z<T.length;Z++){z=(this.words[Z+j]|0)+fe;var te=(T.words[Z]|0)*N;z-=te&67108863,fe=(z>>26)-(te/67108864|0),this.words[Z+j]=z&67108863}for(;Z<this.length-j;Z++)z=(this.words[Z+j]|0)+fe,fe=z>>26,this.words[Z+j]=z&67108863;if(fe===0)return this._strip();for(E(fe===-1),fe=0,Z=0;Z<this.length;Z++)z=-(this.words[Z]|0)+fe,fe=z>>26,this.words[Z]=z&67108863;return this.negative=1,this._strip()},c.prototype._wordDiv=function(T,N){var j=this.length-T.length,Y=this.clone(),Z=T,z=Z.words[Z.length-1]|0,fe=this._countBits(z);j=26-fe,j!==0&&(Z=Z.ushln(j),Y.iushln(j),z=Z.words[Z.length-1]|0);var te=Y.length-Z.length,H;if(N!=="mod"){H=new c(null),H.length=te+1,H.words=new Array(H.length);for(var Q=0;Q<H.length;Q++)H.words[Q]=0}var oe=Y.clone()._ishlnsubmul(Z,1,te);oe.negative===0&&(Y=oe,H&&(H.words[te]=1));for(var _e=te-1;_e>=0;_e--){var ge=(Y.words[Z.length+_e]|0)*67108864+(Y.words[Z.length+_e-1]|0);for(ge=Math.min(ge/z|0,67108863),Y._ishlnsubmul(Z,ge,_e);Y.negative!==0;)ge--,Y.negative=0,Y._ishlnsubmul(Z,1,_e),Y.isZero()||(Y.negative^=1);H&&(H.words[_e]=ge)}return H&&H._strip(),Y._strip(),N!=="div"&&j!==0&&Y.iushrn(j),{div:H||null,mod:Y}},c.prototype.divmod=function(T,N,j){if(E(!T.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var Y,Z,z;return this.negative!==0&&T.negative===0?(z=this.neg().divmod(T,N),N!=="mod"&&(Y=z.div.neg()),N!=="div"&&(Z=z.mod.neg(),j&&Z.negative!==0&&Z.iadd(T)),{div:Y,mod:Z}):this.negative===0&&T.negative!==0?(z=this.divmod(T.neg(),N),N!=="mod"&&(Y=z.div.neg()),{div:Y,mod:z.mod}):this.negative&T.negative?(z=this.neg().divmod(T.neg(),N),N!=="div"&&(Z=z.mod.neg(),j&&Z.negative!==0&&Z.isub(T)),{div:z.div,mod:Z}):T.length>this.length||this.cmp(T)<0?{div:new c(0),mod:this}:T.length===1?N==="div"?{div:this.divn(T.words[0]),mod:null}:N==="mod"?{div:null,mod:new c(this.modrn(T.words[0]))}:{div:this.divn(T.words[0]),mod:new c(this.modrn(T.words[0]))}:this._wordDiv(T,N)},c.prototype.div=function(T){return this.divmod(T,"div",!1).div},c.prototype.mod=function(T){return this.divmod(T,"mod",!1).mod},c.prototype.umod=function(T){return this.divmod(T,"mod",!0).mod},c.prototype.divRound=function(T){var N=this.divmod(T);if(N.mod.isZero())return N.div;var j=N.div.negative!==0?N.mod.isub(T):N.mod,Y=T.ushrn(1),Z=T.andln(1),z=j.cmp(Y);return z<0||Z===1&&z===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},c.prototype.modrn=function(T){var N=T<0;N&&(T=-T),E(T<=67108863);for(var j=(1<<26)%T,Y=0,Z=this.length-1;Z>=0;Z--)Y=(j*Y+(this.words[Z]|0))%T;return N?-Y:Y},c.prototype.modn=function(T){return this.modrn(T)},c.prototype.idivn=function(T){var N=T<0;N&&(T=-T),E(T<=67108863);for(var j=0,Y=this.length-1;Y>=0;Y--){var Z=(this.words[Y]|0)+j*67108864;this.words[Y]=Z/T|0,j=Z%T}return this._strip(),N?this.ineg():this},c.prototype.divn=function(T){return this.clone().idivn(T)},c.prototype.egcd=function(T){E(T.negative===0),E(!T.isZero());var N=this,j=T.clone();N.negative!==0?N=N.umod(T):N=N.clone();for(var Y=new c(1),Z=new c(0),z=new c(0),fe=new c(1),te=0;N.isEven()&&j.isEven();)N.iushrn(1),j.iushrn(1),++te;for(var H=j.clone(),Q=N.clone();!N.isZero();){for(var oe=0,_e=1;!(N.words[0]&_e)&&oe<26;++oe,_e<<=1);if(oe>0)for(N.iushrn(oe);oe-- >0;)(Y.isOdd()||Z.isOdd())&&(Y.iadd(H),Z.isub(Q)),Y.iushrn(1),Z.iushrn(1);for(var ge=0,be=1;!(j.words[0]&be)&&ge<26;++ge,be<<=1);if(ge>0)for(j.iushrn(ge);ge-- >0;)(z.isOdd()||fe.isOdd())&&(z.iadd(H),fe.isub(Q)),z.iushrn(1),fe.iushrn(1);N.cmp(j)>=0?(N.isub(j),Y.isub(z),Z.isub(fe)):(j.isub(N),z.isub(Y),fe.isub(Z))}return{a:z,b:fe,gcd:j.iushln(te)}},c.prototype._invmp=function(T){E(T.negative===0),E(!T.isZero());var N=this,j=T.clone();N.negative!==0?N=N.umod(T):N=N.clone();for(var Y=new c(1),Z=new c(0),z=j.clone();N.cmpn(1)>0&&j.cmpn(1)>0;){for(var fe=0,te=1;!(N.words[0]&te)&&fe<26;++fe,te<<=1);if(fe>0)for(N.iushrn(fe);fe-- >0;)Y.isOdd()&&Y.iadd(z),Y.iushrn(1);for(var H=0,Q=1;!(j.words[0]&Q)&&H<26;++H,Q<<=1);if(H>0)for(j.iushrn(H);H-- >0;)Z.isOdd()&&Z.iadd(z),Z.iushrn(1);N.cmp(j)>=0?(N.isub(j),Y.isub(Z)):(j.isub(N),Z.isub(Y))}var oe;return N.cmpn(1)===0?oe=Y:oe=Z,oe.cmpn(0)<0&&oe.iadd(T),oe},c.prototype.gcd=function(T){if(this.isZero())return T.abs();if(T.isZero())return this.abs();var N=this.clone(),j=T.clone();N.negative=0,j.negative=0;for(var Y=0;N.isEven()&&j.isEven();Y++)N.iushrn(1),j.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;j.isEven();)j.iushrn(1);var Z=N.cmp(j);if(Z<0){var z=N;N=j,j=z}else if(Z===0||j.cmpn(1)===0)break;N.isub(j)}while(!0);return j.iushln(Y)},c.prototype.invm=function(T){return this.egcd(T).a.umod(T)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(T){return this.words[0]&T},c.prototype.bincn=function(T){E(typeof T=="number");var N=T%26,j=(T-N)/26,Y=1<<N;if(this.length<=j)return this._expand(j+1),this.words[j]|=Y,this;for(var Z=Y,z=j;Z!==0&&z<this.length;z++){var fe=this.words[z]|0;fe+=Z,Z=fe>>>26,fe&=67108863,this.words[z]=fe}return Z!==0&&(this.words[z]=Z,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(T){var N=T<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this._strip();var j;if(this.length>1)j=1;else{N&&(T=-T),E(T<=67108863,"Number is too big");var Y=this.words[0]|0;j=Y===T?0:Y<T?-1:1}return this.negative!==0?-j|0:j},c.prototype.cmp=function(T){if(this.negative!==0&&T.negative===0)return-1;if(this.negative===0&&T.negative!==0)return 1;var N=this.ucmp(T);return this.negative!==0?-N|0:N},c.prototype.ucmp=function(T){if(this.length>T.length)return 1;if(this.length<T.length)return-1;for(var N=0,j=this.length-1;j>=0;j--){var Y=this.words[j]|0,Z=T.words[j]|0;if(Y!==Z){Y<Z?N=-1:Y>Z&&(N=1);break}}return N},c.prototype.gtn=function(T){return this.cmpn(T)===1},c.prototype.gt=function(T){return this.cmp(T)===1},c.prototype.gten=function(T){return this.cmpn(T)>=0},c.prototype.gte=function(T){return this.cmp(T)>=0},c.prototype.ltn=function(T){return this.cmpn(T)===-1},c.prototype.lt=function(T){return this.cmp(T)===-1},c.prototype.lten=function(T){return this.cmpn(T)<=0},c.prototype.lte=function(T){return this.cmp(T)<=0},c.prototype.eqn=function(T){return this.cmpn(T)===0},c.prototype.eq=function(T){return this.cmp(T)===0},c.red=function(T){return new B(T)},c.prototype.toRed=function(T){return E(!this.red,"Already a number in reduction context"),E(this.negative===0,"red works only with positives"),T.convertTo(this)._forceRed(T)},c.prototype.fromRed=function(){return E(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(T){return this.red=T,this},c.prototype.forceRed=function(T){return E(!this.red,"Already a number in reduction context"),this._forceRed(T)},c.prototype.redAdd=function(T){return E(this.red,"redAdd works only with red numbers"),this.red.add(this,T)},c.prototype.redIAdd=function(T){return E(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,T)},c.prototype.redSub=function(T){return E(this.red,"redSub works only with red numbers"),this.red.sub(this,T)},c.prototype.redISub=function(T){return E(this.red,"redISub works only with red numbers"),this.red.isub(this,T)},c.prototype.redShl=function(T){return E(this.red,"redShl works only with red numbers"),this.red.shl(this,T)},c.prototype.redMul=function(T){return E(this.red,"redMul works only with red numbers"),this.red._verify2(this,T),this.red.mul(this,T)},c.prototype.redIMul=function(T){return E(this.red,"redMul works only with red numbers"),this.red._verify2(this,T),this.red.imul(this,T)},c.prototype.redSqr=function(){return E(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return E(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return E(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return E(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return E(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(T){return E(this.red&&!T.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,T)};var X={k256:null,p224:null,p192:null,p25519:null};function se($,T){this.name=$,this.p=new c(T,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}se.prototype._tmp=function(){var T=new c(null);return T.words=new Array(Math.ceil(this.n/13)),T},se.prototype.ireduce=function(T){var N=T,j;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),j=N.bitLength();while(j>this.n);var Y=j<this.n?-1:N.ucmp(this.p);return Y===0?(N.words[0]=0,N.length=1):Y>0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},se.prototype.split=function(T,N){T.iushrn(this.n,0,N)},se.prototype.imulK=function(T){return T.imul(this.k)};function de(){se.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(de,se),de.prototype.split=function(T,N){for(var j=4194303,Y=Math.min(T.length,9),Z=0;Z<Y;Z++)N.words[Z]=T.words[Z];if(N.length=Y,T.length<=9){T.words[0]=0,T.length=1;return}var z=T.words[9];for(N.words[N.length++]=z&j,Z=10;Z<T.length;Z++){var fe=T.words[Z]|0;T.words[Z-10]=(fe&j)<<4|z>>>22,z=fe}z>>>=22,T.words[Z-10]=z,z===0&&T.length>10?T.length-=10:T.length-=9},de.prototype.imulK=function(T){T.words[T.length]=0,T.words[T.length+1]=0,T.length+=2;for(var N=0,j=0;j<T.length;j++){var Y=T.words[j]|0;N+=Y*977,T.words[j]=N&67108863,N=Y*64+(N/67108864|0)}return T.words[T.length-1]===0&&(T.length--,T.words[T.length-1]===0&&T.length--),T};function ye(){se.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(ye,se);function he(){se.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(he,se);function K(){se.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(K,se),K.prototype.imulK=function(T){for(var N=0,j=0;j<T.length;j++){var Y=(T.words[j]|0)*19+N,Z=Y&67108863;Y>>>=26,T.words[j]=Z,N=Y}return N!==0&&(T.words[T.length++]=N),T},c._prime=function(T){if(X[T])return X[T];var N;if(T==="k256")N=new de;else if(T==="p224")N=new ye;else if(T==="p192")N=new he;else if(T==="p25519")N=new K;else throw new Error("Unknown prime "+T);return X[T]=N,N};function B($){if(typeof $=="string"){var T=c._prime($);this.m=T.p,this.prime=T}else E($.gtn(1),"modulus must be greater than 1"),this.m=$,this.prime=null}B.prototype._verify1=function(T){E(T.negative===0,"red works only with positives"),E(T.red,"red works only with red numbers")},B.prototype._verify2=function(T,N){E((T.negative|N.negative)===0,"red works only with positives"),E(T.red&&T.red===N.red,"red works only with red numbers")},B.prototype.imod=function(T){return this.prime?this.prime.ireduce(T)._forceRed(this):(x(T,T.umod(this.m)._forceRed(this)),T)},B.prototype.neg=function(T){return T.isZero()?T.clone():this.m.sub(T)._forceRed(this)},B.prototype.add=function(T,N){this._verify2(T,N);var j=T.add(N);return j.cmp(this.m)>=0&&j.isub(this.m),j._forceRed(this)},B.prototype.iadd=function(T,N){this._verify2(T,N);var j=T.iadd(N);return j.cmp(this.m)>=0&&j.isub(this.m),j},B.prototype.sub=function(T,N){this._verify2(T,N);var j=T.sub(N);return j.cmpn(0)<0&&j.iadd(this.m),j._forceRed(this)},B.prototype.isub=function(T,N){this._verify2(T,N);var j=T.isub(N);return j.cmpn(0)<0&&j.iadd(this.m),j},B.prototype.shl=function(T,N){return this._verify1(T),this.imod(T.ushln(N))},B.prototype.imul=function(T,N){return this._verify2(T,N),this.imod(T.imul(N))},B.prototype.mul=function(T,N){return this._verify2(T,N),this.imod(T.mul(N))},B.prototype.isqr=function(T){return this.imul(T,T.clone())},B.prototype.sqr=function(T){return this.mul(T,T)},B.prototype.sqrt=function(T){if(T.isZero())return T.clone();var N=this.m.andln(3);if(E(N%2===1),N===3){var j=this.m.add(new c(1)).iushrn(2);return this.pow(T,j)}for(var Y=this.m.subn(1),Z=0;!Y.isZero()&&Y.andln(1)===0;)Z++,Y.iushrn(1);E(!Y.isZero());var z=new c(1).toRed(this),fe=z.redNeg(),te=this.m.subn(1).iushrn(1),H=this.m.bitLength();for(H=new c(2*H*H).toRed(this);this.pow(H,te).cmp(fe)!==0;)H.redIAdd(fe);for(var Q=this.pow(H,Y),oe=this.pow(T,Y.addn(1).iushrn(1)),_e=this.pow(T,Y),ge=Z;_e.cmp(z)!==0;){for(var be=_e,we=0;be.cmp(z)!==0;we++)be=be.redSqr();E(we<ge);var Ee=this.pow(Q,new c(1).iushln(ge-we-1));oe=oe.redMul(Ee),Q=Ee.redSqr(),_e=_e.redMul(Q),ge=we}return oe},B.prototype.invm=function(T){var N=T._invmp(this.m);return N.negative!==0?(N.negative=0,this.imod(N).redNeg()):this.imod(N)},B.prototype.pow=function(T,N){if(N.isZero())return new c(1).toRed(this);if(N.cmpn(1)===0)return T.clone();var j=4,Y=new Array(1<<j);Y[0]=new c(1).toRed(this),Y[1]=T;for(var Z=2;Z<Y.length;Z++)Y[Z]=this.mul(Y[Z-1],T);var z=Y[0],fe=0,te=0,H=N.bitLength()%26;for(H===0&&(H=26),Z=N.length-1;Z>=0;Z--){for(var Q=N.words[Z],oe=H-1;oe>=0;oe--){var _e=Q>>oe&1;if(z!==Y[0]&&(z=this.sqr(z)),_e===0&&fe===0){te=0;continue}fe<<=1,fe|=_e,te++,!(te!==j&&(Z!==0||oe!==0))&&(z=this.mul(z,Y[fe]),te=0,fe=0)}H=26}return z},B.prototype.convertTo=function(T){var N=T.umod(this.m);return N===T?N.clone():N},B.prototype.convertFrom=function(T){var N=T.clone();return N.red=null,N},c.mont=function(T){return new L(T)};function L($){B.call(this,$),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(L,B),L.prototype.convertTo=function(T){return this.imod(T.ushln(this.shift))},L.prototype.convertFrom=function(T){var N=this.imod(T.mul(this.rinv));return N.red=null,N},L.prototype.imul=function(T,N){if(T.isZero()||N.isZero())return T.words[0]=0,T.length=1,T;var j=T.imul(N),Y=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=j.isub(Y).iushrn(this.shift),z=Z;return Z.cmp(this.m)>=0?z=Z.isub(this.m):Z.cmpn(0)<0&&(z=Z.iadd(this.m)),z._forceRed(this)},L.prototype.mul=function(T,N){if(T.isZero()||N.isZero())return new c(0)._forceRed(this);var j=T.mul(N),Y=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=j.isub(Y).iushrn(this.shift),z=Z;return Z.cmp(this.m)>=0?z=Z.isub(this.m):Z.cmpn(0)<0&&(z=Z.iadd(this.m)),z._forceRed(this)},L.prototype.invm=function(T){var N=this.imod(T._invmp(this.m).mul(this.r2));return N._forceRed(this)}}(ie,this)},59229:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=this&&this.__createBinding||(Object.create?function(K,B,L,$){$===void 0&&($=L),Object.defineProperty(K,$,{enumerable:!0,get:function(){return B[L]}})}:function(K,B,L,$){$===void 0&&($=L),K[$]=B[L]}),E=this&&this.__setModuleDefault||(Object.create?function(K,B){Object.defineProperty(K,"default",{enumerable:!0,value:B})}:function(K,B){K.default=B}),v=this&&this.__decorate||function(K,B,L,$){var T=arguments.length,N=T<3?B:$===null?$=Object.getOwnPropertyDescriptor(B,L):$,j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(K,B,L,$);else for(var Y=K.length-1;Y>=0;Y--)(j=K[Y])&&(N=(T<3?j(N):T>3?j(B,L,N):j(B,L))||N);return T>3&&N&&Object.defineProperty(B,L,N),N},c=this&&this.__importStar||function(K){if(K&&K.__esModule)return K;var B={};if(K!=null)for(var L in K)L!=="default"&&Object.hasOwnProperty.call(K,L)&&w(B,K,L);return E(B,K),B},d=this&&this.__importDefault||function(K){return K&&K.__esModule?K:{default:K}};Object.defineProperty(f,"__esModule",{value:!0}),f.deserializeUnchecked=f.deserialize=f.serialize=f.BinaryReader=f.BinaryWriter=f.BorshError=f.baseDecode=f.baseEncode=void 0;const p=d(_(83900)),m=d(_(22265)),C=c(_(69637)),x=typeof TextDecoder!="function"?C.TextDecoder:TextDecoder,R=new x("utf-8",{fatal:!0});function S(K){return typeof K=="string"&&(K=h.from(K,"utf8")),m.default.encode(h.from(K))}f.baseEncode=S;function O(K){return h.from(m.default.decode(K))}f.baseDecode=O;const M=1024;class k extends Error{constructor(B){super(B),this.fieldPath=[],this.originalMessage=B}addToFieldPath(B){this.fieldPath.splice(0,0,B),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}f.BorshError=k;class q{constructor(){this.buf=h.alloc(M),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=h.concat([this.buf,h.alloc(M)]))}writeU8(B){this.maybeResize(),this.buf.writeUInt8(B,this.length),this.length+=1}writeU16(B){this.maybeResize(),this.buf.writeUInt16LE(B,this.length),this.length+=2}writeU32(B){this.maybeResize(),this.buf.writeUInt32LE(B,this.length),this.length+=4}writeU64(B){this.maybeResize(),this.writeBuffer(h.from(new p.default(B).toArray("le",8)))}writeU128(B){this.maybeResize(),this.writeBuffer(h.from(new p.default(B).toArray("le",16)))}writeU256(B){this.maybeResize(),this.writeBuffer(h.from(new p.default(B).toArray("le",32)))}writeU512(B){this.maybeResize(),this.writeBuffer(h.from(new p.default(B).toArray("le",64)))}writeBuffer(B){this.buf=h.concat([h.from(this.buf.subarray(0,this.length)),B,h.alloc(M)]),this.length+=B.length}writeString(B){this.maybeResize();const L=h.from(B,"utf8");this.writeU32(L.length),this.writeBuffer(L)}writeFixedArray(B){this.writeBuffer(h.from(B))}writeArray(B,L){this.maybeResize(),this.writeU32(B.length);for(const $ of B)this.maybeResize(),L($)}toArray(){return this.buf.subarray(0,this.length)}}f.BinaryWriter=q;function b(K,B,L){const $=L.value;L.value=function(...T){try{return $.apply(this,T)}catch(N){if(N instanceof RangeError){const j=N.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(j)>=0)throw new k("Reached the end of buffer when deserializing")}throw N}}}class F{constructor(B){this.buf=B,this.offset=0}readU8(){const B=this.buf.readUInt8(this.offset);return this.offset+=1,B}readU16(){const B=this.buf.readUInt16LE(this.offset);return this.offset+=2,B}readU32(){const B=this.buf.readUInt32LE(this.offset);return this.offset+=4,B}readU64(){const B=this.readBuffer(8);return new p.default(B,"le")}readU128(){const B=this.readBuffer(16);return new p.default(B,"le")}readU256(){const B=this.readBuffer(32);return new p.default(B,"le")}readU512(){const B=this.readBuffer(64);return new p.default(B,"le")}readBuffer(B){if(this.offset+B>this.buf.length)throw new k(`Expected buffer length ${B} isn't within bounds`);const L=this.buf.slice(this.offset,this.offset+B);return this.offset+=B,L}readString(){const B=this.readU32(),L=this.readBuffer(B);try{return R.decode(L)}catch($){throw new k(`Error decoding UTF-8 string: ${$}`)}}readFixedArray(B){return new Uint8Array(this.readBuffer(B))}readArray(B){const L=this.readU32(),$=Array();for(let T=0;T<L;++T)$.push(B());return $}}v([b],F.prototype,"readU8",null),v([b],F.prototype,"readU16",null),v([b],F.prototype,"readU32",null),v([b],F.prototype,"readU64",null),v([b],F.prototype,"readU128",null),v([b],F.prototype,"readU256",null),v([b],F.prototype,"readU512",null),v([b],F.prototype,"readString",null),v([b],F.prototype,"readFixedArray",null),v([b],F.prototype,"readArray",null),f.BinaryReader=F;function G(K){return K.charAt(0).toUpperCase()+K.slice(1)}function ue(K,B,L,$,T){try{if(typeof $=="string")T[`write${G($)}`](L);else if($ instanceof Array)if(typeof $[0]=="number"){if(L.length!==$[0])throw new k(`Expecting byte array of length ${$[0]}, but got ${L.length} bytes`);T.writeFixedArray(L)}else if($.length===2&&typeof $[1]=="number"){if(L.length!==$[1])throw new k(`Expecting byte array of length ${$[1]}, but got ${L.length} bytes`);for(let N=0;N<$[1];N++)ue(K,null,L[N],$[0],T)}else T.writeArray(L,N=>{ue(K,B,N,$[0],T)});else if($.kind!==void 0)switch($.kind){case"option":{L==null?T.writeU8(0):(T.writeU8(1),ue(K,B,L,$.type,T));break}case"map":{T.writeU32(L.size),L.forEach((N,j)=>{ue(K,B,j,$.key,T),ue(K,B,N,$.value,T)});break}default:throw new k(`FieldType ${$} unrecognized`)}else le(K,L,T)}catch(N){throw N instanceof k&&N.addToFieldPath(B),N}}function le(K,B,L){if(typeof B.borshSerialize=="function"){B.borshSerialize(L);return}const $=K.get(B.constructor);if(!$)throw new k(`Class ${B.constructor.name} is missing in schema`);if($.kind==="struct")$.fields.map(([T,N])=>{ue(K,T,B[T],N,L)});else if($.kind==="enum"){const T=B[$.field];for(let N=0;N<$.values.length;++N){const[j,Y]=$.values[N];if(j===T){L.writeU8(N),ue(K,j,B[j],Y,L);break}}}else throw new k(`Unexpected schema kind: ${$.kind} for ${B.constructor.name}`)}function X(K,B,L=q){const $=new L;return le(K,B,$),$.toArray()}f.serialize=X;function se(K,B,L,$){try{if(typeof L=="string")return $[`read${G(L)}`]();if(L instanceof Array){if(typeof L[0]=="number")return $.readFixedArray(L[0]);if(typeof L[1]=="number"){const T=[];for(let N=0;N<L[1];N++)T.push(se(K,null,L[0],$));return T}else return $.readArray(()=>se(K,B,L[0],$))}if(L.kind==="option")return $.readU8()?se(K,B,L.type,$):void 0;if(L.kind==="map"){let T=new Map;const N=$.readU32();for(let j=0;j<N;j++){const Y=se(K,B,L.key,$),Z=se(K,B,L.value,$);T.set(Y,Z)}return T}return de(K,L,$)}catch(T){throw T instanceof k&&T.addToFieldPath(B),T}}function de(K,B,L){if(typeof B.borshDeserialize=="function")return B.borshDeserialize(L);const $=K.get(B);if(!$)throw new k(`Class ${B.name} is missing in schema`);if($.kind==="struct"){const T={};for(const[N,j]of K.get(B).fields)T[N]=se(K,N,j,L);return new B(T)}if($.kind==="enum"){const T=L.readU8();if(T>=$.values.length)throw new k(`Enum index: ${T} is out of range`);const[N,j]=$.values[T],Y=se(K,N,j,L);return new B({[N]:Y})}throw new k(`Unexpected schema kind: ${$.kind} for ${B.constructor.name}`)}function ye(K,B,L,$=F){const T=new $(L),N=de(K,B,T);if(T.offset<L.length)throw new k(`Unexpected ${L.length-T.offset} bytes after deserialized data`);return N}f.deserialize=ye;function he(K,B,L,$=F){const T=new $(L);return de(K,B,T)}f.deserializeUnchecked=he},46025:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=_(85409),E=_(46732),v=_(84179),c=_(78250),d=_(81090),p=_(10756);for(var m in p)f[m]=p[m];f.NONE=0,f.DEFLATE=1,f.INFLATE=2,f.GZIP=3,f.GUNZIP=4,f.DEFLATERAW=5,f.INFLATERAW=6,f.UNZIP=7;var C=31,x=139;function R(S){if(typeof S!="number"||S<f.DEFLATE||S>f.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=S,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}R.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,E(this.init_done,"close before init"),E(this.mode<=f.UNZIP),this.mode===f.DEFLATE||this.mode===f.GZIP||this.mode===f.DEFLATERAW?c.deflateEnd(this.strm):(this.mode===f.INFLATE||this.mode===f.GUNZIP||this.mode===f.INFLATERAW||this.mode===f.UNZIP)&&d.inflateEnd(this.strm),this.mode=f.NONE,this.dictionary=null},R.prototype.write=function(S,O,M,k,q,b,F){return this._write(!0,S,O,M,k,q,b,F)},R.prototype.writeSync=function(S,O,M,k,q,b,F){return this._write(!1,S,O,M,k,q,b,F)},R.prototype._write=function(S,O,M,k,q,b,F,G){if(E.equal(arguments.length,8),E(this.init_done,"write before init"),E(this.mode!==f.NONE,"already finalized"),E.equal(!1,this.write_in_progress,"write already in progress"),E.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,E.equal(!1,O===void 0,"must provide flush value"),this.write_in_progress=!0,O!==f.Z_NO_FLUSH&&O!==f.Z_PARTIAL_FLUSH&&O!==f.Z_SYNC_FLUSH&&O!==f.Z_FULL_FLUSH&&O!==f.Z_FINISH&&O!==f.Z_BLOCK)throw new Error("Invalid flush value");if(M==null&&(M=h.alloc(0),q=0,k=0),this.strm.avail_in=q,this.strm.input=M,this.strm.next_in=k,this.strm.avail_out=G,this.strm.output=b,this.strm.next_out=F,this.flush=O,!S)return this._process(),this._checkError()?this._afterSync():void 0;var ue=this;return w.nextTick(function(){ue._process(),ue._after()}),this},R.prototype._afterSync=function(){var S=this.strm.avail_out,O=this.strm.avail_in;return this.write_in_progress=!1,[O,S]},R.prototype._process=function(){var S=null;switch(this.mode){case f.DEFLATE:case f.GZIP:case f.DEFLATERAW:this.err=c.deflate(this.strm,this.flush);break;case f.UNZIP:switch(this.strm.avail_in>0&&(S=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(S===null)break;if(this.strm.input[S]===C){if(this.gzip_id_bytes_read=1,S++,this.strm.avail_in===1)break}else{this.mode=f.INFLATE;break}case 1:if(S===null)break;this.strm.input[S]===x?(this.gzip_id_bytes_read=2,this.mode=f.GUNZIP):this.mode=f.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case f.INFLATE:case f.GUNZIP:case f.INFLATERAW:for(this.err=d.inflate(this.strm,this.flush),this.err===f.Z_NEED_DICT&&this.dictionary&&(this.err=d.inflateSetDictionary(this.strm,this.dictionary),this.err===f.Z_OK?this.err=d.inflate(this.strm,this.flush):this.err===f.Z_DATA_ERROR&&(this.err=f.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===f.GUNZIP&&this.err===f.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=d.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},R.prototype._checkError=function(){switch(this.err){case f.Z_OK:case f.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===f.Z_FINISH)return this._error("unexpected end of file"),!1;break;case f.Z_STREAM_END:break;case f.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},R.prototype._after=function(){if(this._checkError()){var S=this.strm.avail_out,O=this.strm.avail_in;this.write_in_progress=!1,this.callback(O,S),this.pending_close&&this.close()}},R.prototype._error=function(S){this.strm.msg&&(S=this.strm.msg),this.onerror(S,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},R.prototype.init=function(S,O,M,k,q){E(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),E(S>=8&&S<=15,"invalid windowBits"),E(O>=-1&&O<=9,"invalid compression level"),E(M>=1&&M<=9,"invalid memlevel"),E(k===f.Z_FILTERED||k===f.Z_HUFFMAN_ONLY||k===f.Z_RLE||k===f.Z_FIXED||k===f.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(O,S,M,k,q),this._setDictionary()},R.prototype.params=function(){throw new Error("deflateParams Not supported")},R.prototype.reset=function(){this._reset(),this._setDictionary()},R.prototype._init=function(S,O,M,k,q){switch(this.level=S,this.windowBits=O,this.memLevel=M,this.strategy=k,this.flush=f.Z_NO_FLUSH,this.err=f.Z_OK,(this.mode===f.GZIP||this.mode===f.GUNZIP)&&(this.windowBits+=16),this.mode===f.UNZIP&&(this.windowBits+=32),(this.mode===f.DEFLATERAW||this.mode===f.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new v,this.mode){case f.DEFLATE:case f.GZIP:case f.DEFLATERAW:this.err=c.deflateInit2(this.strm,this.level,f.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case f.INFLATE:case f.GUNZIP:case f.INFLATERAW:case f.UNZIP:this.err=d.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==f.Z_OK&&this._error("Init error"),this.dictionary=q,this.write_in_progress=!1,this.init_done=!0},R.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=f.Z_OK,this.mode){case f.DEFLATE:case f.DEFLATERAW:this.err=c.deflateSetDictionary(this.strm,this.dictionary);break;default:break}this.err!==f.Z_OK&&this._error("Failed to set dictionary")}},R.prototype._reset=function(){switch(this.err=f.Z_OK,this.mode){case f.DEFLATE:case f.DEFLATERAW:case f.GZIP:this.err=c.deflateReset(this.strm);break;case f.INFLATE:case f.INFLATERAW:case f.GUNZIP:this.err=d.inflateReset(this.strm);break;default:break}this.err!==f.Z_OK&&this._error("Failed to reset stream")},f.Zlib=R},46068:function(ie,f,_){"use strict";var h=_(85409),w=_(36533).Buffer,E=_(43803).Transform,v=_(46025),c=_(1344),d=_(46732).ok,p=_(36533).kMaxLength,m="Cannot create final Buffer. It would be larger than 0x"+p.toString(16)+" bytes";v.Z_MIN_WINDOWBITS=8,v.Z_MAX_WINDOWBITS=15,v.Z_DEFAULT_WINDOWBITS=15,v.Z_MIN_CHUNK=64,v.Z_MAX_CHUNK=1/0,v.Z_DEFAULT_CHUNK=16384,v.Z_MIN_MEMLEVEL=1,v.Z_MAX_MEMLEVEL=9,v.Z_DEFAULT_MEMLEVEL=8,v.Z_MIN_LEVEL=-1,v.Z_MAX_LEVEL=9,v.Z_DEFAULT_LEVEL=v.Z_DEFAULT_COMPRESSION;for(var C=Object.keys(v),x=0;x<C.length;x++){var R=C[x];R.match(/^Z/)&&Object.defineProperty(f,R,{enumerable:!0,value:v[R],writable:!1})}for(var S={Z_OK:v.Z_OK,Z_STREAM_END:v.Z_STREAM_END,Z_NEED_DICT:v.Z_NEED_DICT,Z_ERRNO:v.Z_ERRNO,Z_STREAM_ERROR:v.Z_STREAM_ERROR,Z_DATA_ERROR:v.Z_DATA_ERROR,Z_MEM_ERROR:v.Z_MEM_ERROR,Z_BUF_ERROR:v.Z_BUF_ERROR,Z_VERSION_ERROR:v.Z_VERSION_ERROR},O=Object.keys(S),M=0;M<O.length;M++){var k=O[M];S[S[k]]=k}Object.defineProperty(f,"codes",{enumerable:!0,value:Object.freeze(S),writable:!1}),f.Deflate=F,f.Inflate=G,f.Gzip=ue,f.Gunzip=le,f.DeflateRaw=X,f.InflateRaw=se,f.Unzip=de,f.createDeflate=function(L){return new F(L)},f.createInflate=function(L){return new G(L)},f.createDeflateRaw=function(L){return new X(L)},f.createInflateRaw=function(L){return new se(L)},f.createGzip=function(L){return new ue(L)},f.createGunzip=function(L){return new le(L)},f.createUnzip=function(L){return new de(L)},f.deflate=function(L,$,T){return typeof $=="function"&&(T=$,$={}),q(new F($),L,T)},f.deflateSync=function(L,$){return b(new F($),L)},f.gzip=function(L,$,T){return typeof $=="function"&&(T=$,$={}),q(new ue($),L,T)},f.gzipSync=function(L,$){return b(new ue($),L)},f.deflateRaw=function(L,$,T){return typeof $=="function"&&(T=$,$={}),q(new X($),L,T)},f.deflateRawSync=function(L,$){return b(new X($),L)},f.unzip=function(L,$,T){return typeof $=="function"&&(T=$,$={}),q(new de($),L,T)},f.unzipSync=function(L,$){return b(new de($),L)},f.inflate=function(L,$,T){return typeof $=="function"&&(T=$,$={}),q(new G($),L,T)},f.inflateSync=function(L,$){return b(new G($),L)},f.gunzip=function(L,$,T){return typeof $=="function"&&(T=$,$={}),q(new le($),L,T)},f.gunzipSync=function(L,$){return b(new le($),L)},f.inflateRaw=function(L,$,T){return typeof $=="function"&&(T=$,$={}),q(new se($),L,T)},f.inflateRawSync=function(L,$){return b(new se($),L)};function q(L,$,T){var N=[],j=0;L.on("error",Z),L.on("end",z),L.end($),Y();function Y(){for(var fe;(fe=L.read())!==null;)N.push(fe),j+=fe.length;L.once("readable",Y)}function Z(fe){L.removeListener("end",z),L.removeListener("readable",Y),T(fe)}function z(){var fe,te=null;j>=p?te=new RangeError(m):fe=w.concat(N,j),N=[],L.close(),T(te,fe)}}function b(L,$){if(typeof $=="string"&&($=w.from($)),!w.isBuffer($))throw new TypeError("Not a string or buffer");var T=L._finishFlushFlag;return L._processChunk($,T)}function F(L){if(!(this instanceof F))return new F(L);he.call(this,L,v.DEFLATE)}function G(L){if(!(this instanceof G))return new G(L);he.call(this,L,v.INFLATE)}function ue(L){if(!(this instanceof ue))return new ue(L);he.call(this,L,v.GZIP)}function le(L){if(!(this instanceof le))return new le(L);he.call(this,L,v.GUNZIP)}function X(L){if(!(this instanceof X))return new X(L);he.call(this,L,v.DEFLATERAW)}function se(L){if(!(this instanceof se))return new se(L);he.call(this,L,v.INFLATERAW)}function de(L){if(!(this instanceof de))return new de(L);he.call(this,L,v.UNZIP)}function ye(L){return L===v.Z_NO_FLUSH||L===v.Z_PARTIAL_FLUSH||L===v.Z_SYNC_FLUSH||L===v.Z_FULL_FLUSH||L===v.Z_FINISH||L===v.Z_BLOCK}function he(L,$){var T=this;if(this._opts=L=L||{},this._chunkSize=L.chunkSize||f.Z_DEFAULT_CHUNK,E.call(this,L),L.flush&&!ye(L.flush))throw new Error("Invalid flush flag: "+L.flush);if(L.finishFlush&&!ye(L.finishFlush))throw new Error("Invalid flush flag: "+L.finishFlush);if(this._flushFlag=L.flush||v.Z_NO_FLUSH,this._finishFlushFlag=typeof L.finishFlush<"u"?L.finishFlush:v.Z_FINISH,L.chunkSize&&(L.chunkSize<f.Z_MIN_CHUNK||L.chunkSize>f.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+L.chunkSize);if(L.windowBits&&(L.windowBits<f.Z_MIN_WINDOWBITS||L.windowBits>f.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+L.windowBits);if(L.level&&(L.level<f.Z_MIN_LEVEL||L.level>f.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+L.level);if(L.memLevel&&(L.memLevel<f.Z_MIN_MEMLEVEL||L.memLevel>f.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+L.memLevel);if(L.strategy&&L.strategy!=f.Z_FILTERED&&L.strategy!=f.Z_HUFFMAN_ONLY&&L.strategy!=f.Z_RLE&&L.strategy!=f.Z_FIXED&&L.strategy!=f.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+L.strategy);if(L.dictionary&&!w.isBuffer(L.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new v.Zlib($);var N=this;this._hadError=!1,this._handle.onerror=function(Z,z){K(N),N._hadError=!0;var fe=new Error(Z);fe.errno=z,fe.code=f.codes[z],N.emit("error",fe)};var j=f.Z_DEFAULT_COMPRESSION;typeof L.level=="number"&&(j=L.level);var Y=f.Z_DEFAULT_STRATEGY;typeof L.strategy=="number"&&(Y=L.strategy),this._handle.init(L.windowBits||f.Z_DEFAULT_WINDOWBITS,j,L.memLevel||f.Z_DEFAULT_MEMLEVEL,Y,L.dictionary),this._buffer=w.allocUnsafe(this._chunkSize),this._offset=0,this._level=j,this._strategy=Y,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!T._handle},configurable:!0,enumerable:!0})}c.inherits(he,E),he.prototype.params=function(L,$,T){if(L<f.Z_MIN_LEVEL||L>f.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+L);if($!=f.Z_FILTERED&&$!=f.Z_HUFFMAN_ONLY&&$!=f.Z_RLE&&$!=f.Z_FIXED&&$!=f.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+$);if(this._level!==L||this._strategy!==$){var N=this;this.flush(v.Z_SYNC_FLUSH,function(){d(N._handle,"zlib binding closed"),N._handle.params(L,$),N._hadError||(N._level=L,N._strategy=$,T&&T())})}else h.nextTick(T)},he.prototype.reset=function(){return d(this._handle,"zlib binding closed"),this._handle.reset()},he.prototype._flush=function(L){this._transform(w.alloc(0),"",L)},he.prototype.flush=function(L,$){var T=this,N=this._writableState;(typeof L=="function"||L===void 0&&!$)&&($=L,L=v.Z_FULL_FLUSH),N.ended?$&&h.nextTick($):N.ending?$&&this.once("end",$):N.needDrain?$&&this.once("drain",function(){return T.flush(L,$)}):(this._flushFlag=L,this.write(w.alloc(0),"",$))},he.prototype.close=function(L){K(this,L),h.nextTick(B,this)};function K(L,$){$&&h.nextTick($),L._handle&&(L._handle.close(),L._handle=null)}function B(L){L.emit("close")}he.prototype._transform=function(L,$,T){var N,j=this._writableState,Y=j.ending||j.ended,Z=Y&&(!L||j.length===L.length);if(L!==null&&!w.isBuffer(L))return T(new Error("invalid input"));if(!this._handle)return T(new Error("zlib binding closed"));Z?N=this._finishFlushFlag:(N=this._flushFlag,L.length>=j.length&&(this._flushFlag=this._opts.flush||v.Z_NO_FLUSH)),this._processChunk(L,N,T)},he.prototype._processChunk=function(L,$,T){var N=L&&L.length,j=this._chunkSize-this._offset,Y=0,Z=this,z=typeof T=="function";if(!z){var fe=[],te=0,H;this.on("error",function(be){H=be}),d(this._handle,"zlib binding closed");do var Q=this._handle.writeSync($,L,Y,N,this._buffer,this._offset,j);while(!this._hadError&&ge(Q[0],Q[1]));if(this._hadError)throw H;if(te>=p)throw K(this),new RangeError(m);var oe=w.concat(fe,te);return K(this),oe}d(this._handle,"zlib binding closed");var _e=this._handle.write($,L,Y,N,this._buffer,this._offset,j);_e.buffer=L,_e.callback=ge;function ge(be,we){if(this&&(this.buffer=null,this.callback=null),!Z._hadError){var Ee=j-we;if(d(Ee>=0,"have should not go down"),Ee>0){var me=Z._buffer.slice(Z._offset,Z._offset+Ee);Z._offset+=Ee,z?Z.push(me):(fe.push(me),te+=me.length)}if((we===0||Z._offset>=Z._chunkSize)&&(j=Z._chunkSize,Z._offset=0,Z._buffer=w.allocUnsafe(Z._chunkSize)),we===0){if(Y+=N-be,N=be,!z)return!0;var Ke=Z._handle.write($,L,Y,N,Z._buffer,Z._offset,Z._chunkSize);Ke.callback=ge,Ke.buffer=L;return}if(!z)return!1;T()}}},c.inherits(F,he),c.inherits(G,he),c.inherits(ue,he),c.inherits(le,he),c.inherits(X,he),c.inherits(se,he),c.inherits(de,he)},22265:function(ie,f,_){var h=_(29622),w="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";ie.exports=h(w)},36533:function(ie,f,_){"use strict";/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*/const h=_(84933),w=_(63328),E=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;f.Buffer=p,f.SlowBuffer=F,f.INSPECT_MAX_BYTES=50;const v=2147483647;f.kMaxLength=v,p.TYPED_ARRAY_SUPPORT=c(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function c(){try{const ke=new Uint8Array(1),xe={foo:function(){return 42}};return Object.setPrototypeOf(xe,Uint8Array.prototype),Object.setPrototypeOf(ke,xe),ke.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function d(ke){if(ke>v)throw new RangeError('The value "'+ke+'" is invalid for option "size"');const xe=new Uint8Array(ke);return Object.setPrototypeOf(xe,p.prototype),xe}function p(ke,xe,Pe){if(typeof ke=="number"){if(typeof xe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(ke)}return m(ke,xe,Pe)}p.poolSize=8192;function m(ke,xe,Pe){if(typeof ke=="string")return S(ke,xe);if(ArrayBuffer.isView(ke))return M(ke);if(ke==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ke);if(gt(ke,ArrayBuffer)||ke&>(ke.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(gt(ke,SharedArrayBuffer)||ke&>(ke.buffer,SharedArrayBuffer)))return k(ke,xe,Pe);if(typeof ke=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const it=ke.valueOf&&ke.valueOf();if(it!=null&&it!==ke)return p.from(it,xe,Pe);const Xe=q(ke);if(Xe)return Xe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ke[Symbol.toPrimitive]=="function")return p.from(ke[Symbol.toPrimitive]("string"),xe,Pe);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ke)}p.from=function(ke,xe,Pe){return m(ke,xe,Pe)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function C(ke){if(typeof ke!="number")throw new TypeError('"size" argument must be of type number');if(ke<0)throw new RangeError('The value "'+ke+'" is invalid for option "size"')}function x(ke,xe,Pe){return C(ke),ke<=0?d(ke):xe!==void 0?typeof Pe=="string"?d(ke).fill(xe,Pe):d(ke).fill(xe):d(ke)}p.alloc=function(ke,xe,Pe){return x(ke,xe,Pe)};function R(ke){return C(ke),d(ke<0?0:b(ke)|0)}p.allocUnsafe=function(ke){return R(ke)},p.allocUnsafeSlow=function(ke){return R(ke)};function S(ke,xe){if((typeof xe!="string"||xe==="")&&(xe="utf8"),!p.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);const Pe=G(ke,xe)|0;let it=d(Pe);const Xe=it.write(ke,xe);return Xe!==Pe&&(it=it.slice(0,Xe)),it}function O(ke){const xe=ke.length<0?0:b(ke.length)|0,Pe=d(xe);for(let it=0;it<xe;it+=1)Pe[it]=ke[it]&255;return Pe}function M(ke){if(gt(ke,Uint8Array)){const xe=new Uint8Array(ke);return k(xe.buffer,xe.byteOffset,xe.byteLength)}return O(ke)}function k(ke,xe,Pe){if(xe<0||ke.byteLength<xe)throw new RangeError('"offset" is outside of buffer bounds');if(ke.byteLength<xe+(Pe||0))throw new RangeError('"length" is outside of buffer bounds');let it;return xe===void 0&&Pe===void 0?it=new Uint8Array(ke):Pe===void 0?it=new Uint8Array(ke,xe):it=new Uint8Array(ke,xe,Pe),Object.setPrototypeOf(it,p.prototype),it}function q(ke){if(p.isBuffer(ke)){const xe=b(ke.length)|0,Pe=d(xe);return Pe.length===0||ke.copy(Pe,0,0,xe),Pe}if(ke.length!==void 0)return typeof ke.length!="number"||lt(ke.length)?d(0):O(ke);if(ke.type==="Buffer"&&Array.isArray(ke.data))return O(ke.data)}function b(ke){if(ke>=v)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+v.toString(16)+" bytes");return ke|0}function F(ke){return+ke!=ke&&(ke=0),p.alloc(+ke)}p.isBuffer=function(xe){return xe!=null&&xe._isBuffer===!0&&xe!==p.prototype},p.compare=function(xe,Pe){if(gt(xe,Uint8Array)&&(xe=p.from(xe,xe.offset,xe.byteLength)),gt(Pe,Uint8Array)&&(Pe=p.from(Pe,Pe.offset,Pe.byteLength)),!p.isBuffer(xe)||!p.isBuffer(Pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(xe===Pe)return 0;let it=xe.length,Xe=Pe.length;for(let st=0,It=Math.min(it,Xe);st<It;++st)if(xe[st]!==Pe[st]){it=xe[st],Xe=Pe[st];break}return it<Xe?-1:Xe<it?1:0},p.isEncoding=function(xe){switch(String(xe).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}},p.concat=function(xe,Pe){if(!Array.isArray(xe))throw new TypeError('"list" argument must be an Array of Buffers');if(xe.length===0)return p.alloc(0);let it;if(Pe===void 0)for(Pe=0,it=0;it<xe.length;++it)Pe+=xe[it].length;const Xe=p.allocUnsafe(Pe);let st=0;for(it=0;it<xe.length;++it){let It=xe[it];if(gt(It,Uint8Array))st+It.length>Xe.length?(p.isBuffer(It)||(It=p.from(It)),It.copy(Xe,st)):Uint8Array.prototype.set.call(Xe,It,st);else if(p.isBuffer(It))It.copy(Xe,st);else throw new TypeError('"list" argument must be an Array of Buffers');st+=It.length}return Xe};function G(ke,xe){if(p.isBuffer(ke))return ke.length;if(ArrayBuffer.isView(ke)||gt(ke,ArrayBuffer))return ke.byteLength;if(typeof ke!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ke);const Pe=ke.length,it=arguments.length>2&&arguments[2]===!0;if(!it&&Pe===0)return 0;let Xe=!1;for(;;)switch(xe){case"ascii":case"latin1":case"binary":return Pe;case"utf8":case"utf-8":return Be(ke).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pe*2;case"hex":return Pe>>>1;case"base64":return _t(ke).length;default:if(Xe)return it?-1:Be(ke).length;xe=(""+xe).toLowerCase(),Xe=!0}}p.byteLength=G;function ue(ke,xe,Pe){let it=!1;if((xe===void 0||xe<0)&&(xe=0),xe>this.length||((Pe===void 0||Pe>this.length)&&(Pe=this.length),Pe<=0)||(Pe>>>=0,xe>>>=0,Pe<=xe))return"";for(ke||(ke="utf8");;)switch(ke){case"hex":return Z(this,xe,Pe);case"utf8":case"utf-8":return $(this,xe,Pe);case"ascii":return j(this,xe,Pe);case"latin1":case"binary":return Y(this,xe,Pe);case"base64":return L(this,xe,Pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,xe,Pe);default:if(it)throw new TypeError("Unknown encoding: "+ke);ke=(ke+"").toLowerCase(),it=!0}}p.prototype._isBuffer=!0;function le(ke,xe,Pe){const it=ke[xe];ke[xe]=ke[Pe],ke[Pe]=it}p.prototype.swap16=function(){const xe=this.length;if(xe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Pe=0;Pe<xe;Pe+=2)le(this,Pe,Pe+1);return this},p.prototype.swap32=function(){const xe=this.length;if(xe%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Pe=0;Pe<xe;Pe+=4)le(this,Pe,Pe+3),le(this,Pe+1,Pe+2);return this},p.prototype.swap64=function(){const xe=this.length;if(xe%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Pe=0;Pe<xe;Pe+=8)le(this,Pe,Pe+7),le(this,Pe+1,Pe+6),le(this,Pe+2,Pe+5),le(this,Pe+3,Pe+4);return this},p.prototype.toString=function(){const xe=this.length;return xe===0?"":arguments.length===0?$(this,0,xe):ue.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(xe){if(!p.isBuffer(xe))throw new TypeError("Argument must be a Buffer");return this===xe?!0:p.compare(this,xe)===0},p.prototype.inspect=function(){let xe="";const Pe=f.INSPECT_MAX_BYTES;return xe=this.toString("hex",0,Pe).replace(/(.{2})/g,"$1 ").trim(),this.length>Pe&&(xe+=" ... "),"<Buffer "+xe+">"},E&&(p.prototype[E]=p.prototype.inspect),p.prototype.compare=function(xe,Pe,it,Xe,st){if(gt(xe,Uint8Array)&&(xe=p.from(xe,xe.offset,xe.byteLength)),!p.isBuffer(xe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof xe);if(Pe===void 0&&(Pe=0),it===void 0&&(it=xe?xe.length:0),Xe===void 0&&(Xe=0),st===void 0&&(st=this.length),Pe<0||it>xe.length||Xe<0||st>this.length)throw new RangeError("out of range index");if(Xe>=st&&Pe>=it)return 0;if(Xe>=st)return-1;if(Pe>=it)return 1;if(Pe>>>=0,it>>>=0,Xe>>>=0,st>>>=0,this===xe)return 0;let It=st-Xe,ft=it-Pe;const Jt=Math.min(It,ft),Ot=this.slice(Xe,st),Ct=xe.slice(Pe,it);for(let qe=0;qe<Jt;++qe)if(Ot[qe]!==Ct[qe]){It=Ot[qe],ft=Ct[qe];break}return It<ft?-1:ft<It?1:0};function X(ke,xe,Pe,it,Xe){if(ke.length===0)return-1;if(typeof Pe=="string"?(it=Pe,Pe=0):Pe>2147483647?Pe=2147483647:Pe<-2147483648&&(Pe=-2147483648),Pe=+Pe,lt(Pe)&&(Pe=Xe?0:ke.length-1),Pe<0&&(Pe=ke.length+Pe),Pe>=ke.length){if(Xe)return-1;Pe=ke.length-1}else if(Pe<0)if(Xe)Pe=0;else return-1;if(typeof xe=="string"&&(xe=p.from(xe,it)),p.isBuffer(xe))return xe.length===0?-1:se(ke,xe,Pe,it,Xe);if(typeof xe=="number")return xe=xe&255,typeof Uint8Array.prototype.indexOf=="function"?Xe?Uint8Array.prototype.indexOf.call(ke,xe,Pe):Uint8Array.prototype.lastIndexOf.call(ke,xe,Pe):se(ke,[xe],Pe,it,Xe);throw new TypeError("val must be string, number or Buffer")}function se(ke,xe,Pe,it,Xe){let st=1,It=ke.length,ft=xe.length;if(it!==void 0&&(it=String(it).toLowerCase(),it==="ucs2"||it==="ucs-2"||it==="utf16le"||it==="utf-16le")){if(ke.length<2||xe.length<2)return-1;st=2,It/=2,ft/=2,Pe/=2}function Jt(Ct,qe){return st===1?Ct[qe]:Ct.readUInt16BE(qe*st)}let Ot;if(Xe){let Ct=-1;for(Ot=Pe;Ot<It;Ot++)if(Jt(ke,Ot)===Jt(xe,Ct===-1?0:Ot-Ct)){if(Ct===-1&&(Ct=Ot),Ot-Ct+1===ft)return Ct*st}else Ct!==-1&&(Ot-=Ot-Ct),Ct=-1}else for(Pe+ft>It&&(Pe=It-ft),Ot=Pe;Ot>=0;Ot--){let Ct=!0;for(let qe=0;qe<ft;qe++)if(Jt(ke,Ot+qe)!==Jt(xe,qe)){Ct=!1;break}if(Ct)return Ot}return-1}p.prototype.includes=function(xe,Pe,it){return this.indexOf(xe,Pe,it)!==-1},p.prototype.indexOf=function(xe,Pe,it){return X(this,xe,Pe,it,!0)},p.prototype.lastIndexOf=function(xe,Pe,it){return X(this,xe,Pe,it,!1)};function de(ke,xe,Pe,it){Pe=Number(Pe)||0;const Xe=ke.length-Pe;it?(it=Number(it),it>Xe&&(it=Xe)):it=Xe;const st=xe.length;it>st/2&&(it=st/2);let It;for(It=0;It<it;++It){const ft=parseInt(xe.substr(It*2,2),16);if(lt(ft))return It;ke[Pe+It]=ft}return It}function ye(ke,xe,Pe,it){return Ft(Be(xe,ke.length-Pe),ke,Pe,it)}function he(ke,xe,Pe,it){return Ft(We(xe),ke,Pe,it)}function K(ke,xe,Pe,it){return Ft(_t(xe),ke,Pe,it)}function B(ke,xe,Pe,it){return Ft(Ze(xe,ke.length-Pe),ke,Pe,it)}p.prototype.write=function(xe,Pe,it,Xe){if(Pe===void 0)Xe="utf8",it=this.length,Pe=0;else if(it===void 0&&typeof Pe=="string")Xe=Pe,it=this.length,Pe=0;else if(isFinite(Pe))Pe=Pe>>>0,isFinite(it)?(it=it>>>0,Xe===void 0&&(Xe="utf8")):(Xe=it,it=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const st=this.length-Pe;if((it===void 0||it>st)&&(it=st),xe.length>0&&(it<0||Pe<0)||Pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");Xe||(Xe="utf8");let It=!1;for(;;)switch(Xe){case"hex":return de(this,xe,Pe,it);case"utf8":case"utf-8":return ye(this,xe,Pe,it);case"ascii":case"latin1":case"binary":return he(this,xe,Pe,it);case"base64":return K(this,xe,Pe,it);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,xe,Pe,it);default:if(It)throw new TypeError("Unknown encoding: "+Xe);Xe=(""+Xe).toLowerCase(),It=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(ke,xe,Pe){return xe===0&&Pe===ke.length?h.fromByteArray(ke):h.fromByteArray(ke.slice(xe,Pe))}function $(ke,xe,Pe){Pe=Math.min(ke.length,Pe);const it=[];let Xe=xe;for(;Xe<Pe;){const st=ke[Xe];let It=null,ft=st>239?4:st>223?3:st>191?2:1;if(Xe+ft<=Pe){let Jt,Ot,Ct,qe;switch(ft){case 1:st<128&&(It=st);break;case 2:Jt=ke[Xe+1],(Jt&192)===128&&(qe=(st&31)<<6|Jt&63,qe>127&&(It=qe));break;case 3:Jt=ke[Xe+1],Ot=ke[Xe+2],(Jt&192)===128&&(Ot&192)===128&&(qe=(st&15)<<12|(Jt&63)<<6|Ot&63,qe>2047&&(qe<55296||qe>57343)&&(It=qe));break;case 4:Jt=ke[Xe+1],Ot=ke[Xe+2],Ct=ke[Xe+3],(Jt&192)===128&&(Ot&192)===128&&(Ct&192)===128&&(qe=(st&15)<<18|(Jt&63)<<12|(Ot&63)<<6|Ct&63,qe>65535&&qe<1114112&&(It=qe))}}It===null?(It=65533,ft=1):It>65535&&(It-=65536,it.push(It>>>10&1023|55296),It=56320|It&1023),it.push(It),Xe+=ft}return N(it)}const T=4096;function N(ke){const xe=ke.length;if(xe<=T)return String.fromCharCode.apply(String,ke);let Pe="",it=0;for(;it<xe;)Pe+=String.fromCharCode.apply(String,ke.slice(it,it+=T));return Pe}function j(ke,xe,Pe){let it="";Pe=Math.min(ke.length,Pe);for(let Xe=xe;Xe<Pe;++Xe)it+=String.fromCharCode(ke[Xe]&127);return it}function Y(ke,xe,Pe){let it="";Pe=Math.min(ke.length,Pe);for(let Xe=xe;Xe<Pe;++Xe)it+=String.fromCharCode(ke[Xe]);return it}function Z(ke,xe,Pe){const it=ke.length;(!xe||xe<0)&&(xe=0),(!Pe||Pe<0||Pe>it)&&(Pe=it);let Xe="";for(let st=xe;st<Pe;++st)Xe+=dt[ke[st]];return Xe}function z(ke,xe,Pe){const it=ke.slice(xe,Pe);let Xe="";for(let st=0;st<it.length-1;st+=2)Xe+=String.fromCharCode(it[st]+it[st+1]*256);return Xe}p.prototype.slice=function(xe,Pe){const it=this.length;xe=~~xe,Pe=Pe===void 0?it:~~Pe,xe<0?(xe+=it,xe<0&&(xe=0)):xe>it&&(xe=it),Pe<0?(Pe+=it,Pe<0&&(Pe=0)):Pe>it&&(Pe=it),Pe<xe&&(Pe=xe);const Xe=this.subarray(xe,Pe);return Object.setPrototypeOf(Xe,p.prototype),Xe};function fe(ke,xe,Pe){if(ke%1!==0||ke<0)throw new RangeError("offset is not uint");if(ke+xe>Pe)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(xe,Pe,it){xe=xe>>>0,Pe=Pe>>>0,it||fe(xe,Pe,this.length);let Xe=this[xe],st=1,It=0;for(;++It<Pe&&(st*=256);)Xe+=this[xe+It]*st;return Xe},p.prototype.readUintBE=p.prototype.readUIntBE=function(xe,Pe,it){xe=xe>>>0,Pe=Pe>>>0,it||fe(xe,Pe,this.length);let Xe=this[xe+--Pe],st=1;for(;Pe>0&&(st*=256);)Xe+=this[xe+--Pe]*st;return Xe},p.prototype.readUint8=p.prototype.readUInt8=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,1,this.length),this[xe]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,2,this.length),this[xe]|this[xe+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,2,this.length),this[xe]<<8|this[xe+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,4,this.length),(this[xe]|this[xe+1]<<8|this[xe+2]<<16)+this[xe+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,4,this.length),this[xe]*16777216+(this[xe+1]<<16|this[xe+2]<<8|this[xe+3])},p.prototype.readBigUInt64LE=tt(function(xe){xe=xe>>>0,He(xe,"offset");const Pe=this[xe],it=this[xe+7];(Pe===void 0||it===void 0)&&Ie(xe,this.length-8);const Xe=Pe+this[++xe]*2**8+this[++xe]*2**16+this[++xe]*2**24,st=this[++xe]+this[++xe]*2**8+this[++xe]*2**16+it*2**24;return BigInt(Xe)+(BigInt(st)<<BigInt(32))}),p.prototype.readBigUInt64BE=tt(function(xe){xe=xe>>>0,He(xe,"offset");const Pe=this[xe],it=this[xe+7];(Pe===void 0||it===void 0)&&Ie(xe,this.length-8);const Xe=Pe*2**24+this[++xe]*2**16+this[++xe]*2**8+this[++xe],st=this[++xe]*2**24+this[++xe]*2**16+this[++xe]*2**8+it;return(BigInt(Xe)<<BigInt(32))+BigInt(st)}),p.prototype.readIntLE=function(xe,Pe,it){xe=xe>>>0,Pe=Pe>>>0,it||fe(xe,Pe,this.length);let Xe=this[xe],st=1,It=0;for(;++It<Pe&&(st*=256);)Xe+=this[xe+It]*st;return st*=128,Xe>=st&&(Xe-=Math.pow(2,8*Pe)),Xe},p.prototype.readIntBE=function(xe,Pe,it){xe=xe>>>0,Pe=Pe>>>0,it||fe(xe,Pe,this.length);let Xe=Pe,st=1,It=this[xe+--Xe];for(;Xe>0&&(st*=256);)It+=this[xe+--Xe]*st;return st*=128,It>=st&&(It-=Math.pow(2,8*Pe)),It},p.prototype.readInt8=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,1,this.length),this[xe]&128?(255-this[xe]+1)*-1:this[xe]},p.prototype.readInt16LE=function(xe,Pe){xe=xe>>>0,Pe||fe(xe,2,this.length);const it=this[xe]|this[xe+1]<<8;return it&32768?it|4294901760:it},p.prototype.readInt16BE=function(xe,Pe){xe=xe>>>0,Pe||fe(xe,2,this.length);const it=this[xe+1]|this[xe]<<8;return it&32768?it|4294901760:it},p.prototype.readInt32LE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,4,this.length),this[xe]|this[xe+1]<<8|this[xe+2]<<16|this[xe+3]<<24},p.prototype.readInt32BE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,4,this.length),this[xe]<<24|this[xe+1]<<16|this[xe+2]<<8|this[xe+3]},p.prototype.readBigInt64LE=tt(function(xe){xe=xe>>>0,He(xe,"offset");const Pe=this[xe],it=this[xe+7];(Pe===void 0||it===void 0)&&Ie(xe,this.length-8);const Xe=this[xe+4]+this[xe+5]*2**8+this[xe+6]*2**16+(it<<24);return(BigInt(Xe)<<BigInt(32))+BigInt(Pe+this[++xe]*256+this[++xe]*65536+this[++xe]*16777216)}),p.prototype.readBigInt64BE=tt(function(xe){xe=xe>>>0,He(xe,"offset");const Pe=this[xe],it=this[xe+7];(Pe===void 0||it===void 0)&&Ie(xe,this.length-8);const Xe=(Pe<<24)+this[++xe]*2**16+this[++xe]*2**8+this[++xe];return(BigInt(Xe)<<BigInt(32))+BigInt(this[++xe]*16777216+this[++xe]*65536+this[++xe]*256+it)}),p.prototype.readFloatLE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,4,this.length),w.read(this,xe,!0,23,4)},p.prototype.readFloatBE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,4,this.length),w.read(this,xe,!1,23,4)},p.prototype.readDoubleLE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,8,this.length),w.read(this,xe,!0,52,8)},p.prototype.readDoubleBE=function(xe,Pe){return xe=xe>>>0,Pe||fe(xe,8,this.length),w.read(this,xe,!1,52,8)};function te(ke,xe,Pe,it,Xe,st){if(!p.isBuffer(ke))throw new TypeError('"buffer" argument must be a Buffer instance');if(xe>Xe||xe<st)throw new RangeError('"value" argument is out of bounds');if(Pe+it>ke.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(xe,Pe,it,Xe){if(xe=+xe,Pe=Pe>>>0,it=it>>>0,!Xe){const ft=Math.pow(2,8*it)-1;te(this,xe,Pe,it,ft,0)}let st=1,It=0;for(this[Pe]=xe&255;++It<it&&(st*=256);)this[Pe+It]=xe/st&255;return Pe+it},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(xe,Pe,it,Xe){if(xe=+xe,Pe=Pe>>>0,it=it>>>0,!Xe){const ft=Math.pow(2,8*it)-1;te(this,xe,Pe,it,ft,0)}let st=it-1,It=1;for(this[Pe+st]=xe&255;--st>=0&&(It*=256);)this[Pe+st]=xe/It&255;return Pe+it},p.prototype.writeUint8=p.prototype.writeUInt8=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,1,255,0),this[Pe]=xe&255,Pe+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,2,65535,0),this[Pe]=xe&255,this[Pe+1]=xe>>>8,Pe+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,2,65535,0),this[Pe]=xe>>>8,this[Pe+1]=xe&255,Pe+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,4,4294967295,0),this[Pe+3]=xe>>>24,this[Pe+2]=xe>>>16,this[Pe+1]=xe>>>8,this[Pe]=xe&255,Pe+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,4,4294967295,0),this[Pe]=xe>>>24,this[Pe+1]=xe>>>16,this[Pe+2]=xe>>>8,this[Pe+3]=xe&255,Pe+4};function H(ke,xe,Pe,it,Xe){Ke(xe,it,Xe,ke,Pe,7);let st=Number(xe&BigInt(4294967295));ke[Pe++]=st,st=st>>8,ke[Pe++]=st,st=st>>8,ke[Pe++]=st,st=st>>8,ke[Pe++]=st;let It=Number(xe>>BigInt(32)&BigInt(4294967295));return ke[Pe++]=It,It=It>>8,ke[Pe++]=It,It=It>>8,ke[Pe++]=It,It=It>>8,ke[Pe++]=It,Pe}function Q(ke,xe,Pe,it,Xe){Ke(xe,it,Xe,ke,Pe,7);let st=Number(xe&BigInt(4294967295));ke[Pe+7]=st,st=st>>8,ke[Pe+6]=st,st=st>>8,ke[Pe+5]=st,st=st>>8,ke[Pe+4]=st;let It=Number(xe>>BigInt(32)&BigInt(4294967295));return ke[Pe+3]=It,It=It>>8,ke[Pe+2]=It,It=It>>8,ke[Pe+1]=It,It=It>>8,ke[Pe]=It,Pe+8}p.prototype.writeBigUInt64LE=tt(function(xe,Pe=0){return H(this,xe,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=tt(function(xe,Pe=0){return Q(this,xe,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(xe,Pe,it,Xe){if(xe=+xe,Pe=Pe>>>0,!Xe){const Jt=Math.pow(2,8*it-1);te(this,xe,Pe,it,Jt-1,-Jt)}let st=0,It=1,ft=0;for(this[Pe]=xe&255;++st<it&&(It*=256);)xe<0&&ft===0&&this[Pe+st-1]!==0&&(ft=1),this[Pe+st]=(xe/It>>0)-ft&255;return Pe+it},p.prototype.writeIntBE=function(xe,Pe,it,Xe){if(xe=+xe,Pe=Pe>>>0,!Xe){const Jt=Math.pow(2,8*it-1);te(this,xe,Pe,it,Jt-1,-Jt)}let st=it-1,It=1,ft=0;for(this[Pe+st]=xe&255;--st>=0&&(It*=256);)xe<0&&ft===0&&this[Pe+st+1]!==0&&(ft=1),this[Pe+st]=(xe/It>>0)-ft&255;return Pe+it},p.prototype.writeInt8=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,1,127,-128),xe<0&&(xe=255+xe+1),this[Pe]=xe&255,Pe+1},p.prototype.writeInt16LE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,2,32767,-32768),this[Pe]=xe&255,this[Pe+1]=xe>>>8,Pe+2},p.prototype.writeInt16BE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,2,32767,-32768),this[Pe]=xe>>>8,this[Pe+1]=xe&255,Pe+2},p.prototype.writeInt32LE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,4,2147483647,-2147483648),this[Pe]=xe&255,this[Pe+1]=xe>>>8,this[Pe+2]=xe>>>16,this[Pe+3]=xe>>>24,Pe+4},p.prototype.writeInt32BE=function(xe,Pe,it){return xe=+xe,Pe=Pe>>>0,it||te(this,xe,Pe,4,2147483647,-2147483648),xe<0&&(xe=4294967295+xe+1),this[Pe]=xe>>>24,this[Pe+1]=xe>>>16,this[Pe+2]=xe>>>8,this[Pe+3]=xe&255,Pe+4},p.prototype.writeBigInt64LE=tt(function(xe,Pe=0){return H(this,xe,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=tt(function(xe,Pe=0){return Q(this,xe,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function oe(ke,xe,Pe,it,Xe,st){if(Pe+it>ke.length)throw new RangeError("Index out of range");if(Pe<0)throw new RangeError("Index out of range")}function _e(ke,xe,Pe,it,Xe){return xe=+xe,Pe=Pe>>>0,Xe||oe(ke,xe,Pe,4,34028234663852886e22,-34028234663852886e22),w.write(ke,xe,Pe,it,23,4),Pe+4}p.prototype.writeFloatLE=function(xe,Pe,it){return _e(this,xe,Pe,!0,it)},p.prototype.writeFloatBE=function(xe,Pe,it){return _e(this,xe,Pe,!1,it)};function ge(ke,xe,Pe,it,Xe){return xe=+xe,Pe=Pe>>>0,Xe||oe(ke,xe,Pe,8,17976931348623157e292,-17976931348623157e292),w.write(ke,xe,Pe,it,52,8),Pe+8}p.prototype.writeDoubleLE=function(xe,Pe,it){return ge(this,xe,Pe,!0,it)},p.prototype.writeDoubleBE=function(xe,Pe,it){return ge(this,xe,Pe,!1,it)},p.prototype.copy=function(xe,Pe,it,Xe){if(!p.isBuffer(xe))throw new TypeError("argument should be a Buffer");if(it||(it=0),!Xe&&Xe!==0&&(Xe=this.length),Pe>=xe.length&&(Pe=xe.length),Pe||(Pe=0),Xe>0&&Xe<it&&(Xe=it),Xe===it||xe.length===0||this.length===0)return 0;if(Pe<0)throw new RangeError("targetStart out of bounds");if(it<0||it>=this.length)throw new RangeError("Index out of range");if(Xe<0)throw new RangeError("sourceEnd out of bounds");Xe>this.length&&(Xe=this.length),xe.length-Pe<Xe-it&&(Xe=xe.length-Pe+it);const st=Xe-it;return this===xe&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Pe,it,Xe):Uint8Array.prototype.set.call(xe,this.subarray(it,Xe),Pe),st},p.prototype.fill=function(xe,Pe,it,Xe){if(typeof xe=="string"){if(typeof Pe=="string"?(Xe=Pe,Pe=0,it=this.length):typeof it=="string"&&(Xe=it,it=this.length),Xe!==void 0&&typeof Xe!="string")throw new TypeError("encoding must be a string");if(typeof Xe=="string"&&!p.isEncoding(Xe))throw new TypeError("Unknown encoding: "+Xe);if(xe.length===1){const It=xe.charCodeAt(0);(Xe==="utf8"&&It<128||Xe==="latin1")&&(xe=It)}}else typeof xe=="number"?xe=xe&255:typeof xe=="boolean"&&(xe=Number(xe));if(Pe<0||this.length<Pe||this.length<it)throw new RangeError("Out of range index");if(it<=Pe)return this;Pe=Pe>>>0,it=it===void 0?this.length:it>>>0,xe||(xe=0);let st;if(typeof xe=="number")for(st=Pe;st<it;++st)this[st]=xe;else{const It=p.isBuffer(xe)?xe:p.from(xe,Xe),ft=It.length;if(ft===0)throw new TypeError('The value "'+xe+'" is invalid for argument "value"');for(st=0;st<it-Pe;++st)this[st+Pe]=It[st%ft]}return this};const be={};function we(ke,xe,Pe){be[ke]=class extends Pe{constructor(){super(),Object.defineProperty(this,"message",{value:xe.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ke}]`,this.stack,delete this.name}get code(){return ke}set code(Xe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Xe,writable:!0})}toString(){return`${this.name} [${ke}]: ${this.message}`}}}we("ERR_BUFFER_OUT_OF_BOUNDS",function(ke){return ke?`${ke} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),we("ERR_INVALID_ARG_TYPE",function(ke,xe){return`The "${ke}" argument must be of type number. Received type ${typeof xe}`},TypeError),we("ERR_OUT_OF_RANGE",function(ke,xe,Pe){let it=`The value of "${ke}" is out of range.`,Xe=Pe;return Number.isInteger(Pe)&&Math.abs(Pe)>4294967296?Xe=Ee(String(Pe)):typeof Pe=="bigint"&&(Xe=String(Pe),(Pe>BigInt(2)**BigInt(32)||Pe<-(BigInt(2)**BigInt(32)))&&(Xe=Ee(Xe)),Xe+="n"),it+=` It must be ${xe}. Received ${Xe}`,it},RangeError);function Ee(ke){let xe="",Pe=ke.length;const it=ke[0]==="-"?1:0;for(;Pe>=it+4;Pe-=3)xe=`_${ke.slice(Pe-3,Pe)}${xe}`;return`${ke.slice(0,Pe)}${xe}`}function me(ke,xe,Pe){He(xe,"offset"),(ke[xe]===void 0||ke[xe+Pe]===void 0)&&Ie(xe,ke.length-(Pe+1))}function Ke(ke,xe,Pe,it,Xe,st){if(ke>Pe||ke<xe){const It=typeof xe=="bigint"?"n":"";let ft;throw st>3?xe===0||xe===BigInt(0)?ft=`>= 0${It} and < 2${It} ** ${(st+1)*8}${It}`:ft=`>= -(2${It} ** ${(st+1)*8-1}${It}) and < 2 ** ${(st+1)*8-1}${It}`:ft=`>= ${xe}${It} and <= ${Pe}${It}`,new be.ERR_OUT_OF_RANGE("value",ft,ke)}me(it,Xe,st)}function He(ke,xe){if(typeof ke!="number")throw new be.ERR_INVALID_ARG_TYPE(xe,"number",ke)}function Ie(ke,xe,Pe){throw Math.floor(ke)!==ke?(He(ke,Pe),new be.ERR_OUT_OF_RANGE(Pe||"offset","an integer",ke)):xe<0?new be.ERR_BUFFER_OUT_OF_BOUNDS:new be.ERR_OUT_OF_RANGE(Pe||"offset",`>= ${Pe?1:0} and <= ${xe}`,ke)}const Le=/[^+/0-9A-Za-z-_]/g;function Ge(ke){if(ke=ke.split("=")[0],ke=ke.trim().replace(Le,""),ke.length<2)return"";for(;ke.length%4!==0;)ke=ke+"=";return ke}function Be(ke,xe){xe=xe||1/0;let Pe;const it=ke.length;let Xe=null;const st=[];for(let It=0;It<it;++It){if(Pe=ke.charCodeAt(It),Pe>55295&&Pe<57344){if(!Xe){if(Pe>56319){(xe-=3)>-1&&st.push(239,191,189);continue}else if(It+1===it){(xe-=3)>-1&&st.push(239,191,189);continue}Xe=Pe;continue}if(Pe<56320){(xe-=3)>-1&&st.push(239,191,189),Xe=Pe;continue}Pe=(Xe-55296<<10|Pe-56320)+65536}else Xe&&(xe-=3)>-1&&st.push(239,191,189);if(Xe=null,Pe<128){if((xe-=1)<0)break;st.push(Pe)}else if(Pe<2048){if((xe-=2)<0)break;st.push(Pe>>6|192,Pe&63|128)}else if(Pe<65536){if((xe-=3)<0)break;st.push(Pe>>12|224,Pe>>6&63|128,Pe&63|128)}else if(Pe<1114112){if((xe-=4)<0)break;st.push(Pe>>18|240,Pe>>12&63|128,Pe>>6&63|128,Pe&63|128)}else throw new Error("Invalid code point")}return st}function We(ke){const xe=[];for(let Pe=0;Pe<ke.length;++Pe)xe.push(ke.charCodeAt(Pe)&255);return xe}function Ze(ke,xe){let Pe,it,Xe;const st=[];for(let It=0;It<ke.length&&!((xe-=2)<0);++It)Pe=ke.charCodeAt(It),it=Pe>>8,Xe=Pe%256,st.push(Xe),st.push(it);return st}function _t(ke){return h.toByteArray(Ge(ke))}function Ft(ke,xe,Pe,it){let Xe;for(Xe=0;Xe<it&&!(Xe+Pe>=xe.length||Xe>=ke.length);++Xe)xe[Xe+Pe]=ke[Xe];return Xe}function gt(ke,xe){return ke instanceof xe||ke!=null&&ke.constructor!=null&&ke.constructor.name!=null&&ke.constructor.name===xe.name}function lt(ke){return ke!==ke}const dt=function(){const ke="0123456789abcdef",xe=new Array(256);for(let Pe=0;Pe<16;++Pe){const it=Pe*16;for(let Xe=0;Xe<16;++Xe)xe[it+Xe]=ke[Pe]+ke[Xe]}return xe}();function tt(ke){return typeof BigInt>"u"?rt:ke}function rt(){throw new Error("BigInt not supported")}},97785:function(ie,f,_){"use strict";var h=_(79524),w=_(64811),E=_(46255),v=_(12728);ie.exports=v||h.call(E,w)},96440:function(ie,f,_){"use strict";var h=_(79524),w=_(64811),E=_(97785);ie.exports=function(){return E(h,w,arguments)}},64811:function(ie){"use strict";ie.exports=Function.prototype.apply},46255:function(ie){"use strict";ie.exports=Function.prototype.call},92427:function(ie,f,_){"use strict";var h=_(79524),w=_(71102),E=_(46255),v=_(97785);ie.exports=function(d){if(d.length<1||typeof d[0]!="function")throw new w("a function is required");return v(h,E,d)}},12728:function(ie){"use strict";ie.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply},11187:function(ie,f,_){"use strict";var h=_(49336),w=_(17695),E=w(h("String.prototype.indexOf"));ie.exports=function(c,d){var p=h(c,!!d);return typeof p=="function"&&E(c,".prototype.")>-1?w(p):p}},17695:function(ie,f,_){"use strict";var h=_(7755),w=_(39886),E=_(92427),v=_(96440);ie.exports=function(d){var p=E(arguments),m=d.length-(arguments.length-1);return h(p,1+(m>0?m:0),!0)},w?w(ie.exports,"apply",{value:v}):ie.exports.apply=v},98801:function(ie,f,_){"use strict";var h=_(49336),w=_(92427),E=w([h("%String.prototype.indexOf%")]);ie.exports=function(c,d){var p=h(c,!!d);return typeof p=="function"&&E(c,".prototype.")>-1?w([p]):p}},11036:function(ie){var f={utf8:{stringToBytes:function(_){return f.bin.stringToBytes(unescape(encodeURIComponent(_)))},bytesToString:function(_){return decodeURIComponent(escape(f.bin.bytesToString(_)))}},bin:{stringToBytes:function(_){for(var h=[],w=0;w<_.length;w++)h.push(_.charCodeAt(w)&255);return h},bytesToString:function(_){for(var h=[],w=0;w<_.length;w++)h.push(String.fromCharCode(_[w]));return h.join("")}}};ie.exports=f},65960:function(ie){(function(){var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_={rotl:function(h,w){return h<<w|h>>>32-w},rotr:function(h,w){return h<<32-w|h>>>w},endian:function(h){if(h.constructor==Number)return _.rotl(h,8)&16711935|_.rotl(h,24)&4278255360;for(var w=0;w<h.length;w++)h[w]=_.endian(h[w]);return h},randomBytes:function(h){for(var w=[];h>0;h--)w.push(Math.floor(Math.random()*256));return w},bytesToWords:function(h){for(var w=[],E=0,v=0;E<h.length;E++,v+=8)w[v>>>5]|=h[E]<<24-v%32;return w},wordsToBytes:function(h){for(var w=[],E=0;E<h.length*32;E+=8)w.push(h[E>>>5]>>>24-E%32&255);return w},bytesToHex:function(h){for(var w=[],E=0;E<h.length;E++)w.push((h[E]>>>4).toString(16)),w.push((h[E]&15).toString(16));return w.join("")},hexToBytes:function(h){for(var w=[],E=0;E<h.length;E+=2)w.push(parseInt(h.substr(E,2),16));return w},bytesToBase64:function(h){for(var w=[],E=0;E<h.length;E+=3)for(var v=h[E]<<16|h[E+1]<<8|h[E+2],c=0;c<4;c++)E*8+c*6<=h.length*8?w.push(f.charAt(v>>>6*(3-c)&63)):w.push("=");return w.join("")},base64ToBytes:function(h){h=h.replace(/[^A-Z0-9+\/]/ig,"");for(var w=[],E=0,v=0;E<h.length;v=++E%4)v!=0&&w.push((f.indexOf(h.charAt(E-1))&Math.pow(2,-2*v+8)-1)<<v*2|f.indexOf(h.charAt(E))>>>6-v*2);return w}};ie.exports=_})()},78579:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(20282),_(69636),_(54058),_(93893))})(this,function(h){return function(){var w=h,E=w.lib,v=E.BlockCipher,c=w.algo,d=[],p=[],m=[],C=[],x=[],R=[],S=[],O=[],M=[],k=[];(function(){for(var F=[],G=0;G<256;G++)G<128?F[G]=G<<1:F[G]=G<<1^283;for(var ue=0,le=0,G=0;G<256;G++){var X=le^le<<1^le<<2^le<<3^le<<4;X=X>>>8^X&255^99,d[ue]=X,p[X]=ue;var se=F[ue],de=F[se],ye=F[de],he=F[X]*257^X*16843008;m[ue]=he<<24|he>>>8,C[ue]=he<<16|he>>>16,x[ue]=he<<8|he>>>24,R[ue]=he;var he=ye*16843009^de*65537^se*257^ue*16843008;S[X]=he<<24|he>>>8,O[X]=he<<16|he>>>16,M[X]=he<<8|he>>>24,k[X]=he,ue?(ue=se^F[F[F[ye^se]]],le^=F[F[le]]):ue=le=1}})();var q=[0,1,2,4,8,16,32,64,128,27,54],b=c.AES=v.extend({_doReset:function(){for(var F=this._key,G=F.words,ue=F.sigBytes/4,le=this._nRounds=ue+6,X=(le+1)*4,se=this._keySchedule=[],de=0;de<X;de++)if(de<ue)se[de]=G[de];else{var ye=se[de-1];de%ue?ue>6&&de%ue==4&&(ye=d[ye>>>24]<<24|d[ye>>>16&255]<<16|d[ye>>>8&255]<<8|d[ye&255]):(ye=ye<<8|ye>>>24,ye=d[ye>>>24]<<24|d[ye>>>16&255]<<16|d[ye>>>8&255]<<8|d[ye&255],ye^=q[de/ue|0]<<24),se[de]=se[de-ue]^ye}for(var he=this._invKeySchedule=[],K=0;K<X;K++){var de=X-K;if(K%4)var ye=se[de];else var ye=se[de-4];K<4||de<=4?he[K]=ye:he[K]=S[d[ye>>>24]]^O[d[ye>>>16&255]]^M[d[ye>>>8&255]]^k[d[ye&255]]}},encryptBlock:function(F,G){this._doCryptBlock(F,G,this._keySchedule,m,C,x,R,d)},decryptBlock:function(F,G){var ue=F[G+1];F[G+1]=F[G+3],F[G+3]=ue,this._doCryptBlock(F,G,this._invKeySchedule,S,O,M,k,p);var ue=F[G+1];F[G+1]=F[G+3],F[G+3]=ue},_doCryptBlock:function(F,G,ue,le,X,se,de,ye){for(var he=this._nRounds,K=F[G]^ue[0],B=F[G+1]^ue[1],L=F[G+2]^ue[2],$=F[G+3]^ue[3],T=4,N=1;N<he;N++){var j=le[K>>>24]^X[B>>>16&255]^se[L>>>8&255]^de[$&255]^ue[T++],Y=le[B>>>24]^X[L>>>16&255]^se[$>>>8&255]^de[K&255]^ue[T++],Z=le[L>>>24]^X[$>>>16&255]^se[K>>>8&255]^de[B&255]^ue[T++],z=le[$>>>24]^X[K>>>16&255]^se[B>>>8&255]^de[L&255]^ue[T++];K=j,B=Y,L=Z,$=z}var j=(ye[K>>>24]<<24|ye[B>>>16&255]<<16|ye[L>>>8&255]<<8|ye[$&255])^ue[T++],Y=(ye[B>>>24]<<24|ye[L>>>16&255]<<16|ye[$>>>8&255]<<8|ye[K&255])^ue[T++],Z=(ye[L>>>24]<<24|ye[$>>>16&255]<<16|ye[K>>>8&255]<<8|ye[B&255])^ue[T++],z=(ye[$>>>24]<<24|ye[K>>>16&255]<<16|ye[B>>>8&255]<<8|ye[L&255])^ue[T++];F[G]=j,F[G+1]=Y,F[G+2]=Z,F[G+3]=z},keySize:256/32});w.AES=v._createHelper(b)}(),h.AES})},93893:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){h.lib.Cipher||function(w){var E=h,v=E.lib,c=v.Base,d=v.WordArray,p=v.BufferedBlockAlgorithm,m=E.enc,C=m.Utf8,x=m.Base64,R=E.algo,S=R.EvpKDF,O=v.Cipher=p.extend({cfg:c.extend(),createEncryptor:function(B,L){return this.create(this._ENC_XFORM_MODE,B,L)},createDecryptor:function(B,L){return this.create(this._DEC_XFORM_MODE,B,L)},init:function(B,L,$){this.cfg=this.cfg.extend($),this._xformMode=B,this._key=L,this.reset()},reset:function(){p.reset.call(this),this._doReset()},process:function(B){return this._append(B),this._process()},finalize:function(B){B&&this._append(B);var L=this._doFinalize();return L},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function B(L){return typeof L=="string"?K:de}return function(L){return{encrypt:function($,T,N){return B(T).encrypt(L,$,T,N)},decrypt:function($,T,N){return B(T).decrypt(L,$,T,N)}}}}()}),M=v.StreamCipher=O.extend({_doFinalize:function(){var B=this._process(!0);return B},blockSize:1}),k=E.mode={},q=v.BlockCipherMode=c.extend({createEncryptor:function(B,L){return this.Encryptor.create(B,L)},createDecryptor:function(B,L){return this.Decryptor.create(B,L)},init:function(B,L){this._cipher=B,this._iv=L}}),b=k.CBC=function(){var B=q.extend();B.Encryptor=B.extend({processBlock:function($,T){var N=this._cipher,j=N.blockSize;L.call(this,$,T,j),N.encryptBlock($,T),this._prevBlock=$.slice(T,T+j)}}),B.Decryptor=B.extend({processBlock:function($,T){var N=this._cipher,j=N.blockSize,Y=$.slice(T,T+j);N.decryptBlock($,T),L.call(this,$,T,j),this._prevBlock=Y}});function L($,T,N){var j=this._iv;if(j){var Y=j;this._iv=w}else var Y=this._prevBlock;for(var Z=0;Z<N;Z++)$[T+Z]^=Y[Z]}return B}(),F=E.pad={},G=F.Pkcs7={pad:function(B,L){for(var $=L*4,T=$-B.sigBytes%$,N=T<<24|T<<16|T<<8|T,j=[],Y=0;Y<T;Y+=4)j.push(N);var Z=d.create(j,T);B.concat(Z)},unpad:function(B){var L=B.words[B.sigBytes-1>>>2]&255;B.sigBytes-=L}},ue=v.BlockCipher=O.extend({cfg:O.cfg.extend({mode:b,padding:G}),reset:function(){O.reset.call(this);var B=this.cfg,L=B.iv,$=B.mode;if(this._xformMode==this._ENC_XFORM_MODE)var T=$.createEncryptor;else{var T=$.createDecryptor;this._minBufferSize=1}this._mode=T.call($,this,L&&L.words)},_doProcessBlock:function(B,L){this._mode.processBlock(B,L)},_doFinalize:function(){var B=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){B.pad(this._data,this.blockSize);var L=this._process(!0)}else{var L=this._process(!0);B.unpad(L)}return L},blockSize:128/32}),le=v.CipherParams=c.extend({init:function(B){this.mixIn(B)},toString:function(B){return(B||this.formatter).stringify(this)}}),X=E.format={},se=X.OpenSSL={stringify:function(B){var L=B.ciphertext,$=B.salt;if($)var T=d.create([1398893684,1701076831]).concat($).concat(L);else var T=L;return T.toString(x)},parse:function(B){var L=x.parse(B),$=L.words;if($[0]==1398893684&&$[1]==1701076831){var T=d.create($.slice(2,4));$.splice(0,4),L.sigBytes-=16}return le.create({ciphertext:L,salt:T})}},de=v.SerializableCipher=c.extend({cfg:c.extend({format:se}),encrypt:function(B,L,$,T){T=this.cfg.extend(T);var N=B.createEncryptor($,T),j=N.finalize(L),Y=N.cfg;return le.create({ciphertext:j,key:$,iv:Y.iv,algorithm:B,mode:Y.mode,padding:Y.padding,blockSize:B.blockSize,formatter:T.format})},decrypt:function(B,L,$,T){T=this.cfg.extend(T),L=this._parse(L,T.format);var N=B.createDecryptor($,T).finalize(L.ciphertext);return N},_parse:function(B,L){return typeof B=="string"?L.parse(B,this):B}}),ye=E.kdf={},he=ye.OpenSSL={execute:function(B,L,$,T){T||(T=d.random(64/8));var N=S.create({keySize:L+$}).compute(B,T),j=d.create(N.words.slice(L),$*4);return N.sigBytes=L*4,le.create({key:N,iv:j,salt:T})}},K=v.PasswordBasedCipher=de.extend({cfg:de.cfg.extend({kdf:he}),encrypt:function(B,L,$,T){T=this.cfg.extend(T);var N=T.kdf.execute($,B.keySize,B.ivSize);T.iv=N.iv;var j=de.encrypt.call(this,B,L,N.key,T);return j.mixIn(N),j},decrypt:function(B,L,$,T){T=this.cfg.extend(T),L=this._parse(L,T.format);var N=T.kdf.execute($,B.keySize,B.ivSize,L.salt);T.iv=N.iv;var j=de.decrypt.call(this,B,L,N.key,T);return j}})}()})},64901:function(ie,f){(function(_,h){ie.exports=f=h()})(this,function(){var _=_||function(h,w){var E={},v=E.lib={},c=v.Base=function(){function M(){}return{extend:function(k){M.prototype=this;var q=new M;return k&&q.mixIn(k),q.hasOwnProperty("init")||(q.init=function(){q.$super.init.apply(this,arguments)}),q.init.prototype=q,q.$super=this,q},create:function(){var k=this.extend();return k.init.apply(k,arguments),k},init:function(){},mixIn:function(k){for(var q in k)k.hasOwnProperty(q)&&(this[q]=k[q]);k.hasOwnProperty("toString")&&(this.toString=k.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=v.WordArray=c.extend({init:function(M,k){M=this.words=M||[],k!=w?this.sigBytes=k:this.sigBytes=M.length*4},toString:function(M){return(M||m).stringify(this)},concat:function(M){var k=this.words,q=M.words,b=this.sigBytes,F=M.sigBytes;if(this.clamp(),b%4)for(var G=0;G<F;G++){var ue=q[G>>>2]>>>24-G%4*8&255;k[b+G>>>2]|=ue<<24-(b+G)%4*8}else for(var G=0;G<F;G+=4)k[b+G>>>2]=q[G>>>2];return this.sigBytes+=F,this},clamp:function(){var M=this.words,k=this.sigBytes;M[k>>>2]&=4294967295<<32-k%4*8,M.length=h.ceil(k/4)},clone:function(){var M=c.clone.call(this);return M.words=this.words.slice(0),M},random:function(M){for(var k=[],q=function(le){var le=le,X=987654321,se=4294967295;return function(){X=36969*(X&65535)+(X>>16)&se,le=18e3*(le&65535)+(le>>16)&se;var de=(X<<16)+le&se;return de/=4294967296,de+=.5,de*(h.random()>.5?1:-1)}},b=0,F;b<M;b+=4){var G=q((F||h.random())*4294967296);F=G()*987654071,k.push(G()*4294967296|0)}return new d.init(k,M)}}),p=E.enc={},m=p.Hex={stringify:function(M){for(var k=M.words,q=M.sigBytes,b=[],F=0;F<q;F++){var G=k[F>>>2]>>>24-F%4*8&255;b.push((G>>>4).toString(16)),b.push((G&15).toString(16))}return b.join("")},parse:function(M){for(var k=M.length,q=[],b=0;b<k;b+=2)q[b>>>3]|=parseInt(M.substr(b,2),16)<<24-b%8*4;return new d.init(q,k/2)}},C=p.Latin1={stringify:function(M){for(var k=M.words,q=M.sigBytes,b=[],F=0;F<q;F++){var G=k[F>>>2]>>>24-F%4*8&255;b.push(String.fromCharCode(G))}return b.join("")},parse:function(M){for(var k=M.length,q=[],b=0;b<k;b++)q[b>>>2]|=(M.charCodeAt(b)&255)<<24-b%4*8;return new d.init(q,k)}},x=p.Utf8={stringify:function(M){try{return decodeURIComponent(escape(C.stringify(M)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(M){return C.parse(unescape(encodeURIComponent(M)))}},R=v.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(M){typeof M=="string"&&(M=x.parse(M)),this._data.concat(M),this._nDataBytes+=M.sigBytes},_process:function(M){var k=this._data,q=k.words,b=k.sigBytes,F=this.blockSize,G=F*4,ue=b/G;M?ue=h.ceil(ue):ue=h.max((ue|0)-this._minBufferSize,0);var le=ue*F,X=h.min(le*4,b);if(le){for(var se=0;se<le;se+=F)this._doProcessBlock(q,se);var de=q.splice(0,le);k.sigBytes-=X}return new d.init(de,X)},clone:function(){var M=c.clone.call(this);return M._data=this._data.clone(),M},_minBufferSize:0}),S=v.Hasher=R.extend({cfg:c.extend(),init:function(M){this.cfg=this.cfg.extend(M),this.reset()},reset:function(){R.reset.call(this),this._doReset()},update:function(M){return this._append(M),this._process(),this},finalize:function(M){M&&this._append(M);var k=this._doFinalize();return k},blockSize:512/32,_createHelper:function(M){return function(k,q){return new M.init(q).finalize(k)}},_createHmacHelper:function(M){return function(k,q){return new O.HMAC.init(M,q).finalize(k)}}}),O=E.algo={};return E}(Math);return _})},20282:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){return function(){var w=h,E=w.lib,v=E.WordArray,c=w.enc,d=c.Base64={stringify:function(p){var m=p.words,C=p.sigBytes,x=this._map;p.clamp();for(var R=[],S=0;S<C;S+=3)for(var O=m[S>>>2]>>>24-S%4*8&255,M=m[S+1>>>2]>>>24-(S+1)%4*8&255,k=m[S+2>>>2]>>>24-(S+2)%4*8&255,q=O<<16|M<<8|k,b=0;b<4&&S+b*.75<C;b++)R.push(x.charAt(q>>>6*(3-b)&63));var F=x.charAt(64);if(F)for(;R.length%4;)R.push(F);return R.join("")},parse:function(p){var m=p.length,C=this._map,x=C.charAt(64);if(x){var R=p.indexOf(x);R!=-1&&(m=R)}for(var S=[],O=0,M=0;M<m;M++)if(M%4){var k=C.indexOf(p.charAt(M-1))<<M%4*2,q=C.indexOf(p.charAt(M))>>>6-M%4*2,b=k|q;S[O>>>2]|=b<<24-O%4*8,O++}return v.create(S,O)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),h.enc.Base64})},58903:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){return function(){var w=h,E=w.lib,v=E.WordArray,c=w.enc,d=c.Utf16=c.Utf16BE={stringify:function(m){for(var C=m.words,x=m.sigBytes,R=[],S=0;S<x;S+=2){var O=C[S>>>2]>>>16-S%4*8&65535;R.push(String.fromCharCode(O))}return R.join("")},parse:function(m){for(var C=m.length,x=[],R=0;R<C;R++)x[R>>>1]|=m.charCodeAt(R)<<16-R%2*16;return v.create(x,C*2)}};c.Utf16LE={stringify:function(m){for(var C=m.words,x=m.sigBytes,R=[],S=0;S<x;S+=2){var O=p(C[S>>>2]>>>16-S%4*8&65535);R.push(String.fromCharCode(O))}return R.join("")},parse:function(m){for(var C=m.length,x=[],R=0;R<C;R++)x[R>>>1]|=p(m.charCodeAt(R)<<16-R%2*16);return v.create(x,C*2)}};function p(m){return m<<8&4278255360|m>>>8&16711935}}(),h.enc.Utf16})},54058:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(6167),_(42809))})(this,function(h){return function(){var w=h,E=w.lib,v=E.Base,c=E.WordArray,d=w.algo,p=d.MD5,m=d.EvpKDF=v.extend({cfg:v.extend({keySize:128/32,hasher:p,iterations:1}),init:function(C){this.cfg=this.cfg.extend(C)},compute:function(C,x){for(var R=this.cfg,S=R.hasher.create(),O=c.create(),M=O.words,k=R.keySize,q=R.iterations;M.length<k;){b&&S.update(b);var b=S.update(C).finalize(x);S.reset();for(var F=1;F<q;F++)b=S.finalize(b),S.reset();O.concat(b)}return O.sigBytes=k*4,O}});w.EvpKDF=function(C,x,R){return m.create(R).compute(C,x)}}(),h.EvpKDF})},62785:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return function(w){var E=h,v=E.lib,c=v.CipherParams,d=E.enc,p=d.Hex,m=E.format,C=m.Hex={stringify:function(x){return x.ciphertext.toString(p)},parse:function(x){var R=p.parse(x);return c.create({ciphertext:R})}}}(),h.format.Hex})},42809:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){(function(){var w=h,E=w.lib,v=E.Base,c=w.enc,d=c.Utf8,p=w.algo,m=p.HMAC=v.extend({init:function(C,x){C=this._hasher=new C.init,typeof x=="string"&&(x=d.parse(x));var R=C.blockSize,S=R*4;x.sigBytes>S&&(x=C.finalize(x)),x.clamp();for(var O=this._oKey=x.clone(),M=this._iKey=x.clone(),k=O.words,q=M.words,b=0;b<R;b++)k[b]^=1549556828,q[b]^=909522486;O.sigBytes=M.sigBytes=S,this.reset()},reset:function(){var C=this._hasher;C.reset(),C.update(this._iKey)},update:function(C){return this._hasher.update(C),this},finalize:function(C){var x=this._hasher,R=x.finalize(C);x.reset();var S=x.finalize(this._oKey.clone().concat(R));return S}})})()})},90620:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(69728),_(17072),_(58903),_(20282),_(69636),_(6167),_(62521),_(90860),_(71900),_(41597),_(36729),_(44480),_(42809),_(84891),_(54058),_(93893),_(67697),_(34883),_(49500),_(78893),_(5870),_(28145),_(75217),_(39786),_(56291),_(74036),_(62785),_(78579),_(49796),_(40897),_(26562),_(75488))})(this,function(h){return h})},17072:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){return function(){if(typeof ArrayBuffer=="function"){var w=h,E=w.lib,v=E.WordArray,c=v.init,d=v.init=function(p){if(p instanceof ArrayBuffer&&(p=new Uint8Array(p)),(p instanceof Int8Array||typeof Uint8ClampedArray<"u"&&p instanceof Uint8ClampedArray||p instanceof Int16Array||p instanceof Uint16Array||p instanceof Int32Array||p instanceof Uint32Array||p instanceof Float32Array||p instanceof Float64Array)&&(p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength)),p instanceof Uint8Array){for(var m=p.byteLength,C=[],x=0;x<m;x++)C[x>>>2]|=p[x]<<24-x%4*8;c.call(this,C,m)}else c.apply(this,arguments)};d.prototype=v}}(),h.lib.WordArray})},69636:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){return function(w){var E=h,v=E.lib,c=v.WordArray,d=v.Hasher,p=E.algo,m=[];(function(){for(var M=0;M<64;M++)m[M]=w.abs(w.sin(M+1))*4294967296|0})();var C=p.MD5=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(M,k){for(var q=0;q<16;q++){var b=k+q,F=M[b];M[b]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360}var G=this._hash.words,ue=M[k+0],le=M[k+1],X=M[k+2],se=M[k+3],de=M[k+4],ye=M[k+5],he=M[k+6],K=M[k+7],B=M[k+8],L=M[k+9],$=M[k+10],T=M[k+11],N=M[k+12],j=M[k+13],Y=M[k+14],Z=M[k+15],z=G[0],fe=G[1],te=G[2],H=G[3];z=x(z,fe,te,H,ue,7,m[0]),H=x(H,z,fe,te,le,12,m[1]),te=x(te,H,z,fe,X,17,m[2]),fe=x(fe,te,H,z,se,22,m[3]),z=x(z,fe,te,H,de,7,m[4]),H=x(H,z,fe,te,ye,12,m[5]),te=x(te,H,z,fe,he,17,m[6]),fe=x(fe,te,H,z,K,22,m[7]),z=x(z,fe,te,H,B,7,m[8]),H=x(H,z,fe,te,L,12,m[9]),te=x(te,H,z,fe,$,17,m[10]),fe=x(fe,te,H,z,T,22,m[11]),z=x(z,fe,te,H,N,7,m[12]),H=x(H,z,fe,te,j,12,m[13]),te=x(te,H,z,fe,Y,17,m[14]),fe=x(fe,te,H,z,Z,22,m[15]),z=R(z,fe,te,H,le,5,m[16]),H=R(H,z,fe,te,he,9,m[17]),te=R(te,H,z,fe,T,14,m[18]),fe=R(fe,te,H,z,ue,20,m[19]),z=R(z,fe,te,H,ye,5,m[20]),H=R(H,z,fe,te,$,9,m[21]),te=R(te,H,z,fe,Z,14,m[22]),fe=R(fe,te,H,z,de,20,m[23]),z=R(z,fe,te,H,L,5,m[24]),H=R(H,z,fe,te,Y,9,m[25]),te=R(te,H,z,fe,se,14,m[26]),fe=R(fe,te,H,z,B,20,m[27]),z=R(z,fe,te,H,j,5,m[28]),H=R(H,z,fe,te,X,9,m[29]),te=R(te,H,z,fe,K,14,m[30]),fe=R(fe,te,H,z,N,20,m[31]),z=S(z,fe,te,H,ye,4,m[32]),H=S(H,z,fe,te,B,11,m[33]),te=S(te,H,z,fe,T,16,m[34]),fe=S(fe,te,H,z,Y,23,m[35]),z=S(z,fe,te,H,le,4,m[36]),H=S(H,z,fe,te,de,11,m[37]),te=S(te,H,z,fe,K,16,m[38]),fe=S(fe,te,H,z,$,23,m[39]),z=S(z,fe,te,H,j,4,m[40]),H=S(H,z,fe,te,ue,11,m[41]),te=S(te,H,z,fe,se,16,m[42]),fe=S(fe,te,H,z,he,23,m[43]),z=S(z,fe,te,H,L,4,m[44]),H=S(H,z,fe,te,N,11,m[45]),te=S(te,H,z,fe,Z,16,m[46]),fe=S(fe,te,H,z,X,23,m[47]),z=O(z,fe,te,H,ue,6,m[48]),H=O(H,z,fe,te,K,10,m[49]),te=O(te,H,z,fe,Y,15,m[50]),fe=O(fe,te,H,z,ye,21,m[51]),z=O(z,fe,te,H,N,6,m[52]),H=O(H,z,fe,te,se,10,m[53]),te=O(te,H,z,fe,$,15,m[54]),fe=O(fe,te,H,z,le,21,m[55]),z=O(z,fe,te,H,B,6,m[56]),H=O(H,z,fe,te,Z,10,m[57]),te=O(te,H,z,fe,he,15,m[58]),fe=O(fe,te,H,z,j,21,m[59]),z=O(z,fe,te,H,de,6,m[60]),H=O(H,z,fe,te,T,10,m[61]),te=O(te,H,z,fe,X,15,m[62]),fe=O(fe,te,H,z,L,21,m[63]),G[0]=G[0]+z|0,G[1]=G[1]+fe|0,G[2]=G[2]+te|0,G[3]=G[3]+H|0},_doFinalize:function(){var M=this._data,k=M.words,q=this._nDataBytes*8,b=M.sigBytes*8;k[b>>>5]|=128<<24-b%32;var F=w.floor(q/4294967296),G=q;k[(b+64>>>9<<4)+15]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,k[(b+64>>>9<<4)+14]=(G<<8|G>>>24)&16711935|(G<<24|G>>>8)&4278255360,M.sigBytes=(k.length+1)*4,this._process();for(var ue=this._hash,le=ue.words,X=0;X<4;X++){var se=le[X];le[X]=(se<<8|se>>>24)&16711935|(se<<24|se>>>8)&4278255360}return ue},clone:function(){var M=d.clone.call(this);return M._hash=this._hash.clone(),M}});function x(M,k,q,b,F,G,ue){var le=M+(k&q|~k&b)+F+ue;return(le<<G|le>>>32-G)+k}function R(M,k,q,b,F,G,ue){var le=M+(k&b|q&~b)+F+ue;return(le<<G|le>>>32-G)+k}function S(M,k,q,b,F,G,ue){var le=M+(k^q^b)+F+ue;return(le<<G|le>>>32-G)+k}function O(M,k,q,b,F,G,ue){var le=M+(q^(k|~b))+F+ue;return(le<<G|le>>>32-G)+k}E.MD5=d._createHelper(C),E.HmacMD5=d._createHmacHelper(C)}(Math),h.MD5})},67697:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.mode.CFB=function(){var w=h.lib.BlockCipherMode.extend();w.Encryptor=w.extend({processBlock:function(v,c){var d=this._cipher,p=d.blockSize;E.call(this,v,c,p,d),this._prevBlock=v.slice(c,c+p)}}),w.Decryptor=w.extend({processBlock:function(v,c){var d=this._cipher,p=d.blockSize,m=v.slice(c,c+p);E.call(this,v,c,p,d),this._prevBlock=m}});function E(v,c,d,p){var m=this._iv;if(m){var C=m.slice(0);this._iv=void 0}else var C=this._prevBlock;p.encryptBlock(C,0);for(var x=0;x<d;x++)v[c+x]^=C[x]}return w}(),h.mode.CFB})},49500:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){/** @preserve
|
||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||
* derived from CryptoJS.mode.CTR
|
||
* Jan Hruby jhruby.web@gmail.com
|
||
*/return h.mode.CTRGladman=function(){var w=h.lib.BlockCipherMode.extend();function E(d){if((d>>24&255)===255){var p=d>>16&255,m=d>>8&255,C=d&255;p===255?(p=0,m===255?(m=0,C===255?C=0:++C):++m):++p,d=0,d+=p<<16,d+=m<<8,d+=C}else d+=16777216;return d}function v(d){return(d[0]=E(d[0]))===0&&(d[1]=E(d[1])),d}var c=w.Encryptor=w.extend({processBlock:function(d,p){var m=this._cipher,C=m.blockSize,x=this._iv,R=this._counter;x&&(R=this._counter=x.slice(0),this._iv=void 0),v(R);var S=R.slice(0);m.encryptBlock(S,0);for(var O=0;O<C;O++)d[p+O]^=S[O]}});return w.Decryptor=c,w}(),h.mode.CTRGladman})},34883:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.mode.CTR=function(){var w=h.lib.BlockCipherMode.extend(),E=w.Encryptor=w.extend({processBlock:function(v,c){var d=this._cipher,p=d.blockSize,m=this._iv,C=this._counter;m&&(C=this._counter=m.slice(0),this._iv=void 0);var x=C.slice(0);d.encryptBlock(x,0),C[p-1]=C[p-1]+1|0;for(var R=0;R<p;R++)v[c+R]^=x[R]}});return w.Decryptor=E,w}(),h.mode.CTR})},5870:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.mode.ECB=function(){var w=h.lib.BlockCipherMode.extend();return w.Encryptor=w.extend({processBlock:function(E,v){this._cipher.encryptBlock(E,v)}}),w.Decryptor=w.extend({processBlock:function(E,v){this._cipher.decryptBlock(E,v)}}),w}(),h.mode.ECB})},78893:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.mode.OFB=function(){var w=h.lib.BlockCipherMode.extend(),E=w.Encryptor=w.extend({processBlock:function(v,c){var d=this._cipher,p=d.blockSize,m=this._iv,C=this._keystream;m&&(C=this._keystream=m.slice(0),this._iv=void 0),d.encryptBlock(C,0);for(var x=0;x<p;x++)v[c+x]^=C[x]}});return w.Decryptor=E,w}(),h.mode.OFB})},28145:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.pad.AnsiX923={pad:function(w,E){var v=w.sigBytes,c=E*4,d=c-v%c,p=v+d-1;w.clamp(),w.words[p>>>2]|=d<<24-p%4*8,w.sigBytes+=d},unpad:function(w){var E=w.words[w.sigBytes-1>>>2]&255;w.sigBytes-=E}},h.pad.Ansix923})},75217:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.pad.Iso10126={pad:function(w,E){var v=E*4,c=v-w.sigBytes%v;w.concat(h.lib.WordArray.random(c-1)).concat(h.lib.WordArray.create([c<<24],1))},unpad:function(w){var E=w.words[w.sigBytes-1>>>2]&255;w.sigBytes-=E}},h.pad.Iso10126})},39786:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.pad.Iso97971={pad:function(w,E){w.concat(h.lib.WordArray.create([2147483648],1)),h.pad.ZeroPadding.pad(w,E)},unpad:function(w){h.pad.ZeroPadding.unpad(w),w.sigBytes--}},h.pad.Iso97971})},74036:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.pad.NoPadding={pad:function(){},unpad:function(){}},h.pad.NoPadding})},56291:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(93893))})(this,function(h){return h.pad.ZeroPadding={pad:function(w,E){var v=E*4;w.clamp(),w.sigBytes+=v-(w.sigBytes%v||v)},unpad:function(w){for(var E=w.words,v=w.sigBytes-1;!(E[v>>>2]>>>24-v%4*8&255);)v--;w.sigBytes=v+1}},h.pad.ZeroPadding})},84891:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(6167),_(42809))})(this,function(h){return function(){var w=h,E=w.lib,v=E.Base,c=E.WordArray,d=w.algo,p=d.SHA1,m=d.HMAC,C=d.PBKDF2=v.extend({cfg:v.extend({keySize:128/32,hasher:p,iterations:1}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,R){for(var S=this.cfg,O=m.create(S.hasher,x),M=c.create(),k=c.create([1]),q=M.words,b=k.words,F=S.keySize,G=S.iterations;q.length<F;){var ue=O.update(R).finalize(k);O.reset();for(var le=ue.words,X=le.length,se=ue,de=1;de<G;de++){se=O.finalize(se),O.reset();for(var ye=se.words,he=0;he<X;he++)le[he]^=ye[he]}M.concat(ue),b[0]++}return M.sigBytes=F*4,M}});w.PBKDF2=function(x,R,S){return C.create(S).compute(x,R)}}(),h.PBKDF2})},75488:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(20282),_(69636),_(54058),_(93893))})(this,function(h){return function(){var w=h,E=w.lib,v=E.StreamCipher,c=w.algo,d=[],p=[],m=[],C=c.RabbitLegacy=v.extend({_doReset:function(){var R=this._key.words,S=this.cfg.iv,O=this._X=[R[0],R[3]<<16|R[2]>>>16,R[1],R[0]<<16|R[3]>>>16,R[2],R[1]<<16|R[0]>>>16,R[3],R[2]<<16|R[1]>>>16],M=this._C=[R[2]<<16|R[2]>>>16,R[0]&4294901760|R[1]&65535,R[3]<<16|R[3]>>>16,R[1]&4294901760|R[2]&65535,R[0]<<16|R[0]>>>16,R[2]&4294901760|R[3]&65535,R[1]<<16|R[1]>>>16,R[3]&4294901760|R[0]&65535];this._b=0;for(var k=0;k<4;k++)x.call(this);for(var k=0;k<8;k++)M[k]^=O[k+4&7];if(S){var q=S.words,b=q[0],F=q[1],G=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,ue=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,le=G>>>16|ue&4294901760,X=ue<<16|G&65535;M[0]^=G,M[1]^=le,M[2]^=ue,M[3]^=X,M[4]^=G,M[5]^=le,M[6]^=ue,M[7]^=X;for(var k=0;k<4;k++)x.call(this)}},_doProcessBlock:function(R,S){var O=this._X;x.call(this),d[0]=O[0]^O[5]>>>16^O[3]<<16,d[1]=O[2]^O[7]>>>16^O[5]<<16,d[2]=O[4]^O[1]>>>16^O[7]<<16,d[3]=O[6]^O[3]>>>16^O[1]<<16;for(var M=0;M<4;M++)d[M]=(d[M]<<8|d[M]>>>24)&16711935|(d[M]<<24|d[M]>>>8)&4278255360,R[S+M]^=d[M]},blockSize:128/32,ivSize:64/32});function x(){for(var R=this._X,S=this._C,O=0;O<8;O++)p[O]=S[O];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0<p[0]>>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0<p[1]>>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0<p[2]>>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0<p[3]>>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0<p[4]>>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0<p[5]>>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0<p[6]>>>0?1:0)|0,this._b=S[7]>>>0<p[7]>>>0?1:0;for(var O=0;O<8;O++){var M=R[O]+S[O],k=M&65535,q=M>>>16,b=((k*k>>>17)+k*q>>>15)+q*q,F=((M&4294901760)*M|0)+((M&65535)*M|0);m[O]=b^F}R[0]=m[0]+(m[7]<<16|m[7]>>>16)+(m[6]<<16|m[6]>>>16)|0,R[1]=m[1]+(m[0]<<8|m[0]>>>24)+m[7]|0,R[2]=m[2]+(m[1]<<16|m[1]>>>16)+(m[0]<<16|m[0]>>>16)|0,R[3]=m[3]+(m[2]<<8|m[2]>>>24)+m[1]|0,R[4]=m[4]+(m[3]<<16|m[3]>>>16)+(m[2]<<16|m[2]>>>16)|0,R[5]=m[5]+(m[4]<<8|m[4]>>>24)+m[3]|0,R[6]=m[6]+(m[5]<<16|m[5]>>>16)+(m[4]<<16|m[4]>>>16)|0,R[7]=m[7]+(m[6]<<8|m[6]>>>24)+m[5]|0}w.RabbitLegacy=v._createHelper(C)}(),h.RabbitLegacy})},26562:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(20282),_(69636),_(54058),_(93893))})(this,function(h){return function(){var w=h,E=w.lib,v=E.StreamCipher,c=w.algo,d=[],p=[],m=[],C=c.Rabbit=v.extend({_doReset:function(){for(var R=this._key.words,S=this.cfg.iv,O=0;O<4;O++)R[O]=(R[O]<<8|R[O]>>>24)&16711935|(R[O]<<24|R[O]>>>8)&4278255360;var M=this._X=[R[0],R[3]<<16|R[2]>>>16,R[1],R[0]<<16|R[3]>>>16,R[2],R[1]<<16|R[0]>>>16,R[3],R[2]<<16|R[1]>>>16],k=this._C=[R[2]<<16|R[2]>>>16,R[0]&4294901760|R[1]&65535,R[3]<<16|R[3]>>>16,R[1]&4294901760|R[2]&65535,R[0]<<16|R[0]>>>16,R[2]&4294901760|R[3]&65535,R[1]<<16|R[1]>>>16,R[3]&4294901760|R[0]&65535];this._b=0;for(var O=0;O<4;O++)x.call(this);for(var O=0;O<8;O++)k[O]^=M[O+4&7];if(S){var q=S.words,b=q[0],F=q[1],G=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,ue=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,le=G>>>16|ue&4294901760,X=ue<<16|G&65535;k[0]^=G,k[1]^=le,k[2]^=ue,k[3]^=X,k[4]^=G,k[5]^=le,k[6]^=ue,k[7]^=X;for(var O=0;O<4;O++)x.call(this)}},_doProcessBlock:function(R,S){var O=this._X;x.call(this),d[0]=O[0]^O[5]>>>16^O[3]<<16,d[1]=O[2]^O[7]>>>16^O[5]<<16,d[2]=O[4]^O[1]>>>16^O[7]<<16,d[3]=O[6]^O[3]>>>16^O[1]<<16;for(var M=0;M<4;M++)d[M]=(d[M]<<8|d[M]>>>24)&16711935|(d[M]<<24|d[M]>>>8)&4278255360,R[S+M]^=d[M]},blockSize:128/32,ivSize:64/32});function x(){for(var R=this._X,S=this._C,O=0;O<8;O++)p[O]=S[O];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0<p[0]>>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0<p[1]>>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0<p[2]>>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0<p[3]>>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0<p[4]>>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0<p[5]>>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0<p[6]>>>0?1:0)|0,this._b=S[7]>>>0<p[7]>>>0?1:0;for(var O=0;O<8;O++){var M=R[O]+S[O],k=M&65535,q=M>>>16,b=((k*k>>>17)+k*q>>>15)+q*q,F=((M&4294901760)*M|0)+((M&65535)*M|0);m[O]=b^F}R[0]=m[0]+(m[7]<<16|m[7]>>>16)+(m[6]<<16|m[6]>>>16)|0,R[1]=m[1]+(m[0]<<8|m[0]>>>24)+m[7]|0,R[2]=m[2]+(m[1]<<16|m[1]>>>16)+(m[0]<<16|m[0]>>>16)|0,R[3]=m[3]+(m[2]<<8|m[2]>>>24)+m[1]|0,R[4]=m[4]+(m[3]<<16|m[3]>>>16)+(m[2]<<16|m[2]>>>16)|0,R[5]=m[5]+(m[4]<<8|m[4]>>>24)+m[3]|0,R[6]=m[6]+(m[5]<<16|m[5]>>>16)+(m[4]<<16|m[4]>>>16)|0,R[7]=m[7]+(m[6]<<8|m[6]>>>24)+m[5]|0}w.Rabbit=v._createHelper(C)}(),h.Rabbit})},40897:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(20282),_(69636),_(54058),_(93893))})(this,function(h){return function(){var w=h,E=w.lib,v=E.StreamCipher,c=w.algo,d=c.RC4=v.extend({_doReset:function(){for(var C=this._key,x=C.words,R=C.sigBytes,S=this._S=[],O=0;O<256;O++)S[O]=O;for(var O=0,M=0;O<256;O++){var k=O%R,q=x[k>>>2]>>>24-k%4*8&255;M=(M+S[O]+q)%256;var b=S[O];S[O]=S[M],S[M]=b}this._i=this._j=0},_doProcessBlock:function(C,x){C[x]^=p.call(this)},keySize:256/32,ivSize:0});function p(){for(var C=this._S,x=this._i,R=this._j,S=0,O=0;O<4;O++){x=(x+1)%256,R=(R+C[x])%256;var M=C[x];C[x]=C[R],C[R]=M,S|=C[(C[x]+C[R])%256]<<24-O*8}return this._i=x,this._j=R,S}w.RC4=v._createHelper(d);var m=c.RC4Drop=d.extend({cfg:d.cfg.extend({drop:192}),_doReset:function(){d._doReset.call(this);for(var C=this.cfg.drop;C>0;C--)p.call(this)}});w.RC4Drop=v._createHelper(m)}(),h.RC4})},44480:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){/** @preserve
|
||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||
|
||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/return function(w){var E=h,v=E.lib,c=v.WordArray,d=v.Hasher,p=E.algo,m=c.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),C=c.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),x=c.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),R=c.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),S=c.create([0,1518500249,1859775393,2400959708,2840853838]),O=c.create([1352829926,1548603684,1836072691,2053994217,0]),M=p.RIPEMD160=d.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(le,X){for(var se=0;se<16;se++){var de=X+se,ye=le[de];le[de]=(ye<<8|ye>>>24)&16711935|(ye<<24|ye>>>8)&4278255360}var he=this._hash.words,K=S.words,B=O.words,L=m.words,$=C.words,T=x.words,N=R.words,j,Y,Z,z,fe,te,H,Q,oe,_e;te=j=he[0],H=Y=he[1],Q=Z=he[2],oe=z=he[3],_e=fe=he[4];for(var ge,se=0;se<80;se+=1)ge=j+le[X+L[se]]|0,se<16?ge+=k(Y,Z,z)+K[0]:se<32?ge+=q(Y,Z,z)+K[1]:se<48?ge+=b(Y,Z,z)+K[2]:se<64?ge+=F(Y,Z,z)+K[3]:ge+=G(Y,Z,z)+K[4],ge=ge|0,ge=ue(ge,T[se]),ge=ge+fe|0,j=fe,fe=z,z=ue(Z,10),Z=Y,Y=ge,ge=te+le[X+$[se]]|0,se<16?ge+=G(H,Q,oe)+B[0]:se<32?ge+=F(H,Q,oe)+B[1]:se<48?ge+=b(H,Q,oe)+B[2]:se<64?ge+=q(H,Q,oe)+B[3]:ge+=k(H,Q,oe)+B[4],ge=ge|0,ge=ue(ge,N[se]),ge=ge+_e|0,te=_e,_e=oe,oe=ue(Q,10),Q=H,H=ge;ge=he[1]+Z+oe|0,he[1]=he[2]+z+_e|0,he[2]=he[3]+fe+te|0,he[3]=he[4]+j+H|0,he[4]=he[0]+Y+Q|0,he[0]=ge},_doFinalize:function(){var le=this._data,X=le.words,se=this._nDataBytes*8,de=le.sigBytes*8;X[de>>>5]|=128<<24-de%32,X[(de+64>>>9<<4)+14]=(se<<8|se>>>24)&16711935|(se<<24|se>>>8)&4278255360,le.sigBytes=(X.length+1)*4,this._process();for(var ye=this._hash,he=ye.words,K=0;K<5;K++){var B=he[K];he[K]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360}return ye},clone:function(){var le=d.clone.call(this);return le._hash=this._hash.clone(),le}});function k(le,X,se){return le^X^se}function q(le,X,se){return le&X|~le&se}function b(le,X,se){return(le|~X)^se}function F(le,X,se){return le&se|X&~se}function G(le,X,se){return le^(X|~se)}function ue(le,X){return le<<X|le>>>32-X}E.RIPEMD160=d._createHelper(M),E.HmacRIPEMD160=d._createHmacHelper(M)}(Math),h.RIPEMD160})},6167:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){return function(){var w=h,E=w.lib,v=E.WordArray,c=E.Hasher,d=w.algo,p=[],m=d.SHA1=c.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(C,x){for(var R=this._hash.words,S=R[0],O=R[1],M=R[2],k=R[3],q=R[4],b=0;b<80;b++){if(b<16)p[b]=C[x+b]|0;else{var F=p[b-3]^p[b-8]^p[b-14]^p[b-16];p[b]=F<<1|F>>>31}var G=(S<<5|S>>>27)+q+p[b];b<20?G+=(O&M|~O&k)+1518500249:b<40?G+=(O^M^k)+1859775393:b<60?G+=(O&M|O&k|M&k)-1894007588:G+=(O^M^k)-899497514,q=k,k=M,M=O<<30|O>>>2,O=S,S=G}R[0]=R[0]+S|0,R[1]=R[1]+O|0,R[2]=R[2]+M|0,R[3]=R[3]+k|0,R[4]=R[4]+q|0},_doFinalize:function(){var C=this._data,x=C.words,R=this._nDataBytes*8,S=C.sigBytes*8;return x[S>>>5]|=128<<24-S%32,x[(S+64>>>9<<4)+14]=Math.floor(R/4294967296),x[(S+64>>>9<<4)+15]=R,C.sigBytes=x.length*4,this._process(),this._hash},clone:function(){var C=c.clone.call(this);return C._hash=this._hash.clone(),C}});w.SHA1=c._createHelper(m),w.HmacSHA1=c._createHmacHelper(m)}(),h.SHA1})},90860:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(62521))})(this,function(h){return function(){var w=h,E=w.lib,v=E.WordArray,c=w.algo,d=c.SHA256,p=c.SHA224=d.extend({_doReset:function(){this._hash=new v.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var m=d._doFinalize.call(this);return m.sigBytes-=4,m}});w.SHA224=d._createHelper(p),w.HmacSHA224=d._createHmacHelper(p)}(),h.SHA224})},62521:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){return function(w){var E=h,v=E.lib,c=v.WordArray,d=v.Hasher,p=E.algo,m=[],C=[];(function(){function S(q){for(var b=w.sqrt(q),F=2;F<=b;F++)if(!(q%F))return!1;return!0}function O(q){return(q-(q|0))*4294967296|0}for(var M=2,k=0;k<64;)S(M)&&(k<8&&(m[k]=O(w.pow(M,.5))),C[k]=O(w.pow(M,.3333333333333333)),k++),M++})();var x=[],R=p.SHA256=d.extend({_doReset:function(){this._hash=new c.init(m.slice(0))},_doProcessBlock:function(S,O){for(var M=this._hash.words,k=M[0],q=M[1],b=M[2],F=M[3],G=M[4],ue=M[5],le=M[6],X=M[7],se=0;se<64;se++){if(se<16)x[se]=S[O+se]|0;else{var de=x[se-15],ye=(de<<25|de>>>7)^(de<<14|de>>>18)^de>>>3,he=x[se-2],K=(he<<15|he>>>17)^(he<<13|he>>>19)^he>>>10;x[se]=ye+x[se-7]+K+x[se-16]}var B=G&ue^~G&le,L=k&q^k&b^q&b,$=(k<<30|k>>>2)^(k<<19|k>>>13)^(k<<10|k>>>22),T=(G<<26|G>>>6)^(G<<21|G>>>11)^(G<<7|G>>>25),N=X+T+B+C[se]+x[se],j=$+L;X=le,le=ue,ue=G,G=F+N|0,F=b,b=q,q=k,k=N+j|0}M[0]=M[0]+k|0,M[1]=M[1]+q|0,M[2]=M[2]+b|0,M[3]=M[3]+F|0,M[4]=M[4]+G|0,M[5]=M[5]+ue|0,M[6]=M[6]+le|0,M[7]=M[7]+X|0},_doFinalize:function(){var S=this._data,O=S.words,M=this._nDataBytes*8,k=S.sigBytes*8;return O[k>>>5]|=128<<24-k%32,O[(k+64>>>9<<4)+14]=w.floor(M/4294967296),O[(k+64>>>9<<4)+15]=M,S.sigBytes=O.length*4,this._process(),this._hash},clone:function(){var S=d.clone.call(this);return S._hash=this._hash.clone(),S}});E.SHA256=d._createHelper(R),E.HmacSHA256=d._createHmacHelper(R)}(Math),h.SHA256})},36729:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(69728))})(this,function(h){return function(w){var E=h,v=E.lib,c=v.WordArray,d=v.Hasher,p=E.x64,m=p.Word,C=E.algo,x=[],R=[],S=[];(function(){for(var k=1,q=0,b=0;b<24;b++){x[k+5*q]=(b+1)*(b+2)/2%64;var F=q%5,G=(2*k+3*q)%5;k=F,q=G}for(var k=0;k<5;k++)for(var q=0;q<5;q++)R[k+5*q]=q+(2*k+3*q)%5*5;for(var ue=1,le=0;le<24;le++){for(var X=0,se=0,de=0;de<7;de++){if(ue&1){var ye=(1<<de)-1;ye<32?se^=1<<ye:X^=1<<ye-32}ue&128?ue=ue<<1^113:ue<<=1}S[le]=m.create(X,se)}})();var O=[];(function(){for(var k=0;k<25;k++)O[k]=m.create()})();var M=C.SHA3=d.extend({cfg:d.cfg.extend({outputLength:512}),_doReset:function(){for(var k=this._state=[],q=0;q<25;q++)k[q]=new m.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(k,q){for(var b=this._state,F=this.blockSize/2,G=0;G<F;G++){var ue=k[q+2*G],le=k[q+2*G+1];ue=(ue<<8|ue>>>24)&16711935|(ue<<24|ue>>>8)&4278255360,le=(le<<8|le>>>24)&16711935|(le<<24|le>>>8)&4278255360;var X=b[G];X.high^=le,X.low^=ue}for(var se=0;se<24;se++){for(var de=0;de<5;de++){for(var ye=0,he=0,K=0;K<5;K++){var X=b[de+5*K];ye^=X.high,he^=X.low}var B=O[de];B.high=ye,B.low=he}for(var de=0;de<5;de++)for(var L=O[(de+4)%5],$=O[(de+1)%5],T=$.high,N=$.low,ye=L.high^(T<<1|N>>>31),he=L.low^(N<<1|T>>>31),K=0;K<5;K++){var X=b[de+5*K];X.high^=ye,X.low^=he}for(var j=1;j<25;j++){var X=b[j],Y=X.high,Z=X.low,z=x[j];if(z<32)var ye=Y<<z|Z>>>32-z,he=Z<<z|Y>>>32-z;else var ye=Z<<z-32|Y>>>64-z,he=Y<<z-32|Z>>>64-z;var fe=O[R[j]];fe.high=ye,fe.low=he}var te=O[0],H=b[0];te.high=H.high,te.low=H.low;for(var de=0;de<5;de++)for(var K=0;K<5;K++){var j=de+5*K,X=b[j],Q=O[j],oe=O[(de+1)%5+5*K],_e=O[(de+2)%5+5*K];X.high=Q.high^~oe.high&_e.high,X.low=Q.low^~oe.low&_e.low}var X=b[0],ge=S[se];X.high^=ge.high,X.low^=ge.low}},_doFinalize:function(){var k=this._data,q=k.words,b=this._nDataBytes*8,F=k.sigBytes*8,G=this.blockSize*32;q[F>>>5]|=1<<24-F%32,q[(w.ceil((F+1)/G)*G>>>5)-1]|=128,k.sigBytes=q.length*4,this._process();for(var ue=this._state,le=this.cfg.outputLength/8,X=le/8,se=[],de=0;de<X;de++){var ye=ue[de],he=ye.high,K=ye.low;he=(he<<8|he>>>24)&16711935|(he<<24|he>>>8)&4278255360,K=(K<<8|K>>>24)&16711935|(K<<24|K>>>8)&4278255360,se.push(K),se.push(he)}return new c.init(se,le)},clone:function(){for(var k=d.clone.call(this),q=k._state=this._state.slice(0),b=0;b<25;b++)q[b]=q[b].clone();return k}});E.SHA3=d._createHelper(M),E.HmacSHA3=d._createHmacHelper(M)}(Math),h.SHA3})},41597:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(69728),_(71900))})(this,function(h){return function(){var w=h,E=w.x64,v=E.Word,c=E.WordArray,d=w.algo,p=d.SHA512,m=d.SHA384=p.extend({_doReset:function(){this._hash=new c.init([new v.init(3418070365,3238371032),new v.init(1654270250,914150663),new v.init(2438529370,812702999),new v.init(355462360,4144912697),new v.init(1731405415,4290775857),new v.init(2394180231,1750603025),new v.init(3675008525,1694076839),new v.init(1203062813,3204075428)])},_doFinalize:function(){var C=p._doFinalize.call(this);return C.sigBytes-=16,C}});w.SHA384=p._createHelper(m),w.HmacSHA384=p._createHmacHelper(m)}(),h.SHA384})},71900:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(69728))})(this,function(h){return function(){var w=h,E=w.lib,v=E.Hasher,c=w.x64,d=c.Word,p=c.WordArray,m=w.algo;function C(){return d.create.apply(d,arguments)}var x=[C(1116352408,3609767458),C(1899447441,602891725),C(3049323471,3964484399),C(3921009573,2173295548),C(961987163,4081628472),C(1508970993,3053834265),C(2453635748,2937671579),C(2870763221,3664609560),C(3624381080,2734883394),C(310598401,1164996542),C(607225278,1323610764),C(1426881987,3590304994),C(1925078388,4068182383),C(2162078206,991336113),C(2614888103,633803317),C(3248222580,3479774868),C(3835390401,2666613458),C(4022224774,944711139),C(264347078,2341262773),C(604807628,2007800933),C(770255983,1495990901),C(1249150122,1856431235),C(1555081692,3175218132),C(1996064986,2198950837),C(2554220882,3999719339),C(2821834349,766784016),C(2952996808,2566594879),C(3210313671,3203337956),C(3336571891,1034457026),C(3584528711,2466948901),C(113926993,3758326383),C(338241895,168717936),C(666307205,1188179964),C(773529912,1546045734),C(1294757372,1522805485),C(1396182291,2643833823),C(1695183700,2343527390),C(1986661051,1014477480),C(2177026350,1206759142),C(2456956037,344077627),C(2730485921,1290863460),C(2820302411,3158454273),C(3259730800,3505952657),C(3345764771,106217008),C(3516065817,3606008344),C(3600352804,1432725776),C(4094571909,1467031594),C(275423344,851169720),C(430227734,3100823752),C(506948616,1363258195),C(659060556,3750685593),C(883997877,3785050280),C(958139571,3318307427),C(1322822218,3812723403),C(1537002063,2003034995),C(1747873779,3602036899),C(1955562222,1575990012),C(2024104815,1125592928),C(2227730452,2716904306),C(2361852424,442776044),C(2428436474,593698344),C(2756734187,3733110249),C(3204031479,2999351573),C(3329325298,3815920427),C(3391569614,3928383900),C(3515267271,566280711),C(3940187606,3454069534),C(4118630271,4000239992),C(116418474,1914138554),C(174292421,2731055270),C(289380356,3203993006),C(460393269,320620315),C(685471733,587496836),C(852142971,1086792851),C(1017036298,365543100),C(1126000580,2618297676),C(1288033470,3409855158),C(1501505948,4234509866),C(1607167915,987167468),C(1816402316,1246189591)],R=[];(function(){for(var O=0;O<80;O++)R[O]=C()})();var S=m.SHA512=v.extend({_doReset:function(){this._hash=new p.init([new d.init(1779033703,4089235720),new d.init(3144134277,2227873595),new d.init(1013904242,4271175723),new d.init(2773480762,1595750129),new d.init(1359893119,2917565137),new d.init(2600822924,725511199),new d.init(528734635,4215389547),new d.init(1541459225,327033209)])},_doProcessBlock:function(O,M){for(var k=this._hash.words,q=k[0],b=k[1],F=k[2],G=k[3],ue=k[4],le=k[5],X=k[6],se=k[7],de=q.high,ye=q.low,he=b.high,K=b.low,B=F.high,L=F.low,$=G.high,T=G.low,N=ue.high,j=ue.low,Y=le.high,Z=le.low,z=X.high,fe=X.low,te=se.high,H=se.low,Q=de,oe=ye,_e=he,ge=K,be=B,we=L,Ee=$,me=T,Ke=N,He=j,Ie=Y,Le=Z,Ge=z,Be=fe,We=te,Ze=H,_t=0;_t<80;_t++){var Ft=R[_t];if(_t<16)var gt=Ft.high=O[M+_t*2]|0,lt=Ft.low=O[M+_t*2+1]|0;else{var dt=R[_t-15],tt=dt.high,rt=dt.low,ke=(tt>>>1|rt<<31)^(tt>>>8|rt<<24)^tt>>>7,xe=(rt>>>1|tt<<31)^(rt>>>8|tt<<24)^(rt>>>7|tt<<25),Pe=R[_t-2],it=Pe.high,Xe=Pe.low,st=(it>>>19|Xe<<13)^(it<<3|Xe>>>29)^it>>>6,It=(Xe>>>19|it<<13)^(Xe<<3|it>>>29)^(Xe>>>6|it<<26),ft=R[_t-7],Jt=ft.high,Ot=ft.low,Ct=R[_t-16],qe=Ct.high,Yt=Ct.low,lt=xe+Ot,gt=ke+Jt+(lt>>>0<xe>>>0?1:0),lt=lt+It,gt=gt+st+(lt>>>0<It>>>0?1:0),lt=lt+Yt,gt=gt+qe+(lt>>>0<Yt>>>0?1:0);Ft.high=gt,Ft.low=lt}var ot=Ke&Ie^~Ke&Ge,Ae=He&Le^~He&Be,Rt=Q&_e^Q&be^_e&be,Ht=oe&ge^oe&we^ge&we,bt=(Q>>>28|oe<<4)^(Q<<30|oe>>>2)^(Q<<25|oe>>>7),Mt=(oe>>>28|Q<<4)^(oe<<30|Q>>>2)^(oe<<25|Q>>>7),tr=(Ke>>>14|He<<18)^(Ke>>>18|He<<14)^(Ke<<23|He>>>9),Vt=(He>>>14|Ke<<18)^(He>>>18|Ke<<14)^(He<<23|Ke>>>9),Et=x[_t],Ye=Et.high,Tt=Et.low,Wt=Ze+Vt,dr=We+tr+(Wt>>>0<Ze>>>0?1:0),Wt=Wt+Ae,dr=dr+ot+(Wt>>>0<Ae>>>0?1:0),Wt=Wt+Tt,dr=dr+Ye+(Wt>>>0<Tt>>>0?1:0),Wt=Wt+lt,dr=dr+gt+(Wt>>>0<lt>>>0?1:0),at=Mt+Ht,wt=bt+Rt+(at>>>0<Mt>>>0?1:0);We=Ge,Ze=Be,Ge=Ie,Be=Le,Ie=Ke,Le=He,He=me+Wt|0,Ke=Ee+dr+(He>>>0<me>>>0?1:0)|0,Ee=be,me=we,be=_e,we=ge,_e=Q,ge=oe,oe=Wt+at|0,Q=dr+wt+(oe>>>0<Wt>>>0?1:0)|0}ye=q.low=ye+oe,q.high=de+Q+(ye>>>0<oe>>>0?1:0),K=b.low=K+ge,b.high=he+_e+(K>>>0<ge>>>0?1:0),L=F.low=L+we,F.high=B+be+(L>>>0<we>>>0?1:0),T=G.low=T+me,G.high=$+Ee+(T>>>0<me>>>0?1:0),j=ue.low=j+He,ue.high=N+Ke+(j>>>0<He>>>0?1:0),Z=le.low=Z+Le,le.high=Y+Ie+(Z>>>0<Le>>>0?1:0),fe=X.low=fe+Be,X.high=z+Ge+(fe>>>0<Be>>>0?1:0),H=se.low=H+Ze,se.high=te+We+(H>>>0<Ze>>>0?1:0)},_doFinalize:function(){var O=this._data,M=O.words,k=this._nDataBytes*8,q=O.sigBytes*8;M[q>>>5]|=128<<24-q%32,M[(q+128>>>10<<5)+30]=Math.floor(k/4294967296),M[(q+128>>>10<<5)+31]=k,O.sigBytes=M.length*4,this._process();var b=this._hash.toX32();return b},clone:function(){var O=v.clone.call(this);return O._hash=this._hash.clone(),O},blockSize:1024/32});w.SHA512=v._createHelper(S),w.HmacSHA512=v._createHmacHelper(S)}(),h.SHA512})},49796:function(ie,f,_){(function(h,w,E){ie.exports=f=w(_(64901),_(20282),_(69636),_(54058),_(93893))})(this,function(h){return function(){var w=h,E=w.lib,v=E.WordArray,c=E.BlockCipher,d=w.algo,p=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],m=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],C=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],x=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],R=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],S=d.DES=c.extend({_doReset:function(){for(var q=this._key,b=q.words,F=[],G=0;G<56;G++){var ue=p[G]-1;F[G]=b[ue>>>5]>>>31-ue%32&1}for(var le=this._subKeys=[],X=0;X<16;X++){for(var se=le[X]=[],de=C[X],G=0;G<24;G++)se[G/6|0]|=F[(m[G]-1+de)%28]<<31-G%6,se[4+(G/6|0)]|=F[28+(m[G+24]-1+de)%28]<<31-G%6;se[0]=se[0]<<1|se[0]>>>31;for(var G=1;G<7;G++)se[G]=se[G]>>>(G-1)*4+3;se[7]=se[7]<<5|se[7]>>>27}for(var ye=this._invSubKeys=[],G=0;G<16;G++)ye[G]=le[15-G]},encryptBlock:function(q,b){this._doCryptBlock(q,b,this._subKeys)},decryptBlock:function(q,b){this._doCryptBlock(q,b,this._invSubKeys)},_doCryptBlock:function(q,b,F){this._lBlock=q[b],this._rBlock=q[b+1],O.call(this,4,252645135),O.call(this,16,65535),M.call(this,2,858993459),M.call(this,8,16711935),O.call(this,1,1431655765);for(var G=0;G<16;G++){for(var ue=F[G],le=this._lBlock,X=this._rBlock,se=0,de=0;de<8;de++)se|=x[de][((X^ue[de])&R[de])>>>0];this._lBlock=X,this._rBlock=le^se}var ye=this._lBlock;this._lBlock=this._rBlock,this._rBlock=ye,O.call(this,1,1431655765),M.call(this,8,16711935),M.call(this,2,858993459),O.call(this,16,65535),O.call(this,4,252645135),q[b]=this._lBlock,q[b+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function O(q,b){var F=(this._lBlock>>>q^this._rBlock)&b;this._rBlock^=F,this._lBlock^=F<<q}function M(q,b){var F=(this._rBlock>>>q^this._lBlock)&b;this._lBlock^=F,this._rBlock^=F<<q}w.DES=c._createHelper(S);var k=d.TripleDES=c.extend({_doReset:function(){var q=this._key,b=q.words;this._des1=S.createEncryptor(v.create(b.slice(0,2))),this._des2=S.createEncryptor(v.create(b.slice(2,4))),this._des3=S.createEncryptor(v.create(b.slice(4,6)))},encryptBlock:function(q,b){this._des1.encryptBlock(q,b),this._des2.decryptBlock(q,b),this._des3.encryptBlock(q,b)},decryptBlock:function(q,b){this._des3.decryptBlock(q,b),this._des2.encryptBlock(q,b),this._des1.decryptBlock(q,b)},keySize:192/32,ivSize:64/32,blockSize:64/32});w.TripleDES=c._createHelper(k)}(),h.TripleDES})},69728:function(ie,f,_){(function(h,w){ie.exports=f=w(_(64901))})(this,function(h){return function(w){var E=h,v=E.lib,c=v.Base,d=v.WordArray,p=E.x64={},m=p.Word=c.extend({init:function(x,R){this.high=x,this.low=R}}),C=p.WordArray=c.extend({init:function(x,R){x=this.words=x||[],R!=w?this.sigBytes=R:this.sigBytes=x.length*8},toX32:function(){for(var x=this.words,R=x.length,S=[],O=0;O<R;O++){var M=x[O];S.push(M.high),S.push(M.low)}return d.create(S,this.sigBytes)},clone:function(){for(var x=c.clone.call(this),R=x.words=this.words.slice(0),S=R.length,O=0;O<S;O++)R[O]=R[O].clone();return x}})}(),h})},20136:function(ie,f,_){"use strict";var h=_(85409),w=function(){function k(b,F){if(typeof b!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+b+"."));this._batchLoadFn=b,this._maxBatchSize=C(F),this._batchScheduleFn=x(F),this._cacheKeyFn=R(F),this._cacheMap=S(F),this._batch=null,this.name=O(F)}var q=k.prototype;return q.load=function(F){if(F==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(F)+"."));var G=c(this),ue=this._cacheMap,le=this._cacheKeyFn(F);if(ue){var X=ue.get(le);if(X){var se=G.cacheHits||(G.cacheHits=[]);return new Promise(function(ye){se.push(function(){ye(X)})})}}G.keys.push(F);var de=new Promise(function(ye,he){G.callbacks.push({resolve:ye,reject:he})});return ue&&ue.set(le,de),de},q.loadMany=function(F){if(!M(F))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+F+"."));for(var G=[],ue=0;ue<F.length;ue++)G.push(this.load(F[ue]).catch(function(le){return le}));return Promise.all(G)},q.clear=function(F){var G=this._cacheMap;if(G){var ue=this._cacheKeyFn(F);G.delete(ue)}return this},q.clearAll=function(){var F=this._cacheMap;return F&&F.clear(),this},q.prime=function(F,G){var ue=this._cacheMap;if(ue){var le=this._cacheKeyFn(F);if(ue.get(le)===void 0){var X;G instanceof Error?(X=Promise.reject(G),X.catch(function(){})):X=Promise.resolve(G),ue.set(le,X)}}return this},k}(),E=typeof h=="object"&&typeof h.nextTick=="function"?function(k){v||(v=Promise.resolve()),v.then(function(){h.nextTick(k)})}:typeof setImmediate=="function"?function(k){setImmediate(k)}:function(k){setTimeout(k)},v;function c(k){var q=k._batch;if(q!==null&&!q.hasDispatched&&q.keys.length<k._maxBatchSize)return q;var b={hasDispatched:!1,keys:[],callbacks:[]};return k._batch=b,k._batchScheduleFn(function(){d(k,b)}),b}function d(k,q){if(q.hasDispatched=!0,q.keys.length===0){m(q);return}var b;try{b=k._batchLoadFn(q.keys)}catch(F){return p(k,q,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(F)+".")))}if(!b||typeof b.then!="function")return p(k,q,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(b)+".")));b.then(function(F){if(!M(F))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(F)+"."));if(F.length!==q.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(`
|
||
|
||
Keys:
|
||
`+String(q.keys))+(`
|
||
|
||
Values:
|
||
`+String(F)));m(q);for(var G=0;G<q.callbacks.length;G++){var ue=F[G];ue instanceof Error?q.callbacks[G].reject(ue):q.callbacks[G].resolve(ue)}}).catch(function(F){p(k,q,F)})}function p(k,q,b){m(q);for(var F=0;F<q.keys.length;F++)k.clear(q.keys[F]),q.callbacks[F].reject(b)}function m(k){if(k.cacheHits)for(var q=0;q<k.cacheHits.length;q++)k.cacheHits[q]()}function C(k){var q=!k||k.batch!==!1;if(!q)return 1;var b=k&&k.maxBatchSize;if(b===void 0)return 1/0;if(typeof b!="number"||b<1)throw new TypeError("maxBatchSize must be a positive number: "+b);return b}function x(k){var q=k&&k.batchScheduleFn;if(q===void 0)return E;if(typeof q!="function")throw new TypeError("batchScheduleFn must be a function: "+q);return q}function R(k){var q=k&&k.cacheKeyFn;if(q===void 0)return function(b){return b};if(typeof q!="function")throw new TypeError("cacheKeyFn must be a function: "+q);return q}function S(k){var q=!k||k.cache!==!1;if(!q)return null;var b=k&&k.cacheMap;if(b===void 0)return new Map;if(b!==null){var F=["get","set","delete","clear"],G=F.filter(function(ue){return b&&typeof b[ue]!="function"});if(G.length!==0)throw new TypeError("Custom cacheMap missing methods: "+G.join(", "))}return b}function O(k){return k&&k.name?k.name:null}function M(k){return typeof k=="object"&&k!==null&&typeof k.length=="number"&&(k.length===0||k.length>0&&Object.prototype.hasOwnProperty.call(k,k.length-1))}ie.exports=w},83328:function(ie,f,_){var h=_(85409);f.formatArgs=E,f.save=v,f.load=c,f.useColors=w,f.storage=d(),f.destroy=(()=>{let m=!1;return()=>{m||(m=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),f.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function w(){if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let m;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||!1||typeof navigator<"u"&&navigator.userAgent&&(m=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(m[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function E(m){if(m[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+m[0]+(this.useColors?"%c ":" ")+"+"+ie.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;m.splice(1,0,C,"color: inherit");let x=0,R=0;m[0].replace(/%[a-zA-Z%]/g,S=>{S!=="%%"&&(x++,S==="%c"&&(R=x))}),m.splice(R,0,C)}f.log=console.debug||console.log||(()=>{});function v(m){try{m?f.storage.setItem("debug",m):f.storage.removeItem("debug")}catch{}}function c(){let m;try{m=f.storage.getItem("debug")||f.storage.getItem("DEBUG")}catch{}return!m&&typeof h<"u"&&"env"in h&&(m="{}".DEBUG),m}function d(){try{return localStorage}catch{}}ie.exports=_(12607)(f);const{formatters:p}=ie.exports;p.j=function(m){try{return JSON.stringify(m)}catch(C){return"[UnexpectedJSONParseError]: "+C.message}}},12607:function(ie,f,_){function h(w){v.debug=v,v.default=v,v.coerce=x,v.disable=m,v.enable=d,v.enabled=C,v.humanize=_(53866),v.destroy=R,Object.keys(w).forEach(S=>{v[S]=w[S]}),v.names=[],v.skips=[],v.formatters={};function E(S){let O=0;for(let M=0;M<S.length;M++)O=(O<<5)-O+S.charCodeAt(M),O|=0;return v.colors[Math.abs(O)%v.colors.length]}v.selectColor=E;function v(S){let O,M=null,k,q;function b(...F){if(!b.enabled)return;const G=b,ue=Number(new Date),le=ue-(O||ue);G.diff=le,G.prev=O,G.curr=ue,O=ue,F[0]=v.coerce(F[0]),typeof F[0]!="string"&&F.unshift("%O");let X=0;F[0]=F[0].replace(/%([a-zA-Z%])/g,(de,ye)=>{if(de==="%%")return"%";X++;const he=v.formatters[ye];if(typeof he=="function"){const K=F[X];de=he.call(G,K),F.splice(X,1),X--}return de}),v.formatArgs.call(G,F),(G.log||v.log).apply(G,F)}return b.namespace=S,b.useColors=v.useColors(),b.color=v.selectColor(S),b.extend=c,b.destroy=v.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>M!==null?M:(k!==v.namespaces&&(k=v.namespaces,q=v.enabled(S)),q),set:F=>{M=F}}),typeof v.init=="function"&&v.init(b),b}function c(S,O){const M=v(this.namespace+(typeof O>"u"?":":O)+S);return M.log=this.log,M}function d(S){v.save(S),v.namespaces=S,v.names=[],v.skips=[];const O=(typeof S=="string"?S:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const M of O)M[0]==="-"?v.skips.push(M.slice(1)):v.names.push(M)}function p(S,O){let M=0,k=0,q=-1,b=0;for(;M<S.length;)if(k<O.length&&(O[k]===S[M]||O[k]==="*"))O[k]==="*"?(q=k,b=M,k++):(M++,k++);else if(q!==-1)k=q+1,b++,M=b;else return!1;for(;k<O.length&&O[k]==="*";)k++;return k===O.length}function m(){const S=[...v.names,...v.skips.map(O=>"-"+O)].join(",");return v.enable(""),S}function C(S){for(const O of v.skips)if(p(S,O))return!1;for(const O of v.names)if(p(S,O))return!0;return!1}function x(S){return S instanceof Error?S.stack||S.message:S}function R(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return v.enable(v.load()),v}ie.exports=h},20022:function(ie,f,_){"use strict";var h=_(39886),w=_(63429),E=_(71102),v=_(25667);ie.exports=function(d,p,m){if(!d||typeof d!="object"&&typeof d!="function")throw new E("`obj` must be an object or a function`");if(typeof p!="string"&&typeof p!="symbol")throw new E("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new E("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new E("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new E("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new E("`loose`, if provided, must be a boolean");var C=arguments.length>3?arguments[3]:null,x=arguments.length>4?arguments[4]:null,R=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,O=!!v&&v(d,p);if(h)h(d,p,{configurable:R===null&&O?O.configurable:!R,enumerable:C===null&&O?O.enumerable:!C,value:m,writable:x===null&&O?O.writable:!x});else if(S||!C&&!x&&!R)d[p]=m;else throw new w("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}},4938:function(ie,f,_){"use strict";var h=_(5187),w=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",E=Object.prototype.toString,v=Array.prototype.concat,c=_(20022),d=function(x){return typeof x=="function"&&E.call(x)==="[object Function]"},p=_(491)(),m=function(x,R,S,O){if(R in x){if(O===!0){if(x[R]===S)return}else if(!d(O)||!O())return}p?c(x,R,S,!0):c(x,R,S)},C=function(x,R){var S=arguments.length>2?arguments[2]:{},O=h(R);w&&(O=v.call(O,Object.getOwnPropertySymbols(R)));for(var M=0;M<O.length;M+=1)m(x,O[M],R[O[M]],S[O[M]])};C.supportsDescriptors=!!p,ie.exports=C},504:function(ie,f,_){(function(h,w){ie.exports=w()})(this,function(){"use strict";var h=function(Te,Fe){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ut,St){ut.__proto__=St}||function(ut,St){for(var Nt in St)Object.prototype.hasOwnProperty.call(St,Nt)&&(ut[Nt]=St[Nt])})(Te,Fe)},w=function(){return(w=Object.assign||function(Te){for(var Fe,ut=1,St=arguments.length;ut<St;ut++)for(var Nt in Fe=arguments[ut])Object.prototype.hasOwnProperty.call(Fe,Nt)&&(Te[Nt]=Fe[Nt]);return Te}).apply(this,arguments)};function E(Te,Fe,ut){if(ut||arguments.length===2)for(var St,Nt=0,qt=Fe.length;Nt<qt;Nt++)!St&&Nt in Fe||((St=St||Array.prototype.slice.call(Fe,0,Nt))[Nt]=Fe[Nt]);return Te.concat(St||Array.prototype.slice.call(Fe))}var v=typeof globalThis<"u"?globalThis:typeof self<"u"?self:_.g,c=Object.keys,d=Array.isArray;function p(Te,Fe){return typeof Fe!="object"||c(Fe).forEach(function(ut){Te[ut]=Fe[ut]}),Te}typeof Promise>"u"||v.Promise||(v.Promise=Promise);var m=Object.getPrototypeOf,C={}.hasOwnProperty;function x(Te,Fe){return C.call(Te,Fe)}function R(Te,Fe){typeof Fe=="function"&&(Fe=Fe(m(Te))),(typeof Reflect>"u"?c:Reflect.ownKeys)(Fe).forEach(function(ut){O(Te,ut,Fe[ut])})}var S=Object.defineProperty;function O(Te,Fe,ut,St){S(Te,Fe,p(ut&&x(ut,"get")&&typeof ut.get=="function"?{get:ut.get,set:ut.set,configurable:!0}:{value:ut,configurable:!0,writable:!0},St))}function M(Te){return{from:function(Fe){return Te.prototype=Object.create(Fe.prototype),O(Te.prototype,"constructor",Te),{extend:R.bind(null,Te.prototype)}}}}var k=Object.getOwnPropertyDescriptor,q=[].slice;function b(Te,Fe,ut){return q.call(Te,Fe,ut)}function F(Te,Fe){return Fe(Te)}function G(Te){if(!Te)throw new Error("Assertion Failed")}function ue(Te){v.setImmediate?setImmediate(Te):setTimeout(Te,0)}function le(Te,Fe){if(typeof Fe=="string"&&x(Te,Fe))return Te[Fe];if(!Fe)return Te;if(typeof Fe!="string"){for(var ut=[],St=0,Nt=Fe.length;St<Nt;++St){var qt=le(Te,Fe[St]);ut.push(qt)}return ut}var lr=Fe.indexOf(".");if(lr!==-1){var gr=Te[Fe.substr(0,lr)];return gr==null?void 0:le(gr,Fe.substr(lr+1))}}function X(Te,Fe,ut){if(Te&&Fe!==void 0&&!("isFrozen"in Object&&Object.isFrozen(Te)))if(typeof Fe!="string"&&"length"in Fe){G(typeof ut!="string"&&"length"in ut);for(var St=0,Nt=Fe.length;St<Nt;++St)X(Te,Fe[St],ut[St])}else{var qt,lr,gr=Fe.indexOf(".");gr!==-1?(qt=Fe.substr(0,gr),(lr=Fe.substr(gr+1))===""?ut===void 0?d(Te)&&!isNaN(parseInt(qt))?Te.splice(qt,1):delete Te[qt]:Te[qt]=ut:X(gr=!(gr=Te[qt])||!x(Te,qt)?Te[qt]={}:gr,lr,ut)):ut===void 0?d(Te)&&!isNaN(parseInt(Fe))?Te.splice(Fe,1):delete Te[Fe]:Te[Fe]=ut}}function se(Te){var Fe,ut={};for(Fe in Te)x(Te,Fe)&&(ut[Fe]=Te[Fe]);return ut}var de=[].concat;function ye(Te){return de.apply([],Te)}var tt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ye([8,16,32,64].map(function(Te){return["Int","Uint","Float"].map(function(Fe){return Fe+Te+"Array"})}))).filter(function(Te){return v[Te]}),he=new Set(tt.map(function(Te){return v[Te]})),K=null;function B(Te){return K=new WeakMap,Te=function Fe(ut){if(!ut||typeof ut!="object")return ut;var St=K.get(ut);if(St)return St;if(d(ut)){St=[],K.set(ut,St);for(var Nt=0,qt=ut.length;Nt<qt;++Nt)St.push(Fe(ut[Nt]))}else if(he.has(ut.constructor))St=ut;else{var lr,gr=m(ut);for(lr in St=gr===Object.prototype?{}:Object.create(gr),K.set(ut,St),ut)x(ut,lr)&&(St[lr]=Fe(ut[lr]))}return St}(Te),K=null,Te}var L={}.toString;function $(Te){return L.call(Te).slice(8,-1)}var T=typeof Symbol<"u"?Symbol.iterator:"@@iterator",N=typeof T=="symbol"?function(Te){var Fe;return Te!=null&&(Fe=Te[T])&&Fe.apply(Te)}:function(){return null};function j(Te,Fe){return Fe=Te.indexOf(Fe),0<=Fe&&Te.splice(Fe,1),0<=Fe}var Y={};function Z(Te){var Fe,ut,St,Nt;if(arguments.length===1){if(d(Te))return Te.slice();if(this===Y&&typeof Te=="string")return[Te];if(Nt=N(Te)){for(ut=[];!(St=Nt.next()).done;)ut.push(St.value);return ut}if(Te==null)return[Te];if(typeof(Fe=Te.length)!="number")return[Te];for(ut=new Array(Fe);Fe--;)ut[Fe]=Te[Fe];return ut}for(Fe=arguments.length,ut=new Array(Fe);Fe--;)ut[Fe]=arguments[Fe];return ut}var z=typeof Symbol<"u"?function(Te){return Te[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},dt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Oc=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(dt),fe={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function te(Te,Fe){this.name=Te,this.message=Fe}function H(Te,Fe){return Te+". Errors: "+Object.keys(Fe).map(function(ut){return Fe[ut].toString()}).filter(function(ut,St,Nt){return Nt.indexOf(ut)===St}).join(`
|
||
`)}function Q(Te,Fe,ut,St){this.failures=Fe,this.failedKeys=St,this.successCount=ut,this.message=H(Te,Fe)}function oe(Te,Fe){this.name="BulkError",this.failures=Object.keys(Fe).map(function(ut){return Fe[ut]}),this.failuresByPos=Fe,this.message=H(Te,this.failures)}M(te).from(Error).extend({toString:function(){return this.name+": "+this.message}}),M(Q).from(te),M(oe).from(te);var _e=Oc.reduce(function(Te,Fe){return Te[Fe]=Fe+"Error",Te},{}),ge=te,be=Oc.reduce(function(Te,Fe){var ut=Fe+"Error";function St(Nt,qt){this.name=ut,Nt?typeof Nt=="string"?(this.message="".concat(Nt).concat(qt?`
|
||
`+qt:""),this.inner=qt||null):typeof Nt=="object"&&(this.message="".concat(Nt.name," ").concat(Nt.message),this.inner=Nt):(this.message=fe[Fe]||ut,this.inner=null)}return M(St).from(ge),Te[Fe]=St,Te},{});be.Syntax=SyntaxError,be.Type=TypeError,be.Range=RangeError;var we=dt.reduce(function(Te,Fe){return Te[Fe+"Error"]=be[Fe],Te},{}),Ee=Oc.reduce(function(Te,Fe){return["Syntax","Type","Range"].indexOf(Fe)===-1&&(Te[Fe+"Error"]=be[Fe]),Te},{});function me(){}function Ke(Te){return Te}function He(Te,Fe){return Te==null||Te===Ke?Fe:function(ut){return Fe(Te(ut))}}function Ie(Te,Fe){return function(){Te.apply(this,arguments),Fe.apply(this,arguments)}}function Le(Te,Fe){return Te===me?Fe:function(){var ut=Te.apply(this,arguments);ut!==void 0&&(arguments[0]=ut);var St=this.onsuccess,Nt=this.onerror;this.onsuccess=null,this.onerror=null;var qt=Fe.apply(this,arguments);return St&&(this.onsuccess=this.onsuccess?Ie(St,this.onsuccess):St),Nt&&(this.onerror=this.onerror?Ie(Nt,this.onerror):Nt),qt!==void 0?qt:ut}}function Ge(Te,Fe){return Te===me?Fe:function(){Te.apply(this,arguments);var ut=this.onsuccess,St=this.onerror;this.onsuccess=this.onerror=null,Fe.apply(this,arguments),ut&&(this.onsuccess=this.onsuccess?Ie(ut,this.onsuccess):ut),St&&(this.onerror=this.onerror?Ie(St,this.onerror):St)}}function Be(Te,Fe){return Te===me?Fe:function(ut){var St=Te.apply(this,arguments);p(ut,St);var Nt=this.onsuccess,qt=this.onerror;return this.onsuccess=null,this.onerror=null,ut=Fe.apply(this,arguments),Nt&&(this.onsuccess=this.onsuccess?Ie(Nt,this.onsuccess):Nt),qt&&(this.onerror=this.onerror?Ie(qt,this.onerror):qt),St===void 0?ut===void 0?void 0:ut:p(St,ut)}}function We(Te,Fe){return Te===me?Fe:function(){return Fe.apply(this,arguments)!==!1&&Te.apply(this,arguments)}}function Ze(Te,Fe){return Te===me?Fe:function(){var ut=Te.apply(this,arguments);if(ut&&typeof ut.then=="function"){for(var St=this,Nt=arguments.length,qt=new Array(Nt);Nt--;)qt[Nt]=arguments[Nt];return ut.then(function(){return Fe.apply(St,qt)})}return Fe.apply(this,arguments)}}Ee.ModifyError=Q,Ee.DexieError=te,Ee.BulkError=oe;var _t=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ft(Te){_t=Te}var gt={},lt=100,tt=typeof Promise>"u"?[]:function(){var Te=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[Te,m(Te),Te];var Fe=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[Fe,m(Fe),Te]}(),dt=tt[0],Oc=tt[1],tt=tt[2],Oc=Oc&&Oc.then,rt=dt&&dt.constructor,ke=!!tt,xe=function(Te,Fe){Ot.push([Te,Fe]),it&&(queueMicrotask(tr),it=!1)},Pe=!0,it=!0,Xe=[],st=[],It=Ke,ft={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:me,pgp:!1,env:{},finalize:me},Jt=ft,Ot=[],Ct=0,qe=[];function Yt(Te){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var Fe=this._PSD=Jt;if(typeof Te!="function"){if(Te!==gt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Rt(this,this._value))}this._state=null,this._value=null,++Fe.ref,function ut(St,Nt){try{Nt(function(qt){if(St._state===null){if(qt===St)throw new TypeError("A promise cannot be resolved with itself.");var lr=St._lib&&Vt();qt&&typeof qt.then=="function"?ut(St,function(gr,Er){qt instanceof Yt?qt._then(gr,Er):qt.then(gr,Er)}):(St._state=!0,St._value=qt,Ht(St)),lr&&Et()}},Rt.bind(null,St))}catch(qt){Rt(St,qt)}}(this,Te)}var ot={get:function(){var Te=Jt,Fe=Je;function ut(St,Nt){var qt=this,lr=!Te.global&&(Te!==Jt||Fe!==Je),gr=lr&&!vr(),Er=new Yt(function(jt,Qt){bt(qt,new Ae(rn(St,Te,lr,gr),rn(Nt,Te,lr,gr),jt,Qt,Te))});return this._consoleTask&&(Er._consoleTask=this._consoleTask),Er}return ut.prototype=gt,ut},set:function(Te){O(this,"then",Te&&Te.prototype===gt?ot:{get:function(){return Te},set:ot.set})}};function Ae(Te,Fe,ut,St,Nt){this.onFulfilled=typeof Te=="function"?Te:null,this.onRejected=typeof Fe=="function"?Fe:null,this.resolve=ut,this.reject=St,this.psd=Nt}function Rt(Te,Fe){var ut,St;st.push(Fe),Te._state===null&&(ut=Te._lib&&Vt(),Fe=It(Fe),Te._state=!1,Te._value=Fe,St=Te,Xe.some(function(Nt){return Nt._value===St._value})||Xe.push(St),Ht(Te),ut&&Et())}function Ht(Te){var Fe=Te._listeners;Te._listeners=[];for(var ut=0,St=Fe.length;ut<St;++ut)bt(Te,Fe[ut]);var Nt=Te._PSD;--Nt.ref||Nt.finalize(),Ct===0&&(++Ct,xe(function(){--Ct==0&&Ye()},[]))}function bt(Te,Fe){if(Te._state!==null){var ut=Te._state?Fe.onFulfilled:Fe.onRejected;if(ut===null)return(Te._state?Fe.resolve:Fe.reject)(Te._value);++Fe.psd.ref,++Ct,xe(Mt,[ut,Te,Fe])}else Te._listeners.push(Fe)}function Mt(Te,Fe,ut){try{var St,Nt=Fe._value;!Fe._state&&st.length&&(st=[]),St=_t&&Fe._consoleTask?Fe._consoleTask.run(function(){return Te(Nt)}):Te(Nt),Fe._state||st.indexOf(Nt)!==-1||function(qt){for(var lr=Xe.length;lr;)if(Xe[--lr]._value===qt._value)return Xe.splice(lr,1)}(Fe),ut.resolve(St)}catch(qt){ut.reject(qt)}finally{--Ct==0&&Ye(),--ut.psd.ref||ut.psd.finalize()}}function tr(){Hr(ft,function(){Vt()&&Et()})}function Vt(){var Te=Pe;return it=Pe=!1,Te}function Et(){var Te,Fe,ut;do for(;0<Ot.length;)for(Te=Ot,Ot=[],ut=Te.length,Fe=0;Fe<ut;++Fe){var St=Te[Fe];St[0].apply(null,St[1])}while(0<Ot.length);it=Pe=!0}function Ye(){var Te=Xe;Xe=[],Te.forEach(function(St){St._PSD.onunhandled.call(null,St._value,St)});for(var Fe=qe.slice(0),ut=Fe.length;ut;)Fe[--ut]()}function Tt(Te){return new Yt(gt,!1,Te)}function Wt(Te,Fe){var ut=Jt;return function(){var St=Vt(),Nt=Jt;try{return hr(ut,!0),Te.apply(this,arguments)}catch(qt){Fe&&Fe(qt)}finally{hr(Nt,!1),St&&Et()}}}R(Yt.prototype,{then:ot,_then:function(Te,Fe){bt(this,new Ae(null,null,Te,Fe,Jt))},catch:function(Te){if(arguments.length===1)return this.then(null,Te);var Fe=Te,ut=arguments[1];return typeof Fe=="function"?this.then(null,function(St){return(St instanceof Fe?ut:Tt)(St)}):this.then(null,function(St){return(St&&St.name===Fe?ut:Tt)(St)})},finally:function(Te){return this.then(function(Fe){return Yt.resolve(Te()).then(function(){return Fe})},function(Fe){return Yt.resolve(Te()).then(function(){return Tt(Fe)})})},timeout:function(Te,Fe){var ut=this;return Te<1/0?new Yt(function(St,Nt){var qt=setTimeout(function(){return Nt(new be.Timeout(Fe))},Te);ut.then(St,Nt).finally(clearTimeout.bind(null,qt))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&O(Yt.prototype,Symbol.toStringTag,"Dexie.Promise"),ft.env=$r(),R(Yt,{all:function(){var Te=Z.apply(null,arguments).map(kr);return new Yt(function(Fe,ut){Te.length===0&&Fe([]);var St=Te.length;Te.forEach(function(Nt,qt){return Yt.resolve(Nt).then(function(lr){Te[qt]=lr,--St||Fe(Te)},ut)})})},resolve:function(Te){return Te instanceof Yt?Te:Te&&typeof Te.then=="function"?new Yt(function(Fe,ut){Te.then(Fe,ut)}):new Yt(gt,!0,Te)},reject:Tt,race:function(){var Te=Z.apply(null,arguments).map(kr);return new Yt(function(Fe,ut){Te.map(function(St){return Yt.resolve(St).then(Fe,ut)})})},PSD:{get:function(){return Jt},set:function(Te){return Jt=Te}},totalEchoes:{get:function(){return Je}},newPSD:sr,usePSD:Hr,scheduler:{get:function(){return xe},set:function(Te){xe=Te}},rejectionMapper:{get:function(){return It},set:function(Te){It=Te}},follow:function(Te,Fe){return new Yt(function(ut,St){return sr(function(Nt,qt){var lr=Jt;lr.unhandleds=[],lr.onunhandled=qt,lr.finalize=Ie(function(){var gr,Er=this;gr=function(){Er.unhandleds.length===0?Nt():qt(Er.unhandleds[0])},qe.push(function jt(){gr(),qe.splice(qe.indexOf(jt),1)}),++Ct,xe(function(){--Ct==0&&Ye()},[])},lr.finalize),Te()},Fe,ut,St)})}}),rt&&(rt.allSettled&&O(Yt,"allSettled",function(){var Te=Z.apply(null,arguments).map(kr);return new Yt(function(Fe){Te.length===0&&Fe([]);var ut=Te.length,St=new Array(ut);Te.forEach(function(Nt,qt){return Yt.resolve(Nt).then(function(lr){return St[qt]={status:"fulfilled",value:lr}},function(lr){return St[qt]={status:"rejected",reason:lr}}).then(function(){return--ut||Fe(St)})})})}),rt.any&&typeof AggregateError<"u"&&O(Yt,"any",function(){var Te=Z.apply(null,arguments).map(kr);return new Yt(function(Fe,ut){Te.length===0&&ut(new AggregateError([]));var St=Te.length,Nt=new Array(St);Te.forEach(function(qt,lr){return Yt.resolve(qt).then(function(gr){return Fe(gr)},function(gr){Nt[lr]=gr,--St||ut(new AggregateError(Nt))})})})}),rt.withResolvers&&(Yt.withResolvers=rt.withResolvers));var dr={awaits:0,echoes:0,id:0},at=0,wt=[],At=0,Je=0,Lt=0;function sr(Te,Fe,ut,St){var Nt=Jt,qt=Object.create(Nt);return qt.parent=Nt,qt.ref=0,qt.global=!1,qt.id=++Lt,ft.env,qt.env=ke?{Promise:Yt,PromiseProp:{value:Yt,configurable:!0,writable:!0},all:Yt.all,race:Yt.race,allSettled:Yt.allSettled,any:Yt.any,resolve:Yt.resolve,reject:Yt.reject}:{},Fe&&p(qt,Fe),++Nt.ref,qt.finalize=function(){--this.parent.ref||this.parent.finalize()},St=Hr(qt,Te,ut,St),qt.ref===0&&qt.finalize(),St}function ur(){return dr.id||(dr.id=++at),++dr.awaits,dr.echoes+=lt,dr.id}function vr(){return!!dr.awaits&&(--dr.awaits==0&&(dr.id=0),dr.echoes=dr.awaits*lt,!0)}function kr(Te){return dr.echoes&&Te&&Te.constructor===rt?(ur(),Te.then(function(Fe){return vr(),Fe},function(Fe){return vr(),pn(Fe)})):Te}function Jr(){var Te=wt[wt.length-1];wt.pop(),hr(Te,!1)}function hr(Te,Fe){var ut,St=Jt;(Fe?!dr.echoes||At++&&Te===Jt:!At||--At&&Te===Jt)||queueMicrotask(Fe?function(Nt){++Je,dr.echoes&&--dr.echoes!=0||(dr.echoes=dr.awaits=dr.id=0),wt.push(Jt),hr(Nt,!0)}.bind(null,Te):Jr),Te!==Jt&&(Jt=Te,St===ft&&(ft.env=$r()),ke&&(ut=ft.env.Promise,Fe=Te.env,(St.global||Te.global)&&(Object.defineProperty(v,"Promise",Fe.PromiseProp),ut.all=Fe.all,ut.race=Fe.race,ut.resolve=Fe.resolve,ut.reject=Fe.reject,Fe.allSettled&&(ut.allSettled=Fe.allSettled),Fe.any&&(ut.any=Fe.any))))}function $r(){var Te=v.Promise;return ke?{Promise:Te,PromiseProp:Object.getOwnPropertyDescriptor(v,"Promise"),all:Te.all,race:Te.race,allSettled:Te.allSettled,any:Te.any,resolve:Te.resolve,reject:Te.reject}:{}}function Hr(Te,Fe,ut,St,Nt){var qt=Jt;try{return hr(Te,!0),Fe(ut,St,Nt)}finally{hr(qt,!1)}}function rn(Te,Fe,ut,St){return typeof Te!="function"?Te:function(){var Nt=Jt;ut&&ur(),hr(Fe,!0);try{return Te.apply(this,arguments)}finally{hr(Nt,!1),St&&queueMicrotask(vr)}}}function _r(Te){Promise===rt&&dr.echoes===0?At===0?Te():enqueueNativeMicroTask(Te):setTimeout(Te,0)}(""+Oc).indexOf("[native code]")===-1&&(ur=vr=me);var pn=Yt.reject,$t="\uFFFF",In="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",ln="String expected.",yn=[],Fr="__dbnames",On="readonly",En="readwrite";function ee(Te,Fe){return Te?Fe?function(){return Te.apply(this,arguments)&&Fe.apply(this,arguments)}:Te:Fe}var ve={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ze(Te){return typeof Te!="string"||/\./.test(Te)?function(Fe){return Fe}:function(Fe){return Fe[Te]===void 0&&Te in Fe&&delete(Fe=B(Fe))[Te],Fe}}function yt(){throw be.Type()}function vt(Te,Fe){try{var ut=ar(Te),St=ar(Fe);if(ut!==St)return ut==="Array"?1:St==="Array"?-1:ut==="binary"?1:St==="binary"?-1:ut==="string"?1:St==="string"?-1:ut==="Date"?1:St!=="Date"?NaN:-1;switch(ut){case"number":case"Date":case"string":return Fe<Te?1:Te<Fe?-1:0;case"binary":return function(Nt,qt){for(var lr=Nt.length,gr=qt.length,Er=lr<gr?lr:gr,jt=0;jt<Er;++jt)if(Nt[jt]!==qt[jt])return Nt[jt]<qt[jt]?-1:1;return lr===gr?0:lr<gr?-1:1}(wr(Te),wr(Fe));case"Array":return function(Nt,qt){for(var lr=Nt.length,gr=qt.length,Er=lr<gr?lr:gr,jt=0;jt<Er;++jt){var Qt=vt(Nt[jt],qt[jt]);if(Qt!==0)return Qt}return lr===gr?0:lr<gr?-1:1}(Te,Fe)}}catch{}return NaN}function ar(Te){var Fe=typeof Te;return Fe!="object"?Fe:ArrayBuffer.isView(Te)?"binary":(Te=$(Te),Te==="ArrayBuffer"?"binary":Te)}function wr(Te){return Te instanceof Uint8Array?Te:ArrayBuffer.isView(Te)?new Uint8Array(Te.buffer,Te.byteOffset,Te.byteLength):new Uint8Array(Te)}var zt=(Kr.prototype._trans=function(Te,Fe,ut){var St=this._tx||Jt.trans,Nt=this.name,qt=_t&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(Te==="readonly"?"read":"write"," ").concat(this.name));function lr(jt,Qt,Gt){if(!Gt.schema[Nt])throw new be.NotFound("Table "+Nt+" not part of transaction");return Fe(Gt.idbtrans,Gt)}var gr=Vt();try{var Er=St&&St.db._novip===this.db._novip?St===Jt.trans?St._promise(Te,lr,ut):sr(function(){return St._promise(Te,lr,ut)},{trans:St,transless:Jt.transless||Jt}):function jt(Qt,Gt,br,yr){if(Qt.idbdb&&(Qt._state.openComplete||Jt.letThrough||Qt._vip)){var Sr=Qt._createTransaction(Gt,br,Qt._dbSchema);try{Sr.create(),Qt._state.PR1398_maxLoop=3}catch(Or){return Or.name===_e.InvalidState&&Qt.isOpen()&&0<--Qt._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Qt.close({disableAutoOpen:!1}),Qt.open().then(function(){return jt(Qt,Gt,br,yr)})):pn(Or)}return Sr._promise(Gt,function(Or,Ir){return sr(function(){return Jt.trans=Sr,yr(Or,Ir,Sr)})}).then(function(Or){if(Gt==="readwrite")try{Sr.idbtrans.commit()}catch{}return Gt==="readonly"?Or:Sr._completion.then(function(){return Or})})}if(Qt._state.openComplete)return pn(new be.DatabaseClosed(Qt._state.dbOpenError));if(!Qt._state.isBeingOpened){if(!Qt._state.autoOpen)return pn(new be.DatabaseClosed);Qt.open().catch(me)}return Qt._state.dbReadyPromise.then(function(){return jt(Qt,Gt,br,yr)})}(this.db,Te,[this.name],lr);return qt&&(Er._consoleTask=qt,Er=Er.catch(function(jt){return console.trace(jt),pn(jt)})),Er}finally{gr&&Et()}},Kr.prototype.get=function(Te,Fe){var ut=this;return Te&&Te.constructor===Object?this.where(Te).first(Fe):Te==null?pn(new be.Type("Invalid argument to Table.get()")):this._trans("readonly",function(St){return ut.core.get({trans:St,key:Te}).then(function(Nt){return ut.hook.reading.fire(Nt)})}).then(Fe)},Kr.prototype.where=function(Te){if(typeof Te=="string")return new this.db.WhereClause(this,Te);if(d(Te))return new this.db.WhereClause(this,"[".concat(Te.join("+"),"]"));var Fe=c(Te);if(Fe.length===1)return this.where(Fe[0]).equals(Te[Fe[0]]);var ut=this.schema.indexes.concat(this.schema.primKey).filter(function(gr){if(gr.compound&&Fe.every(function(jt){return 0<=gr.keyPath.indexOf(jt)})){for(var Er=0;Er<Fe.length;++Er)if(Fe.indexOf(gr.keyPath[Er])===-1)return!1;return!0}return!1}).sort(function(gr,Er){return gr.keyPath.length-Er.keyPath.length})[0];if(ut&&this.db._maxKey!==$t){var qt=ut.keyPath.slice(0,Fe.length);return this.where(qt).equals(qt.map(function(Er){return Te[Er]}))}!ut&&_t&&console.warn("The query ".concat(JSON.stringify(Te)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(Fe.join("+"),"]"));var St=this.schema.idxByName;function Nt(gr,Er){return vt(gr,Er)===0}var lr=Fe.reduce(function(Gt,Er){var jt=Gt[0],Qt=Gt[1],Gt=St[Er],br=Te[Er];return[jt||Gt,jt||!Gt?ee(Qt,Gt&&Gt.multi?function(yr){return yr=le(yr,Er),d(yr)&&yr.some(function(Sr){return Nt(br,Sr)})}:function(yr){return Nt(br,le(yr,Er))}):Qt]},[null,null]),qt=lr[0],lr=lr[1];return qt?this.where(qt.name).equals(Te[qt.keyPath]).filter(lr):ut?this.filter(lr):this.where(Fe).equals("")},Kr.prototype.filter=function(Te){return this.toCollection().and(Te)},Kr.prototype.count=function(Te){return this.toCollection().count(Te)},Kr.prototype.offset=function(Te){return this.toCollection().offset(Te)},Kr.prototype.limit=function(Te){return this.toCollection().limit(Te)},Kr.prototype.each=function(Te){return this.toCollection().each(Te)},Kr.prototype.toArray=function(Te){return this.toCollection().toArray(Te)},Kr.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Kr.prototype.orderBy=function(Te){return new this.db.Collection(new this.db.WhereClause(this,d(Te)?"[".concat(Te.join("+"),"]"):Te))},Kr.prototype.reverse=function(){return this.toCollection().reverse()},Kr.prototype.mapToClass=function(Te){var Fe,ut=this.db,St=this.name;function Nt(){return Fe!==null&&Fe.apply(this,arguments)||this}(this.schema.mappedClass=Te).prototype instanceof yt&&(function(Er,jt){if(typeof jt!="function"&&jt!==null)throw new TypeError("Class extends value "+String(jt)+" is not a constructor or null");function Qt(){this.constructor=Er}h(Er,jt),Er.prototype=jt===null?Object.create(jt):(Qt.prototype=jt.prototype,new Qt)}(Nt,Fe=Te),Object.defineProperty(Nt.prototype,"db",{get:function(){return ut},enumerable:!1,configurable:!0}),Nt.prototype.table=function(){return St},Te=Nt);for(var qt=new Set,lr=Te.prototype;lr;lr=m(lr))Object.getOwnPropertyNames(lr).forEach(function(Er){return qt.add(Er)});function gr(Er){if(!Er)return Er;var jt,Qt=Object.create(Te.prototype);for(jt in Er)if(!qt.has(jt))try{Qt[jt]=Er[jt]}catch{}return Qt}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=gr,this.hook("reading",gr),Te},Kr.prototype.defineClass=function(){return this.mapToClass(function(Te){p(this,Te)})},Kr.prototype.add=function(Te,Fe){var ut=this,St=this.schema.primKey,Nt=St.auto,qt=St.keyPath,lr=Te;return qt&&Nt&&(lr=ze(qt)(Te)),this._trans("readwrite",function(gr){return ut.core.mutate({trans:gr,type:"add",keys:Fe!=null?[Fe]:null,values:[lr]})}).then(function(gr){return gr.numFailures?Yt.reject(gr.failures[0]):gr.lastResult}).then(function(gr){if(qt)try{X(Te,qt,gr)}catch{}return gr})},Kr.prototype.update=function(Te,Fe){return typeof Te!="object"||d(Te)?this.where(":id").equals(Te).modify(Fe):(Te=le(Te,this.schema.primKey.keyPath),Te===void 0?pn(new be.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(Te).modify(Fe))},Kr.prototype.put=function(Te,Fe){var ut=this,St=this.schema.primKey,Nt=St.auto,qt=St.keyPath,lr=Te;return qt&&Nt&&(lr=ze(qt)(Te)),this._trans("readwrite",function(gr){return ut.core.mutate({trans:gr,type:"put",values:[lr],keys:Fe!=null?[Fe]:null})}).then(function(gr){return gr.numFailures?Yt.reject(gr.failures[0]):gr.lastResult}).then(function(gr){if(qt)try{X(Te,qt,gr)}catch{}return gr})},Kr.prototype.delete=function(Te){var Fe=this;return this._trans("readwrite",function(ut){return Fe.core.mutate({trans:ut,type:"delete",keys:[Te]})}).then(function(ut){return ut.numFailures?Yt.reject(ut.failures[0]):void 0})},Kr.prototype.clear=function(){var Te=this;return this._trans("readwrite",function(Fe){return Te.core.mutate({trans:Fe,type:"deleteRange",range:ve})}).then(function(Fe){return Fe.numFailures?Yt.reject(Fe.failures[0]):void 0})},Kr.prototype.bulkGet=function(Te){var Fe=this;return this._trans("readonly",function(ut){return Fe.core.getMany({keys:Te,trans:ut}).then(function(St){return St.map(function(Nt){return Fe.hook.reading.fire(Nt)})})})},Kr.prototype.bulkAdd=function(Te,Fe,ut){var St=this,Nt=Array.isArray(Fe)?Fe:void 0,qt=(ut=ut||(Nt?void 0:Fe))?ut.allKeys:void 0;return this._trans("readwrite",function(lr){var jt=St.schema.primKey,gr=jt.auto,jt=jt.keyPath;if(jt&&Nt)throw new be.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(Nt&&Nt.length!==Te.length)throw new be.InvalidArgument("Arguments objects and keys must have the same length");var Er=Te.length,jt=jt&&gr?Te.map(ze(jt)):Te;return St.core.mutate({trans:lr,type:"add",keys:Nt,values:jt,wantResults:qt}).then(function(Sr){var Gt=Sr.numFailures,br=Sr.results,yr=Sr.lastResult,Sr=Sr.failures;if(Gt===0)return qt?br:yr;throw new oe("".concat(St.name,".bulkAdd(): ").concat(Gt," of ").concat(Er," operations failed"),Sr)})})},Kr.prototype.bulkPut=function(Te,Fe,ut){var St=this,Nt=Array.isArray(Fe)?Fe:void 0,qt=(ut=ut||(Nt?void 0:Fe))?ut.allKeys:void 0;return this._trans("readwrite",function(lr){var jt=St.schema.primKey,gr=jt.auto,jt=jt.keyPath;if(jt&&Nt)throw new be.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(Nt&&Nt.length!==Te.length)throw new be.InvalidArgument("Arguments objects and keys must have the same length");var Er=Te.length,jt=jt&&gr?Te.map(ze(jt)):Te;return St.core.mutate({trans:lr,type:"put",keys:Nt,values:jt,wantResults:qt}).then(function(Sr){var Gt=Sr.numFailures,br=Sr.results,yr=Sr.lastResult,Sr=Sr.failures;if(Gt===0)return qt?br:yr;throw new oe("".concat(St.name,".bulkPut(): ").concat(Gt," of ").concat(Er," operations failed"),Sr)})})},Kr.prototype.bulkUpdate=function(Te){var Fe=this,ut=this.core,St=Te.map(function(lr){return lr.key}),Nt=Te.map(function(lr){return lr.changes}),qt=[];return this._trans("readwrite",function(lr){return ut.getMany({trans:lr,keys:St,cache:"clone"}).then(function(gr){var Er=[],jt=[];Te.forEach(function(Gt,br){var yr=Gt.key,Sr=Gt.changes,Or=gr[br];if(Or){for(var Ir=0,Vr=Object.keys(Sr);Ir<Vr.length;Ir++){var Gr=Vr[Ir],jr=Sr[Gr];if(Gr===Fe.schema.primKey.keyPath){if(vt(jr,yr)!==0)throw new be.Constraint("Cannot update primary key in bulkUpdate()")}else X(Or,Gr,jr)}qt.push(br),Er.push(yr),jt.push(Or)}});var Qt=Er.length;return ut.mutate({trans:lr,type:"put",keys:Er,values:jt,updates:{keys:St,changeSpecs:Nt}}).then(function(Gt){var br=Gt.numFailures,yr=Gt.failures;if(br===0)return Qt;for(var Sr=0,Or=Object.keys(yr);Sr<Or.length;Sr++){var Ir,Vr=Or[Sr],Gr=qt[Number(Vr)];Gr!=null&&(Ir=yr[Vr],delete yr[Vr],yr[Gr]=Ir)}throw new oe("".concat(Fe.name,".bulkUpdate(): ").concat(br," of ").concat(Qt," operations failed"),yr)})})})},Kr.prototype.bulkDelete=function(Te){var Fe=this,ut=Te.length;return this._trans("readwrite",function(St){return Fe.core.mutate({trans:St,type:"delete",keys:Te})}).then(function(lr){var Nt=lr.numFailures,qt=lr.lastResult,lr=lr.failures;if(Nt===0)return qt;throw new oe("".concat(Fe.name,".bulkDelete(): ").concat(Nt," of ").concat(ut," operations failed"),lr)})},Kr);function Kr(){}function Xt(Te){function Fe(lr,gr){if(gr){for(var Er=arguments.length,jt=new Array(Er-1);--Er;)jt[Er-1]=arguments[Er];return ut[lr].subscribe.apply(null,jt),Te}if(typeof lr=="string")return ut[lr]}var ut={};Fe.addEventType=qt;for(var St=1,Nt=arguments.length;St<Nt;++St)qt(arguments[St]);return Fe;function qt(lr,gr,Er){if(typeof lr!="object"){var jt;gr=gr||We;var Qt={subscribers:[],fire:Er=Er||me,subscribe:function(Gt){Qt.subscribers.indexOf(Gt)===-1&&(Qt.subscribers.push(Gt),Qt.fire=gr(Qt.fire,Gt))},unsubscribe:function(Gt){Qt.subscribers=Qt.subscribers.filter(function(br){return br!==Gt}),Qt.fire=Qt.subscribers.reduce(gr,Er)}};return ut[lr]=Fe[lr]=Qt}c(jt=lr).forEach(function(Gt){var br=jt[Gt];if(d(br))qt(Gt,jt[Gt][0],jt[Gt][1]);else{if(br!=="asap")throw new be.InvalidArgument("Invalid event config");var yr=qt(Gt,Ke,function(){for(var Sr=arguments.length,Or=new Array(Sr);Sr--;)Or[Sr]=arguments[Sr];yr.subscribers.forEach(function(Ir){ue(function(){Ir.apply(null,Or)})})})}})}}function et(Te,Fe){return M(Fe).from({prototype:Te}),Fe}function xt(Te,Fe){return!(Te.filter||Te.algorithm||Te.or)&&(Fe?Te.justLimit:!Te.replayFilter)}function Kt(Te,Fe){Te.filter=ee(Te.filter,Fe)}function kt(Te,Fe,ut){var St=Te.replayFilter;Te.replayFilter=St?function(){return ee(St(),Fe())}:Fe,Te.justLimit=ut&&!St}function or(Te,Fe){if(Te.isPrimKey)return Fe.primaryKey;var ut=Fe.getIndexByKeyPath(Te.index);if(!ut)throw new be.Schema("KeyPath "+Te.index+" on object store "+Fe.name+" is not indexed");return ut}function Qr(Te,Fe,ut){var St=or(Te,Fe.schema);return Fe.openCursor({trans:ut,values:!Te.keysOnly,reverse:Te.dir==="prev",unique:!!Te.unique,query:{index:St,range:Te.range}})}function Nr(Te,Fe,ut,St){var Nt=Te.replayFilter?ee(Te.filter,Te.replayFilter()):Te.filter;if(Te.or){var qt={},lr=function(gr,Er,jt){var Qt,Gt;Nt&&!Nt(Er,jt,function(br){return Er.stop(br)},function(br){return Er.fail(br)})||((Gt=""+(Qt=Er.primaryKey))=="[object ArrayBuffer]"&&(Gt=""+new Uint8Array(Qt)),x(qt,Gt)||(qt[Gt]=!0,Fe(gr,Er,jt)))};return Promise.all([Te.or._iterate(lr,ut),An(Qr(Te,St,ut),Te.algorithm,lr,!Te.keysOnly&&Te.valueMapper)])}return An(Qr(Te,St,ut),ee(Te.algorithm,Nt),Fe,!Te.keysOnly&&Te.valueMapper)}function An(Te,Fe,ut,St){var Nt=Wt(St?function(qt,lr,gr){return ut(St(qt),lr,gr)}:ut);return Te.then(function(qt){if(qt)return qt.start(function(){var lr=function(){return qt.continue()};Fe&&!Fe(qt,function(gr){return lr=gr},function(gr){qt.stop(gr),lr=me},function(gr){qt.fail(gr),lr=me})||Nt(qt.value,qt,function(gr){return lr=gr}),lr()})})}var mn=(Nn.prototype.execute=function(Te){var Fe=this["@@propmod"];if(Fe.add!==void 0){var ut=Fe.add;if(d(ut))return E(E([],d(Te)?Te:[],!0),ut,!0).sort();if(typeof ut=="number")return(Number(Te)||0)+ut;if(typeof ut=="bigint")try{return BigInt(Te)+ut}catch{return BigInt(0)+ut}throw new TypeError("Invalid term ".concat(ut))}if(Fe.remove!==void 0){var St=Fe.remove;if(d(St))return d(Te)?Te.filter(function(Nt){return!St.includes(Nt)}).sort():[];if(typeof St=="number")return Number(Te)-St;if(typeof St=="bigint")try{return BigInt(Te)-St}catch{return BigInt(0)-St}throw new TypeError("Invalid subtrahend ".concat(St))}return ut=(ut=Fe.replacePrefix)===null||ut===void 0?void 0:ut[0],ut&&typeof Te=="string"&&Te.startsWith(ut)?Fe.replacePrefix[1]+Te.substring(ut.length):Te},Nn);function Nn(Te){this["@@propmod"]=Te}var Vi=(Kn.prototype._read=function(Te,Fe){var ut=this._ctx;return ut.error?ut.table._trans(null,pn.bind(null,ut.error)):ut.table._trans("readonly",Te).then(Fe)},Kn.prototype._write=function(Te){var Fe=this._ctx;return Fe.error?Fe.table._trans(null,pn.bind(null,Fe.error)):Fe.table._trans("readwrite",Te,"locked")},Kn.prototype._addAlgorithm=function(Te){var Fe=this._ctx;Fe.algorithm=ee(Fe.algorithm,Te)},Kn.prototype._iterate=function(Te,Fe){return Nr(this._ctx,Te,Fe,this._ctx.table.core)},Kn.prototype.clone=function(Te){var Fe=Object.create(this.constructor.prototype),ut=Object.create(this._ctx);return Te&&p(ut,Te),Fe._ctx=ut,Fe},Kn.prototype.raw=function(){return this._ctx.valueMapper=null,this},Kn.prototype.each=function(Te){var Fe=this._ctx;return this._read(function(ut){return Nr(Fe,Te,ut,Fe.table.core)})},Kn.prototype.count=function(Te){var Fe=this;return this._read(function(ut){var St=Fe._ctx,Nt=St.table.core;if(xt(St,!0))return Nt.count({trans:ut,query:{index:or(St,Nt.schema),range:St.range}}).then(function(lr){return Math.min(lr,St.limit)});var qt=0;return Nr(St,function(){return++qt,!1},ut,Nt).then(function(){return qt})}).then(Te)},Kn.prototype.sortBy=function(Te,Fe){var ut=Te.split(".").reverse(),St=ut[0],Nt=ut.length-1;function qt(Er,jt){return jt?qt(Er[ut[jt]],jt-1):Er[St]}var lr=this._ctx.dir==="next"?1:-1;function gr(Er,jt){return vt(qt(Er,Nt),qt(jt,Nt))*lr}return this.toArray(function(Er){return Er.sort(gr)}).then(Fe)},Kn.prototype.toArray=function(Te){var Fe=this;return this._read(function(ut){var St=Fe._ctx;if(St.dir==="next"&&xt(St,!0)&&0<St.limit){var Nt=St.valueMapper,qt=or(St,St.table.core.schema);return St.table.core.query({trans:ut,limit:St.limit,values:!0,query:{index:qt,range:St.range}}).then(function(gr){return gr=gr.result,Nt?gr.map(Nt):gr})}var lr=[];return Nr(St,function(gr){return lr.push(gr)},ut,St.table.core).then(function(){return lr})},Te)},Kn.prototype.offset=function(Te){var Fe=this._ctx;return Te<=0||(Fe.offset+=Te,xt(Fe)?kt(Fe,function(){var ut=Te;return function(St,Nt){return ut===0||(ut===1?--ut:Nt(function(){St.advance(ut),ut=0}),!1)}}):kt(Fe,function(){var ut=Te;return function(){return--ut<0}})),this},Kn.prototype.limit=function(Te){return this._ctx.limit=Math.min(this._ctx.limit,Te),kt(this._ctx,function(){var Fe=Te;return function(ut,St,Nt){return--Fe<=0&&St(Nt),0<=Fe}},!0),this},Kn.prototype.until=function(Te,Fe){return Kt(this._ctx,function(ut,St,Nt){return!Te(ut.value)||(St(Nt),Fe)}),this},Kn.prototype.first=function(Te){return this.limit(1).toArray(function(Fe){return Fe[0]}).then(Te)},Kn.prototype.last=function(Te){return this.reverse().first(Te)},Kn.prototype.filter=function(Te){var Fe;return Kt(this._ctx,function(ut){return Te(ut.value)}),(Fe=this._ctx).isMatch=ee(Fe.isMatch,Te),this},Kn.prototype.and=function(Te){return this.filter(Te)},Kn.prototype.or=function(Te){return new this.db.WhereClause(this._ctx.table,Te,this)},Kn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Kn.prototype.desc=function(){return this.reverse()},Kn.prototype.eachKey=function(Te){var Fe=this._ctx;return Fe.keysOnly=!Fe.isMatch,this.each(function(ut,St){Te(St.key,St)})},Kn.prototype.eachUniqueKey=function(Te){return this._ctx.unique="unique",this.eachKey(Te)},Kn.prototype.eachPrimaryKey=function(Te){var Fe=this._ctx;return Fe.keysOnly=!Fe.isMatch,this.each(function(ut,St){Te(St.primaryKey,St)})},Kn.prototype.keys=function(Te){var Fe=this._ctx;Fe.keysOnly=!Fe.isMatch;var ut=[];return this.each(function(St,Nt){ut.push(Nt.key)}).then(function(){return ut}).then(Te)},Kn.prototype.primaryKeys=function(Te){var Fe=this._ctx;if(Fe.dir==="next"&&xt(Fe,!0)&&0<Fe.limit)return this._read(function(St){var Nt=or(Fe,Fe.table.core.schema);return Fe.table.core.query({trans:St,values:!1,limit:Fe.limit,query:{index:Nt,range:Fe.range}})}).then(function(St){return St.result}).then(Te);Fe.keysOnly=!Fe.isMatch;var ut=[];return this.each(function(St,Nt){ut.push(Nt.primaryKey)}).then(function(){return ut}).then(Te)},Kn.prototype.uniqueKeys=function(Te){return this._ctx.unique="unique",this.keys(Te)},Kn.prototype.firstKey=function(Te){return this.limit(1).keys(function(Fe){return Fe[0]}).then(Te)},Kn.prototype.lastKey=function(Te){return this.reverse().firstKey(Te)},Kn.prototype.distinct=function(){var Te=this._ctx,Te=Te.index&&Te.table.schema.idxByName[Te.index];if(!Te||!Te.multi)return this;var Fe={};return Kt(this._ctx,function(Nt){var St=Nt.primaryKey.toString(),Nt=x(Fe,St);return Fe[St]=!0,!Nt}),this},Kn.prototype.modify=function(Te){var Fe=this,ut=this._ctx;return this._write(function(St){var Nt,qt,lr;lr=typeof Te=="function"?Te:(Nt=c(Te),qt=Nt.length,function(Ir){for(var Vr=!1,Gr=0;Gr<qt;++Gr){var jr=Nt[Gr],dn=Te[jr],Pn=le(Ir,jr);dn instanceof mn?(X(Ir,jr,dn.execute(Pn)),Vr=!0):Pn!==dn&&(X(Ir,jr,dn),Vr=!0)}return Vr});var gr=ut.table.core,Gt=gr.schema.primaryKey,Er=Gt.outbound,jt=Gt.extractKey,Qt=200,Gt=Fe.db._options.modifyChunkSize;Gt&&(Qt=typeof Gt=="object"?Gt[gr.name]||Gt["*"]||200:Gt);function br(Ir,jr){var Gr=jr.failures,jr=jr.numFailures;Sr+=Ir-jr;for(var dn=0,Pn=c(Gr);dn<Pn.length;dn++){var Dn=Pn[dn];yr.push(Gr[Dn])}}var yr=[],Sr=0,Or=[];return Fe.clone().primaryKeys().then(function(Ir){function Vr(jr){var dn=Math.min(Qt,Ir.length-jr);return gr.getMany({trans:St,keys:Ir.slice(jr,jr+dn),cache:"immutable"}).then(function(Pn){for(var Dn=[],Cn=[],Ln=Er?[]:null,Yr=[],Un=0;Un<dn;++Un){var ii=Pn[Un],Hi={value:B(ii),primKey:Ir[jr+Un]};lr.call(Hi,Hi.value,Hi)!==!1&&(Hi.value==null?Yr.push(Ir[jr+Un]):Er||vt(jt(ii),jt(Hi.value))===0?(Cn.push(Hi.value),Er&&Ln.push(Ir[jr+Un])):(Yr.push(Ir[jr+Un]),Dn.push(Hi.value)))}return Promise.resolve(0<Dn.length&&gr.mutate({trans:St,type:"add",values:Dn}).then(function(Zi){for(var Bi in Zi.failures)Yr.splice(parseInt(Bi),1);br(Dn.length,Zi)})).then(function(){return(0<Cn.length||Gr&&typeof Te=="object")&&gr.mutate({trans:St,type:"put",keys:Ln,values:Cn,criteria:Gr,changeSpec:typeof Te!="function"&&Te,isAdditionalChunk:0<jr}).then(function(Zi){return br(Cn.length,Zi)})}).then(function(){return(0<Yr.length||Gr&&Te===_s)&&gr.mutate({trans:St,type:"delete",keys:Yr,criteria:Gr,isAdditionalChunk:0<jr}).then(function(Zi){return br(Yr.length,Zi)})}).then(function(){return Ir.length>jr+dn&&Vr(jr+Qt)})})}var Gr=xt(ut)&&ut.limit===1/0&&(typeof Te!="function"||Te===_s)&&{index:ut.index,range:ut.range};return Vr(0).then(function(){if(0<yr.length)throw new Q("Error modifying one or more objects",yr,Sr,Or);return Ir.length})})})},Kn.prototype.delete=function(){var Te=this._ctx,Fe=Te.range;return xt(Te)&&(Te.isPrimKey||Fe.type===3)?this._write(function(ut){var St=Te.table.core.schema.primaryKey,Nt=Fe;return Te.table.core.count({trans:ut,query:{index:St,range:Nt}}).then(function(qt){return Te.table.core.mutate({trans:ut,type:"deleteRange",range:Nt}).then(function(lr){var gr=lr.failures;if(lr.lastResult,lr.results,lr=lr.numFailures,lr)throw new Q("Could not delete some values",Object.keys(gr).map(function(Er){return gr[Er]}),qt-lr);return qt-lr})})}):this.modify(_s)},Kn);function Kn(){}var _s=function(Te,Fe){return Fe.value=null};function Gs(Te,Fe){return Te<Fe?-1:Te===Fe?0:1}function zs(Te,Fe){return Fe<Te?-1:Te===Fe?0:1}function rs(Te,Fe,ut){return Te=Te instanceof Eh?new Te.Collection(Te):Te,Te._ctx.error=new(ut||TypeError)(Fe),Te}function to(Te){return new Te.Collection(Te,function(){return cl("")}).limit(0)}function ro(Te,Fe,ut,St){var Nt,qt,lr,gr,Er,jt,Qt,Gt=ut.length;if(!ut.every(function(Sr){return typeof Sr=="string"}))return rs(Te,ln);function br(Sr){Nt=Sr==="next"?function(Ir){return Ir.toUpperCase()}:function(Ir){return Ir.toLowerCase()},qt=Sr==="next"?function(Ir){return Ir.toLowerCase()}:function(Ir){return Ir.toUpperCase()},lr=Sr==="next"?Gs:zs;var Or=ut.map(function(Ir){return{lower:qt(Ir),upper:Nt(Ir)}}).sort(function(Ir,Vr){return lr(Ir.lower,Vr.lower)});gr=Or.map(function(Ir){return Ir.upper}),Er=Or.map(function(Ir){return Ir.lower}),Qt=(jt=Sr)==="next"?"":St}br("next"),Te=new Te.Collection(Te,function(){return Ls(gr[0],Er[Gt-1]+St)}),Te._ondirectionchange=function(Sr){br(Sr)};var yr=0;return Te._addAlgorithm(function(Sr,Or,Ir){var Vr=Sr.key;if(typeof Vr!="string")return!1;var Gr=qt(Vr);if(Fe(Gr,Er,yr))return!0;for(var jr=null,dn=yr;dn<Gt;++dn){var Pn=function(Dn,Cn,Ln,Yr,Un,ii){for(var Hi=Math.min(Dn.length,Yr.length),Zi=-1,Bi=0;Bi<Hi;++Bi){var Cu=Cn[Bi];if(Cu!==Yr[Bi])return Un(Dn[Bi],Ln[Bi])<0?Dn.substr(0,Bi)+Ln[Bi]+Ln.substr(Bi+1):Un(Dn[Bi],Yr[Bi])<0?Dn.substr(0,Bi)+Yr[Bi]+Ln.substr(Bi+1):0<=Zi?Dn.substr(0,Zi)+Cn[Zi]+Ln.substr(Zi+1):null;Un(Dn[Bi],Cu)<0&&(Zi=Bi)}return Hi<Yr.length&&ii==="next"?Dn+Ln.substr(Dn.length):Hi<Dn.length&&ii==="prev"?Dn.substr(0,Ln.length):Zi<0?null:Dn.substr(0,Zi)+Yr[Zi]+Ln.substr(Zi+1)}(Vr,Gr,gr[dn],Er[dn],lr,jt);Pn===null&&jr===null?yr=dn+1:(jr===null||0<lr(jr,Pn))&&(jr=Pn)}return Or(jr!==null?function(){Sr.continue(jr+Qt)}:Ir),!1}),Te}function Ls(Te,Fe,ut,St){return{type:2,lower:Te,upper:Fe,lowerOpen:ut,upperOpen:St}}function cl(Te){return{type:1,lower:Te,upper:Te}}var Eh=(Object.defineProperty(Ro.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ro.prototype.between=function(Te,Fe,ut,St){ut=ut!==!1,St=St===!0;try{return 0<this._cmp(Te,Fe)||this._cmp(Te,Fe)===0&&(ut||St)&&(!ut||!St)?to(this):new this.Collection(this,function(){return Ls(Te,Fe,!ut,!St)})}catch{return rs(this,In)}},Ro.prototype.equals=function(Te){return Te==null?rs(this,In):new this.Collection(this,function(){return cl(Te)})},Ro.prototype.above=function(Te){return Te==null?rs(this,In):new this.Collection(this,function(){return Ls(Te,void 0,!0)})},Ro.prototype.aboveOrEqual=function(Te){return Te==null?rs(this,In):new this.Collection(this,function(){return Ls(Te,void 0,!1)})},Ro.prototype.below=function(Te){return Te==null?rs(this,In):new this.Collection(this,function(){return Ls(void 0,Te,!1,!0)})},Ro.prototype.belowOrEqual=function(Te){return Te==null?rs(this,In):new this.Collection(this,function(){return Ls(void 0,Te)})},Ro.prototype.startsWith=function(Te){return typeof Te!="string"?rs(this,ln):this.between(Te,Te+$t,!0,!0)},Ro.prototype.startsWithIgnoreCase=function(Te){return Te===""?this.startsWith(Te):ro(this,function(Fe,ut){return Fe.indexOf(ut[0])===0},[Te],$t)},Ro.prototype.equalsIgnoreCase=function(Te){return ro(this,function(Fe,ut){return Fe===ut[0]},[Te],"")},Ro.prototype.anyOfIgnoreCase=function(){var Te=Z.apply(Y,arguments);return Te.length===0?to(this):ro(this,function(Fe,ut){return ut.indexOf(Fe)!==-1},Te,"")},Ro.prototype.startsWithAnyOfIgnoreCase=function(){var Te=Z.apply(Y,arguments);return Te.length===0?to(this):ro(this,function(Fe,ut){return ut.some(function(St){return Fe.indexOf(St)===0})},Te,$t)},Ro.prototype.anyOf=function(){var Te=this,Fe=Z.apply(Y,arguments),ut=this._cmp;try{Fe.sort(ut)}catch{return rs(this,In)}if(Fe.length===0)return to(this);var St=new this.Collection(this,function(){return Ls(Fe[0],Fe[Fe.length-1])});St._ondirectionchange=function(qt){ut=qt==="next"?Te._ascending:Te._descending,Fe.sort(ut)};var Nt=0;return St._addAlgorithm(function(qt,lr,gr){for(var Er=qt.key;0<ut(Er,Fe[Nt]);)if(++Nt===Fe.length)return lr(gr),!1;return ut(Er,Fe[Nt])===0||(lr(function(){qt.continue(Fe[Nt])}),!1)}),St},Ro.prototype.notEqual=function(Te){return this.inAnyRange([[-1/0,Te],[Te,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ro.prototype.noneOf=function(){var Te=Z.apply(Y,arguments);if(Te.length===0)return new this.Collection(this);try{Te.sort(this._ascending)}catch{return rs(this,In)}var Fe=Te.reduce(function(ut,St){return ut?ut.concat([[ut[ut.length-1][1],St]]):[[-1/0,St]]},null);return Fe.push([Te[Te.length-1],this.db._maxKey]),this.inAnyRange(Fe,{includeLowers:!1,includeUppers:!1})},Ro.prototype.inAnyRange=function(Vr,Fe){var ut=this,St=this._cmp,Nt=this._ascending,qt=this._descending,lr=this._min,gr=this._max;if(Vr.length===0)return to(this);if(!Vr.every(function(Gr){return Gr[0]!==void 0&&Gr[1]!==void 0&&Nt(Gr[0],Gr[1])<=0}))return rs(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",be.InvalidArgument);var Er=!Fe||Fe.includeLowers!==!1,jt=Fe&&Fe.includeUppers===!0,Qt,Gt=Nt;function br(Gr,jr){return Gt(Gr[0],jr[0])}try{(Qt=Vr.reduce(function(Gr,jr){for(var dn=0,Pn=Gr.length;dn<Pn;++dn){var Dn=Gr[dn];if(St(jr[0],Dn[1])<0&&0<St(jr[1],Dn[0])){Dn[0]=lr(Dn[0],jr[0]),Dn[1]=gr(Dn[1],jr[1]);break}}return dn===Pn&&Gr.push(jr),Gr},[])).sort(br)}catch{return rs(this,In)}var yr=0,Sr=jt?function(Gr){return 0<Nt(Gr,Qt[yr][1])}:function(Gr){return 0<=Nt(Gr,Qt[yr][1])},Or=Er?function(Gr){return 0<qt(Gr,Qt[yr][0])}:function(Gr){return 0<=qt(Gr,Qt[yr][0])},Ir=Sr,Vr=new this.Collection(this,function(){return Ls(Qt[0][0],Qt[Qt.length-1][1],!Er,!jt)});return Vr._ondirectionchange=function(Gr){Gt=Gr==="next"?(Ir=Sr,Nt):(Ir=Or,qt),Qt.sort(br)},Vr._addAlgorithm(function(Gr,jr,dn){for(var Pn,Dn=Gr.key;Ir(Dn);)if(++yr===Qt.length)return jr(dn),!1;return!Sr(Pn=Dn)&&!Or(Pn)||(ut._cmp(Dn,Qt[yr][1])===0||ut._cmp(Dn,Qt[yr][0])===0||jr(function(){Gt===Nt?Gr.continue(Qt[yr][0]):Gr.continue(Qt[yr][1])}),!1)}),Vr},Ro.prototype.startsWithAnyOf=function(){var Te=Z.apply(Y,arguments);return Te.every(function(Fe){return typeof Fe=="string"})?Te.length===0?to(this):this.inAnyRange(Te.map(function(Fe){return[Fe,Fe+$t]})):rs(this,"startsWithAnyOf() only works with strings")},Ro);function Ro(){}function Su(Te){return Wt(function(Fe){return Yl(Fe),Te(Fe.target.error),!1})}function Yl(Te){Te.stopPropagation&&Te.stopPropagation(),Te.preventDefault&&Te.preventDefault()}var Th="storagemutated",Sh="x-storagemutated-1",Bc=Xt(null,Th),Id=(Iu.prototype._lock=function(){return G(!Jt.global),++this._reculock,this._reculock!==1||Jt.global||(Jt.lockOwnerFor=this),this},Iu.prototype._unlock=function(){if(G(!Jt.global),--this._reculock==0)for(Jt.global||(Jt.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var Te=this._blockedFuncs.shift();try{Hr(Te[1],Te[0])}catch{}}return this},Iu.prototype._locked=function(){return this._reculock&&Jt.lockOwnerFor!==this},Iu.prototype.create=function(Te){var Fe=this;if(!this.mode)return this;var ut=this.db.idbdb,St=this.db._state.dbOpenError;if(G(!this.idbtrans),!Te&&!ut)switch(St&&St.name){case"DatabaseClosedError":throw new be.DatabaseClosed(St);case"MissingAPIError":throw new be.MissingAPI(St.message,St);default:throw new be.OpenFailed(St)}if(!this.active)throw new be.TransactionInactive;return G(this._completion._state===null),(Te=this.idbtrans=Te||(this.db.core||ut).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Wt(function(Nt){Yl(Nt),Fe._reject(Te.error)}),Te.onabort=Wt(function(Nt){Yl(Nt),Fe.active&&Fe._reject(new be.Abort(Te.error)),Fe.active=!1,Fe.on("abort").fire(Nt)}),Te.oncomplete=Wt(function(){Fe.active=!1,Fe._resolve(),"mutatedParts"in Te&&Bc.storagemutated.fire(Te.mutatedParts)}),this},Iu.prototype._promise=function(Te,Fe,ut){var St=this;if(Te==="readwrite"&&this.mode!=="readwrite")return pn(new be.ReadOnly("Transaction is readonly"));if(!this.active)return pn(new be.TransactionInactive);if(this._locked())return new Yt(function(qt,lr){St._blockedFuncs.push([function(){St._promise(Te,Fe,ut).then(qt,lr)},Jt])});if(ut)return sr(function(){var qt=new Yt(function(lr,gr){St._lock();var Er=Fe(lr,gr,St);Er&&Er.then&&Er.then(lr,gr)});return qt.finally(function(){return St._unlock()}),qt._lib=!0,qt});var Nt=new Yt(function(qt,lr){var gr=Fe(qt,lr,St);gr&&gr.then&&gr.then(qt,lr)});return Nt._lib=!0,Nt},Iu.prototype._root=function(){return this.parent?this.parent._root():this},Iu.prototype.waitFor=function(Te){var Fe,ut=this._root(),St=Yt.resolve(Te);ut._waitingFor?ut._waitingFor=ut._waitingFor.then(function(){return St}):(ut._waitingFor=St,ut._waitingQueue=[],Fe=ut.idbtrans.objectStore(ut.storeNames[0]),function qt(){for(++ut._spinCount;ut._waitingQueue.length;)ut._waitingQueue.shift()();ut._waitingFor&&(Fe.get(-1/0).onsuccess=qt)}());var Nt=ut._waitingFor;return new Yt(function(qt,lr){St.then(function(gr){return ut._waitingQueue.push(Wt(qt.bind(null,gr)))},function(gr){return ut._waitingQueue.push(Wt(lr.bind(null,gr)))}).finally(function(){ut._waitingFor===Nt&&(ut._waitingFor=null)})})},Iu.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new be.Abort))},Iu.prototype.table=function(Te){var Fe=this._memoizedTables||(this._memoizedTables={});if(x(Fe,Te))return Fe[Te];var ut=this.schema[Te];if(!ut)throw new be.NotFound("Table "+Te+" not part of transaction");return ut=new this.db.Table(Te,ut,this),ut.core=this.db.core.table(Te),Fe[Te]=ut},Iu);function Iu(){}function kd(Te,Fe,ut,St,Nt,qt,lr){return{name:Te,keyPath:Fe,unique:ut,multi:St,auto:Nt,compound:qt,src:(ut&&!lr?"&":"")+(St?"*":"")+(Nt?"++":"")+Tg(Fe)}}function Tg(Te){return typeof Te=="string"?Te:Te?"["+[].join.call(Te,"+")+"]":""}function Rd(Te,Fe,ut){return{name:Te,primKey:Fe,indexes:ut,mappedClass:null,idxByName:(St=function(Nt){return[Nt.name,Nt]},ut.reduce(function(Nt,qt,lr){return lr=St(qt,lr),lr&&(Nt[lr[0]]=lr[1]),Nt},{}))};var St}var Ju=function(Te){try{return Te.only([[]]),Ju=function(){return[[]]},[[]]}catch{return Ju=function(){return $t},$t}};function Ds(Te){return Te==null?function(){}:typeof Te=="string"?(Fe=Te).split(".").length===1?function(ut){return ut[Fe]}:function(ut){return le(ut,Fe)}:function(ut){return le(ut,Te)};var Fe}function qs(Te){return[].slice.call(Te)}var Cd=0;function Wa(Te){return Te==null?":id":typeof Te=="string"?Te:"[".concat(Te.join("+"),"]")}function Ih(Te,Fe,Er){function St(Ir){if(Ir.type===3)return null;if(Ir.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var yr=Ir.lower,Sr=Ir.upper,Or=Ir.lowerOpen,Ir=Ir.upperOpen;return yr===void 0?Sr===void 0?null:Fe.upperBound(Sr,!!Ir):Sr===void 0?Fe.lowerBound(yr,!!Or):Fe.bound(yr,Sr,!!Or,!!Ir)}function Nt(br){var yr,Sr=br.name;return{name:Sr,schema:br,mutate:function(Or){var Ir=Or.trans,Vr=Or.type,Gr=Or.keys,jr=Or.values,dn=Or.range;return new Promise(function(Pn,Dn){Pn=Wt(Pn);var Cn=Ir.objectStore(Sr),Ln=Cn.keyPath==null,Yr=Vr==="put"||Vr==="add";if(!Yr&&Vr!=="delete"&&Vr!=="deleteRange")throw new Error("Invalid operation type: "+Vr);var Un,ii=(Gr||jr||{length:1}).length;if(Gr&&jr&&Gr.length!==jr.length)throw new Error("Given keys array must have same length as given values array.");if(ii===0)return Pn({numFailures:0,failures:{},results:[],lastResult:void 0});function Hi(ba){++Cu,Yl(ba)}var Zi=[],Bi=[],Cu=0;if(Vr==="deleteRange"){if(dn.type===4)return Pn({numFailures:Cu,failures:Bi,results:[],lastResult:void 0});dn.type===3?Zi.push(Un=Cn.clear()):Zi.push(Un=Cn.delete(St(dn)))}else{var Ln=Yr?Ln?[jr,Gr]:[jr,null]:[Gr,null],Si=Ln[0],Li=Ln[1];if(Yr)for(var ia=0;ia<ii;++ia)Zi.push(Un=Li&&Li[ia]!==void 0?Cn[Vr](Si[ia],Li[ia]):Cn[Vr](Si[ia])),Un.onerror=Hi;else for(ia=0;ia<ii;++ia)Zi.push(Un=Cn[Vr](Si[ia])),Un.onerror=Hi}function $0(ba){ba=ba.target.result,Zi.forEach(function(Od,xh){return Od.error!=null&&(Bi[xh]=Od.error)}),Pn({numFailures:Cu,failures:Bi,results:Vr==="delete"?Gr:Zi.map(function(Od){return Od.result}),lastResult:ba})}Un.onerror=function(ba){Hi(ba),$0(ba)},Un.onsuccess=$0})},getMany:function(Or){var Ir=Or.trans,Vr=Or.keys;return new Promise(function(Gr,jr){Gr=Wt(Gr);for(var dn,Pn=Ir.objectStore(Sr),Dn=Vr.length,Cn=new Array(Dn),Ln=0,Yr=0,Un=function(Zi){Zi=Zi.target,Cn[Zi._pos]=Zi.result,++Yr===Ln&&Gr(Cn)},ii=Su(jr),Hi=0;Hi<Dn;++Hi)Vr[Hi]!=null&&((dn=Pn.get(Vr[Hi]))._pos=Hi,dn.onsuccess=Un,dn.onerror=ii,++Ln);Ln===0&&Gr(Cn)})},get:function(Or){var Ir=Or.trans,Vr=Or.key;return new Promise(function(Gr,jr){Gr=Wt(Gr);var dn=Ir.objectStore(Sr).get(Vr);dn.onsuccess=function(Pn){return Gr(Pn.target.result)},dn.onerror=Su(jr)})},query:(yr=jt,function(Or){return new Promise(function(Ir,Vr){Ir=Wt(Ir);var Gr,jr,dn,Ln=Or.trans,Pn=Or.values,Dn=Or.limit,Un=Or.query,Cn=Dn===1/0?void 0:Dn,Yr=Un.index,Un=Un.range,Ln=Ln.objectStore(Sr),Yr=Yr.isPrimaryKey?Ln:Ln.index(Yr.name),Un=St(Un);if(Dn===0)return Ir({result:[]});yr?((Cn=Pn?Yr.getAll(Un,Cn):Yr.getAllKeys(Un,Cn)).onsuccess=function(ii){return Ir({result:ii.target.result})},Cn.onerror=Su(Vr)):(Gr=0,jr=!Pn&&"openKeyCursor"in Yr?Yr.openKeyCursor(Un):Yr.openCursor(Un),dn=[],jr.onsuccess=function(ii){var Hi=jr.result;return Hi?(dn.push(Pn?Hi.value:Hi.primaryKey),++Gr===Dn?Ir({result:dn}):void Hi.continue()):Ir({result:dn})},jr.onerror=Su(Vr))})}),openCursor:function(Or){var Ir=Or.trans,Vr=Or.values,Gr=Or.query,jr=Or.reverse,dn=Or.unique;return new Promise(function(Pn,Dn){Pn=Wt(Pn);var Yr=Gr.index,Cn=Gr.range,Ln=Ir.objectStore(Sr),Ln=Yr.isPrimaryKey?Ln:Ln.index(Yr.name),Yr=jr?dn?"prevunique":"prev":dn?"nextunique":"next",Un=!Vr&&"openKeyCursor"in Ln?Ln.openKeyCursor(St(Cn),Yr):Ln.openCursor(St(Cn),Yr);Un.onerror=Su(Dn),Un.onsuccess=Wt(function(ii){var Hi,Zi,Bi,Cu,Si=Un.result;Si?(Si.___id=++Cd,Si.done=!1,Hi=Si.continue.bind(Si),Zi=(Zi=Si.continuePrimaryKey)&&Zi.bind(Si),Bi=Si.advance.bind(Si),Cu=function(){throw new Error("Cursor not stopped")},Si.trans=Ir,Si.stop=Si.continue=Si.continuePrimaryKey=Si.advance=function(){throw new Error("Cursor not started")},Si.fail=Wt(Dn),Si.next=function(){var Li=this,ia=1;return this.start(function(){return ia--?Li.continue():Li.stop()}).then(function(){return Li})},Si.start=function(Li){function ia(){if(Un.result)try{Li()}catch(ba){Si.fail(ba)}else Si.done=!0,Si.start=function(){throw new Error("Cursor behind last entry")},Si.stop()}var $0=new Promise(function(ba,Od){ba=Wt(ba),Un.onerror=Su(Od),Si.fail=Od,Si.stop=function(xh){Si.stop=Si.continue=Si.continuePrimaryKey=Si.advance=Cu,ba(xh)}});return Un.onsuccess=Wt(function(ba){Un.onsuccess=ia,ia()}),Si.continue=Hi,Si.continuePrimaryKey=Zi,Si.advance=Bi,ia(),$0},Pn(Si)):Pn(null)},Dn)})},count:function(Or){var Ir=Or.query,Vr=Or.trans,Gr=Ir.index,jr=Ir.range;return new Promise(function(dn,Pn){var Dn=Vr.objectStore(Sr),Cn=Gr.isPrimaryKey?Dn:Dn.index(Gr.name),Dn=St(jr),Cn=Dn?Cn.count(Dn):Cn.count();Cn.onsuccess=Wt(function(Ln){return dn(Ln.target.result)}),Cn.onerror=Su(Pn)})}}}var qt,lr,gr,Qt=(lr=Er,gr=qs((qt=Te).objectStoreNames),{schema:{name:qt.name,tables:gr.map(function(br){return lr.objectStore(br)}).map(function(br){var yr=br.keyPath,Ir=br.autoIncrement,Sr=d(yr),Or={},Ir={name:br.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:yr==null,compound:Sr,keyPath:yr,autoIncrement:Ir,unique:!0,extractKey:Ds(yr)},indexes:qs(br.indexNames).map(function(Vr){return br.index(Vr)}).map(function(dn){var Gr=dn.name,jr=dn.unique,Pn=dn.multiEntry,dn=dn.keyPath,Pn={name:Gr,compound:d(dn),keyPath:dn,unique:jr,multiEntry:Pn,extractKey:Ds(dn)};return Or[Wa(dn)]=Pn}),getIndexByKeyPath:function(Vr){return Or[Wa(Vr)]}};return Or[":id"]=Ir.primaryKey,yr!=null&&(Or[Wa(yr)]=Ir.primaryKey),Ir})},hasGetAll:0<gr.length&&"getAll"in lr.objectStore(gr[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Er=Qt.schema,jt=Qt.hasGetAll,Qt=Er.tables.map(Nt),Gt={};return Qt.forEach(function(br){return Gt[br.name]=br}),{stack:"dbcore",transaction:Te.transaction.bind(Te),table:function(br){if(!Gt[br])throw new Error("Table '".concat(br,"' not found"));return Gt[br]},MIN_KEY:-1/0,MAX_KEY:Ju(Fe),schema:Er}}function kh(Te,Fe,ut,St){var Nt=ut.IDBKeyRange;return ut.indexedDB,{dbcore:(St=Ih(Fe,Nt,St),Te.dbcore.reduce(function(qt,lr){return lr=lr.create,w(w({},qt),lr(qt))},St))}}function Xl(Te,St){var ut=St.db,St=kh(Te._middlewares,ut,Te._deps,St);Te.core=St.dbcore,Te.tables.forEach(function(Nt){var qt=Nt.name;Te.core.schema.tables.some(function(lr){return lr.name===qt})&&(Nt.core=Te.core.table(qt),Te[qt]instanceof Te.Table&&(Te[qt].core=Nt.core))})}function Rh(Te,Fe,ut,St){ut.forEach(function(Nt){var qt=St[Nt];Fe.forEach(function(lr){var gr=function Er(jt,Qt){return k(jt,Qt)||(jt=m(jt))&&Er(jt,Qt)}(lr,Nt);(!gr||"value"in gr&&gr.value===void 0)&&(lr===Te.Transaction.prototype||lr instanceof Te.Transaction?O(lr,Nt,{get:function(){return this.table(Nt)},set:function(Er){S(this,Nt,{value:Er,writable:!0,configurable:!0,enumerable:!0})}}):lr[Nt]=new Te.Table(Nt,qt))})})}function U0(Te,Fe){Fe.forEach(function(ut){for(var St in ut)ut[St]instanceof Te.Table&&delete ut[St]})}function cv(Te,Fe){return Te._cfg.version-Fe._cfg.version}function Co(Te,Fe,ut,St){var Nt=Te._dbSchema;ut.objectStoreNames.contains("$meta")&&!Nt.$meta&&(Nt.$meta=Rd("$meta",Tr("")[0],[]),Te._storeNames.push("$meta"));var qt=Te._createTransaction("readwrite",Te._storeNames,Nt);qt.create(ut),qt._completion.catch(St);var lr=qt._reject.bind(qt),gr=Jt.transless||Jt;sr(function(){return Jt.trans=qt,Jt.transless=gr,Fe!==0?(Xl(Te,ut),jt=Fe,((Er=qt).storeNames.includes("$meta")?Er.table("$meta").get("version").then(function(Qt){return Qt??jt}):Yt.resolve(jt)).then(function(Qt){return br=Qt,yr=qt,Sr=ut,Or=[],Qt=(Gt=Te)._versions,Ir=Gt._dbSchema=nr(0,Gt.idbdb,Sr),(Qt=Qt.filter(function(Vr){return Vr._cfg.version>=br})).length!==0?(Qt.forEach(function(Vr){Or.push(function(){var Gr=Ir,jr=Vr._cfg.dbschema;ir(Gt,Gr,Sr),ir(Gt,jr,Sr),Ir=Gt._dbSchema=jr;var dn=Qu(Gr,jr);dn.add.forEach(function(Yr){po(Sr,Yr[0],Yr[1].primKey,Yr[1].indexes)}),dn.change.forEach(function(Yr){if(Yr.recreate)throw new be.Upgrade("Not yet support for changing primary key");var Un=Sr.objectStore(Yr.name);Yr.add.forEach(function(ii){return Dt(Un,ii)}),Yr.change.forEach(function(ii){Un.deleteIndex(ii.name),Dt(Un,ii)}),Yr.del.forEach(function(ii){return Un.deleteIndex(ii)})});var Pn=Vr._cfg.contentUpgrade;if(Pn&&Vr._cfg.version>br){Xl(Gt,Sr),yr._memoizedTables={};var Dn=se(jr);dn.del.forEach(function(Yr){Dn[Yr]=Gr[Yr]}),U0(Gt,[Gt.Transaction.prototype]),Rh(Gt,[Gt.Transaction.prototype],c(Dn),Dn),yr.schema=Dn;var Cn,Ln=z(Pn);return Ln&&ur(),dn=Yt.follow(function(){var Yr;(Cn=Pn(yr))&&Ln&&(Yr=vr.bind(null,null),Cn.then(Yr,Yr))}),Cn&&typeof Cn.then=="function"?Yt.resolve(Cn):dn.then(function(){return Cn})}}),Or.push(function(Gr){var jr,dn,Pn=Vr._cfg.dbschema;jr=Pn,dn=Gr,[].slice.call(dn.db.objectStoreNames).forEach(function(Dn){return jr[Dn]==null&&dn.db.deleteObjectStore(Dn)}),U0(Gt,[Gt.Transaction.prototype]),Rh(Gt,[Gt.Transaction.prototype],Gt._storeNames,Gt._dbSchema),yr.schema=Gt._dbSchema}),Or.push(function(Gr){Gt.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Gt.idbdb.version/10)===Vr._cfg.version?(Gt.idbdb.deleteObjectStore("$meta"),delete Gt._dbSchema.$meta,Gt._storeNames=Gt._storeNames.filter(function(jr){return jr!=="$meta"})):Gr.objectStore("$meta").put(Vr._cfg.version,"version"))})}),function Vr(){return Or.length?Yt.resolve(Or.shift()(yr.idbtrans)).then(Vr):Yt.resolve()}().then(function(){Pt(Ir,Sr)})):Yt.resolve();var Gt,br,yr,Sr,Or,Ir}).catch(lr)):(c(Nt).forEach(function(Qt){po(ut,Qt,Nt[Qt].primKey,Nt[Qt].indexes)}),Xl(Te,ut),void Yt.follow(function(){return Te.on.populate.fire(qt)}).catch(lr));var Er,jt})}function Sg(Te,Fe){Pt(Te._dbSchema,Fe),Fe.db.version%10!=0||Fe.objectStoreNames.contains("$meta")||Fe.db.createObjectStore("$meta").add(Math.ceil(Fe.db.version/10-1),"version");var ut=nr(0,Te.idbdb,Fe);ir(Te,Te._dbSchema,Fe);for(var St=0,Nt=Qu(ut,Te._dbSchema).change;St<Nt.length;St++){var qt=function(lr){if(lr.change.length||lr.recreate)return console.warn("Unable to patch indexes of table ".concat(lr.name," because it has changes on the type of index or primary key.")),{value:void 0};var gr=Fe.objectStore(lr.name);lr.add.forEach(function(Er){_t&&console.debug("Dexie upgrade patch: Creating missing index ".concat(lr.name,".").concat(Er.src)),Dt(gr,Er)})}(Nt[St]);if(typeof qt=="object")return qt.value}}function Qu(Te,Fe){var ut,St={del:[],add:[],change:[]};for(ut in Te)Fe[ut]||St.del.push(ut);for(ut in Fe){var Nt=Te[ut],qt=Fe[ut];if(Nt){var lr={name:ut,def:qt,recreate:!1,del:[],add:[],change:[]};if(""+(Nt.primKey.keyPath||"")!=""+(qt.primKey.keyPath||"")||Nt.primKey.auto!==qt.primKey.auto)lr.recreate=!0,St.change.push(lr);else{var gr=Nt.idxByName,Er=qt.idxByName,jt=void 0;for(jt in gr)Er[jt]||lr.del.push(jt);for(jt in Er){var Qt=gr[jt],Gt=Er[jt];Qt?Qt.src!==Gt.src&&lr.change.push(Gt):lr.add.push(Gt)}(0<lr.del.length||0<lr.add.length||0<lr.change.length)&&St.change.push(lr)}}else St.add.push([ut,qt])}return St}function po(Te,Fe,ut,St){var Nt=Te.db.createObjectStore(Fe,ut.keyPath?{keyPath:ut.keyPath,autoIncrement:ut.auto}:{autoIncrement:ut.auto});return St.forEach(function(qt){return Dt(Nt,qt)}),Nt}function Pt(Te,Fe){c(Te).forEach(function(ut){Fe.db.objectStoreNames.contains(ut)||(_t&&console.debug("Dexie: Creating missing table",ut),po(Fe,ut,Te[ut].primKey,Te[ut].indexes))})}function Dt(Te,Fe){Te.createIndex(Fe.name,Fe.keyPath,{unique:Fe.unique,multiEntry:Fe.multi})}function nr(Te,Fe,ut){var St={};return b(Fe.objectStoreNames,0).forEach(function(Nt){for(var qt=ut.objectStore(Nt),lr=kd(Tg(jt=qt.keyPath),jt||"",!0,!1,!!qt.autoIncrement,jt&&typeof jt!="string",!0),gr=[],Er=0;Er<qt.indexNames.length;++Er){var Qt=qt.index(qt.indexNames[Er]),jt=Qt.keyPath,Qt=kd(Qt.name,jt,!!Qt.unique,!!Qt.multiEntry,!1,jt&&typeof jt!="string",!1);gr.push(Qt)}St[Nt]=Rd(Nt,lr,gr)}),St}function ir(Te,Fe,ut){for(var St=ut.db.objectStoreNames,Nt=0;Nt<St.length;++Nt){var qt=St[Nt],lr=ut.objectStore(qt);Te._hasGetAll="getAll"in lr;for(var gr=0;gr<lr.indexNames.length;++gr){var Er=lr.indexNames[gr],jt=lr.index(Er).keyPath,Qt=typeof jt=="string"?jt:"["+b(jt).join("+")+"]";!Fe[qt]||(jt=Fe[qt].idxByName[Qt])&&(jt.name=Er,delete Fe[qt].idxByName[Qt],Fe[qt].idxByName[Er]=jt)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&v.WorkerGlobalScope&&v instanceof v.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(Te._hasGetAll=!1)}function Tr(Te){return Te.split(",").map(function(Fe,ut){var St=(Fe=Fe.trim()).replace(/([&*]|\+\+)/g,""),Nt=/^\[/.test(St)?St.match(/^\[(.*)\]$/)[1].split("+"):St;return kd(St,Nt||null,/\&/.test(Fe),/\*/.test(Fe),/\+\+/.test(Fe),d(Nt),ut===0)})}var Ur=(Wr.prototype._parseStoresSpec=function(Te,Fe){c(Te).forEach(function(ut){if(Te[ut]!==null){var St=Tr(Te[ut]),Nt=St.shift();if(Nt.unique=!0,Nt.multi)throw new be.Schema("Primary key cannot be multi-valued");St.forEach(function(qt){if(qt.auto)throw new be.Schema("Only primary key can be marked as autoIncrement (++)");if(!qt.keyPath)throw new be.Schema("Index must have a name and cannot be an empty string")}),Fe[ut]=Rd(ut,Nt,St)}})},Wr.prototype.stores=function(ut){var Fe=this.db;this._cfg.storesSource=this._cfg.storesSource?p(this._cfg.storesSource,ut):ut;var ut=Fe._versions,St={},Nt={};return ut.forEach(function(qt){p(St,qt._cfg.storesSource),Nt=qt._cfg.dbschema={},qt._parseStoresSpec(St,Nt)}),Fe._dbSchema=Nt,U0(Fe,[Fe._allTables,Fe,Fe.Transaction.prototype]),Rh(Fe,[Fe._allTables,Fe,Fe.Transaction.prototype,this._cfg.tables],c(Nt),Nt),Fe._storeNames=c(Nt),this},Wr.prototype.upgrade=function(Te){return this._cfg.contentUpgrade=Ze(this._cfg.contentUpgrade||me,Te),this},Wr);function Wr(){}function Sn(Te,Fe){var ut=Te._dbNamesDB;return ut||(ut=Te._dbNamesDB=new ec(Fr,{addons:[],indexedDB:Te,IDBKeyRange:Fe})).version(1).stores({dbnames:"name"}),ut.table("dbnames")}function Xn(Te){return Te&&typeof Te.databases=="function"}function Wn(Te){return sr(function(){return Jt.letThrough=!0,Te()})}function Mn(Te){return!("from"in Te)}var Qn=function(Te,Fe){if(!this){var ut=new Qn;return Te&&"d"in Te&&p(ut,Te),ut}p(this,arguments.length?{d:1,from:Te,to:1<arguments.length?Fe:Te}:{d:0})};function Es(Te,Fe,ut){var St=vt(Fe,ut);if(!isNaN(St)){if(0<St)throw RangeError();if(Mn(Te))return p(Te,{from:Fe,to:ut,d:1});var Nt=Te.l,St=Te.r;if(vt(ut,Te.from)<0)return Nt?Es(Nt,Fe,ut):Te.l={from:Fe,to:ut,d:1,l:null,r:null},Hn(Te);if(0<vt(Fe,Te.to))return St?Es(St,Fe,ut):Te.r={from:Fe,to:ut,d:1,l:null,r:null},Hn(Te);vt(Fe,Te.from)<0&&(Te.from=Fe,Te.l=null,Te.d=St?St.d+1:1),0<vt(ut,Te.to)&&(Te.to=ut,Te.r=null,Te.d=Te.l?Te.l.d+1:1),ut=!Te.r,Nt&&!Te.l&&Bs(Te,Nt),St&&ut&&Bs(Te,St)}}function Bs(Te,Fe){Mn(Fe)||function ut(St,Er){var qt=Er.from,lr=Er.to,gr=Er.l,Er=Er.r;Es(St,qt,lr),gr&&ut(St,gr),Er&&ut(St,Er)}(Te,Fe)}function yi(Te,Fe){var ut=xi(Fe),St=ut.next();if(St.done)return!1;for(var Nt=St.value,qt=xi(Te),lr=qt.next(Nt.from),gr=lr.value;!St.done&&!lr.done;){if(vt(gr.from,Nt.to)<=0&&0<=vt(gr.to,Nt.from))return!0;vt(Nt.from,gr.from)<0?Nt=(St=ut.next(gr.from)).value:gr=(lr=qt.next(Nt.from)).value}return!1}function xi(Te){var Fe=Mn(Te)?null:{s:0,n:Te};return{next:function(ut){for(var St=0<arguments.length;Fe;)switch(Fe.s){case 0:if(Fe.s=1,St)for(;Fe.n.l&&vt(ut,Fe.n.from)<0;)Fe={up:Fe,n:Fe.n.l,s:1};else for(;Fe.n.l;)Fe={up:Fe,n:Fe.n.l,s:1};case 1:if(Fe.s=2,!St||vt(ut,Fe.n.to)<=0)return{value:Fe.n,done:!1};case 2:if(Fe.n.r){Fe.s=3,Fe={up:Fe,n:Fe.n.r,s:0};continue}case 3:Fe=Fe.up}return{done:!0}}}}function Hn(Te){var Fe,ut,St=(((Fe=Te.r)===null||Fe===void 0?void 0:Fe.d)||0)-(((ut=Te.l)===null||ut===void 0?void 0:ut.d)||0),Nt=1<St?"r":St<-1?"l":"";Nt&&(Fe=Nt=="r"?"l":"r",ut=w({},Te),St=Te[Nt],Te.from=St.from,Te.to=St.to,Te[Nt]=St[Nt],ut[Nt]=St[Fe],(Te[Fe]=ut).d=Os(ut)),Te.d=Os(Te)}function Os(ut){var Fe=ut.r,ut=ut.l;return(Fe?ut?Math.max(Fe.d,ut.d):Fe.d:ut?ut.d:0)+1}function Zs(Te,Fe){return c(Fe).forEach(function(ut){Te[ut]?Bs(Te[ut],Fe[ut]):Te[ut]=function St(Nt){var qt,lr,gr={};for(qt in Nt)x(Nt,qt)&&(lr=Nt[qt],gr[qt]=!lr||typeof lr!="object"||he.has(lr.constructor)?lr:St(lr));return gr}(Fe[ut])}),Te}function Po(Te,Fe){return Te.all||Fe.all||Object.keys(Te).some(function(ut){return Fe[ut]&&yi(Fe[ut],Te[ut])})}R(Qn.prototype,((Oc={add:function(Te){return Bs(this,Te),this},addKey:function(Te){return Es(this,Te,Te),this},addKeys:function(Te){var Fe=this;return Te.forEach(function(ut){return Es(Fe,ut,ut)}),this},hasKey:function(Te){var Fe=xi(this).next(Te).value;return Fe&&vt(Fe.from,Te)<=0&&0<=vt(Fe.to,Te)}})[T]=function(){return xi(this)},Oc));var Fo={},na={},ku=!1;function Mr(Te){Zs(na,Te),ku||(ku=!0,setTimeout(function(){ku=!1,Jl(na,!(na={}))},0))}function Jl(Te,Fe){Fe===void 0&&(Fe=!1);var ut=new Set;if(Te.all)for(var St=0,Nt=Object.values(Fo);St<Nt.length;St++)gn(lr=Nt[St],Te,ut,Fe);else for(var qt in Te){var lr,gr=/^idb\:\/\/(.*)\/(.*)\//.exec(qt);gr&&(qt=gr[1],gr=gr[2],(lr=Fo["idb://".concat(qt,"/").concat(gr)])&&gn(lr,Te,ut,Fe))}ut.forEach(function(Er){return Er()})}function gn(Te,Fe,ut,St){for(var Nt=[],qt=0,lr=Object.entries(Te.queries.query);qt<lr.length;qt++){for(var gr=lr[qt],Er=gr[0],jt=[],Qt=0,Gt=gr[1];Qt<Gt.length;Qt++){var br=Gt[Qt];Po(Fe,br.obsSet)?br.subscribers.forEach(function(Ir){return ut.add(Ir)}):St&&jt.push(br)}St&&Nt.push([Er,jt])}if(St)for(var yr=0,Sr=Nt;yr<Sr.length;yr++){var Or=Sr[yr],Er=Or[0],jt=Or[1];Te.queries.query[Er]=jt}}function Ch(Te){var Fe=Te._state,ut=Te._deps.indexedDB;if(Fe.isBeingOpened||Te.idbdb)return Fe.dbReadyPromise.then(function(){return Fe.dbOpenError?pn(Fe.dbOpenError):Te});Fe.isBeingOpened=!0,Fe.dbOpenError=null,Fe.openComplete=!1;var St=Fe.openCanceller,Nt=Math.round(10*Te.verno),qt=!1;function lr(){if(Fe.openCanceller!==St)throw new be.DatabaseClosed("db.open() was cancelled")}function gr(){return new Yt(function(br,yr){if(lr(),!ut)throw new be.MissingAPI;var Sr=Te.name,Or=Fe.autoSchema||!Nt?ut.open(Sr):ut.open(Sr,Nt);if(!Or)throw new be.MissingAPI;Or.onerror=Su(yr),Or.onblocked=Wt(Te._fireOnBlocked),Or.onupgradeneeded=Wt(function(Ir){var Vr;Qt=Or.transaction,Fe.autoSchema&&!Te._options.allowEmptyDB?(Or.onerror=Yl,Qt.abort(),Or.result.close(),(Vr=ut.deleteDatabase(Sr)).onsuccess=Vr.onerror=Wt(function(){yr(new be.NoSuchDatabase("Database ".concat(Sr," doesnt exist")))})):(Qt.onerror=Su(yr),Ir=Ir.oldVersion>Math.pow(2,62)?0:Ir.oldVersion,Gt=Ir<1,Te.idbdb=Or.result,qt&&Sg(Te,Qt),Co(Te,Ir/10,Qt,yr))},yr),Or.onsuccess=Wt(function(){Qt=null;var Ir,Vr,Gr,jr,dn,Pn=Te.idbdb=Or.result,Dn=b(Pn.objectStoreNames);if(0<Dn.length)try{var Cn=Pn.transaction((jr=Dn).length===1?jr[0]:jr,"readonly");if(Fe.autoSchema)Vr=Pn,Gr=Cn,(Ir=Te).verno=Vr.version/10,Gr=Ir._dbSchema=nr(0,Vr,Gr),Ir._storeNames=b(Vr.objectStoreNames,0),Rh(Ir,[Ir._allTables],c(Gr),Gr);else if(ir(Te,Te._dbSchema,Cn),((dn=Qu(nr(0,(dn=Te).idbdb,Cn),dn._dbSchema)).add.length||dn.change.some(function(Ln){return Ln.add.length||Ln.change.length}))&&!qt)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),Pn.close(),Nt=Pn.version+1,qt=!0,br(gr());Xl(Te,Cn)}catch{}yn.push(Te),Pn.onversionchange=Wt(function(Ln){Fe.vcFired=!0,Te.on("versionchange").fire(Ln)}),Pn.onclose=Wt(function(Ln){Te.on("close").fire(Ln)}),Gt&&(dn=Te._deps,Cn=Sr,Pn=dn.indexedDB,dn=dn.IDBKeyRange,Xn(Pn)||Cn===Fr||Sn(Pn,dn).put({name:Cn}).catch(me)),br()},yr)}).catch(function(br){switch(br?.name){case"UnknownError":if(0<Fe.PR1398_maxLoop)return Fe.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),gr();break;case"VersionError":if(0<Nt)return Nt=0,gr()}return Yt.reject(br)})}var Er,jt=Fe.dbReadyResolve,Qt=null,Gt=!1;return Yt.race([St,(typeof navigator>"u"?Yt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(br){function yr(){return indexedDB.databases().finally(br)}Er=setInterval(yr,100),yr()}).finally(function(){return clearInterval(Er)}):Promise.resolve()).then(gr)]).then(function(){return lr(),Fe.onReadyBeingFired=[],Yt.resolve(Wn(function(){return Te.on.ready.fire(Te.vip)})).then(function br(){if(0<Fe.onReadyBeingFired.length){var yr=Fe.onReadyBeingFired.reduce(Ze,me);return Fe.onReadyBeingFired=[],Yt.resolve(Wn(function(){return yr(Te.vip)})).then(br)}})}).finally(function(){Fe.openCanceller===St&&(Fe.onReadyBeingFired=null,Fe.isBeingOpened=!1)}).catch(function(br){Fe.dbOpenError=br;try{Qt&&Qt.abort()}catch{}return St===Fe.openCanceller&&Te._close(),pn(br)}).finally(function(){Fe.openComplete=!0,jt()}).then(function(){var br;return Gt&&(br={},Te.tables.forEach(function(yr){yr.schema.indexes.forEach(function(Sr){Sr.name&&(br["idb://".concat(Te.name,"/").concat(yr.name,"/").concat(Sr.name)]=new Qn(-1/0,[[[]]]))}),br["idb://".concat(Te.name,"/").concat(yr.name,"/")]=br["idb://".concat(Te.name,"/").concat(yr.name,"/:dels")]=new Qn(-1/0,[[[]]])}),Bc(Th).fire(br),Jl(br,!0)),Te})}function bs(Te){function Fe(qt){return Te.next(qt)}var ut=Nt(Fe),St=Nt(function(qt){return Te.throw(qt)});function Nt(qt){return function(Er){var gr=qt(Er),Er=gr.value;return gr.done?Er:Er&&typeof Er.then=="function"?Er.then(ut,St):d(Er)?Promise.all(Er).then(ut,St):ut(Er)}}return Nt(Fe)()}function Ig(Te,Fe,ut){for(var St=d(Te)?Te.slice():[Te],Nt=0;Nt<ut;++Nt)St.push(Fe);return St}var Nm={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(Te){return w(w({},Te),{table:function(Fe){var ut=Te.table(Fe),St=ut.schema,Nt={},qt=[];function lr(Gt,br,yr){var Sr=Wa(Gt),Or=Nt[Sr]=Nt[Sr]||[],Ir=Gt==null?0:typeof Gt=="string"?1:Gt.length,Vr=0<br,Vr=w(w({},yr),{name:Vr?"".concat(Sr,"(virtual-from:").concat(yr.name,")"):yr.name,lowLevelIndex:yr,isVirtual:Vr,keyTail:br,keyLength:Ir,extractKey:Ds(Gt),unique:!Vr&&yr.unique});return Or.push(Vr),Vr.isPrimaryKey||qt.push(Vr),1<Ir&&lr(Ir===2?Gt[0]:Gt.slice(0,Ir-1),br+1,yr),Or.sort(function(Gr,jr){return Gr.keyTail-jr.keyTail}),Vr}Fe=lr(St.primaryKey.keyPath,0,St.primaryKey),Nt[":id"]=[Fe];for(var gr=0,Er=St.indexes;gr<Er.length;gr++){var jt=Er[gr];lr(jt.keyPath,0,jt)}function Qt(Gt){var br,yr=Gt.query.index;return yr.isVirtual?w(w({},Gt),{query:{index:yr.lowLevelIndex,range:(br=Gt.query.range,yr=yr.keyTail,{type:br.type===1?2:br.type,lower:Ig(br.lower,br.lowerOpen?Te.MAX_KEY:Te.MIN_KEY,yr),lowerOpen:!0,upper:Ig(br.upper,br.upperOpen?Te.MIN_KEY:Te.MAX_KEY,yr),upperOpen:!0})}}):Gt}return w(w({},ut),{schema:w(w({},St),{primaryKey:Fe,indexes:qt,getIndexByKeyPath:function(Gt){return(Gt=Nt[Wa(Gt)])&&Gt[0]}}),count:function(Gt){return ut.count(Qt(Gt))},query:function(Gt){return ut.query(Qt(Gt))},openCursor:function(Gt){var br=Gt.query.index,yr=br.keyTail,Sr=br.isVirtual,Or=br.keyLength;return Sr?ut.openCursor(Qt(Gt)).then(function(Vr){return Vr&&Ir(Vr)}):ut.openCursor(Gt);function Ir(Vr){return Object.create(Vr,{continue:{value:function(Gr){Gr!=null?Vr.continue(Ig(Gr,Gt.reverse?Te.MAX_KEY:Te.MIN_KEY,yr)):Gt.unique?Vr.continue(Vr.key.slice(0,Or).concat(Gt.reverse?Te.MIN_KEY:Te.MAX_KEY,yr)):Vr.continue()}},continuePrimaryKey:{value:function(Gr,jr){Vr.continuePrimaryKey(Ig(Gr,Te.MAX_KEY,yr),jr)}},primaryKey:{get:function(){return Vr.primaryKey}},key:{get:function(){var Gr=Vr.key;return Or===1?Gr[0]:Gr.slice(0,Or)}},value:{get:function(){return Vr.value}}})}}})}})}};function Bf(Te,Fe,ut,St){return ut=ut||{},St=St||"",c(Te).forEach(function(Nt){var qt,lr,gr;x(Fe,Nt)?(qt=Te[Nt],lr=Fe[Nt],typeof qt=="object"&&typeof lr=="object"&&qt&&lr?(gr=$(qt))!==$(lr)?ut[St+Nt]=Fe[Nt]:gr==="Object"?Bf(qt,lr,ut,St+Nt+"."):qt!==lr&&(ut[St+Nt]=Fe[Nt]):qt!==lr&&(ut[St+Nt]=Fe[Nt])):ut[St+Nt]=void 0}),c(Fe).forEach(function(Nt){x(Te,Nt)||(ut[St+Nt]=Fe[Nt])}),ut}function F0(Te,Fe){return Fe.type==="delete"?Fe.keys:Fe.keys||Fe.values.map(Te.extractKey)}var lv={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(Te){return w(w({},Te),{table:function(Fe){var ut=Te.table(Fe),St=ut.schema.primaryKey;return w(w({},ut),{mutate:function(Nt){var qt=Jt.trans,lr=qt.table(Fe).hook,gr=lr.deleting,Er=lr.creating,jt=lr.updating;switch(Nt.type){case"add":if(Er.fire===me)break;return qt._promise("readwrite",function(){return Qt(Nt)},!0);case"put":if(Er.fire===me&&jt.fire===me)break;return qt._promise("readwrite",function(){return Qt(Nt)},!0);case"delete":if(gr.fire===me)break;return qt._promise("readwrite",function(){return Qt(Nt)},!0);case"deleteRange":if(gr.fire===me)break;return qt._promise("readwrite",function(){return function Gt(br,yr,Sr){return ut.query({trans:br,values:!1,query:{index:St,range:yr},limit:Sr}).then(function(Or){var Ir=Or.result;return Qt({type:"delete",keys:Ir,trans:br}).then(function(Vr){return 0<Vr.numFailures?Promise.reject(Vr.failures[0]):Ir.length<Sr?{failures:[],numFailures:0,lastResult:void 0}:Gt(br,w(w({},yr),{lower:Ir[Ir.length-1],lowerOpen:!0}),Sr)})})}(Nt.trans,Nt.range,1e4)},!0)}return ut.mutate(Nt);function Qt(Gt){var br,yr,Sr,Or=Jt.trans,Ir=Gt.keys||F0(St,Gt);if(!Ir)throw new Error("Keys missing");return(Gt=Gt.type==="add"||Gt.type==="put"?w(w({},Gt),{keys:Ir}):w({},Gt)).type!=="delete"&&(Gt.values=E([],Gt.values,!0)),Gt.keys&&(Gt.keys=E([],Gt.keys,!0)),br=ut,Sr=Ir,((yr=Gt).type==="add"?Promise.resolve([]):br.getMany({trans:yr.trans,keys:Sr,cache:"immutable"})).then(function(Vr){var Gr=Ir.map(function(jr,dn){var Pn,Dn,Cn,Ln=Vr[dn],Yr={onerror:null,onsuccess:null};return Gt.type==="delete"?gr.fire.call(Yr,jr,Ln,Or):Gt.type==="add"||Ln===void 0?(Pn=Er.fire.call(Yr,jr,Gt.values[dn],Or),jr==null&&Pn!=null&&(Gt.keys[dn]=jr=Pn,St.outbound||X(Gt.values[dn],St.keyPath,jr))):(Pn=Bf(Ln,Gt.values[dn]),(Dn=jt.fire.call(Yr,Pn,jr,Ln,Or))&&(Cn=Gt.values[dn],Object.keys(Dn).forEach(function(Un){x(Cn,Un)?Cn[Un]=Dn[Un]:X(Cn,Un,Dn[Un])}))),Yr});return ut.mutate(Gt).then(function(jr){for(var dn=jr.failures,Pn=jr.results,Dn=jr.numFailures,jr=jr.lastResult,Cn=0;Cn<Ir.length;++Cn){var Ln=(Pn||Ir)[Cn],Yr=Gr[Cn];Ln==null?Yr.onerror&&Yr.onerror(dn[Cn]):Yr.onsuccess&&Yr.onsuccess(Gt.type==="put"&&Vr[Cn]?Gt.values[Cn]:Ln)}return{failures:dn,results:Pn,numFailures:Dn,lastResult:jr}}).catch(function(jr){return Gr.forEach(function(dn){return dn.onerror&&dn.onerror(jr)}),Promise.reject(jr)})})}}})}})}};function ma(Te,Fe,ut){try{if(!Fe||Fe.keys.length<Te.length)return null;for(var St=[],Nt=0,qt=0;Nt<Fe.keys.length&&qt<Te.length;++Nt)vt(Fe.keys[Nt],Te[qt])===0&&(St.push(ut?B(Fe.values[Nt]):Fe.values[Nt]),++qt);return St.length===Te.length?St:null}catch{return null}}var kg={stack:"dbcore",level:-1,create:function(Te){return{table:function(Fe){var ut=Te.table(Fe);return w(w({},ut),{getMany:function(St){if(!St.cache)return ut.getMany(St);var Nt=ma(St.keys,St.trans._cache,St.cache==="clone");return Nt?Yt.resolve(Nt):ut.getMany(St).then(function(qt){return St.trans._cache={keys:St.keys,values:St.cache==="clone"?B(qt):qt},qt})},mutate:function(St){return St.type!=="add"&&(St.trans._cache=null),ut.mutate(St)}})}}}};function Mm(Te,Fe){return Te.trans.mode==="readonly"&&!!Te.subscr&&!Te.trans.explicit&&Te.trans.db._options.cache!=="disabled"&&!Fe.schema.primaryKey.outbound}function lA(Te,Fe){switch(Te){case"query":return Fe.values&&!Fe.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var fv={stack:"dbcore",level:0,name:"Observability",create:function(Te){var Fe=Te.schema.name,ut=new Qn(Te.MIN_KEY,Te.MAX_KEY);return w(w({},Te),{transaction:function(St,Nt,qt){if(Jt.subscr&&Nt!=="readonly")throw new be.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Jt.querier));return Te.transaction(St,Nt,qt)},table:function(St){var Nt=Te.table(St),qt=Nt.schema,lr=qt.primaryKey,Gt=qt.indexes,gr=lr.extractKey,Er=lr.outbound,jt=lr.autoIncrement&&Gt.filter(function(yr){return yr.compound&&yr.keyPath.includes(lr.keyPath)}),Qt=w(w({},Nt),{mutate:function(yr){function Sr(Un){return Un="idb://".concat(Fe,"/").concat(St,"/").concat(Un),jr[Un]||(jr[Un]=new Qn)}var Or,Ir,Vr,Gr=yr.trans,jr=yr.mutatedParts||(yr.mutatedParts={}),dn=Sr(""),Pn=Sr(":dels"),Dn=yr.type,Yr=yr.type==="deleteRange"?[yr.range]:yr.type==="delete"?[yr.keys]:yr.values.length<50?[F0(lr,yr).filter(function(Un){return Un}),yr.values]:[],Cn=Yr[0],Ln=Yr[1],Yr=yr.trans._cache;return d(Cn)?(dn.addKeys(Cn),(Yr=Dn==="delete"||Cn.length===Ln.length?ma(Cn,Yr):null)||Pn.addKeys(Cn),(Yr||Ln)&&(Or=Sr,Ir=Yr,Vr=Ln,qt.indexes.forEach(function(Un){var ii=Or(Un.name||"");function Hi(Bi){return Bi!=null?Un.extractKey(Bi):null}function Zi(Bi){return Un.multiEntry&&d(Bi)?Bi.forEach(function(Cu){return ii.addKey(Cu)}):ii.addKey(Bi)}(Ir||Vr).forEach(function(Bi,Li){var Si=Ir&&Hi(Ir[Li]),Li=Vr&&Hi(Vr[Li]);vt(Si,Li)!==0&&(Si!=null&&Zi(Si),Li!=null&&Zi(Li))})}))):Cn?(Ln={from:(Ln=Cn.lower)!==null&&Ln!==void 0?Ln:Te.MIN_KEY,to:(Ln=Cn.upper)!==null&&Ln!==void 0?Ln:Te.MAX_KEY},Pn.add(Ln),dn.add(Ln)):(dn.add(ut),Pn.add(ut),qt.indexes.forEach(function(Un){return Sr(Un.name).add(ut)})),Nt.mutate(yr).then(function(Un){return!Cn||yr.type!=="add"&&yr.type!=="put"||(dn.addKeys(Un.results),jt&&jt.forEach(function(ii){for(var Hi=yr.values.map(function(Si){return ii.extractKey(Si)}),Zi=ii.keyPath.findIndex(function(Si){return Si===lr.keyPath}),Bi=0,Cu=Un.results.length;Bi<Cu;++Bi)Hi[Bi][Zi]=Un.results[Bi];Sr(ii.name).addKeys(Hi)})),Gr.mutatedParts=Zs(Gr.mutatedParts||{},jr),Un})}}),Gt=function(Sr){var Or=Sr.query,Sr=Or.index,Or=Or.range;return[Sr,new Qn((Sr=Or.lower)!==null&&Sr!==void 0?Sr:Te.MIN_KEY,(Or=Or.upper)!==null&&Or!==void 0?Or:Te.MAX_KEY)]},br={get:function(yr){return[lr,new Qn(yr.key)]},getMany:function(yr){return[lr,new Qn().addKeys(yr.keys)]},count:Gt,query:Gt,openCursor:Gt};return c(br).forEach(function(yr){Qt[yr]=function(Sr){var Or=Jt.subscr,Ir=!!Or,Vr=Mm(Jt,Nt)&&lA(yr,Sr)?Sr.obsSet={}:Or;if(Ir){var Gr=function(Ln){return Ln="idb://".concat(Fe,"/").concat(St,"/").concat(Ln),Vr[Ln]||(Vr[Ln]=new Qn)},jr=Gr(""),dn=Gr(":dels"),Or=br[yr](Sr),Ir=Or[0],Or=Or[1];if((yr==="query"&&Ir.isPrimaryKey&&!Sr.values?dn:Gr(Ir.name||"")).add(Or),!Ir.isPrimaryKey){if(yr!=="count"){var Pn=yr==="query"&&Er&&Sr.values&&Nt.query(w(w({},Sr),{values:!1}));return Nt[yr].apply(this,arguments).then(function(Ln){if(yr==="query"){if(Er&&Sr.values)return Pn.then(function(Hi){return Hi=Hi.result,jr.addKeys(Hi),Ln});var Yr=Sr.values?Ln.result.map(gr):Ln.result;(Sr.values?jr:dn).addKeys(Yr)}else if(yr==="openCursor"){var Un=Ln,ii=Sr.values;return Un&&Object.create(Un,{key:{get:function(){return dn.addKey(Un.primaryKey),Un.key}},primaryKey:{get:function(){var Hi=Un.primaryKey;return dn.addKey(Hi),Hi}},value:{get:function(){return ii&&jr.addKey(Un.primaryKey),Un.value}}})}return Ln})}dn.add(ut)}}return Nt[yr].apply(this,arguments)}}),Qt}})}};function Ha(Te,Fe,ut){if(ut.numFailures===0)return Fe;if(Fe.type==="deleteRange")return null;var St=Fe.keys?Fe.keys.length:"values"in Fe&&Fe.values?Fe.values.length:1;return ut.numFailures===St?null:(Fe=w({},Fe),d(Fe.keys)&&(Fe.keys=Fe.keys.filter(function(Nt,qt){return!(qt in ut.failures)})),"values"in Fe&&d(Fe.values)&&(Fe.values=Fe.values.filter(function(Nt,qt){return!(qt in ut.failures)})),Fe)}function xd(Te,Fe){return ut=Te,((St=Fe).lower===void 0||(St.lowerOpen?0<vt(ut,St.lower):0<=vt(ut,St.lower)))&&(Te=Te,(Fe=Fe).upper===void 0||(Fe.upperOpen?vt(Te,Fe.upper)<0:vt(Te,Fe.upper)<=0));var ut,St}function Ql(Te,Fe,br,St,Nt,qt){if(!br||br.length===0)return Te;var lr=Fe.query.index,gr=lr.multiEntry,Er=Fe.query.range,jt=St.schema.primaryKey.extractKey,Qt=lr.extractKey,Gt=(lr.lowLevelIndex||lr).extractKey,br=br.reduce(function(yr,Sr){var Or=yr,Ir=[];if(Sr.type==="add"||Sr.type==="put")for(var Vr=new Qn,Gr=Sr.values.length-1;0<=Gr;--Gr){var jr,dn=Sr.values[Gr],Pn=jt(dn);Vr.hasKey(Pn)||(jr=Qt(dn),(gr&&d(jr)?jr.some(function(Un){return xd(Un,Er)}):xd(jr,Er))&&(Vr.addKey(Pn),Ir.push(dn)))}switch(Sr.type){case"add":var Dn=new Qn().addKeys(Fe.values?yr.map(function(ii){return jt(ii)}):yr),Or=yr.concat(Fe.values?Ir.filter(function(ii){return ii=jt(ii),!Dn.hasKey(ii)&&(Dn.addKey(ii),!0)}):Ir.map(function(ii){return jt(ii)}).filter(function(ii){return!Dn.hasKey(ii)&&(Dn.addKey(ii),!0)}));break;case"put":var Cn=new Qn().addKeys(Sr.values.map(function(ii){return jt(ii)}));Or=yr.filter(function(ii){return!Cn.hasKey(Fe.values?jt(ii):ii)}).concat(Fe.values?Ir:Ir.map(function(ii){return jt(ii)}));break;case"delete":var Ln=new Qn().addKeys(Sr.keys);Or=yr.filter(function(ii){return!Ln.hasKey(Fe.values?jt(ii):ii)});break;case"deleteRange":var Yr=Sr.range;Or=yr.filter(function(ii){return!xd(jt(ii),Yr)})}return Or},Te);return br===Te?Te:(br.sort(function(yr,Sr){return vt(Gt(yr),Gt(Sr))||vt(jt(yr),jt(Sr))}),Fe.limit&&Fe.limit<1/0&&(br.length>Fe.limit?br.length=Fe.limit:Te.length===Fe.limit&&br.length<Fe.limit&&(Nt.dirty=!0)),qt?Object.freeze(br):br)}function Lm(Te,Fe){return vt(Te.lower,Fe.lower)===0&&vt(Te.upper,Fe.upper)===0&&!!Te.lowerOpen==!!Fe.lowerOpen&&!!Te.upperOpen==!!Fe.upperOpen}function ll(Te,Fe){return function(ut,St,Nt,qt){if(ut===void 0)return St!==void 0?-1:0;if(St===void 0)return 1;if((St=vt(ut,St))===0){if(Nt&&qt)return 0;if(Nt)return 1;if(qt)return-1}return St}(Te.lower,Fe.lower,Te.lowerOpen,Fe.lowerOpen)<=0&&0<=function(ut,St,Nt,qt){if(ut===void 0)return St!==void 0?1:0;if(St===void 0)return-1;if((St=vt(ut,St))===0){if(Nt&&qt)return 0;if(Nt)return-1;if(qt)return 1}return St}(Te.upper,Fe.upper,Te.upperOpen,Fe.upperOpen)}function fA(Te,Fe,ut,St){Te.subscribers.add(ut),St.addEventListener("abort",function(){var Nt,qt;Te.subscribers.delete(ut),Te.subscribers.size===0&&(Nt=Te,qt=Fe,setTimeout(function(){Nt.subscribers.size===0&&j(qt,Nt)},3e3))})}var Dm={stack:"dbcore",level:0,name:"Cache",create:function(Te){var Fe=Te.schema.name;return w(w({},Te),{transaction:function(ut,St,Nt){var qt,lr,gr=Te.transaction(ut,St,Nt);return St==="readwrite"&&(lr=(qt=new AbortController).signal,Nt=function(Er){return function(){if(qt.abort(),St==="readwrite"){for(var jt=new Set,Qt=0,Gt=ut;Qt<Gt.length;Qt++){var br=Gt[Qt],yr=Fo["idb://".concat(Fe,"/").concat(br)];if(yr){var Sr=Te.table(br),Or=yr.optimisticOps.filter(function(ii){return ii.trans===gr});if(gr._explicit&&Er&&gr.mutatedParts)for(var Ir=0,Vr=Object.values(yr.queries.query);Ir<Vr.length;Ir++)for(var Gr=0,jr=(Dn=Vr[Ir]).slice();Gr<jr.length;Gr++)Po((Cn=jr[Gr]).obsSet,gr.mutatedParts)&&(j(Dn,Cn),Cn.subscribers.forEach(function(ii){return jt.add(ii)}));else if(0<Or.length){yr.optimisticOps=yr.optimisticOps.filter(function(ii){return ii.trans!==gr});for(var dn=0,Pn=Object.values(yr.queries.query);dn<Pn.length;dn++)for(var Dn,Cn,Ln,Yr=0,Un=(Dn=Pn[dn]).slice();Yr<Un.length;Yr++)(Cn=Un[Yr]).res!=null&&gr.mutatedParts&&(Er&&!Cn.dirty?(Ln=Object.isFrozen(Cn.res),Ln=Ql(Cn.res,Cn.req,Or,Sr,Cn,Ln),Cn.dirty?(j(Dn,Cn),Cn.subscribers.forEach(function(ii){return jt.add(ii)})):Ln!==Cn.res&&(Cn.res=Ln,Cn.promise=Yt.resolve({result:Ln}))):(Cn.dirty&&j(Dn,Cn),Cn.subscribers.forEach(function(ii){return jt.add(ii)})))}}}jt.forEach(function(ii){return ii()})}}},gr.addEventListener("abort",Nt(!1),{signal:lr}),gr.addEventListener("error",Nt(!1),{signal:lr}),gr.addEventListener("complete",Nt(!0),{signal:lr})),gr},table:function(ut){var St=Te.table(ut),Nt=St.schema.primaryKey;return w(w({},St),{mutate:function(qt){var lr=Jt.trans;if(Nt.outbound||lr.db._options.cache==="disabled"||lr.explicit||lr.idbtrans.mode!=="readwrite")return St.mutate(qt);var gr=Fo["idb://".concat(Fe,"/").concat(ut)];return gr?(lr=St.mutate(qt),qt.type!=="add"&&qt.type!=="put"||!(50<=qt.values.length||F0(Nt,qt).some(function(Er){return Er==null}))?(gr.optimisticOps.push(qt),qt.mutatedParts&&Mr(qt.mutatedParts),lr.then(function(Er){0<Er.numFailures&&(j(gr.optimisticOps,qt),(Er=Ha(0,qt,Er))&&gr.optimisticOps.push(Er),qt.mutatedParts&&Mr(qt.mutatedParts))}),lr.catch(function(){j(gr.optimisticOps,qt),qt.mutatedParts&&Mr(qt.mutatedParts)})):lr.then(function(Er){var jt=Ha(0,w(w({},qt),{values:qt.values.map(function(Qt,Gt){var br;return Er.failures[Gt]?Qt:(Qt=(br=Nt.keyPath)!==null&&br!==void 0&&br.includes(".")?B(Qt):w({},Qt),X(Qt,Nt.keyPath,Er.results[Gt]),Qt)})}),Er);gr.optimisticOps.push(jt),queueMicrotask(function(){return qt.mutatedParts&&Mr(qt.mutatedParts)})}),lr):St.mutate(qt)},query:function(qt){if(!Mm(Jt,St)||!lA("query",qt))return St.query(qt);var lr=((jt=Jt.trans)===null||jt===void 0?void 0:jt.db._options.cache)==="immutable",Gt=Jt,gr=Gt.requery,Er=Gt.signal,jt=function(Sr,Or,Ir,Vr){var Gr=Fo["idb://".concat(Sr,"/").concat(Or)];if(!Gr)return[];if(!(Or=Gr.queries[Ir]))return[null,!1,Gr,null];var jr=Or[(Vr.query?Vr.query.index.name:null)||""];if(!jr)return[null,!1,Gr,null];switch(Ir){case"query":var dn=jr.find(function(Pn){return Pn.req.limit===Vr.limit&&Pn.req.values===Vr.values&&Lm(Pn.req.query.range,Vr.query.range)});return dn?[dn,!0,Gr,jr]:[jr.find(function(Pn){return("limit"in Pn.req?Pn.req.limit:1/0)>=Vr.limit&&(!Vr.values||Pn.req.values)&&ll(Pn.req.query.range,Vr.query.range)}),!1,Gr,jr];case"count":return dn=jr.find(function(Pn){return Lm(Pn.req.query.range,Vr.query.range)}),[dn,!!dn,Gr,jr]}}(Fe,ut,"query",qt),Qt=jt[0],Gt=jt[1],br=jt[2],yr=jt[3];return Qt&&Gt?Qt.obsSet=qt.obsSet:(Gt=St.query(qt).then(function(Sr){var Or=Sr.result;if(Qt&&(Qt.res=Or),lr){for(var Ir=0,Vr=Or.length;Ir<Vr;++Ir)Object.freeze(Or[Ir]);Object.freeze(Or)}else Sr.result=B(Or);return Sr}).catch(function(Sr){return yr&&Qt&&j(yr,Qt),Promise.reject(Sr)}),Qt={obsSet:qt.obsSet,promise:Gt,subscribers:new Set,type:"query",req:qt,dirty:!1},yr?yr.push(Qt):(yr=[Qt],(br=br||(Fo["idb://".concat(Fe,"/").concat(ut)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[qt.query.index.name||""]=yr)),fA(Qt,yr,gr,Er),Qt.promise.then(function(Sr){return{result:Ql(Sr.result,qt,br?.optimisticOps,St,Qt,lr)}})}})}})}};function W0(Te,Fe){return new Proxy(Te,{get:function(ut,St,Nt){return St==="db"?Fe:Reflect.get(ut,St,Nt)}})}var ec=(Yo.prototype.version=function(Te){if(isNaN(Te)||Te<.1)throw new be.Type("Given version is not a positive number");if(Te=Math.round(10*Te)/10,this.idbdb||this._state.isBeingOpened)throw new be.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,Te);var Fe=this._versions,ut=Fe.filter(function(St){return St._cfg.version===Te})[0];return ut||(ut=new this.Version(Te),Fe.push(ut),Fe.sort(cv),ut.stores({}),this._state.autoSchema=!1,ut)},Yo.prototype._whenReady=function(Te){var Fe=this;return this.idbdb&&(this._state.openComplete||Jt.letThrough||this._vip)?Te():new Yt(function(ut,St){if(Fe._state.openComplete)return St(new be.DatabaseClosed(Fe._state.dbOpenError));if(!Fe._state.isBeingOpened){if(!Fe._state.autoOpen)return void St(new be.DatabaseClosed);Fe.open().catch(me)}Fe._state.dbReadyPromise.then(ut,St)}).then(Te)},Yo.prototype.use=function(Te){var Fe=Te.stack,ut=Te.create,St=Te.level,Nt=Te.name;return Nt&&this.unuse({stack:Fe,name:Nt}),Te=this._middlewares[Fe]||(this._middlewares[Fe]=[]),Te.push({stack:Fe,create:ut,level:St??10,name:Nt}),Te.sort(function(qt,lr){return qt.level-lr.level}),this},Yo.prototype.unuse=function(Te){var Fe=Te.stack,ut=Te.name,St=Te.create;return Fe&&this._middlewares[Fe]&&(this._middlewares[Fe]=this._middlewares[Fe].filter(function(Nt){return St?Nt.create!==St:!!ut&&Nt.name!==ut})),this},Yo.prototype.open=function(){var Te=this;return Hr(ft,function(){return Ch(Te)})},Yo.prototype._close=function(){var Te=this._state,Fe=yn.indexOf(this);if(0<=Fe&&yn.splice(Fe,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}Te.isBeingOpened||(Te.dbReadyPromise=new Yt(function(ut){Te.dbReadyResolve=ut}),Te.openCanceller=new Yt(function(ut,St){Te.cancelOpen=St}))},Yo.prototype.close=function(ut){var Fe=(ut===void 0?{disableAutoOpen:!0}:ut).disableAutoOpen,ut=this._state;Fe?(ut.isBeingOpened&&ut.cancelOpen(new be.DatabaseClosed),this._close(),ut.autoOpen=!1,ut.dbOpenError=new be.DatabaseClosed):(this._close(),ut.autoOpen=this._options.autoOpen||ut.isBeingOpened,ut.openComplete=!1,ut.dbOpenError=null)},Yo.prototype.delete=function(Te){var Fe=this;Te===void 0&&(Te={disableAutoOpen:!0});var ut=0<arguments.length&&typeof arguments[0]!="object",St=this._state;return new Yt(function(Nt,qt){function lr(){Fe.close(Te);var gr=Fe._deps.indexedDB.deleteDatabase(Fe.name);gr.onsuccess=Wt(function(){var Er,jt,Qt;Er=Fe._deps,jt=Fe.name,Qt=Er.indexedDB,Er=Er.IDBKeyRange,Xn(Qt)||jt===Fr||Sn(Qt,Er).delete(jt).catch(me),Nt()}),gr.onerror=Su(qt),gr.onblocked=Fe._fireOnBlocked}if(ut)throw new be.InvalidArgument("Invalid closeOptions argument to db.delete()");St.isBeingOpened?St.dbReadyPromise.then(lr):lr()})},Yo.prototype.backendDB=function(){return this.idbdb},Yo.prototype.isOpen=function(){return this.idbdb!==null},Yo.prototype.hasBeenClosed=function(){var Te=this._state.dbOpenError;return Te&&Te.name==="DatabaseClosed"},Yo.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Yo.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Yo.prototype,"tables",{get:function(){var Te=this;return c(this._allTables).map(function(Fe){return Te._allTables[Fe]})},enumerable:!1,configurable:!0}),Yo.prototype.transaction=function(){var Te=function(Fe,ut,St){var Nt=arguments.length;if(Nt<2)throw new be.InvalidArgument("Too few arguments");for(var qt=new Array(Nt-1);--Nt;)qt[Nt-1]=arguments[Nt];return St=qt.pop(),[Fe,ye(qt),St]}.apply(this,arguments);return this._transaction.apply(this,Te)},Yo.prototype._transaction=function(Te,Fe,ut){var St=this,Nt=Jt.trans;Nt&&Nt.db===this&&Te.indexOf("!")===-1||(Nt=null);var qt,lr,gr=Te.indexOf("?")!==-1;Te=Te.replace("!","").replace("?","");try{if(lr=Fe.map(function(jt){if(jt=jt instanceof St.Table?jt.name:jt,typeof jt!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return jt}),Te=="r"||Te===On)qt=On;else{if(Te!="rw"&&Te!=En)throw new be.InvalidArgument("Invalid transaction mode: "+Te);qt=En}if(Nt){if(Nt.mode===On&&qt===En){if(!gr)throw new be.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");Nt=null}Nt&&lr.forEach(function(jt){if(Nt&&Nt.storeNames.indexOf(jt)===-1){if(!gr)throw new be.SubTransaction("Table "+jt+" not included in parent transaction.");Nt=null}}),gr&&Nt&&!Nt.active&&(Nt=null)}}catch(jt){return Nt?Nt._promise(null,function(Qt,Gt){Gt(jt)}):pn(jt)}var Er=function jt(Qt,Gt,br,yr,Sr){return Yt.resolve().then(function(){var Or=Jt.transless||Jt,Ir=Qt._createTransaction(Gt,br,Qt._dbSchema,yr);if(Ir.explicit=!0,Or={trans:Ir,transless:Or},yr)Ir.idbtrans=yr.idbtrans;else try{Ir.create(),Ir.idbtrans._explicit=!0,Qt._state.PR1398_maxLoop=3}catch(jr){return jr.name===_e.InvalidState&&Qt.isOpen()&&0<--Qt._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Qt.close({disableAutoOpen:!1}),Qt.open().then(function(){return jt(Qt,Gt,br,null,Sr)})):pn(jr)}var Vr,Gr=z(Sr);return Gr&&ur(),Or=Yt.follow(function(){var jr;(Vr=Sr.call(Ir,Ir))&&(Gr?(jr=vr.bind(null,null),Vr.then(jr,jr)):typeof Vr.next=="function"&&typeof Vr.throw=="function"&&(Vr=bs(Vr)))},Or),(Vr&&typeof Vr.then=="function"?Yt.resolve(Vr).then(function(jr){return Ir.active?jr:pn(new be.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Or.then(function(){return Vr})).then(function(jr){return yr&&Ir._resolve(),Ir._completion.then(function(){return jr})}).catch(function(jr){return Ir._reject(jr),pn(jr)})})}.bind(null,this,qt,lr,Nt,ut);return Nt?Nt._promise(qt,Er,"lock"):Jt.trans?Hr(Jt.transless,function(){return St._whenReady(Er)}):this._whenReady(Er)},Yo.prototype.table=function(Te){if(!x(this._allTables,Te))throw new be.InvalidTable("Table ".concat(Te," does not exist"));return this._allTables[Te]},Yo);function Yo(Te,Fe){var ut=this;this._middlewares={},this.verno=0;var St=Yo.dependencies;this._options=Fe=w({addons:Yo.addons,autoOpen:!0,indexedDB:St.indexedDB,IDBKeyRange:St.IDBKeyRange,cache:"cloned"},Fe),this._deps={indexedDB:Fe.indexedDB,IDBKeyRange:Fe.IDBKeyRange},St=Fe.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var Nt,qt,lr,gr,Er,jt={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:me,dbReadyPromise:null,cancelOpen:me,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:Fe.autoOpen};jt.dbReadyPromise=new Yt(function(Gt){jt.dbReadyResolve=Gt}),jt.openCanceller=new Yt(function(Gt,br){jt.cancelOpen=br}),this._state=jt,this.name=Te,this.on=Xt(this,"populate","blocked","versionchange","close",{ready:[Ze,me]}),this.on.ready.subscribe=F(this.on.ready.subscribe,function(Gt){return function(br,yr){Yo.vip(function(){var Sr,Or=ut._state;Or.openComplete?(Or.dbOpenError||Yt.resolve().then(br),yr&&Gt(br)):Or.onReadyBeingFired?(Or.onReadyBeingFired.push(br),yr&&Gt(br)):(Gt(br),Sr=ut,yr||Gt(function Ir(){Sr.on.ready.unsubscribe(br),Sr.on.ready.unsubscribe(Ir)}))})}}),this.Collection=(Nt=this,et(Vi.prototype,function(Vr,Ir){this.db=Nt;var yr=ve,Sr=null;if(Ir)try{yr=Ir()}catch(Gr){Sr=Gr}var Or=Vr._ctx,Ir=Or.table,Vr=Ir.hook.reading.fire;this._ctx={table:Ir,index:Or.index,isPrimKey:!Or.index||Ir.schema.primKey.keyPath&&Or.index===Ir.schema.primKey.name,range:yr,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Sr,or:Or.or,valueMapper:Vr!==Ke?Vr:null}})),this.Table=(qt=this,et(zt.prototype,function(Gt,br,yr){this.db=qt,this._tx=yr,this.name=Gt,this.schema=br,this.hook=qt._allTables[Gt]?qt._allTables[Gt].hook:Xt(null,{creating:[Le,me],reading:[He,Ke],updating:[Be,me],deleting:[Ge,me]})})),this.Transaction=(lr=this,et(Id.prototype,function(Gt,br,yr,Sr,Or){var Ir=this;this.db=lr,this.mode=Gt,this.storeNames=br,this.schema=yr,this.chromeTransactionDurability=Sr,this.idbtrans=null,this.on=Xt(this,"complete","error","abort"),this.parent=Or||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Yt(function(Vr,Gr){Ir._resolve=Vr,Ir._reject=Gr}),this._completion.then(function(){Ir.active=!1,Ir.on.complete.fire()},function(Vr){var Gr=Ir.active;return Ir.active=!1,Ir.on.error.fire(Vr),Ir.parent?Ir.parent._reject(Vr):Gr&&Ir.idbtrans&&Ir.idbtrans.abort(),pn(Vr)})})),this.Version=(gr=this,et(Ur.prototype,function(Gt){this.db=gr,this._cfg={version:Gt,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Er=this,et(Eh.prototype,function(Gt,br,yr){if(this.db=Er,this._ctx={table:Gt,index:br===":id"?null:br,or:yr},this._cmp=this._ascending=vt,this._descending=function(Sr,Or){return vt(Or,Sr)},this._max=function(Sr,Or){return 0<vt(Sr,Or)?Sr:Or},this._min=function(Sr,Or){return vt(Sr,Or)<0?Sr:Or},this._IDBKeyRange=Er._deps.IDBKeyRange,!this._IDBKeyRange)throw new be.MissingAPI})),this.on("versionchange",function(Gt){0<Gt.newVersion?console.warn("Another connection wants to upgrade database '".concat(ut.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(ut.name,"'. Closing db now to resume the delete request.")),ut.close({disableAutoOpen:!1})}),this.on("blocked",function(Gt){!Gt.newVersion||Gt.newVersion<Gt.oldVersion?console.warn("Dexie.delete('".concat(ut.name,"') was blocked")):console.warn("Upgrade '".concat(ut.name,"' blocked by other connection holding version ").concat(Gt.oldVersion/10))}),this._maxKey=Ju(Fe.IDBKeyRange),this._createTransaction=function(Gt,br,yr,Sr){return new ut.Transaction(Gt,br,yr,ut._options.chromeTransactionDurability,Sr)},this._fireOnBlocked=function(Gt){ut.on("blocked").fire(Gt),yn.filter(function(br){return br.name===ut.name&&br!==ut&&!br._state.vcFired}).map(function(br){return br.on("versionchange").fire(Gt)})},this.use(kg),this.use(Dm),this.use(fv),this.use(Nm),this.use(lv);var Qt=new Proxy(this,{get:function(Gt,br,yr){if(br==="_vip")return!0;if(br==="table")return function(Or){return W0(ut.table(Or),Qt)};var Sr=Reflect.get(Gt,br,yr);return Sr instanceof zt?W0(Sr,Qt):br==="tables"?Sr.map(function(Or){return W0(Or,Qt)}):br==="_createTransaction"?function(){return W0(Sr.apply(this,arguments),Qt)}:Sr}});this.vip=Qt,St.forEach(function(Gt){return Gt(ut)})}var Of,Oc=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",_S=(Rg.prototype.subscribe=function(Te,Fe,ut){return this._subscribe(Te&&typeof Te!="function"?Te:{next:Te,error:Fe,complete:ut})},Rg.prototype[Oc]=function(){return this},Rg);function Rg(Te){this._subscribe=Te}try{Of={indexedDB:v.indexedDB||v.mozIndexedDB||v.webkitIndexedDB||v.msIndexedDB,IDBKeyRange:v.IDBKeyRange||v.webkitIDBKeyRange}}catch{Of={indexedDB:null,IDBKeyRange:null}}function dv(Te){var Fe,ut=!1,St=new _S(function(Nt){var qt=z(Te),lr,gr=!1,Er={},jt={},Qt={get closed(){return gr},unsubscribe:function(){gr||(gr=!0,lr&&lr.abort(),Gt&&Bc.storagemutated.unsubscribe(yr))}};Nt.start&&Nt.start(Qt);var Gt=!1,br=function(){return _r(Sr)},yr=function(Or){Zs(Er,Or),Po(jt,Er)&&br()},Sr=function(){var Or,Ir,Vr;!gr&&Of.indexedDB&&(Er={},Or={},lr&&lr.abort(),lr=new AbortController,Vr=function(Gr){var jr=Vt();try{qt&&ur();var dn=sr(Te,Gr);return dn=qt?dn.finally(vr):dn}finally{jr&&Et()}}(Ir={subscr:Or,signal:lr.signal,requery:br,querier:Te,trans:null}),Promise.resolve(Vr).then(function(Gr){ut=!0,Fe=Gr,gr||Ir.signal.aborted||(Er={},function(jr){for(var dn in jr)if(x(jr,dn))return;return 1}(jt=Or)||Gt||(Bc(Th,yr),Gt=!0),_r(function(){return!gr&&Nt.next&&Nt.next(Gr)}))},function(Gr){ut=!1,["DatabaseClosedError","AbortError"].includes(Gr?.name)||gr||_r(function(){gr||Nt.error&&Nt.error(Gr)})}))};return setTimeout(br,0),Qt});return St.hasValue=function(){return ut},St.getValue=function(){return Fe},St}var Ru=ec;function H0(Te){var Fe=Bd;try{Bd=!0,Bc.storagemutated.fire(Te),Jl(Te,!0)}finally{Bd=Fe}}R(Ru,w(w({},Ee),{delete:function(Te){return new Ru(Te,{addons:[]}).delete()},exists:function(Te){return new Ru(Te,{addons:[]}).open().then(function(Fe){return Fe.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(Te){try{return Fe=Ru.dependencies,ut=Fe.indexedDB,Fe=Fe.IDBKeyRange,(Xn(ut)?Promise.resolve(ut.databases()).then(function(St){return St.map(function(Nt){return Nt.name}).filter(function(Nt){return Nt!==Fr})}):Sn(ut,Fe).toCollection().primaryKeys()).then(Te)}catch{return pn(new be.MissingAPI)}var Fe,ut},defineClass:function(){return function(Te){p(this,Te)}},ignoreTransaction:function(Te){return Jt.trans?Hr(Jt.transless,Te):Te()},vip:Wn,async:function(Te){return function(){try{var Fe=bs(Te.apply(this,arguments));return Fe&&typeof Fe.then=="function"?Fe:Yt.resolve(Fe)}catch(ut){return pn(ut)}}},spawn:function(Te,Fe,ut){try{var St=bs(Te.apply(ut,Fe||[]));return St&&typeof St.then=="function"?St:Yt.resolve(St)}catch(Nt){return pn(Nt)}},currentTransaction:{get:function(){return Jt.trans||null}},waitFor:function(Te,Fe){return Fe=Yt.resolve(typeof Te=="function"?Ru.ignoreTransaction(Te):Te).timeout(Fe||6e4),Jt.trans?Jt.trans.waitFor(Fe):Fe},Promise:Yt,debug:{get:function(){return _t},set:function(Te){Ft(Te)}},derive:M,extend:p,props:R,override:F,Events:Xt,on:Bc,liveQuery:dv,extendObservabilitySet:Zs,getByKeyPath:le,setByKeyPath:X,delByKeyPath:function(Te,Fe){typeof Fe=="string"?X(Te,Fe,void 0):"length"in Fe&&[].map.call(Fe,function(ut){X(Te,ut,void 0)})},shallowClone:se,deepClone:B,getObjectDiff:Bf,cmp:vt,asap:ue,minKey:-1/0,addons:[],connections:yn,errnames:_e,dependencies:Of,cache:Fo,semVer:"4.0.11",version:"4.0.11".split(".").map(function(Te){return parseInt(Te)}).reduce(function(Te,Fe,ut){return Te+Fe/Math.pow(10,2*ut)})})),Ru.maxKey=Ju(Ru.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Bc(Th,function(Te){Bd||(Te=new CustomEvent(Sh,{detail:Te}),Bd=!0,dispatchEvent(Te),Bd=!1)}),addEventListener(Sh,function(Te){Te=Te.detail,Bd||H0(Te)}));var z0,Bd=!1,hv=function(){};return typeof BroadcastChannel<"u"&&((hv=function(){(z0=new BroadcastChannel(Sh)).onmessage=function(Te){return Te.data&&H0(Te.data)}})(),typeof z0.unref=="function"&&z0.unref(),Bc(Th,function(Te){Bd||z0.postMessage(Te)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(Te){if(!ec.disableBfCache&&Te.persisted){_t&&console.debug("Dexie: handling persisted pagehide"),z0?.close();for(var Fe=0,ut=yn;Fe<ut.length;Fe++)ut[Fe].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(Te){!ec.disableBfCache&&Te.persisted&&(_t&&console.debug("Dexie: handling persisted pageshow"),hv(),H0({all:new Qn(-1/0,[[]])}))})),Yt.rejectionMapper=function(Te,Fe){return!Te||Te instanceof te||Te instanceof TypeError||Te instanceof SyntaxError||!Te.name||!we[Te.name]?Te:(Fe=new we[Te.name](Fe||Te.message,Te),"stack"in Te&&O(Fe,"stack",{get:function(){return this.inner.stack}}),Fe)},Ft(_t),w(ec,Object.freeze({__proto__:null,Dexie:ec,liveQuery:dv,Entity:yt,cmp:vt,PropModification:mn,replacePrefix:function(Te,Fe){return new mn({replacePrefix:[Te,Fe]})},add:function(Te){return new mn({add:Te})},remove:function(Te){return new mn({remove:Te})},default:ec,RangeSet:Qn,mergeRanges:Bs,rangesOverlap:yi}),{default:ec}),ec})},57678:function(ie,f,_){"use strict";var h=_(92427),w=_(25667),E;try{E=[].__proto__===Array.prototype}catch(p){if(!p||typeof p!="object"||!("code"in p)||p.code!=="ERR_PROTO_ACCESS")throw p}var v=!!E&&w&&w(Object.prototype,"__proto__"),c=Object,d=c.getPrototypeOf;ie.exports=v&&typeof v.get=="function"?h([v.get]):typeof d=="function"?function(m){return d(m==null?m:c(m))}:!1},93817:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.ephemeralKeySize=f.symmetricNonceLength=f.symmetricAlgorithm=f.isHkdfKeyCompressed=f.isEphemeralKeyCompressed=f.ellipticCurve=f.ECIES_CONFIG=void 0;var h=_(80976),w=function(){function C(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16}return C}();f.ECIES_CONFIG=new w;var E=function(){return f.ECIES_CONFIG.ellipticCurve};f.ellipticCurve=E;var v=function(){return f.ECIES_CONFIG.isEphemeralKeyCompressed};f.isEphemeralKeyCompressed=v;var c=function(){return f.ECIES_CONFIG.isHkdfKeyCompressed};f.isHkdfKeyCompressed=c;var d=function(){return f.ECIES_CONFIG.symmetricAlgorithm};f.symmetricAlgorithm=d;var p=function(){return f.ECIES_CONFIG.symmetricNonceLength};f.symmetricNonceLength=p;var m=function(){var C={secp256k1:f.ECIES_CONFIG.isEphemeralKeyCompressed?h.COMPRESSED_PUBLIC_KEY_SIZE:h.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:h.CURVE25519_PUBLIC_KEY_SIZE,ed25519:h.CURVE25519_PUBLIC_KEY_SIZE};if(f.ECIES_CONFIG.ellipticCurve in C)return C[f.ECIES_CONFIG.ellipticCurve];throw new Error("Not implemented")};f.ephemeralKeySize=m},80976:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.AEAD_TAG_LENGTH=f.XCHACHA20_NONCE_LENGTH=f.CURVE25519_PUBLIC_KEY_SIZE=f.ETH_PUBLIC_KEY_SIZE=f.UNCOMPRESSED_PUBLIC_KEY_SIZE=f.COMPRESSED_PUBLIC_KEY_SIZE=f.SECRET_KEY_LENGTH=void 0,f.SECRET_KEY_LENGTH=32,f.COMPRESSED_PUBLIC_KEY_SIZE=33,f.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,f.ETH_PUBLIC_KEY_SIZE=64,f.CURVE25519_PUBLIC_KEY_SIZE=32,f.XCHACHA20_NONCE_LENGTH=24,f.AEAD_TAG_LENGTH=16},79422:function(ie,f,_){"use strict";var h,w=_(36533).Buffer;h={value:!0},h=h=f.PrivateKey=h=void 0,f.encrypt=p,f.decrypt=C;var E=_(7837),v=_(93817),c=_(76016),d=_(78152);function p(O,M){return w.from(m(O,M))}function m(O,M){var k=new c.PrivateKey,q=O instanceof Uint8Array?new c.PublicKey(O):c.PublicKey.fromHex(O),b=k.encapsulate(q,(0,v.isHkdfKeyCompressed)()),F=k.publicKey.toBytes((0,v.isEphemeralKeyCompressed)()),G=(0,d.symEncrypt)(b,M);return(0,E.concatBytes)(F,G)}function C(O,M){return w.from(x(O,M))}function x(O,M){var k=O instanceof Uint8Array?new c.PrivateKey(O):c.PrivateKey.fromHex(O),q=(0,v.ephemeralKeySize)(),b=new c.PublicKey(M.subarray(0,q)),F=M.subarray(q),G=b.decapsulate(k,(0,v.isHkdfKeyCompressed)());return(0,d.symDecrypt)(G,F)}var R=_(93817);h={enumerable:!0,get:function(){return R.ECIES_CONFIG}};var S=_(76016);Object.defineProperty(f,"PrivateKey",{enumerable:!0,get:function(){return S.PrivateKey}}),h={enumerable:!0,get:function(){return S.PublicKey}},h={aesEncrypt:d.aesEncrypt,aesDecrypt:d.aesDecrypt,symEncrypt:d.symEncrypt,symDecrypt:d.symDecrypt,decodeHex:d.decodeHex,getValidSecret:d.getValidSecret,remove0x:d.remove0x}},20053:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.PrivateKey=void 0;var w=_(7837),E=_(78152),v=_(67415),c=function(){function d(p){if(p===void 0)this.data=(0,E.getValidSecret)();else if((0,E.isValidPrivateKey)(p))this.data=p;else throw new Error("Invalid private key");this.publicKey=new v.PublicKey((0,E.getPublicKey)(this.data))}return d.fromHex=function(p){return new d((0,E.decodeHex)(p))},Object.defineProperty(d.prototype,"secret",{get:function(){return h.from(this.data)},enumerable:!1,configurable:!0}),d.prototype.toHex=function(){return(0,w.bytesToHex)(this.data)},d.prototype.encapsulate=function(p,m){m===void 0&&(m=!1);var C=this.publicKey.toBytes(m),x=this.multiply(p,m);return(0,E.getSharedKey)(C,x)},d.prototype.multiply=function(p,m){return m===void 0&&(m=!1),(0,E.getSharedPoint)(this.data,p.toBytes(!0),m)},d.prototype.equals=function(p){return(0,w.equalBytes)(this.data,p.data)},d}();f.PrivateKey=c},67415:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.PublicKey=void 0;var w=_(7837),E=_(78152),v=function(){function c(d){var p=(0,E.convertPublicKeyFormat)(d,!0),m=(0,E.convertPublicKeyFormat)(d,!1);this.data=p,this.dataUncompressed=p.length!==m.length?m:null}return c.fromHex=function(d){return new c((0,E.hexToPublicKey)(d))},Object.defineProperty(c.prototype,"_uncompressed",{get:function(){return this.dataUncompressed!==null?this.dataUncompressed:this.data},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"uncompressed",{get:function(){return h.from(this._uncompressed)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"compressed",{get:function(){return h.from(this.data)},enumerable:!1,configurable:!0}),c.prototype.toBytes=function(d){return d===void 0&&(d=!0),d?this.data:this._uncompressed},c.prototype.toHex=function(d){return d===void 0&&(d=!0),(0,w.bytesToHex)(this.toBytes(d))},c.prototype.decapsulate=function(d,p){p===void 0&&(p=!1);var m=this.toBytes(p),C=d.multiply(this,p);return(0,E.getSharedKey)(m,C)},c.prototype.equals=function(d){return(0,w.equalBytes)(this.data,d.data)},c}();f.PublicKey=v},76016:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.PublicKey=f.PrivateKey=void 0;var h=_(20053);Object.defineProperty(f,"PrivateKey",{enumerable:!0,get:function(){return h.PrivateKey}});var w=_(67415);Object.defineProperty(f,"PublicKey",{enumerable:!0,get:function(){return w.PublicKey}})},18200:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.hexToPublicKey=f.convertPublicKeyFormat=f.getSharedPoint=f.getPublicKey=f.isValidPrivateKey=f.getValidSecret=void 0;var h=_(93127),w=_(12231),E=_(29458),v=_(93817),c=_(80976),d=_(49349),p=function(){var q;do q=(0,h.randomBytes)(c.SECRET_KEY_LENGTH);while(!(0,f.isValidPrivateKey)(q));return q};f.getValidSecret=p;var m=function(q){return O((0,v.ellipticCurve)(),function(b){return b.utils.isValidPrivateKey(q)},function(){return!0},function(){return!0})};f.isValidPrivateKey=m;var C=function(q){return O((0,v.ellipticCurve)(),function(b){return b.getPublicKey(q)},function(b){return b.getPublicKey(q)},function(b){return b.getPublicKey(q)})};f.getPublicKey=C;var x=function(q,b,F){return O((0,v.ellipticCurve)(),function(G){return G.getSharedSecret(q,b,F)},function(G){return G.getSharedSecret(q,b)},function(G){return k(G,q,b)})};f.getSharedPoint=x;var R=function(q,b){return O((0,v.ellipticCurve)(),function(F){return F.getSharedSecret(BigInt(1),q,b)},function(){return q},function(){return q})};f.convertPublicKeyFormat=R;var S=function(q){var b=(0,d.decodeHex)(q);return O((0,v.ellipticCurve)(),function(){return M(b)},function(){return b},function(){return b})};f.hexToPublicKey=S;function O(q,b,F,G){if(q==="secp256k1")return b(E.secp256k1);if(q==="x25519")return F(w.x25519);if(q==="ed25519")return G(w.ed25519);throw new Error("Not implemented")}var M=function(q){if(q.length===c.ETH_PUBLIC_KEY_SIZE){var b=new Uint8Array(1+q.length);return b.set([4]),b.set(q,1),b}return q},k=function(q,b,F){var G=q.utils.getExtendedPublicKey(b).scalar,ue=q.ExtendedPoint.fromHex(F).multiply(G);return ue.toRawBytes()}},29410:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getSharedKey=f.deriveKey=void 0;var h=_(7837),w=_(14549),E=_(23741),v=function(d,p,m){return(0,w.hkdf)(E.sha256,d,p,m,32)};f.deriveKey=v;var c=function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];return(0,f.deriveKey)(h.concatBytes.apply(void 0,d))};f.getSharedKey=c},49349:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.decodeHex=f.remove0x=void 0;var h=_(7837),w=function(v){return v.startsWith("0x")||v.startsWith("0X")?v.slice(2):v};f.remove0x=w;var E=function(v){return(0,h.hexToBytes)((0,f.remove0x)(v))};f.decodeHex=E},78152:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(18200),f),w(_(29410),f),w(_(49349),f),w(_(80063),f)},80063:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.aesDecrypt=f.aesEncrypt=f.symDecrypt=f.symEncrypt=void 0;var h=_(7837),w=_(93127),E=_(55800),v=_(65533),c=_(93817),d=_(80976),p=function(S,O,M){return C(x,S,O,M)};f.symEncrypt=p;var m=function(S,O,M){return C(R,S,O,M)};f.symDecrypt=m,f.aesEncrypt=f.symEncrypt,f.aesDecrypt=f.symDecrypt;function C(S,O,M,k){var q=(0,c.symmetricAlgorithm)();if(q==="aes-256-gcm")return S(E.aes256gcm,O,M,(0,c.symmetricNonceLength)(),d.AEAD_TAG_LENGTH,k);if(q==="xchacha20")return S(v.xchacha20,O,M,d.XCHACHA20_NONCE_LENGTH,d.AEAD_TAG_LENGTH,k);if(q==="aes-256-cbc")return S(E.aes256cbc,O,M,16,0);throw new Error("Not implemented")}function x(S,O,M,k,q,b){var F=(0,w.randomBytes)(k),G=S(O,F,b),ue=G.encrypt(M);if(q===0)return(0,h.concatBytes)(F,ue);var le=ue.length-q,X=ue.subarray(0,le),se=ue.subarray(le);return(0,h.concatBytes)(F,se,X)}function R(S,O,M,k,q,b){var F=M.subarray(0,k),G=S(O,Uint8Array.from(F),b),ue=M.subarray(k);if(q===0)return G.decrypt(ue);var le=ue.subarray(0,q),X=ue.subarray(q);return G.decrypt((0,h.concatBytes)(X,le))}},39886:function(ie){"use strict";var f=Object.defineProperty||!1;if(f)try{f({},"a",{value:1})}catch{f=!1}ie.exports=f},38004:function(ie){"use strict";ie.exports=EvalError},41488:function(ie){"use strict";ie.exports=Error},96469:function(ie){"use strict";ie.exports=RangeError},12557:function(ie){"use strict";ie.exports=ReferenceError},63429:function(ie){"use strict";ie.exports=SyntaxError},71102:function(ie){"use strict";ie.exports=TypeError},85966:function(ie){"use strict";ie.exports=URIError},25153:function(ie){"use strict";ie.exports=Object},98381:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.keccak512=f.keccak384=f.keccak256=f.keccak224=void 0;const h=_(54658),w=_(74114);f.keccak224=(0,w.wrapHash)(h.keccak_224),f.keccak256=(()=>{const E=(0,w.wrapHash)(h.keccak_256);return E.create=h.keccak_256.create,E})(),f.keccak384=(0,w.wrapHash)(h.keccak_384),f.keccak512=(0,w.wrapHash)(h.keccak_512)},51747:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.secp256k1=void 0;var h=_(74679);Object.defineProperty(f,"secp256k1",{enumerable:!0,get:function(){return h.secp256k1}})},74114:function(ie,f,_){"use strict";ie=_.nmd(ie);var h=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(f,"__esModule",{value:!0}),f.crypto=f.utf8ToBytes=f.createView=f.concatBytes=f.toHex=f.bytesToHex=f.assertBytes=f.assertBool=void 0,f.bytesToUtf8=p,f.hexToBytes=m,f.equalsBytes=C,f.wrapHash=x;const w=h(_(81778)),E=_(49724),v=w.default.bool;f.assertBool=v;const c=w.default.bytes;f.assertBytes=c;var d=_(49724);Object.defineProperty(f,"bytesToHex",{enumerable:!0,get:function(){return d.bytesToHex}}),Object.defineProperty(f,"toHex",{enumerable:!0,get:function(){return d.bytesToHex}}),Object.defineProperty(f,"concatBytes",{enumerable:!0,get:function(){return d.concatBytes}}),Object.defineProperty(f,"createView",{enumerable:!0,get:function(){return d.createView}}),Object.defineProperty(f,"utf8ToBytes",{enumerable:!0,get:function(){return d.utf8ToBytes}});function p(R){if(!(R instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof R}`);return new TextDecoder().decode(R)}function m(R){const S=R.startsWith("0x")?R.substring(2):R;return(0,E.hexToBytes)(S)}function C(R,S){if(R.length!==S.length)return!1;for(let O=0;O<R.length;O++)if(R[O]!==S[O])return!1;return!0}function x(R){return S=>(w.default.bytes(S),R(S))}f.crypto=(()=>{const R=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,S=typeof ie.require=="function"&&ie.require.bind(ie);return{node:S&&!R?S("crypto"):void 0,web:R}})()},86296:function(ie){"use strict";var f=Object.prototype.hasOwnProperty,_="~";function h(){}Object.create&&(h.prototype=Object.create(null),new h().__proto__||(_=!1));function w(d,p,m){this.fn=d,this.context=p,this.once=m||!1}function E(d,p,m,C,x){if(typeof m!="function")throw new TypeError("The listener must be a function");var R=new w(m,C||d,x),S=_?_+p:p;return d._events[S]?d._events[S].fn?d._events[S]=[d._events[S],R]:d._events[S].push(R):(d._events[S]=R,d._eventsCount++),d}function v(d,p){--d._eventsCount===0?d._events=new h:delete d._events[p]}function c(){this._events=new h,this._eventsCount=0}c.prototype.eventNames=function(){var p=[],m,C;if(this._eventsCount===0)return p;for(C in m=this._events)f.call(m,C)&&p.push(_?C.slice(1):C);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},c.prototype.listeners=function(p){var m=_?_+p:p,C=this._events[m];if(!C)return[];if(C.fn)return[C.fn];for(var x=0,R=C.length,S=new Array(R);x<R;x++)S[x]=C[x].fn;return S},c.prototype.listenerCount=function(p){var m=_?_+p:p,C=this._events[m];return C?C.fn?1:C.length:0},c.prototype.emit=function(p,m,C,x,R,S){var O=_?_+p:p;if(!this._events[O])return!1;var M=this._events[O],k=arguments.length,q,b;if(M.fn){switch(M.once&&this.removeListener(p,M.fn,void 0,!0),k){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,m),!0;case 3:return M.fn.call(M.context,m,C),!0;case 4:return M.fn.call(M.context,m,C,x),!0;case 5:return M.fn.call(M.context,m,C,x,R),!0;case 6:return M.fn.call(M.context,m,C,x,R,S),!0}for(b=1,q=new Array(k-1);b<k;b++)q[b-1]=arguments[b];M.fn.apply(M.context,q)}else{var F=M.length,G;for(b=0;b<F;b++)switch(M[b].once&&this.removeListener(p,M[b].fn,void 0,!0),k){case 1:M[b].fn.call(M[b].context);break;case 2:M[b].fn.call(M[b].context,m);break;case 3:M[b].fn.call(M[b].context,m,C);break;case 4:M[b].fn.call(M[b].context,m,C,x);break;default:if(!q)for(G=1,q=new Array(k-1);G<k;G++)q[G-1]=arguments[G];M[b].fn.apply(M[b].context,q)}}return!0},c.prototype.on=function(p,m,C){return E(this,p,m,C,!1)},c.prototype.once=function(p,m,C){return E(this,p,m,C,!0)},c.prototype.removeListener=function(p,m,C,x){var R=_?_+p:p;if(!this._events[R])return this;if(!m)return v(this,R),this;var S=this._events[R];if(S.fn)S.fn===m&&(!x||S.once)&&(!C||S.context===C)&&v(this,R);else{for(var O=0,M=[],k=S.length;O<k;O++)(S[O].fn!==m||x&&!S[O].once||C&&S[O].context!==C)&&M.push(S[O]);M.length?this._events[R]=M.length===1?M[0]:M:v(this,R)}return this},c.prototype.removeAllListeners=function(p){var m;return p?(m=_?_+p:p,this._events[m]&&v(this,m)):(this._events=new h,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=_,c.EventEmitter=c,ie.exports=c},80381:function(ie){"use strict";var f=typeof Reflect=="object"?Reflect:null,_=f&&typeof f.apply=="function"?f.apply:function(ue,le,X){return Function.prototype.apply.call(ue,le,X)},h;f&&typeof f.ownKeys=="function"?h=f.ownKeys:Object.getOwnPropertySymbols?h=function(ue){return Object.getOwnPropertyNames(ue).concat(Object.getOwnPropertySymbols(ue))}:h=function(ue){return Object.getOwnPropertyNames(ue)};function w(G){console&&console.warn&&console.warn(G)}var E=Number.isNaN||function(ue){return ue!==ue};function v(){v.init.call(this)}ie.exports=v,ie.exports.once=q,v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var c=10;function d(G){if(typeof G!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(G){if(typeof G!="number"||G<0||E(G))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+G+".");c=G}}),v.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function(ue){if(typeof ue!="number"||ue<0||E(ue))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ue+".");return this._maxListeners=ue,this};function p(G){return G._maxListeners===void 0?v.defaultMaxListeners:G._maxListeners}v.prototype.getMaxListeners=function(){return p(this)},v.prototype.emit=function(ue){for(var le=[],X=1;X<arguments.length;X++)le.push(arguments[X]);var se=ue==="error",de=this._events;if(de!==void 0)se=se&&de.error===void 0;else if(!se)return!1;if(se){var ye;if(le.length>0&&(ye=le[0]),ye instanceof Error)throw ye;var he=new Error("Unhandled error."+(ye?" ("+ye.message+")":""));throw he.context=ye,he}var K=de[ue];if(K===void 0)return!1;if(typeof K=="function")_(K,this,le);else for(var B=K.length,L=O(K,B),X=0;X<B;++X)_(L[X],this,le);return!0};function m(G,ue,le,X){var se,de,ye;if(d(le),de=G._events,de===void 0?(de=G._events=Object.create(null),G._eventsCount=0):(de.newListener!==void 0&&(G.emit("newListener",ue,le.listener?le.listener:le),de=G._events),ye=de[ue]),ye===void 0)ye=de[ue]=le,++G._eventsCount;else if(typeof ye=="function"?ye=de[ue]=X?[le,ye]:[ye,le]:X?ye.unshift(le):ye.push(le),se=p(G),se>0&&ye.length>se&&!ye.warned){ye.warned=!0;var he=new Error("Possible EventEmitter memory leak detected. "+ye.length+" "+String(ue)+" listeners added. Use emitter.setMaxListeners() to increase limit");he.name="MaxListenersExceededWarning",he.emitter=G,he.type=ue,he.count=ye.length,w(he)}return G}v.prototype.addListener=function(ue,le){return m(this,ue,le,!1)},v.prototype.on=v.prototype.addListener,v.prototype.prependListener=function(ue,le){return m(this,ue,le,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function x(G,ue,le){var X={fired:!1,wrapFn:void 0,target:G,type:ue,listener:le},se=C.bind(X);return se.listener=le,X.wrapFn=se,se}v.prototype.once=function(ue,le){return d(le),this.on(ue,x(this,ue,le)),this},v.prototype.prependOnceListener=function(ue,le){return d(le),this.prependListener(ue,x(this,ue,le)),this},v.prototype.removeListener=function(ue,le){var X,se,de,ye,he;if(d(le),se=this._events,se===void 0)return this;if(X=se[ue],X===void 0)return this;if(X===le||X.listener===le)--this._eventsCount===0?this._events=Object.create(null):(delete se[ue],se.removeListener&&this.emit("removeListener",ue,X.listener||le));else if(typeof X!="function"){for(de=-1,ye=X.length-1;ye>=0;ye--)if(X[ye]===le||X[ye].listener===le){he=X[ye].listener,de=ye;break}if(de<0)return this;de===0?X.shift():M(X,de),X.length===1&&(se[ue]=X[0]),se.removeListener!==void 0&&this.emit("removeListener",ue,he||le)}return this},v.prototype.off=v.prototype.removeListener,v.prototype.removeAllListeners=function(ue){var le,X,se;if(X=this._events,X===void 0)return this;if(X.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):X[ue]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete X[ue]),this;if(arguments.length===0){var de=Object.keys(X),ye;for(se=0;se<de.length;++se)ye=de[se],ye!=="removeListener"&&this.removeAllListeners(ye);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(le=X[ue],typeof le=="function")this.removeListener(ue,le);else if(le!==void 0)for(se=le.length-1;se>=0;se--)this.removeListener(ue,le[se]);return this};function R(G,ue,le){var X=G._events;if(X===void 0)return[];var se=X[ue];return se===void 0?[]:typeof se=="function"?le?[se.listener||se]:[se]:le?k(se):O(se,se.length)}v.prototype.listeners=function(ue){return R(this,ue,!0)},v.prototype.rawListeners=function(ue){return R(this,ue,!1)},v.listenerCount=function(G,ue){return typeof G.listenerCount=="function"?G.listenerCount(ue):S.call(G,ue)},v.prototype.listenerCount=S;function S(G){var ue=this._events;if(ue!==void 0){var le=ue[G];if(typeof le=="function")return 1;if(le!==void 0)return le.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]};function O(G,ue){for(var le=new Array(ue),X=0;X<ue;++X)le[X]=G[X];return le}function M(G,ue){for(;ue+1<G.length;ue++)G[ue]=G[ue+1];G.pop()}function k(G){for(var ue=new Array(G.length),le=0;le<ue.length;++le)ue[le]=G[le].listener||G[le];return ue}function q(G,ue){return new Promise(function(le,X){function se(ye){G.removeListener(ue,de),X(ye)}function de(){typeof G.removeListener=="function"&&G.removeListener("error",se),le([].slice.call(arguments))}F(G,ue,de,{once:!0}),ue!=="error"&&b(G,se,{once:!0})})}function b(G,ue,le){typeof G.on=="function"&&F(G,"error",ue,le)}function F(G,ue,le,X){if(typeof G.on=="function")X.once?G.once(ue,le):G.on(ue,le);else if(typeof G.addEventListener=="function")G.addEventListener(ue,function se(de){X.once&&G.removeEventListener(ue,se),le(de)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof G)}},18844:function(ie){ie.exports=v,v.default=v,v.stable=m,v.stableStringify=m;var f="[...]",_="[Circular]",h=[],w=[];function E(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function v(R,S,O,M){typeof M>"u"&&(M=E()),d(R,"",0,[],void 0,0,M);var k;try{w.length===0?k=JSON.stringify(R,S,O):k=JSON.stringify(R,x(S),O)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;h.length!==0;){var q=h.pop();q.length===4?Object.defineProperty(q[0],q[1],q[3]):q[0][q[1]]=q[2]}}return k}function c(R,S,O,M){var k=Object.getOwnPropertyDescriptor(M,O);k.get!==void 0?k.configurable?(Object.defineProperty(M,O,{value:R}),h.push([M,O,S,k])):w.push([S,O,R]):(M[O]=R,h.push([M,O,S]))}function d(R,S,O,M,k,q,b){q+=1;var F;if(typeof R=="object"&&R!==null){for(F=0;F<M.length;F++)if(M[F]===R){c(_,R,S,k);return}if(typeof b.depthLimit<"u"&&q>b.depthLimit){c(f,R,S,k);return}if(typeof b.edgesLimit<"u"&&O+1>b.edgesLimit){c(f,R,S,k);return}if(M.push(R),Array.isArray(R))for(F=0;F<R.length;F++)d(R[F],F,F,M,R,q,b);else{var G=Object.keys(R);for(F=0;F<G.length;F++){var ue=G[F];d(R[ue],ue,F,M,R,q,b)}}M.pop()}}function p(R,S){return R<S?-1:R>S?1:0}function m(R,S,O,M){typeof M>"u"&&(M=E());var k=C(R,"",0,[],void 0,0,M)||R,q;try{w.length===0?q=JSON.stringify(k,S,O):q=JSON.stringify(k,x(S),O)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;h.length!==0;){var b=h.pop();b.length===4?Object.defineProperty(b[0],b[1],b[3]):b[0][b[1]]=b[2]}}return q}function C(R,S,O,M,k,q,b){q+=1;var F;if(typeof R=="object"&&R!==null){for(F=0;F<M.length;F++)if(M[F]===R){c(_,R,S,k);return}try{if(typeof R.toJSON=="function")return}catch{return}if(typeof b.depthLimit<"u"&&q>b.depthLimit){c(f,R,S,k);return}if(typeof b.edgesLimit<"u"&&O+1>b.edgesLimit){c(f,R,S,k);return}if(M.push(R),Array.isArray(R))for(F=0;F<R.length;F++)C(R[F],F,F,M,R,q,b);else{var G={},ue=Object.keys(R).sort(p);for(F=0;F<ue.length;F++){var le=ue[F];C(R[le],le,F,M,R,q,b),G[le]=R[le]}if(typeof k<"u")h.push([k,S,R]),k[S]=G;else return G}M.pop()}}function x(R){return R=typeof R<"u"?R:function(S,O){return O},function(S,O){if(w.length>0)for(var M=0;M<w.length;M++){var k=w[M];if(k[1]===S&&k[0]===O){O=k[2],w.splice(M,1);break}}return R.call(this,S,O)}}},47886:function(ie,f,_){(function(h){"use strict";function w(E){var v=E&&E.Promise||h.Promise,c=E&&E.XMLHttpRequest||h.XMLHttpRequest,d=h;return function(){var p=Object.create(d,{fetch:{value:void 0,writable:!0}});return function(m){"use strict";if(m.fetch)return;var C={searchParams:"URLSearchParams"in m,iterable:"Symbol"in m&&"iterator"in Symbol,blob:"FileReader"in m&&"Blob"in m&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in m,arrayBuffer:"ArrayBuffer"in m};if(C.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],R=function(T){return T&&DataView.prototype.isPrototypeOf(T)},S=ArrayBuffer.isView||function(T){return T&&x.indexOf(Object.prototype.toString.call(T))>-1};function O(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(T))throw new TypeError("Invalid character in header field name");return T.toLowerCase()}function M(T){return typeof T!="string"&&(T=String(T)),T}function k(T){var N={next:function(){var j=T.shift();return{done:j===void 0,value:j}}};return C.iterable&&(N[Symbol.iterator]=function(){return N}),N}function q(T){this.map={},T instanceof q?T.forEach(function(N,j){this.append(j,N)},this):Array.isArray(T)?T.forEach(function(N){this.append(N[0],N[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(N){this.append(N,T[N])},this)}q.prototype.append=function(T,N){T=O(T),N=M(N);var j=this.map[T];this.map[T]=j?j+","+N:N},q.prototype.delete=function(T){delete this.map[O(T)]},q.prototype.get=function(T){return T=O(T),this.has(T)?this.map[T]:null},q.prototype.has=function(T){return this.map.hasOwnProperty(O(T))},q.prototype.set=function(T,N){this.map[O(T)]=M(N)},q.prototype.forEach=function(T,N){for(var j in this.map)this.map.hasOwnProperty(j)&&T.call(N,this.map[j],j,this)},q.prototype.keys=function(){var T=[];return this.forEach(function(N,j){T.push(j)}),k(T)},q.prototype.values=function(){var T=[];return this.forEach(function(N){T.push(N)}),k(T)},q.prototype.entries=function(){var T=[];return this.forEach(function(N,j){T.push([j,N])}),k(T)},C.iterable&&(q.prototype[Symbol.iterator]=q.prototype.entries);function b(T){if(T.bodyUsed)return v.reject(new TypeError("Already read"));T.bodyUsed=!0}function F(T){return new v(function(N,j){T.onload=function(){N(T.result)},T.onerror=function(){j(T.error)}})}function G(T){var N=new FileReader,j=F(N);return N.readAsArrayBuffer(T),j}function ue(T){var N=new FileReader,j=F(N);return N.readAsText(T),j}function le(T){for(var N=new Uint8Array(T),j=new Array(N.length),Y=0;Y<N.length;Y++)j[Y]=String.fromCharCode(N[Y]);return j.join("")}function X(T){if(T.slice)return T.slice(0);var N=new Uint8Array(T.byteLength);return N.set(new Uint8Array(T)),N.buffer}function se(){return this.bodyUsed=!1,this._initBody=function(T){if(this._bodyInit=T,!T)this._bodyText="";else if(typeof T=="string")this._bodyText=T;else if(C.blob&&Blob.prototype.isPrototypeOf(T))this._bodyBlob=T;else if(C.formData&&FormData.prototype.isPrototypeOf(T))this._bodyFormData=T;else if(C.searchParams&&URLSearchParams.prototype.isPrototypeOf(T))this._bodyText=T.toString();else if(C.arrayBuffer&&C.blob&&R(T))this._bodyArrayBuffer=X(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else if(C.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||S(T)))this._bodyArrayBuffer=X(T);else throw new Error("unsupported BodyInit type");this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):C.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},C.blob&&(this.blob=function(){var T=b(this);if(T)return T;if(this._bodyBlob)return v.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return v.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return v.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?b(this)||v.resolve(this._bodyArrayBuffer):this.blob().then(G)}),this.text=function(){var T=b(this);if(T)return T;if(this._bodyBlob)return ue(this._bodyBlob);if(this._bodyArrayBuffer)return v.resolve(le(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return v.resolve(this._bodyText)},C.formData&&(this.formData=function(){return this.text().then(K)}),this.json=function(){return this.text().then(JSON.parse)},this}var de=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ye(T){var N=T.toUpperCase();return de.indexOf(N)>-1?N:T}function he(T,N){N=N||{};var j=N.body;if(T instanceof he){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,N.headers||(this.headers=new q(T.headers)),this.method=T.method,this.mode=T.mode,!j&&T._bodyInit!=null&&(j=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=N.credentials||this.credentials||"omit",(N.headers||!this.headers)&&(this.headers=new q(N.headers)),this.method=ye(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&j)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(j)}he.prototype.clone=function(){return new he(this,{body:this._bodyInit})};function K(T){var N=new FormData;return T.trim().split("&").forEach(function(j){if(j){var Y=j.split("="),Z=Y.shift().replace(/\+/g," "),z=Y.join("=").replace(/\+/g," ");N.append(decodeURIComponent(Z),decodeURIComponent(z))}}),N}function B(T){var N=new q,j=T.replace(/\r?\n[\t ]+/g," ");return j.split(/\r?\n/).forEach(function(Y){var Z=Y.split(":"),z=Z.shift().trim();if(z){var fe=Z.join(":").trim();N.append(z,fe)}}),N}se.call(he.prototype);function L(T,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new q(N.headers),this.url=N.url||"",this._initBody(T)}se.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new q(this.headers),url:this.url})},L.error=function(){var T=new L(null,{status:0,statusText:""});return T.type="error",T};var $=[301,302,303,307,308];L.redirect=function(T,N){if($.indexOf(N)===-1)throw new RangeError("Invalid status code");return new L(null,{status:N,headers:{location:T}})},m.Headers=q,m.Request=he,m.Response=L,m.fetch=function(T,N){return new v(function(j,Y){var Z=new he(T,N),z=new c;z.onload=function(){var fe={status:z.status,statusText:z.statusText,headers:B(z.getAllResponseHeaders()||"")};fe.url="responseURL"in z?z.responseURL:fe.headers.get("X-Request-URL");var te="response"in z?z.response:z.responseText;j(new L(te,fe))},z.onerror=function(){Y(new TypeError("Network request failed"))},z.ontimeout=function(){Y(new TypeError("Network request failed"))},z.open(Z.method,Z.url,!0),Z.credentials==="include"?z.withCredentials=!0:Z.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&C.blob&&(z.responseType="blob"),Z.headers.forEach(function(fe,te){z.setRequestHeader(te,fe)}),z.send(typeof Z._bodyInit>"u"?null:Z._bodyInit)})},m.fetch.polyfill=!0}(typeof p<"u"?p:this),{fetch:p.fetch,Headers:p.Headers,Request:p.Request,Response:p.Response}}()}typeof define=="function"&&define.amd?define(function(){return w}):ie.exports=w})(typeof self<"u"?self:typeof _.g<"u"?_.g:this)},69461:function(ie){(function(f,_,h){"use strict";ie.exports?ie.exports=h():_.exports?_.exports=h():_[f]=h()})("Fingerprint2",this,function(){"use strict";typeof Array.isArray>"u"&&(Array.isArray=function(Ae){return Object.prototype.toString.call(Ae)==="[object Array]"});var f=function(Ae,Rt){Ae=[Ae[0]>>>16,Ae[0]&65535,Ae[1]>>>16,Ae[1]&65535],Rt=[Rt[0]>>>16,Rt[0]&65535,Rt[1]>>>16,Rt[1]&65535];var Ht=[0,0,0,0];return Ht[3]+=Ae[3]+Rt[3],Ht[2]+=Ht[3]>>>16,Ht[3]&=65535,Ht[2]+=Ae[2]+Rt[2],Ht[1]+=Ht[2]>>>16,Ht[2]&=65535,Ht[1]+=Ae[1]+Rt[1],Ht[0]+=Ht[1]>>>16,Ht[1]&=65535,Ht[0]+=Ae[0]+Rt[0],Ht[0]&=65535,[Ht[0]<<16|Ht[1],Ht[2]<<16|Ht[3]]},_=function(Ae,Rt){Ae=[Ae[0]>>>16,Ae[0]&65535,Ae[1]>>>16,Ae[1]&65535],Rt=[Rt[0]>>>16,Rt[0]&65535,Rt[1]>>>16,Rt[1]&65535];var Ht=[0,0,0,0];return Ht[3]+=Ae[3]*Rt[3],Ht[2]+=Ht[3]>>>16,Ht[3]&=65535,Ht[2]+=Ae[2]*Rt[3],Ht[1]+=Ht[2]>>>16,Ht[2]&=65535,Ht[2]+=Ae[3]*Rt[2],Ht[1]+=Ht[2]>>>16,Ht[2]&=65535,Ht[1]+=Ae[1]*Rt[3],Ht[0]+=Ht[1]>>>16,Ht[1]&=65535,Ht[1]+=Ae[2]*Rt[2],Ht[0]+=Ht[1]>>>16,Ht[1]&=65535,Ht[1]+=Ae[3]*Rt[1],Ht[0]+=Ht[1]>>>16,Ht[1]&=65535,Ht[0]+=Ae[0]*Rt[3]+Ae[1]*Rt[2]+Ae[2]*Rt[1]+Ae[3]*Rt[0],Ht[0]&=65535,[Ht[0]<<16|Ht[1],Ht[2]<<16|Ht[3]]},h=function(Ae,Rt){return Rt%=64,Rt===32?[Ae[1],Ae[0]]:Rt<32?[Ae[0]<<Rt|Ae[1]>>>32-Rt,Ae[1]<<Rt|Ae[0]>>>32-Rt]:(Rt-=32,[Ae[1]<<Rt|Ae[0]>>>32-Rt,Ae[0]<<Rt|Ae[1]>>>32-Rt])},w=function(Ae,Rt){return Rt%=64,Rt===0?Ae:Rt<32?[Ae[0]<<Rt|Ae[1]>>>32-Rt,Ae[1]<<Rt]:[Ae[1]<<Rt-32,0]},E=function(Ae,Rt){return[Ae[0]^Rt[0],Ae[1]^Rt[1]]},v=function(Ae){return Ae=E(Ae,[0,Ae[0]>>>1]),Ae=_(Ae,[4283543511,3981806797]),Ae=E(Ae,[0,Ae[0]>>>1]),Ae=_(Ae,[3301882366,444984403]),Ae=E(Ae,[0,Ae[0]>>>1]),Ae},c=function(Ae,Rt){Ae=Ae||"",Rt=Rt||0;for(var Ht=Ae.length%16,bt=Ae.length-Ht,Mt=[0,Rt],tr=[0,Rt],Vt=[0,0],Et=[0,0],Ye=[2277735313,289559509],Tt=[1291169091,658871167],Wt=0;Wt<bt;Wt=Wt+16)Vt=[Ae.charCodeAt(Wt+4)&255|(Ae.charCodeAt(Wt+5)&255)<<8|(Ae.charCodeAt(Wt+6)&255)<<16|(Ae.charCodeAt(Wt+7)&255)<<24,Ae.charCodeAt(Wt)&255|(Ae.charCodeAt(Wt+1)&255)<<8|(Ae.charCodeAt(Wt+2)&255)<<16|(Ae.charCodeAt(Wt+3)&255)<<24],Et=[Ae.charCodeAt(Wt+12)&255|(Ae.charCodeAt(Wt+13)&255)<<8|(Ae.charCodeAt(Wt+14)&255)<<16|(Ae.charCodeAt(Wt+15)&255)<<24,Ae.charCodeAt(Wt+8)&255|(Ae.charCodeAt(Wt+9)&255)<<8|(Ae.charCodeAt(Wt+10)&255)<<16|(Ae.charCodeAt(Wt+11)&255)<<24],Vt=_(Vt,Ye),Vt=h(Vt,31),Vt=_(Vt,Tt),Mt=E(Mt,Vt),Mt=h(Mt,27),Mt=f(Mt,tr),Mt=f(_(Mt,[0,5]),[0,1390208809]),Et=_(Et,Tt),Et=h(Et,33),Et=_(Et,Ye),tr=E(tr,Et),tr=h(tr,31),tr=f(tr,Mt),tr=f(_(tr,[0,5]),[0,944331445]);switch(Vt=[0,0],Et=[0,0],Ht){case 15:Et=E(Et,w([0,Ae.charCodeAt(Wt+14)],48));case 14:Et=E(Et,w([0,Ae.charCodeAt(Wt+13)],40));case 13:Et=E(Et,w([0,Ae.charCodeAt(Wt+12)],32));case 12:Et=E(Et,w([0,Ae.charCodeAt(Wt+11)],24));case 11:Et=E(Et,w([0,Ae.charCodeAt(Wt+10)],16));case 10:Et=E(Et,w([0,Ae.charCodeAt(Wt+9)],8));case 9:Et=E(Et,[0,Ae.charCodeAt(Wt+8)]),Et=_(Et,Tt),Et=h(Et,33),Et=_(Et,Ye),tr=E(tr,Et);case 8:Vt=E(Vt,w([0,Ae.charCodeAt(Wt+7)],56));case 7:Vt=E(Vt,w([0,Ae.charCodeAt(Wt+6)],48));case 6:Vt=E(Vt,w([0,Ae.charCodeAt(Wt+5)],40));case 5:Vt=E(Vt,w([0,Ae.charCodeAt(Wt+4)],32));case 4:Vt=E(Vt,w([0,Ae.charCodeAt(Wt+3)],24));case 3:Vt=E(Vt,w([0,Ae.charCodeAt(Wt+2)],16));case 2:Vt=E(Vt,w([0,Ae.charCodeAt(Wt+1)],8));case 1:Vt=E(Vt,[0,Ae.charCodeAt(Wt)]),Vt=_(Vt,Ye),Vt=h(Vt,31),Vt=_(Vt,Tt),Mt=E(Mt,Vt)}return Mt=E(Mt,[0,Ae.length]),tr=E(tr,[0,Ae.length]),Mt=f(Mt,tr),tr=f(tr,Mt),Mt=v(Mt),tr=v(tr),Mt=f(Mt,tr),tr=f(tr,Mt),("00000000"+(Mt[0]>>>0).toString(16)).slice(-8)+("00000000"+(Mt[1]>>>0).toString(16)).slice(-8)+("00000000"+(tr[0]>>>0).toString(16)).slice(-8)+("00000000"+(tr[1]>>>0).toString(16)).slice(-8)},d={preprocessor:null,audio:{timeout:1e3,excludeIOS11:!0},fonts:{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",userDefinedFonts:[],extendedJsFonts:!1},screen:{detectScreenOrientation:!0},plugins:{sortPluginsFor:[/palemoon/i],excludeIE:!1},extraComponents:[],excludes:{enumerateDevices:!0,pixelRatio:!0,doNotTrack:!0,fontsFlash:!0,adBlock:!0},NOT_AVAILABLE:"not available",ERROR:"error",EXCLUDED:"excluded"},p=function(Ae,Rt){if(Array.prototype.forEach&&Ae.forEach===Array.prototype.forEach)Ae.forEach(Rt);else if(Ae.length===+Ae.length)for(var Ht=0,bt=Ae.length;Ht<bt;Ht++)Rt(Ae[Ht],Ht,Ae);else for(var Mt in Ae)Ae.hasOwnProperty(Mt)&&Rt(Ae[Mt],Mt,Ae)},m=function(Ae,Rt){var Ht=[];return Ae==null?Ht:Array.prototype.map&&Ae.map===Array.prototype.map?Ae.map(Rt):(p(Ae,function(bt,Mt,tr){Ht.push(Rt(bt,Mt,tr))}),Ht)},C=function(Ae,Rt){if(Rt==null)return Ae;var Ht,bt;for(bt in Rt)Ht=Rt[bt],Ht!=null&&!Object.prototype.hasOwnProperty.call(Ae,bt)&&(Ae[bt]=Ht);return Ae},x=function(Ae,Rt){if(!R())return Ae(Rt.NOT_AVAILABLE);navigator.mediaDevices.enumerateDevices().then(function(Ht){Ae(Ht.map(function(bt){return"id="+bt.deviceId+";gid="+bt.groupId+";"+bt.kind+";"+bt.label}))}).catch(function(Ht){Ae(Ht)})},R=function(){return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices},S=function(Ae,Rt){var Ht=Rt.audio;if(Ht.excludeIOS11&&navigator.userAgent.match(/OS 11.+Version\/11.+Safari/))return Ae(Rt.EXCLUDED);var bt=self.OfflineAudioContext||self.webkitOfflineAudioContext;if(bt==null)return Ae(Rt.NOT_AVAILABLE);var Mt=new bt(1,44100,44100),tr=Mt.createOscillator();tr.type="triangle",tr.frequency.setValueAtTime(1e4,Mt.currentTime);var Vt=Mt.createDynamicsCompressor();p([["threshold",-50],["knee",40],["ratio",12],["reduction",-20],["attack",0],["release",.25]],function(Ye){Vt[Ye[0]]!==void 0&&typeof Vt[Ye[0]].setValueAtTime=="function"&&Vt[Ye[0]].setValueAtTime(Ye[1],Mt.currentTime)}),tr.connect(Vt),Vt.connect(Mt.destination),tr.start(0),Mt.startRendering();var Et=setTimeout(function(){return console.warn('Audio fingerprint timed out. Please report bug at https://github.com/fingerprintjs/fingerprintjs with your user agent: "'+navigator.userAgent+'".'),Mt.oncomplete=function(){},Mt=null,Ae("audioTimeout")},Ht.timeout);Mt.oncomplete=function(Ye){var Tt;try{clearTimeout(Et),Tt=Ye.renderedBuffer.getChannelData(0).slice(4500,5e3).reduce(function(Wt,dr){return Wt+Math.abs(dr)},0).toString(),tr.disconnect(),Vt.disconnect()}catch(Wt){Ae(Wt);return}Ae(Tt)}},O=function(Ae){Ae(navigator.userAgent)},M=function(Ae,Rt){Ae(navigator.webdriver==null?Rt.NOT_AVAILABLE:navigator.webdriver)},k=function(Ae,Rt){Ae(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||Rt.NOT_AVAILABLE)},q=function(Ae,Rt){Ae(self.screen.colorDepth||Rt.NOT_AVAILABLE)},b=function(Ae,Rt){Ae(navigator.deviceMemory||Rt.NOT_AVAILABLE)},F=function(Ae,Rt){Ae(self.devicePixelRatio||Rt.NOT_AVAILABLE)},G=function(Ae,Rt){Ae(ue(Rt))},ue=function(Ae){var Rt=[self.screen.width,self.screen.height];return Ae.screen.detectScreenOrientation&&Rt.sort().reverse(),Rt},le=function(Ae,Rt){Ae(X(Rt))},X=function(Ae){if(self.screen.availWidth&&self.screen.availHeight){var Rt=[self.screen.availHeight,self.screen.availWidth];return Ae.screen.detectScreenOrientation&&Rt.sort().reverse(),Rt}return Ae.NOT_AVAILABLE},se=function(Ae){Ae(new Date().getTimezoneOffset())},de=function(Ae,Rt){if(self.Intl&&self.Intl.DateTimeFormat){Ae(new self.Intl.DateTimeFormat().resolvedOptions().timeZone||Rt.NOT_AVAILABLE);return}Ae(Rt.NOT_AVAILABLE)},ye=function(Ae,Rt){Ae(He(Rt))},he=function(Ae,Rt){Ae(Ie(Rt))},K=function(Ae,Rt){Ae(Le(Rt))},B=function(Ae){Ae(!!self.HTMLElement.prototype.addBehavior)},L=function(Ae){Ae(!!self.openDatabase)},$=function(Ae,Rt){Ae(Be(Rt))},T=function(Ae,Rt){Ae(We(Rt))},N=function(Ae,Rt){Ae(Ze(Rt))},j=function(Ae,Rt){if(Pe()){Ae(Ft(Rt));return}Ae(Rt.NOT_AVAILABLE)},Y=function(Ae,Rt){if(it()){Ae(gt());return}Ae(Rt.NOT_AVAILABLE)},Z=function(Ae){if(it()){Ae(lt());return}Ae()},z=function(Ae){Ae(dt())},fe=function(Ae){Ae(tt())},te=function(Ae){Ae(rt())},H=function(Ae){Ae(ke())},Q=function(Ae){Ae(xe())},oe=function(Ae,Rt){if(!It())return Ae("swf object not loaded");if(!ft())return Ae("flash not installed");if(!Rt.fonts.swfPath)return Ae("missing options.fonts.swfPath");Ot(function(Ht){Ae(Ht)},Rt)},_e=function(Ae,Rt){var Ht=["monospace","sans-serif","serif"],bt=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];if(Rt.fonts.extendedJsFonts){var Mt=["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"];bt=bt.concat(Mt)}bt=bt.concat(Rt.fonts.userDefinedFonts),bt=bt.filter(function(Hr,rn){return bt.indexOf(Hr)===rn});var tr="mmmmmmmmmmlli",Vt="72px",Et=document.getElementsByTagName("body")[0],Ye=document.createElement("div"),Tt=document.createElement("div"),Wt={},dr={},at=function(){var Hr=document.createElement("span");return Hr.style.position="absolute",Hr.style.left="-9999px",Hr.style.fontSize=Vt,Hr.style.fontStyle="normal",Hr.style.fontWeight="normal",Hr.style.letterSpacing="normal",Hr.style.lineBreak="auto",Hr.style.lineHeight="normal",Hr.style.textTransform="none",Hr.style.textAlign="left",Hr.style.textDecoration="none",Hr.style.textShadow="none",Hr.style.whiteSpace="normal",Hr.style.wordBreak="normal",Hr.style.wordSpacing="normal",Hr.innerHTML=tr,Hr},wt=function(Hr,rn){var _r=at();return _r.style.fontFamily="'"+Hr+"',"+rn,_r},At=function(){for(var Hr=[],rn=0,_r=Ht.length;rn<_r;rn++){var pn=at();pn.style.fontFamily=Ht[rn],Ye.appendChild(pn),Hr.push(pn)}return Hr},Je=function(){for(var Hr={},rn=0,_r=bt.length;rn<_r;rn++){for(var pn=[],$t=0,In=Ht.length;$t<In;$t++){var ln=wt(bt[rn],Ht[$t]);Tt.appendChild(ln),pn.push(ln)}Hr[bt[rn]]=pn}return Hr},Lt=function(Hr){for(var rn=!1,_r=0;_r<Ht.length;_r++)if(rn=Hr[_r].offsetWidth!==Wt[Ht[_r]]||Hr[_r].offsetHeight!==dr[Ht[_r]],rn)return rn;return rn},sr=At();Et.appendChild(Ye);for(var ur=0,vr=Ht.length;ur<vr;ur++)Wt[Ht[ur]]=sr[ur].offsetWidth,dr[Ht[ur]]=sr[ur].offsetHeight;var kr=Je();Et.appendChild(Tt);for(var Jr=[],hr=0,$r=bt.length;hr<$r;hr++)Lt(kr[bt[hr]])&&Jr.push(bt[hr]);Et.removeChild(Tt),Et.removeChild(Ye),Ae(Jr)},ge=function(Ae,Rt){Xe()?Rt.plugins.excludeIE?Ae(Rt.EXCLUDED):Ae(we(Rt)):Ae(be(Rt))},be=function(Ae){if(navigator.plugins==null)return Ae.NOT_AVAILABLE;for(var Rt=[],Ht=0,bt=navigator.plugins.length;Ht<bt;Ht++)navigator.plugins[Ht]&&Rt.push(navigator.plugins[Ht]);return Ee(Ae)&&(Rt=Rt.sort(function(Mt,tr){return Mt.name>tr.name?1:Mt.name<tr.name?-1:0})),m(Rt,function(Mt){var tr=m(Mt,function(Vt){return[Vt.type,Vt.suffixes]});return[Mt.name,Mt.description,tr]})},we=function(Ae){var Rt=[];if(Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(self,"ActiveXObject")||"ActiveXObject"in self){var Ht=["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"];Rt=m(Ht,function(bt){try{return new self.ActiveXObject(bt),bt}catch{return Ae.ERROR}})}else Rt.push(Ae.NOT_AVAILABLE);return navigator.plugins&&(Rt=Rt.concat(be(Ae))),Rt},Ee=function(Ae){for(var Rt=!1,Ht=0,bt=Ae.plugins.sortPluginsFor.length;Ht<bt;Ht++){var Mt=Ae.plugins.sortPluginsFor[Ht];if(navigator.userAgent.match(Mt)){Rt=!0;break}}return Rt},me=function(Ae){Ae(_t())},Ke=function(Ae,Rt){Ae(Ge(Rt))},He=function(Ae){try{return!!self.sessionStorage}catch{return Ae.ERROR}},Ie=function(Ae){try{return!!self.localStorage}catch{return Ae.ERROR}},Le=function(Ae){if(st())return Ae.EXCLUDED;try{return!!self.indexedDB}catch{return Ae.ERROR}},Ge=function(Ae){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:Ae.NOT_AVAILABLE},Be=function(Ae){return navigator.cpuClass||Ae.NOT_AVAILABLE},We=function(Ae){return navigator.platform?navigator.platform:Ae.NOT_AVAILABLE},Ze=function(Ae){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:self.doNotTrack?self.doNotTrack:Ae.NOT_AVAILABLE},_t=function(){var Ae=0,Rt;typeof navigator.maxTouchPoints<"u"?Ae=navigator.maxTouchPoints:typeof navigator.msMaxTouchPoints<"u"&&(Ae=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),Rt=!0}catch{Rt=!1}var Ht="ontouchstart"in self;return[Ae,Rt,Ht]},Ft=function(Ae){var Rt=[],Ht=document.createElement("canvas");Ht.width=2e3,Ht.height=200,Ht.style.display="inline";var bt=Ht.getContext("2d");return bt.rect(0,0,10,10),bt.rect(2,2,6,6),Rt.push("canvas winding:"+(bt.isPointInPath(5,5,"evenodd")===!1?"yes":"no")),bt.textBaseline="alphabetic",bt.fillStyle="#f60",bt.fillRect(125,1,62,20),bt.fillStyle="#069",Ae.dontUseFakeFontInCanvas?bt.font="11pt Arial":bt.font="11pt no-real-font-123",bt.fillText("Cwm fjordbank glyphs vext quiz, \u{1F603}",2,15),bt.fillStyle="rgba(102, 204, 0, 0.2)",bt.font="18pt Arial",bt.fillText("Cwm fjordbank glyphs vext quiz, \u{1F603}",4,45),bt.globalCompositeOperation="multiply",bt.fillStyle="rgb(255,0,255)",bt.beginPath(),bt.arc(50,50,50,0,Math.PI*2,!0),bt.closePath(),bt.fill(),bt.fillStyle="rgb(0,255,255)",bt.beginPath(),bt.arc(100,50,50,0,Math.PI*2,!0),bt.closePath(),bt.fill(),bt.fillStyle="rgb(255,255,0)",bt.beginPath(),bt.arc(75,100,50,0,Math.PI*2,!0),bt.closePath(),bt.fill(),bt.fillStyle="rgb(255,0,255)",bt.arc(75,75,75,0,Math.PI*2,!0),bt.arc(75,75,25,0,Math.PI*2,!0),bt.fill("evenodd"),Ht.toDataURL&&Rt.push("canvas fp:"+Ht.toDataURL()),Rt},gt=function(){var Ae,Rt=function(at){return Ae.clearColor(0,0,0,1),Ae.enable(Ae.DEPTH_TEST),Ae.depthFunc(Ae.LEQUAL),Ae.clear(Ae.COLOR_BUFFER_BIT|Ae.DEPTH_BUFFER_BIT),"["+at[0]+", "+at[1]+"]"},Ht=function(at){var wt=at.getExtension("EXT_texture_filter_anisotropic")||at.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||at.getExtension("MOZ_EXT_texture_filter_anisotropic");if(wt){var At=at.getParameter(wt.MAX_TEXTURE_MAX_ANISOTROPY_EXT);return At===0&&(At=2),At}else return null};if(Ae=Ct(),!Ae)return null;var bt=[],Mt="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",tr="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",Vt=Ae.createBuffer();Ae.bindBuffer(Ae.ARRAY_BUFFER,Vt);var Et=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);Ae.bufferData(Ae.ARRAY_BUFFER,Et,Ae.STATIC_DRAW),Vt.itemSize=3,Vt.numItems=3;var Ye=Ae.createProgram(),Tt=Ae.createShader(Ae.VERTEX_SHADER);Ae.shaderSource(Tt,Mt),Ae.compileShader(Tt);var Wt=Ae.createShader(Ae.FRAGMENT_SHADER);Ae.shaderSource(Wt,tr),Ae.compileShader(Wt),Ae.attachShader(Ye,Tt),Ae.attachShader(Ye,Wt),Ae.linkProgram(Ye),Ae.useProgram(Ye),Ye.vertexPosAttrib=Ae.getAttribLocation(Ye,"attrVertex"),Ye.offsetUniform=Ae.getUniformLocation(Ye,"uniformOffset"),Ae.enableVertexAttribArray(Ye.vertexPosArray),Ae.vertexAttribPointer(Ye.vertexPosAttrib,Vt.itemSize,Ae.FLOAT,!1,0,0),Ae.uniform2f(Ye.offsetUniform,1,1),Ae.drawArrays(Ae.TRIANGLE_STRIP,0,Vt.numItems);try{bt.push(Ae.canvas.toDataURL())}catch{}bt.push("extensions:"+(Ae.getSupportedExtensions()||[]).join(";")),bt.push("webgl aliased line width range:"+Rt(Ae.getParameter(Ae.ALIASED_LINE_WIDTH_RANGE))),bt.push("webgl aliased point size range:"+Rt(Ae.getParameter(Ae.ALIASED_POINT_SIZE_RANGE))),bt.push("webgl alpha bits:"+Ae.getParameter(Ae.ALPHA_BITS)),bt.push("webgl antialiasing:"+(Ae.getContextAttributes().antialias?"yes":"no")),bt.push("webgl blue bits:"+Ae.getParameter(Ae.BLUE_BITS)),bt.push("webgl depth bits:"+Ae.getParameter(Ae.DEPTH_BITS)),bt.push("webgl green bits:"+Ae.getParameter(Ae.GREEN_BITS)),bt.push("webgl max anisotropy:"+Ht(Ae)),bt.push("webgl max combined texture image units:"+Ae.getParameter(Ae.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),bt.push("webgl max cube map texture size:"+Ae.getParameter(Ae.MAX_CUBE_MAP_TEXTURE_SIZE)),bt.push("webgl max fragment uniform vectors:"+Ae.getParameter(Ae.MAX_FRAGMENT_UNIFORM_VECTORS)),bt.push("webgl max render buffer size:"+Ae.getParameter(Ae.MAX_RENDERBUFFER_SIZE)),bt.push("webgl max texture image units:"+Ae.getParameter(Ae.MAX_TEXTURE_IMAGE_UNITS)),bt.push("webgl max texture size:"+Ae.getParameter(Ae.MAX_TEXTURE_SIZE)),bt.push("webgl max varying vectors:"+Ae.getParameter(Ae.MAX_VARYING_VECTORS)),bt.push("webgl max vertex attribs:"+Ae.getParameter(Ae.MAX_VERTEX_ATTRIBS)),bt.push("webgl max vertex texture image units:"+Ae.getParameter(Ae.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),bt.push("webgl max vertex uniform vectors:"+Ae.getParameter(Ae.MAX_VERTEX_UNIFORM_VECTORS)),bt.push("webgl max viewport dims:"+Rt(Ae.getParameter(Ae.MAX_VIEWPORT_DIMS))),bt.push("webgl red bits:"+Ae.getParameter(Ae.RED_BITS)),bt.push("webgl renderer:"+Ae.getParameter(Ae.RENDERER)),bt.push("webgl shading language version:"+Ae.getParameter(Ae.SHADING_LANGUAGE_VERSION)),bt.push("webgl stencil bits:"+Ae.getParameter(Ae.STENCIL_BITS)),bt.push("webgl vendor:"+Ae.getParameter(Ae.VENDOR)),bt.push("webgl version:"+Ae.getParameter(Ae.VERSION));try{var dr=Ae.getExtension("WEBGL_debug_renderer_info");dr&&(bt.push("webgl unmasked vendor:"+Ae.getParameter(dr.UNMASKED_VENDOR_WEBGL)),bt.push("webgl unmasked renderer:"+Ae.getParameter(dr.UNMASKED_RENDERER_WEBGL)))}catch{}return Ae.getShaderPrecisionFormat?(p(["FLOAT","INT"],function(at){p(["VERTEX","FRAGMENT"],function(wt){p(["HIGH","MEDIUM","LOW"],function(At){p(["precision","rangeMin","rangeMax"],function(Je){var Lt=Ae.getShaderPrecisionFormat(Ae[wt+"_SHADER"],Ae[At+"_"+at])[Je];Je!=="precision"&&(Je="precision "+Je);var sr=["webgl ",wt.toLowerCase()," shader ",At.toLowerCase()," ",at.toLowerCase()," ",Je,":",Lt].join("");bt.push(sr)})})})}),qe(Ae),bt):(qe(Ae),bt)},lt=function(){try{var Ae=Ct(),Rt=Ae.getExtension("WEBGL_debug_renderer_info"),Ht=Ae.getParameter(Rt.UNMASKED_VENDOR_WEBGL)+"~"+Ae.getParameter(Rt.UNMASKED_RENDERER_WEBGL);return qe(Ae),Ht}catch{return null}},dt=function(){var Ae=document.createElement("div");Ae.innerHTML=" ",Ae.className="adsbox";var Rt=!1;try{document.body.appendChild(Ae),Rt=document.getElementsByClassName("adsbox")[0].offsetHeight===0,document.body.removeChild(Ae)}catch{Rt=!1}return Rt},tt=function(){if(typeof navigator.languages<"u")try{var Ae=navigator.languages[0].substr(0,2);if(Ae!==navigator.language.substr(0,2))return!0}catch{return!0}return!1},rt=function(){return self.screen.width<self.screen.availWidth||self.screen.height<self.screen.availHeight},ke=function(){var Ae=navigator.userAgent.toLowerCase(),Rt=navigator.oscpu,Ht=navigator.platform.toLowerCase(),bt;Ae.indexOf("windows phone")>=0?bt="Windows Phone":Ae.indexOf("windows")>=0||Ae.indexOf("win16")>=0||Ae.indexOf("win32")>=0||Ae.indexOf("win64")>=0||Ae.indexOf("win95")>=0||Ae.indexOf("win98")>=0||Ae.indexOf("winnt")>=0||Ae.indexOf("wow64")>=0?bt="Windows":Ae.indexOf("android")>=0?bt="Android":Ae.indexOf("linux")>=0||Ae.indexOf("cros")>=0||Ae.indexOf("x11")>=0?bt="Linux":Ae.indexOf("iphone")>=0||Ae.indexOf("ipad")>=0||Ae.indexOf("ipod")>=0||Ae.indexOf("crios")>=0||Ae.indexOf("fxios")>=0?bt="iOS":Ae.indexOf("macintosh")>=0||Ae.indexOf("mac_powerpc)")>=0?bt="Mac":bt="Other";var Mt="ontouchstart"in self||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;if(Mt&&bt!=="Windows"&&bt!=="Windows Phone"&&bt!=="Android"&&bt!=="iOS"&&bt!=="Other"&&Ae.indexOf("cros")===-1)return!0;if(typeof Rt<"u"){if(Rt=Rt.toLowerCase(),Rt.indexOf("win")>=0&&bt!=="Windows"&&bt!=="Windows Phone")return!0;if(Rt.indexOf("linux")>=0&&bt!=="Linux"&&bt!=="Android")return!0;if(Rt.indexOf("mac")>=0&&bt!=="Mac"&&bt!=="iOS")return!0;if((Rt.indexOf("win")===-1&&Rt.indexOf("linux")===-1&&Rt.indexOf("mac")===-1)!=(bt==="Other"))return!0}if(Ht.indexOf("win")>=0&&bt!=="Windows"&&bt!=="Windows Phone")return!0;if((Ht.indexOf("linux")>=0||Ht.indexOf("android")>=0||Ht.indexOf("pike")>=0)&&bt!=="Linux"&&bt!=="Android")return!0;if((Ht.indexOf("mac")>=0||Ht.indexOf("ipad")>=0||Ht.indexOf("ipod")>=0||Ht.indexOf("iphone")>=0)&&bt!=="Mac"&&bt!=="iOS")return!0;if(Ht.indexOf("arm")>=0&&bt==="Windows Phone")return!1;if(Ht.indexOf("pike")>=0&&Ae.indexOf("opera mini")>=0)return!1;var tr=Ht.indexOf("win")<0&&Ht.indexOf("linux")<0&&Ht.indexOf("mac")<0&&Ht.indexOf("iphone")<0&&Ht.indexOf("ipad")<0&&Ht.indexOf("ipod")<0;return tr!==(bt==="Other")?!0:typeof navigator.plugins>"u"&&bt!=="Windows"&&bt!=="Windows Phone"},xe=function(){var Ae=navigator.userAgent.toLowerCase(),Rt=navigator.productSub,Ht;if(Ae.indexOf("edge/")>=0||Ae.indexOf("iemobile/")>=0)return!1;if(Ae.indexOf("opera mini")>=0)return!1;if(Ae.indexOf("firefox/")>=0?Ht="Firefox":Ae.indexOf("opera/")>=0||Ae.indexOf(" opr/")>=0?Ht="Opera":Ae.indexOf("chrome/")>=0?Ht="Chrome":Ae.indexOf("safari/")>=0?Ae.indexOf("android 1.")>=0||Ae.indexOf("android 2.")>=0||Ae.indexOf("android 3.")>=0||Ae.indexOf("android 4.")>=0?Ht="AOSP":Ht="Safari":Ae.indexOf("trident/")>=0?Ht="Internet Explorer":Ht="Other",(Ht==="Chrome"||Ht==="Safari"||Ht==="Opera")&&Rt!=="20030107")return!0;var bt=eval.toString().length;if(bt===37&&Ht!=="Safari"&&Ht!=="Firefox"&&Ht!=="Other")return!0;if(bt===39&&Ht!=="Internet Explorer"&&Ht!=="Other")return!0;if(bt===33&&Ht!=="Chrome"&&Ht!=="AOSP"&&Ht!=="Opera"&&Ht!=="Other")return!0;var Mt;try{throw"a"}catch(tr){try{tr.toSource(),Mt=!0}catch{Mt=!1}}return Mt&&Ht!=="Firefox"&&Ht!=="Other"},Pe=function(){var Ae=document.createElement("canvas");return!!(Ae.getContext&&Ae.getContext("2d"))},it=function(){if(!Pe())return!1;var Ae=Ct(),Rt=!!self.WebGLRenderingContext&&!!Ae;return qe(Ae),Rt},Xe=function(){return navigator.appName==="Microsoft Internet Explorer"?!0:!!(navigator.appName==="Netscape"&&/Trident/.test(navigator.userAgent))},st=function(){return("msWriteProfilerMark"in self)+("msLaunchUri"in navigator)+("msSaveBlob"in navigator)>=2},It=function(){return typeof self.swfobject<"u"},ft=function(){return self.swfobject.hasFlashPlayerVersion("9.0.0")},Jt=function(Ae){var Rt=document.createElement("div");Rt.setAttribute("id",Ae.fonts.swfContainerId),document.body.appendChild(Rt)},Ot=function(Ae,Rt){var Ht="___fp_swf_loaded";self[Ht]=function(Vt){Ae(Vt)};var bt=Rt.fonts.swfContainerId;Jt();var Mt={onReady:Ht},tr={allowScriptAccess:"always",menu:"false"};self.swfobject.embedSWF(Rt.fonts.swfPath,bt,"1","1","9.0.0",!1,Mt,tr,{})},Ct=function(){var Ae=document.createElement("canvas"),Rt=null;try{Rt=Ae.getContext("webgl")||Ae.getContext("experimental-webgl")}catch{}return Rt||(Rt=null),Rt},qe=function(Ae){var Rt=Ae.getExtension("WEBGL_lose_context");Rt?.loseContext()},Yt=[{key:"userAgent",getData:O},{key:"webdriver",getData:M},{key:"language",getData:k},{key:"colorDepth",getData:q},{key:"deviceMemory",getData:b},{key:"pixelRatio",getData:F},{key:"hardwareConcurrency",getData:Ke},{key:"screenResolution",getData:G},{key:"availableScreenResolution",getData:le},{key:"timezoneOffset",getData:se},{key:"timezone",getData:de},{key:"sessionStorage",getData:ye},{key:"localStorage",getData:he},{key:"indexedDb",getData:K},{key:"addBehavior",getData:B},{key:"openDatabase",getData:L},{key:"cpuClass",getData:$},{key:"platform",getData:T},{key:"doNotTrack",getData:N},{key:"plugins",getData:ge},{key:"canvas",getData:j},{key:"webgl",getData:Y},{key:"webglVendorAndRenderer",getData:Z},{key:"adBlock",getData:z},{key:"hasLiedLanguages",getData:fe},{key:"hasLiedResolution",getData:te},{key:"hasLiedOs",getData:H},{key:"hasLiedBrowser",getData:Q},{key:"touchSupport",getData:me},{key:"fonts",getData:_e,pauseBefore:!0},{key:"fontsFlash",getData:oe,pauseBefore:!0},{key:"audio",getData:S},{key:"enumerateDevices",getData:x}],ot=function(Ae){throw new Error("'new Fingerprint()' is deprecated, see https://github.com/fingerprintjs/fingerprintjs#upgrade-guide-from-182-to-200")};return ot.get=function(Ae,Rt){Rt?Ae||(Ae={}):(Rt=Ae,Ae={}),C(Ae,d),Ae.components=Ae.extraComponents.concat(Yt);var Ht={data:[],addPreprocessedComponent:function(tr,Vt){typeof Ae.preprocessor=="function"&&(Vt=Ae.preprocessor(tr,Vt)),Ht.data.push({key:tr,value:Vt})}},bt=-1,Mt=function(tr){if(bt+=1,bt>=Ae.components.length){Rt(Ht.data);return}var Vt=Ae.components[bt];if(Ae.excludes[Vt.key]){Mt(!1);return}if(!tr&&Vt.pauseBefore){bt-=1,setTimeout(function(){Mt(!0)},1);return}try{Vt.getData(function(Et){Ht.addPreprocessedComponent(Vt.key,Et),Mt(!1)},Ae)}catch(Et){Ht.addPreprocessedComponent(Vt.key,String(Et)),Mt(!1)}};Mt(!1)},ot.getPromise=function(Ae){return new Promise(function(Rt,Ht){ot.get(Ae,Rt)})},ot.getV18=function(Ae,Rt){return Rt==null&&(Rt=Ae,Ae={}),ot.get(Ae,function(Ht){for(var bt=[],Mt=0;Mt<Ht.length;Mt++){var tr=Ht[Mt];if(tr.value===(Ae.NOT_AVAILABLE||"not available"))bt.push({key:tr.key,value:"unknown"});else if(tr.key==="plugins")bt.push({key:"plugins",value:m(tr.value,function(Et){var Ye=m(Et[2],function(Tt){return Tt.join?Tt.join("~"):Tt}).join(",");return[Et[0],Et[1],Ye].join("::")})});else if(["canvas","webgl"].indexOf(tr.key)!==-1&&Array.isArray(tr.value))bt.push({key:tr.key,value:tr.value.join("~")});else if(["sessionStorage","localStorage","indexedDb","addBehavior","openDatabase"].indexOf(tr.key)!==-1)if(tr.value)bt.push({key:tr.key,value:1});else continue;else tr.value?bt.push(tr.value.join?{key:tr.key,value:tr.value.join(";")}:tr):bt.push({key:tr.key,value:tr.value})}var Vt=c(m(bt,function(Et){return Et.value}).join("~~~"),31);Rt(Vt,bt)})},ot.x64hash128=c,ot.VERSION="2.1.4",ot})},87196:function(ie,f,_){"use strict";var h=_(22956),w=Object.prototype.toString,E=Object.prototype.hasOwnProperty,v=function(C,x,R){for(var S=0,O=C.length;S<O;S++)E.call(C,S)&&(R==null?x(C[S],S,C):x.call(R,C[S],S,C))},c=function(C,x,R){for(var S=0,O=C.length;S<O;S++)R==null?x(C.charAt(S),S,C):x.call(R,C.charAt(S),S,C)},d=function(C,x,R){for(var S in C)E.call(C,S)&&(R==null?x(C[S],S,C):x.call(R,C[S],S,C))};function p(m){return w.call(m)==="[object Array]"}ie.exports=function(C,x,R){if(!h(x))throw new TypeError("iterator must be a function");var S;arguments.length>=3&&(S=R),p(C)?v(C,x,S):typeof C=="string"?c(C,x,S):d(C,x,S)}},69992:function(ie){"use strict";var f="Function.prototype.bind called on incompatible ",_=Object.prototype.toString,h=Math.max,w="[object Function]",E=function(p,m){for(var C=[],x=0;x<p.length;x+=1)C[x]=p[x];for(var R=0;R<m.length;R+=1)C[R+p.length]=m[R];return C},v=function(p,m){for(var C=[],x=m||0,R=0;x<p.length;x+=1,R+=1)C[R]=p[x];return C},c=function(d,p){for(var m="",C=0;C<d.length;C+=1)m+=d[C],C+1<d.length&&(m+=p);return m};ie.exports=function(p){var m=this;if(typeof m!="function"||_.apply(m)!==w)throw new TypeError(f+m);for(var C=v(arguments,1),x,R=function(){if(this instanceof x){var q=m.apply(this,E(C,arguments));return Object(q)===q?q:this}return m.apply(p,E(C,arguments))},S=h(0,m.length-C.length),O=[],M=0;M<S;M++)O[M]="$"+M;if(x=Function("binder","return function ("+c(O,",")+"){ return binder.apply(this,arguments); }")(R),m.prototype){var k=function(){};k.prototype=m.prototype,x.prototype=new k,k.prototype=null}return x}},79524:function(ie,f,_){"use strict";var h=_(69992);ie.exports=Function.prototype.bind||h},49336:function(ie,f,_){"use strict";var h,w=_(25153),E=_(41488),v=_(38004),c=_(96469),d=_(12557),p=_(63429),m=_(71102),C=_(85966),x=_(77412),R=_(52418),S=_(57958),O=_(47384),M=_(250),k=_(51844),q=_(47279),b=Function,F=function(Ee){try{return b('"use strict"; return ('+Ee+").constructor;")()}catch{}},G=_(25667),ue=_(39886),le=function(){throw new m},X=G?function(){try{return arguments.callee,le}catch{try{return G(arguments,"callee").get}catch{return le}}}():le,se=_(21514)(),de=_(14252),ye=_(23752),he=_(60248),K=_(64811),B=_(46255),L={},$=typeof Uint8Array>"u"||!de?h:de(Uint8Array),T={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?h:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?h:ArrayBuffer,"%ArrayIteratorPrototype%":se&&de?de([][Symbol.iterator]()):h,"%AsyncFromSyncIteratorPrototype%":h,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%Atomics%":typeof Atomics>"u"?h:Atomics,"%BigInt%":typeof BigInt>"u"?h:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?h:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?h:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?h:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":E,"%eval%":eval,"%EvalError%":v,"%Float16Array%":typeof Float16Array>"u"?h:Float16Array,"%Float32Array%":typeof Float32Array>"u"?h:Float32Array,"%Float64Array%":typeof Float64Array>"u"?h:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?h:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array>"u"?h:Int8Array,"%Int16Array%":typeof Int16Array>"u"?h:Int16Array,"%Int32Array%":typeof Int32Array>"u"?h:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":se&&de?de(de([][Symbol.iterator]())):h,"%JSON%":typeof JSON=="object"?JSON:h,"%Map%":typeof Map>"u"?h:Map,"%MapIteratorPrototype%":typeof Map>"u"||!se||!de?h:de(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":w,"%Object.getOwnPropertyDescriptor%":G,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?h:Promise,"%Proxy%":typeof Proxy>"u"?h:Proxy,"%RangeError%":c,"%ReferenceError%":d,"%Reflect%":typeof Reflect>"u"?h:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?h:Set,"%SetIteratorPrototype%":typeof Set>"u"||!se||!de?h:de(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?h:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":se&&de?de(""[Symbol.iterator]()):h,"%Symbol%":se?Symbol:h,"%SyntaxError%":p,"%ThrowTypeError%":X,"%TypedArray%":$,"%TypeError%":m,"%Uint8Array%":typeof Uint8Array>"u"?h:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?h:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?h:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?h:Uint32Array,"%URIError%":C,"%WeakMap%":typeof WeakMap>"u"?h:WeakMap,"%WeakRef%":typeof WeakRef>"u"?h:WeakRef,"%WeakSet%":typeof WeakSet>"u"?h:WeakSet,"%Function.prototype.call%":B,"%Function.prototype.apply%":K,"%Object.defineProperty%":ue,"%Object.getPrototypeOf%":ye,"%Math.abs%":x,"%Math.floor%":R,"%Math.max%":S,"%Math.min%":O,"%Math.pow%":M,"%Math.round%":k,"%Math.sign%":q,"%Reflect.getPrototypeOf%":he};if(de)try{null.error}catch(Ee){var N=de(de(Ee));T["%Error.prototype%"]=N}var j=function Ee(me){var Ke;if(me==="%AsyncFunction%")Ke=F("async function () {}");else if(me==="%GeneratorFunction%")Ke=F("function* () {}");else if(me==="%AsyncGeneratorFunction%")Ke=F("async function* () {}");else if(me==="%AsyncGenerator%"){var He=Ee("%AsyncGeneratorFunction%");He&&(Ke=He.prototype)}else if(me==="%AsyncIteratorPrototype%"){var Ie=Ee("%AsyncGenerator%");Ie&&de&&(Ke=de(Ie.prototype))}return T[me]=Ke,Ke},Y={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Z=_(79524),z=_(75630),fe=Z.call(B,Array.prototype.concat),te=Z.call(K,Array.prototype.splice),H=Z.call(B,String.prototype.replace),Q=Z.call(B,String.prototype.slice),oe=Z.call(B,RegExp.prototype.exec),_e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ge=/\\(\\)?/g,be=function(me){var Ke=Q(me,0,1),He=Q(me,-1);if(Ke==="%"&&He!=="%")throw new p("invalid intrinsic syntax, expected closing `%`");if(He==="%"&&Ke!=="%")throw new p("invalid intrinsic syntax, expected opening `%`");var Ie=[];return H(me,_e,function(Le,Ge,Be,We){Ie[Ie.length]=Be?H(We,ge,"$1"):Ge||Le}),Ie},we=function(me,Ke){var He=me,Ie;if(z(Y,He)&&(Ie=Y[He],He="%"+Ie[0]+"%"),z(T,He)){var Le=T[He];if(Le===L&&(Le=j(He)),typeof Le>"u"&&!Ke)throw new m("intrinsic "+me+" exists, but is not available. Please file an issue!");return{alias:Ie,name:He,value:Le}}throw new p("intrinsic "+me+" does not exist!")};ie.exports=function(me,Ke){if(typeof me!="string"||me.length===0)throw new m("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ke!="boolean")throw new m('"allowMissing" argument must be a boolean');if(oe(/^%?[^%]*%?$/,me)===null)throw new p("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var He=be(me),Ie=He.length>0?He[0]:"",Le=we("%"+Ie+"%",Ke),Ge=Le.name,Be=Le.value,We=!1,Ze=Le.alias;Ze&&(Ie=Ze[0],te(He,fe([0,1],Ze)));for(var _t=1,Ft=!0;_t<He.length;_t+=1){var gt=He[_t],lt=Q(gt,0,1),dt=Q(gt,-1);if((lt==='"'||lt==="'"||lt==="`"||dt==='"'||dt==="'"||dt==="`")&<!==dt)throw new p("property names with quotes must have matching quotes");if((gt==="constructor"||!Ft)&&(We=!0),Ie+="."+gt,Ge="%"+Ie+"%",z(T,Ge))Be=T[Ge];else if(Be!=null){if(!(gt in Be)){if(!Ke)throw new m("base intrinsic for "+me+" exists, but the property is not available.");return}if(G&&_t+1>=He.length){var tt=G(Be,gt);Ft=!!tt,Ft&&"get"in tt&&!("originalValue"in tt.get)?Be=tt.get:Be=Be[gt]}else Ft=z(Be,gt),Be=Be[gt];Ft&&!We&&(T[Ge]=Be)}}return Be}},23752:function(ie,f,_){"use strict";var h=_(25153);ie.exports=h.getPrototypeOf||null},60248:function(ie){"use strict";ie.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null},14252:function(ie,f,_){"use strict";var h=_(60248),w=_(23752),E=_(57678);ie.exports=h?function(c){return h(c)}:w?function(c){if(!c||typeof c!="object"&&typeof c!="function")throw new TypeError("getProto: not an object");return w(c)}:E?function(c){return E(c)}:null},41765:function(ie,f,_){var h=typeof Object.defineProperties=="function"?Object.defineProperty:function(ee,ve,ze){ee!=Array.prototype&&ee!=Object.prototype&&(ee[ve]=ze.value)},w=typeof _.g<"u"&&_.g!=null?_.g:this;function E(ee,ve){if(ve){var ze=w;ee=ee.split(".");for(var yt=0;yt<ee.length-1;yt++){var vt=ee[yt];vt in ze||(ze[vt]={}),ze=ze[vt]}ee=ee[ee.length-1],yt=ze[ee],ve=ve(yt),ve!=yt&&ve!=null&&h(ze,ee,{configurable:!0,writable:!0,value:ve})}}function v(ee){var ve=0;return function(){return ve<ee.length?{done:!1,value:ee[ve++]}:{done:!0}}}function c(){c=function(){},w.Symbol||(w.Symbol=p)}function d(ee,ve){this.a=ee,h(this,"description",{configurable:!0,writable:!0,value:ve})}d.prototype.toString=function(){return this.a};var p=function(){function ee(ze){if(this instanceof ee)throw new TypeError("Symbol is not a constructor");return new d("jscomp_symbol_"+(ze||"")+"_"+ve++,ze)}var ve=0;return ee}();function m(){c();var ee=w.Symbol.iterator;ee||(ee=w.Symbol.iterator=w.Symbol("Symbol.iterator")),typeof Array.prototype[ee]!="function"&&h(Array.prototype,ee,{configurable:!0,writable:!0,value:function(){return C(v(this))}}),m=function(){}}function C(ee){return m(),ee={next:ee},ee[w.Symbol.iterator]=function(){return this},ee}function x(ee,ve){m(),ee instanceof String&&(ee+="");var ze=0,yt={next:function(){if(ze<ee.length){var vt=ze++;return{value:ve(vt,ee[vt]),done:!1}}return yt.next=function(){return{done:!0,value:void 0}},yt.next()}};return yt[Symbol.iterator]=function(){return yt},yt}E("Array.prototype.entries",function(ee){return ee||function(){return x(this,function(ve,ze){return[ve,ze]})}});var R=this||self;function S(ee,ve,ze){ee=ee.split("."),ze=ze||R,ee[0]in ze||typeof ze.execScript>"u"||ze.execScript("var "+ee[0]);for(var yt;ee.length&&(yt=ee.shift());)ee.length||ve===void 0?ze[yt]&&ze[yt]!==Object.prototype[yt]?ze=ze[yt]:ze=ze[yt]={}:ze[yt]=ve}function O(ee){var ve=typeof ee;if(ve=="object")if(ee){if(ee instanceof Array)return"array";if(ee instanceof Object)return ve;var ze=Object.prototype.toString.call(ee);if(ze=="[object Window]")return"object";if(ze=="[object Array]"||typeof ee.length=="number"&&typeof ee.splice<"u"&&typeof ee.propertyIsEnumerable<"u"&&!ee.propertyIsEnumerable("splice"))return"array";if(ze=="[object Function]"||typeof ee.call<"u"&&typeof ee.propertyIsEnumerable<"u"&&!ee.propertyIsEnumerable("call"))return"function"}else return"null";else if(ve=="function"&&typeof ee.call>"u")return"object";return ve}function M(ee){var ve=typeof ee;return ve=="object"&&ee!=null||ve=="function"}function k(ee,ve,ze){S(ee,ve,ze)}function q(ee,ve){function ze(){}ze.prototype=ve.prototype,ee.prototype=new ze,ee.prototype.constructor=ee}var b="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function F(ee,ve){for(var ze,yt,vt=1;vt<arguments.length;vt++){yt=arguments[vt];for(ze in yt)ee[ze]=yt[ze];for(var ar=0;ar<b.length;ar++)ze=b[ar],Object.prototype.hasOwnProperty.call(yt,ze)&&(ee[ze]=yt[ze])}}var G=Array.prototype.forEach?function(ee,ve){Array.prototype.forEach.call(ee,ve,void 0)}:function(ee,ve){for(var ze=ee.length,yt=typeof ee=="string"?ee.split(""):ee,vt=0;vt<ze;vt++)vt in yt&&ve.call(void 0,yt[vt],vt,ee)},ue=Array.prototype.map?function(ee,ve){return Array.prototype.map.call(ee,ve,void 0)}:function(ee,ve){for(var ze=ee.length,yt=Array(ze),vt=typeof ee=="string"?ee.split(""):ee,ar=0;ar<ze;ar++)ar in vt&&(yt[ar]=ve.call(void 0,vt[ar],ar,ee));return yt};function le(ee,ve,ze){return 2>=arguments.length?Array.prototype.slice.call(ee,ve):Array.prototype.slice.call(ee,ve,ze)}function X(ee,ve,ze,yt){var vt="Assertion failed";if(ze){vt+=": "+ze;var ar=yt}else ee&&(vt+=": "+ee,ar=ve);throw Error(vt,ar||[])}function se(ee,ve,ze){for(var yt=[],vt=2;vt<arguments.length;++vt)yt[vt-2]=arguments[vt];return ee||X("",null,ve,yt),ee}function de(ee,ve,ze){for(var yt=[],vt=2;vt<arguments.length;++vt)yt[vt-2]=arguments[vt];typeof ee!="string"&&X("Expected string but got %s: %s.",[O(ee),ee],ve,yt)}function ye(ee,ve,ze){for(var yt=[],vt=2;vt<arguments.length;++vt)yt[vt-2]=arguments[vt];Array.isArray(ee)||X("Expected array but got %s: %s.",[O(ee),ee],ve,yt)}function he(ee,ve){for(var ze=[],yt=1;yt<arguments.length;++yt)ze[yt-1]=arguments[yt];throw Error("Failure"+(ee?": "+ee:""),ze)}function K(ee,ve,ze,yt){for(var vt=[],ar=3;ar<arguments.length;++ar)vt[ar-3]=arguments[ar];ee instanceof ve||X("Expected instanceof %s but got %s.",[B(ve),B(ee)],ze,vt)}function B(ee){return ee instanceof Function?ee.displayName||ee.name||"unknown type name":ee instanceof Object?ee.constructor.displayName||ee.constructor.name||Object.prototype.toString.call(ee):ee===null?"null":typeof ee}function L(ee,ve){if(this.c=ee,this.b=ve,this.a={},this.arrClean=!0,0<this.c.length){for(ee=0;ee<this.c.length;ee++){ve=this.c[ee];var ze=ve[0];this.a[ze.toString()]=new j(ze,ve[1])}this.arrClean=!0}}S("jspb.Map",L,void 0),L.prototype.g=function(){if(this.arrClean){if(this.b){var ee=this.a,ve;for(ve in ee)if(Object.prototype.hasOwnProperty.call(ee,ve)){var ze=ee[ve].a;ze&&ze.g()}}}else{for(this.c.length=0,ee=N(this),ee.sort(),ve=0;ve<ee.length;ve++){var yt=this.a[ee[ve]];(ze=yt.a)&&ze.g(),this.c.push([yt.key,yt.value])}this.arrClean=!0}return this.c},L.prototype.toArray=L.prototype.g,L.prototype.Mc=function(ee,ve){for(var ze=this.g(),yt=[],vt=0;vt<ze.length;vt++){var ar=this.a[ze[vt][0].toString()];T(this,ar);var wr=ar.a;wr?(se(ve),yt.push([ar.key,ve(ee,wr)])):yt.push([ar.key,ar.value])}return yt},L.prototype.toObject=L.prototype.Mc,L.fromObject=function(ee,ve,ze){ve=new L([],ve);for(var yt=0;yt<ee.length;yt++){var vt=ee[yt][0],ar=ze(ee[yt][1]);ve.set(vt,ar)}return ve};function $(ee){this.a=0,this.b=ee}$.prototype.next=function(){return this.a<this.b.length?{done:!1,value:this.b[this.a++]}:{done:!0,value:void 0}},typeof Symbol<"u"&&($.prototype[Symbol.iterator]=function(){return this}),L.prototype.Jb=function(){return N(this).length},L.prototype.getLength=L.prototype.Jb,L.prototype.clear=function(){this.a={},this.arrClean=!1},L.prototype.clear=L.prototype.clear,L.prototype.Cb=function(ee){ee=ee.toString();var ve=this.a.hasOwnProperty(ee);return delete this.a[ee],this.arrClean=!1,ve},L.prototype.del=L.prototype.Cb,L.prototype.Eb=function(){var ee=[],ve=N(this);ve.sort();for(var ze=0;ze<ve.length;ze++){var yt=this.a[ve[ze]];ee.push([yt.key,yt.value])}return ee},L.prototype.getEntryList=L.prototype.Eb,L.prototype.entries=function(){var ee=[],ve=N(this);ve.sort();for(var ze=0;ze<ve.length;ze++){var yt=this.a[ve[ze]];ee.push([yt.key,T(this,yt)])}return new $(ee)},L.prototype.entries=L.prototype.entries,L.prototype.keys=function(){var ee=[],ve=N(this);ve.sort();for(var ze=0;ze<ve.length;ze++)ee.push(this.a[ve[ze]].key);return new $(ee)},L.prototype.keys=L.prototype.keys,L.prototype.values=function(){var ee=[],ve=N(this);ve.sort();for(var ze=0;ze<ve.length;ze++)ee.push(T(this,this.a[ve[ze]]));return new $(ee)},L.prototype.values=L.prototype.values,L.prototype.forEach=function(ee,ve){var ze=N(this);ze.sort();for(var yt=0;yt<ze.length;yt++){var vt=this.a[ze[yt]];ee.call(ve,T(this,vt),vt.key,this)}},L.prototype.forEach=L.prototype.forEach,L.prototype.set=function(ee,ve){var ze=new j(ee);return this.b?(ze.a=ve,ze.value=ve.g()):ze.value=ve,this.a[ee.toString()]=ze,this.arrClean=!1,this},L.prototype.set=L.prototype.set;function T(ee,ve){return ee.b?(ve.a||(ve.a=new ee.b(ve.value)),ve.a):ve.value}L.prototype.get=function(ee){if(ee=this.a[ee.toString()])return T(this,ee)},L.prototype.get=L.prototype.get,L.prototype.has=function(ee){return ee.toString()in this.a},L.prototype.has=L.prototype.has,L.prototype.Jc=function(ee,ve,ze,yt,vt){var ar=N(this);ar.sort();for(var wr=0;wr<ar.length;wr++){var zt=this.a[ar[wr]];ve.Va(ee),ze.call(ve,1,zt.key),this.b?yt.call(ve,2,T(this,zt),vt):yt.call(ve,2,zt.value),ve.Ya()}},L.prototype.serializeBinary=L.prototype.Jc,L.deserializeBinary=function(ee,ve,ze,yt,vt,ar,wr){for(;ve.oa()&&!ve.bb();){var zt=ve.c;zt==1?ar=ze.call(ve):zt==2&&(ee.b?(se(vt),wr||(wr=new ee.b),yt.call(ve,wr,vt)):wr=yt.call(ve))}se(ar!=null),se(wr!=null),ee.set(ar,wr)};function N(ee){ee=ee.a;var ve=[],ze;for(ze in ee)Object.prototype.hasOwnProperty.call(ee,ze)&&ve.push(ze);return ve}function j(ee,ve){this.key=ee,this.value=ve,this.a=void 0}function Y(ee){if(8192>=ee.length)return String.fromCharCode.apply(null,ee);for(var ve="",ze=0;ze<ee.length;ze+=8192)ve+=String.fromCharCode.apply(null,le(ee,ze,ze+8192));return ve}var Z={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},z={"'":"\\'"},fe={},te=null;function H(ee,ve){ve===void 0&&(ve=0),_e(),ve=fe[ve];for(var ze=[],yt=0;yt<ee.length;yt+=3){var vt=ee[yt],ar=yt+1<ee.length,wr=ar?ee[yt+1]:0,zt=yt+2<ee.length,Kr=zt?ee[yt+2]:0,Xt=vt>>2;vt=(vt&3)<<4|wr>>4,wr=(wr&15)<<2|Kr>>6,Kr&=63,zt||(Kr=64,ar||(wr=64)),ze.push(ve[Xt],ve[vt],ve[wr]||"",ve[Kr]||"")}return ze.join("")}function Q(ee){var ve=ee.length,ze=3*ve/4;ze%3?ze=Math.floor(ze):"=.".indexOf(ee[ve-1])!=-1&&(ze="=.".indexOf(ee[ve-2])!=-1?ze-2:ze-1);var yt=new Uint8Array(ze),vt=0;return oe(ee,function(ar){yt[vt++]=ar}),yt.subarray(0,vt)}function oe(ee,ve){function ze(Kr){for(;yt<ee.length;){var Xt=ee.charAt(yt++),et=te[Xt];if(et!=null)return et;if(!/^[\s\xa0]*$/.test(Xt))throw Error("Unknown base64 encoding at char: "+Xt)}return Kr}_e();for(var yt=0;;){var vt=ze(-1),ar=ze(0),wr=ze(64),zt=ze(64);if(zt===64&&vt===-1)break;ve(vt<<2|ar>>4),wr!=64&&(ve(ar<<4&240|wr>>2),zt!=64&&ve(wr<<6&192|zt))}}function _e(){if(!te){te={};for(var ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),ve=["+/=","+/","-_=","-_.","-_"],ze=0;5>ze;ze++){var yt=ee.concat(ve[ze].split(""));fe[ze]=yt;for(var vt=0;vt<yt.length;vt++){var ar=yt[vt];te[ar]===void 0&&(te[ar]=vt)}}}}S("jspb.ConstBinaryMessage",function(){},void 0),S("jspb.BinaryMessage",function(){},void 0),S("jspb.BinaryConstants.FieldType",{yb:-1,ee:1,FLOAT:2,ke:3,te:4,je:5,xb:6,wb:7,BOOL:8,re:9,ie:10,le:11,ce:12,se:13,ge:14,me:15,ne:16,oe:17,pe:18,he:30,ve:31},void 0),S("jspb.BinaryConstants.WireType",{yb:-1,ue:0,xb:1,de:2,qe:3,fe:4,wb:5},void 0),S("jspb.BinaryConstants.FieldTypeToWireType",function(ee){switch(ee){case 5:case 3:case 13:case 4:case 17:case 18:case 8:case 14:case 31:return 0;case 1:case 6:case 16:case 30:return 1;case 9:case 11:case 12:return 2;case 2:case 7:case 15:return 5;default:return-1}},void 0),S("jspb.BinaryConstants.INVALID_FIELD_NUMBER",-1,void 0),S("jspb.BinaryConstants.FLOAT32_EPS",1401298464324817e-60,void 0),S("jspb.BinaryConstants.FLOAT32_MIN",11754943508222875e-54,void 0),S("jspb.BinaryConstants.FLOAT32_MAX",34028234663852886e22,void 0),S("jspb.BinaryConstants.FLOAT64_EPS",5e-324,void 0),S("jspb.BinaryConstants.FLOAT64_MIN",22250738585072014e-324,void 0),S("jspb.BinaryConstants.FLOAT64_MAX",17976931348623157e292,void 0),S("jspb.BinaryConstants.TWO_TO_20",1048576,void 0),S("jspb.BinaryConstants.TWO_TO_23",8388608,void 0),S("jspb.BinaryConstants.TWO_TO_31",2147483648,void 0),S("jspb.BinaryConstants.TWO_TO_32",4294967296,void 0),S("jspb.BinaryConstants.TWO_TO_52",4503599627370496,void 0),S("jspb.BinaryConstants.TWO_TO_63",9223372036854776e3,void 0),S("jspb.BinaryConstants.TWO_TO_64",18446744073709552e3,void 0),S("jspb.BinaryConstants.ZERO_HASH","\0\0\0\0\0\0\0\0",void 0);var ge=0,be=0;S("jspb.utils.getSplit64Low",function(){return ge},void 0),S("jspb.utils.getSplit64High",function(){return be},void 0);function we(ee){var ve=ee>>>0;ee=Math.floor((ee-ve)/4294967296)>>>0,ge=ve,be=ee}S("jspb.utils.splitUint64",we,void 0);function Ee(ee){var ve=0>ee;ee=Math.abs(ee);var ze=ee>>>0;ee=Math.floor((ee-ze)/4294967296),ee>>>=0,ve&&(ee=~ee>>>0,ze=(~ze>>>0)+1,4294967295<ze&&(ze=0,ee++,4294967295<ee&&(ee=0))),ge=ze,be=ee}S("jspb.utils.splitInt64",Ee,void 0);function me(ee){var ve=0>ee;ee=2*Math.abs(ee),we(ee),ee=ge;var ze=be;ve&&(ee==0?ze==0?ze=ee=4294967295:(ze--,ee=4294967295):ee--),ge=ee,be=ze}S("jspb.utils.splitZigzag64",me,void 0);function Ke(ee){var ve=0>ee?1:0;if(ee=ve?-ee:ee,ee===0)0<1/ee?ge=be=0:(be=0,ge=2147483648);else if(isNaN(ee))be=0,ge=2147483647;else if(34028234663852886e22<ee)be=0,ge=(ve<<31|2139095040)>>>0;else if(11754943508222875e-54>ee)ee=Math.round(ee/Math.pow(2,-149)),be=0,ge=(ve<<31|ee)>>>0;else{var ze=Math.floor(Math.log(ee)/Math.LN2);ee*=Math.pow(2,-ze),ee=Math.round(8388608*ee),16777216<=ee&&++ze,be=0,ge=(ve<<31|ze+127<<23|ee&8388607)>>>0}}S("jspb.utils.splitFloat32",Ke,void 0);function He(ee){var ve=0>ee?1:0;if(ee=ve?-ee:ee,ee===0)be=0<1/ee?0:2147483648,ge=0;else if(isNaN(ee))be=2147483647,ge=4294967295;else if(17976931348623157e292<ee)be=(ve<<31|2146435072)>>>0,ge=0;else if(22250738585072014e-324>ee)ee/=Math.pow(2,-1074),be=(ve<<31|ee/4294967296)>>>0,ge=ee>>>0;else{var ze=ee,yt=0;if(2<=ze)for(;2<=ze&&1023>yt;)yt++,ze/=2;else for(;1>ze&&-1022<yt;)ze*=2,yt--;ee*=Math.pow(2,-yt),be=(ve<<31|yt+1023<<20|1048576*ee&1048575)>>>0,ge=4503599627370496*ee>>>0}}S("jspb.utils.splitFloat64",He,void 0);function Ie(ee){var ve=ee.charCodeAt(4),ze=ee.charCodeAt(5),yt=ee.charCodeAt(6),vt=ee.charCodeAt(7);ge=ee.charCodeAt(0)+(ee.charCodeAt(1)<<8)+(ee.charCodeAt(2)<<16)+(ee.charCodeAt(3)<<24)>>>0,be=ve+(ze<<8)+(yt<<16)+(vt<<24)>>>0}S("jspb.utils.splitHash64",Ie,void 0);function Le(ee,ve){return 4294967296*ve+(ee>>>0)}S("jspb.utils.joinUint64",Le,void 0);function Ge(ee,ve){var ze=ve&2147483648;return ze&&(ee=~ee+1>>>0,ve=~ve>>>0,ee==0&&(ve=ve+1>>>0)),ee=Le(ee,ve),ze?-ee:ee}S("jspb.utils.joinInt64",Ge,void 0);function Be(ee,ve,ze){var yt=ve>>31;return ze(ee<<1^yt,(ve<<1|ee>>>31)^yt)}S("jspb.utils.toZigzag64",Be,void 0);function We(ee,ve){return Ze(ee,ve,Ge)}S("jspb.utils.joinZigzag64",We,void 0);function Ze(ee,ve,ze){var yt=-(ee&1);return ze((ee>>>1|ve<<31)^yt,ve>>>1^yt)}S("jspb.utils.fromZigzag64",Ze,void 0);function _t(ee){var ve=2*(ee>>31)+1,ze=ee>>>23&255;return ee&=8388607,ze==255?ee?NaN:1/0*ve:ze==0?ve*Math.pow(2,-149)*ee:ve*Math.pow(2,ze-150)*(ee+Math.pow(2,23))}S("jspb.utils.joinFloat32",_t,void 0);function Ft(ee,ve){var ze=2*(ve>>31)+1,yt=ve>>>20&2047;return ee=4294967296*(ve&1048575)+ee,yt==2047?ee?NaN:1/0*ze:yt==0?ze*Math.pow(2,-1074)*ee:ze*Math.pow(2,yt-1075)*(ee+4503599627370496)}S("jspb.utils.joinFloat64",Ft,void 0);function gt(ee,ve){return String.fromCharCode(ee>>>0&255,ee>>>8&255,ee>>>16&255,ee>>>24&255,ve>>>0&255,ve>>>8&255,ve>>>16&255,ve>>>24&255)}S("jspb.utils.joinHash64",gt,void 0),S("jspb.utils.DIGITS","0123456789abcdef".split(""),void 0);function lt(ee,ve){function ze(vt,ar){return vt=vt?String(vt):"",ar?"0000000".slice(vt.length)+vt:vt}if(2097151>=ve)return""+Le(ee,ve);var yt=(ee>>>24|ve<<8)>>>0&16777215;return ve=ve>>16&65535,ee=(ee&16777215)+6777216*yt+6710656*ve,yt+=8147497*ve,ve*=2,1e7<=ee&&(yt+=Math.floor(ee/1e7),ee%=1e7),1e7<=yt&&(ve+=Math.floor(yt/1e7),yt%=1e7),ze(ve,0)+ze(yt,ve)+ze(ee,1)}S("jspb.utils.joinUnsignedDecimalString",lt,void 0);function dt(ee,ve){var ze=ve&2147483648;return ze&&(ee=~ee+1>>>0,ve=~ve+(ee==0?1:0)>>>0),ee=lt(ee,ve),ze?"-"+ee:ee}S("jspb.utils.joinSignedDecimalString",dt,void 0);function tt(ee,ve){Ie(ee),ee=ge;var ze=be;return ve?dt(ee,ze):lt(ee,ze)}S("jspb.utils.hash64ToDecimalString",tt,void 0),S("jspb.utils.hash64ArrayToDecimalStrings",function(ee,ve){for(var ze=Array(ee.length),yt=0;yt<ee.length;yt++)ze[yt]=tt(ee[yt],ve);return ze},void 0);function rt(ee){function ve(wr,zt){for(var Kr=0;8>Kr&&(wr!==1||0<zt);Kr++)zt=wr*vt[Kr]+zt,vt[Kr]=zt&255,zt>>>=8}function ze(){for(var wr=0;8>wr;wr++)vt[wr]=~vt[wr]&255}se(0<ee.length);var yt=!1;ee[0]==="-"&&(yt=!0,ee=ee.slice(1));for(var vt=[0,0,0,0,0,0,0,0],ar=0;ar<ee.length;ar++)ve(10,ee.charCodeAt(ar)-48);return yt&&(ze(),ve(1,1)),Y(vt)}S("jspb.utils.decimalStringToHash64",rt,void 0),S("jspb.utils.splitDecimalString",function(ee){Ie(rt(ee))},void 0);function ke(ee){return String.fromCharCode(10>ee?48+ee:87+ee)}function xe(ee){return 97<=ee?ee-97+10:ee-48}S("jspb.utils.hash64ToHexString",function(ee){var ve=Array(18);ve[0]="0",ve[1]="x";for(var ze=0;8>ze;ze++){var yt=ee.charCodeAt(7-ze);ve[2*ze+2]=ke(yt>>4),ve[2*ze+3]=ke(yt&15)}return ve.join("")},void 0),S("jspb.utils.hexStringToHash64",function(ee){ee=ee.toLowerCase(),se(ee.length==18),se(ee[0]=="0"),se(ee[1]=="x");for(var ve="",ze=0;8>ze;ze++)ve=String.fromCharCode(16*xe(ee.charCodeAt(2*ze+2))+xe(ee.charCodeAt(2*ze+3)))+ve;return ve},void 0),S("jspb.utils.hash64ToNumber",function(ee,ve){Ie(ee),ee=ge;var ze=be;return ve?Ge(ee,ze):Le(ee,ze)},void 0),S("jspb.utils.numberToHash64",function(ee){return Ee(ee),gt(ge,be)},void 0),S("jspb.utils.countVarints",function(ee,ve,ze){for(var yt=0,vt=ve;vt<ze;vt++)yt+=ee[vt]>>7;return ze-ve-yt},void 0),S("jspb.utils.countVarintFields",function(ee,ve,ze,yt){var vt=0;if(yt*=8,128>yt)for(;ve<ze&&ee[ve++]==yt;)for(vt++;;){var ar=ee[ve++];if(!(ar&128))break}else for(;ve<ze;){for(ar=yt;128<ar;){if(ee[ve]!=(ar&127|128))return vt;ve++,ar>>=7}if(ee[ve++]!=ar)break;for(vt++;ar=ee[ve++],(ar&128)!=0;);}return vt},void 0);function Pe(ee,ve,ze,yt,vt){var ar=0;if(128>yt)for(;ve<ze&&ee[ve++]==yt;)ar++,ve+=vt;else for(;ve<ze;){for(var wr=yt;128<wr;){if(ee[ve++]!=(wr&127|128))return ar;wr>>=7}if(ee[ve++]!=wr)break;ar++,ve+=vt}return ar}S("jspb.utils.countFixed32Fields",function(ee,ve,ze,yt){return Pe(ee,ve,ze,8*yt+5,4)},void 0),S("jspb.utils.countFixed64Fields",function(ee,ve,ze,yt){return Pe(ee,ve,ze,8*yt+1,8)},void 0),S("jspb.utils.countDelimitedFields",function(ee,ve,ze,yt){var vt=0;for(yt=8*yt+2;ve<ze;){for(var ar=yt;128<ar;){if(ee[ve++]!=(ar&127|128))return vt;ar>>=7}if(ee[ve++]!=ar)break;vt++;for(var wr=0,zt=1;ar=ee[ve++],wr+=(ar&127)*zt,zt*=128,(ar&128)!=0;);ve+=wr}return vt},void 0),S("jspb.utils.debugBytesToTextFormat",function(ee){var ve='"';if(ee){ee=it(ee);for(var ze=0;ze<ee.length;ze++)ve+="\\x",16>ee[ze]&&(ve+="0"),ve+=ee[ze].toString(16)}return ve+'"'},void 0),S("jspb.utils.debugScalarToTextFormat",function(ee){if(typeof ee=="string"){ee=String(ee);for(var ve=['"'],ze=0;ze<ee.length;ze++){var yt=ee.charAt(ze),vt=yt.charCodeAt(0),ar=ze+1,wr;(wr=Z[yt])||(31<vt&&127>vt||(vt=yt,vt in z?yt=z[vt]:vt in Z?yt=z[vt]=Z[vt]:(wr=vt.charCodeAt(0),31<wr&&127>wr?yt=vt:(256>wr?(yt="\\x",(16>wr||256<wr)&&(yt+="0")):(yt="\\u",4096>wr&&(yt+="0")),yt+=wr.toString(16).toUpperCase()),yt=z[vt]=yt)),wr=yt),ve[ar]=wr}ve.push('"'),ee=ve.join("")}else ee=ee.toString();return ee},void 0),S("jspb.utils.stringToByteArray",function(ee){for(var ve=new Uint8Array(ee.length),ze=0;ze<ee.length;ze++){var yt=ee.charCodeAt(ze);if(255<yt)throw Error("Conversion error: string contains codepoint outside of byte range");ve[ze]=yt}return ve},void 0);function it(ee){return ee.constructor===Uint8Array?ee:ee.constructor===ArrayBuffer?new Uint8Array(ee):ee.constructor===Array?new Uint8Array(ee):ee.constructor===String?Q(ee):ee instanceof Uint8Array?new Uint8Array(ee.buffer,ee.byteOffset,ee.byteLength):(he("Type not convertible to Uint8Array."),new Uint8Array(0))}S("jspb.utils.byteSourceToUint8Array",it,void 0);function Xe(ee,ve,ze){this.b=null,this.a=this.c=this.h=0,this.v=!1,ee&&this.H(ee,ve,ze)}S("jspb.BinaryDecoder",Xe,void 0);var st=[];Xe.getInstanceCacheLength=function(){return st.length};function It(ee,ve,ze){if(st.length){var yt=st.pop();return ee&&yt.H(ee,ve,ze),yt}return new Xe(ee,ve,ze)}Xe.alloc=It,Xe.prototype.Ca=function(){this.clear(),100>st.length&&st.push(this)},Xe.prototype.free=Xe.prototype.Ca,Xe.prototype.clone=function(){return It(this.b,this.h,this.c-this.h)},Xe.prototype.clone=Xe.prototype.clone,Xe.prototype.clear=function(){this.b=null,this.a=this.c=this.h=0,this.v=!1},Xe.prototype.clear=Xe.prototype.clear,Xe.prototype.Y=function(){return this.b},Xe.prototype.getBuffer=Xe.prototype.Y,Xe.prototype.H=function(ee,ve,ze){this.b=it(ee),this.h=ve!==void 0?ve:0,this.c=ze!==void 0?this.h+ze:this.b.length,this.a=this.h},Xe.prototype.setBlock=Xe.prototype.H,Xe.prototype.Db=function(){return this.c},Xe.prototype.getEnd=Xe.prototype.Db,Xe.prototype.setEnd=function(ee){this.c=ee},Xe.prototype.setEnd=Xe.prototype.setEnd,Xe.prototype.reset=function(){this.a=this.h},Xe.prototype.reset=Xe.prototype.reset,Xe.prototype.B=function(){return this.a},Xe.prototype.getCursor=Xe.prototype.B,Xe.prototype.Ma=function(ee){this.a=ee},Xe.prototype.setCursor=Xe.prototype.Ma,Xe.prototype.advance=function(ee){this.a+=ee,se(this.a<=this.c)},Xe.prototype.advance=Xe.prototype.advance,Xe.prototype.ya=function(){return this.a==this.c},Xe.prototype.atEnd=Xe.prototype.ya,Xe.prototype.Qb=function(){return this.a>this.c},Xe.prototype.pastEnd=Xe.prototype.Qb,Xe.prototype.getError=function(){return this.v||0>this.a||this.a>this.c},Xe.prototype.getError=Xe.prototype.getError,Xe.prototype.w=function(ee){for(var ve=128,ze=0,yt=0,vt=0;4>vt&&128<=ve;vt++)ve=this.b[this.a++],ze|=(ve&127)<<7*vt;if(128<=ve&&(ve=this.b[this.a++],ze|=(ve&127)<<28,yt|=(ve&127)>>4),128<=ve)for(vt=0;5>vt&&128<=ve;vt++)ve=this.b[this.a++],yt|=(ve&127)<<7*vt+3;if(128>ve)return ee(ze>>>0,yt>>>0);he("Failed to read varint, encoding is invalid."),this.v=!0},Xe.prototype.readSplitVarint64=Xe.prototype.w,Xe.prototype.ea=function(ee){return this.w(function(ve,ze){return Ze(ve,ze,ee)})},Xe.prototype.readSplitZigzagVarint64=Xe.prototype.ea,Xe.prototype.ta=function(ee){var ve=this.b,ze=this.a;this.a+=8;for(var yt=0,vt=0,ar=ze+7;ar>=ze;ar--)yt=yt<<8|ve[ar],vt=vt<<8|ve[ar+4];return ee(yt,vt)},Xe.prototype.readSplitFixed64=Xe.prototype.ta,Xe.prototype.kb=function(){for(;this.b[this.a]&128;)this.a++;this.a++},Xe.prototype.skipVarint=Xe.prototype.kb,Xe.prototype.mb=function(ee){for(;128<ee;)this.a--,ee>>>=7;this.a--},Xe.prototype.unskipVarint=Xe.prototype.mb,Xe.prototype.o=function(){var ee=this.b,ve=ee[this.a],ze=ve&127;return 128>ve?(this.a+=1,se(this.a<=this.c),ze):(ve=ee[this.a+1],ze|=(ve&127)<<7,128>ve?(this.a+=2,se(this.a<=this.c),ze):(ve=ee[this.a+2],ze|=(ve&127)<<14,128>ve?(this.a+=3,se(this.a<=this.c),ze):(ve=ee[this.a+3],ze|=(ve&127)<<21,128>ve?(this.a+=4,se(this.a<=this.c),ze):(ve=ee[this.a+4],ze|=(ve&15)<<28,128>ve?(this.a+=5,se(this.a<=this.c),ze>>>0):(this.a+=5,128<=ee[this.a++]&&128<=ee[this.a++]&&128<=ee[this.a++]&&128<=ee[this.a++]&&128<=ee[this.a++]&&se(!1),se(this.a<=this.c),ze)))))},Xe.prototype.readUnsignedVarint32=Xe.prototype.o,Xe.prototype.da=function(){return~~this.o()},Xe.prototype.readSignedVarint32=Xe.prototype.da,Xe.prototype.O=function(){return this.o().toString()},Xe.prototype.Ea=function(){return this.da().toString()},Xe.prototype.readSignedVarint32String=Xe.prototype.Ea,Xe.prototype.Ia=function(){var ee=this.o();return ee>>>1^-(ee&1)},Xe.prototype.readZigzagVarint32=Xe.prototype.Ia,Xe.prototype.Ga=function(){return this.w(Le)},Xe.prototype.readUnsignedVarint64=Xe.prototype.Ga,Xe.prototype.Ha=function(){return this.w(lt)},Xe.prototype.readUnsignedVarint64String=Xe.prototype.Ha,Xe.prototype.sa=function(){return this.w(Ge)},Xe.prototype.readSignedVarint64=Xe.prototype.sa,Xe.prototype.Fa=function(){return this.w(dt)},Xe.prototype.readSignedVarint64String=Xe.prototype.Fa,Xe.prototype.Ja=function(){return this.w(We)},Xe.prototype.readZigzagVarint64=Xe.prototype.Ja,Xe.prototype.fb=function(){return this.ea(gt)},Xe.prototype.readZigzagVarintHash64=Xe.prototype.fb,Xe.prototype.Ka=function(){return this.ea(dt)},Xe.prototype.readZigzagVarint64String=Xe.prototype.Ka,Xe.prototype.Gc=function(){var ee=this.b[this.a];return this.a+=1,se(this.a<=this.c),ee},Xe.prototype.readUint8=Xe.prototype.Gc,Xe.prototype.Ec=function(){var ee=this.b[this.a],ve=this.b[this.a+1];return this.a+=2,se(this.a<=this.c),ee<<0|ve<<8},Xe.prototype.readUint16=Xe.prototype.Ec,Xe.prototype.m=function(){var ee=this.b[this.a],ve=this.b[this.a+1],ze=this.b[this.a+2],yt=this.b[this.a+3];return this.a+=4,se(this.a<=this.c),(ee<<0|ve<<8|ze<<16|yt<<24)>>>0},Xe.prototype.readUint32=Xe.prototype.m,Xe.prototype.ga=function(){var ee=this.m(),ve=this.m();return Le(ee,ve)},Xe.prototype.readUint64=Xe.prototype.ga,Xe.prototype.ha=function(){var ee=this.m(),ve=this.m();return lt(ee,ve)},Xe.prototype.readUint64String=Xe.prototype.ha,Xe.prototype.Xb=function(){var ee=this.b[this.a];return this.a+=1,se(this.a<=this.c),ee<<24>>24},Xe.prototype.readInt8=Xe.prototype.Xb,Xe.prototype.Vb=function(){var ee=this.b[this.a],ve=this.b[this.a+1];return this.a+=2,se(this.a<=this.c),(ee<<0|ve<<8)<<16>>16},Xe.prototype.readInt16=Xe.prototype.Vb,Xe.prototype.P=function(){var ee=this.b[this.a],ve=this.b[this.a+1],ze=this.b[this.a+2],yt=this.b[this.a+3];return this.a+=4,se(this.a<=this.c),ee<<0|ve<<8|ze<<16|yt<<24},Xe.prototype.readInt32=Xe.prototype.P,Xe.prototype.ba=function(){var ee=this.m(),ve=this.m();return Ge(ee,ve)},Xe.prototype.readInt64=Xe.prototype.ba,Xe.prototype.ca=function(){var ee=this.m(),ve=this.m();return dt(ee,ve)},Xe.prototype.readInt64String=Xe.prototype.ca,Xe.prototype.aa=function(){var ee=this.m();return _t(ee,0)},Xe.prototype.readFloat=Xe.prototype.aa,Xe.prototype.Z=function(){var ee=this.m(),ve=this.m();return Ft(ee,ve)},Xe.prototype.readDouble=Xe.prototype.Z,Xe.prototype.pa=function(){return!!this.b[this.a++]},Xe.prototype.readBool=Xe.prototype.pa,Xe.prototype.ra=function(){return this.da()},Xe.prototype.readEnum=Xe.prototype.ra,Xe.prototype.fa=function(ee){var ve=this.b,ze=this.a;ee=ze+ee;for(var yt=[],vt="";ze<ee;){var ar=ve[ze++];if(128>ar)yt.push(ar);else{if(192>ar)continue;if(224>ar){var wr=ve[ze++];yt.push((ar&31)<<6|wr&63)}else if(240>ar){wr=ve[ze++];var zt=ve[ze++];yt.push((ar&15)<<12|(wr&63)<<6|zt&63)}else if(248>ar){wr=ve[ze++],zt=ve[ze++];var Kr=ve[ze++];ar=(ar&7)<<18|(wr&63)<<12|(zt&63)<<6|Kr&63,ar-=65536,yt.push((ar>>10&1023)+55296,(ar&1023)+56320)}}8192<=yt.length&&(vt+=String.fromCharCode.apply(null,yt),yt.length=0)}return vt+=Y(yt),this.a=ze,vt},Xe.prototype.readString=Xe.prototype.fa,Xe.prototype.Dc=function(){var ee=this.o();return this.fa(ee)},Xe.prototype.readStringWithLength=Xe.prototype.Dc,Xe.prototype.qa=function(ee){if(0>ee||this.a+ee>this.b.length)return this.v=!0,he("Invalid byte length!"),new Uint8Array(0);var ve=this.b.subarray(this.a,this.a+ee);return this.a+=ee,se(this.a<=this.c),ve},Xe.prototype.readBytes=Xe.prototype.qa,Xe.prototype.ia=function(){return this.w(gt)},Xe.prototype.readVarintHash64=Xe.prototype.ia,Xe.prototype.$=function(){var ee=this.b,ve=this.a,ze=ee[ve],yt=ee[ve+1],vt=ee[ve+2],ar=ee[ve+3],wr=ee[ve+4],zt=ee[ve+5],Kr=ee[ve+6];return ee=ee[ve+7],this.a+=8,String.fromCharCode(ze,yt,vt,ar,wr,zt,Kr,ee)},Xe.prototype.readFixedHash64=Xe.prototype.$;function ft(ee,ve,ze){this.a=It(ee,ve,ze),this.O=this.a.B(),this.b=this.c=-1,this.h=!1,this.v=null}S("jspb.BinaryReader",ft,void 0);var Jt=[];ft.clearInstanceCache=function(){Jt=[]},ft.getInstanceCacheLength=function(){return Jt.length};function Ot(ee,ve,ze){if(Jt.length){var yt=Jt.pop();return ee&&yt.a.H(ee,ve,ze),yt}return new ft(ee,ve,ze)}ft.alloc=Ot,ft.prototype.zb=Ot,ft.prototype.alloc=ft.prototype.zb,ft.prototype.Ca=function(){this.a.clear(),this.b=this.c=-1,this.h=!1,this.v=null,100>Jt.length&&Jt.push(this)},ft.prototype.free=ft.prototype.Ca,ft.prototype.Fb=function(){return this.O},ft.prototype.getFieldCursor=ft.prototype.Fb,ft.prototype.B=function(){return this.a.B()},ft.prototype.getCursor=ft.prototype.B,ft.prototype.Y=function(){return this.a.Y()},ft.prototype.getBuffer=ft.prototype.Y,ft.prototype.Hb=function(){return this.c},ft.prototype.getFieldNumber=ft.prototype.Hb,ft.prototype.Lb=function(){return this.b},ft.prototype.getWireType=ft.prototype.Lb,ft.prototype.Mb=function(){return this.b==2},ft.prototype.isDelimited=ft.prototype.Mb,ft.prototype.bb=function(){return this.b==4},ft.prototype.isEndGroup=ft.prototype.bb,ft.prototype.getError=function(){return this.h||this.a.getError()},ft.prototype.getError=ft.prototype.getError,ft.prototype.H=function(ee,ve,ze){this.a.H(ee,ve,ze),this.b=this.c=-1},ft.prototype.setBlock=ft.prototype.H,ft.prototype.reset=function(){this.a.reset(),this.b=this.c=-1},ft.prototype.reset=ft.prototype.reset,ft.prototype.advance=function(ee){this.a.advance(ee)},ft.prototype.advance=ft.prototype.advance,ft.prototype.oa=function(){if(this.a.ya())return!1;if(this.getError())return he("Decoder hit an error"),!1;this.O=this.a.B();var ee=this.a.o(),ve=ee>>>3;return ee&=7,ee!=0&&ee!=5&&ee!=1&&ee!=2&&ee!=3&&ee!=4?(he("Invalid wire type: %s (at position %s)",ee,this.O),this.h=!0,!1):(this.c=ve,this.b=ee,!0)},ft.prototype.nextField=ft.prototype.oa,ft.prototype.Oa=function(){this.a.mb(this.c<<3|this.b)},ft.prototype.unskipHeader=ft.prototype.Oa,ft.prototype.Lc=function(){var ee=this.c;for(this.Oa();this.oa()&&this.c==ee;)this.C();this.a.ya()||this.Oa()},ft.prototype.skipMatchingFields=ft.prototype.Lc,ft.prototype.lb=function(){this.b!=0?(he("Invalid wire type for skipVarintField"),this.C()):this.a.kb()},ft.prototype.skipVarintField=ft.prototype.lb,ft.prototype.gb=function(){if(this.b!=2)he("Invalid wire type for skipDelimitedField"),this.C();else{var ee=this.a.o();this.a.advance(ee)}},ft.prototype.skipDelimitedField=ft.prototype.gb,ft.prototype.hb=function(){this.b!=5?(he("Invalid wire type for skipFixed32Field"),this.C()):this.a.advance(4)},ft.prototype.skipFixed32Field=ft.prototype.hb,ft.prototype.ib=function(){this.b!=1?(he("Invalid wire type for skipFixed64Field"),this.C()):this.a.advance(8)},ft.prototype.skipFixed64Field=ft.prototype.ib,ft.prototype.jb=function(){var ee=this.c;do{if(!this.oa()){he("Unmatched start-group tag: stream EOF"),this.h=!0;break}if(this.b==4){this.c!=ee&&(he("Unmatched end-group tag"),this.h=!0);break}this.C()}while(!0)},ft.prototype.skipGroup=ft.prototype.jb,ft.prototype.C=function(){switch(this.b){case 0:this.lb();break;case 1:this.ib();break;case 2:this.gb();break;case 5:this.hb();break;case 3:this.jb();break;default:he("Invalid wire encoding for field.")}},ft.prototype.skipField=ft.prototype.C,ft.prototype.Hc=function(ee,ve){this.v===null&&(this.v={}),se(!this.v[ee]),this.v[ee]=ve},ft.prototype.registerReadCallback=ft.prototype.Hc,ft.prototype.Ic=function(ee){return se(this.v!==null),ee=this.v[ee],se(ee),ee(this)},ft.prototype.runReadCallback=ft.prototype.Ic,ft.prototype.Yb=function(ee,ve){se(this.b==2);var ze=this.a.c,yt=this.a.o();yt=this.a.B()+yt,this.a.setEnd(yt),ve(ee,this),this.a.Ma(yt),this.a.setEnd(ze)},ft.prototype.readMessage=ft.prototype.Yb,ft.prototype.Ub=function(ee,ve,ze){se(this.b==3),se(this.c==ee),ze(ve,this),this.h||this.b==4||(he("Group submessage did not end with an END_GROUP tag"),this.h=!0)},ft.prototype.readGroup=ft.prototype.Ub,ft.prototype.Gb=function(){se(this.b==2);var ee=this.a.o(),ve=this.a.B(),ze=ve+ee;return ee=It(this.a.Y(),ve,ee),this.a.Ma(ze),ee},ft.prototype.getFieldDecoder=ft.prototype.Gb,ft.prototype.P=function(){return se(this.b==0),this.a.da()},ft.prototype.readInt32=ft.prototype.P,ft.prototype.Wb=function(){return se(this.b==0),this.a.Ea()},ft.prototype.readInt32String=ft.prototype.Wb,ft.prototype.ba=function(){return se(this.b==0),this.a.sa()},ft.prototype.readInt64=ft.prototype.ba,ft.prototype.ca=function(){return se(this.b==0),this.a.Fa()},ft.prototype.readInt64String=ft.prototype.ca,ft.prototype.m=function(){return se(this.b==0),this.a.o()},ft.prototype.readUint32=ft.prototype.m,ft.prototype.Fc=function(){return se(this.b==0),this.a.O()},ft.prototype.readUint32String=ft.prototype.Fc,ft.prototype.ga=function(){return se(this.b==0),this.a.Ga()},ft.prototype.readUint64=ft.prototype.ga,ft.prototype.ha=function(){return se(this.b==0),this.a.Ha()},ft.prototype.readUint64String=ft.prototype.ha,ft.prototype.zc=function(){return se(this.b==0),this.a.Ia()},ft.prototype.readSint32=ft.prototype.zc,ft.prototype.Ac=function(){return se(this.b==0),this.a.Ja()},ft.prototype.readSint64=ft.prototype.Ac,ft.prototype.Bc=function(){return se(this.b==0),this.a.Ka()},ft.prototype.readSint64String=ft.prototype.Bc,ft.prototype.Rb=function(){return se(this.b==5),this.a.m()},ft.prototype.readFixed32=ft.prototype.Rb,ft.prototype.Sb=function(){return se(this.b==1),this.a.ga()},ft.prototype.readFixed64=ft.prototype.Sb,ft.prototype.Tb=function(){return se(this.b==1),this.a.ha()},ft.prototype.readFixed64String=ft.prototype.Tb,ft.prototype.vc=function(){return se(this.b==5),this.a.P()},ft.prototype.readSfixed32=ft.prototype.vc,ft.prototype.wc=function(){return se(this.b==5),this.a.P().toString()},ft.prototype.readSfixed32String=ft.prototype.wc,ft.prototype.xc=function(){return se(this.b==1),this.a.ba()},ft.prototype.readSfixed64=ft.prototype.xc,ft.prototype.yc=function(){return se(this.b==1),this.a.ca()},ft.prototype.readSfixed64String=ft.prototype.yc,ft.prototype.aa=function(){return se(this.b==5),this.a.aa()},ft.prototype.readFloat=ft.prototype.aa,ft.prototype.Z=function(){return se(this.b==1),this.a.Z()},ft.prototype.readDouble=ft.prototype.Z,ft.prototype.pa=function(){return se(this.b==0),!!this.a.o()},ft.prototype.readBool=ft.prototype.pa,ft.prototype.ra=function(){return se(this.b==0),this.a.sa()},ft.prototype.readEnum=ft.prototype.ra,ft.prototype.fa=function(){se(this.b==2);var ee=this.a.o();return this.a.fa(ee)},ft.prototype.readString=ft.prototype.fa,ft.prototype.qa=function(){se(this.b==2);var ee=this.a.o();return this.a.qa(ee)},ft.prototype.readBytes=ft.prototype.qa,ft.prototype.ia=function(){return se(this.b==0),this.a.ia()},ft.prototype.readVarintHash64=ft.prototype.ia,ft.prototype.Cc=function(){return se(this.b==0),this.a.fb()},ft.prototype.readSintHash64=ft.prototype.Cc,ft.prototype.w=function(ee){return se(this.b==0),this.a.w(ee)},ft.prototype.readSplitVarint64=ft.prototype.w,ft.prototype.ea=function(ee){return se(this.b==0),this.a.w(function(ve,ze){return Ze(ve,ze,ee)})},ft.prototype.readSplitZigzagVarint64=ft.prototype.ea,ft.prototype.$=function(){return se(this.b==1),this.a.$()},ft.prototype.readFixedHash64=ft.prototype.$,ft.prototype.ta=function(ee){return se(this.b==1),this.a.ta(ee)},ft.prototype.readSplitFixed64=ft.prototype.ta;function Ct(ee,ve){se(ee.b==2);var ze=ee.a.o();ze=ee.a.B()+ze;for(var yt=[];ee.a.B()<ze;)yt.push(ve.call(ee.a));return yt}ft.prototype.gc=function(){return Ct(this,this.a.da)},ft.prototype.readPackedInt32=ft.prototype.gc,ft.prototype.hc=function(){return Ct(this,this.a.Ea)},ft.prototype.readPackedInt32String=ft.prototype.hc,ft.prototype.ic=function(){return Ct(this,this.a.sa)},ft.prototype.readPackedInt64=ft.prototype.ic,ft.prototype.jc=function(){return Ct(this,this.a.Fa)},ft.prototype.readPackedInt64String=ft.prototype.jc,ft.prototype.qc=function(){return Ct(this,this.a.o)},ft.prototype.readPackedUint32=ft.prototype.qc,ft.prototype.rc=function(){return Ct(this,this.a.O)},ft.prototype.readPackedUint32String=ft.prototype.rc,ft.prototype.sc=function(){return Ct(this,this.a.Ga)},ft.prototype.readPackedUint64=ft.prototype.sc,ft.prototype.tc=function(){return Ct(this,this.a.Ha)},ft.prototype.readPackedUint64String=ft.prototype.tc,ft.prototype.nc=function(){return Ct(this,this.a.Ia)},ft.prototype.readPackedSint32=ft.prototype.nc,ft.prototype.oc=function(){return Ct(this,this.a.Ja)},ft.prototype.readPackedSint64=ft.prototype.oc,ft.prototype.pc=function(){return Ct(this,this.a.Ka)},ft.prototype.readPackedSint64String=ft.prototype.pc,ft.prototype.bc=function(){return Ct(this,this.a.m)},ft.prototype.readPackedFixed32=ft.prototype.bc,ft.prototype.cc=function(){return Ct(this,this.a.ga)},ft.prototype.readPackedFixed64=ft.prototype.cc,ft.prototype.dc=function(){return Ct(this,this.a.ha)},ft.prototype.readPackedFixed64String=ft.prototype.dc,ft.prototype.kc=function(){return Ct(this,this.a.P)},ft.prototype.readPackedSfixed32=ft.prototype.kc,ft.prototype.lc=function(){return Ct(this,this.a.ba)},ft.prototype.readPackedSfixed64=ft.prototype.lc,ft.prototype.mc=function(){return Ct(this,this.a.ca)},ft.prototype.readPackedSfixed64String=ft.prototype.mc,ft.prototype.fc=function(){return Ct(this,this.a.aa)},ft.prototype.readPackedFloat=ft.prototype.fc,ft.prototype.$b=function(){return Ct(this,this.a.Z)},ft.prototype.readPackedDouble=ft.prototype.$b,ft.prototype.Zb=function(){return Ct(this,this.a.pa)},ft.prototype.readPackedBool=ft.prototype.Zb,ft.prototype.ac=function(){return Ct(this,this.a.ra)},ft.prototype.readPackedEnum=ft.prototype.ac,ft.prototype.uc=function(){return Ct(this,this.a.ia)},ft.prototype.readPackedVarintHash64=ft.prototype.uc,ft.prototype.ec=function(){return Ct(this,this.a.$)},ft.prototype.readPackedFixedHash64=ft.prototype.ec;function qe(ee,ve,ze,yt,vt){this.ma=ee,this.Ba=ve,this.la=ze,this.Na=yt,this.na=vt}S("jspb.ExtensionFieldInfo",qe,void 0);function Yt(ee,ve,ze,yt,vt,ar){this.Za=ee,this.za=ve,this.Aa=ze,this.Wa=yt,this.Ab=vt,this.Nb=ar}S("jspb.ExtensionFieldBinaryInfo",Yt,void 0),qe.prototype.F=function(){return!!this.la},qe.prototype.isMessageType=qe.prototype.F;function ot(){}S("jspb.Message",ot,void 0),ot.GENERATE_TO_OBJECT=!0,ot.GENERATE_FROM_OBJECT=!0;var Ae=typeof Uint8Array=="function";ot.prototype.Ib=function(){return this.b},ot.prototype.getJsPbMessageId=ot.prototype.Ib,ot.initialize=function(ee,ve,ze,yt,vt,ar){ee.f=null,ve||(ve=ze?[ze]:[]),ee.b=ze?String(ze):void 0,ee.D=ze===0?-1:0,ee.u=ve;e:{if(ze=ee.u.length,ve=-1,ze&&(ve=ze-1,ze=ee.u[ve],!(ze===null||typeof ze!="object"||Array.isArray(ze)||Ae&&ze instanceof Uint8Array))){ee.G=ve-ee.D,ee.i=ze;break e}-1<yt?(ee.G=Math.max(yt,ve+1-ee.D),ee.i=null):ee.G=Number.MAX_VALUE}if(ee.a={},vt)for(yt=0;yt<vt.length;yt++)ve=vt[yt],ve<ee.G?(ve+=ee.D,ee.u[ve]=ee.u[ve]||Rt):(Ht(ee),ee.i[ve]=ee.i[ve]||Rt);if(ar&&ar.length)for(yt=0;yt<ar.length;yt++)At(ee,ar[yt])};var Rt=Object.freeze?Object.freeze([]):[];function Ht(ee){var ve=ee.G+ee.D;ee.u[ve]||(ee.i=ee.u[ve]={})}function bt(ee,ve,ze){for(var yt=[],vt=0;vt<ee.length;vt++)yt[vt]=ve.call(ee[vt],ze,ee[vt]);return yt}ot.toObjectList=bt,ot.toObjectExtension=function(ee,ve,ze,yt,vt){for(var ar in ze){var wr=ze[ar],zt=yt.call(ee,wr);if(zt!=null){for(var Kr in wr.Ba)if(wr.Ba.hasOwnProperty(Kr))break;ve[Kr]=wr.Na?wr.na?bt(zt,wr.Na,vt):wr.Na(vt,zt):zt}}},ot.serializeBinaryExtensions=function(ee,ve,ze,yt){for(var vt in ze){var ar=ze[vt],wr=ar.Za;if(!ar.Aa)throw Error("Message extension present that was generated without binary serialization support");var zt=yt.call(ee,wr);if(zt!=null)if(wr.F())if(ar.Wa)ar.Aa.call(ve,wr.ma,zt,ar.Wa);else throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");else ar.Aa.call(ve,wr.ma,zt)}},ot.readBinaryExtension=function(ee,ve,ze,yt,vt){var ar=ze[ve.c];if(ar){if(ze=ar.Za,!ar.za)throw Error("Deserializing extension whose generated code does not support binary format");if(ze.F()){var wr=new ze.la;ar.za.call(ve,wr,ar.Ab)}else wr=ar.za.call(ve);ze.na&&!ar.Nb?(ve=yt.call(ee,ze))?ve.push(wr):vt.call(ee,ze,[wr]):vt.call(ee,ze,wr)}else ve.C()};function Mt(ee,ve){if(ve<ee.G){ve+=ee.D;var ze=ee.u[ve];return ze===Rt?ee.u[ve]=[]:ze}if(ee.i)return ze=ee.i[ve],ze===Rt?ee.i[ve]=[]:ze}ot.getField=Mt,ot.getRepeatedField=function(ee,ve){return Mt(ee,ve)};function tr(ee,ve){return ee=Mt(ee,ve),ee==null?ee:+ee}ot.getOptionalFloatingPointField=tr;function Vt(ee,ve){return ee=Mt(ee,ve),ee==null?ee:!!ee}ot.getBooleanField=Vt,ot.getRepeatedFloatingPointField=function(ee,ve){var ze=Mt(ee,ve);if(ee.a||(ee.a={}),!ee.a[ve]){for(var yt=0;yt<ze.length;yt++)ze[yt]=+ze[yt];ee.a[ve]=!0}return ze},ot.getRepeatedBooleanField=function(ee,ve){var ze=Mt(ee,ve);if(ee.a||(ee.a={}),!ee.a[ve]){for(var yt=0;yt<ze.length;yt++)ze[yt]=!!ze[yt];ee.a[ve]=!0}return ze};function Et(ee){return ee==null||typeof ee=="string"?ee:Ae&&ee instanceof Uint8Array?H(ee):(he("Cannot coerce to b64 string: "+O(ee)),null)}ot.bytesAsB64=Et;function Ye(ee){return ee==null||ee instanceof Uint8Array?ee:typeof ee=="string"?Q(ee):(he("Cannot coerce to Uint8Array: "+O(ee)),null)}ot.bytesAsU8=Ye,ot.bytesListAsB64=function(ee){return Tt(ee),ee.length&&typeof ee[0]!="string"?ue(ee,Et):ee},ot.bytesListAsU8=function(ee){return Tt(ee),!ee.length||ee[0]instanceof Uint8Array?ee:ue(ee,Ye)};function Tt(ee){if(ee&&1<ee.length){var ve=O(ee[0]);G(ee,function(ze){O(ze)!=ve&&he("Inconsistent type in JSPB repeated field array. Got "+O(ze)+" expected "+ve)})}}function Wt(ee,ve,ze){return ee=Mt(ee,ve),ee??ze}ot.getFieldWithDefault=Wt,ot.getBooleanFieldWithDefault=function(ee,ve,ze){return ee=Vt(ee,ve),ee??ze},ot.getFloatingPointFieldWithDefault=function(ee,ve,ze){return ee=tr(ee,ve),ee??ze},ot.getFieldProto3=Wt,ot.getMapField=function(ee,ve,ze,yt){if(ee.f||(ee.f={}),ve in ee.f)return ee.f[ve];var vt=Mt(ee,ve);if(!vt){if(ze)return;vt=[],dr(ee,ve,vt)}return ee.f[ve]=new L(vt,yt)};function dr(ee,ve,ze){return K(ee,ot),ve<ee.G?ee.u[ve+ee.D]=ze:(Ht(ee),ee.i[ve]=ze),ee}ot.setField=dr,ot.setProto3IntField=function(ee,ve,ze){return at(ee,ve,ze,0)},ot.setProto3FloatField=function(ee,ve,ze){return at(ee,ve,ze,0)},ot.setProto3BooleanField=function(ee,ve,ze){return at(ee,ve,ze,!1)},ot.setProto3StringField=function(ee,ve,ze){return at(ee,ve,ze,"")},ot.setProto3BytesField=function(ee,ve,ze){return at(ee,ve,ze,"")},ot.setProto3EnumField=function(ee,ve,ze){return at(ee,ve,ze,0)},ot.setProto3StringIntField=function(ee,ve,ze){return at(ee,ve,ze,"0")};function at(ee,ve,ze,yt){return K(ee,ot),ze!==yt?dr(ee,ve,ze):ve<ee.G?ee.u[ve+ee.D]=null:(Ht(ee),delete ee.i[ve]),ee}ot.addToRepeatedField=function(ee,ve,ze,yt){return K(ee,ot),ve=Mt(ee,ve),yt!=null?ve.splice(yt,0,ze):ve.push(ze),ee};function wt(ee,ve,ze,yt){return K(ee,ot),(ze=At(ee,ze))&&ze!==ve&&yt!==void 0&&(ee.f&&ze in ee.f&&(ee.f[ze]=void 0),dr(ee,ze,void 0)),dr(ee,ve,yt)}ot.setOneofField=wt;function At(ee,ve){for(var ze,yt,vt=0;vt<ve.length;vt++){var ar=ve[vt],wr=Mt(ee,ar);wr!=null&&(ze=ar,yt=wr,dr(ee,ar,void 0))}return ze?(dr(ee,ze,yt),ze):0}ot.computeOneofCase=At,ot.getWrapperField=function(ee,ve,ze,yt){if(ee.f||(ee.f={}),!ee.f[ze]){var vt=Mt(ee,ze);(yt||vt)&&(ee.f[ze]=new ve(vt))}return ee.f[ze]},ot.getRepeatedWrapperField=function(ee,ve,ze){return Je(ee,ve,ze),ve=ee.f[ze],ve==Rt&&(ve=ee.f[ze]=[]),ve};function Je(ee,ve,ze){if(ee.f||(ee.f={}),!ee.f[ze]){for(var yt=Mt(ee,ze),vt=[],ar=0;ar<yt.length;ar++)vt[ar]=new ve(yt[ar]);ee.f[ze]=vt}}ot.setWrapperField=function(ee,ve,ze){K(ee,ot),ee.f||(ee.f={});var yt=ze&&ze.g();return ee.f[ve]=ze,dr(ee,ve,yt)},ot.setOneofWrapperField=function(ee,ve,ze,yt){K(ee,ot),ee.f||(ee.f={});var vt=yt&&yt.g();return ee.f[ve]=yt,wt(ee,ve,ze,vt)},ot.setRepeatedWrapperField=function(ee,ve,ze){K(ee,ot),ee.f||(ee.f={}),ze=ze||[];for(var yt=[],vt=0;vt<ze.length;vt++)yt[vt]=ze[vt].g();return ee.f[ve]=ze,dr(ee,ve,yt)},ot.addToRepeatedWrapperField=function(ee,ve,ze,yt,vt){Je(ee,yt,ve);var ar=ee.f[ve];return ar||(ar=ee.f[ve]=[]),ze=ze||new yt,ee=Mt(ee,ve),vt!=null?(ar.splice(vt,0,ze),ee.splice(vt,0,ze.g())):(ar.push(ze),ee.push(ze.g())),ze},ot.toMap=function(ee,ve,ze,yt){for(var vt={},ar=0;ar<ee.length;ar++)vt[ve.call(ee[ar])]=ze?ze.call(ee[ar],yt,ee[ar]):ee[ar];return vt};function Lt(ee){if(ee.f)for(var ve in ee.f){var ze=ee.f[ve];if(Array.isArray(ze))for(var yt=0;yt<ze.length;yt++)ze[yt]&&ze[yt].g();else ze&&ze.g()}}ot.prototype.g=function(){return Lt(this),this.u},ot.prototype.toArray=ot.prototype.g,ot.prototype.toString=function(){return Lt(this),this.u.toString()},ot.prototype.getExtension=function(ee){if(this.i){this.f||(this.f={});var ve=ee.ma;if(ee.na){if(ee.F())return this.f[ve]||(this.f[ve]=ue(this.i[ve]||[],function(ze){return new ee.la(ze)})),this.f[ve]}else if(ee.F())return!this.f[ve]&&this.i[ve]&&(this.f[ve]=new ee.la(this.i[ve])),this.f[ve];return this.i[ve]}},ot.prototype.getExtension=ot.prototype.getExtension,ot.prototype.Kc=function(ee,ve){this.f||(this.f={}),Ht(this);var ze=ee.ma;return ee.na?(ve=ve||[],ee.F()?(this.f[ze]=ve,this.i[ze]=ue(ve,function(yt){return yt.g()})):this.i[ze]=ve):ee.F()?(this.f[ze]=ve,this.i[ze]=ve&&ve.g()):this.i[ze]=ve,this},ot.prototype.setExtension=ot.prototype.Kc,ot.difference=function(ee,ve){if(!(ee instanceof ve.constructor))throw Error("Messages have different types.");var ze=ee.g();ve=ve.g();var yt=[],vt=0,ar=ze.length>ve.length?ze.length:ve.length;for(ee.b&&(yt[0]=ee.b,vt=1);vt<ar;vt++)ur(ze[vt],ve[vt])||(yt[vt]=ve[vt]);return new ee.constructor(yt)},ot.equals=function(ee,ve){return ee==ve||!(!ee||!ve)&&ee instanceof ve.constructor&&ur(ee.g(),ve.g())};function sr(ee,ve){ee=ee||{},ve=ve||{};var ze={},yt;for(yt in ee)ze[yt]=0;for(yt in ve)ze[yt]=0;for(yt in ze)if(!ur(ee[yt],ve[yt]))return!1;return!0}ot.compareExtensions=sr;function ur(ee,ve){if(ee==ve)return!0;if(!M(ee)||!M(ve))return typeof ee=="number"&&isNaN(ee)||typeof ve=="number"&&isNaN(ve)?String(ee)==String(ve):!1;if(ee.constructor!=ve.constructor)return!1;if(Ae&&ee.constructor===Uint8Array){if(ee.length!=ve.length)return!1;for(var ze=0;ze<ee.length;ze++)if(ee[ze]!=ve[ze])return!1;return!0}if(ee.constructor===Array){var yt=void 0,vt=void 0,ar=Math.max(ee.length,ve.length);for(ze=0;ze<ar;ze++){var wr=ee[ze],zt=ve[ze];if(wr&&wr.constructor==Object&&(se(yt===void 0),se(ze===ee.length-1),yt=wr,wr=void 0),zt&&zt.constructor==Object&&(se(vt===void 0),se(ze===ve.length-1),vt=zt,zt=void 0),!ur(wr,zt))return!1}return yt||vt?(yt=yt||{},vt=vt||{},sr(yt,vt)):!0}if(ee.constructor===Object)return sr(ee,ve);throw Error("Invalid type in JSPB array")}ot.compareFields=ur,ot.prototype.Bb=function(){return vr(this)},ot.prototype.cloneMessage=ot.prototype.Bb,ot.prototype.clone=function(){return vr(this)},ot.prototype.clone=ot.prototype.clone,ot.clone=function(ee){return vr(ee)};function vr(ee){return new ee.constructor(kr(ee.g()))}ot.copyInto=function(ee,ve){K(ee,ot),K(ve,ot),se(ee.constructor==ve.constructor,"Copy source and target message should have the same type."),ee=vr(ee);for(var ze=ve.g(),yt=ee.g(),vt=ze.length=0;vt<yt.length;vt++)ze[vt]=yt[vt];ve.f=ee.f,ve.i=ee.i};function kr(ee){if(Array.isArray(ee)){for(var ve=Array(ee.length),ze=0;ze<ee.length;ze++){var yt=ee[ze];yt!=null&&(ve[ze]=typeof yt=="object"?kr(se(yt)):yt)}return ve}if(Ae&&ee instanceof Uint8Array)return new Uint8Array(ee);ve={};for(ze in ee)yt=ee[ze],yt!=null&&(ve[ze]=typeof yt=="object"?kr(se(yt)):yt);return ve}ot.registerMessageType=function(ee,ve){ve.we=ee};var Jr={dump:function(ee){return K(ee,ot,"jspb.Message instance expected"),se(ee.getExtension,"Only unobfuscated and unoptimized compilation modes supported."),Jr.X(ee)}};S("jspb.debug.dump",Jr.dump,void 0),Jr.X=function(ee){var ve=O(ee);if(ve=="number"||ve=="string"||ve=="boolean"||ve=="null"||ve=="undefined"||typeof Uint8Array<"u"&&ee instanceof Uint8Array)return ee;if(ve=="array")return ye(ee),ue(ee,Jr.X);if(ee instanceof L){var ze={};ee=ee.entries();for(var yt=ee.next();!yt.done;yt=ee.next())ze[yt.value[0]]=Jr.X(yt.value[1]);return ze}K(ee,ot,"Only messages expected: "+ee),ve=ee.constructor;var vt={$name:ve.name||ve.displayName};for(zt in ve.prototype){var ar=/^get([A-Z]\w*)/.exec(zt);if(ar&&zt!="getExtension"&&zt!="getJsPbMessageId"){var wr="has"+ar[1];(!ee[wr]||ee[wr]())&&(wr=ee[zt](),vt[Jr.$a(ar[1])]=Jr.X(wr))}}if(ee.extensionObject_)return vt.$extensions="Recursive dumping of extensions not supported in compiled code. Switch to uncompiled or dump extension object directly",vt;for(yt in ve.extensions)if(/^\d+$/.test(yt)){wr=ve.extensions[yt];var zt=ee.getExtension(wr);ar=void 0,wr=wr.Ba;var Kr=[],Xt=0;for(ar in wr)Kr[Xt++]=ar;ar=Kr[0],zt!=null&&(ze||(ze=vt.$extensions={}),ze[Jr.$a(ar)]=Jr.X(zt))}return vt},Jr.$a=function(ee){return ee.replace(/^[A-Z]/,function(ve){return ve.toLowerCase()})};function hr(){this.a=[]}S("jspb.BinaryEncoder",hr,void 0),hr.prototype.length=function(){return this.a.length},hr.prototype.length=hr.prototype.length,hr.prototype.end=function(){var ee=this.a;return this.a=[],ee},hr.prototype.end=hr.prototype.end,hr.prototype.l=function(ee,ve){for(se(ee==Math.floor(ee)),se(ve==Math.floor(ve)),se(0<=ee&&4294967296>ee),se(0<=ve&&4294967296>ve);0<ve||127<ee;)this.a.push(ee&127|128),ee=(ee>>>7|ve<<25)>>>0,ve>>>=7;this.a.push(ee)},hr.prototype.writeSplitVarint64=hr.prototype.l,hr.prototype.A=function(ee,ve){se(ee==Math.floor(ee)),se(ve==Math.floor(ve)),se(0<=ee&&4294967296>ee),se(0<=ve&&4294967296>ve),this.s(ee),this.s(ve)},hr.prototype.writeSplitFixed64=hr.prototype.A,hr.prototype.j=function(ee){for(se(ee==Math.floor(ee)),se(0<=ee&&4294967296>ee);127<ee;)this.a.push(ee&127|128),ee>>>=7;this.a.push(ee)},hr.prototype.writeUnsignedVarint32=hr.prototype.j,hr.prototype.M=function(ee){if(se(ee==Math.floor(ee)),se(-2147483648<=ee&&2147483648>ee),0<=ee)this.j(ee);else{for(var ve=0;9>ve;ve++)this.a.push(ee&127|128),ee>>=7;this.a.push(1)}},hr.prototype.writeSignedVarint32=hr.prototype.M,hr.prototype.va=function(ee){se(ee==Math.floor(ee)),se(0<=ee&&18446744073709552e3>ee),Ee(ee),this.l(ge,be)},hr.prototype.writeUnsignedVarint64=hr.prototype.va,hr.prototype.ua=function(ee){se(ee==Math.floor(ee)),se(-9223372036854776e3<=ee&&9223372036854776e3>ee),Ee(ee),this.l(ge,be)},hr.prototype.writeSignedVarint64=hr.prototype.ua,hr.prototype.wa=function(ee){se(ee==Math.floor(ee)),se(-2147483648<=ee&&2147483648>ee),this.j((ee<<1^ee>>31)>>>0)},hr.prototype.writeZigzagVarint32=hr.prototype.wa,hr.prototype.xa=function(ee){se(ee==Math.floor(ee)),se(-9223372036854776e3<=ee&&9223372036854776e3>ee),me(ee),this.l(ge,be)},hr.prototype.writeZigzagVarint64=hr.prototype.xa,hr.prototype.Ta=function(ee){this.W(rt(ee))},hr.prototype.writeZigzagVarint64String=hr.prototype.Ta,hr.prototype.W=function(ee){var ve=this;Ie(ee),Be(ge,be,function(ze,yt){ve.l(ze>>>0,yt>>>0)})},hr.prototype.writeZigzagVarintHash64=hr.prototype.W,hr.prototype.be=function(ee){se(ee==Math.floor(ee)),se(0<=ee&&256>ee),this.a.push(ee>>>0&255)},hr.prototype.writeUint8=hr.prototype.be,hr.prototype.ae=function(ee){se(ee==Math.floor(ee)),se(0<=ee&&65536>ee),this.a.push(ee>>>0&255),this.a.push(ee>>>8&255)},hr.prototype.writeUint16=hr.prototype.ae,hr.prototype.s=function(ee){se(ee==Math.floor(ee)),se(0<=ee&&4294967296>ee),this.a.push(ee>>>0&255),this.a.push(ee>>>8&255),this.a.push(ee>>>16&255),this.a.push(ee>>>24&255)},hr.prototype.writeUint32=hr.prototype.s,hr.prototype.V=function(ee){se(ee==Math.floor(ee)),se(0<=ee&&18446744073709552e3>ee),we(ee),this.s(ge),this.s(be)},hr.prototype.writeUint64=hr.prototype.V,hr.prototype.Qc=function(ee){se(ee==Math.floor(ee)),se(-128<=ee&&128>ee),this.a.push(ee>>>0&255)},hr.prototype.writeInt8=hr.prototype.Qc,hr.prototype.Pc=function(ee){se(ee==Math.floor(ee)),se(-32768<=ee&&32768>ee),this.a.push(ee>>>0&255),this.a.push(ee>>>8&255)},hr.prototype.writeInt16=hr.prototype.Pc,hr.prototype.S=function(ee){se(ee==Math.floor(ee)),se(-2147483648<=ee&&2147483648>ee),this.a.push(ee>>>0&255),this.a.push(ee>>>8&255),this.a.push(ee>>>16&255),this.a.push(ee>>>24&255)},hr.prototype.writeInt32=hr.prototype.S,hr.prototype.T=function(ee){se(ee==Math.floor(ee)),se(-9223372036854776e3<=ee&&9223372036854776e3>ee),Ee(ee),this.A(ge,be)},hr.prototype.writeInt64=hr.prototype.T,hr.prototype.ka=function(ee){se(ee==Math.floor(ee)),se(-9223372036854776e3<=+ee&&9223372036854776e3>+ee),Ie(rt(ee)),this.A(ge,be)},hr.prototype.writeInt64String=hr.prototype.ka,hr.prototype.L=function(ee){se(ee===1/0||ee===-1/0||isNaN(ee)||-34028234663852886e22<=ee&&34028234663852886e22>=ee),Ke(ee),this.s(ge)},hr.prototype.writeFloat=hr.prototype.L,hr.prototype.J=function(ee){se(ee===1/0||ee===-1/0||isNaN(ee)||-17976931348623157e292<=ee&&17976931348623157e292>=ee),He(ee),this.s(ge),this.s(be)},hr.prototype.writeDouble=hr.prototype.J,hr.prototype.I=function(ee){se(typeof ee=="boolean"||typeof ee=="number"),this.a.push(ee?1:0)},hr.prototype.writeBool=hr.prototype.I,hr.prototype.R=function(ee){se(ee==Math.floor(ee)),se(-2147483648<=ee&&2147483648>ee),this.M(ee)},hr.prototype.writeEnum=hr.prototype.R,hr.prototype.ja=function(ee){this.a.push.apply(this.a,ee)},hr.prototype.writeBytes=hr.prototype.ja,hr.prototype.N=function(ee){Ie(ee),this.l(ge,be)},hr.prototype.writeVarintHash64=hr.prototype.N,hr.prototype.K=function(ee){Ie(ee),this.s(ge),this.s(be)},hr.prototype.writeFixedHash64=hr.prototype.K,hr.prototype.U=function(ee){var ve=this.a.length;de(ee);for(var ze=0;ze<ee.length;ze++){var yt=ee.charCodeAt(ze);if(128>yt)this.a.push(yt);else if(2048>yt)this.a.push(yt>>6|192),this.a.push(yt&63|128);else if(65536>yt)if(55296<=yt&&56319>=yt&&ze+1<ee.length){var vt=ee.charCodeAt(ze+1);56320<=vt&&57343>=vt&&(yt=1024*(yt-55296)+vt-56320+65536,this.a.push(yt>>18|240),this.a.push(yt>>12&63|128),this.a.push(yt>>6&63|128),this.a.push(yt&63|128),ze++)}else this.a.push(yt>>12|224),this.a.push(yt>>6&63|128),this.a.push(yt&63|128)}return this.a.length-ve},hr.prototype.writeString=hr.prototype.U;function $r(ee,ve){this.lo=ee,this.hi=ve}S("jspb.arith.UInt64",$r,void 0),$r.prototype.cmp=function(ee){return this.hi<ee.hi||this.hi==ee.hi&&this.lo<ee.lo?-1:this.hi==ee.hi&&this.lo==ee.lo?0:1},$r.prototype.cmp=$r.prototype.cmp,$r.prototype.La=function(){return new $r((this.lo>>>1|(this.hi&1)<<31)>>>0,this.hi>>>1>>>0)},$r.prototype.rightShift=$r.prototype.La,$r.prototype.Da=function(){return new $r(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},$r.prototype.leftShift=$r.prototype.Da,$r.prototype.cb=function(){return!!(this.hi&2147483648)},$r.prototype.msb=$r.prototype.cb,$r.prototype.Ob=function(){return!!(this.lo&1)},$r.prototype.lsb=$r.prototype.Ob,$r.prototype.Ua=function(){return this.lo==0&&this.hi==0},$r.prototype.zero=$r.prototype.Ua,$r.prototype.add=function(ee){return new $r((this.lo+ee.lo&4294967295)>>>0>>>0,((this.hi+ee.hi&4294967295)>>>0)+(4294967296<=this.lo+ee.lo?1:0)>>>0)},$r.prototype.add=$r.prototype.add,$r.prototype.sub=function(ee){return new $r((this.lo-ee.lo&4294967295)>>>0>>>0,((this.hi-ee.hi&4294967295)>>>0)-(0>this.lo-ee.lo?1:0)>>>0)},$r.prototype.sub=$r.prototype.sub;function Hr(ee,ve){var ze=ee&65535;ee>>>=16;var yt=ve&65535,vt=ve>>>16;for(ve=ze*yt+65536*(ze*vt&65535)+65536*(ee*yt&65535),ze=ee*vt+(ze*vt>>>16)+(ee*yt>>>16);4294967296<=ve;)ve-=4294967296,ze+=1;return new $r(ve>>>0,ze>>>0)}$r.mul32x32=Hr,$r.prototype.eb=function(ee){var ve=Hr(this.lo,ee);return ee=Hr(this.hi,ee),ee.hi=ee.lo,ee.lo=0,ve.add(ee)},$r.prototype.mul=$r.prototype.eb,$r.prototype.Xa=function(ee){if(ee==0)return[];var ve=new $r(0,0),ze=new $r(this.lo,this.hi);ee=new $r(ee,0);for(var yt=new $r(1,0);!ee.cb();)ee=ee.Da(),yt=yt.Da();for(;!yt.Ua();)0>=ee.cmp(ze)&&(ve=ve.add(yt),ze=ze.sub(ee)),ee=ee.La(),yt=yt.La();return[ve,ze]},$r.prototype.div=$r.prototype.Xa,$r.prototype.toString=function(){for(var ee="",ve=this;!ve.Ua();){ve=ve.Xa(10);var ze=ve[0];ee=ve[1].lo+ee,ve=ze}return ee==""&&(ee="0"),ee},$r.prototype.toString=$r.prototype.toString;function rn(ee){for(var ve=new $r(0,0),ze=new $r(0,0),yt=0;yt<ee.length;yt++){if("0">ee[yt]||"9"<ee[yt])return null;ze.lo=parseInt(ee[yt],10),ve=ve.eb(10).add(ze)}return ve}$r.fromString=rn,$r.prototype.clone=function(){return new $r(this.lo,this.hi)},$r.prototype.clone=$r.prototype.clone;function _r(ee,ve){this.lo=ee,this.hi=ve}S("jspb.arith.Int64",_r,void 0),_r.prototype.add=function(ee){return new _r((this.lo+ee.lo&4294967295)>>>0>>>0,((this.hi+ee.hi&4294967295)>>>0)+(4294967296<=this.lo+ee.lo?1:0)>>>0)},_r.prototype.add=_r.prototype.add,_r.prototype.sub=function(ee){return new _r((this.lo-ee.lo&4294967295)>>>0>>>0,((this.hi-ee.hi&4294967295)>>>0)-(0>this.lo-ee.lo?1:0)>>>0)},_r.prototype.sub=_r.prototype.sub,_r.prototype.clone=function(){return new _r(this.lo,this.hi)},_r.prototype.clone=_r.prototype.clone,_r.prototype.toString=function(){var ee=(this.hi&2147483648)!=0,ve=new $r(this.lo,this.hi);return ee&&(ve=new $r(0,0).sub(ve)),(ee?"-":"")+ve.toString()},_r.prototype.toString=_r.prototype.toString;function pn(ee){var ve=0<ee.length&&ee[0]=="-";return ve&&(ee=ee.substring(1)),ee=rn(ee),ee===null?null:(ve&&(ee=new $r(0,0).sub(ee)),new _r(ee.lo,ee.hi))}_r.fromString=pn;function $t(){this.c=[],this.b=0,this.a=new hr,this.h=[]}S("jspb.BinaryWriter",$t,void 0);function In(ee,ve){var ze=ee.a.end();ee.c.push(ze),ee.c.push(ve),ee.b+=ze.length+ve.length}function ln(ee,ve){return Fr(ee,ve,2),ve=ee.a.end(),ee.c.push(ve),ee.b+=ve.length,ve.push(ee.b),ve}function yn(ee,ve){var ze=ve.pop();for(ze=ee.b+ee.a.length()-ze,se(0<=ze);127<ze;)ve.push(ze&127|128),ze>>>=7,ee.b++;ve.push(ze),ee.b++}$t.prototype.pb=function(ee,ve,ze){In(this,ee.subarray(ve,ze))},$t.prototype.writeSerializedMessage=$t.prototype.pb,$t.prototype.Pb=function(ee,ve,ze){ee!=null&&ve!=null&&ze!=null&&this.pb(ee,ve,ze)},$t.prototype.maybeWriteSerializedMessage=$t.prototype.Pb,$t.prototype.reset=function(){this.c=[],this.a.end(),this.b=0,this.h=[]},$t.prototype.reset=$t.prototype.reset,$t.prototype.ab=function(){se(this.h.length==0);for(var ee=new Uint8Array(this.b+this.a.length()),ve=this.c,ze=ve.length,yt=0,vt=0;vt<ze;vt++){var ar=ve[vt];ee.set(ar,yt),yt+=ar.length}return ve=this.a.end(),ee.set(ve,yt),yt+=ve.length,se(yt==ee.length),this.c=[ee],ee},$t.prototype.getResultBuffer=$t.prototype.ab,$t.prototype.Kb=function(ee){return H(this.ab(),ee)},$t.prototype.getResultBase64String=$t.prototype.Kb,$t.prototype.Va=function(ee){this.h.push(ln(this,ee))},$t.prototype.beginSubMessage=$t.prototype.Va,$t.prototype.Ya=function(){se(0<=this.h.length),yn(this,this.h.pop())},$t.prototype.endSubMessage=$t.prototype.Ya;function Fr(ee,ve,ze){se(1<=ve&&ve==Math.floor(ve)),ee.a.j(8*ve+ze)}$t.prototype.Nc=function(ee,ve,ze){switch(ee){case 1:this.J(ve,ze);break;case 2:this.L(ve,ze);break;case 3:this.T(ve,ze);break;case 4:this.V(ve,ze);break;case 5:this.S(ve,ze);break;case 6:this.Qa(ve,ze);break;case 7:this.Pa(ve,ze);break;case 8:this.I(ve,ze);break;case 9:this.U(ve,ze);break;case 10:he("Group field type not supported in writeAny()");break;case 11:he("Message field type not supported in writeAny()");break;case 12:this.ja(ve,ze);break;case 13:this.s(ve,ze);break;case 14:this.R(ve,ze);break;case 15:this.Ra(ve,ze);break;case 16:this.Sa(ve,ze);break;case 17:this.rb(ve,ze);break;case 18:this.sb(ve,ze);break;case 30:this.K(ve,ze);break;case 31:this.N(ve,ze);break;default:he("Invalid field type in writeAny()")}},$t.prototype.writeAny=$t.prototype.Nc;function On(ee,ve,ze){ze!=null&&(Fr(ee,ve,0),ee.a.j(ze))}function En(ee,ve,ze){ze!=null&&(Fr(ee,ve,0),ee.a.M(ze))}$t.prototype.S=function(ee,ve){ve!=null&&(se(-2147483648<=ve&&2147483648>ve),En(this,ee,ve))},$t.prototype.writeInt32=$t.prototype.S,$t.prototype.ob=function(ee,ve){ve!=null&&(ve=parseInt(ve,10),se(-2147483648<=ve&&2147483648>ve),En(this,ee,ve))},$t.prototype.writeInt32String=$t.prototype.ob,$t.prototype.T=function(ee,ve){ve!=null&&(se(-9223372036854776e3<=ve&&9223372036854776e3>ve),ve!=null&&(Fr(this,ee,0),this.a.ua(ve)))},$t.prototype.writeInt64=$t.prototype.T,$t.prototype.ka=function(ee,ve){ve!=null&&(ve=pn(ve),Fr(this,ee,0),this.a.l(ve.lo,ve.hi))},$t.prototype.writeInt64String=$t.prototype.ka,$t.prototype.s=function(ee,ve){ve!=null&&(se(0<=ve&&4294967296>ve),On(this,ee,ve))},$t.prototype.writeUint32=$t.prototype.s,$t.prototype.ub=function(ee,ve){ve!=null&&(ve=parseInt(ve,10),se(0<=ve&&4294967296>ve),On(this,ee,ve))},$t.prototype.writeUint32String=$t.prototype.ub,$t.prototype.V=function(ee,ve){ve!=null&&(se(0<=ve&&18446744073709552e3>ve),ve!=null&&(Fr(this,ee,0),this.a.va(ve)))},$t.prototype.writeUint64=$t.prototype.V,$t.prototype.vb=function(ee,ve){ve!=null&&(ve=rn(ve),Fr(this,ee,0),this.a.l(ve.lo,ve.hi))},$t.prototype.writeUint64String=$t.prototype.vb,$t.prototype.rb=function(ee,ve){ve!=null&&(se(-2147483648<=ve&&2147483648>ve),ve!=null&&(Fr(this,ee,0),this.a.wa(ve)))},$t.prototype.writeSint32=$t.prototype.rb,$t.prototype.sb=function(ee,ve){ve!=null&&(se(-9223372036854776e3<=ve&&9223372036854776e3>ve),ve!=null&&(Fr(this,ee,0),this.a.xa(ve)))},$t.prototype.writeSint64=$t.prototype.sb,$t.prototype.$d=function(ee,ve){ve!=null&&ve!=null&&(Fr(this,ee,0),this.a.W(ve))},$t.prototype.writeSintHash64=$t.prototype.$d,$t.prototype.Zd=function(ee,ve){ve!=null&&ve!=null&&(Fr(this,ee,0),this.a.Ta(ve))},$t.prototype.writeSint64String=$t.prototype.Zd,$t.prototype.Pa=function(ee,ve){ve!=null&&(se(0<=ve&&4294967296>ve),Fr(this,ee,5),this.a.s(ve))},$t.prototype.writeFixed32=$t.prototype.Pa,$t.prototype.Qa=function(ee,ve){ve!=null&&(se(0<=ve&&18446744073709552e3>ve),Fr(this,ee,1),this.a.V(ve))},$t.prototype.writeFixed64=$t.prototype.Qa,$t.prototype.nb=function(ee,ve){ve!=null&&(ve=rn(ve),Fr(this,ee,1),this.a.A(ve.lo,ve.hi))},$t.prototype.writeFixed64String=$t.prototype.nb,$t.prototype.Ra=function(ee,ve){ve!=null&&(se(-2147483648<=ve&&2147483648>ve),Fr(this,ee,5),this.a.S(ve))},$t.prototype.writeSfixed32=$t.prototype.Ra,$t.prototype.Sa=function(ee,ve){ve!=null&&(se(-9223372036854776e3<=ve&&9223372036854776e3>ve),Fr(this,ee,1),this.a.T(ve))},$t.prototype.writeSfixed64=$t.prototype.Sa,$t.prototype.qb=function(ee,ve){ve!=null&&(ve=pn(ve),Fr(this,ee,1),this.a.A(ve.lo,ve.hi))},$t.prototype.writeSfixed64String=$t.prototype.qb,$t.prototype.L=function(ee,ve){ve!=null&&(Fr(this,ee,5),this.a.L(ve))},$t.prototype.writeFloat=$t.prototype.L,$t.prototype.J=function(ee,ve){ve!=null&&(Fr(this,ee,1),this.a.J(ve))},$t.prototype.writeDouble=$t.prototype.J,$t.prototype.I=function(ee,ve){ve!=null&&(se(typeof ve=="boolean"||typeof ve=="number"),Fr(this,ee,0),this.a.I(ve))},$t.prototype.writeBool=$t.prototype.I,$t.prototype.R=function(ee,ve){ve!=null&&(se(-2147483648<=ve&&2147483648>ve),Fr(this,ee,0),this.a.M(ve))},$t.prototype.writeEnum=$t.prototype.R,$t.prototype.U=function(ee,ve){ve!=null&&(ee=ln(this,ee),this.a.U(ve),yn(this,ee))},$t.prototype.writeString=$t.prototype.U,$t.prototype.ja=function(ee,ve){ve!=null&&(ve=it(ve),Fr(this,ee,2),this.a.j(ve.length),In(this,ve))},$t.prototype.writeBytes=$t.prototype.ja,$t.prototype.Rc=function(ee,ve,ze){ve!=null&&(ee=ln(this,ee),ze(ve,this),yn(this,ee))},$t.prototype.writeMessage=$t.prototype.Rc,$t.prototype.Sc=function(ee,ve,ze){ve!=null&&(Fr(this,1,3),Fr(this,2,0),this.a.M(ee),ee=ln(this,3),ze(ve,this),yn(this,ee),Fr(this,1,4))},$t.prototype.writeMessageSet=$t.prototype.Sc,$t.prototype.Oc=function(ee,ve,ze){ve!=null&&(Fr(this,ee,3),ze(ve,this),Fr(this,ee,4))},$t.prototype.writeGroup=$t.prototype.Oc,$t.prototype.K=function(ee,ve){ve!=null&&(se(ve.length==8),Fr(this,ee,1),this.a.K(ve))},$t.prototype.writeFixedHash64=$t.prototype.K,$t.prototype.N=function(ee,ve){ve!=null&&(se(ve.length==8),Fr(this,ee,0),this.a.N(ve))},$t.prototype.writeVarintHash64=$t.prototype.N,$t.prototype.A=function(ee,ve,ze){Fr(this,ee,1),this.a.A(ve,ze)},$t.prototype.writeSplitFixed64=$t.prototype.A,$t.prototype.l=function(ee,ve,ze){Fr(this,ee,0),this.a.l(ve,ze)},$t.prototype.writeSplitVarint64=$t.prototype.l,$t.prototype.tb=function(ee,ve,ze){Fr(this,ee,0);var yt=this.a;Be(ve,ze,function(vt,ar){yt.l(vt>>>0,ar>>>0)})},$t.prototype.writeSplitZigzagVarint64=$t.prototype.tb,$t.prototype.Ed=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)En(this,ee,ve[ze])},$t.prototype.writeRepeatedInt32=$t.prototype.Ed,$t.prototype.Fd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.ob(ee,ve[ze])},$t.prototype.writeRepeatedInt32String=$t.prototype.Fd,$t.prototype.Gd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++){var yt=ve[ze];yt!=null&&(Fr(this,ee,0),this.a.ua(yt))}},$t.prototype.writeRepeatedInt64=$t.prototype.Gd,$t.prototype.Qd=function(ee,ve,ze,yt){if(ve!=null)for(var vt=0;vt<ve.length;vt++)this.A(ee,ze(ve[vt]),yt(ve[vt]))},$t.prototype.writeRepeatedSplitFixed64=$t.prototype.Qd,$t.prototype.Rd=function(ee,ve,ze,yt){if(ve!=null)for(var vt=0;vt<ve.length;vt++)this.l(ee,ze(ve[vt]),yt(ve[vt]))},$t.prototype.writeRepeatedSplitVarint64=$t.prototype.Rd,$t.prototype.Sd=function(ee,ve,ze,yt){if(ve!=null)for(var vt=0;vt<ve.length;vt++)this.tb(ee,ze(ve[vt]),yt(ve[vt]))},$t.prototype.writeRepeatedSplitZigzagVarint64=$t.prototype.Sd,$t.prototype.Hd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.ka(ee,ve[ze])},$t.prototype.writeRepeatedInt64String=$t.prototype.Hd,$t.prototype.Ud=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)On(this,ee,ve[ze])},$t.prototype.writeRepeatedUint32=$t.prototype.Ud,$t.prototype.Vd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.ub(ee,ve[ze])},$t.prototype.writeRepeatedUint32String=$t.prototype.Vd,$t.prototype.Wd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++){var yt=ve[ze];yt!=null&&(Fr(this,ee,0),this.a.va(yt))}},$t.prototype.writeRepeatedUint64=$t.prototype.Wd,$t.prototype.Xd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.vb(ee,ve[ze])},$t.prototype.writeRepeatedUint64String=$t.prototype.Xd,$t.prototype.Md=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++){var yt=ve[ze];yt!=null&&(Fr(this,ee,0),this.a.wa(yt))}},$t.prototype.writeRepeatedSint32=$t.prototype.Md,$t.prototype.Nd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++){var yt=ve[ze];yt!=null&&(Fr(this,ee,0),this.a.xa(yt))}},$t.prototype.writeRepeatedSint64=$t.prototype.Nd,$t.prototype.Od=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++){var yt=ve[ze];yt!=null&&(Fr(this,ee,0),this.a.Ta(yt))}},$t.prototype.writeRepeatedSint64String=$t.prototype.Od,$t.prototype.Pd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++){var yt=ve[ze];yt!=null&&(Fr(this,ee,0),this.a.W(yt))}},$t.prototype.writeRepeatedSintHash64=$t.prototype.Pd,$t.prototype.yd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.Pa(ee,ve[ze])},$t.prototype.writeRepeatedFixed32=$t.prototype.yd,$t.prototype.zd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.Qa(ee,ve[ze])},$t.prototype.writeRepeatedFixed64=$t.prototype.zd,$t.prototype.Ad=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.nb(ee,ve[ze])},$t.prototype.writeRepeatedFixed64String=$t.prototype.Ad,$t.prototype.Jd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.Ra(ee,ve[ze])},$t.prototype.writeRepeatedSfixed32=$t.prototype.Jd,$t.prototype.Kd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.Sa(ee,ve[ze])},$t.prototype.writeRepeatedSfixed64=$t.prototype.Kd,$t.prototype.Ld=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.qb(ee,ve[ze])},$t.prototype.writeRepeatedSfixed64String=$t.prototype.Ld,$t.prototype.Cd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.L(ee,ve[ze])},$t.prototype.writeRepeatedFloat=$t.prototype.Cd,$t.prototype.wd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.J(ee,ve[ze])},$t.prototype.writeRepeatedDouble=$t.prototype.wd,$t.prototype.ud=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.I(ee,ve[ze])},$t.prototype.writeRepeatedBool=$t.prototype.ud,$t.prototype.xd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.R(ee,ve[ze])},$t.prototype.writeRepeatedEnum=$t.prototype.xd,$t.prototype.Td=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.U(ee,ve[ze])},$t.prototype.writeRepeatedString=$t.prototype.Td,$t.prototype.vd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.ja(ee,ve[ze])},$t.prototype.writeRepeatedBytes=$t.prototype.vd,$t.prototype.Id=function(ee,ve,ze){if(ve!=null)for(var yt=0;yt<ve.length;yt++){var vt=ln(this,ee);ze(ve[yt],this),yn(this,vt)}},$t.prototype.writeRepeatedMessage=$t.prototype.Id,$t.prototype.Dd=function(ee,ve,ze){if(ve!=null)for(var yt=0;yt<ve.length;yt++)Fr(this,ee,3),ze(ve[yt],this),Fr(this,ee,4)},$t.prototype.writeRepeatedGroup=$t.prototype.Dd,$t.prototype.Bd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.K(ee,ve[ze])},$t.prototype.writeRepeatedFixedHash64=$t.prototype.Bd,$t.prototype.Yd=function(ee,ve){if(ve!=null)for(var ze=0;ze<ve.length;ze++)this.N(ee,ve[ze])},$t.prototype.writeRepeatedVarintHash64=$t.prototype.Yd,$t.prototype.ad=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.M(ve[ze]);yn(this,ee)}},$t.prototype.writePackedInt32=$t.prototype.ad,$t.prototype.bd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.M(parseInt(ve[ze],10));yn(this,ee)}},$t.prototype.writePackedInt32String=$t.prototype.bd,$t.prototype.cd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.ua(ve[ze]);yn(this,ee)}},$t.prototype.writePackedInt64=$t.prototype.cd,$t.prototype.md=function(ee,ve,ze,yt){if(ve!=null){ee=ln(this,ee);for(var vt=0;vt<ve.length;vt++)this.a.A(ze(ve[vt]),yt(ve[vt]));yn(this,ee)}},$t.prototype.writePackedSplitFixed64=$t.prototype.md,$t.prototype.nd=function(ee,ve,ze,yt){if(ve!=null){ee=ln(this,ee);for(var vt=0;vt<ve.length;vt++)this.a.l(ze(ve[vt]),yt(ve[vt]));yn(this,ee)}},$t.prototype.writePackedSplitVarint64=$t.prototype.nd,$t.prototype.od=function(ee,ve,ze,yt){if(ve!=null){ee=ln(this,ee);for(var vt=this.a,ar=0;ar<ve.length;ar++)Be(ze(ve[ar]),yt(ve[ar]),function(wr,zt){vt.l(wr>>>0,zt>>>0)});yn(this,ee)}},$t.prototype.writePackedSplitZigzagVarint64=$t.prototype.od,$t.prototype.dd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++){var yt=pn(ve[ze]);this.a.l(yt.lo,yt.hi)}yn(this,ee)}},$t.prototype.writePackedInt64String=$t.prototype.dd,$t.prototype.pd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.j(ve[ze]);yn(this,ee)}},$t.prototype.writePackedUint32=$t.prototype.pd,$t.prototype.qd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.j(parseInt(ve[ze],10));yn(this,ee)}},$t.prototype.writePackedUint32String=$t.prototype.qd,$t.prototype.rd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.va(ve[ze]);yn(this,ee)}},$t.prototype.writePackedUint64=$t.prototype.rd,$t.prototype.sd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++){var yt=rn(ve[ze]);this.a.l(yt.lo,yt.hi)}yn(this,ee)}},$t.prototype.writePackedUint64String=$t.prototype.sd,$t.prototype.hd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.wa(ve[ze]);yn(this,ee)}},$t.prototype.writePackedSint32=$t.prototype.hd,$t.prototype.jd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.xa(ve[ze]);yn(this,ee)}},$t.prototype.writePackedSint64=$t.prototype.jd,$t.prototype.kd=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.W(rt(ve[ze]));yn(this,ee)}},$t.prototype.writePackedSint64String=$t.prototype.kd,$t.prototype.ld=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.W(ve[ze]);yn(this,ee)}},$t.prototype.writePackedSintHash64=$t.prototype.ld,$t.prototype.Wc=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(4*ve.length),ee=0;ee<ve.length;ee++)this.a.s(ve[ee])},$t.prototype.writePackedFixed32=$t.prototype.Wc,$t.prototype.Xc=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(8*ve.length),ee=0;ee<ve.length;ee++)this.a.V(ve[ee])},$t.prototype.writePackedFixed64=$t.prototype.Xc,$t.prototype.Yc=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(8*ve.length),ee=0;ee<ve.length;ee++){var ze=rn(ve[ee]);this.a.A(ze.lo,ze.hi)}},$t.prototype.writePackedFixed64String=$t.prototype.Yc,$t.prototype.ed=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(4*ve.length),ee=0;ee<ve.length;ee++)this.a.S(ve[ee])},$t.prototype.writePackedSfixed32=$t.prototype.ed,$t.prototype.fd=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(8*ve.length),ee=0;ee<ve.length;ee++)this.a.T(ve[ee])},$t.prototype.writePackedSfixed64=$t.prototype.fd,$t.prototype.gd=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(8*ve.length),ee=0;ee<ve.length;ee++)this.a.ka(ve[ee])},$t.prototype.writePackedSfixed64String=$t.prototype.gd,$t.prototype.$c=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(4*ve.length),ee=0;ee<ve.length;ee++)this.a.L(ve[ee])},$t.prototype.writePackedFloat=$t.prototype.$c,$t.prototype.Uc=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(8*ve.length),ee=0;ee<ve.length;ee++)this.a.J(ve[ee])},$t.prototype.writePackedDouble=$t.prototype.Uc,$t.prototype.Tc=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(ve.length),ee=0;ee<ve.length;ee++)this.a.I(ve[ee])},$t.prototype.writePackedBool=$t.prototype.Tc,$t.prototype.Vc=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.R(ve[ze]);yn(this,ee)}},$t.prototype.writePackedEnum=$t.prototype.Vc,$t.prototype.Zc=function(ee,ve){if(ve!=null&&ve.length)for(Fr(this,ee,2),this.a.j(8*ve.length),ee=0;ee<ve.length;ee++)this.a.K(ve[ee])},$t.prototype.writePackedFixedHash64=$t.prototype.Zc,$t.prototype.td=function(ee,ve){if(ve!=null&&ve.length){ee=ln(this,ee);for(var ze=0;ze<ve.length;ze++)this.a.N(ve[ze]);yn(this,ee)}},$t.prototype.writePackedVarintHash64=$t.prototype.td,f.debug=Jr,f.Map=L,f.Message=ot,f.BinaryReader=ft,f.BinaryWriter=$t,f.ExtensionFieldInfo=qe,f.ExtensionFieldBinaryInfo=Yt,f.exportSymbol=k,f.inherits=q,f.object={extend:F},f.typeOf=O},52983:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")();w.exportSymbol("proto.google.protobuf.Any",null,E),proto.google.protobuf.Any=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(proto.google.protobuf.Any,h.Message),w.DEBUG&&!COMPILED&&(proto.google.protobuf.Any.displayName="proto.google.protobuf.Any"),h.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Any.prototype.toObject=function(v){return proto.google.protobuf.Any.toObject(v,this)},proto.google.protobuf.Any.toObject=function(v,c){var d,p={typeUrl:h.Message.getFieldWithDefault(c,1,""),value:c.getValue_asB64()};return v&&(p.$jspbMessageInstance=c),p}),proto.google.protobuf.Any.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new proto.google.protobuf.Any;return proto.google.protobuf.Any.deserializeBinaryFromReader(d,c)},proto.google.protobuf.Any.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readString();v.setTypeUrl(p);break;case 2:var p=c.readBytes();v.setValue(p);break;default:c.skipField();break}}return v},proto.google.protobuf.Any.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return proto.google.protobuf.Any.serializeBinaryToWriter(this,v),v.getResultBuffer()},proto.google.protobuf.Any.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getTypeUrl(),d.length>0&&c.writeString(1,d),d=v.getValue_asU8(),d.length>0&&c.writeBytes(2,d)},proto.google.protobuf.Any.prototype.getTypeUrl=function(){return h.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.Any.prototype.setTypeUrl=function(v){return h.Message.setProto3StringField(this,1,v)},proto.google.protobuf.Any.prototype.getValue=function(){return h.Message.getFieldWithDefault(this,2,"")},proto.google.protobuf.Any.prototype.getValue_asB64=function(){return h.Message.bytesAsB64(this.getValue())},proto.google.protobuf.Any.prototype.getValue_asU8=function(){return h.Message.bytesAsU8(this.getValue())},proto.google.protobuf.Any.prototype.setValue=function(v){return h.Message.setProto3BytesField(this,2,v)},w.object.extend(f,proto.google.protobuf),proto.google.protobuf.Any.prototype.getTypeName=function(){return this.getTypeUrl().split("/").pop()},proto.google.protobuf.Any.prototype.pack=function(v,c,d){d||(d="type.googleapis.com/"),d.substr(-1)!="/"?this.setTypeUrl(d+"/"+c):this.setTypeUrl(d+c),this.setValue(v)},proto.google.protobuf.Any.prototype.unpack=function(v,c){return this.getTypeName()==c?v(this.getValue_asU8()):null}},51333:function(ie){"use strict";ie.exports=Object.getOwnPropertyDescriptor},25667:function(ie,f,_){"use strict";var h=_(51333);if(h)try{h([],"length")}catch{h=null}ie.exports=h},491:function(ie,f,_){"use strict";var h=_(39886),w=function(){return!!h};w.hasArrayLengthDefineBug=function(){if(!h)return null;try{return h([],"length",{value:1}).length!==1}catch{return!0}},ie.exports=w},21514:function(ie,f,_){"use strict";var h=typeof Symbol<"u"&&Symbol,w=_(9712);ie.exports=function(){return typeof h!="function"||typeof Symbol!="function"||typeof h("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:w()}},9712:function(ie){"use strict";ie.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var _={},h=Symbol("test"),w=Object(h);if(typeof h=="string"||Object.prototype.toString.call(h)!=="[object Symbol]"||Object.prototype.toString.call(w)!=="[object Symbol]")return!1;var E=42;_[h]=E;for(var v in _)return!1;if(typeof Object.keys=="function"&&Object.keys(_).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var c=Object.getOwnPropertySymbols(_);if(c.length!==1||c[0]!==h||!Object.prototype.propertyIsEnumerable.call(_,h))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(_,h);if(d.value!==E||d.enumerable!==!0)return!1}return!0}},77185:function(ie,f,_){"use strict";var h=_(9712);ie.exports=function(){return h()&&!!Symbol.toStringTag}},75630:function(ie,f,_){"use strict";var h=Function.prototype.call,w=Object.prototype.hasOwnProperty,E=_(79524);ie.exports=E.call(h,w)},63328:function(ie,f){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */f.read=function(_,h,w,E,v){var c,d,p=v*8-E-1,m=(1<<p)-1,C=m>>1,x=-7,R=w?v-1:0,S=w?-1:1,O=_[h+R];for(R+=S,c=O&(1<<-x)-1,O>>=-x,x+=p;x>0;c=c*256+_[h+R],R+=S,x-=8);for(d=c&(1<<-x)-1,c>>=-x,x+=E;x>0;d=d*256+_[h+R],R+=S,x-=8);if(c===0)c=1-C;else{if(c===m)return d?NaN:(O?-1:1)*(1/0);d=d+Math.pow(2,E),c=c-C}return(O?-1:1)*d*Math.pow(2,c-E)},f.write=function(_,h,w,E,v,c){var d,p,m,C=c*8-v-1,x=(1<<C)-1,R=x>>1,S=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,O=E?0:c-1,M=E?1:-1,k=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(p=isNaN(h)?1:0,d=x):(d=Math.floor(Math.log(h)/Math.LN2),h*(m=Math.pow(2,-d))<1&&(d--,m*=2),d+R>=1?h+=S/m:h+=S*Math.pow(2,1-R),h*m>=2&&(d++,m/=2),d+R>=x?(p=0,d=x):d+R>=1?(p=(h*m-1)*Math.pow(2,v),d=d+R):(p=h*Math.pow(2,R-1)*Math.pow(2,v),d=0));v>=8;_[w+O]=p&255,O+=M,p/=256,v-=8);for(d=d<<v|p,C+=v;C>0;_[w+O]=d&255,O+=M,d/=256,C-=8);_[w+O-M]|=k*128}},91193:function(ie){typeof Object.create=="function"?ie.exports=function(_,h){h&&(_.super_=h,_.prototype=Object.create(h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:ie.exports=function(_,h){if(h){_.super_=h;var w=function(){};w.prototype=h.prototype,_.prototype=new w,_.prototype.constructor=_}}},5117:function(ie,f,_){"use strict";var h=_(77185)(),w=_(11187),E=w("Object.prototype.toString"),v=function(m){return h&&m&&typeof m=="object"&&Symbol.toStringTag in m?!1:E(m)==="[object Arguments]"},c=function(m){return v(m)?!0:m!==null&&typeof m=="object"&&typeof m.length=="number"&&m.length>=0&&E(m)!=="[object Array]"&&E(m.callee)==="[object Function]"},d=function(){return v(arguments)}();v.isLegacyArguments=c,ie.exports=d?v:c},24982:function(ie){/*!
|
||
* Determine if an object is a Buffer
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*/ie.exports=function(h){return h!=null&&(f(h)||_(h)||!!h._isBuffer)};function f(h){return!!h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)}function _(h){return typeof h.readFloatLE=="function"&&typeof h.slice=="function"&&f(h.slice(0,0))}},22956:function(ie){"use strict";var f=Function.prototype.toString,_=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,h,w;if(typeof _=="function"&&typeof Object.defineProperty=="function")try{h=Object.defineProperty({},"length",{get:function(){throw w}}),w={},_(function(){throw 42},null,h)}catch(b){b!==w&&(_=null)}else _=null;var E=/^\s*class\b/,v=function(F){try{var G=f.call(F);return E.test(G)}catch{return!1}},c=function(F){try{return v(F)?!1:(f.call(F),!0)}catch{return!1}},d=Object.prototype.toString,p="[object Object]",m="[object Function]",C="[object GeneratorFunction]",x="[object HTMLAllCollection]",R="[object HTML document.all class]",S="[object HTMLCollection]",O=typeof Symbol=="function"&&!!Symbol.toStringTag,M=!(0 in[,]),k=function(){return!1};if(typeof document=="object"){var q=document.all;d.call(q)===d.call(document.all)&&(k=function(F){if((M||!F)&&(typeof F>"u"||typeof F=="object"))try{var G=d.call(F);return(G===x||G===R||G===S||G===p)&&F("")==null}catch{}return!1})}ie.exports=_?function(F){if(k(F))return!0;if(!F||typeof F!="function"&&typeof F!="object")return!1;try{_(F,null,h)}catch(G){if(G!==w)return!1}return!v(F)&&c(F)}:function(F){if(k(F))return!0;if(!F||typeof F!="function"&&typeof F!="object")return!1;if(O)return c(F);if(v(F))return!1;var G=d.call(F);return G!==m&&G!==C&&!/^\[object HTML/.test(G)?!1:c(F)}},94204:function(ie,f,_){"use strict";var h=_(98801),w=_(43282),E=w(/^\s*(?:function)?\*/),v=_(77185)(),c=_(14252),d=h("Object.prototype.toString"),p=h("Function.prototype.toString"),m=function(){if(!v)return!1;try{return Function("return function*() {}")()}catch{}},C;ie.exports=function(R){if(typeof R!="function")return!1;if(E(p(R)))return!0;if(!v){var S=d(R);return S==="[object GeneratorFunction]"}if(!c)return!1;if(typeof C>"u"){var O=m();C=O?c(O):!1}return c(R)===C}},84770:function(ie){"use strict";ie.exports=function(_){return _!==_}},14954:function(ie,f,_){"use strict";var h=_(17695),w=_(4938),E=_(84770),v=_(2219),c=_(54445),d=h(v(),Number);w(d,{getPolyfill:v,implementation:E,shim:c}),ie.exports=d},2219:function(ie,f,_){"use strict";var h=_(84770);ie.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:h}},54445:function(ie,f,_){"use strict";var h=_(4938),w=_(2219);ie.exports=function(){var v=w();return h(Number,{isNaN:v},{isNaN:function(){return Number.isNaN!==v}}),v}},10092:function(ie,f,_){"use strict";var h=_(98801),w=_(77185)(),E=_(75630),v=_(25667),c;if(w){var d=h("RegExp.prototype.exec"),p={},m=function(){throw p},C={toString:m,valueOf:m};typeof Symbol.toPrimitive=="symbol"&&(C[Symbol.toPrimitive]=m),c=function(O){if(!O||typeof O!="object")return!1;var M=v(O,"lastIndex"),k=M&&E(M,"value");if(!k)return!1;try{d(O,C)}catch(q){return q===p}}}else{var x=h("Object.prototype.toString"),R="[object RegExp]";c=function(O){return!O||typeof O!="object"&&typeof O!="function"?!1:x(O)===R}}ie.exports=c},40006:function(ie,f,_){"use strict";var h=_(1728);ie.exports=function(E){return!!h(E)}},52149:function(ie,f,_){"use strict";const h=_(33357).v4,w=_(89456),E=function(v,c){if(!(this instanceof E))return new E(v,c);c||(c={}),this.options={reviver:typeof c.reviver<"u"?c.reviver:null,replacer:typeof c.replacer<"u"?c.replacer:null,generator:typeof c.generator<"u"?c.generator:function(){return h()},version:typeof c.version<"u"?c.version:2,notificationIdNull:typeof c.notificationIdNull=="boolean"?c.notificationIdNull:!1},this.callServer=v};ie.exports=E,E.prototype.request=function(v,c,d,p){const m=this;let C=null;const x=Array.isArray(v)&&typeof c=="function";if(this.options.version===1&&x)throw new TypeError("JSON-RPC 1.0 does not support batching");if(x||!x&&v&&typeof v=="object"&&typeof c=="function")p=c,C=v;else{typeof d=="function"&&(p=d,d=void 0);const O=typeof p=="function";try{C=w(v,c,d,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(M){if(O)return p(M);throw M}if(!O)return C}let S;try{S=JSON.stringify(C,this.options.replacer)}catch(O){return p(O)}return this.callServer(S,function(O,M){m._parseResponse(O,M,p)}),C},E.prototype._parseResponse=function(v,c,d){if(v){d(v);return}if(!c)return d();let p;try{p=JSON.parse(c,this.options.reviver)}catch(m){return d(m)}if(d.length===3)if(Array.isArray(p)){const m=function(x){return typeof x.error<"u"},C=function(x){return!m(x)};return d(null,p.filter(m),p.filter(C))}else return d(null,p.error,p.result);d(null,p)}},89456:function(ie,f,_){"use strict";const h=_(33357).v4,w=function(E,v,c,d){if(typeof E!="string")throw new TypeError(E+" must be a string");d=d||{};const p=typeof d.version=="number"?d.version:2;if(p!==1&&p!==2)throw new TypeError(p+" must be 1 or 2");const m={method:E};if(p===2&&(m.jsonrpc="2.0"),v){if(typeof v!="object"&&!Array.isArray(v))throw new TypeError(v+" must be an object, array or omitted");m.params=v}if(typeof c>"u"){const C=typeof d.generator=="function"?d.generator:function(){return h()};m.id=C(m,d)}else p===2&&c===null?d.notificationIdNull&&(m.id=null):m.id=c;return m};ie.exports=w},22057:function(ie,f,_){(function(h,w){ie.exports=w(h)})(typeof self<"u"?self:typeof _.g<"u"?_.g:this,function(h){"use strict";h=h||{};var w=h.Base64,E="2.6.4",v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=function(L){for(var $={},T=0,N=L.length;T<N;T++)$[L.charAt(T)]=T;return $}(v),d=String.fromCharCode,p=function(L){if(L.length<2){var $=L.charCodeAt(0);return $<128?L:$<2048?d(192|$>>>6)+d(128|$&63):d(224|$>>>12&15)+d(128|$>>>6&63)+d(128|$&63)}else{var $=65536+(L.charCodeAt(0)-55296)*1024+(L.charCodeAt(1)-56320);return d(240|$>>>18&7)+d(128|$>>>12&63)+d(128|$>>>6&63)+d(128|$&63)}},m=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,C=function(L){return L.replace(m,p)},x=function(L){var $=[0,2,1][L.length%3],T=L.charCodeAt(0)<<16|(L.length>1?L.charCodeAt(1):0)<<8|(L.length>2?L.charCodeAt(2):0),N=[v.charAt(T>>>18),v.charAt(T>>>12&63),$>=2?"=":v.charAt(T>>>6&63),$>=1?"=":v.charAt(T&63)];return N.join("")},R=h.btoa&&typeof h.btoa=="function"?function(L){return h.btoa(L)}:function(L){if(L.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return L.replace(/[\s\S]{1,3}/g,x)},S=function(L){return R(C(String(L)))},O=function(L){return L.replace(/[+\/]/g,function($){return $=="+"?"-":"_"}).replace(/=/g,"")},M=function(L,$){return $?O(S(L)):S(L)},k=function(L){return M(L,!0)},q;h.Uint8Array&&(q=function(L,$){for(var T="",N=0,j=L.length;N<j;N+=3){var Y=L[N],Z=L[N+1],z=L[N+2],fe=Y<<16|Z<<8|z;T+=v.charAt(fe>>>18)+v.charAt(fe>>>12&63)+(typeof Z<"u"?v.charAt(fe>>>6&63):"=")+(typeof z<"u"?v.charAt(fe&63):"=")}return $?O(T):T});var b=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,F=function(L){switch(L.length){case 4:var $=(7&L.charCodeAt(0))<<18|(63&L.charCodeAt(1))<<12|(63&L.charCodeAt(2))<<6|63&L.charCodeAt(3),T=$-65536;return d((T>>>10)+55296)+d((T&1023)+56320);case 3:return d((15&L.charCodeAt(0))<<12|(63&L.charCodeAt(1))<<6|63&L.charCodeAt(2));default:return d((31&L.charCodeAt(0))<<6|63&L.charCodeAt(1))}},G=function(L){return L.replace(b,F)},ue=function(L){var $=L.length,T=$%4,N=($>0?c[L.charAt(0)]<<18:0)|($>1?c[L.charAt(1)]<<12:0)|($>2?c[L.charAt(2)]<<6:0)|($>3?c[L.charAt(3)]:0),j=[d(N>>>16),d(N>>>8&255),d(N&255)];return j.length-=[0,0,2,1][T],j.join("")},le=h.atob&&typeof h.atob=="function"?function(L){return h.atob(L)}:function(L){return L.replace(/\S{1,4}/g,ue)},X=function(L){return le(String(L).replace(/[^A-Za-z0-9\+\/]/g,""))},se=function(L){return G(le(L))},de=function(L){return String(L).replace(/[-_]/g,function($){return $=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},ye=function(L){return se(de(L))},he;h.Uint8Array&&(he=function(L){return Uint8Array.from(X(de(L)),function($){return $.charCodeAt(0)})});var K=function(){var L=h.Base64;return h.Base64=w,L};if(h.Base64={VERSION:E,atob:X,btoa:R,fromBase64:ye,toBase64:M,utob:C,encode:M,encodeURI:k,btou:G,decode:ye,noConflict:K,fromUint8Array:q,toUint8Array:he},typeof Object.defineProperty=="function"){var B=function(L){return{value:L,enumerable:!1,writable:!0,configurable:!0}};h.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",B(function(){return ye(this)})),Object.defineProperty(String.prototype,"toBase64",B(function(L){return M(this,L)})),Object.defineProperty(String.prototype,"toBase64URI",B(function(){return M(this,!0)}))}}return h.Meteor&&(Base64=h.Base64),ie.exports?ie.exports.Base64=h.Base64:typeof define=="function"&&define.amd&&define([],function(){return h.Base64}),{Base64:h.Base64}})},3749:function(ie,f,_){var h=_(85409);/**
|
||
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
||
*
|
||
* @version 0.11.1
|
||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||
* @copyright Chen, Yi-Cyuan 2014-2025
|
||
* @license MIT
|
||
*/(function(){"use strict";var w="input is invalid type",E=!1,v=E?self:{};v.JS_SHA256_NO_WINDOW&&(E=!1);var c=!E&&typeof self=="object",d=!v.JS_SHA256_NO_NODE_JS&&typeof h=="object"&&h.versions&&h.versions.node&&h.type!="renderer";d?v=_.g:c&&(v=self);var p=!v.JS_SHA256_NO_COMMON_JS&&!0&&ie.exports,m=typeof define=="function"&&define.amd,C=!v.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",x="0123456789abcdef".split(""),R=[-2147483648,8388608,32768,128],S=[24,16,8,0],O=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],M=["hex","array","digest","arrayBuffer"],k=[];(v.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(de){return Object.prototype.toString.call(de)==="[object Array]"}),C&&(v.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(de){return typeof de=="object"&&de.buffer&&de.buffer.constructor===ArrayBuffer});var q=function(de,ye){return function(he){return new le(ye,!0).update(he)[de]()}},b=function(de){var ye=q("hex",de);d&&(ye=F(ye,de)),ye.create=function(){return new le(de)},ye.update=function(B){return ye.create().update(B)};for(var he=0;he<M.length;++he){var K=M[he];ye[K]=q(K,de)}return ye},F=function(de,ye){var he=_(78172),K=_(90861).Buffer,B=ye?"sha224":"sha256",L;K.from&&!v.JS_SHA256_NO_BUFFER_FROM?L=K.from:L=function(T){return new K(T)};var $=function(T){if(typeof T=="string")return he.createHash(B).update(T,"utf8").digest("hex");if(T==null)throw new Error(w);return T.constructor===ArrayBuffer&&(T=new Uint8Array(T)),Array.isArray(T)||ArrayBuffer.isView(T)||T.constructor===K?he.createHash(B).update(L(T)).digest("hex"):de(T)};return $},G=function(de,ye){return function(he,K){return new X(he,ye,!0).update(K)[de]()}},ue=function(de){var ye=G("hex",de);ye.create=function(B){return new X(B,de)},ye.update=function(B,L){return ye.create(B).update(L)};for(var he=0;he<M.length;++he){var K=M[he];ye[K]=G(K,de)}return ye};function le(de,ye){ye?(k[0]=k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0,this.blocks=k):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],de?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=de}le.prototype.update=function(de){if(!this.finalized){var ye,he=typeof de;if(he!=="string"){if(he==="object"){if(de===null)throw new Error(w);if(C&&de.constructor===ArrayBuffer)de=new Uint8Array(de);else if(!Array.isArray(de)&&(!C||!ArrayBuffer.isView(de)))throw new Error(w)}else throw new Error(w);ye=!0}for(var K,B=0,L,$=de.length,T=this.blocks;B<$;){if(this.hashed&&(this.hashed=!1,T[0]=this.block,this.block=T[16]=T[1]=T[2]=T[3]=T[4]=T[5]=T[6]=T[7]=T[8]=T[9]=T[10]=T[11]=T[12]=T[13]=T[14]=T[15]=0),ye)for(L=this.start;B<$&&L<64;++B)T[L>>>2]|=de[B]<<S[L++&3];else for(L=this.start;B<$&&L<64;++B)K=de.charCodeAt(B),K<128?T[L>>>2]|=K<<S[L++&3]:K<2048?(T[L>>>2]|=(192|K>>>6)<<S[L++&3],T[L>>>2]|=(128|K&63)<<S[L++&3]):K<55296||K>=57344?(T[L>>>2]|=(224|K>>>12)<<S[L++&3],T[L>>>2]|=(128|K>>>6&63)<<S[L++&3],T[L>>>2]|=(128|K&63)<<S[L++&3]):(K=65536+((K&1023)<<10|de.charCodeAt(++B)&1023),T[L>>>2]|=(240|K>>>18)<<S[L++&3],T[L>>>2]|=(128|K>>>12&63)<<S[L++&3],T[L>>>2]|=(128|K>>>6&63)<<S[L++&3],T[L>>>2]|=(128|K&63)<<S[L++&3]);this.lastByteIndex=L,this.bytes+=L-this.start,L>=64?(this.block=T[16],this.start=L-64,this.hash(),this.hashed=!0):this.start=L}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},le.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var de=this.blocks,ye=this.lastByteIndex;de[16]=this.block,de[ye>>>2]|=R[ye&3],this.block=de[16],ye>=56&&(this.hashed||this.hash(),de[0]=this.block,de[16]=de[1]=de[2]=de[3]=de[4]=de[5]=de[6]=de[7]=de[8]=de[9]=de[10]=de[11]=de[12]=de[13]=de[14]=de[15]=0),de[14]=this.hBytes<<3|this.bytes>>>29,de[15]=this.bytes<<3,this.hash()}},le.prototype.hash=function(){var de=this.h0,ye=this.h1,he=this.h2,K=this.h3,B=this.h4,L=this.h5,$=this.h6,T=this.h7,N=this.blocks,j,Y,Z,z,fe,te,H,Q,oe,_e,ge;for(j=16;j<64;++j)fe=N[j-15],Y=(fe>>>7|fe<<25)^(fe>>>18|fe<<14)^fe>>>3,fe=N[j-2],Z=(fe>>>17|fe<<15)^(fe>>>19|fe<<13)^fe>>>10,N[j]=N[j-16]+Y+N[j-7]+Z<<0;for(ge=ye&he,j=0;j<64;j+=4)this.first?(this.is224?(Q=300032,fe=N[0]-1413257819,T=fe-150054599<<0,K=fe+24177077<<0):(Q=704751109,fe=N[0]-210244248,T=fe-1521486534<<0,K=fe+143694565<<0),this.first=!1):(Y=(de>>>2|de<<30)^(de>>>13|de<<19)^(de>>>22|de<<10),Z=(B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7),Q=de&ye,z=Q^de&he^ge,H=B&L^~B&$,fe=T+Z+H+O[j]+N[j],te=Y+z,T=K+fe<<0,K=fe+te<<0),Y=(K>>>2|K<<30)^(K>>>13|K<<19)^(K>>>22|K<<10),Z=(T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7),oe=K&de,z=oe^K&ye^Q,H=T&B^~T&L,fe=$+Z+H+O[j+1]+N[j+1],te=Y+z,$=he+fe<<0,he=fe+te<<0,Y=(he>>>2|he<<30)^(he>>>13|he<<19)^(he>>>22|he<<10),Z=($>>>6|$<<26)^($>>>11|$<<21)^($>>>25|$<<7),_e=he&K,z=_e^he&de^oe,H=$&T^~$&B,fe=L+Z+H+O[j+2]+N[j+2],te=Y+z,L=ye+fe<<0,ye=fe+te<<0,Y=(ye>>>2|ye<<30)^(ye>>>13|ye<<19)^(ye>>>22|ye<<10),Z=(L>>>6|L<<26)^(L>>>11|L<<21)^(L>>>25|L<<7),ge=ye&he,z=ge^ye&K^_e,H=L&$^~L&T,fe=B+Z+H+O[j+3]+N[j+3],te=Y+z,B=de+fe<<0,de=fe+te<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+de<<0,this.h1=this.h1+ye<<0,this.h2=this.h2+he<<0,this.h3=this.h3+K<<0,this.h4=this.h4+B<<0,this.h5=this.h5+L<<0,this.h6=this.h6+$<<0,this.h7=this.h7+T<<0},le.prototype.hex=function(){this.finalize();var de=this.h0,ye=this.h1,he=this.h2,K=this.h3,B=this.h4,L=this.h5,$=this.h6,T=this.h7,N=x[de>>>28&15]+x[de>>>24&15]+x[de>>>20&15]+x[de>>>16&15]+x[de>>>12&15]+x[de>>>8&15]+x[de>>>4&15]+x[de&15]+x[ye>>>28&15]+x[ye>>>24&15]+x[ye>>>20&15]+x[ye>>>16&15]+x[ye>>>12&15]+x[ye>>>8&15]+x[ye>>>4&15]+x[ye&15]+x[he>>>28&15]+x[he>>>24&15]+x[he>>>20&15]+x[he>>>16&15]+x[he>>>12&15]+x[he>>>8&15]+x[he>>>4&15]+x[he&15]+x[K>>>28&15]+x[K>>>24&15]+x[K>>>20&15]+x[K>>>16&15]+x[K>>>12&15]+x[K>>>8&15]+x[K>>>4&15]+x[K&15]+x[B>>>28&15]+x[B>>>24&15]+x[B>>>20&15]+x[B>>>16&15]+x[B>>>12&15]+x[B>>>8&15]+x[B>>>4&15]+x[B&15]+x[L>>>28&15]+x[L>>>24&15]+x[L>>>20&15]+x[L>>>16&15]+x[L>>>12&15]+x[L>>>8&15]+x[L>>>4&15]+x[L&15]+x[$>>>28&15]+x[$>>>24&15]+x[$>>>20&15]+x[$>>>16&15]+x[$>>>12&15]+x[$>>>8&15]+x[$>>>4&15]+x[$&15];return this.is224||(N+=x[T>>>28&15]+x[T>>>24&15]+x[T>>>20&15]+x[T>>>16&15]+x[T>>>12&15]+x[T>>>8&15]+x[T>>>4&15]+x[T&15]),N},le.prototype.toString=le.prototype.hex,le.prototype.digest=function(){this.finalize();var de=this.h0,ye=this.h1,he=this.h2,K=this.h3,B=this.h4,L=this.h5,$=this.h6,T=this.h7,N=[de>>>24&255,de>>>16&255,de>>>8&255,de&255,ye>>>24&255,ye>>>16&255,ye>>>8&255,ye&255,he>>>24&255,he>>>16&255,he>>>8&255,he&255,K>>>24&255,K>>>16&255,K>>>8&255,K&255,B>>>24&255,B>>>16&255,B>>>8&255,B&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255];return this.is224||N.push(T>>>24&255,T>>>16&255,T>>>8&255,T&255),N},le.prototype.array=le.prototype.digest,le.prototype.arrayBuffer=function(){this.finalize();var de=new ArrayBuffer(this.is224?28:32),ye=new DataView(de);return ye.setUint32(0,this.h0),ye.setUint32(4,this.h1),ye.setUint32(8,this.h2),ye.setUint32(12,this.h3),ye.setUint32(16,this.h4),ye.setUint32(20,this.h5),ye.setUint32(24,this.h6),this.is224||ye.setUint32(28,this.h7),de};function X(de,ye,he){var K,B=typeof de;if(B==="string"){var L=[],$=de.length,T=0,N;for(K=0;K<$;++K)N=de.charCodeAt(K),N<128?L[T++]=N:N<2048?(L[T++]=192|N>>>6,L[T++]=128|N&63):N<55296||N>=57344?(L[T++]=224|N>>>12,L[T++]=128|N>>>6&63,L[T++]=128|N&63):(N=65536+((N&1023)<<10|de.charCodeAt(++K)&1023),L[T++]=240|N>>>18,L[T++]=128|N>>>12&63,L[T++]=128|N>>>6&63,L[T++]=128|N&63);de=L}else if(B==="object"){if(de===null)throw new Error(w);if(C&&de.constructor===ArrayBuffer)de=new Uint8Array(de);else if(!Array.isArray(de)&&(!C||!ArrayBuffer.isView(de)))throw new Error(w)}else throw new Error(w);de.length>64&&(de=new le(ye,!0).update(de).array());var j=[],Y=[];for(K=0;K<64;++K){var Z=de[K]||0;j[K]=92^Z,Y[K]=54^Z}le.call(this,ye,he),this.update(Y),this.oKeyPad=j,this.inner=!0,this.sharedMemory=he}X.prototype=new le,X.prototype.finalize=function(){if(le.prototype.finalize.call(this),this.inner){this.inner=!1;var de=this.array();le.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(de),le.prototype.finalize.call(this)}};var se=b();se.sha256=se,se.sha224=b(!0),se.sha256.hmac=ue(),se.sha224.hmac=ue(!0),p?ie.exports=se:(v.sha256=se.sha256,v.sha224=se.sha224,m&&define(function(){return se}))})()},99136:function(ie,f,_){var h=_(85409);/**
|
||
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
||
*
|
||
* @version 0.5.7
|
||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||
* @copyright Chen, Yi-Cyuan 2015-2016
|
||
* @license MIT
|
||
*/(function(){"use strict";var w={},E=!w.JS_SHA3_NO_NODE_JS&&typeof h=="object"&&h.versions&&h.versions.node;E&&(w=_.g);for(var v=!w.JS_SHA3_NO_COMMON_JS&&!0&&ie.exports,c="0123456789abcdef".split(""),d=[31,7936,2031616,520093696],p=[1,256,65536,16777216],m=[6,1536,393216,100663296],C=[0,8,16,24],x=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],R=[224,256,384,512],S=[128,256],O=["hex","buffer","arrayBuffer","array"],M=function(B,L,$){return function(T){return new he(B,L,B).update(T)[$]()}},k=function(B,L,$){return function(T,N){return new he(B,L,N).update(T)[$]()}},q=function(B,L){var $=M(B,L,"hex");$.create=function(){return new he(B,L,B)},$.update=function(j){return $.create().update(j)};for(var T=0;T<O.length;++T){var N=O[T];$[N]=M(B,L,N)}return $},b=function(B,L){var $=k(B,L,"hex");$.create=function(j){return new he(B,L,j)},$.update=function(j,Y){return $.create(Y).update(j)};for(var T=0;T<O.length;++T){var N=O[T];$[N]=k(B,L,N)}return $},F=[{name:"keccak",padding:p,bits:R,createMethod:q},{name:"sha3",padding:m,bits:R,createMethod:q},{name:"shake",padding:d,bits:S,createMethod:b}],G={},ue=[],le=0;le<F.length;++le)for(var X=F[le],se=X.bits,de=0;de<se.length;++de){var ye=X.name+"_"+se[de];ue.push(ye),G[ye]=X.createMethod(se[de],X.padding)}function he(B,L,$){this.blocks=[],this.s=[],this.padding=L,this.outputBits=$,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(B<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=$>>5,this.extraBytes=($&31)>>3;for(var T=0;T<50;++T)this.s[T]=0}he.prototype.update=function(B){var L=typeof B!="string";L&&B.constructor===ArrayBuffer&&(B=new Uint8Array(B));for(var $=B.length,T=this.blocks,N=this.byteCount,j=this.blockCount,Y=0,Z=this.s,z,fe;Y<$;){if(this.reset)for(this.reset=!1,T[0]=this.block,z=1;z<j+1;++z)T[z]=0;if(L)for(z=this.start;Y<$&&z<N;++Y)T[z>>2]|=B[Y]<<C[z++&3];else for(z=this.start;Y<$&&z<N;++Y)fe=B.charCodeAt(Y),fe<128?T[z>>2]|=fe<<C[z++&3]:fe<2048?(T[z>>2]|=(192|fe>>6)<<C[z++&3],T[z>>2]|=(128|fe&63)<<C[z++&3]):fe<55296||fe>=57344?(T[z>>2]|=(224|fe>>12)<<C[z++&3],T[z>>2]|=(128|fe>>6&63)<<C[z++&3],T[z>>2]|=(128|fe&63)<<C[z++&3]):(fe=65536+((fe&1023)<<10|B.charCodeAt(++Y)&1023),T[z>>2]|=(240|fe>>18)<<C[z++&3],T[z>>2]|=(128|fe>>12&63)<<C[z++&3],T[z>>2]|=(128|fe>>6&63)<<C[z++&3],T[z>>2]|=(128|fe&63)<<C[z++&3]);if(this.lastByteIndex=z,z>=N){for(this.start=z-N,this.block=T[j],z=0;z<j;++z)Z[z]^=T[z];K(Z),this.reset=!0}else this.start=z}return this},he.prototype.finalize=function(){var B=this.blocks,L=this.lastByteIndex,$=this.blockCount,T=this.s;if(B[L>>2]|=this.padding[L&3],this.lastByteIndex===this.byteCount)for(B[0]=B[$],L=1;L<$+1;++L)B[L]=0;for(B[$-1]|=2147483648,L=0;L<$;++L)T[L]^=B[L];K(T)},he.prototype.toString=he.prototype.hex=function(){this.finalize();for(var B=this.blockCount,L=this.s,$=this.outputBlocks,T=this.extraBytes,N=0,j=0,Y="",Z;j<$;){for(N=0;N<B&&j<$;++N,++j)Z=L[N],Y+=c[Z>>4&15]+c[Z&15]+c[Z>>12&15]+c[Z>>8&15]+c[Z>>20&15]+c[Z>>16&15]+c[Z>>28&15]+c[Z>>24&15];j%B===0&&(K(L),N=0)}return T&&(Z=L[N],T>0&&(Y+=c[Z>>4&15]+c[Z&15]),T>1&&(Y+=c[Z>>12&15]+c[Z>>8&15]),T>2&&(Y+=c[Z>>20&15]+c[Z>>16&15])),Y},he.prototype.arrayBuffer=function(){this.finalize();var B=this.blockCount,L=this.s,$=this.outputBlocks,T=this.extraBytes,N=0,j=0,Y=this.outputBits>>3,Z;T?Z=new ArrayBuffer($+1<<2):Z=new ArrayBuffer(Y);for(var z=new Uint32Array(Z);j<$;){for(N=0;N<B&&j<$;++N,++j)z[j]=L[N];j%B===0&&K(L)}return T&&(z[N]=L[N],Z=Z.slice(0,Y)),Z},he.prototype.buffer=he.prototype.arrayBuffer,he.prototype.digest=he.prototype.array=function(){this.finalize();for(var B=this.blockCount,L=this.s,$=this.outputBlocks,T=this.extraBytes,N=0,j=0,Y=[],Z,z;j<$;){for(N=0;N<B&&j<$;++N,++j)Z=j<<2,z=L[N],Y[Z]=z&255,Y[Z+1]=z>>8&255,Y[Z+2]=z>>16&255,Y[Z+3]=z>>24&255;j%B===0&&K(L)}return T&&(Z=j<<2,z=L[N],T>0&&(Y[Z]=z&255),T>1&&(Y[Z+1]=z>>8&255),T>2&&(Y[Z+2]=z>>16&255)),Y};var K=function(B){var L,$,T,N,j,Y,Z,z,fe,te,H,Q,oe,_e,ge,be,we,Ee,me,Ke,He,Ie,Le,Ge,Be,We,Ze,_t,Ft,gt,lt,dt,tt,rt,ke,xe,Pe,it,Xe,st,It,ft,Jt,Ot,Ct,qe,Yt,ot,Ae,Rt,Ht,bt,Mt,tr,Vt,Et,Ye,Tt,Wt,dr,at,wt,At;for(T=0;T<48;T+=2)N=B[0]^B[10]^B[20]^B[30]^B[40],j=B[1]^B[11]^B[21]^B[31]^B[41],Y=B[2]^B[12]^B[22]^B[32]^B[42],Z=B[3]^B[13]^B[23]^B[33]^B[43],z=B[4]^B[14]^B[24]^B[34]^B[44],fe=B[5]^B[15]^B[25]^B[35]^B[45],te=B[6]^B[16]^B[26]^B[36]^B[46],H=B[7]^B[17]^B[27]^B[37]^B[47],Q=B[8]^B[18]^B[28]^B[38]^B[48],oe=B[9]^B[19]^B[29]^B[39]^B[49],L=Q^(Y<<1|Z>>>31),$=oe^(Z<<1|Y>>>31),B[0]^=L,B[1]^=$,B[10]^=L,B[11]^=$,B[20]^=L,B[21]^=$,B[30]^=L,B[31]^=$,B[40]^=L,B[41]^=$,L=N^(z<<1|fe>>>31),$=j^(fe<<1|z>>>31),B[2]^=L,B[3]^=$,B[12]^=L,B[13]^=$,B[22]^=L,B[23]^=$,B[32]^=L,B[33]^=$,B[42]^=L,B[43]^=$,L=Y^(te<<1|H>>>31),$=Z^(H<<1|te>>>31),B[4]^=L,B[5]^=$,B[14]^=L,B[15]^=$,B[24]^=L,B[25]^=$,B[34]^=L,B[35]^=$,B[44]^=L,B[45]^=$,L=z^(Q<<1|oe>>>31),$=fe^(oe<<1|Q>>>31),B[6]^=L,B[7]^=$,B[16]^=L,B[17]^=$,B[26]^=L,B[27]^=$,B[36]^=L,B[37]^=$,B[46]^=L,B[47]^=$,L=te^(N<<1|j>>>31),$=H^(j<<1|N>>>31),B[8]^=L,B[9]^=$,B[18]^=L,B[19]^=$,B[28]^=L,B[29]^=$,B[38]^=L,B[39]^=$,B[48]^=L,B[49]^=$,_e=B[0],ge=B[1],qe=B[11]<<4|B[10]>>>28,Yt=B[10]<<4|B[11]>>>28,_t=B[20]<<3|B[21]>>>29,Ft=B[21]<<3|B[20]>>>29,dr=B[31]<<9|B[30]>>>23,at=B[30]<<9|B[31]>>>23,ft=B[40]<<18|B[41]>>>14,Jt=B[41]<<18|B[40]>>>14,rt=B[2]<<1|B[3]>>>31,ke=B[3]<<1|B[2]>>>31,be=B[13]<<12|B[12]>>>20,we=B[12]<<12|B[13]>>>20,ot=B[22]<<10|B[23]>>>22,Ae=B[23]<<10|B[22]>>>22,gt=B[33]<<13|B[32]>>>19,lt=B[32]<<13|B[33]>>>19,wt=B[42]<<2|B[43]>>>30,At=B[43]<<2|B[42]>>>30,tr=B[5]<<30|B[4]>>>2,Vt=B[4]<<30|B[5]>>>2,xe=B[14]<<6|B[15]>>>26,Pe=B[15]<<6|B[14]>>>26,Ee=B[25]<<11|B[24]>>>21,me=B[24]<<11|B[25]>>>21,Rt=B[34]<<15|B[35]>>>17,Ht=B[35]<<15|B[34]>>>17,dt=B[45]<<29|B[44]>>>3,tt=B[44]<<29|B[45]>>>3,Ge=B[6]<<28|B[7]>>>4,Be=B[7]<<28|B[6]>>>4,Et=B[17]<<23|B[16]>>>9,Ye=B[16]<<23|B[17]>>>9,it=B[26]<<25|B[27]>>>7,Xe=B[27]<<25|B[26]>>>7,Ke=B[36]<<21|B[37]>>>11,He=B[37]<<21|B[36]>>>11,bt=B[47]<<24|B[46]>>>8,Mt=B[46]<<24|B[47]>>>8,Ot=B[8]<<27|B[9]>>>5,Ct=B[9]<<27|B[8]>>>5,We=B[18]<<20|B[19]>>>12,Ze=B[19]<<20|B[18]>>>12,Tt=B[29]<<7|B[28]>>>25,Wt=B[28]<<7|B[29]>>>25,st=B[38]<<8|B[39]>>>24,It=B[39]<<8|B[38]>>>24,Ie=B[48]<<14|B[49]>>>18,Le=B[49]<<14|B[48]>>>18,B[0]=_e^~be&Ee,B[1]=ge^~we&me,B[10]=Ge^~We&_t,B[11]=Be^~Ze&Ft,B[20]=rt^~xe&it,B[21]=ke^~Pe&Xe,B[30]=Ot^~qe&ot,B[31]=Ct^~Yt&Ae,B[40]=tr^~Et&Tt,B[41]=Vt^~Ye&Wt,B[2]=be^~Ee&Ke,B[3]=we^~me&He,B[12]=We^~_t>,B[13]=Ze^~Ft<,B[22]=xe^~it&st,B[23]=Pe^~Xe&It,B[32]=qe^~ot&Rt,B[33]=Yt^~Ae&Ht,B[42]=Et^~Tt&dr,B[43]=Ye^~Wt&at,B[4]=Ee^~Ke&Ie,B[5]=me^~He&Le,B[14]=_t^~gt&dt,B[15]=Ft^~lt&tt,B[24]=it^~st&ft,B[25]=Xe^~It&Jt,B[34]=ot^~Rt&bt,B[35]=Ae^~Ht&Mt,B[44]=Tt^~dr&wt,B[45]=Wt^~at&At,B[6]=Ke^~Ie&_e,B[7]=He^~Le&ge,B[16]=gt^~dt&Ge,B[17]=lt^~tt&Be,B[26]=st^~ft&rt,B[27]=It^~Jt&ke,B[36]=Rt^~bt&Ot,B[37]=Ht^~Mt&Ct,B[46]=dr^~wt&tr,B[47]=at^~At&Vt,B[8]=Ie^~_e&be,B[9]=Le^~ge&we,B[18]=dt^~Ge&We,B[19]=tt^~Be&Ze,B[28]=ft^~rt&xe,B[29]=Jt^~ke&Pe,B[38]=bt^~Ot&qe,B[39]=Mt^~Ct&Yt,B[48]=wt^~tr&Et,B[49]=At^~Vt&Ye,B[0]^=x[T],B[1]^=x[T+1]};if(v)ie.exports=G;else for(var le=0;le<ue.length;++le)w[ue[le]]=G[ue[le]]})()},9162:function(ie,f,_){var h=_(85409);/**
|
||
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
||
*
|
||
* @version 0.8.0
|
||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||
* @copyright Chen, Yi-Cyuan 2015-2018
|
||
* @license MIT
|
||
*/(function(){"use strict";var w="input is invalid type",E="finalize already called",v=!1,c=v?self:{};c.JS_SHA3_NO_WINDOW&&(v=!1);var d=!v&&typeof self=="object",p=!c.JS_SHA3_NO_NODE_JS&&typeof h=="object"&&h.versions&&h.versions.node;p?c=_.g:d&&(c=self);var m=!c.JS_SHA3_NO_COMMON_JS&&!0&&ie.exports,C=typeof define=="function"&&define.amd,x=!c.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",R="0123456789abcdef".split(""),S=[31,7936,2031616,520093696],O=[4,1024,262144,67108864],M=[1,256,65536,16777216],k=[6,1536,393216,100663296],q=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],F=[224,256,384,512],G=[128,256],ue=["hex","buffer","arrayBuffer","array","digest"],le={128:168,256:136};(c.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(ge){return Object.prototype.toString.call(ge)==="[object Array]"}),x&&(c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(ge){return typeof ge=="object"&&ge.buffer&&ge.buffer.constructor===ArrayBuffer});for(var X=function(ge,be,we){return function(Ee){return new Q(ge,be,ge).update(Ee)[we]()}},se=function(ge,be,we){return function(Ee,me){return new Q(ge,be,me).update(Ee)[we]()}},de=function(ge,be,we){return function(Ee,me,Ke,He){return N["cshake"+ge].update(Ee,me,Ke,He)[we]()}},ye=function(ge,be,we){return function(Ee,me,Ke,He){return N["kmac"+ge].update(Ee,me,Ke,He)[we]()}},he=function(ge,be,we,Ee){for(var me=0;me<ue.length;++me){var Ke=ue[me];ge[Ke]=be(we,Ee,Ke)}return ge},K=function(ge,be){var we=X(ge,be,"hex");return we.create=function(){return new Q(ge,be,ge)},we.update=function(Ee){return we.create().update(Ee)},he(we,X,ge,be)},B=function(ge,be){var we=se(ge,be,"hex");return we.create=function(Ee){return new Q(ge,be,Ee)},we.update=function(Ee,me){return we.create(me).update(Ee)},he(we,se,ge,be)},L=function(ge,be){var we=le[ge],Ee=de(ge,be,"hex");return Ee.create=function(me,Ke,He){return!Ke&&!He?N["shake"+ge].create(me):new Q(ge,be,me).bytepad([Ke,He],we)},Ee.update=function(me,Ke,He,Ie){return Ee.create(Ke,He,Ie).update(me)},he(Ee,de,ge,be)},$=function(ge,be){var we=le[ge],Ee=ye(ge,be,"hex");return Ee.create=function(me,Ke,He){return new oe(ge,be,Ke).bytepad(["KMAC",He],we).bytepad([me],we)},Ee.update=function(me,Ke,He,Ie){return Ee.create(me,He,Ie).update(Ke)},he(Ee,ye,ge,be)},T=[{name:"keccak",padding:M,bits:F,createMethod:K},{name:"sha3",padding:k,bits:F,createMethod:K},{name:"shake",padding:S,bits:G,createMethod:B},{name:"cshake",padding:O,bits:G,createMethod:L},{name:"kmac",padding:O,bits:G,createMethod:$}],N={},j=[],Y=0;Y<T.length;++Y)for(var Z=T[Y],z=Z.bits,fe=0;fe<z.length;++fe){var te=Z.name+"_"+z[fe];if(j.push(te),N[te]=Z.createMethod(z[fe],Z.padding),Z.name!=="sha3"){var H=Z.name+z[fe];j.push(H),N[H]=N[te]}}function Q(ge,be,we){this.blocks=[],this.s=[],this.padding=be,this.outputBits=we,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(ge<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=we>>5,this.extraBytes=(we&31)>>3;for(var Ee=0;Ee<50;++Ee)this.s[Ee]=0}Q.prototype.update=function(ge){if(this.finalized)throw new Error(E);var be,we=typeof ge;if(we!=="string"){if(we==="object"){if(ge===null)throw new Error(w);if(x&&ge.constructor===ArrayBuffer)ge=new Uint8Array(ge);else if(!Array.isArray(ge)&&(!x||!ArrayBuffer.isView(ge)))throw new Error(w)}else throw new Error(w);be=!0}for(var Ee=this.blocks,me=this.byteCount,Ke=ge.length,He=this.blockCount,Ie=0,Le=this.s,Ge,Be;Ie<Ke;){if(this.reset)for(this.reset=!1,Ee[0]=this.block,Ge=1;Ge<He+1;++Ge)Ee[Ge]=0;if(be)for(Ge=this.start;Ie<Ke&&Ge<me;++Ie)Ee[Ge>>2]|=ge[Ie]<<q[Ge++&3];else for(Ge=this.start;Ie<Ke&&Ge<me;++Ie)Be=ge.charCodeAt(Ie),Be<128?Ee[Ge>>2]|=Be<<q[Ge++&3]:Be<2048?(Ee[Ge>>2]|=(192|Be>>6)<<q[Ge++&3],Ee[Ge>>2]|=(128|Be&63)<<q[Ge++&3]):Be<55296||Be>=57344?(Ee[Ge>>2]|=(224|Be>>12)<<q[Ge++&3],Ee[Ge>>2]|=(128|Be>>6&63)<<q[Ge++&3],Ee[Ge>>2]|=(128|Be&63)<<q[Ge++&3]):(Be=65536+((Be&1023)<<10|ge.charCodeAt(++Ie)&1023),Ee[Ge>>2]|=(240|Be>>18)<<q[Ge++&3],Ee[Ge>>2]|=(128|Be>>12&63)<<q[Ge++&3],Ee[Ge>>2]|=(128|Be>>6&63)<<q[Ge++&3],Ee[Ge>>2]|=(128|Be&63)<<q[Ge++&3]);if(this.lastByteIndex=Ge,Ge>=me){for(this.start=Ge-me,this.block=Ee[He],Ge=0;Ge<He;++Ge)Le[Ge]^=Ee[Ge];_e(Le),this.reset=!0}else this.start=Ge}return this},Q.prototype.encode=function(ge,be){var we=ge&255,Ee=1,me=[we];for(ge=ge>>8,we=ge&255;we>0;)me.unshift(we),ge=ge>>8,we=ge&255,++Ee;return be?me.push(Ee):me.unshift(Ee),this.update(me),me.length},Q.prototype.encodeString=function(ge){var be,we=typeof ge;if(we!=="string"){if(we==="object"){if(ge===null)throw new Error(w);if(x&&ge.constructor===ArrayBuffer)ge=new Uint8Array(ge);else if(!Array.isArray(ge)&&(!x||!ArrayBuffer.isView(ge)))throw new Error(w)}else throw new Error(w);be=!0}var Ee=0,me=ge.length;if(be)Ee=me;else for(var Ke=0;Ke<ge.length;++Ke){var He=ge.charCodeAt(Ke);He<128?Ee+=1:He<2048?Ee+=2:He<55296||He>=57344?Ee+=3:(He=65536+((He&1023)<<10|ge.charCodeAt(++Ke)&1023),Ee+=4)}return Ee+=this.encode(Ee*8),this.update(ge),Ee},Q.prototype.bytepad=function(ge,be){for(var we=this.encode(be),Ee=0;Ee<ge.length;++Ee)we+=this.encodeString(ge[Ee]);var me=be-we%be,Ke=[];return Ke.length=me,this.update(Ke),this},Q.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var ge=this.blocks,be=this.lastByteIndex,we=this.blockCount,Ee=this.s;if(ge[be>>2]|=this.padding[be&3],this.lastByteIndex===this.byteCount)for(ge[0]=ge[we],be=1;be<we+1;++be)ge[be]=0;for(ge[we-1]|=2147483648,be=0;be<we;++be)Ee[be]^=ge[be];_e(Ee)}},Q.prototype.toString=Q.prototype.hex=function(){this.finalize();for(var ge=this.blockCount,be=this.s,we=this.outputBlocks,Ee=this.extraBytes,me=0,Ke=0,He="",Ie;Ke<we;){for(me=0;me<ge&&Ke<we;++me,++Ke)Ie=be[me],He+=R[Ie>>4&15]+R[Ie&15]+R[Ie>>12&15]+R[Ie>>8&15]+R[Ie>>20&15]+R[Ie>>16&15]+R[Ie>>28&15]+R[Ie>>24&15];Ke%ge===0&&(_e(be),me=0)}return Ee&&(Ie=be[me],He+=R[Ie>>4&15]+R[Ie&15],Ee>1&&(He+=R[Ie>>12&15]+R[Ie>>8&15]),Ee>2&&(He+=R[Ie>>20&15]+R[Ie>>16&15])),He},Q.prototype.arrayBuffer=function(){this.finalize();var ge=this.blockCount,be=this.s,we=this.outputBlocks,Ee=this.extraBytes,me=0,Ke=0,He=this.outputBits>>3,Ie;Ee?Ie=new ArrayBuffer(we+1<<2):Ie=new ArrayBuffer(He);for(var Le=new Uint32Array(Ie);Ke<we;){for(me=0;me<ge&&Ke<we;++me,++Ke)Le[Ke]=be[me];Ke%ge===0&&_e(be)}return Ee&&(Le[me]=be[me],Ie=Ie.slice(0,He)),Ie},Q.prototype.buffer=Q.prototype.arrayBuffer,Q.prototype.digest=Q.prototype.array=function(){this.finalize();for(var ge=this.blockCount,be=this.s,we=this.outputBlocks,Ee=this.extraBytes,me=0,Ke=0,He=[],Ie,Le;Ke<we;){for(me=0;me<ge&&Ke<we;++me,++Ke)Ie=Ke<<2,Le=be[me],He[Ie]=Le&255,He[Ie+1]=Le>>8&255,He[Ie+2]=Le>>16&255,He[Ie+3]=Le>>24&255;Ke%ge===0&&_e(be)}return Ee&&(Ie=Ke<<2,Le=be[me],He[Ie]=Le&255,Ee>1&&(He[Ie+1]=Le>>8&255),Ee>2&&(He[Ie+2]=Le>>16&255)),He};function oe(ge,be,we){Q.call(this,ge,be,we)}oe.prototype=new Q,oe.prototype.finalize=function(){return this.encode(this.outputBits,!0),Q.prototype.finalize.call(this)};var _e=function(ge){var be,we,Ee,me,Ke,He,Ie,Le,Ge,Be,We,Ze,_t,Ft,gt,lt,dt,tt,rt,ke,xe,Pe,it,Xe,st,It,ft,Jt,Ot,Ct,qe,Yt,ot,Ae,Rt,Ht,bt,Mt,tr,Vt,Et,Ye,Tt,Wt,dr,at,wt,At,Je,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,rn,_r,pn,$t,In;for(Ee=0;Ee<48;Ee+=2)me=ge[0]^ge[10]^ge[20]^ge[30]^ge[40],Ke=ge[1]^ge[11]^ge[21]^ge[31]^ge[41],He=ge[2]^ge[12]^ge[22]^ge[32]^ge[42],Ie=ge[3]^ge[13]^ge[23]^ge[33]^ge[43],Le=ge[4]^ge[14]^ge[24]^ge[34]^ge[44],Ge=ge[5]^ge[15]^ge[25]^ge[35]^ge[45],Be=ge[6]^ge[16]^ge[26]^ge[36]^ge[46],We=ge[7]^ge[17]^ge[27]^ge[37]^ge[47],Ze=ge[8]^ge[18]^ge[28]^ge[38]^ge[48],_t=ge[9]^ge[19]^ge[29]^ge[39]^ge[49],be=Ze^(He<<1|Ie>>>31),we=_t^(Ie<<1|He>>>31),ge[0]^=be,ge[1]^=we,ge[10]^=be,ge[11]^=we,ge[20]^=be,ge[21]^=we,ge[30]^=be,ge[31]^=we,ge[40]^=be,ge[41]^=we,be=me^(Le<<1|Ge>>>31),we=Ke^(Ge<<1|Le>>>31),ge[2]^=be,ge[3]^=we,ge[12]^=be,ge[13]^=we,ge[22]^=be,ge[23]^=we,ge[32]^=be,ge[33]^=we,ge[42]^=be,ge[43]^=we,be=He^(Be<<1|We>>>31),we=Ie^(We<<1|Be>>>31),ge[4]^=be,ge[5]^=we,ge[14]^=be,ge[15]^=we,ge[24]^=be,ge[25]^=we,ge[34]^=be,ge[35]^=we,ge[44]^=be,ge[45]^=we,be=Le^(Ze<<1|_t>>>31),we=Ge^(_t<<1|Ze>>>31),ge[6]^=be,ge[7]^=we,ge[16]^=be,ge[17]^=we,ge[26]^=be,ge[27]^=we,ge[36]^=be,ge[37]^=we,ge[46]^=be,ge[47]^=we,be=Be^(me<<1|Ke>>>31),we=We^(Ke<<1|me>>>31),ge[8]^=be,ge[9]^=we,ge[18]^=be,ge[19]^=we,ge[28]^=be,ge[29]^=we,ge[38]^=be,ge[39]^=we,ge[48]^=be,ge[49]^=we,Ft=ge[0],gt=ge[1],at=ge[11]<<4|ge[10]>>>28,wt=ge[10]<<4|ge[11]>>>28,Jt=ge[20]<<3|ge[21]>>>29,Ot=ge[21]<<3|ge[20]>>>29,_r=ge[31]<<9|ge[30]>>>23,pn=ge[30]<<9|ge[31]>>>23,Ye=ge[40]<<18|ge[41]>>>14,Tt=ge[41]<<18|ge[40]>>>14,Ae=ge[2]<<1|ge[3]>>>31,Rt=ge[3]<<1|ge[2]>>>31,lt=ge[13]<<12|ge[12]>>>20,dt=ge[12]<<12|ge[13]>>>20,At=ge[22]<<10|ge[23]>>>22,Je=ge[23]<<10|ge[22]>>>22,Ct=ge[33]<<13|ge[32]>>>19,qe=ge[32]<<13|ge[33]>>>19,$t=ge[42]<<2|ge[43]>>>30,In=ge[43]<<2|ge[42]>>>30,kr=ge[5]<<30|ge[4]>>>2,Jr=ge[4]<<30|ge[5]>>>2,Ht=ge[14]<<6|ge[15]>>>26,bt=ge[15]<<6|ge[14]>>>26,tt=ge[25]<<11|ge[24]>>>21,rt=ge[24]<<11|ge[25]>>>21,Lt=ge[34]<<15|ge[35]>>>17,sr=ge[35]<<15|ge[34]>>>17,Yt=ge[45]<<29|ge[44]>>>3,ot=ge[44]<<29|ge[45]>>>3,Xe=ge[6]<<28|ge[7]>>>4,st=ge[7]<<28|ge[6]>>>4,hr=ge[17]<<23|ge[16]>>>9,$r=ge[16]<<23|ge[17]>>>9,Mt=ge[26]<<25|ge[27]>>>7,tr=ge[27]<<25|ge[26]>>>7,ke=ge[36]<<21|ge[37]>>>11,xe=ge[37]<<21|ge[36]>>>11,ur=ge[47]<<24|ge[46]>>>8,vr=ge[46]<<24|ge[47]>>>8,Wt=ge[8]<<27|ge[9]>>>5,dr=ge[9]<<27|ge[8]>>>5,It=ge[18]<<20|ge[19]>>>12,ft=ge[19]<<20|ge[18]>>>12,Hr=ge[29]<<7|ge[28]>>>25,rn=ge[28]<<7|ge[29]>>>25,Vt=ge[38]<<8|ge[39]>>>24,Et=ge[39]<<8|ge[38]>>>24,Pe=ge[48]<<14|ge[49]>>>18,it=ge[49]<<14|ge[48]>>>18,ge[0]=Ft^~lt&tt,ge[1]=gt^~dt&rt,ge[10]=Xe^~It&Jt,ge[11]=st^~ft&Ot,ge[20]=Ae^~Ht&Mt,ge[21]=Rt^~bt&tr,ge[30]=Wt^~at&At,ge[31]=dr^~wt&Je,ge[40]=kr^~hr&Hr,ge[41]=Jr^~$r&rn,ge[2]=lt^~tt&ke,ge[3]=dt^~rt&xe,ge[12]=It^~Jt&Ct,ge[13]=ft^~Ot&qe,ge[22]=Ht^~Mt&Vt,ge[23]=bt^~tr&Et,ge[32]=at^~At&Lt,ge[33]=wt^~Je&sr,ge[42]=hr^~Hr&_r,ge[43]=$r^~rn&pn,ge[4]=tt^~ke&Pe,ge[5]=rt^~xe&it,ge[14]=Jt^~Ct&Yt,ge[15]=Ot^~qe&ot,ge[24]=Mt^~Vt&Ye,ge[25]=tr^~Et&Tt,ge[34]=At^~Lt&ur,ge[35]=Je^~sr&vr,ge[44]=Hr^~_r&$t,ge[45]=rn^~pn&In,ge[6]=ke^~Pe&Ft,ge[7]=xe^~it>,ge[16]=Ct^~Yt&Xe,ge[17]=qe^~ot&st,ge[26]=Vt^~Ye&Ae,ge[27]=Et^~Tt&Rt,ge[36]=Lt^~ur&Wt,ge[37]=sr^~vr&dr,ge[46]=_r^~$t&kr,ge[47]=pn^~In&Jr,ge[8]=Pe^~Ft<,ge[9]=it^~gt&dt,ge[18]=Yt^~Xe&It,ge[19]=ot^~st&ft,ge[28]=Ye^~Ae&Ht,ge[29]=Tt^~Rt&bt,ge[38]=ur^~Wt&at,ge[39]=vr^~dr&wt,ge[48]=$t^~kr&hr,ge[49]=In^~Jr&$r,ge[0]^=b[Ee],ge[1]^=b[Ee+1]};if(m)ie.exports=N;else{for(Y=0;Y<j.length;++Y)c[j[Y]]=N[j[Y]];C&&define(function(){return N})}})()},77308:function(ie){(function(f,_){ie.exports=_()})(this,function(){"use strict";var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function _(gt,lt,dt,tt){var rt,ke,xe,Pe=lt||[0],it=(dt=dt||0)>>>3,Xe=tt===-1?3:0;for(rt=0;rt<gt.length;rt+=1)ke=(xe=rt+it)>>>2,Pe.length<=ke&&Pe.push(0),Pe[ke]|=gt[rt]<<8*(Xe+tt*(xe%4));return{value:Pe,binLen:8*gt.length+dt}}function h(gt,lt,dt){switch(lt){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(gt){case"HEX":return function(tt,rt,ke){return function(xe,Pe,it,Xe){var st,It,ft,Jt;if(xe.length%2!=0)throw new Error("String of HEX type must be in byte increments");var Ot=Pe||[0],Ct=(it=it||0)>>>3,qe=Xe===-1?3:0;for(st=0;st<xe.length;st+=2){if(It=parseInt(xe.substr(st,2),16),isNaN(It))throw new Error("String of HEX type contains invalid characters");for(ft=(Jt=(st>>>1)+Ct)>>>2;Ot.length<=ft;)Ot.push(0);Ot[ft]|=It<<8*(qe+Xe*(Jt%4))}return{value:Ot,binLen:4*xe.length+it}}(tt,rt,ke,dt)};case"TEXT":return function(tt,rt,ke){return function(xe,Pe,it,Xe,st){var It,ft,Jt,Ot,Ct,qe,Yt,ot,Ae=0,Rt=it||[0],Ht=(Xe=Xe||0)>>>3;if(Pe==="UTF8")for(Yt=st===-1?3:0,Jt=0;Jt<xe.length;Jt+=1)for(ft=[],128>(It=xe.charCodeAt(Jt))?ft.push(It):2048>It?(ft.push(192|It>>>6),ft.push(128|63&It)):55296>It||57344<=It?ft.push(224|It>>>12,128|It>>>6&63,128|63&It):(Jt+=1,It=65536+((1023&It)<<10|1023&xe.charCodeAt(Jt)),ft.push(240|It>>>18,128|It>>>12&63,128|It>>>6&63,128|63&It)),Ot=0;Ot<ft.length;Ot+=1){for(Ct=(qe=Ae+Ht)>>>2;Rt.length<=Ct;)Rt.push(0);Rt[Ct]|=ft[Ot]<<8*(Yt+st*(qe%4)),Ae+=1}else for(Yt=st===-1?2:0,ot=Pe==="UTF16LE"&&st!==1||Pe!=="UTF16LE"&&st===1,Jt=0;Jt<xe.length;Jt+=1){for(It=xe.charCodeAt(Jt),ot===!0&&(It=(Ot=255&It)<<8|It>>>8),Ct=(qe=Ae+Ht)>>>2;Rt.length<=Ct;)Rt.push(0);Rt[Ct]|=It<<8*(Yt+st*(qe%4)),Ae+=2}return{value:Rt,binLen:8*Ae+Xe}}(tt,lt,rt,ke,dt)};case"B64":return function(tt,rt,ke){return function(xe,Pe,it,Xe){var st,It,ft,Jt,Ot,Ct,qe=0,Yt=Pe||[0],ot=(it=it||0)>>>3,Ae=Xe===-1?3:0,Rt=xe.indexOf("=");if(xe.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(xe=xe.replace(/=/g,""),Rt!==-1&&Rt<xe.length)throw new Error("Invalid '=' found in base-64 string");for(st=0;st<xe.length;st+=4){for(Jt=xe.substr(st,4),ft=0,It=0;It<Jt.length;It+=1)ft|=f.indexOf(Jt.charAt(It))<<18-6*It;for(It=0;It<Jt.length-1;It+=1){for(Ot=(Ct=qe+ot)>>>2;Yt.length<=Ot;)Yt.push(0);Yt[Ot]|=(ft>>>16-8*It&255)<<8*(Ae+Xe*(Ct%4)),qe+=1}}return{value:Yt,binLen:8*qe+it}}(tt,rt,ke,dt)};case"BYTES":return function(tt,rt,ke){return function(xe,Pe,it,Xe){var st,It,ft,Jt,Ot=Pe||[0],Ct=(it=it||0)>>>3,qe=Xe===-1?3:0;for(It=0;It<xe.length;It+=1)st=xe.charCodeAt(It),ft=(Jt=It+Ct)>>>2,Ot.length<=ft&&Ot.push(0),Ot[ft]|=st<<8*(qe+Xe*(Jt%4));return{value:Ot,binLen:8*xe.length+it}}(tt,rt,ke,dt)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(tt,rt,ke){return function(xe,Pe,it,Xe){return _(new Uint8Array(xe),Pe,it,Xe)}(tt,rt,ke,dt)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(tt,rt,ke){return _(tt,rt,ke,dt)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function w(gt,lt,dt,tt){switch(gt){case"HEX":return function(rt){return function(ke,xe,Pe,it){var Xe,st,It="",ft=xe/8,Jt=Pe===-1?3:0;for(Xe=0;Xe<ft;Xe+=1)st=ke[Xe>>>2]>>>8*(Jt+Pe*(Xe%4)),It+="0123456789abcdef".charAt(st>>>4&15)+"0123456789abcdef".charAt(15&st);return it.outputUpper?It.toUpperCase():It}(rt,lt,dt,tt)};case"B64":return function(rt){return function(ke,xe,Pe,it){var Xe,st,It,ft,Jt,Ot="",Ct=xe/8,qe=Pe===-1?3:0;for(Xe=0;Xe<Ct;Xe+=3)for(ft=Xe+1<Ct?ke[Xe+1>>>2]:0,Jt=Xe+2<Ct?ke[Xe+2>>>2]:0,It=(ke[Xe>>>2]>>>8*(qe+Pe*(Xe%4))&255)<<16|(ft>>>8*(qe+Pe*((Xe+1)%4))&255)<<8|Jt>>>8*(qe+Pe*((Xe+2)%4))&255,st=0;st<4;st+=1)Ot+=8*Xe+6*st<=xe?f.charAt(It>>>6*(3-st)&63):it.b64Pad;return Ot}(rt,lt,dt,tt)};case"BYTES":return function(rt){return function(ke,xe,Pe){var it,Xe,st="",It=xe/8,ft=Pe===-1?3:0;for(it=0;it<It;it+=1)Xe=ke[it>>>2]>>>8*(ft+Pe*(it%4))&255,st+=String.fromCharCode(Xe);return st}(rt,lt,dt)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(rt){return function(ke,xe,Pe){var it,Xe=xe/8,st=new ArrayBuffer(Xe),It=new Uint8Array(st),ft=Pe===-1?3:0;for(it=0;it<Xe;it+=1)It[it]=ke[it>>>2]>>>8*(ft+Pe*(it%4))&255;return st}(rt,lt,dt)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(rt){return function(ke,xe,Pe){var it,Xe=xe/8,st=Pe===-1?3:0,It=new Uint8Array(Xe);for(it=0;it<Xe;it+=1)It[it]=ke[it>>>2]>>>8*(st+Pe*(it%4))&255;return It}(rt,lt,dt)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var E=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],v=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],c=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],d="Chosen SHA variant is not supported";function p(gt,lt){var dt,tt,rt=gt.binLen>>>3,ke=lt.binLen>>>3,xe=rt<<3,Pe=4-rt<<3;if(rt%4!=0){for(dt=0;dt<ke;dt+=4)tt=rt+dt>>>2,gt.value[tt]|=lt.value[dt>>>2]<<xe,gt.value.push(0),gt.value[tt+1]|=lt.value[dt>>>2]>>>Pe;return(gt.value.length<<2)-4>=ke+rt&>.value.pop(),{value:gt.value,binLen:gt.binLen+lt.binLen}}return{value:gt.value.concat(lt.value),binLen:gt.binLen+lt.binLen}}function m(gt){var lt={outputUpper:!1,b64Pad:"=",outputLen:-1},dt=gt||{},tt="Output length must be a multiple of 8";if(lt.outputUpper=dt.outputUpper||!1,dt.b64Pad&&(lt.b64Pad=dt.b64Pad),dt.outputLen){if(dt.outputLen%8!=0)throw new Error(tt);lt.outputLen=dt.outputLen}else if(dt.shakeLen){if(dt.shakeLen%8!=0)throw new Error(tt);lt.outputLen=dt.shakeLen}if(typeof lt.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof lt.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return lt}function C(gt,lt,dt,tt){var rt=gt+" must include a value and format";if(!lt){if(!tt)throw new Error(rt);return tt}if(lt.value===void 0||!lt.format)throw new Error(rt);return h(lt.format,lt.encoding||"UTF8",dt)(lt.value)}var x=function(){function gt(lt,dt,tt){var rt=tt||{};if(this.t=dt,this.i=rt.encoding||"UTF8",this.numRounds=rt.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=lt,this.u=[],this.s=0,this.h=!1,this.v=0,this.A=!1,this.l=[],this.H=[]}return gt.prototype.update=function(lt){var dt,tt=0,rt=this.S>>>5,ke=this.p(lt,this.u,this.s),xe=ke.binLen,Pe=ke.value,it=xe>>>5;for(dt=0;dt<it;dt+=rt)tt+this.S<=xe&&(this.m=this.R(Pe.slice(dt,dt+rt),this.m),tt+=this.S);this.v+=tt,this.u=Pe.slice(tt>>>5),this.s=xe%this.S,this.h=!0},gt.prototype.getHash=function(lt,dt){var tt,rt,ke=this.U,xe=m(dt);if(this.T){if(xe.outputLen===-1)throw new Error("Output length must be specified in options");ke=xe.outputLen}var Pe=w(lt,ke,this.C,xe);if(this.A&&this.F)return Pe(this.F(xe));for(rt=this.K(this.u.slice(),this.s,this.v,this.B(this.m),ke),tt=1;tt<this.numRounds;tt+=1)this.T&&ke%32!=0&&(rt[rt.length-1]&=16777215>>>24-ke%32),rt=this.K(rt,ke,0,this.L(this.o),ke);return Pe(rt)},gt.prototype.setHMACKey=function(lt,dt,tt){if(!this.g)throw new Error("Variant does not support HMAC");if(this.h)throw new Error("Cannot set MAC key after calling update");var rt=h(dt,(tt||{}).encoding||"UTF8",this.C);this.k(rt(lt))},gt.prototype.k=function(lt){var dt,tt=this.S>>>3,rt=tt/4-1;if(this.numRounds!==1)throw new Error("Cannot set numRounds with MAC");if(this.A)throw new Error("MAC key already set");for(tt<lt.binLen/8&&(lt.value=this.K(lt.value,lt.binLen,0,this.L(this.o),this.U));lt.value.length<=rt;)lt.value.push(0);for(dt=0;dt<=rt;dt+=1)this.l[dt]=909522486^lt.value[dt],this.H[dt]=1549556828^lt.value[dt];this.m=this.R(this.l,this.m),this.v=this.S,this.A=!0},gt.prototype.getHMAC=function(lt,dt){var tt=m(dt);return w(lt,this.U,this.C,tt)(this.Y())},gt.prototype.Y=function(){var lt;if(!this.A)throw new Error("Cannot call getHMAC without first setting MAC key");var dt=this.K(this.u.slice(),this.s,this.v,this.B(this.m),this.U);return lt=this.R(this.H,this.L(this.o)),lt=this.K(dt,this.U,this.S,lt,this.U)},gt}(),R=function(gt,lt){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(dt,tt){dt.__proto__=tt}||function(dt,tt){for(var rt in tt)Object.prototype.hasOwnProperty.call(tt,rt)&&(dt[rt]=tt[rt])})(gt,lt)};function S(gt,lt){function dt(){this.constructor=gt}R(gt,lt),gt.prototype=lt===null?Object.create(lt):(dt.prototype=lt.prototype,new dt)}function O(gt,lt){return gt<<lt|gt>>>32-lt}function M(gt,lt){return gt>>>lt|gt<<32-lt}function k(gt,lt){return gt>>>lt}function q(gt,lt,dt){return gt^lt^dt}function b(gt,lt,dt){return gt<^~gt&dt}function F(gt,lt,dt){return gt<^gt&dt^lt&dt}function G(gt){return M(gt,2)^M(gt,13)^M(gt,22)}function ue(gt,lt){var dt=(65535>)+(65535<);return(65535&(gt>>>16)+(lt>>>16)+(dt>>>16))<<16|65535&dt}function le(gt,lt,dt,tt){var rt=(65535>)+(65535<)+(65535&dt)+(65535&tt);return(65535&(gt>>>16)+(lt>>>16)+(dt>>>16)+(tt>>>16)+(rt>>>16))<<16|65535&rt}function X(gt,lt,dt,tt,rt){var ke=(65535>)+(65535<)+(65535&dt)+(65535&tt)+(65535&rt);return(65535&(gt>>>16)+(lt>>>16)+(dt>>>16)+(tt>>>16)+(rt>>>16)+(ke>>>16))<<16|65535&ke}function se(gt){return M(gt,7)^M(gt,18)^k(gt,3)}function de(gt){return M(gt,6)^M(gt,11)^M(gt,25)}function ye(gt){return[1732584193,4023233417,2562383102,271733878,3285377520]}function he(gt,lt){var dt,tt,rt,ke,xe,Pe,it,Xe=[];for(dt=lt[0],tt=lt[1],rt=lt[2],ke=lt[3],xe=lt[4],it=0;it<80;it+=1)Xe[it]=it<16?gt[it]:O(Xe[it-3]^Xe[it-8]^Xe[it-14]^Xe[it-16],1),Pe=it<20?X(O(dt,5),b(tt,rt,ke),xe,1518500249,Xe[it]):it<40?X(O(dt,5),q(tt,rt,ke),xe,1859775393,Xe[it]):it<60?X(O(dt,5),F(tt,rt,ke),xe,2400959708,Xe[it]):X(O(dt,5),q(tt,rt,ke),xe,3395469782,Xe[it]),xe=ke,ke=rt,rt=O(tt,30),tt=dt,dt=Pe;return lt[0]=ue(dt,lt[0]),lt[1]=ue(tt,lt[1]),lt[2]=ue(rt,lt[2]),lt[3]=ue(ke,lt[3]),lt[4]=ue(xe,lt[4]),lt}function K(gt,lt,dt,tt){for(var rt,ke=15+(lt+65>>>9<<4),xe=lt+dt;gt.length<=ke;)gt.push(0);for(gt[lt>>>5]|=128<<24-lt%32,gt[ke]=4294967295&xe,gt[ke-1]=xe/4294967296|0,rt=0;rt<gt.length;rt+=16)tt=he(gt.slice(rt,rt+16),tt);return tt}var B=function(gt){function lt(dt,tt,rt){var ke=this;if(dt!=="SHA-1")throw new Error(d);var xe=rt||{};return(ke=gt.call(this,dt,tt,rt)||this).g=!0,ke.F=ke.Y,ke.C=-1,ke.p=h(ke.t,ke.i,ke.C),ke.R=he,ke.B=function(Pe){return Pe.slice()},ke.L=ye,ke.K=K,ke.m=[1732584193,4023233417,2562383102,271733878,3285377520],ke.S=512,ke.U=160,ke.T=!1,xe.hmacKey&&ke.k(C("hmacKey",xe.hmacKey,ke.C)),ke}return S(lt,gt),lt}(x);function L(gt){return gt=="SHA-224"?v.slice():c.slice()}function $(gt,lt){var dt,tt,rt,ke,xe,Pe,it,Xe,st,It,ft,Jt,Ot=[];for(dt=lt[0],tt=lt[1],rt=lt[2],ke=lt[3],xe=lt[4],Pe=lt[5],it=lt[6],Xe=lt[7],ft=0;ft<64;ft+=1)Ot[ft]=ft<16?gt[ft]:le(M(Jt=Ot[ft-2],17)^M(Jt,19)^k(Jt,10),Ot[ft-7],se(Ot[ft-15]),Ot[ft-16]),st=X(Xe,de(xe),b(xe,Pe,it),E[ft],Ot[ft]),It=ue(G(dt),F(dt,tt,rt)),Xe=it,it=Pe,Pe=xe,xe=ue(ke,st),ke=rt,rt=tt,tt=dt,dt=ue(st,It);return lt[0]=ue(dt,lt[0]),lt[1]=ue(tt,lt[1]),lt[2]=ue(rt,lt[2]),lt[3]=ue(ke,lt[3]),lt[4]=ue(xe,lt[4]),lt[5]=ue(Pe,lt[5]),lt[6]=ue(it,lt[6]),lt[7]=ue(Xe,lt[7]),lt}var T=function(gt){function lt(dt,tt,rt){var ke=this;if(dt!=="SHA-224"&&dt!=="SHA-256")throw new Error(d);var xe=rt||{};return(ke=gt.call(this,dt,tt,rt)||this).F=ke.Y,ke.g=!0,ke.C=-1,ke.p=h(ke.t,ke.i,ke.C),ke.R=$,ke.B=function(Pe){return Pe.slice()},ke.L=L,ke.K=function(Pe,it,Xe,st){return function(It,ft,Jt,Ot,Ct){for(var qe,Yt=15+(ft+65>>>9<<4),ot=ft+Jt;It.length<=Yt;)It.push(0);for(It[ft>>>5]|=128<<24-ft%32,It[Yt]=4294967295&ot,It[Yt-1]=ot/4294967296|0,qe=0;qe<It.length;qe+=16)Ot=$(It.slice(qe,qe+16),Ot);return Ct==="SHA-224"?[Ot[0],Ot[1],Ot[2],Ot[3],Ot[4],Ot[5],Ot[6]]:Ot}(Pe,it,Xe,st,dt)},ke.m=L(dt),ke.S=512,ke.U=dt==="SHA-224"?224:256,ke.T=!1,xe.hmacKey&&ke.k(C("hmacKey",xe.hmacKey,ke.C)),ke}return S(lt,gt),lt}(x),N=function(gt,lt){this.N=gt,this.I=lt};function j(gt,lt){var dt;return lt>32?(dt=64-lt,new N(gt.I<<lt|gt.N>>>dt,gt.N<<lt|gt.I>>>dt)):lt!==0?(dt=32-lt,new N(gt.N<<lt|gt.I>>>dt,gt.I<<lt|gt.N>>>dt)):gt}function Y(gt,lt){var dt;return lt<32?(dt=32-lt,new N(gt.N>>>lt|gt.I<<dt,gt.I>>>lt|gt.N<<dt)):(dt=64-lt,new N(gt.I>>>lt|gt.N<<dt,gt.N>>>lt|gt.I<<dt))}function Z(gt,lt){return new N(gt.N>>>lt,gt.I>>>lt|gt.N<<32-lt)}function z(gt,lt,dt){return new N(gt.N<.N^~gt.N&dt.N,gt.I<.I^~gt.I&dt.I)}function fe(gt,lt,dt){return new N(gt.N<.N^gt.N&dt.N^lt.N&dt.N,gt.I<.I^gt.I&dt.I^lt.I&dt.I)}function te(gt){var lt=Y(gt,28),dt=Y(gt,34),tt=Y(gt,39);return new N(lt.N^dt.N^tt.N,lt.I^dt.I^tt.I)}function H(gt,lt){var dt,tt;dt=(65535>.I)+(65535<.I);var rt=(65535&(tt=(gt.I>>>16)+(lt.I>>>16)+(dt>>>16)))<<16|65535&dt;return dt=(65535>.N)+(65535<.N)+(tt>>>16),tt=(gt.N>>>16)+(lt.N>>>16)+(dt>>>16),new N((65535&tt)<<16|65535&dt,rt)}function Q(gt,lt,dt,tt){var rt,ke;rt=(65535>.I)+(65535<.I)+(65535&dt.I)+(65535&tt.I);var xe=(65535&(ke=(gt.I>>>16)+(lt.I>>>16)+(dt.I>>>16)+(tt.I>>>16)+(rt>>>16)))<<16|65535&rt;return rt=(65535>.N)+(65535<.N)+(65535&dt.N)+(65535&tt.N)+(ke>>>16),ke=(gt.N>>>16)+(lt.N>>>16)+(dt.N>>>16)+(tt.N>>>16)+(rt>>>16),new N((65535&ke)<<16|65535&rt,xe)}function oe(gt,lt,dt,tt,rt){var ke,xe;ke=(65535>.I)+(65535<.I)+(65535&dt.I)+(65535&tt.I)+(65535&rt.I);var Pe=(65535&(xe=(gt.I>>>16)+(lt.I>>>16)+(dt.I>>>16)+(tt.I>>>16)+(rt.I>>>16)+(ke>>>16)))<<16|65535&ke;return ke=(65535>.N)+(65535<.N)+(65535&dt.N)+(65535&tt.N)+(65535&rt.N)+(xe>>>16),xe=(gt.N>>>16)+(lt.N>>>16)+(dt.N>>>16)+(tt.N>>>16)+(rt.N>>>16)+(ke>>>16),new N((65535&xe)<<16|65535&ke,Pe)}function _e(gt,lt){return new N(gt.N^lt.N,gt.I^lt.I)}function ge(gt){var lt=Y(gt,1),dt=Y(gt,8),tt=Z(gt,7);return new N(lt.N^dt.N^tt.N,lt.I^dt.I^tt.I)}function be(gt){var lt=Y(gt,14),dt=Y(gt,18),tt=Y(gt,41);return new N(lt.N^dt.N^tt.N,lt.I^dt.I^tt.I)}var we=[new N(E[0],3609767458),new N(E[1],602891725),new N(E[2],3964484399),new N(E[3],2173295548),new N(E[4],4081628472),new N(E[5],3053834265),new N(E[6],2937671579),new N(E[7],3664609560),new N(E[8],2734883394),new N(E[9],1164996542),new N(E[10],1323610764),new N(E[11],3590304994),new N(E[12],4068182383),new N(E[13],991336113),new N(E[14],633803317),new N(E[15],3479774868),new N(E[16],2666613458),new N(E[17],944711139),new N(E[18],2341262773),new N(E[19],2007800933),new N(E[20],1495990901),new N(E[21],1856431235),new N(E[22],3175218132),new N(E[23],2198950837),new N(E[24],3999719339),new N(E[25],766784016),new N(E[26],2566594879),new N(E[27],3203337956),new N(E[28],1034457026),new N(E[29],2466948901),new N(E[30],3758326383),new N(E[31],168717936),new N(E[32],1188179964),new N(E[33],1546045734),new N(E[34],1522805485),new N(E[35],2643833823),new N(E[36],2343527390),new N(E[37],1014477480),new N(E[38],1206759142),new N(E[39],344077627),new N(E[40],1290863460),new N(E[41],3158454273),new N(E[42],3505952657),new N(E[43],106217008),new N(E[44],3606008344),new N(E[45],1432725776),new N(E[46],1467031594),new N(E[47],851169720),new N(E[48],3100823752),new N(E[49],1363258195),new N(E[50],3750685593),new N(E[51],3785050280),new N(E[52],3318307427),new N(E[53],3812723403),new N(E[54],2003034995),new N(E[55],3602036899),new N(E[56],1575990012),new N(E[57],1125592928),new N(E[58],2716904306),new N(E[59],442776044),new N(E[60],593698344),new N(E[61],3733110249),new N(E[62],2999351573),new N(E[63],3815920427),new N(3391569614,3928383900),new N(3515267271,566280711),new N(3940187606,3454069534),new N(4118630271,4000239992),new N(116418474,1914138554),new N(174292421,2731055270),new N(289380356,3203993006),new N(460393269,320620315),new N(685471733,587496836),new N(852142971,1086792851),new N(1017036298,365543100),new N(1126000580,2618297676),new N(1288033470,3409855158),new N(1501505948,4234509866),new N(1607167915,987167468),new N(1816402316,1246189591)];function Ee(gt){return gt==="SHA-384"?[new N(3418070365,v[0]),new N(1654270250,v[1]),new N(2438529370,v[2]),new N(355462360,v[3]),new N(1731405415,v[4]),new N(41048885895,v[5]),new N(3675008525,v[6]),new N(1203062813,v[7])]:[new N(c[0],4089235720),new N(c[1],2227873595),new N(c[2],4271175723),new N(c[3],1595750129),new N(c[4],2917565137),new N(c[5],725511199),new N(c[6],4215389547),new N(c[7],327033209)]}function me(gt,lt){var dt,tt,rt,ke,xe,Pe,it,Xe,st,It,ft,Jt,Ot,Ct,qe,Yt,ot=[];for(dt=lt[0],tt=lt[1],rt=lt[2],ke=lt[3],xe=lt[4],Pe=lt[5],it=lt[6],Xe=lt[7],ft=0;ft<80;ft+=1)ft<16?(Jt=2*ft,ot[ft]=new N(gt[Jt],gt[Jt+1])):ot[ft]=Q((Ot=ot[ft-2],Ct=void 0,qe=void 0,Yt=void 0,Ct=Y(Ot,19),qe=Y(Ot,61),Yt=Z(Ot,6),new N(Ct.N^qe.N^Yt.N,Ct.I^qe.I^Yt.I)),ot[ft-7],ge(ot[ft-15]),ot[ft-16]),st=oe(Xe,be(xe),z(xe,Pe,it),we[ft],ot[ft]),It=H(te(dt),fe(dt,tt,rt)),Xe=it,it=Pe,Pe=xe,xe=H(ke,st),ke=rt,rt=tt,tt=dt,dt=H(st,It);return lt[0]=H(dt,lt[0]),lt[1]=H(tt,lt[1]),lt[2]=H(rt,lt[2]),lt[3]=H(ke,lt[3]),lt[4]=H(xe,lt[4]),lt[5]=H(Pe,lt[5]),lt[6]=H(it,lt[6]),lt[7]=H(Xe,lt[7]),lt}var Ke=function(gt){function lt(dt,tt,rt){var ke=this;if(dt!=="SHA-384"&&dt!=="SHA-512")throw new Error(d);var xe=rt||{};return(ke=gt.call(this,dt,tt,rt)||this).F=ke.Y,ke.g=!0,ke.C=-1,ke.p=h(ke.t,ke.i,ke.C),ke.R=me,ke.B=function(Pe){return Pe.slice()},ke.L=Ee,ke.K=function(Pe,it,Xe,st){return function(It,ft,Jt,Ot,Ct){for(var qe,Yt=31+(ft+129>>>10<<5),ot=ft+Jt;It.length<=Yt;)It.push(0);for(It[ft>>>5]|=128<<24-ft%32,It[Yt]=4294967295&ot,It[Yt-1]=ot/4294967296|0,qe=0;qe<It.length;qe+=32)Ot=me(It.slice(qe,qe+32),Ot);return Ct==="SHA-384"?[(Ot=Ot)[0].N,Ot[0].I,Ot[1].N,Ot[1].I,Ot[2].N,Ot[2].I,Ot[3].N,Ot[3].I,Ot[4].N,Ot[4].I,Ot[5].N,Ot[5].I]:[Ot[0].N,Ot[0].I,Ot[1].N,Ot[1].I,Ot[2].N,Ot[2].I,Ot[3].N,Ot[3].I,Ot[4].N,Ot[4].I,Ot[5].N,Ot[5].I,Ot[6].N,Ot[6].I,Ot[7].N,Ot[7].I]}(Pe,it,Xe,st,dt)},ke.m=Ee(dt),ke.S=1024,ke.U=dt==="SHA-384"?384:512,ke.T=!1,xe.hmacKey&&ke.k(C("hmacKey",xe.hmacKey,ke.C)),ke}return S(lt,gt),lt}(x),He=[new N(0,1),new N(0,32898),new N(2147483648,32906),new N(2147483648,2147516416),new N(0,32907),new N(0,2147483649),new N(2147483648,2147516545),new N(2147483648,32777),new N(0,138),new N(0,136),new N(0,2147516425),new N(0,2147483658),new N(0,2147516555),new N(2147483648,139),new N(2147483648,32905),new N(2147483648,32771),new N(2147483648,32770),new N(2147483648,128),new N(0,32778),new N(2147483648,2147483658),new N(2147483648,2147516545),new N(2147483648,32896),new N(0,2147483649),new N(2147483648,2147516424)],Ie=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function Le(gt){var lt,dt=[];for(lt=0;lt<5;lt+=1)dt[lt]=[new N(0,0),new N(0,0),new N(0,0),new N(0,0),new N(0,0)];return dt}function Ge(gt){var lt,dt=[];for(lt=0;lt<5;lt+=1)dt[lt]=gt[lt].slice();return dt}function Be(gt,lt){var dt,tt,rt,ke,xe,Pe,it,Xe,st,It=[],ft=[];if(gt!==null)for(tt=0;tt<gt.length;tt+=2)lt[(tt>>>1)%5][(tt>>>1)/5|0]=_e(lt[(tt>>>1)%5][(tt>>>1)/5|0],new N(gt[tt+1],gt[tt]));for(dt=0;dt<24;dt+=1){for(ke=Le(),tt=0;tt<5;tt+=1)It[tt]=(xe=lt[tt][0],Pe=lt[tt][1],it=lt[tt][2],Xe=lt[tt][3],st=lt[tt][4],new N(xe.N^Pe.N^it.N^Xe.N^st.N,xe.I^Pe.I^it.I^Xe.I^st.I));for(tt=0;tt<5;tt+=1)ft[tt]=_e(It[(tt+4)%5],j(It[(tt+1)%5],1));for(tt=0;tt<5;tt+=1)for(rt=0;rt<5;rt+=1)lt[tt][rt]=_e(lt[tt][rt],ft[tt]);for(tt=0;tt<5;tt+=1)for(rt=0;rt<5;rt+=1)ke[rt][(2*tt+3*rt)%5]=j(lt[tt][rt],Ie[tt][rt]);for(tt=0;tt<5;tt+=1)for(rt=0;rt<5;rt+=1)lt[tt][rt]=_e(ke[tt][rt],new N(~ke[(tt+1)%5][rt].N&ke[(tt+2)%5][rt].N,~ke[(tt+1)%5][rt].I&ke[(tt+2)%5][rt].I));lt[0][0]=_e(lt[0][0],He[dt])}return lt}function We(gt){var lt,dt,tt=0,rt=[0,0],ke=[4294967295>,gt/4294967296&2097151];for(lt=6;lt>=0;lt--)(dt=ke[lt>>2]>>>8*lt&255)===0&&tt===0||(rt[tt+1>>2]|=dt<<8*(tt+1),tt+=1);return tt=tt!==0?tt:1,rt[0]|=tt,{value:tt+1>4?rt:[rt[0]],binLen:8+8*tt}}function Ze(gt){return p(We(gt.binLen),gt)}function _t(gt,lt){var dt,tt=We(lt),rt=lt>>>2,ke=(rt-(tt=p(tt,gt)).value.length%rt)%rt;for(dt=0;dt<ke;dt++)tt.value.push(0);return tt.value}var Ft=function(gt){function lt(dt,tt,rt){var ke=this,xe=6,Pe=0,it=rt||{};if((ke=gt.call(this,dt,tt,rt)||this).numRounds!==1){if(it.kmacKey||it.hmacKey)throw new Error("Cannot set numRounds with MAC");if(ke.o==="CSHAKE128"||ke.o==="CSHAKE256")throw new Error("Cannot set numRounds for CSHAKE variants")}switch(ke.C=1,ke.p=h(ke.t,ke.i,ke.C),ke.R=Be,ke.B=Ge,ke.L=Le,ke.m=Le(),ke.T=!1,dt){case"SHA3-224":ke.S=Pe=1152,ke.U=224,ke.g=!0,ke.F=ke.Y;break;case"SHA3-256":ke.S=Pe=1088,ke.U=256,ke.g=!0,ke.F=ke.Y;break;case"SHA3-384":ke.S=Pe=832,ke.U=384,ke.g=!0,ke.F=ke.Y;break;case"SHA3-512":ke.S=Pe=576,ke.U=512,ke.g=!0,ke.F=ke.Y;break;case"SHAKE128":xe=31,ke.S=Pe=1344,ke.U=-1,ke.T=!0,ke.g=!1,ke.F=null;break;case"SHAKE256":xe=31,ke.S=Pe=1088,ke.U=-1,ke.T=!0,ke.g=!1,ke.F=null;break;case"KMAC128":xe=4,ke.S=Pe=1344,ke.M(rt),ke.U=-1,ke.T=!0,ke.g=!1,ke.F=ke.X;break;case"KMAC256":xe=4,ke.S=Pe=1088,ke.M(rt),ke.U=-1,ke.T=!0,ke.g=!1,ke.F=ke.X;break;case"CSHAKE128":ke.S=Pe=1344,xe=ke.O(rt),ke.U=-1,ke.T=!0,ke.g=!1,ke.F=null;break;case"CSHAKE256":ke.S=Pe=1088,xe=ke.O(rt),ke.U=-1,ke.T=!0,ke.g=!1,ke.F=null;break;default:throw new Error(d)}return ke.K=function(Xe,st,It,ft,Jt){return function(Ot,Ct,qe,Yt,ot,Ae,Rt){var Ht,bt,Mt=0,tr=[],Vt=ot>>>5,Et=Ct>>>5;for(Ht=0;Ht<Et&&Ct>=ot;Ht+=Vt)Yt=Be(Ot.slice(Ht,Ht+Vt),Yt),Ct-=ot;for(Ot=Ot.slice(Ht),Ct%=ot;Ot.length<Vt;)Ot.push(0);for(Ot[(Ht=Ct>>>3)>>2]^=Ae<<Ht%4*8,Ot[Vt-1]^=2147483648,Yt=Be(Ot,Yt);32*tr.length<Rt&&(bt=Yt[Mt%5][Mt/5|0],tr.push(bt.I),!(32*tr.length>=Rt));)tr.push(bt.N),64*(Mt+=1)%ot==0&&(Be(null,Yt),Mt=0);return tr}(Xe,st,0,ft,Pe,xe,Jt)},it.hmacKey&&ke.k(C("hmacKey",it.hmacKey,ke.C)),ke}return S(lt,gt),lt.prototype.O=function(dt,tt){var rt=function(it){var Xe=it||{};return{funcName:C("funcName",Xe.funcName,1,{value:[],binLen:0}),customization:C("Customization",Xe.customization,1,{value:[],binLen:0})}}(dt||{});tt&&(rt.funcName=tt);var ke=p(Ze(rt.funcName),Ze(rt.customization));if(rt.customization.binLen!==0||rt.funcName.binLen!==0){for(var xe=_t(ke,this.S>>>3),Pe=0;Pe<xe.length;Pe+=this.S>>>5)this.m=this.R(xe.slice(Pe,Pe+(this.S>>>5)),this.m),this.v+=this.S;return 4}return 31},lt.prototype.M=function(dt){var tt=function(xe){var Pe=xe||{};return{kmacKey:C("kmacKey",Pe.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:C("Customization",Pe.customization,1,{value:[],binLen:0})}}(dt||{});this.O(dt,tt.funcName);for(var rt=_t(Ze(tt.kmacKey),this.S>>>3),ke=0;ke<rt.length;ke+=this.S>>>5)this.m=this.R(rt.slice(ke,ke+(this.S>>>5)),this.m),this.v+=this.S;this.A=!0},lt.prototype.X=function(dt){var tt=p({value:this.u.slice(),binLen:this.s},function(rt){var ke,xe,Pe=0,it=[0,0],Xe=[4294967295&rt,rt/4294967296&2097151];for(ke=6;ke>=0;ke--)(xe=Xe[ke>>2]>>>8*ke&255)==0&&Pe===0||(it[Pe>>2]|=xe<<8*Pe,Pe+=1);return it[(Pe=Pe!==0?Pe:1)>>2]|=Pe<<8*Pe,{value:Pe+1>4?it:[it[0]],binLen:8+8*Pe}}(dt.outputLen));return this.K(tt.value,tt.binLen,this.v,this.B(this.m),dt.outputLen)},lt}(x);return function(){function gt(lt,dt,tt){if(lt=="SHA-1")this.j=new B(lt,dt,tt);else if(lt=="SHA-224"||lt=="SHA-256")this.j=new T(lt,dt,tt);else if(lt=="SHA-384"||lt=="SHA-512")this.j=new Ke(lt,dt,tt);else{if(lt!="SHA3-224"&<!="SHA3-256"&<!="SHA3-384"&<!="SHA3-512"&<!="SHAKE128"&<!="SHAKE256"&<!="CSHAKE128"&<!="CSHAKE256"&<!="KMAC128"&<!="KMAC256")throw new Error(d);this.j=new Ft(lt,dt,tt)}}return gt.prototype.update=function(lt){this.j.update(lt)},gt.prototype.getHash=function(lt,dt){return this.j.getHash(lt,dt)},gt.prototype.setHMACKey=function(lt,dt,tt){this.j.setHMACKey(lt,dt,tt)},gt.prototype.getHMAC=function(lt,dt){return this.j.getHMAC(lt,dt)},gt}()})},16171:function(ie,f,_){var h=_(34671),w=_(30714),E=h(w,"DataView");ie.exports=E},36766:function(ie,f,_){var h=_(62405),w=_(68341),E=_(39644),v=_(53784),c=_(46264);function d(p){var m=-1,C=p==null?0:p.length;for(this.clear();++m<C;){var x=p[m];this.set(x[0],x[1])}}d.prototype.clear=h,d.prototype.delete=w,d.prototype.get=E,d.prototype.has=v,d.prototype.set=c,ie.exports=d},21022:function(ie,f,_){var h=_(6821),w=_(7221),E=_(21596),v=_(91992),c=_(10552);function d(p){var m=-1,C=p==null?0:p.length;for(this.clear();++m<C;){var x=p[m];this.set(x[0],x[1])}}d.prototype.clear=h,d.prototype.delete=w,d.prototype.get=E,d.prototype.has=v,d.prototype.set=c,ie.exports=d},75870:function(ie,f,_){var h=_(34671),w=_(30714),E=h(w,"Map");ie.exports=E},68910:function(ie,f,_){var h=_(54069),w=_(97477),E=_(50476),v=_(30984),c=_(4136);function d(p){var m=-1,C=p==null?0:p.length;for(this.clear();++m<C;){var x=p[m];this.set(x[0],x[1])}}d.prototype.clear=h,d.prototype.delete=w,d.prototype.get=E,d.prototype.has=v,d.prototype.set=c,ie.exports=d},84665:function(ie,f,_){var h=_(34671),w=_(30714),E=h(w,"Promise");ie.exports=E},39612:function(ie,f,_){var h=_(34671),w=_(30714),E=h(w,"Set");ie.exports=E},47216:function(ie,f,_){var h=_(21022),w=_(45331),E=_(57063),v=_(90134),c=_(9842),d=_(39850);function p(m){var C=this.__data__=new h(m);this.size=C.size}p.prototype.clear=w,p.prototype.delete=E,p.prototype.get=v,p.prototype.has=c,p.prototype.set=d,ie.exports=p},59006:function(ie,f,_){var h=_(30714),w=h.Symbol;ie.exports=w},88851:function(ie,f,_){var h=_(30714),w=h.Uint8Array;ie.exports=w},98154:function(ie,f,_){var h=_(34671),w=_(30714),E=h(w,"WeakMap");ie.exports=E},97012:function(ie){function f(_,h){for(var w=-1,E=_==null?0:_.length;++w<E&&h(_[w],w,_)!==!1;);return _}ie.exports=f},52995:function(ie){function f(_,h){for(var w=-1,E=_==null?0:_.length,v=0,c=[];++w<E;){var d=_[w];h(d,w,_)&&(c[v++]=d)}return c}ie.exports=f},89754:function(ie,f,_){var h=_(59605),w=_(50079),E=_(25874),v=_(83601),c=_(61908),d=_(39046),p=Object.prototype,m=p.hasOwnProperty;function C(x,R){var S=E(x),O=!S&&w(x),M=!S&&!O&&v(x),k=!S&&!O&&!M&&d(x),q=S||O||M||k,b=q?h(x.length,String):[],F=b.length;for(var G in x)(R||m.call(x,G))&&!(q&&(G=="length"||M&&(G=="offset"||G=="parent")||k&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||c(G,F)))&&b.push(G);return b}ie.exports=C},82525:function(ie){function f(_,h){for(var w=-1,E=h.length,v=_.length;++w<E;)_[v+w]=h[w];return _}ie.exports=f},95802:function(ie,f,_){var h=_(93077),w=_(55097),E=Object.prototype,v=E.hasOwnProperty;function c(d,p,m){var C=d[p];(!(v.call(d,p)&&w(C,m))||m===void 0&&!(p in d))&&h(d,p,m)}ie.exports=c},9438:function(ie,f,_){var h=_(55097);function w(E,v){for(var c=E.length;c--;)if(h(E[c][0],v))return c;return-1}ie.exports=w},6902:function(ie,f,_){var h=_(85532),w=_(3511);function E(v,c){return v&&h(c,w(c),v)}ie.exports=E},15873:function(ie,f,_){var h=_(85532),w=_(42844);function E(v,c){return v&&h(c,w(c),v)}ie.exports=E},93077:function(ie,f,_){var h=_(24856);function w(E,v,c){v=="__proto__"&&h?h(E,v,{configurable:!0,enumerable:!0,value:c,writable:!0}):E[v]=c}ie.exports=w},59018:function(ie,f,_){var h=_(47216),w=_(97012),E=_(95802),v=_(6902),c=_(15873),d=_(56743),p=_(50310),m=_(95590),C=_(72209),x=_(92573),R=_(43918),S=_(29778),O=_(25290),M=_(14028),k=_(39168),q=_(25874),b=_(83601),F=_(4725),G=_(99400),ue=_(47363),le=_(3511),X=_(42844),se=1,de=2,ye=4,he="[object Arguments]",K="[object Array]",B="[object Boolean]",L="[object Date]",$="[object Error]",T="[object Function]",N="[object GeneratorFunction]",j="[object Map]",Y="[object Number]",Z="[object Object]",z="[object RegExp]",fe="[object Set]",te="[object String]",H="[object Symbol]",Q="[object WeakMap]",oe="[object ArrayBuffer]",_e="[object DataView]",ge="[object Float32Array]",be="[object Float64Array]",we="[object Int8Array]",Ee="[object Int16Array]",me="[object Int32Array]",Ke="[object Uint8Array]",He="[object Uint8ClampedArray]",Ie="[object Uint16Array]",Le="[object Uint32Array]",Ge={};Ge[he]=Ge[K]=Ge[oe]=Ge[_e]=Ge[B]=Ge[L]=Ge[ge]=Ge[be]=Ge[we]=Ge[Ee]=Ge[me]=Ge[j]=Ge[Y]=Ge[Z]=Ge[z]=Ge[fe]=Ge[te]=Ge[H]=Ge[Ke]=Ge[He]=Ge[Ie]=Ge[Le]=!0,Ge[$]=Ge[T]=Ge[Q]=!1;function Be(We,Ze,_t,Ft,gt,lt){var dt,tt=Ze&se,rt=Ze&de,ke=Ze&ye;if(_t&&(dt=gt?_t(We,Ft,gt,lt):_t(We)),dt!==void 0)return dt;if(!G(We))return We;var xe=q(We);if(xe){if(dt=O(We),!tt)return p(We,dt)}else{var Pe=S(We),it=Pe==T||Pe==N;if(b(We))return d(We,tt);if(Pe==Z||Pe==he||it&&!gt){if(dt=rt||it?{}:k(We),!tt)return rt?C(We,c(dt,We)):m(We,v(dt,We))}else{if(!Ge[Pe])return gt?We:{};dt=M(We,Pe,tt)}}lt||(lt=new h);var Xe=lt.get(We);if(Xe)return Xe;lt.set(We,dt),ue(We)?We.forEach(function(ft){dt.add(Be(ft,Ze,_t,ft,We,lt))}):F(We)&&We.forEach(function(ft,Jt){dt.set(Jt,Be(ft,Ze,_t,Jt,We,lt))});var st=ke?rt?R:x:rt?X:le,It=xe?void 0:st(We);return w(It||We,function(ft,Jt){It&&(Jt=ft,ft=We[Jt]),E(dt,Jt,Be(ft,Ze,_t,Jt,We,lt))}),dt}ie.exports=Be},71095:function(ie,f,_){var h=_(99400),w=Object.create,E=function(){function v(){}return function(c){if(!h(c))return{};if(w)return w(c);v.prototype=c;var d=new v;return v.prototype=void 0,d}}();ie.exports=E},25920:function(ie,f,_){var h=_(82525),w=_(25874);function E(v,c,d){var p=c(v);return w(v)?p:h(p,d(v))}ie.exports=E},95271:function(ie,f,_){var h=_(59006),w=_(99650),E=_(56881),v="[object Null]",c="[object Undefined]",d=h?h.toStringTag:void 0;function p(m){return m==null?m===void 0?c:v:d&&d in Object(m)?w(m):E(m)}ie.exports=p},94047:function(ie,f,_){var h=_(95271),w=_(77583),E="[object Arguments]";function v(c){return w(c)&&h(c)==E}ie.exports=v},54965:function(ie,f,_){var h=_(29778),w=_(77583),E="[object Map]";function v(c){return w(c)&&h(c)==E}ie.exports=v},24228:function(ie,f,_){var h=_(27787),w=_(97827),E=_(99400),v=_(40462),c=/[\\^$.*+?()[\]{}|]/g,d=/^\[object .+?Constructor\]$/,p=Function.prototype,m=Object.prototype,C=p.toString,x=m.hasOwnProperty,R=RegExp("^"+C.call(x).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function S(O){if(!E(O)||w(O))return!1;var M=h(O)?R:d;return M.test(v(O))}ie.exports=S},6499:function(ie,f,_){var h=_(29778),w=_(77583),E="[object Set]";function v(c){return w(c)&&h(c)==E}ie.exports=v},40550:function(ie,f,_){var h=_(95271),w=_(44583),E=_(77583),v="[object Arguments]",c="[object Array]",d="[object Boolean]",p="[object Date]",m="[object Error]",C="[object Function]",x="[object Map]",R="[object Number]",S="[object Object]",O="[object RegExp]",M="[object Set]",k="[object String]",q="[object WeakMap]",b="[object ArrayBuffer]",F="[object DataView]",G="[object Float32Array]",ue="[object Float64Array]",le="[object Int8Array]",X="[object Int16Array]",se="[object Int32Array]",de="[object Uint8Array]",ye="[object Uint8ClampedArray]",he="[object Uint16Array]",K="[object Uint32Array]",B={};B[G]=B[ue]=B[le]=B[X]=B[se]=B[de]=B[ye]=B[he]=B[K]=!0,B[v]=B[c]=B[b]=B[d]=B[F]=B[p]=B[m]=B[C]=B[x]=B[R]=B[S]=B[O]=B[M]=B[k]=B[q]=!1;function L($){return E($)&&w($.length)&&!!B[h($)]}ie.exports=L},35351:function(ie,f,_){var h=_(37894),w=_(82325),E=Object.prototype,v=E.hasOwnProperty;function c(d){if(!h(d))return w(d);var p=[];for(var m in Object(d))v.call(d,m)&&m!="constructor"&&p.push(m);return p}ie.exports=c},61500:function(ie,f,_){var h=_(99400),w=_(37894),E=_(85382),v=Object.prototype,c=v.hasOwnProperty;function d(p){if(!h(p))return E(p);var m=w(p),C=[];for(var x in p)x=="constructor"&&(m||!c.call(p,x))||C.push(x);return C}ie.exports=d},59605:function(ie){function f(_,h){for(var w=-1,E=Array(_);++w<_;)E[w]=h(w);return E}ie.exports=f},98232:function(ie){function f(_){return function(h){return _(h)}}ie.exports=f},79270:function(ie,f,_){var h=_(88851);function w(E){var v=new E.constructor(E.byteLength);return new h(v).set(new h(E)),v}ie.exports=w},56743:function(ie,f,_){ie=_.nmd(ie);var h=_(30714),w=f&&!f.nodeType&&f,E=w&&!0&&ie&&!ie.nodeType&&ie,v=E&&E.exports===w,c=v?h.Buffer:void 0,d=c?c.allocUnsafe:void 0;function p(m,C){if(C)return m.slice();var x=m.length,R=d?d(x):new m.constructor(x);return m.copy(R),R}ie.exports=p},5940:function(ie,f,_){var h=_(79270);function w(E,v){var c=v?h(E.buffer):E.buffer;return new E.constructor(c,E.byteOffset,E.byteLength)}ie.exports=w},85320:function(ie){var f=/\w*$/;function _(h){var w=new h.constructor(h.source,f.exec(h));return w.lastIndex=h.lastIndex,w}ie.exports=_},24937:function(ie,f,_){var h=_(59006),w=h?h.prototype:void 0,E=w?w.valueOf:void 0;function v(c){return E?Object(E.call(c)):{}}ie.exports=v},51532:function(ie,f,_){var h=_(79270);function w(E,v){var c=v?h(E.buffer):E.buffer;return new E.constructor(c,E.byteOffset,E.length)}ie.exports=w},50310:function(ie){function f(_,h){var w=-1,E=_.length;for(h||(h=Array(E));++w<E;)h[w]=_[w];return h}ie.exports=f},85532:function(ie,f,_){var h=_(95802),w=_(93077);function E(v,c,d,p){var m=!d;d||(d={});for(var C=-1,x=c.length;++C<x;){var R=c[C],S=p?p(d[R],v[R],R,d,v):void 0;S===void 0&&(S=v[R]),m?w(d,R,S):h(d,R,S)}return d}ie.exports=E},95590:function(ie,f,_){var h=_(85532),w=_(19183);function E(v,c){return h(v,w(v),c)}ie.exports=E},72209:function(ie,f,_){var h=_(85532),w=_(596);function E(v,c){return h(v,w(v),c)}ie.exports=E},46450:function(ie,f,_){var h=_(30714),w=h["__core-js_shared__"];ie.exports=w},24856:function(ie,f,_){var h=_(34671),w=function(){try{var E=h(Object,"defineProperty");return E({},"",{}),E}catch{}}();ie.exports=w},11603:function(ie,f,_){var h=typeof _.g=="object"&&_.g&&_.g.Object===Object&&_.g;ie.exports=h},92573:function(ie,f,_){var h=_(25920),w=_(19183),E=_(3511);function v(c){return h(c,E,w)}ie.exports=v},43918:function(ie,f,_){var h=_(25920),w=_(596),E=_(42844);function v(c){return h(c,E,w)}ie.exports=v},31200:function(ie,f,_){var h=_(50095);function w(E,v){var c=E.__data__;return h(v)?c[typeof v=="string"?"string":"hash"]:c.map}ie.exports=w},34671:function(ie,f,_){var h=_(24228),w=_(97559);function E(v,c){var d=w(v,c);return h(d)?d:void 0}ie.exports=E},27556:function(ie,f,_){var h=_(78546),w=h(Object.getPrototypeOf,Object);ie.exports=w},99650:function(ie,f,_){var h=_(59006),w=Object.prototype,E=w.hasOwnProperty,v=w.toString,c=h?h.toStringTag:void 0;function d(p){var m=E.call(p,c),C=p[c];try{p[c]=void 0;var x=!0}catch{}var R=v.call(p);return x&&(m?p[c]=C:delete p[c]),R}ie.exports=d},19183:function(ie,f,_){var h=_(52995),w=_(92982),E=Object.prototype,v=E.propertyIsEnumerable,c=Object.getOwnPropertySymbols,d=c?function(p){return p==null?[]:(p=Object(p),h(c(p),function(m){return v.call(p,m)}))}:w;ie.exports=d},596:function(ie,f,_){var h=_(82525),w=_(27556),E=_(19183),v=_(92982),c=Object.getOwnPropertySymbols,d=c?function(p){for(var m=[];p;)h(m,E(p)),p=w(p);return m}:v;ie.exports=d},29778:function(ie,f,_){var h=_(16171),w=_(75870),E=_(84665),v=_(39612),c=_(98154),d=_(95271),p=_(40462),m="[object Map]",C="[object Object]",x="[object Promise]",R="[object Set]",S="[object WeakMap]",O="[object DataView]",M=p(h),k=p(w),q=p(E),b=p(v),F=p(c),G=d;(h&&G(new h(new ArrayBuffer(1)))!=O||w&&G(new w)!=m||E&&G(E.resolve())!=x||v&&G(new v)!=R||c&&G(new c)!=S)&&(G=function(ue){var le=d(ue),X=le==C?ue.constructor:void 0,se=X?p(X):"";if(se)switch(se){case M:return O;case k:return m;case q:return x;case b:return R;case F:return S}return le}),ie.exports=G},97559:function(ie){function f(_,h){return _?.[h]}ie.exports=f},62405:function(ie,f,_){var h=_(68637);function w(){this.__data__=h?h(null):{},this.size=0}ie.exports=w},68341:function(ie){function f(_){var h=this.has(_)&&delete this.__data__[_];return this.size-=h?1:0,h}ie.exports=f},39644:function(ie,f,_){var h=_(68637),w="__lodash_hash_undefined__",E=Object.prototype,v=E.hasOwnProperty;function c(d){var p=this.__data__;if(h){var m=p[d];return m===w?void 0:m}return v.call(p,d)?p[d]:void 0}ie.exports=c},53784:function(ie,f,_){var h=_(68637),w=Object.prototype,E=w.hasOwnProperty;function v(c){var d=this.__data__;return h?d[c]!==void 0:E.call(d,c)}ie.exports=v},46264:function(ie,f,_){var h=_(68637),w="__lodash_hash_undefined__";function E(v,c){var d=this.__data__;return this.size+=this.has(v)?0:1,d[v]=h&&c===void 0?w:c,this}ie.exports=E},25290:function(ie){var f=Object.prototype,_=f.hasOwnProperty;function h(w){var E=w.length,v=new w.constructor(E);return E&&typeof w[0]=="string"&&_.call(w,"index")&&(v.index=w.index,v.input=w.input),v}ie.exports=h},14028:function(ie,f,_){var h=_(79270),w=_(5940),E=_(85320),v=_(24937),c=_(51532),d="[object Boolean]",p="[object Date]",m="[object Map]",C="[object Number]",x="[object RegExp]",R="[object Set]",S="[object String]",O="[object Symbol]",M="[object ArrayBuffer]",k="[object DataView]",q="[object Float32Array]",b="[object Float64Array]",F="[object Int8Array]",G="[object Int16Array]",ue="[object Int32Array]",le="[object Uint8Array]",X="[object Uint8ClampedArray]",se="[object Uint16Array]",de="[object Uint32Array]";function ye(he,K,B){var L=he.constructor;switch(K){case M:return h(he);case d:case p:return new L(+he);case k:return w(he,B);case q:case b:case F:case G:case ue:case le:case X:case se:case de:return c(he,B);case m:return new L;case C:case S:return new L(he);case x:return E(he);case R:return new L;case O:return v(he)}}ie.exports=ye},39168:function(ie,f,_){var h=_(71095),w=_(27556),E=_(37894);function v(c){return typeof c.constructor=="function"&&!E(c)?h(w(c)):{}}ie.exports=v},61908:function(ie){var f=9007199254740991,_=/^(?:0|[1-9]\d*)$/;function h(w,E){var v=typeof w;return E=E??f,!!E&&(v=="number"||v!="symbol"&&_.test(w))&&w>-1&&w%1==0&&w<E}ie.exports=h},50095:function(ie){function f(_){var h=typeof _;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?_!=="__proto__":_===null}ie.exports=f},97827:function(ie,f,_){var h=_(46450),w=function(){var v=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||"");return v?"Symbol(src)_1."+v:""}();function E(v){return!!w&&w in v}ie.exports=E},37894:function(ie){var f=Object.prototype;function _(h){var w=h&&h.constructor,E=typeof w=="function"&&w.prototype||f;return h===E}ie.exports=_},6821:function(ie){function f(){this.__data__=[],this.size=0}ie.exports=f},7221:function(ie,f,_){var h=_(9438),w=Array.prototype,E=w.splice;function v(c){var d=this.__data__,p=h(d,c);if(p<0)return!1;var m=d.length-1;return p==m?d.pop():E.call(d,p,1),--this.size,!0}ie.exports=v},21596:function(ie,f,_){var h=_(9438);function w(E){var v=this.__data__,c=h(v,E);return c<0?void 0:v[c][1]}ie.exports=w},91992:function(ie,f,_){var h=_(9438);function w(E){return h(this.__data__,E)>-1}ie.exports=w},10552:function(ie,f,_){var h=_(9438);function w(E,v){var c=this.__data__,d=h(c,E);return d<0?(++this.size,c.push([E,v])):c[d][1]=v,this}ie.exports=w},54069:function(ie,f,_){var h=_(36766),w=_(21022),E=_(75870);function v(){this.size=0,this.__data__={hash:new h,map:new(E||w),string:new h}}ie.exports=v},97477:function(ie,f,_){var h=_(31200);function w(E){var v=h(this,E).delete(E);return this.size-=v?1:0,v}ie.exports=w},50476:function(ie,f,_){var h=_(31200);function w(E){return h(this,E).get(E)}ie.exports=w},30984:function(ie,f,_){var h=_(31200);function w(E){return h(this,E).has(E)}ie.exports=w},4136:function(ie,f,_){var h=_(31200);function w(E,v){var c=h(this,E),d=c.size;return c.set(E,v),this.size+=c.size==d?0:1,this}ie.exports=w},68637:function(ie,f,_){var h=_(34671),w=h(Object,"create");ie.exports=w},82325:function(ie,f,_){var h=_(78546),w=h(Object.keys,Object);ie.exports=w},85382:function(ie){function f(_){var h=[];if(_!=null)for(var w in Object(_))h.push(w);return h}ie.exports=f},96574:function(ie,f,_){ie=_.nmd(ie);var h=_(11603),w=f&&!f.nodeType&&f,E=w&&!0&&ie&&!ie.nodeType&&ie,v=E&&E.exports===w,c=v&&h.process,d=function(){try{var p=E&&E.require&&E.require("util").types;return p||c&&c.binding&&c.binding("util")}catch{}}();ie.exports=d},56881:function(ie){var f=Object.prototype,_=f.toString;function h(w){return _.call(w)}ie.exports=h},78546:function(ie){function f(_,h){return function(w){return _(h(w))}}ie.exports=f},30714:function(ie,f,_){var h=_(11603),w=typeof self=="object"&&self&&self.Object===Object&&self,E=h||w||Function("return this")();ie.exports=E},45331:function(ie,f,_){var h=_(21022);function w(){this.__data__=new h,this.size=0}ie.exports=w},57063:function(ie){function f(_){var h=this.__data__,w=h.delete(_);return this.size=h.size,w}ie.exports=f},90134:function(ie){function f(_){return this.__data__.get(_)}ie.exports=f},9842:function(ie){function f(_){return this.__data__.has(_)}ie.exports=f},39850:function(ie,f,_){var h=_(21022),w=_(75870),E=_(68910),v=200;function c(d,p){var m=this.__data__;if(m instanceof h){var C=m.__data__;if(!w||C.length<v-1)return C.push([d,p]),this.size=++m.size,this;m=this.__data__=new E(C)}return m.set(d,p),this.size=m.size,this}ie.exports=c},40462:function(ie){var f=Function.prototype,_=f.toString;function h(w){if(w!=null){try{return _.call(w)}catch{}try{return w+""}catch{}}return""}ie.exports=h},89136:function(ie,f,_){var h=_(59018),w=1,E=4;function v(c){return h(c,w|E)}ie.exports=v},55097:function(ie){function f(_,h){return _===h||_!==_&&h!==h}ie.exports=f},50079:function(ie,f,_){var h=_(94047),w=_(77583),E=Object.prototype,v=E.hasOwnProperty,c=E.propertyIsEnumerable,d=h(function(){return arguments}())?h:function(p){return w(p)&&v.call(p,"callee")&&!c.call(p,"callee")};ie.exports=d},25874:function(ie){var f=Array.isArray;ie.exports=f},73069:function(ie,f,_){var h=_(27787),w=_(44583);function E(v){return v!=null&&w(v.length)&&!h(v)}ie.exports=E},83601:function(ie,f,_){ie=_.nmd(ie);var h=_(30714),w=_(36408),E=f&&!f.nodeType&&f,v=E&&!0&&ie&&!ie.nodeType&&ie,c=v&&v.exports===E,d=c?h.Buffer:void 0,p=d?d.isBuffer:void 0,m=p||w;ie.exports=m},27787:function(ie,f,_){var h=_(95271),w=_(99400),E="[object AsyncFunction]",v="[object Function]",c="[object GeneratorFunction]",d="[object Proxy]";function p(m){if(!w(m))return!1;var C=h(m);return C==v||C==c||C==E||C==d}ie.exports=p},44583:function(ie){var f=9007199254740991;function _(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=f}ie.exports=_},4725:function(ie,f,_){var h=_(54965),w=_(98232),E=_(96574),v=E&&E.isMap,c=v?w(v):h;ie.exports=c},99400:function(ie){function f(_){var h=typeof _;return _!=null&&(h=="object"||h=="function")}ie.exports=f},77583:function(ie){function f(_){return _!=null&&typeof _=="object"}ie.exports=f},47363:function(ie,f,_){var h=_(6499),w=_(98232),E=_(96574),v=E&&E.isSet,c=v?w(v):h;ie.exports=c},39046:function(ie,f,_){var h=_(40550),w=_(98232),E=_(96574),v=E&&E.isTypedArray,c=v?w(v):h;ie.exports=c},3511:function(ie,f,_){var h=_(89754),w=_(35351),E=_(73069);function v(c){return E(c)?h(c):w(c)}ie.exports=v},42844:function(ie,f,_){var h=_(89754),w=_(61500),E=_(73069);function v(c){return E(c)?h(c,!0):w(c)}ie.exports=v},67918:function(ie,f,_){ie=_.nmd(ie);/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/(function(){var h,w="4.17.21",E=200,v="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",d="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",m=500,C="__lodash_placeholder__",x=1,R=2,S=4,O=1,M=2,k=1,q=2,b=4,F=8,G=16,ue=32,le=64,X=128,se=256,de=512,ye=30,he="...",K=800,B=16,L=1,$=2,T=3,N=1/0,j=9007199254740991,Y=17976931348623157e292,Z=NaN,z=4294967295,fe=z-1,te=z>>>1,H=[["ary",X],["bind",k],["bindKey",q],["curry",F],["curryRight",G],["flip",de],["partial",ue],["partialRight",le],["rearg",se]],Q="[object Arguments]",oe="[object Array]",_e="[object AsyncFunction]",ge="[object Boolean]",be="[object Date]",we="[object DOMException]",Ee="[object Error]",me="[object Function]",Ke="[object GeneratorFunction]",He="[object Map]",Ie="[object Number]",Le="[object Null]",Ge="[object Object]",Be="[object Promise]",We="[object Proxy]",Ze="[object RegExp]",_t="[object Set]",Ft="[object String]",gt="[object Symbol]",lt="[object Undefined]",dt="[object WeakMap]",tt="[object WeakSet]",rt="[object ArrayBuffer]",ke="[object DataView]",xe="[object Float32Array]",Pe="[object Float64Array]",it="[object Int8Array]",Xe="[object Int16Array]",st="[object Int32Array]",It="[object Uint8Array]",ft="[object Uint8ClampedArray]",Jt="[object Uint16Array]",Ot="[object Uint32Array]",Ct=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,Yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ot=/&(?:amp|lt|gt|quot|#39);/g,Ae=/[&<>"']/g,Rt=RegExp(ot.source),Ht=RegExp(Ae.source),bt=/<%-([\s\S]+?)%>/g,Mt=/<%([\s\S]+?)%>/g,tr=/<%=([\s\S]+?)%>/g,Vt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Et=/^\w*$/,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tt=/[\\^$.*+?()[\]{}|]/g,Wt=RegExp(Tt.source),dr=/^\s+/,at=/\s/,wt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,At=/\{\n\/\* \[wrapped with (.+)\] \*/,Je=/,? & /,Lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,sr=/[()=,{}\[\]\/\s]/,ur=/\\(\\)?/g,vr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kr=/\w*$/,Jr=/^[-+]0x[0-9a-f]+$/i,hr=/^0b[01]+$/i,$r=/^\[object .+?Constructor\]$/,Hr=/^0o[0-7]+$/i,rn=/^(?:0|[1-9]\d*)$/,_r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pn=/($^)/,$t=/['\n\r\u2028\u2029\\]/g,In="\\ud800-\\udfff",ln="\\u0300-\\u036f",yn="\\ufe20-\\ufe2f",Fr="\\u20d0-\\u20ff",On=ln+yn+Fr,En="\\u2700-\\u27bf",ee="a-z\\xdf-\\xf6\\xf8-\\xff",ve="\\xac\\xb1\\xd7\\xf7",ze="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yt="\\u2000-\\u206f",vt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ar="A-Z\\xc0-\\xd6\\xd8-\\xde",wr="\\ufe0e\\ufe0f",zt=ve+ze+yt+vt,Kr="['\u2019]",Xt="["+In+"]",et="["+zt+"]",xt="["+On+"]",Kt="\\d+",kt="["+En+"]",or="["+ee+"]",Qr="[^"+In+zt+Kt+En+ee+ar+"]",Nr="\\ud83c[\\udffb-\\udfff]",An="(?:"+xt+"|"+Nr+")",mn="[^"+In+"]",Nn="(?:\\ud83c[\\udde6-\\uddff]){2}",Vi="[\\ud800-\\udbff][\\udc00-\\udfff]",Kn="["+ar+"]",_s="\\u200d",Gs="(?:"+or+"|"+Qr+")",zs="(?:"+Kn+"|"+Qr+")",rs="(?:"+Kr+"(?:d|ll|m|re|s|t|ve))?",to="(?:"+Kr+"(?:D|LL|M|RE|S|T|VE))?",ro=An+"?",Ls="["+wr+"]?",cl="(?:"+_s+"(?:"+[mn,Nn,Vi].join("|")+")"+Ls+ro+")*",Eh="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ro="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Su=Ls+ro+cl,Yl="(?:"+[kt,Nn,Vi].join("|")+")"+Su,Th="(?:"+[mn+xt+"?",xt,Nn,Vi,Xt].join("|")+")",Sh=RegExp(Kr,"g"),Bc=RegExp(xt,"g"),Id=RegExp(Nr+"(?="+Nr+")|"+Th+Su,"g"),Iu=RegExp([Kn+"?"+or+"+"+rs+"(?="+[et,Kn,"$"].join("|")+")",zs+"+"+to+"(?="+[et,Kn+Gs,"$"].join("|")+")",Kn+"?"+Gs+"+"+rs,Kn+"+"+to,Ro,Eh,Kt,Yl].join("|"),"g"),kd=RegExp("["+_s+In+On+wr+"]"),Tg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ju=-1,Ds={};Ds[xe]=Ds[Pe]=Ds[it]=Ds[Xe]=Ds[st]=Ds[It]=Ds[ft]=Ds[Jt]=Ds[Ot]=!0,Ds[Q]=Ds[oe]=Ds[rt]=Ds[ge]=Ds[ke]=Ds[be]=Ds[Ee]=Ds[me]=Ds[He]=Ds[Ie]=Ds[Ge]=Ds[Ze]=Ds[_t]=Ds[Ft]=Ds[dt]=!1;var qs={};qs[Q]=qs[oe]=qs[rt]=qs[ke]=qs[ge]=qs[be]=qs[xe]=qs[Pe]=qs[it]=qs[Xe]=qs[st]=qs[He]=qs[Ie]=qs[Ge]=qs[Ze]=qs[_t]=qs[Ft]=qs[gt]=qs[It]=qs[ft]=qs[Jt]=qs[Ot]=!0,qs[Ee]=qs[me]=qs[dt]=!1;var Cd={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Wa={"&":"&","<":"<",">":">",'"':""","'":"'"},Ih={"&":"&","<":"<",">":">",""":'"',"'":"'"},kh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xl=parseFloat,Rh=parseInt,U0=typeof _.g=="object"&&_.g&&_.g.Object===Object&&_.g,cv=typeof self=="object"&&self&&self.Object===Object&&self,Co=U0||cv||Function("return this")(),Sg=f&&!f.nodeType&&f,Qu=Sg&&!0&&ie&&!ie.nodeType&&ie,po=Qu&&Qu.exports===Sg,Pt=po&&U0.process,Dt=function(){try{var jt=Qu&&Qu.require&&Qu.require("util").types;return jt||Pt&&Pt.binding&&Pt.binding("util")}catch{}}(),nr=Dt&&Dt.isArrayBuffer,ir=Dt&&Dt.isDate,Tr=Dt&&Dt.isMap,Ur=Dt&&Dt.isRegExp,Wr=Dt&&Dt.isSet,Sn=Dt&&Dt.isTypedArray;function Xn(jt,Qt,Gt){switch(Gt.length){case 0:return jt.call(Qt);case 1:return jt.call(Qt,Gt[0]);case 2:return jt.call(Qt,Gt[0],Gt[1]);case 3:return jt.call(Qt,Gt[0],Gt[1],Gt[2])}return jt.apply(Qt,Gt)}function Wn(jt,Qt,Gt,br){for(var yr=-1,Sr=jt==null?0:jt.length;++yr<Sr;){var Or=jt[yr];Qt(br,Or,Gt(Or),jt)}return br}function Mn(jt,Qt){for(var Gt=-1,br=jt==null?0:jt.length;++Gt<br&&Qt(jt[Gt],Gt,jt)!==!1;);return jt}function Qn(jt,Qt){for(var Gt=jt==null?0:jt.length;Gt--&&Qt(jt[Gt],Gt,jt)!==!1;);return jt}function Es(jt,Qt){for(var Gt=-1,br=jt==null?0:jt.length;++Gt<br;)if(!Qt(jt[Gt],Gt,jt))return!1;return!0}function Bs(jt,Qt){for(var Gt=-1,br=jt==null?0:jt.length,yr=0,Sr=[];++Gt<br;){var Or=jt[Gt];Qt(Or,Gt,jt)&&(Sr[yr++]=Or)}return Sr}function yi(jt,Qt){var Gt=jt==null?0:jt.length;return!!Gt&&Ch(jt,Qt,0)>-1}function xi(jt,Qt,Gt){for(var br=-1,yr=jt==null?0:jt.length;++br<yr;)if(Gt(Qt,jt[br]))return!0;return!1}function Hn(jt,Qt){for(var Gt=-1,br=jt==null?0:jt.length,yr=Array(br);++Gt<br;)yr[Gt]=Qt(jt[Gt],Gt,jt);return yr}function Os(jt,Qt){for(var Gt=-1,br=Qt.length,yr=jt.length;++Gt<br;)jt[yr+Gt]=Qt[Gt];return jt}function Zs(jt,Qt,Gt,br){var yr=-1,Sr=jt==null?0:jt.length;for(br&&Sr&&(Gt=jt[++yr]);++yr<Sr;)Gt=Qt(Gt,jt[yr],yr,jt);return Gt}function Po(jt,Qt,Gt,br){var yr=jt==null?0:jt.length;for(br&&yr&&(Gt=jt[--yr]);yr--;)Gt=Qt(Gt,jt[yr],yr,jt);return Gt}function Fo(jt,Qt){for(var Gt=-1,br=jt==null?0:jt.length;++Gt<br;)if(Qt(jt[Gt],Gt,jt))return!0;return!1}var na=Bf("length");function ku(jt){return jt.split("")}function Mr(jt){return jt.match(Lt)||[]}function Jl(jt,Qt,Gt){var br;return Gt(jt,function(yr,Sr,Or){if(Qt(yr,Sr,Or))return br=Sr,!1}),br}function gn(jt,Qt,Gt,br){for(var yr=jt.length,Sr=Gt+(br?1:-1);br?Sr--:++Sr<yr;)if(Qt(jt[Sr],Sr,jt))return Sr;return-1}function Ch(jt,Qt,Gt){return Qt===Qt?Bd(jt,Qt,Gt):gn(jt,Ig,Gt)}function bs(jt,Qt,Gt,br){for(var yr=Gt-1,Sr=jt.length;++yr<Sr;)if(br(jt[yr],Qt))return yr;return-1}function Ig(jt){return jt!==jt}function Nm(jt,Qt){var Gt=jt==null?0:jt.length;return Gt?kg(jt,Qt)/Gt:Z}function Bf(jt){return function(Qt){return Qt==null?h:Qt[jt]}}function F0(jt){return function(Qt){return jt==null?h:jt[Qt]}}function lv(jt,Qt,Gt,br,yr){return yr(jt,function(Sr,Or,Ir){Gt=br?(br=!1,Sr):Qt(Gt,Sr,Or,Ir)}),Gt}function ma(jt,Qt){var Gt=jt.length;for(jt.sort(Qt);Gt--;)jt[Gt]=jt[Gt].value;return jt}function kg(jt,Qt){for(var Gt,br=-1,yr=jt.length;++br<yr;){var Sr=Qt(jt[br]);Sr!==h&&(Gt=Gt===h?Sr:Gt+Sr)}return Gt}function Mm(jt,Qt){for(var Gt=-1,br=Array(jt);++Gt<jt;)br[Gt]=Qt(Gt);return br}function lA(jt,Qt){return Hn(Qt,function(Gt){return[Gt,jt[Gt]]})}function fv(jt){return jt&&jt.slice(0,ut(jt)+1).replace(dr,"")}function Ha(jt){return function(Qt){return jt(Qt)}}function xd(jt,Qt){return Hn(Qt,function(Gt){return jt[Gt]})}function Ql(jt,Qt){return jt.has(Qt)}function Lm(jt,Qt){for(var Gt=-1,br=jt.length;++Gt<br&&Ch(Qt,jt[Gt],0)>-1;);return Gt}function ll(jt,Qt){for(var Gt=jt.length;Gt--&&Ch(Qt,jt[Gt],0)>-1;);return Gt}function fA(jt,Qt){for(var Gt=jt.length,br=0;Gt--;)jt[Gt]===Qt&&++br;return br}var Dm=F0(Cd),W0=F0(Wa);function ec(jt){return"\\"+kh[jt]}function Yo(jt,Qt){return jt==null?h:jt[Qt]}function Of(jt){return kd.test(jt)}function Oc(jt){return Tg.test(jt)}function _S(jt){for(var Qt,Gt=[];!(Qt=jt.next()).done;)Gt.push(Qt.value);return Gt}function Rg(jt){var Qt=-1,Gt=Array(jt.size);return jt.forEach(function(br,yr){Gt[++Qt]=[yr,br]}),Gt}function dv(jt,Qt){return function(Gt){return jt(Qt(Gt))}}function Ru(jt,Qt){for(var Gt=-1,br=jt.length,yr=0,Sr=[];++Gt<br;){var Or=jt[Gt];(Or===Qt||Or===C)&&(jt[Gt]=C,Sr[yr++]=Gt)}return Sr}function H0(jt){var Qt=-1,Gt=Array(jt.size);return jt.forEach(function(br){Gt[++Qt]=br}),Gt}function z0(jt){var Qt=-1,Gt=Array(jt.size);return jt.forEach(function(br){Gt[++Qt]=[br,br]}),Gt}function Bd(jt,Qt,Gt){for(var br=Gt-1,yr=jt.length;++br<yr;)if(jt[br]===Qt)return br;return-1}function hv(jt,Qt,Gt){for(var br=Gt+1;br--;)if(jt[br]===Qt)return br;return br}function Te(jt){return Of(jt)?Nt(jt):na(jt)}function Fe(jt){return Of(jt)?qt(jt):ku(jt)}function ut(jt){for(var Qt=jt.length;Qt--&&at.test(jt.charAt(Qt)););return Qt}var St=F0(Ih);function Nt(jt){for(var Qt=Id.lastIndex=0;Id.test(jt);)++Qt;return Qt}function qt(jt){return jt.match(Id)||[]}function lr(jt){return jt.match(Iu)||[]}var gr=function jt(Qt){Qt=Qt==null?Co:Er.defaults(Co.Object(),Qt,Er.pick(Co,Rd));var Gt=Qt.Array,br=Qt.Date,yr=Qt.Error,Sr=Qt.Function,Or=Qt.Math,Ir=Qt.Object,Vr=Qt.RegExp,Gr=Qt.String,jr=Qt.TypeError,dn=Gt.prototype,Pn=Sr.prototype,Dn=Ir.prototype,Cn=Qt["__core-js_shared__"],Ln=Pn.toString,Yr=Dn.hasOwnProperty,Un=0,ii=function(){var W=/[^.]+$/.exec(Cn&&Cn.keys&&Cn.keys.IE_PROTO||"");return W?"Symbol(src)_1."+W:""}(),Hi=Dn.toString,Zi=Ln.call(Ir),Bi=Co._,Cu=Vr("^"+Ln.call(Yr).replace(Tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Si=po?Qt.Buffer:h,Li=Qt.Symbol,ia=Qt.Uint8Array,$0=Si?Si.allocUnsafe:h,ba=dv(Ir.getPrototypeOf,Ir),Od=Ir.create,xh=Dn.propertyIsEnumerable,Pc=dn.splice,Cg=Li?Li.isConcatSpreadable:h,Um=Li?Li.iterator:h,xu=Li?Li.toStringTag:h,ef=function(){try{var W=rp(Ir,"defineProperty");return W({},"",{}),W}catch{}}(),Fm=Qt.clearTimeout!==Co.clearTimeout&&Qt.clearTimeout,M4=br&&br.now!==Co.Date.now&&br.now,no=Qt.setTimeout!==Co.setTimeout&&Qt.setTimeout,Pf=Or.ceil,Za=Or.floor,ES=Ir.getOwnPropertySymbols,Pd=Si?Si.isBuffer:h,za=Qt.isFinite,L4=dn.join,fl=dv(Ir.keys,Ir),No=Or.max,Ya=Or.min,D4=br.now,U4=Qt.parseInt,dA=Or.random,Wm=dn.reverse,Hm=rp(Qt,"DataView"),tf=rp(Qt,"Map"),xg=rp(Qt,"Promise"),Bg=rp(Qt,"Set"),Nc=rp(Qt,"WeakMap"),Og=rp(Ir,"create"),Bh=Nc&&new Nc,Nd={},F4=rc(Hm),W4=rc(tf),TS=rc(xg),hA=rc(Bg),H4=rc(Nc),zm=Li?Li.prototype:h,Oh=zm?zm.valueOf:h,Ph=zm?zm.toString:h;function Zt(W){if(go(W)&&!Gi(W)&&!(W instanceof ps)){if(W instanceof dl)return W;if(Yr.call(W,"__wrapped__"))return Dx(W)}return new dl(W)}var Xi=function(){function W(){}return function(ne){if(!zo(ne))return{};if(Od)return Od(ne);W.prototype=ne;var Oe=new W;return W.prototype=h,Oe}}();function Gn(){}function dl(W,ne){this.__wrapped__=W,this.__actions__=[],this.__chain__=!!ne,this.__index__=0,this.__values__=h}Zt.templateSettings={escape:bt,evaluate:Mt,interpolate:tr,variable:"",imports:{_:Zt}},Zt.prototype=Gn.prototype,Zt.prototype.constructor=Zt,dl.prototype=Xi(Gn.prototype),dl.prototype.constructor=dl;function ps(W){this.__wrapped__=W,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=z,this.__views__=[]}function z4(){var W=new ps(this.__wrapped__);return W.__actions__=Lc(this.__actions__),W.__dir__=this.__dir__,W.__filtered__=this.__filtered__,W.__iteratees__=Lc(this.__iteratees__),W.__takeCount__=this.__takeCount__,W.__views__=Lc(this.__views__),W}function $4(){if(this.__filtered__){var W=new ps(this);W.__dir__=-1,W.__filtered__=!0}else W=this.clone(),W.__dir__*=-1;return W}function V4(){var W=this.__wrapped__.value(),ne=this.__dir__,Oe=Gi(W),ht=ne<0,Ut=Oe?W.length:0,rr=Wh(0,Ut,this.__views__),mr=rr.start,Cr=rr.end,Lr=Cr-mr,wn=ht?Cr:mr-1,_n=this.__iteratees__,Rn=_n.length,Jn=0,vi=Ya(Lr,this.__takeCount__);if(!Oe||!ht&&Ut==Lr&&vi==Lr)return kA(W,this.__actions__);var Ri=[];e:for(;Lr--&&Jn<vi;){wn+=ne;for(var ns=-1,Di=W[wn];++ns<Rn;){var gs=_n[ns],Ts=gs.iteratee,vl=gs.type,oc=Ts(Di);if(vl==$)Di=oc;else if(!oc){if(vl==L)continue e;break e}}Ri[Jn++]=Di}return Ri}ps.prototype=Xi(Gn.prototype),ps.prototype.constructor=ps;function V0(W){var ne=-1,Oe=W==null?0:W.length;for(this.clear();++ne<Oe;){var ht=W[ne];this.set(ht[0],ht[1])}}function j4(){this.__data__=Og?Og(null):{},this.size=0}function K4(W){var ne=this.has(W)&&delete this.__data__[W];return this.size-=ne?1:0,ne}function Mo(W){var ne=this.__data__;if(Og){var Oe=ne[W];return Oe===p?h:Oe}return Yr.call(ne,W)?ne[W]:h}function pA(W){var ne=this.__data__;return Og?ne[W]!==h:Yr.call(ne,W)}function gA(W,ne){var Oe=this.__data__;return this.size+=this.has(W)?0:1,Oe[W]=Og&&ne===h?p:ne,this}V0.prototype.clear=j4,V0.prototype.delete=K4,V0.prototype.get=Mo,V0.prototype.has=pA,V0.prototype.set=gA;function ds(W){var ne=-1,Oe=W==null?0:W.length;for(this.clear();++ne<Oe;){var ht=W[ne];this.set(ht[0],ht[1])}}function RW(){this.__data__=[],this.size=0}function CW(W){var ne=this.__data__,Oe=mA(ne,W);if(Oe<0)return!1;var ht=ne.length-1;return Oe==ht?ne.pop():Pc.call(ne,Oe,1),--this.size,!0}function G4(W){var ne=this.__data__,Oe=mA(ne,W);return Oe<0?h:ne[Oe][1]}function rf(W){return mA(this.__data__,W)>-1}function q4(W,ne){var Oe=this.__data__,ht=mA(Oe,W);return ht<0?(++this.size,Oe.push([W,ne])):Oe[ht][1]=ne,this}ds.prototype.clear=RW,ds.prototype.delete=CW,ds.prototype.get=G4,ds.prototype.has=rf,ds.prototype.set=q4;function Md(W){var ne=-1,Oe=W==null?0:W.length;for(this.clear();++ne<Oe;){var ht=W[ne];this.set(ht[0],ht[1])}}function Z4(){this.size=0,this.__data__={hash:new V0,map:new(tf||ds),string:new V0}}function Y4(W){var ne=Bv(this,W).delete(W);return this.size-=ne?1:0,ne}function X4(W){return Bv(this,W).get(W)}function J4(W){return Bv(this,W).has(W)}function Q4(W,ne){var Oe=Bv(this,W),ht=Oe.size;return Oe.set(W,ne),this.size+=Oe.size==ht?0:1,this}Md.prototype.clear=Z4,Md.prototype.delete=Y4,Md.prototype.get=X4,Md.prototype.has=J4,Md.prototype.set=Q4;function j0(W){var ne=-1,Oe=W==null?0:W.length;for(this.__data__=new Md;++ne<Oe;)this.add(W[ne])}function ex(W){return this.__data__.set(W,p),this}function tx(W){return this.__data__.has(W)}j0.prototype.add=j0.prototype.push=ex,j0.prototype.has=tx;function nf(W){var ne=this.__data__=new ds(W);this.size=ne.size}function rx(){this.__data__=new ds,this.size=0}function nx(W){var ne=this.__data__,Oe=ne.delete(W);return this.size=ne.size,Oe}function ix(W){return this.__data__.get(W)}function sx(W){return this.__data__.has(W)}function hn(W,ne){var Oe=this.__data__;if(Oe instanceof ds){var ht=Oe.__data__;if(!tf||ht.length<E-1)return ht.push([W,ne]),this.size=++Oe.size,this;Oe=this.__data__=new Md(ht)}return Oe.set(W,ne),this.size=Oe.size,this}nf.prototype.clear=rx,nf.prototype.delete=nx,nf.prototype.get=ix,nf.prototype.has=sx,nf.prototype.set=hn;function SS(W,ne){var Oe=Gi(W),ht=!Oe&&op(W),Ut=!Oe&&!ht&&Fd(W),rr=!Oe&&!ht&&!Ut&&cb(W),mr=Oe||ht||Ut||rr,Cr=mr?Mm(W.length,Gr):[],Lr=Cr.length;for(var wn in W)(ne||Yr.call(W,wn))&&!(mr&&(wn=="length"||Ut&&(wn=="offset"||wn=="parent")||rr&&(wn=="buffer"||wn=="byteLength"||wn=="byteOffset")||Ud(wn,Lr)))&&Cr.push(wn);return Cr}function Nh(W){var ne=W.length;return ne?W[LS(0,ne-1)]:h}function tc(W,ne){return Mv(Lc(W),K0(ne,0,W.length))}function yA(W){return Mv(Lc(W))}function pv(W,ne,Oe){(Oe!==h&&!Wf(W[ne],Oe)||Oe===h&&!(ne in W))&&sf(W,ne,Oe)}function gv(W,ne,Oe){var ht=W[ne];(!(Yr.call(W,ne)&&Wf(ht,Oe))||Oe===h&&!(ne in W))&&sf(W,ne,Oe)}function mA(W,ne){for(var Oe=W.length;Oe--;)if(Wf(W[Oe][0],ne))return Oe;return-1}function $m(W,ne,Oe,ht){return lu(W,function(Ut,rr,mr){ne(ht,Ut,Oe(Ut),mr)}),ht}function Vm(W,ne){return W&&Dd(ne,Ra(ne),W)}function xW(W,ne){return W&&Dd(ne,Lu(ne),W)}function sf(W,ne,Oe){ne=="__proto__"&&ef?ef(W,ne,{configurable:!0,enumerable:!0,value:Oe,writable:!0}):W[ne]=Oe}function bA(W,ne){for(var Oe=-1,ht=ne.length,Ut=Gt(ht),rr=W==null;++Oe<ht;)Ut[Oe]=rr?h:NI(W,ne[Oe]);return Ut}function K0(W,ne,Oe){return W===W&&(Oe!==h&&(W=W<=Oe?W:Oe),ne!==h&&(W=W>=ne?W:ne)),W}function hl(W,ne,Oe,ht,Ut,rr){var mr,Cr=ne&x,Lr=ne&R,wn=ne&S;if(Oe&&(mr=Ut?Oe(W,ht,Ut,rr):Oe(W)),mr!==h)return mr;if(!zo(W))return W;var _n=Gi(W);if(_n){if(mr=Ov(W),!Cr)return Lc(W,mr)}else{var Rn=Wo(W),Jn=Rn==me||Rn==Ke;if(Fd(W))return Tv(W,Cr);if(Rn==Ge||Rn==Q||Jn&&!Ut){if(mr=Lr||Jn?{}:Ix(W),!Cr)return Lr?Pg(W,xW(mr,W)):qW(W,Vm(mr,W))}else{if(!qs[Rn])return Ut?W:{};mr=Pv(W,Rn,Cr)}}rr||(rr=new nf);var vi=rr.get(W);if(vi)return vi;rr.set(W,mr),Wg(W)?W.forEach(function(Di){mr.add(hl(Di,ne,Oe,Di,W,rr))}):RI(W)&&W.forEach(function(Di,gs){mr.set(gs,hl(Di,ne,Oe,gs,W,rr))});var Ri=wn?Lr?xv:Cv:Lr?Lu:Ra,ns=_n?h:Ri(W);return Mn(ns||W,function(Di,gs){ns&&(gs=Di,Di=W[gs]),gv(mr,gs,hl(Di,ne,Oe,gs,W,rr))}),mr}function BW(W){var ne=Ra(W);return function(Oe){return ox(Oe,W,ne)}}function ox(W,ne,Oe){var ht=Oe.length;if(W==null)return!ht;for(W=Ir(W);ht--;){var Ut=Oe[ht],rr=ne[Ut],mr=W[Ut];if(mr===h&&!(Ut in W)||!rr(mr))return!1}return!0}function IS(W,ne,Oe){if(typeof W!="function")throw new jr(c);return Nv(function(){W.apply(h,Oe)},ne)}function jm(W,ne,Oe,ht){var Ut=-1,rr=yi,mr=!0,Cr=W.length,Lr=[],wn=ne.length;if(!Cr)return Lr;Oe&&(ne=Hn(ne,Ha(Oe))),ht?(rr=xi,mr=!1):ne.length>=E&&(rr=Ql,mr=!1,ne=new j0(ne));e:for(;++Ut<Cr;){var _n=W[Ut],Rn=Oe==null?_n:Oe(_n);if(_n=ht||_n!==0?_n:0,mr&&Rn===Rn){for(var Jn=wn;Jn--;)if(ne[Jn]===Rn)continue e;Lr.push(_n)}else rr(ne,Rn,ht)||Lr.push(_n)}return Lr}var lu=CA(of),ax=CA(vA,!0);function Nf(W,ne){var Oe=!0;return lu(W,function(ht,Ut,rr){return Oe=!!ne(ht,Ut,rr),Oe}),Oe}function yv(W,ne,Oe){for(var ht=-1,Ut=W.length;++ht<Ut;){var rr=W[ht],mr=ne(rr);if(mr!=null&&(Cr===h?mr===mr&&!yl(mr):Oe(mr,Cr)))var Cr=mr,Lr=rr}return Lr}function ux(W,ne,Oe,ht){var Ut=W.length;for(Oe=ji(Oe),Oe<0&&(Oe=-Oe>Ut?0:Ut+Oe),ht=ht===h||ht>Ut?Ut:ji(ht),ht<0&&(ht+=Ut),ht=Oe>ht?0:va(ht);Oe<ht;)W[Oe++]=ne;return W}function mv(W,ne){var Oe=[];return lu(W,function(ht,Ut,rr){ne(ht,Ut,rr)&&Oe.push(ht)}),Oe}function ka(W,ne,Oe,ht,Ut){var rr=-1,mr=W.length;for(Oe||(Oe=YS),Ut||(Ut=[]);++rr<mr;){var Cr=W[rr];ne>0&&Oe(Cr)?ne>1?ka(Cr,ne-1,Oe,ht,Ut):Os(Ut,Cr):ht||(Ut[Ut.length]=Cr)}return Ut}var Mc=Xm(),kS=Xm(!0);function of(W,ne){return W&&Mc(W,ne,Ra)}function vA(W,ne){return W&&kS(W,ne,Ra)}function G0(W,ne){return Bs(ne,function(Oe){return Wd(W[Oe])})}function af(W,ne){ne=X0(ne,W);for(var Oe=0,ht=ne.length;W!=null&&Oe<ht;)W=W[Ja(ne[Oe++])];return Oe&&Oe==ht?W:h}function cx(W,ne,Oe){var ht=ne(W);return Gi(W)?ht:Os(ht,Oe(W))}function sa(W){return W==null?W===h?lt:Le:xu&&xu in Ir(W)?Tx(W):Px(W)}function RS(W,ne){return W>ne}function OW(W,ne){return W!=null&&Yr.call(W,ne)}function PW(W,ne){return W!=null&&ne in Ir(W)}function NW(W,ne,Oe){return W>=Ya(ne,Oe)&&W<No(ne,Oe)}function CS(W,ne,Oe){for(var ht=Oe?xi:yi,Ut=W[0].length,rr=W.length,mr=rr,Cr=Gt(rr),Lr=1/0,wn=[];mr--;){var _n=W[mr];mr&&ne&&(_n=Hn(_n,Ha(ne))),Lr=Ya(_n.length,Lr),Cr[mr]=!Oe&&(ne||Ut>=120&&_n.length>=120)?new j0(mr&&_n):h}_n=W[0];var Rn=-1,Jn=Cr[0];e:for(;++Rn<Ut&&wn.length<Lr;){var vi=_n[Rn],Ri=ne?ne(vi):vi;if(vi=Oe||vi!==0?vi:0,!(Jn?Ql(Jn,Ri):ht(wn,Ri,Oe))){for(mr=rr;--mr;){var ns=Cr[mr];if(!(ns?Ql(ns,Ri):ht(W[mr],Ri,Oe)))continue e}Jn&&Jn.push(Ri),wn.push(vi)}}return wn}function MW(W,ne,Oe,ht){return of(W,function(Ut,rr,mr){ne(ht,Oe(Ut),rr,mr)}),ht}function Km(W,ne,Oe){ne=X0(ne,W),W=Nx(W,ne);var ht=W==null?W:W[Ja(Mu(ne))];return ht==null?h:Xn(ht,W,Oe)}function xS(W){return go(W)&&sa(W)==Q}function LW(W){return go(W)&&sa(W)==rt}function DW(W){return go(W)&&sa(W)==be}function bv(W,ne,Oe,ht,Ut){return W===ne?!0:W==null||ne==null||!go(W)&&!go(ne)?W!==W&&ne!==ne:UW(W,ne,Oe,ht,bv,Ut)}function UW(W,ne,Oe,ht,Ut,rr){var mr=Gi(W),Cr=Gi(ne),Lr=mr?oe:Wo(W),wn=Cr?oe:Wo(ne);Lr=Lr==Q?Ge:Lr,wn=wn==Q?Ge:wn;var _n=Lr==Ge,Rn=wn==Ge,Jn=Lr==wn;if(Jn&&Fd(W)){if(!Fd(ne))return!1;mr=!0,_n=!1}if(Jn&&!_n)return rr||(rr=new nf),mr||cb(W)?GS(W,ne,Oe,ht,Ut,rr):PA(W,ne,Lr,Oe,ht,Ut,rr);if(!(Oe&O)){var vi=_n&&Yr.call(W,"__wrapped__"),Ri=Rn&&Yr.call(ne,"__wrapped__");if(vi||Ri){var ns=vi?W.value():W,Di=Ri?ne.value():ne;return rr||(rr=new nf),Ut(ns,Di,Oe,ht,rr)}}return Jn?(rr||(rr=new nf),YW(W,ne,Oe,ht,Ut,rr)):!1}function FW(W){return go(W)&&Wo(W)==He}function BS(W,ne,Oe,ht){var Ut=Oe.length,rr=Ut,mr=!ht;if(W==null)return!rr;for(W=Ir(W);Ut--;){var Cr=Oe[Ut];if(mr&&Cr[2]?Cr[1]!==W[Cr[0]]:!(Cr[0]in W))return!1}for(;++Ut<rr;){Cr=Oe[Ut];var Lr=Cr[0],wn=W[Lr],_n=Cr[1];if(mr&&Cr[2]){if(wn===h&&!(Lr in W))return!1}else{var Rn=new nf;if(ht)var Jn=ht(wn,_n,Lr,W,ne,Rn);if(!(Jn===h?bv(_n,wn,O|M,ht,Rn):Jn))return!1}}return!0}function OS(W){if(!zo(W)||Rx(W))return!1;var ne=Wd(W)?Cu:$r;return ne.test(rc(W))}function WW(W){return go(W)&&sa(W)==Ze}function lx(W){return go(W)&&Wo(W)==_t}function HW(W){return go(W)&&Vh(W.length)&&!!Ds[sa(W)]}function wA(W){return typeof W=="function"?W:W==null?Uc:typeof W=="object"?Gi(W)?dx(W[0],W[1]):PS(W):P5(W)}function AA(W){if(!tb(W))return fl(W);var ne=[];for(var Oe in Ir(W))Yr.call(W,Oe)&&Oe!="constructor"&&ne.push(Oe);return ne}function fx(W){if(!zo(W))return Ox(W);var ne=tb(W),Oe=[];for(var ht in W)ht=="constructor"&&(ne||!Yr.call(W,ht))||Oe.push(ht);return Oe}function vv(W,ne){return W<ne}function _A(W,ne){var Oe=-1,ht=sc(W)?Gt(W.length):[];return lu(W,function(Ut,rr,mr){ht[++Oe]=ne(Ut,rr,mr)}),ht}function PS(W){var ne=NA(W);return ne.length==1&&ne[0][2]?JS(ne[0][0],ne[0][1]):function(Oe){return Oe===W||BS(Oe,W,ne)}}function dx(W,ne){return LA(W)&&XS(ne)?JS(Ja(W),ne):function(Oe){var ht=NI(Oe,W);return ht===h&&ht===ne?u_(Oe,W):bv(ne,ht,O|M)}}function EA(W,ne,Oe,ht,Ut){W!==ne&&Mc(ne,function(rr,mr){if(Ut||(Ut=new nf),zo(rr))Mf(W,ne,mr,Oe,EA,ht,Ut);else{var Cr=ht?ht(eI(W,mr),rr,mr+"",W,ne,Ut):h;Cr===h&&(Cr=rr),pv(W,mr,Cr)}},Lu)}function Mf(W,ne,Oe,ht,Ut,rr,mr){var Cr=eI(W,Oe),Lr=eI(ne,Oe),wn=mr.get(Lr);if(wn){pv(W,Oe,wn);return}var _n=rr?rr(Cr,Lr,Oe+"",W,ne,mr):h,Rn=_n===h;if(Rn){var Jn=Gi(Lr),vi=!Jn&&Fd(Lr),Ri=!Jn&&!vi&&cb(Lr);_n=Lr,Jn||vi||Ri?Gi(Cr)?_n=Cr:io(Cr)?_n=Lc(Cr):vi?(Rn=!1,_n=Tv(Lr,!0)):Ri?(Rn=!1,_n=yx(Lr,!0)):_n=[]:cp(Lr)||op(Lr)?(_n=Cr,op(Cr)?_n=$d(Cr):(!zo(Cr)||Wd(Cr))&&(_n=Ix(Lr))):Rn=!1}Rn&&(mr.set(Lr,_n),Ut(_n,Lr,ht,rr,mr),mr.delete(Lr)),pv(W,Oe,_n)}function hx(W,ne){var Oe=W.length;if(Oe)return ne+=ne<0?Oe:0,Ud(ne,Oe)?W[ne]:h}function px(W,ne,Oe){ne.length?ne=Hn(ne,function(rr){return Gi(rr)?function(mr){return af(mr,rr.length===1?rr[0]:rr)}:rr}):ne=[Uc];var ht=-1;ne=Hn(ne,Ha(Ni()));var Ut=_A(W,function(rr,mr,Cr){var Lr=Hn(ne,function(wn){return wn(rr)});return{criteria:Lr,index:++ht,value:rr}});return ma(Ut,function(rr,mr){return GW(rr,mr,Oe)})}function TA(W,ne){return NS(W,ne,function(Oe,ht){return u_(W,ht)})}function NS(W,ne,Oe){for(var ht=-1,Ut=ne.length,rr={};++ht<Ut;){var mr=ne[ht],Cr=af(W,mr);Oe(Cr,mr)&&Av(rr,X0(mr,W),Cr)}return rr}function SA(W){return function(ne){return af(ne,W)}}function MS(W,ne,Oe,ht){var Ut=ht?bs:Ch,rr=-1,mr=ne.length,Cr=W;for(W===ne&&(ne=Lc(ne)),Oe&&(Cr=Hn(W,Ha(Oe)));++rr<mr;)for(var Lr=0,wn=ne[rr],_n=Oe?Oe(wn):wn;(Lr=Ut(Cr,_n,Lr,ht))>-1;)Cr!==W&&Pc.call(Cr,Lr,1),Pc.call(W,Lr,1);return W}function gx(W,ne){for(var Oe=W?ne.length:0,ht=Oe-1;Oe--;){var Ut=ne[Oe];if(Oe==ht||Ut!==rr){var rr=Ut;Ud(Ut)?Pc.call(W,Ut,1):Z0(W,Ut)}}return W}function LS(W,ne){return W+Za(dA()*(ne-W+1))}function DS(W,ne,Oe,ht){for(var Ut=-1,rr=No(Pf((ne-W)/(Oe||1)),0),mr=Gt(rr);rr--;)mr[ht?rr:++Ut]=W,W+=Oe;return mr}function US(W,ne){var Oe="";if(!W||ne<1||ne>j)return Oe;do ne%2&&(Oe+=W),ne=Za(ne/2),ne&&(W+=W);while(ne);return Oe}function ss(W,ne){return tI(QS(W,ne,Uc),W+"")}function zW(W){return Nh(Hg(W))}function wv(W,ne){var Oe=Hg(W);return Mv(Oe,K0(ne,0,Oe.length))}function Av(W,ne,Oe,ht){if(!zo(W))return W;ne=X0(ne,W);for(var Ut=-1,rr=ne.length,mr=rr-1,Cr=W;Cr!=null&&++Ut<rr;){var Lr=Ja(ne[Ut]),wn=Oe;if(Lr==="__proto__"||Lr==="constructor"||Lr==="prototype")return W;if(Ut!=mr){var _n=Cr[Lr];wn=ht?ht(_n,Lr,Cr):h,wn===h&&(wn=zo(_n)?_n:Ud(ne[Ut+1])?[]:{})}gv(Cr,Lr,wn),Cr=Cr[Lr]}return W}var Mh=Bh?function(W,ne){return Bh.set(W,ne),W}:Uc,Gm=ef?function(W,ne){return ef(W,"toString",{configurable:!0,enumerable:!1,value:KI(ne),writable:!0})}:Uc;function FS(W){return Mv(Hg(W))}function Bu(W,ne,Oe){var ht=-1,Ut=W.length;ne<0&&(ne=-ne>Ut?0:Ut+ne),Oe=Oe>Ut?Ut:Oe,Oe<0&&(Oe+=Ut),Ut=ne>Oe?0:Oe-ne>>>0,ne>>>=0;for(var rr=Gt(Ut);++ht<Ut;)rr[ht]=W[ht+ne];return rr}function IA(W,ne){var Oe;return lu(W,function(ht,Ut,rr){return Oe=ne(ht,Ut,rr),!Oe}),!!Oe}function qm(W,ne,Oe){var ht=0,Ut=W==null?ht:W.length;if(typeof ne=="number"&&ne===ne&&Ut<=te){for(;ht<Ut;){var rr=ht+Ut>>>1,mr=W[rr];mr!==null&&!yl(mr)&&(Oe?mr<=ne:mr<ne)?ht=rr+1:Ut=rr}return Ut}return Lh(W,ne,Uc,Oe)}function Lh(W,ne,Oe,ht){var Ut=0,rr=W==null?0:W.length;if(rr===0)return 0;ne=Oe(ne);for(var mr=ne!==ne,Cr=ne===null,Lr=yl(ne),wn=ne===h;Ut<rr;){var _n=Za((Ut+rr)/2),Rn=Oe(W[_n]),Jn=Rn!==h,vi=Rn===null,Ri=Rn===Rn,ns=yl(Rn);if(mr)var Di=ht||Ri;else wn?Di=Ri&&(ht||Jn):Cr?Di=Ri&&Jn&&(ht||!vi):Lr?Di=Ri&&Jn&&!vi&&(ht||!ns):vi||ns?Di=!1:Di=ht?Rn<=ne:Rn<ne;Di?Ut=_n+1:rr=_n}return Ya(rr,fe)}function Zm(W,ne){for(var Oe=-1,ht=W.length,Ut=0,rr=[];++Oe<ht;){var mr=W[Oe],Cr=ne?ne(mr):mr;if(!Oe||!Wf(Cr,Lr)){var Lr=Cr;rr[Ut++]=mr===0?0:mr}}return rr}function WS(W){return typeof W=="number"?W:yl(W)?Z:+W}function pl(W){if(typeof W=="string")return W;if(Gi(W))return Hn(W,pl)+"";if(yl(W))return Ph?Ph.call(W):"";var ne=W+"";return ne=="0"&&1/W==-N?"-0":ne}function q0(W,ne,Oe){var ht=-1,Ut=yi,rr=W.length,mr=!0,Cr=[],Lr=Cr;if(Oe)mr=!1,Ut=xi;else if(rr>=E){var wn=ne?null:Ex(W);if(wn)return H0(wn);mr=!1,Ut=Ql,Lr=new j0}else Lr=ne?[]:Cr;e:for(;++ht<rr;){var _n=W[ht],Rn=ne?ne(_n):_n;if(_n=Oe||_n!==0?_n:0,mr&&Rn===Rn){for(var Jn=Lr.length;Jn--;)if(Lr[Jn]===Rn)continue e;ne&&Lr.push(Rn),Cr.push(_n)}else Ut(Lr,Rn,Oe)||(Lr!==Cr&&Lr.push(Rn),Cr.push(_n))}return Cr}function Z0(W,ne){return ne=X0(ne,W),W=Nx(W,ne),W==null||delete W[Ja(Mu(ne))]}function Ym(W,ne,Oe,ht){return Av(W,ne,Oe(af(W,ne)),ht)}function Y0(W,ne,Oe,ht){for(var Ut=W.length,rr=ht?Ut:-1;(ht?rr--:++rr<Ut)&&ne(W[rr],rr,W););return Oe?Bu(W,ht?0:rr,ht?rr+1:Ut):Bu(W,ht?rr+1:0,ht?Ut:rr)}function kA(W,ne){var Oe=W;return Oe instanceof ps&&(Oe=Oe.value()),Zs(ne,function(ht,Ut){return Ut.func.apply(Ut.thisArg,Os([ht],Ut.args))},Oe)}function _v(W,ne,Oe){var ht=W.length;if(ht<2)return ht?q0(W[0]):[];for(var Ut=-1,rr=Gt(ht);++Ut<ht;)for(var mr=W[Ut],Cr=-1;++Cr<ht;)Cr!=Ut&&(rr[Ut]=jm(rr[Ut]||mr,W[Cr],ne,Oe));return q0(ka(rr,1),ne,Oe)}function RA(W,ne,Oe){for(var ht=-1,Ut=W.length,rr=ne.length,mr={};++ht<Ut;){var Cr=ht<rr?ne[ht]:h;Oe(mr,W[ht],Cr)}return mr}function HS(W){return io(W)?W:[]}function zS(W){return typeof W=="function"?W:Uc}function X0(W,ne){return Gi(W)?W:LA(W,ne)?[W]:rI(Us(W))}var $W=ss;function Ld(W,ne,Oe){var ht=W.length;return Oe=Oe===h?ht:Oe,!ne&&Oe>=ht?W:Bu(W,ne,Oe)}var Ev=Fm||function(W){return Co.clearTimeout(W)};function Tv(W,ne){if(ne)return W.slice();var Oe=W.length,ht=$0?$0(Oe):new W.constructor(Oe);return W.copy(ht),ht}function Sv(W){var ne=new W.constructor(W.byteLength);return new ia(ne).set(new ia(W)),ne}function VW(W,ne){var Oe=ne?Sv(W.buffer):W.buffer;return new W.constructor(Oe,W.byteOffset,W.byteLength)}function jW(W){var ne=new W.constructor(W.source,kr.exec(W));return ne.lastIndex=W.lastIndex,ne}function KW(W){return Oh?Ir(Oh.call(W)):{}}function yx(W,ne){var Oe=ne?Sv(W.buffer):W.buffer;return new W.constructor(Oe,W.byteOffset,W.length)}function mx(W,ne){if(W!==ne){var Oe=W!==h,ht=W===null,Ut=W===W,rr=yl(W),mr=ne!==h,Cr=ne===null,Lr=ne===ne,wn=yl(ne);if(!Cr&&!wn&&!rr&&W>ne||rr&&mr&&Lr&&!Cr&&!wn||ht&&mr&&Lr||!Oe&&Lr||!Ut)return 1;if(!ht&&!rr&&!wn&&W<ne||wn&&Oe&&Ut&&!ht&&!rr||Cr&&Oe&&Ut||!mr&&Ut||!Lr)return-1}return 0}function GW(W,ne,Oe){for(var ht=-1,Ut=W.criteria,rr=ne.criteria,mr=Ut.length,Cr=Oe.length;++ht<mr;){var Lr=mx(Ut[ht],rr[ht]);if(Lr){if(ht>=Cr)return Lr;var wn=Oe[ht];return Lr*(wn=="desc"?-1:1)}}return W.index-ne.index}function bx(W,ne,Oe,ht){for(var Ut=-1,rr=W.length,mr=Oe.length,Cr=-1,Lr=ne.length,wn=No(rr-mr,0),_n=Gt(Lr+wn),Rn=!ht;++Cr<Lr;)_n[Cr]=ne[Cr];for(;++Ut<mr;)(Rn||Ut<rr)&&(_n[Oe[Ut]]=W[Ut]);for(;wn--;)_n[Cr++]=W[Ut++];return _n}function vx(W,ne,Oe,ht){for(var Ut=-1,rr=W.length,mr=-1,Cr=Oe.length,Lr=-1,wn=ne.length,_n=No(rr-Cr,0),Rn=Gt(_n+wn),Jn=!ht;++Ut<_n;)Rn[Ut]=W[Ut];for(var vi=Ut;++Lr<wn;)Rn[vi+Lr]=ne[Lr];for(;++mr<Cr;)(Jn||Ut<rr)&&(Rn[vi+Oe[mr]]=W[Ut++]);return Rn}function Lc(W,ne){var Oe=-1,ht=W.length;for(ne||(ne=Gt(ht));++Oe<ht;)ne[Oe]=W[Oe];return ne}function Dd(W,ne,Oe,ht){var Ut=!Oe;Oe||(Oe={});for(var rr=-1,mr=ne.length;++rr<mr;){var Cr=ne[rr],Lr=ht?ht(Oe[Cr],W[Cr],Cr,Oe,W):h;Lr===h&&(Lr=W[Cr]),Ut?sf(Oe,Cr,Lr):gv(Oe,Cr,Lr)}return Oe}function qW(W,ne){return Dd(W,eb(W),ne)}function Pg(W,ne){return Dd(W,qS(W),ne)}function Iv(W,ne){return function(Oe,ht){var Ut=Gi(Oe)?Wn:$m,rr=ne?ne():{};return Ut(Oe,W,Ni(ht,2),rr)}}function Xa(W){return ss(function(ne,Oe){var ht=-1,Ut=Oe.length,rr=Ut>1?Oe[Ut-1]:h,mr=Ut>2?Oe[2]:h;for(rr=W.length>3&&typeof rr=="function"?(Ut--,rr):h,mr&&Ou(Oe[0],Oe[1],mr)&&(rr=Ut<3?h:rr,Ut=1),ne=Ir(ne);++ht<Ut;){var Cr=Oe[ht];Cr&&W(ne,Cr,ht,rr)}return ne})}function CA(W,ne){return function(Oe,ht){if(Oe==null)return Oe;if(!sc(Oe))return W(Oe,ht);for(var Ut=Oe.length,rr=ne?Ut:-1,mr=Ir(Oe);(ne?rr--:++rr<Ut)&&ht(mr[rr],rr,mr)!==!1;);return Oe}}function Xm(W){return function(ne,Oe,ht){for(var Ut=-1,rr=Ir(ne),mr=ht(ne),Cr=mr.length;Cr--;){var Lr=mr[W?Cr:++Ut];if(Oe(rr[Lr],Lr,rr)===!1)break}return ne}}function wx(W,ne,Oe){var ht=ne&k,Ut=kv(W);function rr(){var mr=this&&this!==Co&&this instanceof rr?Ut:W;return mr.apply(ht?Oe:this,arguments)}return rr}function J0(W){return function(ne){ne=Us(ne);var Oe=Of(ne)?Fe(ne):h,ht=Oe?Oe[0]:ne.charAt(0),Ut=Oe?Ld(Oe,1).join(""):ne.slice(1);return ht[W]()+Ut}}function Jm(W){return function(ne){return Zs(x5(fb(ne).replace(Sh,"")),W,"")}}function kv(W){return function(){var ne=arguments;switch(ne.length){case 0:return new W;case 1:return new W(ne[0]);case 2:return new W(ne[0],ne[1]);case 3:return new W(ne[0],ne[1],ne[2]);case 4:return new W(ne[0],ne[1],ne[2],ne[3]);case 5:return new W(ne[0],ne[1],ne[2],ne[3],ne[4]);case 6:return new W(ne[0],ne[1],ne[2],ne[3],ne[4],ne[5]);case 7:return new W(ne[0],ne[1],ne[2],ne[3],ne[4],ne[5],ne[6])}var Oe=Xi(W.prototype),ht=W.apply(Oe,ne);return zo(ht)?ht:Oe}}function ZW(W,ne,Oe){var ht=kv(W);function Ut(){for(var rr=arguments.length,mr=Gt(rr),Cr=rr,Lr=tp(Ut);Cr--;)mr[Cr]=arguments[Cr];var wn=rr<3&&mr[0]!==Lr&&mr[rr-1]!==Lr?[]:Ru(mr,Lr);if(rr-=wn.length,rr<Oe)return BA(W,ne,Q0,Ut.placeholder,h,mr,wn,h,h,Oe-rr);var _n=this&&this!==Co&&this instanceof Ut?ht:W;return Xn(_n,this,mr)}return Ut}function Dh(W){return function(ne,Oe,ht){var Ut=Ir(ne);if(!sc(ne)){var rr=Ni(Oe,3);ne=Ra(ne),Oe=function(Cr){return rr(Ut[Cr],Cr,Ut)}}var mr=W(ne,Oe,ht);return mr>-1?Ut[rr?ne[mr]:mr]:h}}function uf(W){return Fh(function(ne){var Oe=ne.length,ht=Oe,Ut=dl.prototype.thru;for(W&&ne.reverse();ht--;){var rr=ne[ht];if(typeof rr!="function")throw new jr(c);if(Ut&&!mr&&Qm(rr)=="wrapper")var mr=new dl([],!0)}for(ht=mr?ht:Oe;++ht<Oe;){rr=ne[ht];var Cr=Qm(rr),Lr=Cr=="wrapper"?ep(rr):h;Lr&&DA(Lr[0])&&Lr[1]==(X|F|ue|se)&&!Lr[4].length&&Lr[9]==1?mr=mr[Qm(Lr[0])].apply(mr,Lr[3]):mr=rr.length==1&&DA(rr)?mr[Cr]():mr.thru(rr)}return function(){var wn=arguments,_n=wn[0];if(mr&&wn.length==1&&Gi(_n))return mr.plant(_n).value();for(var Rn=0,Jn=Oe?ne[Rn].apply(this,wn):_n;++Rn<Oe;)Jn=ne[Rn].call(this,Jn);return Jn}})}function Q0(W,ne,Oe,ht,Ut,rr,mr,Cr,Lr,wn){var _n=ne&X,Rn=ne&k,Jn=ne&q,vi=ne&(F|G),Ri=ne&de,ns=Jn?h:kv(W);function Di(){for(var gs=arguments.length,Ts=Gt(gs),vl=gs;vl--;)Ts[vl]=arguments[vl];if(vi)var oc=tp(Di),wl=fA(Ts,oc);if(ht&&(Ts=bx(Ts,ht,Ut,vi)),rr&&(Ts=vx(Ts,rr,mr,vi)),gs-=wl,vi&&gs<wn){var wa=Ru(Ts,oc);return BA(W,ne,Q0,Di.placeholder,Oe,Ts,wa,Cr,Lr,wn-gs)}var Hf=Rn?Oe:this,Kh=Jn?Hf[W]:W;return gs=Ts.length,Cr?Ts=XW(Ts,Cr):Ri&&gs>1&&Ts.reverse(),_n&&Lr<gs&&(Ts.length=Lr),this&&this!==Co&&this instanceof Di&&(Kh=ns||kv(Kh)),Kh.apply(Hf,Ts)}return Di}function Ax(W,ne){return function(Oe,ht){return MW(Oe,W,ne(ht),{})}}function Rv(W,ne){return function(Oe,ht){var Ut;if(Oe===h&&ht===h)return ne;if(Oe!==h&&(Ut=Oe),ht!==h){if(Ut===h)return ht;typeof Oe=="string"||typeof ht=="string"?(Oe=pl(Oe),ht=pl(ht)):(Oe=WS(Oe),ht=WS(ht)),Ut=W(Oe,ht)}return Ut}}function $S(W){return Fh(function(ne){return ne=Hn(ne,Ha(Ni())),ss(function(Oe){var ht=this;return W(ne,function(Ut){return Xn(Ut,ht,Oe)})})})}function xA(W,ne){ne=ne===h?" ":pl(ne);var Oe=ne.length;if(Oe<2)return Oe?US(ne,W):ne;var ht=US(ne,Pf(W/Te(ne)));return Of(ne)?Ld(Fe(ht),0,W).join(""):ht.slice(0,W)}function _x(W,ne,Oe,ht){var Ut=ne&k,rr=kv(W);function mr(){for(var Cr=-1,Lr=arguments.length,wn=-1,_n=ht.length,Rn=Gt(_n+Lr),Jn=this&&this!==Co&&this instanceof mr?rr:W;++wn<_n;)Rn[wn]=ht[wn];for(;Lr--;)Rn[wn++]=arguments[++Cr];return Xn(Jn,Ut?Oe:this,Rn)}return mr}function VS(W){return function(ne,Oe,ht){return ht&&typeof ht!="number"&&Ou(ne,Oe,ht)&&(Oe=ht=h),ne=zd(ne),Oe===h?(Oe=ne,ne=0):Oe=zd(Oe),ht=ht===h?ne<Oe?1:-1:zd(ht),DS(ne,Oe,ht,W)}}function gl(W){return function(ne,Oe){return typeof ne=="string"&&typeof Oe=="string"||(ne=os(ne),Oe=os(Oe)),W(ne,Oe)}}function BA(W,ne,Oe,ht,Ut,rr,mr,Cr,Lr,wn){var _n=ne&F,Rn=_n?mr:h,Jn=_n?h:mr,vi=_n?rr:h,Ri=_n?h:rr;ne|=_n?ue:le,ne&=~(_n?le:ue),ne&b||(ne&=~(k|q));var ns=[W,ne,Ut,vi,Rn,Ri,Jn,Cr,Lr,wn],Di=Oe.apply(h,ns);return DA(W)&&Mx(Di,ns),Di.placeholder=ht,Lx(Di,W,ne)}function OA(W){var ne=Or[W];return function(Oe,ht){if(Oe=os(Oe),ht=ht==null?0:Ya(ji(ht),292),ht&&za(Oe)){var Ut=(Us(Oe)+"e").split("e"),rr=ne(Ut[0]+"e"+(+Ut[1]+ht));return Ut=(Us(rr)+"e").split("e"),+(Ut[0]+"e"+(+Ut[1]-ht))}return ne(Oe)}}var Ex=Bg&&1/H0(new Bg([,-0]))[1]==N?function(W){return new Bg(W)}:qI;function jS(W){return function(ne){var Oe=Wo(ne);return Oe==He?Rg(ne):Oe==_t?z0(ne):lA(ne,W(ne))}}function Lf(W,ne,Oe,ht,Ut,rr,mr,Cr){var Lr=ne&q;if(!Lr&&typeof W!="function")throw new jr(c);var wn=ht?ht.length:0;if(wn||(ne&=~(ue|le),ht=Ut=h),mr=mr===h?mr:No(ji(mr),0),Cr=Cr===h?Cr:ji(Cr),wn-=Ut?Ut.length:0,ne&le){var _n=ht,Rn=Ut;ht=Ut=h}var Jn=Lr?h:ep(W),vi=[W,ne,Oe,ht,Ut,_n,Rn,rr,mr,Cr];if(Jn&&Bx(vi,Jn),W=vi[0],ne=vi[1],Oe=vi[2],ht=vi[3],Ut=vi[4],Cr=vi[9]=vi[9]===h?Lr?0:W.length:No(vi[9]-wn,0),!Cr&&ne&(F|G)&&(ne&=~(F|G)),!ne||ne==k)var Ri=wx(W,ne,Oe);else ne==F||ne==G?Ri=ZW(W,ne,Cr):(ne==ue||ne==(k|ue))&&!Ut.length?Ri=_x(W,ne,Oe,ht):Ri=Q0.apply(h,vi);var ns=Jn?Mh:Mx;return Lx(ns(Ri,vi),W,ne)}function Uh(W,ne,Oe,ht){return W===h||Wf(W,Dn[Oe])&&!Yr.call(ht,Oe)?ne:W}function Ng(W,ne,Oe,ht,Ut,rr){return zo(W)&&zo(ne)&&(rr.set(ne,W),EA(W,ne,h,Ng,rr),rr.delete(ne)),W}function KS(W){return cp(W)?h:W}function GS(W,ne,Oe,ht,Ut,rr){var mr=Oe&O,Cr=W.length,Lr=ne.length;if(Cr!=Lr&&!(mr&&Lr>Cr))return!1;var wn=rr.get(W),_n=rr.get(ne);if(wn&&_n)return wn==ne&&_n==W;var Rn=-1,Jn=!0,vi=Oe&M?new j0:h;for(rr.set(W,ne),rr.set(ne,W);++Rn<Cr;){var Ri=W[Rn],ns=ne[Rn];if(ht)var Di=mr?ht(ns,Ri,Rn,ne,W,rr):ht(Ri,ns,Rn,W,ne,rr);if(Di!==h){if(Di)continue;Jn=!1;break}if(vi){if(!Fo(ne,function(gs,Ts){if(!Ql(vi,Ts)&&(Ri===gs||Ut(Ri,gs,Oe,ht,rr)))return vi.push(Ts)})){Jn=!1;break}}else if(!(Ri===ns||Ut(Ri,ns,Oe,ht,rr))){Jn=!1;break}}return rr.delete(W),rr.delete(ne),Jn}function PA(W,ne,Oe,ht,Ut,rr,mr){switch(Oe){case ke:if(W.byteLength!=ne.byteLength||W.byteOffset!=ne.byteOffset)return!1;W=W.buffer,ne=ne.buffer;case rt:return!(W.byteLength!=ne.byteLength||!rr(new ia(W),new ia(ne)));case ge:case be:case Ie:return Wf(+W,+ne);case Ee:return W.name==ne.name&&W.message==ne.message;case Ze:case Ft:return W==ne+"";case He:var Cr=Rg;case _t:var Lr=ht&O;if(Cr||(Cr=H0),W.size!=ne.size&&!Lr)return!1;var wn=mr.get(W);if(wn)return wn==ne;ht|=M,mr.set(W,ne);var _n=GS(Cr(W),Cr(ne),ht,Ut,rr,mr);return mr.delete(W),_n;case gt:if(Oh)return Oh.call(W)==Oh.call(ne)}return!1}function YW(W,ne,Oe,ht,Ut,rr){var mr=Oe&O,Cr=Cv(W),Lr=Cr.length,wn=Cv(ne),_n=wn.length;if(Lr!=_n&&!mr)return!1;for(var Rn=Lr;Rn--;){var Jn=Cr[Rn];if(!(mr?Jn in ne:Yr.call(ne,Jn)))return!1}var vi=rr.get(W),Ri=rr.get(ne);if(vi&&Ri)return vi==ne&&Ri==W;var ns=!0;rr.set(W,ne),rr.set(ne,W);for(var Di=mr;++Rn<Lr;){Jn=Cr[Rn];var gs=W[Jn],Ts=ne[Jn];if(ht)var vl=mr?ht(Ts,gs,Jn,ne,W,rr):ht(gs,Ts,Jn,W,ne,rr);if(!(vl===h?gs===Ts||Ut(gs,Ts,Oe,ht,rr):vl)){ns=!1;break}Di||(Di=Jn=="constructor")}if(ns&&!Di){var oc=W.constructor,wl=ne.constructor;oc!=wl&&"constructor"in W&&"constructor"in ne&&!(typeof oc=="function"&&oc instanceof oc&&typeof wl=="function"&&wl instanceof wl)&&(ns=!1)}return rr.delete(W),rr.delete(ne),ns}function Fh(W){return tI(QS(W,h,nb),W+"")}function Cv(W){return cx(W,Ra,eb)}function xv(W){return cx(W,Lu,qS)}var ep=Bh?function(W){return Bh.get(W)}:qI;function Qm(W){for(var ne=W.name+"",Oe=Nd[ne],ht=Yr.call(Nd,ne)?Oe.length:0;ht--;){var Ut=Oe[ht],rr=Ut.func;if(rr==null||rr==W)return Ut.name}return ne}function tp(W){var ne=Yr.call(Zt,"placeholder")?Zt:W;return ne.placeholder}function Ni(){var W=Zt.iteratee||zg;return W=W===zg?wA:W,arguments.length?W(arguments[0],arguments[1]):W}function Bv(W,ne){var Oe=W.__data__;return kx(ne)?Oe[typeof ne=="string"?"string":"hash"]:Oe.map}function NA(W){for(var ne=Ra(W),Oe=ne.length;Oe--;){var ht=ne[Oe],Ut=W[ht];ne[Oe]=[ht,Ut,XS(Ut)]}return ne}function rp(W,ne){var Oe=Yo(W,ne);return OS(Oe)?Oe:h}function Tx(W){var ne=Yr.call(W,xu),Oe=W[xu];try{W[xu]=h;var ht=!0}catch{}var Ut=Hi.call(W);return ht&&(ne?W[xu]=Oe:delete W[xu]),Ut}var eb=ES?function(W){return W==null?[]:(W=Ir(W),Bs(ES(W),function(ne){return xh.call(W,ne)}))}:w_,qS=ES?function(W){for(var ne=[];W;)Os(ne,eb(W)),W=ba(W);return ne}:w_,Wo=sa;(Hm&&Wo(new Hm(new ArrayBuffer(1)))!=ke||tf&&Wo(new tf)!=He||xg&&Wo(xg.resolve())!=Be||Bg&&Wo(new Bg)!=_t||Nc&&Wo(new Nc)!=dt)&&(Wo=function(W){var ne=sa(W),Oe=ne==Ge?W.constructor:h,ht=Oe?rc(Oe):"";if(ht)switch(ht){case F4:return ke;case W4:return He;case TS:return Be;case hA:return _t;case H4:return dt}return ne});function Wh(W,ne,Oe){for(var ht=-1,Ut=Oe.length;++ht<Ut;){var rr=Oe[ht],mr=rr.size;switch(rr.type){case"drop":W+=mr;break;case"dropRight":ne-=mr;break;case"take":ne=Ya(ne,W+mr);break;case"takeRight":W=No(W,ne-mr);break}}return{start:W,end:ne}}function ZS(W){var ne=W.match(At);return ne?ne[1].split(Je):[]}function Sx(W,ne,Oe){ne=X0(ne,W);for(var ht=-1,Ut=ne.length,rr=!1;++ht<Ut;){var mr=Ja(ne[ht]);if(!(rr=W!=null&&Oe(W,mr)))break;W=W[mr]}return rr||++ht!=Ut?rr:(Ut=W==null?0:W.length,!!Ut&&Vh(Ut)&&Ud(mr,Ut)&&(Gi(W)||op(W)))}function Ov(W){var ne=W.length,Oe=new W.constructor(ne);return ne&&typeof W[0]=="string"&&Yr.call(W,"index")&&(Oe.index=W.index,Oe.input=W.input),Oe}function Ix(W){return typeof W.constructor=="function"&&!tb(W)?Xi(ba(W)):{}}function Pv(W,ne,Oe){var ht=W.constructor;switch(ne){case rt:return Sv(W);case ge:case be:return new ht(+W);case ke:return VW(W,Oe);case xe:case Pe:case it:case Xe:case st:case It:case ft:case Jt:case Ot:return yx(W,Oe);case He:return new ht;case Ie:case Ft:return new ht(W);case Ze:return jW(W);case _t:return new ht;case gt:return KW(W)}}function MA(W,ne){var Oe=ne.length;if(!Oe)return W;var ht=Oe-1;return ne[ht]=(Oe>1?"& ":"")+ne[ht],ne=ne.join(Oe>2?", ":" "),W.replace(wt,`{
|
||
/* [wrapped with `+ne+`] */
|
||
`)}function YS(W){return Gi(W)||op(W)||!!(Cg&&W&&W[Cg])}function Ud(W,ne){var Oe=typeof W;return ne=ne??j,!!ne&&(Oe=="number"||Oe!="symbol"&&rn.test(W))&&W>-1&&W%1==0&&W<ne}function Ou(W,ne,Oe){if(!zo(Oe))return!1;var ht=typeof ne;return(ht=="number"?sc(Oe)&&Ud(ne,Oe.length):ht=="string"&&ne in Oe)?Wf(Oe[ne],W):!1}function LA(W,ne){if(Gi(W))return!1;var Oe=typeof W;return Oe=="number"||Oe=="symbol"||Oe=="boolean"||W==null||yl(W)?!0:Et.test(W)||!Vt.test(W)||ne!=null&&W in Ir(ne)}function kx(W){var ne=typeof W;return ne=="string"||ne=="number"||ne=="symbol"||ne=="boolean"?W!=="__proto__":W===null}function DA(W){var ne=Qm(W),Oe=Zt[ne];if(typeof Oe!="function"||!(ne in ps.prototype))return!1;if(W===Oe)return!0;var ht=ep(Oe);return!!ht&&W===ht[0]}function Rx(W){return!!ii&&ii in W}var Cx=Cn?Wd:A_;function tb(W){var ne=W&&W.constructor,Oe=typeof ne=="function"&&ne.prototype||Dn;return W===Oe}function XS(W){return W===W&&!zo(W)}function JS(W,ne){return function(Oe){return Oe==null?!1:Oe[W]===ne&&(ne!==h||W in Ir(Oe))}}function xx(W){var ne=jv(W,function(ht){return Oe.size===m&&Oe.clear(),ht}),Oe=ne.cache;return ne}function Bx(W,ne){var Oe=W[1],ht=ne[1],Ut=Oe|ht,rr=Ut<(k|q|X),mr=ht==X&&Oe==F||ht==X&&Oe==se&&W[7].length<=ne[8]||ht==(X|se)&&ne[7].length<=ne[8]&&Oe==F;if(!(rr||mr))return W;ht&k&&(W[2]=ne[2],Ut|=Oe&k?0:b);var Cr=ne[3];if(Cr){var Lr=W[3];W[3]=Lr?bx(Lr,Cr,ne[4]):Cr,W[4]=Lr?Ru(W[3],C):ne[4]}return Cr=ne[5],Cr&&(Lr=W[5],W[5]=Lr?vx(Lr,Cr,ne[6]):Cr,W[6]=Lr?Ru(W[5],C):ne[6]),Cr=ne[7],Cr&&(W[7]=Cr),ht&X&&(W[8]=W[8]==null?ne[8]:Ya(W[8],ne[8])),W[9]==null&&(W[9]=ne[9]),W[0]=ne[0],W[1]=Ut,W}function Ox(W){var ne=[];if(W!=null)for(var Oe in Ir(W))ne.push(Oe);return ne}function Px(W){return Hi.call(W)}function QS(W,ne,Oe){return ne=No(ne===h?W.length-1:ne,0),function(){for(var ht=arguments,Ut=-1,rr=No(ht.length-ne,0),mr=Gt(rr);++Ut<rr;)mr[Ut]=ht[ne+Ut];Ut=-1;for(var Cr=Gt(ne+1);++Ut<ne;)Cr[Ut]=ht[Ut];return Cr[ne]=Oe(mr),Xn(W,this,Cr)}}function Nx(W,ne){return ne.length<2?W:af(W,Bu(ne,0,-1))}function XW(W,ne){for(var Oe=W.length,ht=Ya(ne.length,Oe),Ut=Lc(W);ht--;){var rr=ne[ht];W[ht]=Ud(rr,Oe)?Ut[rr]:h}return W}function eI(W,ne){if(!(ne==="constructor"&&typeof W[ne]=="function")&&ne!="__proto__")return W[ne]}var Mx=Ji(Mh),Nv=no||function(W,ne){return Co.setTimeout(W,ne)},tI=Ji(Gm);function Lx(W,ne,Oe){var ht=ne+"";return tI(W,MA(ht,Lv(ZS(ht),Oe)))}function Ji(W){var ne=0,Oe=0;return function(){var ht=D4(),Ut=B-(ht-Oe);if(Oe=ht,Ut>0){if(++ne>=K)return arguments[0]}else ne=0;return W.apply(h,arguments)}}function Mv(W,ne){var Oe=-1,ht=W.length,Ut=ht-1;for(ne=ne===h?ht:ne;++Oe<ne;){var rr=LS(Oe,Ut),mr=W[rr];W[rr]=W[Oe],W[Oe]=mr}return W.length=ne,W}var rI=xx(function(W){var ne=[];return W.charCodeAt(0)===46&&ne.push(""),W.replace(Ye,function(Oe,ht,Ut,rr){ne.push(Ut?rr.replace(ur,"$1"):ht||Oe)}),ne});function Ja(W){if(typeof W=="string"||yl(W))return W;var ne=W+"";return ne=="0"&&1/W==-N?"-0":ne}function rc(W){if(W!=null){try{return Ln.call(W)}catch{}try{return W+""}catch{}}return""}function Lv(W,ne){return Mn(H,function(Oe){var ht="_."+Oe[0];ne&Oe[1]&&!yi(W,ht)&&W.push(ht)}),W.sort()}function Dx(W){if(W instanceof ps)return W.clone();var ne=new dl(W.__wrapped__,W.__chain__);return ne.__actions__=Lc(W.__actions__),ne.__index__=W.__index__,ne.__values__=W.__values__,ne}function JW(W,ne,Oe){(Oe?Ou(W,ne,Oe):ne===h)?ne=1:ne=No(ji(ne),0);var ht=W==null?0:W.length;if(!ht||ne<1)return[];for(var Ut=0,rr=0,mr=Gt(Pf(ht/ne));Ut<ht;)mr[rr++]=Bu(W,Ut,Ut+=ne);return mr}function QW(W){for(var ne=-1,Oe=W==null?0:W.length,ht=0,Ut=[];++ne<Oe;){var rr=W[ne];rr&&(Ut[ht++]=rr)}return Ut}function UA(){var W=arguments.length;if(!W)return[];for(var ne=Gt(W-1),Oe=arguments[0],ht=W;ht--;)ne[ht-1]=arguments[ht];return Os(Gi(Oe)?Lc(Oe):[Oe],ka(ne,1))}var eH=ss(function(W,ne){return io(W)?jm(W,ka(ne,1,io,!0)):[]}),tH=ss(function(W,ne){var Oe=Mu(ne);return io(Oe)&&(Oe=h),io(W)?jm(W,ka(ne,1,io,!0),Ni(Oe,2)):[]}),rH=ss(function(W,ne){var Oe=Mu(ne);return io(Oe)&&(Oe=h),io(W)?jm(W,ka(ne,1,io,!0),h,Oe):[]});function np(W,ne,Oe){var ht=W==null?0:W.length;return ht?(ne=Oe||ne===h?1:ji(ne),Bu(W,ne<0?0:ne,ht)):[]}function FA(W,ne,Oe){var ht=W==null?0:W.length;return ht?(ne=Oe||ne===h?1:ji(ne),ne=ht-ne,Bu(W,0,ne<0?0:ne)):[]}function nI(W,ne){return W&&W.length?Y0(W,Ni(ne,3),!0,!0):[]}function WA(W,ne){return W&&W.length?Y0(W,Ni(ne,3),!0):[]}function Hh(W,ne,Oe,ht){var Ut=W==null?0:W.length;return Ut?(Oe&&typeof Oe!="number"&&Ou(W,ne,Oe)&&(Oe=0,ht=Ut),ux(W,ne,Oe,ht)):[]}function ip(W,ne,Oe){var ht=W==null?0:W.length;if(!ht)return-1;var Ut=Oe==null?0:ji(Oe);return Ut<0&&(Ut=No(ht+Ut,0)),gn(W,Ni(ne,3),Ut)}function rb(W,ne,Oe){var ht=W==null?0:W.length;if(!ht)return-1;var Ut=ht-1;return Oe!==h&&(Ut=ji(Oe),Ut=Oe<0?No(ht+Ut,0):Ya(Ut,ht-1)),gn(W,Ni(ne,3),Ut,!0)}function nb(W){var ne=W==null?0:W.length;return ne?ka(W,1):[]}function HA(W){var ne=W==null?0:W.length;return ne?ka(W,N):[]}function Pu(W,ne){var Oe=W==null?0:W.length;return Oe?(ne=ne===h?1:ji(ne),ka(W,ne)):[]}function nc(W){for(var ne=-1,Oe=W==null?0:W.length,ht={};++ne<Oe;){var Ut=W[ne];ht[Ut[0]]=Ut[1]}return ht}function Nu(W){return W&&W.length?W[0]:h}function ib(W,ne,Oe){var ht=W==null?0:W.length;if(!ht)return-1;var Ut=Oe==null?0:ji(Oe);return Ut<0&&(Ut=No(ht+Ut,0)),Ch(W,ne,Ut)}function iI(W){var ne=W==null?0:W.length;return ne?Bu(W,0,-1):[]}var zA=ss(function(W){var ne=Hn(W,HS);return ne.length&&ne[0]===W[0]?CS(ne):[]}),sI=ss(function(W){var ne=Mu(W),Oe=Hn(W,HS);return ne===Mu(Oe)?ne=h:Oe.pop(),Oe.length&&Oe[0]===W[0]?CS(Oe,Ni(ne,2)):[]}),Dv=ss(function(W){var ne=Mu(W),Oe=Hn(W,HS);return ne=typeof ne=="function"?ne:h,ne&&Oe.pop(),Oe.length&&Oe[0]===W[0]?CS(Oe,h,ne):[]});function Uv(W,ne){return W==null?"":L4.call(W,ne)}function Mu(W){var ne=W==null?0:W.length;return ne?W[ne-1]:h}function oI(W,ne,Oe){var ht=W==null?0:W.length;if(!ht)return-1;var Ut=ht;return Oe!==h&&(Ut=ji(Oe),Ut=Ut<0?No(ht+Ut,0):Ya(Ut,ht-1)),ne===ne?hv(W,ne,Ut):gn(W,Ig,Ut,!0)}function Dc(W,ne){return W&&W.length?hx(W,ji(ne)):h}var aI=ss($A);function $A(W,ne){return W&&W.length&&ne&&ne.length?MS(W,ne):W}function Fv(W,ne,Oe){return W&&W.length&&ne&&ne.length?MS(W,ne,Ni(Oe,2)):W}function nH(W,ne,Oe){return W&&W.length&&ne&&ne.length?MS(W,ne,h,Oe):W}var iH=Fh(function(W,ne){var Oe=W==null?0:W.length,ht=bA(W,ne);return gx(W,Hn(ne,function(Ut){return Ud(Ut,Oe)?+Ut:Ut}).sort(mx)),ht});function sH(W,ne){var Oe=[];if(!(W&&W.length))return Oe;var ht=-1,Ut=[],rr=W.length;for(ne=Ni(ne,3);++ht<rr;){var mr=W[ht];ne(mr,ht,W)&&(Oe.push(mr),Ut.push(ht))}return gx(W,Ut),Oe}function uI(W){return W==null?W:Wm.call(W)}function oH(W,ne,Oe){var ht=W==null?0:W.length;return ht?(Oe&&typeof Oe!="number"&&Ou(W,ne,Oe)?(ne=0,Oe=ht):(ne=ne==null?0:ji(ne),Oe=Oe===h?ht:ji(Oe)),Bu(W,ne,Oe)):[]}function aH(W,ne){return qm(W,ne)}function cI(W,ne,Oe){return Lh(W,ne,Ni(Oe,2))}function lI(W,ne){var Oe=W==null?0:W.length;if(Oe){var ht=qm(W,ne);if(ht<Oe&&Wf(W[ht],ne))return ht}return-1}function fI(W,ne){return qm(W,ne,!0)}function uH(W,ne,Oe){return Lh(W,ne,Ni(Oe,2),!0)}function cH(W,ne){var Oe=W==null?0:W.length;if(Oe){var ht=qm(W,ne,!0)-1;if(Wf(W[ht],ne))return ht}return-1}function lH(W){return W&&W.length?Zm(W):[]}function VA(W,ne){return W&&W.length?Zm(W,Ni(ne,2)):[]}function Ux(W){var ne=W==null?0:W.length;return ne?Bu(W,1,ne):[]}function fH(W,ne,Oe){return W&&W.length?(ne=Oe||ne===h?1:ji(ne),Bu(W,0,ne<0?0:ne)):[]}function dH(W,ne,Oe){var ht=W==null?0:W.length;return ht?(ne=Oe||ne===h?1:ji(ne),ne=ht-ne,Bu(W,ne<0?0:ne,ht)):[]}function hH(W,ne){return W&&W.length?Y0(W,Ni(ne,3),!1,!0):[]}function pH(W,ne){return W&&W.length?Y0(W,Ni(ne,3)):[]}var Fx=ss(function(W){return q0(ka(W,1,io,!0))}),gH=ss(function(W){var ne=Mu(W);return io(ne)&&(ne=h),q0(ka(W,1,io,!0),Ni(ne,2))}),jA=ss(function(W){var ne=Mu(W);return ne=typeof ne=="function"?ne:h,q0(ka(W,1,io,!0),h,ne)});function dI(W){return W&&W.length?q0(W):[]}function sb(W,ne){return W&&W.length?q0(W,Ni(ne,2)):[]}function hI(W,ne){return ne=typeof ne=="function"?ne:h,W&&W.length?q0(W,h,ne):[]}function Wv(W){if(!(W&&W.length))return[];var ne=0;return W=Bs(W,function(Oe){if(io(Oe))return ne=No(Oe.length,ne),!0}),Mm(ne,function(Oe){return Hn(W,Bf(Oe))})}function Wx(W,ne){if(!(W&&W.length))return[];var Oe=Wv(W);return ne==null?Oe:Hn(Oe,function(ht){return Xn(ne,h,ht)})}var yH=ss(function(W,ne){return io(W)?jm(W,ne):[]}),mH=ss(function(W){return _v(Bs(W,io))}),bH=ss(function(W){var ne=Mu(W);return io(ne)&&(ne=h),_v(Bs(W,io),Ni(ne,2))}),vH=ss(function(W){var ne=Mu(W);return ne=typeof ne=="function"?ne:h,_v(Bs(W,io),h,ne)}),wH=ss(Wv);function Hv(W,ne){return RA(W||[],ne||[],gv)}function pI(W,ne){return RA(W||[],ne||[],Av)}var AH=ss(function(W){var ne=W.length,Oe=ne>1?W[ne-1]:h;return Oe=typeof Oe=="function"?(W.pop(),Oe):h,Wx(W,Oe)});function Hx(W){var ne=Zt(W);return ne.__chain__=!0,ne}function _H(W,ne){return ne(W),W}function KA(W,ne){return ne(W)}var zx=Fh(function(W){var ne=W.length,Oe=ne?W[0]:0,ht=this.__wrapped__,Ut=function(rr){return bA(rr,W)};return ne>1||this.__actions__.length||!(ht instanceof ps)||!Ud(Oe)?this.thru(Ut):(ht=ht.slice(Oe,+Oe+(ne?1:0)),ht.__actions__.push({func:KA,args:[Ut],thisArg:h}),new dl(ht,this.__chain__).thru(function(rr){return ne&&!rr.length&&rr.push(h),rr}))});function gI(){return Hx(this)}function GA(){return new dl(this.value(),this.__chain__)}function yI(){this.__values__===h&&(this.__values__=s_(this.value()));var W=this.__index__>=this.__values__.length,ne=W?h:this.__values__[this.__index__++];return{done:W,value:ne}}function $x(){return this}function Vx(W){for(var ne,Oe=this;Oe instanceof Gn;){var ht=Dx(Oe);ht.__index__=0,ht.__values__=h,ne?Ut.__wrapped__=ht:ne=ht;var Ut=ht;Oe=Oe.__wrapped__}return Ut.__wrapped__=W,ne}function mI(){var W=this.__wrapped__;if(W instanceof ps){var ne=W;return this.__actions__.length&&(ne=new ps(this)),ne=ne.reverse(),ne.__actions__.push({func:KA,args:[uI],thisArg:h}),new dl(ne,this.__chain__)}return this.thru(uI)}function jx(){return kA(this.__wrapped__,this.__actions__)}var Kx=Iv(function(W,ne,Oe){Yr.call(W,Oe)?++W[Oe]:sf(W,Oe,1)});function EH(W,ne,Oe){var ht=Gi(W)?Es:Nf;return Oe&&Ou(W,ne,Oe)&&(ne=h),ht(W,Ni(ne,3))}function bI(W,ne){var Oe=Gi(W)?Bs:mv;return Oe(W,Ni(ne,3))}var Gx=Dh(ip),TH=Dh(rb);function qx(W,ne){return ka(zv(W,ne),1)}function di(W,ne){return ka(zv(W,ne),N)}function SH(W,ne,Oe){return Oe=Oe===h?1:ji(Oe),ka(zv(W,ne),Oe)}function cf(W,ne){var Oe=Gi(W)?Mn:lu;return Oe(W,Ni(ne,3))}function nn(W,ne){var Oe=Gi(W)?Qn:ax;return Oe(W,Ni(ne,3))}var Zx=Iv(function(W,ne,Oe){Yr.call(W,Oe)?W[Oe].push(ne):sf(W,Oe,[ne])});function $s(W,ne,Oe,ht){W=sc(W)?W:Hg(W),Oe=Oe&&!ht?ji(Oe):0;var Ut=W.length;return Oe<0&&(Oe=No(Ut+Oe,0)),r_(W)?Oe<=Ut&&W.indexOf(ne,Oe)>-1:!!Ut&&Ch(W,ne,Oe)>-1}var Ho=ss(function(W,ne,Oe){var ht=-1,Ut=typeof ne=="function",rr=sc(W)?Gt(W.length):[];return lu(W,function(mr){rr[++ht]=Ut?Xn(ne,mr,Oe):Km(mr,ne,Oe)}),rr}),sp=Iv(function(W,ne,Oe){sf(W,Oe,ne)});function zv(W,ne){var Oe=Gi(W)?Hn:_A;return Oe(W,Ni(ne,3))}function ic(W,ne,Oe,ht){return W==null?[]:(Gi(ne)||(ne=ne==null?[]:[ne]),Oe=ht?h:Oe,Gi(Oe)||(Oe=Oe==null?[]:[Oe]),px(W,ne,Oe))}var Mg=Iv(function(W,ne,Oe){W[Oe?0:1].push(ne)},function(){return[[],[]]});function Lg(W,ne,Oe){var ht=Gi(W)?Zs:lv,Ut=arguments.length<3;return ht(W,Ni(ne,4),Oe,Ut,lu)}function vI(W,ne,Oe){var ht=Gi(W)?Po:lv,Ut=arguments.length<3;return ht(W,Ni(ne,4),Oe,Ut,ax)}function Yx(W,ne){var Oe=Gi(W)?Bs:mv;return Oe(W,ZA(Ni(ne,3)))}function Xx(W){var ne=Gi(W)?Nh:zW;return ne(W)}function ob(W,ne,Oe){(Oe?Ou(W,ne,Oe):ne===h)?ne=1:ne=ji(ne);var ht=Gi(W)?tc:wv;return ht(W,ne)}function Jx(W){var ne=Gi(W)?yA:FS;return ne(W)}function Qx(W){if(W==null)return 0;if(sc(W))return r_(W)?Te(W):W.length;var ne=Wo(W);return ne==He||ne==_t?W.size:AA(W).length}function Dg(W,ne,Oe){var ht=Gi(W)?Fo:IA;return Oe&&Ou(W,ne,Oe)&&(ne=h),ht(W,Ni(ne,3))}var wI=ss(function(W,ne){if(W==null)return[];var Oe=ne.length;return Oe>1&&Ou(W,ne[0],ne[1])?ne=[]:Oe>2&&Ou(ne[0],ne[1],ne[2])&&(ne=[ne[0]]),px(W,ka(ne,1),[])}),Df=M4||function(){return Co.Date.now()};function qA(W,ne){if(typeof ne!="function")throw new jr(c);return W=ji(W),function(){if(--W<1)return ne.apply(this,arguments)}}function e5(W,ne,Oe){return ne=Oe?h:ne,ne=W&&ne==null?W.length:ne,Lf(W,X,h,h,h,h,ne)}function $v(W,ne){var Oe;if(typeof ne!="function")throw new jr(c);return W=ji(W),function(){return--W>0&&(Oe=ne.apply(this,arguments)),W<=1&&(ne=h),Oe}}var ab=ss(function(W,ne,Oe){var ht=k;if(Oe.length){var Ut=Ru(Oe,tp(ab));ht|=ue}return Lf(W,ht,ne,Oe,Ut)}),t5=ss(function(W,ne,Oe){var ht=k|q;if(Oe.length){var Ut=Ru(Oe,tp(t5));ht|=ue}return Lf(ne,ht,W,Oe,Ut)});function r5(W,ne,Oe){ne=Oe?h:ne;var ht=Lf(W,F,h,h,h,h,h,ne);return ht.placeholder=r5.placeholder,ht}function AI(W,ne,Oe){ne=Oe?h:ne;var ht=Lf(W,G,h,h,h,h,h,ne);return ht.placeholder=AI.placeholder,ht}function Vv(W,ne,Oe){var ht,Ut,rr,mr,Cr,Lr,wn=0,_n=!1,Rn=!1,Jn=!0;if(typeof W!="function")throw new jr(c);ne=os(ne)||0,zo(Oe)&&(_n=!!Oe.leading,Rn="maxWait"in Oe,rr=Rn?No(os(Oe.maxWait)||0,ne):rr,Jn="trailing"in Oe?!!Oe.trailing:Jn);function vi(wa){var Hf=ht,Kh=Ut;return ht=Ut=h,wn=wa,mr=W.apply(Kh,Hf),mr}function Ri(wa){return wn=wa,Cr=Nv(gs,ne),_n?vi(wa):mr}function ns(wa){var Hf=wa-Lr,Kh=wa-wn,L5=ne-Hf;return Rn?Ya(L5,rr-Kh):L5}function Di(wa){var Hf=wa-Lr,Kh=wa-wn;return Lr===h||Hf>=ne||Hf<0||Rn&&Kh>=rr}function gs(){var wa=Df();if(Di(wa))return Ts(wa);Cr=Nv(gs,ns(wa))}function Ts(wa){return Cr=h,Jn&&ht?vi(wa):(ht=Ut=h,mr)}function vl(){Cr!==h&&Ev(Cr),wn=0,ht=Lr=Ut=Cr=h}function oc(){return Cr===h?mr:Ts(Df())}function wl(){var wa=Df(),Hf=Di(wa);if(ht=arguments,Ut=this,Lr=wa,Hf){if(Cr===h)return Ri(Lr);if(Rn)return Ev(Cr),Cr=Nv(gs,ne),vi(Lr)}return Cr===h&&(Cr=Nv(gs,ne)),mr}return wl.cancel=vl,wl.flush=oc,wl}var Uf=ss(function(W,ne){return IS(W,1,ne)}),IH=ss(function(W,ne,Oe){return IS(W,os(ne)||0,Oe)});function _I(W){return Lf(W,de)}function jv(W,ne){if(typeof W!="function"||ne!=null&&typeof ne!="function")throw new jr(c);var Oe=function(){var ht=arguments,Ut=ne?ne.apply(this,ht):ht[0],rr=Oe.cache;if(rr.has(Ut))return rr.get(Ut);var mr=W.apply(this,ht);return Oe.cache=rr.set(Ut,mr)||rr,mr};return Oe.cache=new(jv.Cache||Md),Oe}jv.Cache=Md;function ZA(W){if(typeof W!="function")throw new jr(c);return function(){var ne=arguments;switch(ne.length){case 0:return!W.call(this);case 1:return!W.call(this,ne[0]);case 2:return!W.call(this,ne[0],ne[1]);case 3:return!W.call(this,ne[0],ne[1],ne[2])}return!W.apply(this,ne)}}function EI(W){return $v(2,W)}var n5=$W(function(W,ne){ne=ne.length==1&&Gi(ne[0])?Hn(ne[0],Ha(Ni())):Hn(ka(ne,1),Ha(Ni()));var Oe=ne.length;return ss(function(ht){for(var Ut=-1,rr=Ya(ht.length,Oe);++Ut<rr;)ht[Ut]=ne[Ut].call(this,ht[Ut]);return Xn(W,this,ht)})}),TI=ss(function(W,ne){var Oe=Ru(ne,tp(TI));return Lf(W,ue,h,ne,Oe)}),Ff=ss(function(W,ne){var Oe=Ru(ne,tp(Ff));return Lf(W,le,h,ne,Oe)}),SI=Fh(function(W,ne){return Lf(W,se,h,h,h,ne)});function kH(W,ne){if(typeof W!="function")throw new jr(c);return ne=ne===h?ne:ji(ne),ss(W,ne)}function i5(W,ne){if(typeof W!="function")throw new jr(c);return ne=ne==null?0:No(ji(ne),0),ss(function(Oe){var ht=Oe[ne],Ut=Ld(Oe,0,ne);return ht&&Os(Ut,ht),Xn(W,this,Ut)})}function RH(W,ne,Oe){var ht=!0,Ut=!0;if(typeof W!="function")throw new jr(c);return zo(Oe)&&(ht="leading"in Oe?!!Oe.leading:ht,Ut="trailing"in Oe?!!Oe.trailing:Ut),Vv(W,ne,{leading:ht,maxWait:ne,trailing:Ut})}function s5(W){return e5(W,1)}function Ug(W,ne){return TI(zS(ne),W)}function ub(){if(!arguments.length)return[];var W=arguments[0];return Gi(W)?W:[W]}function YA(W){return hl(W,S)}function o5(W,ne){return ne=typeof ne=="function"?ne:h,hl(W,S,ne)}function CH(W){return hl(W,x|S)}function XA(W,ne){return ne=typeof ne=="function"?ne:h,hl(W,x|S,ne)}function xH(W,ne){return ne==null||ox(W,ne,Ra(ne))}function Wf(W,ne){return W===ne||W!==W&&ne!==ne}var JA=gl(RS),a5=gl(function(W,ne){return W>=ne}),op=xS(function(){return arguments}())?xS:function(W){return go(W)&&Yr.call(W,"callee")&&!xh.call(W,"callee")},Gi=Gt.isArray,II=nr?Ha(nr):LW;function sc(W){return W!=null&&Vh(W.length)&&!Wd(W)}function io(W){return go(W)&&sc(W)}function zh(W){return W===!0||W===!1||go(W)&&sa(W)==ge}var Fd=Pd||A_,BH=ir?Ha(ir):DW;function QA(W){return go(W)&&W.nodeType===1&&!cp(W)}function OH(W){if(W==null)return!0;if(sc(W)&&(Gi(W)||typeof W=="string"||typeof W.splice=="function"||Fd(W)||cb(W)||op(W)))return!W.length;var ne=Wo(W);if(ne==He||ne==_t)return!W.size;if(tb(W))return!AA(W).length;for(var Oe in W)if(Yr.call(W,Oe))return!1;return!0}function kI(W,ne){return bv(W,ne)}function e_(W,ne,Oe){Oe=typeof Oe=="function"?Oe:h;var ht=Oe?Oe(W,ne):h;return ht===h?bv(W,ne,h,Oe):!!ht}function Kv(W){if(!go(W))return!1;var ne=sa(W);return ne==Ee||ne==we||typeof W.message=="string"&&typeof W.name=="string"&&!cp(W)}function Gv(W){return typeof W=="number"&&za(W)}function Wd(W){if(!zo(W))return!1;var ne=sa(W);return ne==me||ne==Ke||ne==_e||ne==We}function $h(W){return typeof W=="number"&&W==ji(W)}function Vh(W){return typeof W=="number"&&W>-1&&W%1==0&&W<=j}function zo(W){var ne=typeof W;return W!=null&&(ne=="object"||ne=="function")}function go(W){return W!=null&&typeof W=="object"}var RI=Tr?Ha(Tr):FW;function CI(W,ne){return W===ne||BS(W,ne,NA(ne))}function Hd(W,ne,Oe){return Oe=typeof Oe=="function"?Oe:h,BS(W,ne,NA(ne),Oe)}function xI(W){return up(W)&&W!=+W}function Fg(W){if(Cx(W))throw new yr(v);return OS(W)}function ap(W){return W===null}function t_(W){return W==null}function up(W){return typeof W=="number"||go(W)&&sa(W)==Ie}function cp(W){if(!go(W)||sa(W)!=Ge)return!1;var ne=ba(W);if(ne===null)return!0;var Oe=Yr.call(ne,"constructor")&&ne.constructor;return typeof Oe=="function"&&Oe instanceof Oe&&Ln.call(Oe)==Zi}var BI=Ur?Ha(Ur):WW;function lf(W){return $h(W)&&W>=-j&&W<=j}var Wg=Wr?Ha(Wr):lx;function r_(W){return typeof W=="string"||!Gi(W)&&go(W)&&sa(W)==Ft}function yl(W){return typeof W=="symbol"||go(W)&&sa(W)==gt}var cb=Sn?Ha(Sn):HW;function PH(W){return W===h}function NH(W){return go(W)&&Wo(W)==dt}function n_(W){return go(W)&&sa(W)==tt}var i_=gl(vv),OI=gl(function(W,ne){return W<=ne});function s_(W){if(!W)return[];if(sc(W))return r_(W)?Fe(W):Lc(W);if(Um&&W[Um])return _S(W[Um]());var ne=Wo(W),Oe=ne==He?Rg:ne==_t?H0:Hg;return Oe(W)}function zd(W){if(!W)return W===0?W:0;if(W=os(W),W===N||W===-N){var ne=W<0?-1:1;return ne*Y}return W===W?W:0}function ji(W){var ne=zd(W),Oe=ne%1;return ne===ne?Oe?ne-Oe:ne:0}function va(W){return W?K0(ji(W),0,z):0}function os(W){if(typeof W=="number")return W;if(yl(W))return Z;if(zo(W)){var ne=typeof W.valueOf=="function"?W.valueOf():W;W=zo(ne)?ne+"":ne}if(typeof W!="string")return W===0?W:+W;W=fv(W);var Oe=hr.test(W);return Oe||Hr.test(W)?Rh(W.slice(2),Oe?2:8):Jr.test(W)?Z:+W}function $d(W){return Dd(W,Lu(W))}function u5(W){return W?K0(ji(W),-j,j):W===0?W:0}function Us(W){return W==null?"":pl(W)}var PI=Xa(function(W,ne){if(tb(ne)||sc(ne)){Dd(ne,Ra(ne),W);return}for(var Oe in ne)Yr.call(ne,Oe)&&gv(W,Oe,ne[Oe])}),o_=Xa(function(W,ne){Dd(ne,Lu(ne),W)}),qv=Xa(function(W,ne,Oe,ht){Dd(ne,Lu(ne),W,ht)}),c5=Xa(function(W,ne,Oe,ht){Dd(ne,Ra(ne),W,ht)}),fu=Fh(bA);function l5(W,ne){var Oe=Xi(W);return ne==null?Oe:Vm(Oe,ne)}var ml=ss(function(W,ne){W=Ir(W);var Oe=-1,ht=ne.length,Ut=ht>2?ne[2]:h;for(Ut&&Ou(ne[0],ne[1],Ut)&&(ht=1);++Oe<ht;)for(var rr=ne[Oe],mr=Lu(rr),Cr=-1,Lr=mr.length;++Cr<Lr;){var wn=mr[Cr],_n=W[wn];(_n===h||Wf(_n,Dn[wn])&&!Yr.call(W,wn))&&(W[wn]=rr[wn])}return W}),Zv=ss(function(W){return W.push(h,Ng),Xn(MI,h,W)});function f5(W,ne){return Jl(W,Ni(ne,3),of)}function d5(W,ne){return Jl(W,Ni(ne,3),vA)}function MH(W,ne){return W==null?W:Mc(W,Ni(ne,3),Lu)}function h5(W,ne){return W==null?W:kS(W,Ni(ne,3),Lu)}function p5(W,ne){return W&&of(W,Ni(ne,3))}function g5(W,ne){return W&&vA(W,Ni(ne,3))}function y5(W){return W==null?[]:G0(W,Ra(W))}function LH(W){return W==null?[]:G0(W,Lu(W))}function NI(W,ne,Oe){var ht=W==null?h:af(W,ne);return ht===h?Oe:ht}function a_(W,ne){return W!=null&&Sx(W,ne,OW)}function u_(W,ne){return W!=null&&Sx(W,ne,PW)}var DH=Ax(function(W,ne,Oe){ne!=null&&typeof ne.toString!="function"&&(ne=Hi.call(ne)),W[ne]=Oe},KI(Uc)),UH=Ax(function(W,ne,Oe){ne!=null&&typeof ne.toString!="function"&&(ne=Hi.call(ne)),Yr.call(W,ne)?W[ne].push(Oe):W[ne]=[Oe]},Ni),FH=ss(Km);function Ra(W){return sc(W)?SS(W):AA(W)}function Lu(W){return sc(W)?SS(W,!0):fx(W)}function m5(W,ne){var Oe={};return ne=Ni(ne,3),of(W,function(ht,Ut,rr){sf(Oe,ne(ht,Ut,rr),ht)}),Oe}function b5(W,ne){var Oe={};return ne=Ni(ne,3),of(W,function(ht,Ut,rr){sf(Oe,Ut,ne(ht,Ut,rr))}),Oe}var c_=Xa(function(W,ne,Oe){EA(W,ne,Oe)}),MI=Xa(function(W,ne,Oe,ht){EA(W,ne,Oe,ht)}),LI=Fh(function(W,ne){var Oe={};if(W==null)return Oe;var ht=!1;ne=Hn(ne,function(rr){return rr=X0(rr,W),ht||(ht=rr.length>1),rr}),Dd(W,xv(W),Oe),ht&&(Oe=hl(Oe,x|R|S,KS));for(var Ut=ne.length;Ut--;)Z0(Oe,ne[Ut]);return Oe});function v5(W,ne){return DI(W,ZA(Ni(ne)))}var w5=Fh(function(W,ne){return W==null?{}:TA(W,ne)});function DI(W,ne){if(W==null)return{};var Oe=Hn(xv(W),function(ht){return[ht]});return ne=Ni(ne),NS(W,Oe,function(ht,Ut){return ne(ht,Ut[0])})}function lp(W,ne,Oe){ne=X0(ne,W);var ht=-1,Ut=ne.length;for(Ut||(Ut=1,W=h);++ht<Ut;){var rr=W==null?h:W[Ja(ne[ht])];rr===h&&(ht=Ut,rr=Oe),W=Wd(rr)?rr.call(W):rr}return W}function ff(W,ne,Oe){return W==null?W:Av(W,ne,Oe)}function Xo(W,ne,Oe,ht){return ht=typeof ht=="function"?ht:h,W==null?W:Av(W,ne,Oe,ht)}var Vd=jS(Ra),lb=jS(Lu);function UI(W,ne,Oe){var ht=Gi(W),Ut=ht||Fd(W)||cb(W);if(ne=Ni(ne,4),Oe==null){var rr=W&&W.constructor;Ut?Oe=ht?new rr:[]:zo(W)?Oe=Wd(rr)?Xi(ba(W)):{}:Oe={}}return(Ut?Mn:of)(W,function(mr,Cr,Lr){return ne(Oe,mr,Cr,Lr)}),Oe}function A5(W,ne){return W==null?!0:Z0(W,ne)}function _5(W,ne,Oe){return W==null?W:Ym(W,ne,zS(Oe))}function E5(W,ne,Oe,ht){return ht=typeof ht=="function"?ht:h,W==null?W:Ym(W,ne,zS(Oe),ht)}function Hg(W){return W==null?[]:xd(W,Ra(W))}function WH(W){return W==null?[]:xd(W,Lu(W))}function T5(W,ne,Oe){return Oe===h&&(Oe=ne,ne=h),Oe!==h&&(Oe=os(Oe),Oe=Oe===Oe?Oe:0),ne!==h&&(ne=os(ne),ne=ne===ne?ne:0),K0(os(W),ne,Oe)}function S5(W,ne,Oe){return ne=zd(ne),Oe===h?(Oe=ne,ne=0):Oe=zd(Oe),W=os(W),NW(W,ne,Oe)}function Yv(W,ne,Oe){if(Oe&&typeof Oe!="boolean"&&Ou(W,ne,Oe)&&(ne=Oe=h),Oe===h&&(typeof ne=="boolean"?(Oe=ne,ne=h):typeof W=="boolean"&&(Oe=W,W=h)),W===h&&ne===h?(W=0,ne=1):(W=zd(W),ne===h?(ne=W,W=0):ne=zd(ne)),W>ne){var ht=W;W=ne,ne=ht}if(Oe||W%1||ne%1){var Ut=dA();return Ya(W+Ut*(ne-W+Xl("1e-"+((Ut+"").length-1))),ne)}return LS(W,ne)}var Xv=Jm(function(W,ne,Oe){return ne=ne.toLowerCase(),W+(Oe?l_(ne):ne)});function l_(W){return jI(Us(W).toLowerCase())}function fb(W){return W=Us(W),W&&W.replace(_r,Dm).replace(Bc,"")}function FI(W,ne,Oe){W=Us(W),ne=pl(ne);var ht=W.length;Oe=Oe===h?ht:K0(ji(Oe),0,ht);var Ut=Oe;return Oe-=ne.length,Oe>=0&&W.slice(Oe,Ut)==ne}function WI(W){return W=Us(W),W&&Ht.test(W)?W.replace(Ae,W0):W}function f_(W){return W=Us(W),W&&Wt.test(W)?W.replace(Tt,"\\$&"):W}var df=Jm(function(W,ne,Oe){return W+(Oe?"-":"")+ne.toLowerCase()}),Jv=Jm(function(W,ne,Oe){return W+(Oe?" ":"")+ne.toLowerCase()}),HI=J0("toLowerCase");function I5(W,ne,Oe){W=Us(W),ne=ji(ne);var ht=ne?Te(W):0;if(!ne||ht>=ne)return W;var Ut=(ne-ht)/2;return xA(Za(Ut),Oe)+W+xA(Pf(Ut),Oe)}function zI(W,ne,Oe){W=Us(W),ne=ji(ne);var ht=ne?Te(W):0;return ne&&ht<ne?W+xA(ne-ht,Oe):W}function d_(W,ne,Oe){W=Us(W),ne=ji(ne);var ht=ne?Te(W):0;return ne&&ht<ne?xA(ne-ht,Oe)+W:W}function $I(W,ne,Oe){return Oe||ne==null?ne=0:ne&&(ne=+ne),U4(Us(W).replace(dr,""),ne||0)}function h_(W,ne,Oe){return(Oe?Ou(W,ne,Oe):ne===h)?ne=1:ne=ji(ne),US(Us(W),ne)}function p_(){var W=arguments,ne=Us(W[0]);return W.length<3?ne:ne.replace(W[1],W[2])}var db=Jm(function(W,ne,Oe){return W+(Oe?"_":"")+ne.toLowerCase()});function g_(W,ne,Oe){return Oe&&typeof Oe!="number"&&Ou(W,ne,Oe)&&(ne=Oe=h),Oe=Oe===h?z:Oe>>>0,Oe?(W=Us(W),W&&(typeof ne=="string"||ne!=null&&!BI(ne))&&(ne=pl(ne),!ne&&Of(W))?Ld(Fe(W),0,Oe):W.split(ne,Oe)):[]}var k5=Jm(function(W,ne,Oe){return W+(Oe?" ":"")+jI(ne)});function y_(W,ne,Oe){return W=Us(W),Oe=Oe==null?0:K0(ji(Oe),0,W.length),ne=pl(ne),W.slice(Oe,Oe+ne.length)==ne}function R5(W,ne,Oe){var ht=Zt.templateSettings;Oe&&Ou(W,ne,Oe)&&(ne=h),W=Us(W),ne=qv({},ne,ht,Uh);var Ut=qv({},ne.imports,ht.imports,Uh),rr=Ra(Ut),mr=xd(Ut,rr),Cr,Lr,wn=0,_n=ne.interpolate||pn,Rn="__p += '",Jn=Vr((ne.escape||pn).source+"|"+_n.source+"|"+(_n===tr?vr:pn).source+"|"+(ne.evaluate||pn).source+"|$","g"),vi="//# sourceURL="+(Yr.call(ne,"sourceURL")?(ne.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ju+"]")+`
|
||
`;W.replace(Jn,function(Di,gs,Ts,vl,oc,wl){return Ts||(Ts=vl),Rn+=W.slice(wn,wl).replace($t,ec),gs&&(Cr=!0,Rn+=`' +
|
||
__e(`+gs+`) +
|
||
'`),oc&&(Lr=!0,Rn+=`';
|
||
`+oc+`;
|
||
__p += '`),Ts&&(Rn+=`' +
|
||
((__t = (`+Ts+`)) == null ? '' : __t) +
|
||
'`),wn=wl+Di.length,Di}),Rn+=`';
|
||
`;var Ri=Yr.call(ne,"variable")&&ne.variable;if(!Ri)Rn=`with (obj) {
|
||
`+Rn+`
|
||
}
|
||
`;else if(sr.test(Ri))throw new yr(d);Rn=(Lr?Rn.replace(Ct,""):Rn).replace(qe,"$1").replace(Yt,"$1;"),Rn="function("+(Ri||"obj")+`) {
|
||
`+(Ri?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(Cr?", __e = _.escape":"")+(Lr?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+Rn+`return __p
|
||
}`;var ns=B5(function(){return Sr(rr,vi+"return "+Rn).apply(h,mr)});if(ns.source=Rn,Kv(ns))throw ns;return ns}function VI(W){return Us(W).toLowerCase()}function HH(W){return Us(W).toUpperCase()}function zH(W,ne,Oe){if(W=Us(W),W&&(Oe||ne===h))return fv(W);if(!W||!(ne=pl(ne)))return W;var ht=Fe(W),Ut=Fe(ne),rr=Lm(ht,Ut),mr=ll(ht,Ut)+1;return Ld(ht,rr,mr).join("")}function C5(W,ne,Oe){if(W=Us(W),W&&(Oe||ne===h))return W.slice(0,ut(W)+1);if(!W||!(ne=pl(ne)))return W;var ht=Fe(W),Ut=ll(ht,Fe(ne))+1;return Ld(ht,0,Ut).join("")}function $H(W,ne,Oe){if(W=Us(W),W&&(Oe||ne===h))return W.replace(dr,"");if(!W||!(ne=pl(ne)))return W;var ht=Fe(W),Ut=Lm(ht,Fe(ne));return Ld(ht,Ut).join("")}function VH(W,ne){var Oe=ye,ht=he;if(zo(ne)){var Ut="separator"in ne?ne.separator:Ut;Oe="length"in ne?ji(ne.length):Oe,ht="omission"in ne?pl(ne.omission):ht}W=Us(W);var rr=W.length;if(Of(W)){var mr=Fe(W);rr=mr.length}if(Oe>=rr)return W;var Cr=Oe-Te(ht);if(Cr<1)return ht;var Lr=mr?Ld(mr,0,Cr).join(""):W.slice(0,Cr);if(Ut===h)return Lr+ht;if(mr&&(Cr+=Lr.length-Cr),BI(Ut)){if(W.slice(Cr).search(Ut)){var wn,_n=Lr;for(Ut.global||(Ut=Vr(Ut.source,Us(kr.exec(Ut))+"g")),Ut.lastIndex=0;wn=Ut.exec(_n);)var Rn=wn.index;Lr=Lr.slice(0,Rn===h?Cr:Rn)}}else if(W.indexOf(pl(Ut),Cr)!=Cr){var Jn=Lr.lastIndexOf(Ut);Jn>-1&&(Lr=Lr.slice(0,Jn))}return Lr+ht}function jH(W){return W=Us(W),W&&Rt.test(W)?W.replace(ot,St):W}var KH=Jm(function(W,ne,Oe){return W+(Oe?" ":"")+ne.toUpperCase()}),jI=J0("toUpperCase");function x5(W,ne,Oe){return W=Us(W),ne=Oe?h:ne,ne===h?Oc(W)?lr(W):Mr(W):W.match(ne)||[]}var B5=ss(function(W,ne){try{return Xn(W,h,ne)}catch(Oe){return Kv(Oe)?Oe:new yr(Oe)}}),GH=Fh(function(W,ne){return Mn(ne,function(Oe){Oe=Ja(Oe),sf(W,Oe,ab(W[Oe],W))}),W});function qH(W){var ne=W==null?0:W.length,Oe=Ni();return W=ne?Hn(W,function(ht){if(typeof ht[1]!="function")throw new jr(c);return[Oe(ht[0]),ht[1]]}):[],ss(function(ht){for(var Ut=-1;++Ut<ne;){var rr=W[Ut];if(Xn(rr[0],this,ht))return Xn(rr[1],this,ht)}})}function ZH(W){return BW(hl(W,x))}function KI(W){return function(){return W}}function hb(W,ne){return W==null||W!==W?ne:W}var YH=uf(),m_=uf(!0);function Uc(W){return W}function zg(W){return wA(typeof W=="function"?W:hl(W,x))}function XH(W){return PS(hl(W,x))}function JH(W,ne){return dx(W,hl(ne,x))}var QH=ss(function(W,ne){return function(Oe){return Km(Oe,W,ne)}}),ez=ss(function(W,ne){return function(Oe){return Km(W,Oe,ne)}});function GI(W,ne,Oe){var ht=Ra(ne),Ut=G0(ne,ht);Oe==null&&!(zo(ne)&&(Ut.length||!ht.length))&&(Oe=ne,ne=W,W=this,Ut=G0(ne,Ra(ne)));var rr=!(zo(Oe)&&"chain"in Oe)||!!Oe.chain,mr=Wd(W);return Mn(Ut,function(Cr){var Lr=ne[Cr];W[Cr]=Lr,mr&&(W.prototype[Cr]=function(){var wn=this.__chain__;if(rr||wn){var _n=W(this.__wrapped__),Rn=_n.__actions__=Lc(this.__actions__);return Rn.push({func:Lr,args:arguments,thisArg:W}),_n.__chain__=wn,_n}return Lr.apply(W,Os([this.value()],arguments))})}),W}function tz(){return Co._===this&&(Co._=Bi),this}function qI(){}function ZI(W){return W=ji(W),ss(function(ne){return hx(ne,W)})}var rz=$S(Hn),O5=$S(Es),YI=$S(Fo);function P5(W){return LA(W)?Bf(Ja(W)):SA(W)}function b_(W){return function(ne){return W==null?h:af(W,ne)}}var v_=VS(),XI=VS(!0);function w_(){return[]}function A_(){return!1}function Ca(){return{}}function __(){return""}function jh(){return!0}function nz(W,ne){if(W=ji(W),W<1||W>j)return[];var Oe=z,ht=Ya(W,z);ne=Ni(ne),W-=z;for(var Ut=Mm(ht,ne);++Oe<W;)ne(Oe);return Ut}function Du(W){return Gi(W)?Hn(W,Ja):yl(W)?[W]:Lc(rI(Us(W)))}function N5(W){var ne=++Un;return Us(W)+ne}var fp=Rv(function(W,ne){return W+ne},0),$g=OA("ceil"),JI=Rv(function(W,ne){return W/ne},1),Qv=OA("floor");function M5(W){return W&&W.length?yv(W,Uc,RS):h}function iz(W,ne){return W&&W.length?yv(W,Ni(ne,2),RS):h}function E_(W){return Nm(W,Uc)}function QI(W,ne){return Nm(W,Ni(ne,2))}function sz(W){return W&&W.length?yv(W,Uc,vv):h}function oz(W,ne){return W&&W.length?yv(W,Ni(ne,2),vv):h}var bl=Rv(function(W,ne){return W*ne},1),az=OA("round"),uz=Rv(function(W,ne){return W-ne},0);function cz(W){return W&&W.length?kg(W,Uc):0}function lz(W,ne){return W&&W.length?kg(W,Ni(ne,2)):0}return Zt.after=qA,Zt.ary=e5,Zt.assign=PI,Zt.assignIn=o_,Zt.assignInWith=qv,Zt.assignWith=c5,Zt.at=fu,Zt.before=$v,Zt.bind=ab,Zt.bindAll=GH,Zt.bindKey=t5,Zt.castArray=ub,Zt.chain=Hx,Zt.chunk=JW,Zt.compact=QW,Zt.concat=UA,Zt.cond=qH,Zt.conforms=ZH,Zt.constant=KI,Zt.countBy=Kx,Zt.create=l5,Zt.curry=r5,Zt.curryRight=AI,Zt.debounce=Vv,Zt.defaults=ml,Zt.defaultsDeep=Zv,Zt.defer=Uf,Zt.delay=IH,Zt.difference=eH,Zt.differenceBy=tH,Zt.differenceWith=rH,Zt.drop=np,Zt.dropRight=FA,Zt.dropRightWhile=nI,Zt.dropWhile=WA,Zt.fill=Hh,Zt.filter=bI,Zt.flatMap=qx,Zt.flatMapDeep=di,Zt.flatMapDepth=SH,Zt.flatten=nb,Zt.flattenDeep=HA,Zt.flattenDepth=Pu,Zt.flip=_I,Zt.flow=YH,Zt.flowRight=m_,Zt.fromPairs=nc,Zt.functions=y5,Zt.functionsIn=LH,Zt.groupBy=Zx,Zt.initial=iI,Zt.intersection=zA,Zt.intersectionBy=sI,Zt.intersectionWith=Dv,Zt.invert=DH,Zt.invertBy=UH,Zt.invokeMap=Ho,Zt.iteratee=zg,Zt.keyBy=sp,Zt.keys=Ra,Zt.keysIn=Lu,Zt.map=zv,Zt.mapKeys=m5,Zt.mapValues=b5,Zt.matches=XH,Zt.matchesProperty=JH,Zt.memoize=jv,Zt.merge=c_,Zt.mergeWith=MI,Zt.method=QH,Zt.methodOf=ez,Zt.mixin=GI,Zt.negate=ZA,Zt.nthArg=ZI,Zt.omit=LI,Zt.omitBy=v5,Zt.once=EI,Zt.orderBy=ic,Zt.over=rz,Zt.overArgs=n5,Zt.overEvery=O5,Zt.overSome=YI,Zt.partial=TI,Zt.partialRight=Ff,Zt.partition=Mg,Zt.pick=w5,Zt.pickBy=DI,Zt.property=P5,Zt.propertyOf=b_,Zt.pull=aI,Zt.pullAll=$A,Zt.pullAllBy=Fv,Zt.pullAllWith=nH,Zt.pullAt=iH,Zt.range=v_,Zt.rangeRight=XI,Zt.rearg=SI,Zt.reject=Yx,Zt.remove=sH,Zt.rest=kH,Zt.reverse=uI,Zt.sampleSize=ob,Zt.set=ff,Zt.setWith=Xo,Zt.shuffle=Jx,Zt.slice=oH,Zt.sortBy=wI,Zt.sortedUniq=lH,Zt.sortedUniqBy=VA,Zt.split=g_,Zt.spread=i5,Zt.tail=Ux,Zt.take=fH,Zt.takeRight=dH,Zt.takeRightWhile=hH,Zt.takeWhile=pH,Zt.tap=_H,Zt.throttle=RH,Zt.thru=KA,Zt.toArray=s_,Zt.toPairs=Vd,Zt.toPairsIn=lb,Zt.toPath=Du,Zt.toPlainObject=$d,Zt.transform=UI,Zt.unary=s5,Zt.union=Fx,Zt.unionBy=gH,Zt.unionWith=jA,Zt.uniq=dI,Zt.uniqBy=sb,Zt.uniqWith=hI,Zt.unset=A5,Zt.unzip=Wv,Zt.unzipWith=Wx,Zt.update=_5,Zt.updateWith=E5,Zt.values=Hg,Zt.valuesIn=WH,Zt.without=yH,Zt.words=x5,Zt.wrap=Ug,Zt.xor=mH,Zt.xorBy=bH,Zt.xorWith=vH,Zt.zip=wH,Zt.zipObject=Hv,Zt.zipObjectDeep=pI,Zt.zipWith=AH,Zt.entries=Vd,Zt.entriesIn=lb,Zt.extend=o_,Zt.extendWith=qv,GI(Zt,Zt),Zt.add=fp,Zt.attempt=B5,Zt.camelCase=Xv,Zt.capitalize=l_,Zt.ceil=$g,Zt.clamp=T5,Zt.clone=YA,Zt.cloneDeep=CH,Zt.cloneDeepWith=XA,Zt.cloneWith=o5,Zt.conformsTo=xH,Zt.deburr=fb,Zt.defaultTo=hb,Zt.divide=JI,Zt.endsWith=FI,Zt.eq=Wf,Zt.escape=WI,Zt.escapeRegExp=f_,Zt.every=EH,Zt.find=Gx,Zt.findIndex=ip,Zt.findKey=f5,Zt.findLast=TH,Zt.findLastIndex=rb,Zt.findLastKey=d5,Zt.floor=Qv,Zt.forEach=cf,Zt.forEachRight=nn,Zt.forIn=MH,Zt.forInRight=h5,Zt.forOwn=p5,Zt.forOwnRight=g5,Zt.get=NI,Zt.gt=JA,Zt.gte=a5,Zt.has=a_,Zt.hasIn=u_,Zt.head=Nu,Zt.identity=Uc,Zt.includes=$s,Zt.indexOf=ib,Zt.inRange=S5,Zt.invoke=FH,Zt.isArguments=op,Zt.isArray=Gi,Zt.isArrayBuffer=II,Zt.isArrayLike=sc,Zt.isArrayLikeObject=io,Zt.isBoolean=zh,Zt.isBuffer=Fd,Zt.isDate=BH,Zt.isElement=QA,Zt.isEmpty=OH,Zt.isEqual=kI,Zt.isEqualWith=e_,Zt.isError=Kv,Zt.isFinite=Gv,Zt.isFunction=Wd,Zt.isInteger=$h,Zt.isLength=Vh,Zt.isMap=RI,Zt.isMatch=CI,Zt.isMatchWith=Hd,Zt.isNaN=xI,Zt.isNative=Fg,Zt.isNil=t_,Zt.isNull=ap,Zt.isNumber=up,Zt.isObject=zo,Zt.isObjectLike=go,Zt.isPlainObject=cp,Zt.isRegExp=BI,Zt.isSafeInteger=lf,Zt.isSet=Wg,Zt.isString=r_,Zt.isSymbol=yl,Zt.isTypedArray=cb,Zt.isUndefined=PH,Zt.isWeakMap=NH,Zt.isWeakSet=n_,Zt.join=Uv,Zt.kebabCase=df,Zt.last=Mu,Zt.lastIndexOf=oI,Zt.lowerCase=Jv,Zt.lowerFirst=HI,Zt.lt=i_,Zt.lte=OI,Zt.max=M5,Zt.maxBy=iz,Zt.mean=E_,Zt.meanBy=QI,Zt.min=sz,Zt.minBy=oz,Zt.stubArray=w_,Zt.stubFalse=A_,Zt.stubObject=Ca,Zt.stubString=__,Zt.stubTrue=jh,Zt.multiply=bl,Zt.nth=Dc,Zt.noConflict=tz,Zt.noop=qI,Zt.now=Df,Zt.pad=I5,Zt.padEnd=zI,Zt.padStart=d_,Zt.parseInt=$I,Zt.random=Yv,Zt.reduce=Lg,Zt.reduceRight=vI,Zt.repeat=h_,Zt.replace=p_,Zt.result=lp,Zt.round=az,Zt.runInContext=jt,Zt.sample=Xx,Zt.size=Qx,Zt.snakeCase=db,Zt.some=Dg,Zt.sortedIndex=aH,Zt.sortedIndexBy=cI,Zt.sortedIndexOf=lI,Zt.sortedLastIndex=fI,Zt.sortedLastIndexBy=uH,Zt.sortedLastIndexOf=cH,Zt.startCase=k5,Zt.startsWith=y_,Zt.subtract=uz,Zt.sum=cz,Zt.sumBy=lz,Zt.template=R5,Zt.times=nz,Zt.toFinite=zd,Zt.toInteger=ji,Zt.toLength=va,Zt.toLower=VI,Zt.toNumber=os,Zt.toSafeInteger=u5,Zt.toString=Us,Zt.toUpper=HH,Zt.trim=zH,Zt.trimEnd=C5,Zt.trimStart=$H,Zt.truncate=VH,Zt.unescape=jH,Zt.uniqueId=N5,Zt.upperCase=KH,Zt.upperFirst=jI,Zt.each=cf,Zt.eachRight=nn,Zt.first=Nu,GI(Zt,function(){var W={};return of(Zt,function(ne,Oe){Yr.call(Zt.prototype,Oe)||(W[Oe]=ne)}),W}(),{chain:!1}),Zt.VERSION=w,Mn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(W){Zt[W].placeholder=Zt}),Mn(["drop","take"],function(W,ne){ps.prototype[W]=function(Oe){Oe=Oe===h?1:No(ji(Oe),0);var ht=this.__filtered__&&!ne?new ps(this):this.clone();return ht.__filtered__?ht.__takeCount__=Ya(Oe,ht.__takeCount__):ht.__views__.push({size:Ya(Oe,z),type:W+(ht.__dir__<0?"Right":"")}),ht},ps.prototype[W+"Right"]=function(Oe){return this.reverse()[W](Oe).reverse()}}),Mn(["filter","map","takeWhile"],function(W,ne){var Oe=ne+1,ht=Oe==L||Oe==T;ps.prototype[W]=function(Ut){var rr=this.clone();return rr.__iteratees__.push({iteratee:Ni(Ut,3),type:Oe}),rr.__filtered__=rr.__filtered__||ht,rr}}),Mn(["head","last"],function(W,ne){var Oe="take"+(ne?"Right":"");ps.prototype[W]=function(){return this[Oe](1).value()[0]}}),Mn(["initial","tail"],function(W,ne){var Oe="drop"+(ne?"":"Right");ps.prototype[W]=function(){return this.__filtered__?new ps(this):this[Oe](1)}}),ps.prototype.compact=function(){return this.filter(Uc)},ps.prototype.find=function(W){return this.filter(W).head()},ps.prototype.findLast=function(W){return this.reverse().find(W)},ps.prototype.invokeMap=ss(function(W,ne){return typeof W=="function"?new ps(this):this.map(function(Oe){return Km(Oe,W,ne)})}),ps.prototype.reject=function(W){return this.filter(ZA(Ni(W)))},ps.prototype.slice=function(W,ne){W=ji(W);var Oe=this;return Oe.__filtered__&&(W>0||ne<0)?new ps(Oe):(W<0?Oe=Oe.takeRight(-W):W&&(Oe=Oe.drop(W)),ne!==h&&(ne=ji(ne),Oe=ne<0?Oe.dropRight(-ne):Oe.take(ne-W)),Oe)},ps.prototype.takeRightWhile=function(W){return this.reverse().takeWhile(W).reverse()},ps.prototype.toArray=function(){return this.take(z)},of(ps.prototype,function(W,ne){var Oe=/^(?:filter|find|map|reject)|While$/.test(ne),ht=/^(?:head|last)$/.test(ne),Ut=Zt[ht?"take"+(ne=="last"?"Right":""):ne],rr=ht||/^find/.test(ne);Ut&&(Zt.prototype[ne]=function(){var mr=this.__wrapped__,Cr=ht?[1]:arguments,Lr=mr instanceof ps,wn=Cr[0],_n=Lr||Gi(mr),Rn=function(gs){var Ts=Ut.apply(Zt,Os([gs],Cr));return ht&&Jn?Ts[0]:Ts};_n&&Oe&&typeof wn=="function"&&wn.length!=1&&(Lr=_n=!1);var Jn=this.__chain__,vi=!!this.__actions__.length,Ri=rr&&!Jn,ns=Lr&&!vi;if(!rr&&_n){mr=ns?mr:new ps(this);var Di=W.apply(mr,Cr);return Di.__actions__.push({func:KA,args:[Rn],thisArg:h}),new dl(Di,Jn)}return Ri&&ns?W.apply(this,Cr):(Di=this.thru(Rn),Ri?ht?Di.value()[0]:Di.value():Di)})}),Mn(["pop","push","shift","sort","splice","unshift"],function(W){var ne=dn[W],Oe=/^(?:push|sort|unshift)$/.test(W)?"tap":"thru",ht=/^(?:pop|shift)$/.test(W);Zt.prototype[W]=function(){var Ut=arguments;if(ht&&!this.__chain__){var rr=this.value();return ne.apply(Gi(rr)?rr:[],Ut)}return this[Oe](function(mr){return ne.apply(Gi(mr)?mr:[],Ut)})}}),of(ps.prototype,function(W,ne){var Oe=Zt[ne];if(Oe){var ht=Oe.name+"";Yr.call(Nd,ht)||(Nd[ht]=[]),Nd[ht].push({name:ne,func:Oe})}}),Nd[Q0(h,q).name]=[{name:"wrapper",func:h}],ps.prototype.clone=z4,ps.prototype.reverse=$4,ps.prototype.value=V4,Zt.prototype.at=zx,Zt.prototype.chain=gI,Zt.prototype.commit=GA,Zt.prototype.next=yI,Zt.prototype.plant=Vx,Zt.prototype.reverse=mI,Zt.prototype.toJSON=Zt.prototype.valueOf=Zt.prototype.value=jx,Zt.prototype.first=Zt.prototype.head,Um&&(Zt.prototype[Um]=$x),Zt},Er=gr();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Co._=Er,define(function(){return Er})):Qu?((Qu.exports=Er)._=Er,Sg._=Er):Co._=Er}).call(this)},92982:function(ie){function f(){return[]}ie.exports=f},36408:function(ie){function f(){return!1}ie.exports=f},77412:function(ie){"use strict";ie.exports=Math.abs},52418:function(ie){"use strict";ie.exports=Math.floor},19313:function(ie){"use strict";ie.exports=Number.isNaN||function(_){return _!==_}},57958:function(ie){"use strict";ie.exports=Math.max},47384:function(ie){"use strict";ie.exports=Math.min},250:function(ie){"use strict";ie.exports=Math.pow},51844:function(ie){"use strict";ie.exports=Math.round},47279:function(ie,f,_){"use strict";var h=_(19313);ie.exports=function(E){return h(E)||E===0?E:E<0?-1:1}},94527:function(ie,f,_){(function(){var h=_(65960),w=_(11036).utf8,E=_(24982),v=_(11036).bin,c=function(d,p){d.constructor==String?p&&p.encoding==="binary"?d=v.stringToBytes(d):d=w.stringToBytes(d):E(d)?d=Array.prototype.slice.call(d,0):Array.isArray(d)||(d=d.toString());for(var m=h.bytesToWords(d),C=d.length*8,x=1732584193,R=-271733879,S=-1732584194,O=271733878,M=0;M<m.length;M++)m[M]=(m[M]<<8|m[M]>>>24)&16711935|(m[M]<<24|m[M]>>>8)&4278255360;m[C>>>5]|=128<<C%32,m[(C+64>>>9<<4)+14]=C;for(var k=c._ff,q=c._gg,b=c._hh,F=c._ii,M=0;M<m.length;M+=16){var G=x,ue=R,le=S,X=O;x=k(x,R,S,O,m[M+0],7,-680876936),O=k(O,x,R,S,m[M+1],12,-389564586),S=k(S,O,x,R,m[M+2],17,606105819),R=k(R,S,O,x,m[M+3],22,-1044525330),x=k(x,R,S,O,m[M+4],7,-176418897),O=k(O,x,R,S,m[M+5],12,1200080426),S=k(S,O,x,R,m[M+6],17,-1473231341),R=k(R,S,O,x,m[M+7],22,-45705983),x=k(x,R,S,O,m[M+8],7,1770035416),O=k(O,x,R,S,m[M+9],12,-1958414417),S=k(S,O,x,R,m[M+10],17,-42063),R=k(R,S,O,x,m[M+11],22,-1990404162),x=k(x,R,S,O,m[M+12],7,1804603682),O=k(O,x,R,S,m[M+13],12,-40341101),S=k(S,O,x,R,m[M+14],17,-1502002290),R=k(R,S,O,x,m[M+15],22,1236535329),x=q(x,R,S,O,m[M+1],5,-165796510),O=q(O,x,R,S,m[M+6],9,-1069501632),S=q(S,O,x,R,m[M+11],14,643717713),R=q(R,S,O,x,m[M+0],20,-373897302),x=q(x,R,S,O,m[M+5],5,-701558691),O=q(O,x,R,S,m[M+10],9,38016083),S=q(S,O,x,R,m[M+15],14,-660478335),R=q(R,S,O,x,m[M+4],20,-405537848),x=q(x,R,S,O,m[M+9],5,568446438),O=q(O,x,R,S,m[M+14],9,-1019803690),S=q(S,O,x,R,m[M+3],14,-187363961),R=q(R,S,O,x,m[M+8],20,1163531501),x=q(x,R,S,O,m[M+13],5,-1444681467),O=q(O,x,R,S,m[M+2],9,-51403784),S=q(S,O,x,R,m[M+7],14,1735328473),R=q(R,S,O,x,m[M+12],20,-1926607734),x=b(x,R,S,O,m[M+5],4,-378558),O=b(O,x,R,S,m[M+8],11,-2022574463),S=b(S,O,x,R,m[M+11],16,1839030562),R=b(R,S,O,x,m[M+14],23,-35309556),x=b(x,R,S,O,m[M+1],4,-1530992060),O=b(O,x,R,S,m[M+4],11,1272893353),S=b(S,O,x,R,m[M+7],16,-155497632),R=b(R,S,O,x,m[M+10],23,-1094730640),x=b(x,R,S,O,m[M+13],4,681279174),O=b(O,x,R,S,m[M+0],11,-358537222),S=b(S,O,x,R,m[M+3],16,-722521979),R=b(R,S,O,x,m[M+6],23,76029189),x=b(x,R,S,O,m[M+9],4,-640364487),O=b(O,x,R,S,m[M+12],11,-421815835),S=b(S,O,x,R,m[M+15],16,530742520),R=b(R,S,O,x,m[M+2],23,-995338651),x=F(x,R,S,O,m[M+0],6,-198630844),O=F(O,x,R,S,m[M+7],10,1126891415),S=F(S,O,x,R,m[M+14],15,-1416354905),R=F(R,S,O,x,m[M+5],21,-57434055),x=F(x,R,S,O,m[M+12],6,1700485571),O=F(O,x,R,S,m[M+3],10,-1894986606),S=F(S,O,x,R,m[M+10],15,-1051523),R=F(R,S,O,x,m[M+1],21,-2054922799),x=F(x,R,S,O,m[M+8],6,1873313359),O=F(O,x,R,S,m[M+15],10,-30611744),S=F(S,O,x,R,m[M+6],15,-1560198380),R=F(R,S,O,x,m[M+13],21,1309151649),x=F(x,R,S,O,m[M+4],6,-145523070),O=F(O,x,R,S,m[M+11],10,-1120210379),S=F(S,O,x,R,m[M+2],15,718787259),R=F(R,S,O,x,m[M+9],21,-343485551),x=x+G>>>0,R=R+ue>>>0,S=S+le>>>0,O=O+X>>>0}return h.endian([x,R,S,O])};c._ff=function(d,p,m,C,x,R,S){var O=d+(p&m|~p&C)+(x>>>0)+S;return(O<<R|O>>>32-R)+p},c._gg=function(d,p,m,C,x,R,S){var O=d+(p&C|m&~C)+(x>>>0)+S;return(O<<R|O>>>32-R)+p},c._hh=function(d,p,m,C,x,R,S){var O=d+(p^m^C)+(x>>>0)+S;return(O<<R|O>>>32-R)+p},c._ii=function(d,p,m,C,x,R,S){var O=d+(m^(p|~C))+(x>>>0)+S;return(O<<R|O>>>32-R)+p},c._blocksize=16,c._digestsize=16,ie.exports=function(d,p){if(d==null)throw new Error("Illegal argument "+d);var m=h.wordsToBytes(c(d,p));return p&&p.asBytes?m:p&&p.asString?v.bytesToString(m):h.bytesToHex(m)}})()},43712:function(ie,f,_){"use strict";var h=_(36533).Buffer,w=_(85409);Object.defineProperty(f,"__esModule",{value:!0}),f.InvalidStatusCodeError=f.InvalidCertError=void 0;const E=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class v extends Error{constructor(k,q){super(k),this.fingerprint256=q}}f.InvalidCertError=v;class c extends Error{constructor(k){super(`Request Failed. Status Code: ${k}`),this.statusCode=k}}f.InvalidStatusCodeError=c;function d(M,k){if(!k||k==="text"||k==="json")try{let q=new TextDecoder("utf8",{fatal:!0}).decode(M);if(k==="text")return q;try{return JSON.parse(q)}catch(b){if(k==="json")throw b;return q}}catch(q){if(k==="text"||k==="json")throw q}return M}let p={};function m(M,k){let q={...E,...k};const b=_(87963),F=_(87963),G=_(46068),{promisify:ue}=_(1344),{resolve:le}=_(71481),X=!!/^https/.test(M);let se={method:q.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const de=he=>he.replace(/:| /g,"").toLowerCase();if(q.keepAlive){const he={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},K=[X,X&&q.sslPinnedCertificates?.map(B=>de(B)).sort()].join();se.agent=p[K]||(p[K]=new(X?F:b).Agent(he))}q.type==="json"&&(se.headers["Content-Type"]="application/json"),q.data&&(q.method||(se.method="POST"),se.body=q.type==="json"?JSON.stringify(q.data):q.data),se.headers={...se.headers,...q.headers},q.sslAllowSelfSigned&&(se.rejectUnauthorized=!1);const ye=async he=>{const K=he.statusCode;if(q.redirect&&300<=K&&K<400&&he.headers.location){if(q._redirectCount==10)throw new Error("Request failed. Too much redirects.");return q._redirectCount+=1,await m(le(M,he.headers.location),q)}if(q.expectStatusCode&&K!==q.expectStatusCode)throw he.resume(),new c(K);let B=[];for await(const N of he)B.push(N);let L=h.concat(B);const $=he.headers["content-encoding"];$==="br"&&(L=await ue(G.brotliDecompress)(L)),($==="gzip"||$==="deflate")&&(L=await ue(G.unzip)(L));const T=d(L,q.type);return q.full?{headers:he.headers,status:K,body:T}:T};return new Promise((he,K)=>{const B=async N=>{if(N&&N.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await m(M,{...q,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(j){j&&j.fingerprint256&&(N=new v(`Self-signed SSL certificate: ${j.fingerprint256}`,j.fingerprint256))}K(N)},L=(X?F:b).request(M,se,N=>{N.on("error",B),(async()=>{try{he(await ye(N))}catch(j){K(j)}})()});L.on("error",B);const $=q.sslPinnedCertificates?.map(N=>de(N)),T=N=>{const j=de(N.getPeerCertificate()?.fingerprint256||"");if(!(!j&&N.isSessionReused())&&!$.includes(j))return L.emit("error",new v(`Invalid SSL certificate: ${j} Expected: ${$}`,j)),L.abort()};q.sslPinnedCertificates&&L.on("socket",N=>{N.listeners("secureConnect").map(Y=>(Y.name||"").replace("bound ","")).includes("mfetchSecureConnect")||N.on("secureConnect",T.bind(null,N))}),q.keepAlive&&L.setNoDelay(!0),se.body&&L.write(se.body),L.end()})}const C=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(M=>M.toLowerCase())),x=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map(M=>M.toLowerCase()));async function R(M,k){let q={...E,...k};const b=new Headers;q.type==="json"&&b.set("Content-Type","application/json");let F=new URL(M);if(F.username){const X=btoa(`${F.username}:${F.password}`);b.set("Authorization",`Basic ${X}`),F.username="",F.password=""}M=""+F;for(let X in q.headers){const se=X.toLowerCase();(C.has(se)||q.cors&&!x.has(se))&&b.set(X,q.headers[X])}let G={headers:b,redirect:q.redirect?"follow":"manual"};q.referrer||(G.referrerPolicy="no-referrer"),q.cors&&(G.mode="cors"),q.data&&(q.method||(G.method="POST"),G.body=q.type==="json"?JSON.stringify(q.data):q.data);const ue=await fetch(M,G);if(q.expectStatusCode&&ue.status!==q.expectStatusCode)throw new c(ue.status);const le=d(new Uint8Array(await ue.arrayBuffer()),q.type);return q.full?{headers:Object.fromEntries(ue.headers.entries()),status:ue.status,body:le}:le}const S=!!(typeof w=="object"&&w.versions&&w.versions.node&&w.versions.v8);function O(M,k){return(S?m:R)(M,k)}f.default=O},53866:function(ie){var f=1e3,_=f*60,h=_*60,w=h*24,E=w*7,v=w*365.25;ie.exports=function(C,x){x=x||{};var R=typeof C;if(R==="string"&&C.length>0)return c(C);if(R==="number"&&isFinite(C))return x.long?p(C):d(C);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(C))};function c(C){if(C=String(C),!(C.length>100)){var x=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(C);if(x){var R=parseFloat(x[1]),S=(x[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return R*v;case"weeks":case"week":case"w":return R*E;case"days":case"day":case"d":return R*w;case"hours":case"hour":case"hrs":case"hr":case"h":return R*h;case"minutes":case"minute":case"mins":case"min":case"m":return R*_;case"seconds":case"second":case"secs":case"sec":case"s":return R*f;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return R;default:return}}}}function d(C){var x=Math.abs(C);return x>=w?Math.round(C/w)+"d":x>=h?Math.round(C/h)+"h":x>=_?Math.round(C/_)+"m":x>=f?Math.round(C/f)+"s":C+"ms"}function p(C){var x=Math.abs(C);return x>=w?m(C,x,w,"day"):x>=h?m(C,x,h,"hour"):x>=_?m(C,x,_,"minute"):x>=f?m(C,x,f,"second"):C+" ms"}function m(C,x,R,S){var O=x>=R*1.5;return Math.round(C/R)+" "+S+(O?"s":"")}},78311:function(ie,f,_){var h=typeof Map=="function"&&Map.prototype,w=Object.getOwnPropertyDescriptor&&h?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,E=h&&w&&typeof w.get=="function"?w.get:null,v=h&&Map.prototype.forEach,c=typeof Set=="function"&&Set.prototype,d=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,p=c&&d&&typeof d.get=="function"?d.get:null,m=c&&Set.prototype.forEach,C=typeof WeakMap=="function"&&WeakMap.prototype,x=C?WeakMap.prototype.has:null,R=typeof WeakSet=="function"&&WeakSet.prototype,S=R?WeakSet.prototype.has:null,O=typeof WeakRef=="function"&&WeakRef.prototype,M=O?WeakRef.prototype.deref:null,k=Boolean.prototype.valueOf,q=Object.prototype.toString,b=Function.prototype.toString,F=String.prototype.match,G=String.prototype.slice,ue=String.prototype.replace,le=String.prototype.toUpperCase,X=String.prototype.toLowerCase,se=RegExp.prototype.test,de=Array.prototype.concat,ye=Array.prototype.join,he=Array.prototype.slice,K=Math.floor,B=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,T=typeof Symbol=="function"&&typeof Symbol.iterator=="object",N=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||!0)?Symbol.toStringTag:null,j=Object.prototype.propertyIsEnumerable,Y=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Ct){return Ct.__proto__}:null);function Z(Ct,qe){if(Ct===1/0||Ct===-1/0||Ct!==Ct||Ct&&Ct>-1e3&&Ct<1e3||se.call(/e/,qe))return qe;var Yt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Ct=="number"){var ot=Ct<0?-K(-Ct):K(Ct);if(ot!==Ct){var Ae=String(ot),Rt=G.call(qe,Ae.length+1);return ue.call(Ae,Yt,"$&_")+"."+ue.call(ue.call(Rt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ue.call(qe,Yt,"$&_")}var z=_(69094),fe=z.custom,te=Le(fe)?fe:null,H={__proto__:null,double:'"',single:"'"},Q={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ie.exports=function Ct(qe,Yt,ot,Ae){var Rt=Yt||{};if(We(Rt,"quoteStyle")&&!We(H,Rt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(We(Rt,"maxStringLength")&&(typeof Rt.maxStringLength=="number"?Rt.maxStringLength<0&&Rt.maxStringLength!==1/0:Rt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ht=We(Rt,"customInspect")?Rt.customInspect:!0;if(typeof Ht!="boolean"&&Ht!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(We(Rt,"indent")&&Rt.indent!==null&&Rt.indent!==" "&&!(parseInt(Rt.indent,10)===Rt.indent&&Rt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(We(Rt,"numericSeparator")&&typeof Rt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var bt=Rt.numericSeparator;if(typeof qe>"u")return"undefined";if(qe===null)return"null";if(typeof qe=="boolean")return qe?"true":"false";if(typeof qe=="string")return xe(qe,Rt);if(typeof qe=="number"){if(qe===0)return 1/0/qe>0?"0":"-0";var Mt=String(qe);return bt?Z(qe,Mt):Mt}if(typeof qe=="bigint"){var tr=String(qe)+"n";return bt?Z(qe,tr):tr}var Vt=typeof Rt.depth>"u"?5:Rt.depth;if(typeof ot>"u"&&(ot=0),ot>=Vt&&Vt>0&&typeof qe=="object")return be(qe)?"[Array]":"[Object]";var Et=ft(Rt,ot);if(typeof Ae>"u")Ae=[];else if(Ft(Ae,qe)>=0)return"[Circular]";function Ye(rn,_r,pn){if(_r&&(Ae=he.call(Ae),Ae.push(_r)),pn){var $t={depth:Rt.depth};return We(Rt,"quoteStyle")&&($t.quoteStyle=Rt.quoteStyle),Ct(rn,$t,ot+1,Ae)}return Ct(rn,Rt,ot+1,Ae)}if(typeof qe=="function"&&!Ee(qe)){var Tt=_t(qe),Wt=Ot(qe,Ye);return"[Function"+(Tt?": "+Tt:" (anonymous)")+"]"+(Wt.length>0?" { "+ye.call(Wt,", ")+" }":"")}if(Le(qe)){var dr=T?ue.call(String(qe),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(qe);return typeof qe=="object"&&!T?it(dr):dr}if(ke(qe)){for(var at="<"+X.call(String(qe.nodeName)),wt=qe.attributes||[],At=0;At<wt.length;At++)at+=" "+wt[At].name+"="+oe(_e(wt[At].value),"double",Rt);return at+=">",qe.childNodes&&qe.childNodes.length&&(at+="..."),at+="</"+X.call(String(qe.nodeName))+">",at}if(be(qe)){if(qe.length===0)return"[]";var Je=Ot(qe,Ye);return Et&&!It(Je)?"["+Jt(Je,Et)+"]":"[ "+ye.call(Je,", ")+" ]"}if(me(qe)){var Lt=Ot(qe,Ye);return!("cause"in Error.prototype)&&"cause"in qe&&!j.call(qe,"cause")?"{ ["+String(qe)+"] "+ye.call(de.call("[cause]: "+Ye(qe.cause),Lt),", ")+" }":Lt.length===0?"["+String(qe)+"]":"{ ["+String(qe)+"] "+ye.call(Lt,", ")+" }"}if(typeof qe=="object"&&Ht){if(te&&typeof qe[te]=="function"&&z)return z(qe,{depth:Vt-ot});if(Ht!=="symbol"&&typeof qe.inspect=="function")return qe.inspect()}if(gt(qe)){var sr=[];return v&&v.call(qe,function(rn,_r){sr.push(Ye(_r,qe,!0)+" => "+Ye(rn,qe))}),st("Map",E.call(qe),sr,Et)}if(tt(qe)){var ur=[];return m&&m.call(qe,function(rn){ur.push(Ye(rn,qe))}),st("Set",p.call(qe),ur,Et)}if(lt(qe))return Xe("WeakMap");if(rt(qe))return Xe("WeakSet");if(dt(qe))return Xe("WeakRef");if(He(qe))return it(Ye(Number(qe)));if(Ge(qe))return it(Ye(B.call(qe)));if(Ie(qe))return it(k.call(qe));if(Ke(qe))return it(Ye(String(qe)));if(typeof globalThis<"u"&&qe===globalThis||typeof _.g<"u"&&qe===_.g)return"{ [object globalThis] }";if(!we(qe)&&!Ee(qe)){var vr=Ot(qe,Ye),kr=Y?Y(qe)===Object.prototype:qe instanceof Object||qe.constructor===Object,Jr=qe instanceof Object?"":"null prototype",hr=!kr&&N&&Object(qe)===qe&&N in qe?G.call(Ze(qe),8,-1):Jr?"Object":"",$r=kr||typeof qe.constructor!="function"?"":qe.constructor.name?qe.constructor.name+" ":"",Hr=$r+(hr||Jr?"["+ye.call(de.call([],hr||[],Jr||[]),": ")+"] ":"");return vr.length===0?Hr+"{}":Et?Hr+"{"+Jt(vr,Et)+"}":Hr+"{ "+ye.call(vr,", ")+" }"}return String(qe)};function oe(Ct,qe,Yt){var ot=Yt.quoteStyle||qe,Ae=H[ot];return Ae+Ct+Ae}function _e(Ct){return ue.call(String(Ct),/"/g,""")}function ge(Ct){return!N||!(typeof Ct=="object"&&(N in Ct||typeof Ct[N]<"u"))}function be(Ct){return Ze(Ct)==="[object Array]"&&ge(Ct)}function we(Ct){return Ze(Ct)==="[object Date]"&&ge(Ct)}function Ee(Ct){return Ze(Ct)==="[object RegExp]"&&ge(Ct)}function me(Ct){return Ze(Ct)==="[object Error]"&&ge(Ct)}function Ke(Ct){return Ze(Ct)==="[object String]"&&ge(Ct)}function He(Ct){return Ze(Ct)==="[object Number]"&&ge(Ct)}function Ie(Ct){return Ze(Ct)==="[object Boolean]"&&ge(Ct)}function Le(Ct){if(T)return Ct&&typeof Ct=="object"&&Ct instanceof Symbol;if(typeof Ct=="symbol")return!0;if(!Ct||typeof Ct!="object"||!$)return!1;try{return $.call(Ct),!0}catch{}return!1}function Ge(Ct){if(!Ct||typeof Ct!="object"||!B)return!1;try{return B.call(Ct),!0}catch{}return!1}var Be=Object.prototype.hasOwnProperty||function(Ct){return Ct in this};function We(Ct,qe){return Be.call(Ct,qe)}function Ze(Ct){return q.call(Ct)}function _t(Ct){if(Ct.name)return Ct.name;var qe=F.call(b.call(Ct),/^function\s*([\w$]+)/);return qe?qe[1]:null}function Ft(Ct,qe){if(Ct.indexOf)return Ct.indexOf(qe);for(var Yt=0,ot=Ct.length;Yt<ot;Yt++)if(Ct[Yt]===qe)return Yt;return-1}function gt(Ct){if(!E||!Ct||typeof Ct!="object")return!1;try{E.call(Ct);try{p.call(Ct)}catch{return!0}return Ct instanceof Map}catch{}return!1}function lt(Ct){if(!x||!Ct||typeof Ct!="object")return!1;try{x.call(Ct,x);try{S.call(Ct,S)}catch{return!0}return Ct instanceof WeakMap}catch{}return!1}function dt(Ct){if(!M||!Ct||typeof Ct!="object")return!1;try{return M.call(Ct),!0}catch{}return!1}function tt(Ct){if(!p||!Ct||typeof Ct!="object")return!1;try{p.call(Ct);try{E.call(Ct)}catch{return!0}return Ct instanceof Set}catch{}return!1}function rt(Ct){if(!S||!Ct||typeof Ct!="object")return!1;try{S.call(Ct,S);try{x.call(Ct,x)}catch{return!0}return Ct instanceof WeakSet}catch{}return!1}function ke(Ct){return!Ct||typeof Ct!="object"?!1:typeof HTMLElement<"u"&&Ct instanceof HTMLElement?!0:typeof Ct.nodeName=="string"&&typeof Ct.getAttribute=="function"}function xe(Ct,qe){if(Ct.length>qe.maxStringLength){var Yt=Ct.length-qe.maxStringLength,ot="... "+Yt+" more character"+(Yt>1?"s":"");return xe(G.call(Ct,0,qe.maxStringLength),qe)+ot}var Ae=Q[qe.quoteStyle||"single"];Ae.lastIndex=0;var Rt=ue.call(ue.call(Ct,Ae,"\\$1"),/[\x00-\x1f]/g,Pe);return oe(Rt,"single",qe)}function Pe(Ct){var qe=Ct.charCodeAt(0),Yt={8:"b",9:"t",10:"n",12:"f",13:"r"}[qe];return Yt?"\\"+Yt:"\\x"+(qe<16?"0":"")+le.call(qe.toString(16))}function it(Ct){return"Object("+Ct+")"}function Xe(Ct){return Ct+" { ? }"}function st(Ct,qe,Yt,ot){var Ae=ot?Jt(Yt,ot):ye.call(Yt,", ");return Ct+" ("+qe+") {"+Ae+"}"}function It(Ct){for(var qe=0;qe<Ct.length;qe++)if(Ft(Ct[qe],`
|
||
`)>=0)return!1;return!0}function ft(Ct,qe){var Yt;if(Ct.indent===" ")Yt=" ";else if(typeof Ct.indent=="number"&&Ct.indent>0)Yt=ye.call(Array(Ct.indent+1)," ");else return null;return{base:Yt,prev:ye.call(Array(qe+1),Yt)}}function Jt(Ct,qe){if(Ct.length===0)return"";var Yt=`
|
||
`+qe.prev+qe.base;return Yt+ye.call(Ct,","+Yt)+`
|
||
`+qe.prev}function Ot(Ct,qe){var Yt=be(Ct),ot=[];if(Yt){ot.length=Ct.length;for(var Ae=0;Ae<Ct.length;Ae++)ot[Ae]=We(Ct,Ae)?qe(Ct[Ae],Ct):""}var Rt=typeof L=="function"?L(Ct):[],Ht;if(T){Ht={};for(var bt=0;bt<Rt.length;bt++)Ht["$"+Rt[bt]]=Rt[bt]}for(var Mt in Ct)We(Ct,Mt)&&(Yt&&String(Number(Mt))===Mt&&Mt<Ct.length||T&&Ht["$"+Mt]instanceof Symbol||(se.call(/[^\w$]/,Mt)?ot.push(qe(Mt,Ct)+": "+qe(Ct[Mt],Ct)):ot.push(Mt+": "+qe(Ct[Mt],Ct))));if(typeof L=="function")for(var tr=0;tr<Rt.length;tr++)j.call(Ct,Rt[tr])&&ot.push("["+qe(Rt[tr])+"]: "+qe(Ct[Rt[tr]],Ct));return ot}},30656:function(ie){"use strict";var f=function(_){return _!==_};ie.exports=function(h,w){return h===0&&w===0?1/h===1/w:!!(h===w||f(h)&&f(w))}},19068:function(ie,f,_){"use strict";var h=_(4938),w=_(17695),E=_(30656),v=_(12197),c=_(49235),d=w(v(),Object);h(d,{getPolyfill:v,implementation:E,shim:c}),ie.exports=d},12197:function(ie,f,_){"use strict";var h=_(30656);ie.exports=function(){return typeof Object.is=="function"?Object.is:h}},49235:function(ie,f,_){"use strict";var h=_(12197),w=_(4938);ie.exports=function(){var v=h();return w(Object,{is:v},{is:function(){return Object.is!==v}}),v}},25717:function(ie,f,_){"use strict";var h;if(!Object.keys){var w=Object.prototype.hasOwnProperty,E=Object.prototype.toString,v=_(14635),c=Object.prototype.propertyIsEnumerable,d=!c.call({toString:null},"toString"),p=c.call(function(){},"prototype"),m=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],C=function(O){var M=O.constructor;return M&&M.prototype===O},x={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},R=function(){return!1;for(var O in self)try{if(!x["$"+O]&&w.call(self,O)&&self[O]!==null&&typeof self[O]=="object")try{C(self[O])}catch{return!0}}catch{return!0}}(),S=function(O){return C(O);try{return C(O)}catch{return!1}};h=function(M){var k=M!==null&&typeof M=="object",q=E.call(M)==="[object Function]",b=v(M),F=k&&E.call(M)==="[object String]",G=[];if(!k&&!q&&!b)throw new TypeError("Object.keys called on a non-object");var ue=p&&q;if(F&&M.length>0&&!w.call(M,0))for(var le=0;le<M.length;++le)G.push(String(le));if(b&&M.length>0)for(var X=0;X<M.length;++X)G.push(String(X));else for(var se in M)!(ue&&se==="prototype")&&w.call(M,se)&&G.push(String(se));if(d)for(var de=S(M),ye=0;ye<m.length;++ye)!(de&&m[ye]==="constructor")&&w.call(M,m[ye])&&G.push(m[ye]);return G}}ie.exports=h},5187:function(ie,f,_){"use strict";var h=Array.prototype.slice,w=_(14635),E=Object.keys,v=E?function(p){return E(p)}:_(25717),c=Object.keys;v.shim=function(){if(Object.keys){var p=function(){var m=Object.keys(arguments);return m&&m.length===arguments.length}(1,2);p||(Object.keys=function(C){return w(C)?c(h.call(C)):c(C)})}else Object.keys=v;return Object.keys||v},ie.exports=v},14635:function(ie){"use strict";var f=Object.prototype.toString;ie.exports=function(h){var w=f.call(h),E=w==="[object Arguments]";return E||(E=w!=="[object Array]"&&h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&f.call(h.callee)==="[object Function]"),E}},1924:function(ie,f,_){"use strict";var h=_(5187),w=_(9712)(),E=_(98801),v=_(25153),c=E("Array.prototype.push"),d=E("Object.prototype.propertyIsEnumerable"),p=w?v.getOwnPropertySymbols:null;ie.exports=function(C,x){if(C==null)throw new TypeError("target must be an object");var R=v(C);if(arguments.length===1)return R;for(var S=1;S<arguments.length;++S){var O=v(arguments[S]),M=h(O),k=w&&(v.getOwnPropertySymbols||p);if(k)for(var q=k(O),b=0;b<q.length;++b){var F=q[b];d(O,F)&&c(M,F)}for(var G=0;G<M.length;++G){var ue=M[G];if(d(O,ue)){var le=O[ue];R[ue]=le}}}return R}},43921:function(ie,f,_){"use strict";var h=_(1924),w=function(){if(!Object.assign)return!1;for(var v="abcdefghijklmnopqrst",c=v.split(""),d={},p=0;p<c.length;++p)d[c[p]]=c[p];var m=Object.assign({},d),C="";for(var x in m)C+=x;return v!==C},E=function(){if(!Object.assign||!Object.preventExtensions)return!1;var v=Object.preventExtensions({1:2});try{Object.assign(v,"xy")}catch{return v[1]==="y"}return!1};ie.exports=function(){return!Object.assign||w()||E()?h:Object.assign}},50020:function(ie,f){"use strict";var _=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function h(v,c){return Object.prototype.hasOwnProperty.call(v,c)}f.assign=function(v){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var p in d)h(d,p)&&(v[p]=d[p])}}return v},f.shrinkBuf=function(v,c){return v.length===c?v:v.subarray?v.subarray(0,c):(v.length=c,v)};var w={arraySet:function(v,c,d,p,m){if(c.subarray&&v.subarray){v.set(c.subarray(d,d+p),m);return}for(var C=0;C<p;C++)v[m+C]=c[d+C]},flattenChunks:function(v){var c,d,p,m,C,x;for(p=0,c=0,d=v.length;c<d;c++)p+=v[c].length;for(x=new Uint8Array(p),m=0,c=0,d=v.length;c<d;c++)C=v[c],x.set(C,m),m+=C.length;return x}},E={arraySet:function(v,c,d,p,m){for(var C=0;C<p;C++)v[m+C]=c[d+C]},flattenChunks:function(v){return[].concat.apply([],v)}};f.setTyped=function(v){v?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,w)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,E))},f.setTyped(_)},81356:function(ie){"use strict";function f(_,h,w,E){for(var v=_&65535|0,c=_>>>16&65535|0,d=0;w!==0;){d=w>2e3?2e3:w,w-=d;do v=v+h[E++]|0,c=c+v|0;while(--d);v%=65521,c%=65521}return v|c<<16|0}ie.exports=f},10756:function(ie){"use strict";ie.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},49910:function(ie){"use strict";function f(){for(var w,E=[],v=0;v<256;v++){w=v;for(var c=0;c<8;c++)w=w&1?3988292384^w>>>1:w>>>1;E[v]=w}return E}var _=f();function h(w,E,v,c){var d=_,p=c+v;w^=-1;for(var m=c;m<p;m++)w=w>>>8^d[(w^E[m])&255];return w^-1}ie.exports=h},78250:function(ie,f,_){"use strict";var h=_(50020),w=_(9984),E=_(81356),v=_(49910),c=_(5317),d=0,p=1,m=3,C=4,x=5,R=0,S=1,O=-2,M=-3,k=-5,q=-1,b=1,F=2,G=3,ue=4,le=0,X=2,se=8,de=9,ye=15,he=8,K=29,B=256,L=B+1+K,$=30,T=19,N=2*L+1,j=15,Y=3,Z=258,z=Z+Y+1,fe=32,te=42,H=69,Q=73,oe=91,_e=103,ge=113,be=666,we=1,Ee=2,me=3,Ke=4,He=3;function Ie(Ae,Rt){return Ae.msg=c[Rt],Rt}function Le(Ae){return(Ae<<1)-(Ae>4?9:0)}function Ge(Ae){for(var Rt=Ae.length;--Rt>=0;)Ae[Rt]=0}function Be(Ae){var Rt=Ae.state,Ht=Rt.pending;Ht>Ae.avail_out&&(Ht=Ae.avail_out),Ht!==0&&(h.arraySet(Ae.output,Rt.pending_buf,Rt.pending_out,Ht,Ae.next_out),Ae.next_out+=Ht,Rt.pending_out+=Ht,Ae.total_out+=Ht,Ae.avail_out-=Ht,Rt.pending-=Ht,Rt.pending===0&&(Rt.pending_out=0))}function We(Ae,Rt){w._tr_flush_block(Ae,Ae.block_start>=0?Ae.block_start:-1,Ae.strstart-Ae.block_start,Rt),Ae.block_start=Ae.strstart,Be(Ae.strm)}function Ze(Ae,Rt){Ae.pending_buf[Ae.pending++]=Rt}function _t(Ae,Rt){Ae.pending_buf[Ae.pending++]=Rt>>>8&255,Ae.pending_buf[Ae.pending++]=Rt&255}function Ft(Ae,Rt,Ht,bt){var Mt=Ae.avail_in;return Mt>bt&&(Mt=bt),Mt===0?0:(Ae.avail_in-=Mt,h.arraySet(Rt,Ae.input,Ae.next_in,Mt,Ht),Ae.state.wrap===1?Ae.adler=E(Ae.adler,Rt,Mt,Ht):Ae.state.wrap===2&&(Ae.adler=v(Ae.adler,Rt,Mt,Ht)),Ae.next_in+=Mt,Ae.total_in+=Mt,Mt)}function gt(Ae,Rt){var Ht=Ae.max_chain_length,bt=Ae.strstart,Mt,tr,Vt=Ae.prev_length,Et=Ae.nice_match,Ye=Ae.strstart>Ae.w_size-z?Ae.strstart-(Ae.w_size-z):0,Tt=Ae.window,Wt=Ae.w_mask,dr=Ae.prev,at=Ae.strstart+Z,wt=Tt[bt+Vt-1],At=Tt[bt+Vt];Ae.prev_length>=Ae.good_match&&(Ht>>=2),Et>Ae.lookahead&&(Et=Ae.lookahead);do if(Mt=Rt,!(Tt[Mt+Vt]!==At||Tt[Mt+Vt-1]!==wt||Tt[Mt]!==Tt[bt]||Tt[++Mt]!==Tt[bt+1])){bt+=2,Mt++;do;while(Tt[++bt]===Tt[++Mt]&&Tt[++bt]===Tt[++Mt]&&Tt[++bt]===Tt[++Mt]&&Tt[++bt]===Tt[++Mt]&&Tt[++bt]===Tt[++Mt]&&Tt[++bt]===Tt[++Mt]&&Tt[++bt]===Tt[++Mt]&&Tt[++bt]===Tt[++Mt]&&bt<at);if(tr=Z-(at-bt),bt=at-Z,tr>Vt){if(Ae.match_start=Rt,Vt=tr,tr>=Et)break;wt=Tt[bt+Vt-1],At=Tt[bt+Vt]}}while((Rt=dr[Rt&Wt])>Ye&&--Ht!==0);return Vt<=Ae.lookahead?Vt:Ae.lookahead}function lt(Ae){var Rt=Ae.w_size,Ht,bt,Mt,tr,Vt;do{if(tr=Ae.window_size-Ae.lookahead-Ae.strstart,Ae.strstart>=Rt+(Rt-z)){h.arraySet(Ae.window,Ae.window,Rt,Rt,0),Ae.match_start-=Rt,Ae.strstart-=Rt,Ae.block_start-=Rt,bt=Ae.hash_size,Ht=bt;do Mt=Ae.head[--Ht],Ae.head[Ht]=Mt>=Rt?Mt-Rt:0;while(--bt);bt=Rt,Ht=bt;do Mt=Ae.prev[--Ht],Ae.prev[Ht]=Mt>=Rt?Mt-Rt:0;while(--bt);tr+=Rt}if(Ae.strm.avail_in===0)break;if(bt=Ft(Ae.strm,Ae.window,Ae.strstart+Ae.lookahead,tr),Ae.lookahead+=bt,Ae.lookahead+Ae.insert>=Y)for(Vt=Ae.strstart-Ae.insert,Ae.ins_h=Ae.window[Vt],Ae.ins_h=(Ae.ins_h<<Ae.hash_shift^Ae.window[Vt+1])&Ae.hash_mask;Ae.insert&&(Ae.ins_h=(Ae.ins_h<<Ae.hash_shift^Ae.window[Vt+Y-1])&Ae.hash_mask,Ae.prev[Vt&Ae.w_mask]=Ae.head[Ae.ins_h],Ae.head[Ae.ins_h]=Vt,Vt++,Ae.insert--,!(Ae.lookahead+Ae.insert<Y)););}while(Ae.lookahead<z&&Ae.strm.avail_in!==0)}function dt(Ae,Rt){var Ht=65535;for(Ht>Ae.pending_buf_size-5&&(Ht=Ae.pending_buf_size-5);;){if(Ae.lookahead<=1){if(lt(Ae),Ae.lookahead===0&&Rt===d)return we;if(Ae.lookahead===0)break}Ae.strstart+=Ae.lookahead,Ae.lookahead=0;var bt=Ae.block_start+Ht;if((Ae.strstart===0||Ae.strstart>=bt)&&(Ae.lookahead=Ae.strstart-bt,Ae.strstart=bt,We(Ae,!1),Ae.strm.avail_out===0)||Ae.strstart-Ae.block_start>=Ae.w_size-z&&(We(Ae,!1),Ae.strm.avail_out===0))return we}return Ae.insert=0,Rt===C?(We(Ae,!0),Ae.strm.avail_out===0?me:Ke):(Ae.strstart>Ae.block_start&&(We(Ae,!1),Ae.strm.avail_out===0),we)}function tt(Ae,Rt){for(var Ht,bt;;){if(Ae.lookahead<z){if(lt(Ae),Ae.lookahead<z&&Rt===d)return we;if(Ae.lookahead===0)break}if(Ht=0,Ae.lookahead>=Y&&(Ae.ins_h=(Ae.ins_h<<Ae.hash_shift^Ae.window[Ae.strstart+Y-1])&Ae.hash_mask,Ht=Ae.prev[Ae.strstart&Ae.w_mask]=Ae.head[Ae.ins_h],Ae.head[Ae.ins_h]=Ae.strstart),Ht!==0&&Ae.strstart-Ht<=Ae.w_size-z&&(Ae.match_length=gt(Ae,Ht)),Ae.match_length>=Y)if(bt=w._tr_tally(Ae,Ae.strstart-Ae.match_start,Ae.match_length-Y),Ae.lookahead-=Ae.match_length,Ae.match_length<=Ae.max_lazy_match&&Ae.lookahead>=Y){Ae.match_length--;do Ae.strstart++,Ae.ins_h=(Ae.ins_h<<Ae.hash_shift^Ae.window[Ae.strstart+Y-1])&Ae.hash_mask,Ht=Ae.prev[Ae.strstart&Ae.w_mask]=Ae.head[Ae.ins_h],Ae.head[Ae.ins_h]=Ae.strstart;while(--Ae.match_length!==0);Ae.strstart++}else Ae.strstart+=Ae.match_length,Ae.match_length=0,Ae.ins_h=Ae.window[Ae.strstart],Ae.ins_h=(Ae.ins_h<<Ae.hash_shift^Ae.window[Ae.strstart+1])&Ae.hash_mask;else bt=w._tr_tally(Ae,0,Ae.window[Ae.strstart]),Ae.lookahead--,Ae.strstart++;if(bt&&(We(Ae,!1),Ae.strm.avail_out===0))return we}return Ae.insert=Ae.strstart<Y-1?Ae.strstart:Y-1,Rt===C?(We(Ae,!0),Ae.strm.avail_out===0?me:Ke):Ae.last_lit&&(We(Ae,!1),Ae.strm.avail_out===0)?we:Ee}function rt(Ae,Rt){for(var Ht,bt,Mt;;){if(Ae.lookahead<z){if(lt(Ae),Ae.lookahead<z&&Rt===d)return we;if(Ae.lookahead===0)break}if(Ht=0,Ae.lookahead>=Y&&(Ae.ins_h=(Ae.ins_h<<Ae.hash_shift^Ae.window[Ae.strstart+Y-1])&Ae.hash_mask,Ht=Ae.prev[Ae.strstart&Ae.w_mask]=Ae.head[Ae.ins_h],Ae.head[Ae.ins_h]=Ae.strstart),Ae.prev_length=Ae.match_length,Ae.prev_match=Ae.match_start,Ae.match_length=Y-1,Ht!==0&&Ae.prev_length<Ae.max_lazy_match&&Ae.strstart-Ht<=Ae.w_size-z&&(Ae.match_length=gt(Ae,Ht),Ae.match_length<=5&&(Ae.strategy===b||Ae.match_length===Y&&Ae.strstart-Ae.match_start>4096)&&(Ae.match_length=Y-1)),Ae.prev_length>=Y&&Ae.match_length<=Ae.prev_length){Mt=Ae.strstart+Ae.lookahead-Y,bt=w._tr_tally(Ae,Ae.strstart-1-Ae.prev_match,Ae.prev_length-Y),Ae.lookahead-=Ae.prev_length-1,Ae.prev_length-=2;do++Ae.strstart<=Mt&&(Ae.ins_h=(Ae.ins_h<<Ae.hash_shift^Ae.window[Ae.strstart+Y-1])&Ae.hash_mask,Ht=Ae.prev[Ae.strstart&Ae.w_mask]=Ae.head[Ae.ins_h],Ae.head[Ae.ins_h]=Ae.strstart);while(--Ae.prev_length!==0);if(Ae.match_available=0,Ae.match_length=Y-1,Ae.strstart++,bt&&(We(Ae,!1),Ae.strm.avail_out===0))return we}else if(Ae.match_available){if(bt=w._tr_tally(Ae,0,Ae.window[Ae.strstart-1]),bt&&We(Ae,!1),Ae.strstart++,Ae.lookahead--,Ae.strm.avail_out===0)return we}else Ae.match_available=1,Ae.strstart++,Ae.lookahead--}return Ae.match_available&&(bt=w._tr_tally(Ae,0,Ae.window[Ae.strstart-1]),Ae.match_available=0),Ae.insert=Ae.strstart<Y-1?Ae.strstart:Y-1,Rt===C?(We(Ae,!0),Ae.strm.avail_out===0?me:Ke):Ae.last_lit&&(We(Ae,!1),Ae.strm.avail_out===0)?we:Ee}function ke(Ae,Rt){for(var Ht,bt,Mt,tr,Vt=Ae.window;;){if(Ae.lookahead<=Z){if(lt(Ae),Ae.lookahead<=Z&&Rt===d)return we;if(Ae.lookahead===0)break}if(Ae.match_length=0,Ae.lookahead>=Y&&Ae.strstart>0&&(Mt=Ae.strstart-1,bt=Vt[Mt],bt===Vt[++Mt]&&bt===Vt[++Mt]&&bt===Vt[++Mt])){tr=Ae.strstart+Z;do;while(bt===Vt[++Mt]&&bt===Vt[++Mt]&&bt===Vt[++Mt]&&bt===Vt[++Mt]&&bt===Vt[++Mt]&&bt===Vt[++Mt]&&bt===Vt[++Mt]&&bt===Vt[++Mt]&&Mt<tr);Ae.match_length=Z-(tr-Mt),Ae.match_length>Ae.lookahead&&(Ae.match_length=Ae.lookahead)}if(Ae.match_length>=Y?(Ht=w._tr_tally(Ae,1,Ae.match_length-Y),Ae.lookahead-=Ae.match_length,Ae.strstart+=Ae.match_length,Ae.match_length=0):(Ht=w._tr_tally(Ae,0,Ae.window[Ae.strstart]),Ae.lookahead--,Ae.strstart++),Ht&&(We(Ae,!1),Ae.strm.avail_out===0))return we}return Ae.insert=0,Rt===C?(We(Ae,!0),Ae.strm.avail_out===0?me:Ke):Ae.last_lit&&(We(Ae,!1),Ae.strm.avail_out===0)?we:Ee}function xe(Ae,Rt){for(var Ht;;){if(Ae.lookahead===0&&(lt(Ae),Ae.lookahead===0)){if(Rt===d)return we;break}if(Ae.match_length=0,Ht=w._tr_tally(Ae,0,Ae.window[Ae.strstart]),Ae.lookahead--,Ae.strstart++,Ht&&(We(Ae,!1),Ae.strm.avail_out===0))return we}return Ae.insert=0,Rt===C?(We(Ae,!0),Ae.strm.avail_out===0?me:Ke):Ae.last_lit&&(We(Ae,!1),Ae.strm.avail_out===0)?we:Ee}function Pe(Ae,Rt,Ht,bt,Mt){this.good_length=Ae,this.max_lazy=Rt,this.nice_length=Ht,this.max_chain=bt,this.func=Mt}var it;it=[new Pe(0,0,0,0,dt),new Pe(4,4,8,4,tt),new Pe(4,5,16,8,tt),new Pe(4,6,32,32,tt),new Pe(4,4,16,16,rt),new Pe(8,16,32,32,rt),new Pe(8,16,128,128,rt),new Pe(8,32,128,256,rt),new Pe(32,128,258,1024,rt),new Pe(32,258,258,4096,rt)];function Xe(Ae){Ae.window_size=2*Ae.w_size,Ge(Ae.head),Ae.max_lazy_match=it[Ae.level].max_lazy,Ae.good_match=it[Ae.level].good_length,Ae.nice_match=it[Ae.level].nice_length,Ae.max_chain_length=it[Ae.level].max_chain,Ae.strstart=0,Ae.block_start=0,Ae.lookahead=0,Ae.insert=0,Ae.match_length=Ae.prev_length=Y-1,Ae.match_available=0,Ae.ins_h=0}function st(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=se,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new h.Buf16(N*2),this.dyn_dtree=new h.Buf16((2*$+1)*2),this.bl_tree=new h.Buf16((2*T+1)*2),Ge(this.dyn_ltree),Ge(this.dyn_dtree),Ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new h.Buf16(j+1),this.heap=new h.Buf16(2*L+1),Ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new h.Buf16(2*L+1),Ge(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function It(Ae){var Rt;return!Ae||!Ae.state?Ie(Ae,O):(Ae.total_in=Ae.total_out=0,Ae.data_type=X,Rt=Ae.state,Rt.pending=0,Rt.pending_out=0,Rt.wrap<0&&(Rt.wrap=-Rt.wrap),Rt.status=Rt.wrap?te:ge,Ae.adler=Rt.wrap===2?0:1,Rt.last_flush=d,w._tr_init(Rt),R)}function ft(Ae){var Rt=It(Ae);return Rt===R&&Xe(Ae.state),Rt}function Jt(Ae,Rt){return!Ae||!Ae.state||Ae.state.wrap!==2?O:(Ae.state.gzhead=Rt,R)}function Ot(Ae,Rt,Ht,bt,Mt,tr){if(!Ae)return O;var Vt=1;if(Rt===q&&(Rt=6),bt<0?(Vt=0,bt=-bt):bt>15&&(Vt=2,bt-=16),Mt<1||Mt>de||Ht!==se||bt<8||bt>15||Rt<0||Rt>9||tr<0||tr>ue)return Ie(Ae,O);bt===8&&(bt=9);var Et=new st;return Ae.state=Et,Et.strm=Ae,Et.wrap=Vt,Et.gzhead=null,Et.w_bits=bt,Et.w_size=1<<Et.w_bits,Et.w_mask=Et.w_size-1,Et.hash_bits=Mt+7,Et.hash_size=1<<Et.hash_bits,Et.hash_mask=Et.hash_size-1,Et.hash_shift=~~((Et.hash_bits+Y-1)/Y),Et.window=new h.Buf8(Et.w_size*2),Et.head=new h.Buf16(Et.hash_size),Et.prev=new h.Buf16(Et.w_size),Et.lit_bufsize=1<<Mt+6,Et.pending_buf_size=Et.lit_bufsize*4,Et.pending_buf=new h.Buf8(Et.pending_buf_size),Et.d_buf=1*Et.lit_bufsize,Et.l_buf=3*Et.lit_bufsize,Et.level=Rt,Et.strategy=tr,Et.method=Ht,ft(Ae)}function Ct(Ae,Rt){return Ot(Ae,Rt,se,ye,he,le)}function qe(Ae,Rt){var Ht,bt,Mt,tr;if(!Ae||!Ae.state||Rt>x||Rt<0)return Ae?Ie(Ae,O):O;if(bt=Ae.state,!Ae.output||!Ae.input&&Ae.avail_in!==0||bt.status===be&&Rt!==C)return Ie(Ae,Ae.avail_out===0?k:O);if(bt.strm=Ae,Ht=bt.last_flush,bt.last_flush=Rt,bt.status===te)if(bt.wrap===2)Ae.adler=0,Ze(bt,31),Ze(bt,139),Ze(bt,8),bt.gzhead?(Ze(bt,(bt.gzhead.text?1:0)+(bt.gzhead.hcrc?2:0)+(bt.gzhead.extra?4:0)+(bt.gzhead.name?8:0)+(bt.gzhead.comment?16:0)),Ze(bt,bt.gzhead.time&255),Ze(bt,bt.gzhead.time>>8&255),Ze(bt,bt.gzhead.time>>16&255),Ze(bt,bt.gzhead.time>>24&255),Ze(bt,bt.level===9?2:bt.strategy>=F||bt.level<2?4:0),Ze(bt,bt.gzhead.os&255),bt.gzhead.extra&&bt.gzhead.extra.length&&(Ze(bt,bt.gzhead.extra.length&255),Ze(bt,bt.gzhead.extra.length>>8&255)),bt.gzhead.hcrc&&(Ae.adler=v(Ae.adler,bt.pending_buf,bt.pending,0)),bt.gzindex=0,bt.status=H):(Ze(bt,0),Ze(bt,0),Ze(bt,0),Ze(bt,0),Ze(bt,0),Ze(bt,bt.level===9?2:bt.strategy>=F||bt.level<2?4:0),Ze(bt,He),bt.status=ge);else{var Vt=se+(bt.w_bits-8<<4)<<8,Et=-1;bt.strategy>=F||bt.level<2?Et=0:bt.level<6?Et=1:bt.level===6?Et=2:Et=3,Vt|=Et<<6,bt.strstart!==0&&(Vt|=fe),Vt+=31-Vt%31,bt.status=ge,_t(bt,Vt),bt.strstart!==0&&(_t(bt,Ae.adler>>>16),_t(bt,Ae.adler&65535)),Ae.adler=1}if(bt.status===H)if(bt.gzhead.extra){for(Mt=bt.pending;bt.gzindex<(bt.gzhead.extra.length&65535)&&!(bt.pending===bt.pending_buf_size&&(bt.gzhead.hcrc&&bt.pending>Mt&&(Ae.adler=v(Ae.adler,bt.pending_buf,bt.pending-Mt,Mt)),Be(Ae),Mt=bt.pending,bt.pending===bt.pending_buf_size));)Ze(bt,bt.gzhead.extra[bt.gzindex]&255),bt.gzindex++;bt.gzhead.hcrc&&bt.pending>Mt&&(Ae.adler=v(Ae.adler,bt.pending_buf,bt.pending-Mt,Mt)),bt.gzindex===bt.gzhead.extra.length&&(bt.gzindex=0,bt.status=Q)}else bt.status=Q;if(bt.status===Q)if(bt.gzhead.name){Mt=bt.pending;do{if(bt.pending===bt.pending_buf_size&&(bt.gzhead.hcrc&&bt.pending>Mt&&(Ae.adler=v(Ae.adler,bt.pending_buf,bt.pending-Mt,Mt)),Be(Ae),Mt=bt.pending,bt.pending===bt.pending_buf_size)){tr=1;break}bt.gzindex<bt.gzhead.name.length?tr=bt.gzhead.name.charCodeAt(bt.gzindex++)&255:tr=0,Ze(bt,tr)}while(tr!==0);bt.gzhead.hcrc&&bt.pending>Mt&&(Ae.adler=v(Ae.adler,bt.pending_buf,bt.pending-Mt,Mt)),tr===0&&(bt.gzindex=0,bt.status=oe)}else bt.status=oe;if(bt.status===oe)if(bt.gzhead.comment){Mt=bt.pending;do{if(bt.pending===bt.pending_buf_size&&(bt.gzhead.hcrc&&bt.pending>Mt&&(Ae.adler=v(Ae.adler,bt.pending_buf,bt.pending-Mt,Mt)),Be(Ae),Mt=bt.pending,bt.pending===bt.pending_buf_size)){tr=1;break}bt.gzindex<bt.gzhead.comment.length?tr=bt.gzhead.comment.charCodeAt(bt.gzindex++)&255:tr=0,Ze(bt,tr)}while(tr!==0);bt.gzhead.hcrc&&bt.pending>Mt&&(Ae.adler=v(Ae.adler,bt.pending_buf,bt.pending-Mt,Mt)),tr===0&&(bt.status=_e)}else bt.status=_e;if(bt.status===_e&&(bt.gzhead.hcrc?(bt.pending+2>bt.pending_buf_size&&Be(Ae),bt.pending+2<=bt.pending_buf_size&&(Ze(bt,Ae.adler&255),Ze(bt,Ae.adler>>8&255),Ae.adler=0,bt.status=ge)):bt.status=ge),bt.pending!==0){if(Be(Ae),Ae.avail_out===0)return bt.last_flush=-1,R}else if(Ae.avail_in===0&&Le(Rt)<=Le(Ht)&&Rt!==C)return Ie(Ae,k);if(bt.status===be&&Ae.avail_in!==0)return Ie(Ae,k);if(Ae.avail_in!==0||bt.lookahead!==0||Rt!==d&&bt.status!==be){var Ye=bt.strategy===F?xe(bt,Rt):bt.strategy===G?ke(bt,Rt):it[bt.level].func(bt,Rt);if((Ye===me||Ye===Ke)&&(bt.status=be),Ye===we||Ye===me)return Ae.avail_out===0&&(bt.last_flush=-1),R;if(Ye===Ee&&(Rt===p?w._tr_align(bt):Rt!==x&&(w._tr_stored_block(bt,0,0,!1),Rt===m&&(Ge(bt.head),bt.lookahead===0&&(bt.strstart=0,bt.block_start=0,bt.insert=0))),Be(Ae),Ae.avail_out===0))return bt.last_flush=-1,R}return Rt!==C?R:bt.wrap<=0?S:(bt.wrap===2?(Ze(bt,Ae.adler&255),Ze(bt,Ae.adler>>8&255),Ze(bt,Ae.adler>>16&255),Ze(bt,Ae.adler>>24&255),Ze(bt,Ae.total_in&255),Ze(bt,Ae.total_in>>8&255),Ze(bt,Ae.total_in>>16&255),Ze(bt,Ae.total_in>>24&255)):(_t(bt,Ae.adler>>>16),_t(bt,Ae.adler&65535)),Be(Ae),bt.wrap>0&&(bt.wrap=-bt.wrap),bt.pending!==0?R:S)}function Yt(Ae){var Rt;return!Ae||!Ae.state?O:(Rt=Ae.state.status,Rt!==te&&Rt!==H&&Rt!==Q&&Rt!==oe&&Rt!==_e&&Rt!==ge&&Rt!==be?Ie(Ae,O):(Ae.state=null,Rt===ge?Ie(Ae,M):R))}function ot(Ae,Rt){var Ht=Rt.length,bt,Mt,tr,Vt,Et,Ye,Tt,Wt;if(!Ae||!Ae.state||(bt=Ae.state,Vt=bt.wrap,Vt===2||Vt===1&&bt.status!==te||bt.lookahead))return O;for(Vt===1&&(Ae.adler=E(Ae.adler,Rt,Ht,0)),bt.wrap=0,Ht>=bt.w_size&&(Vt===0&&(Ge(bt.head),bt.strstart=0,bt.block_start=0,bt.insert=0),Wt=new h.Buf8(bt.w_size),h.arraySet(Wt,Rt,Ht-bt.w_size,bt.w_size,0),Rt=Wt,Ht=bt.w_size),Et=Ae.avail_in,Ye=Ae.next_in,Tt=Ae.input,Ae.avail_in=Ht,Ae.next_in=0,Ae.input=Rt,lt(bt);bt.lookahead>=Y;){Mt=bt.strstart,tr=bt.lookahead-(Y-1);do bt.ins_h=(bt.ins_h<<bt.hash_shift^bt.window[Mt+Y-1])&bt.hash_mask,bt.prev[Mt&bt.w_mask]=bt.head[bt.ins_h],bt.head[bt.ins_h]=Mt,Mt++;while(--tr);bt.strstart=Mt,bt.lookahead=Y-1,lt(bt)}return bt.strstart+=bt.lookahead,bt.block_start=bt.strstart,bt.insert=bt.lookahead,bt.lookahead=0,bt.match_length=bt.prev_length=Y-1,bt.match_available=0,Ae.next_in=Ye,Ae.input=Tt,Ae.avail_in=Et,bt.wrap=Vt,R}f.deflateInit=Ct,f.deflateInit2=Ot,f.deflateReset=ft,f.deflateResetKeep=It,f.deflateSetHeader=Jt,f.deflate=qe,f.deflateEnd=Yt,f.deflateSetDictionary=ot,f.deflateInfo="pako deflate (from Nodeca project)"},15436:function(ie){"use strict";var f=30,_=12;ie.exports=function(w,E){var v,c,d,p,m,C,x,R,S,O,M,k,q,b,F,G,ue,le,X,se,de,ye,he,K,B;v=w.state,c=w.next_in,K=w.input,d=c+(w.avail_in-5),p=w.next_out,B=w.output,m=p-(E-w.avail_out),C=p+(w.avail_out-257),x=v.dmax,R=v.wsize,S=v.whave,O=v.wnext,M=v.window,k=v.hold,q=v.bits,b=v.lencode,F=v.distcode,G=(1<<v.lenbits)-1,ue=(1<<v.distbits)-1;e:do{q<15&&(k+=K[c++]<<q,q+=8,k+=K[c++]<<q,q+=8),le=b[k&G];t:for(;;){if(X=le>>>24,k>>>=X,q-=X,X=le>>>16&255,X===0)B[p++]=le&65535;else if(X&16){se=le&65535,X&=15,X&&(q<X&&(k+=K[c++]<<q,q+=8),se+=k&(1<<X)-1,k>>>=X,q-=X),q<15&&(k+=K[c++]<<q,q+=8,k+=K[c++]<<q,q+=8),le=F[k&ue];r:for(;;){if(X=le>>>24,k>>>=X,q-=X,X=le>>>16&255,X&16){if(de=le&65535,X&=15,q<X&&(k+=K[c++]<<q,q+=8,q<X&&(k+=K[c++]<<q,q+=8)),de+=k&(1<<X)-1,de>x){w.msg="invalid distance too far back",v.mode=f;break e}if(k>>>=X,q-=X,X=p-m,de>X){if(X=de-X,X>S&&v.sane){w.msg="invalid distance too far back",v.mode=f;break e}if(ye=0,he=M,O===0){if(ye+=R-X,X<se){se-=X;do B[p++]=M[ye++];while(--X);ye=p-de,he=B}}else if(O<X){if(ye+=R+O-X,X-=O,X<se){se-=X;do B[p++]=M[ye++];while(--X);if(ye=0,O<se){X=O,se-=X;do B[p++]=M[ye++];while(--X);ye=p-de,he=B}}}else if(ye+=O-X,X<se){se-=X;do B[p++]=M[ye++];while(--X);ye=p-de,he=B}for(;se>2;)B[p++]=he[ye++],B[p++]=he[ye++],B[p++]=he[ye++],se-=3;se&&(B[p++]=he[ye++],se>1&&(B[p++]=he[ye++]))}else{ye=p-de;do B[p++]=B[ye++],B[p++]=B[ye++],B[p++]=B[ye++],se-=3;while(se>2);se&&(B[p++]=B[ye++],se>1&&(B[p++]=B[ye++]))}}else if(X&64){w.msg="invalid distance code",v.mode=f;break e}else{le=F[(le&65535)+(k&(1<<X)-1)];continue r}break}}else if(X&64)if(X&32){v.mode=_;break e}else{w.msg="invalid literal/length code",v.mode=f;break e}else{le=b[(le&65535)+(k&(1<<X)-1)];continue t}break}}while(c<d&&p<C);se=q>>3,c-=se,q-=se<<3,k&=(1<<q)-1,w.next_in=c,w.next_out=p,w.avail_in=c<d?5+(d-c):5-(c-d),w.avail_out=p<C?257+(C-p):257-(p-C),v.hold=k,v.bits=q}},81090:function(ie,f,_){"use strict";var h=_(50020),w=_(81356),E=_(49910),v=_(15436),c=_(4805),d=0,p=1,m=2,C=4,x=5,R=6,S=0,O=1,M=2,k=-2,q=-3,b=-4,F=-5,G=8,ue=1,le=2,X=3,se=4,de=5,ye=6,he=7,K=8,B=9,L=10,$=11,T=12,N=13,j=14,Y=15,Z=16,z=17,fe=18,te=19,H=20,Q=21,oe=22,_e=23,ge=24,be=25,we=26,Ee=27,me=28,Ke=29,He=30,Ie=31,Le=32,Ge=852,Be=592,We=15,Ze=We;function _t(Ot){return(Ot>>>24&255)+(Ot>>>8&65280)+((Ot&65280)<<8)+((Ot&255)<<24)}function Ft(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function gt(Ot){var Ct;return!Ot||!Ot.state?k:(Ct=Ot.state,Ot.total_in=Ot.total_out=Ct.total=0,Ot.msg="",Ct.wrap&&(Ot.adler=Ct.wrap&1),Ct.mode=ue,Ct.last=0,Ct.havedict=0,Ct.dmax=32768,Ct.head=null,Ct.hold=0,Ct.bits=0,Ct.lencode=Ct.lendyn=new h.Buf32(Ge),Ct.distcode=Ct.distdyn=new h.Buf32(Be),Ct.sane=1,Ct.back=-1,S)}function lt(Ot){var Ct;return!Ot||!Ot.state?k:(Ct=Ot.state,Ct.wsize=0,Ct.whave=0,Ct.wnext=0,gt(Ot))}function dt(Ot,Ct){var qe,Yt;return!Ot||!Ot.state||(Yt=Ot.state,Ct<0?(qe=0,Ct=-Ct):(qe=(Ct>>4)+1,Ct<48&&(Ct&=15)),Ct&&(Ct<8||Ct>15))?k:(Yt.window!==null&&Yt.wbits!==Ct&&(Yt.window=null),Yt.wrap=qe,Yt.wbits=Ct,lt(Ot))}function tt(Ot,Ct){var qe,Yt;return Ot?(Yt=new Ft,Ot.state=Yt,Yt.window=null,qe=dt(Ot,Ct),qe!==S&&(Ot.state=null),qe):k}function rt(Ot){return tt(Ot,Ze)}var ke=!0,xe,Pe;function it(Ot){if(ke){var Ct;for(xe=new h.Buf32(512),Pe=new h.Buf32(32),Ct=0;Ct<144;)Ot.lens[Ct++]=8;for(;Ct<256;)Ot.lens[Ct++]=9;for(;Ct<280;)Ot.lens[Ct++]=7;for(;Ct<288;)Ot.lens[Ct++]=8;for(c(p,Ot.lens,0,288,xe,0,Ot.work,{bits:9}),Ct=0;Ct<32;)Ot.lens[Ct++]=5;c(m,Ot.lens,0,32,Pe,0,Ot.work,{bits:5}),ke=!1}Ot.lencode=xe,Ot.lenbits=9,Ot.distcode=Pe,Ot.distbits=5}function Xe(Ot,Ct,qe,Yt){var ot,Ae=Ot.state;return Ae.window===null&&(Ae.wsize=1<<Ae.wbits,Ae.wnext=0,Ae.whave=0,Ae.window=new h.Buf8(Ae.wsize)),Yt>=Ae.wsize?(h.arraySet(Ae.window,Ct,qe-Ae.wsize,Ae.wsize,0),Ae.wnext=0,Ae.whave=Ae.wsize):(ot=Ae.wsize-Ae.wnext,ot>Yt&&(ot=Yt),h.arraySet(Ae.window,Ct,qe-Yt,ot,Ae.wnext),Yt-=ot,Yt?(h.arraySet(Ae.window,Ct,qe-Yt,Yt,0),Ae.wnext=Yt,Ae.whave=Ae.wsize):(Ae.wnext+=ot,Ae.wnext===Ae.wsize&&(Ae.wnext=0),Ae.whave<Ae.wsize&&(Ae.whave+=ot))),0}function st(Ot,Ct){var qe,Yt,ot,Ae,Rt,Ht,bt,Mt,tr,Vt,Et,Ye,Tt,Wt,dr=0,at,wt,At,Je,Lt,sr,ur,vr,kr=new h.Buf8(4),Jr,hr,$r=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Ot||!Ot.state||!Ot.output||!Ot.input&&Ot.avail_in!==0)return k;qe=Ot.state,qe.mode===T&&(qe.mode=N),Rt=Ot.next_out,ot=Ot.output,bt=Ot.avail_out,Ae=Ot.next_in,Yt=Ot.input,Ht=Ot.avail_in,Mt=qe.hold,tr=qe.bits,Vt=Ht,Et=bt,vr=S;e:for(;;)switch(qe.mode){case ue:if(qe.wrap===0){qe.mode=N;break}for(;tr<16;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(qe.wrap&2&&Mt===35615){qe.check=0,kr[0]=Mt&255,kr[1]=Mt>>>8&255,qe.check=E(qe.check,kr,2,0),Mt=0,tr=0,qe.mode=le;break}if(qe.flags=0,qe.head&&(qe.head.done=!1),!(qe.wrap&1)||(((Mt&255)<<8)+(Mt>>8))%31){Ot.msg="incorrect header check",qe.mode=He;break}if((Mt&15)!==G){Ot.msg="unknown compression method",qe.mode=He;break}if(Mt>>>=4,tr-=4,ur=(Mt&15)+8,qe.wbits===0)qe.wbits=ur;else if(ur>qe.wbits){Ot.msg="invalid window size",qe.mode=He;break}qe.dmax=1<<ur,Ot.adler=qe.check=1,qe.mode=Mt&512?L:T,Mt=0,tr=0;break;case le:for(;tr<16;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(qe.flags=Mt,(qe.flags&255)!==G){Ot.msg="unknown compression method",qe.mode=He;break}if(qe.flags&57344){Ot.msg="unknown header flags set",qe.mode=He;break}qe.head&&(qe.head.text=Mt>>8&1),qe.flags&512&&(kr[0]=Mt&255,kr[1]=Mt>>>8&255,qe.check=E(qe.check,kr,2,0)),Mt=0,tr=0,qe.mode=X;case X:for(;tr<32;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}qe.head&&(qe.head.time=Mt),qe.flags&512&&(kr[0]=Mt&255,kr[1]=Mt>>>8&255,kr[2]=Mt>>>16&255,kr[3]=Mt>>>24&255,qe.check=E(qe.check,kr,4,0)),Mt=0,tr=0,qe.mode=se;case se:for(;tr<16;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}qe.head&&(qe.head.xflags=Mt&255,qe.head.os=Mt>>8),qe.flags&512&&(kr[0]=Mt&255,kr[1]=Mt>>>8&255,qe.check=E(qe.check,kr,2,0)),Mt=0,tr=0,qe.mode=de;case de:if(qe.flags&1024){for(;tr<16;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}qe.length=Mt,qe.head&&(qe.head.extra_len=Mt),qe.flags&512&&(kr[0]=Mt&255,kr[1]=Mt>>>8&255,qe.check=E(qe.check,kr,2,0)),Mt=0,tr=0}else qe.head&&(qe.head.extra=null);qe.mode=ye;case ye:if(qe.flags&1024&&(Ye=qe.length,Ye>Ht&&(Ye=Ht),Ye&&(qe.head&&(ur=qe.head.extra_len-qe.length,qe.head.extra||(qe.head.extra=new Array(qe.head.extra_len)),h.arraySet(qe.head.extra,Yt,Ae,Ye,ur)),qe.flags&512&&(qe.check=E(qe.check,Yt,Ye,Ae)),Ht-=Ye,Ae+=Ye,qe.length-=Ye),qe.length))break e;qe.length=0,qe.mode=he;case he:if(qe.flags&2048){if(Ht===0)break e;Ye=0;do ur=Yt[Ae+Ye++],qe.head&&ur&&qe.length<65536&&(qe.head.name+=String.fromCharCode(ur));while(ur&&Ye<Ht);if(qe.flags&512&&(qe.check=E(qe.check,Yt,Ye,Ae)),Ht-=Ye,Ae+=Ye,ur)break e}else qe.head&&(qe.head.name=null);qe.length=0,qe.mode=K;case K:if(qe.flags&4096){if(Ht===0)break e;Ye=0;do ur=Yt[Ae+Ye++],qe.head&&ur&&qe.length<65536&&(qe.head.comment+=String.fromCharCode(ur));while(ur&&Ye<Ht);if(qe.flags&512&&(qe.check=E(qe.check,Yt,Ye,Ae)),Ht-=Ye,Ae+=Ye,ur)break e}else qe.head&&(qe.head.comment=null);qe.mode=B;case B:if(qe.flags&512){for(;tr<16;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(Mt!==(qe.check&65535)){Ot.msg="header crc mismatch",qe.mode=He;break}Mt=0,tr=0}qe.head&&(qe.head.hcrc=qe.flags>>9&1,qe.head.done=!0),Ot.adler=qe.check=0,qe.mode=T;break;case L:for(;tr<32;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}Ot.adler=qe.check=_t(Mt),Mt=0,tr=0,qe.mode=$;case $:if(qe.havedict===0)return Ot.next_out=Rt,Ot.avail_out=bt,Ot.next_in=Ae,Ot.avail_in=Ht,qe.hold=Mt,qe.bits=tr,M;Ot.adler=qe.check=1,qe.mode=T;case T:if(Ct===x||Ct===R)break e;case N:if(qe.last){Mt>>>=tr&7,tr-=tr&7,qe.mode=Ee;break}for(;tr<3;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}switch(qe.last=Mt&1,Mt>>>=1,tr-=1,Mt&3){case 0:qe.mode=j;break;case 1:if(it(qe),qe.mode=H,Ct===R){Mt>>>=2,tr-=2;break e}break;case 2:qe.mode=z;break;case 3:Ot.msg="invalid block type",qe.mode=He}Mt>>>=2,tr-=2;break;case j:for(Mt>>>=tr&7,tr-=tr&7;tr<32;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if((Mt&65535)!==(Mt>>>16^65535)){Ot.msg="invalid stored block lengths",qe.mode=He;break}if(qe.length=Mt&65535,Mt=0,tr=0,qe.mode=Y,Ct===R)break e;case Y:qe.mode=Z;case Z:if(Ye=qe.length,Ye){if(Ye>Ht&&(Ye=Ht),Ye>bt&&(Ye=bt),Ye===0)break e;h.arraySet(ot,Yt,Ae,Ye,Rt),Ht-=Ye,Ae+=Ye,bt-=Ye,Rt+=Ye,qe.length-=Ye;break}qe.mode=T;break;case z:for(;tr<14;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(qe.nlen=(Mt&31)+257,Mt>>>=5,tr-=5,qe.ndist=(Mt&31)+1,Mt>>>=5,tr-=5,qe.ncode=(Mt&15)+4,Mt>>>=4,tr-=4,qe.nlen>286||qe.ndist>30){Ot.msg="too many length or distance symbols",qe.mode=He;break}qe.have=0,qe.mode=fe;case fe:for(;qe.have<qe.ncode;){for(;tr<3;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}qe.lens[$r[qe.have++]]=Mt&7,Mt>>>=3,tr-=3}for(;qe.have<19;)qe.lens[$r[qe.have++]]=0;if(qe.lencode=qe.lendyn,qe.lenbits=7,Jr={bits:qe.lenbits},vr=c(d,qe.lens,0,19,qe.lencode,0,qe.work,Jr),qe.lenbits=Jr.bits,vr){Ot.msg="invalid code lengths set",qe.mode=He;break}qe.have=0,qe.mode=te;case te:for(;qe.have<qe.nlen+qe.ndist;){for(;dr=qe.lencode[Mt&(1<<qe.lenbits)-1],at=dr>>>24,wt=dr>>>16&255,At=dr&65535,!(at<=tr);){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(At<16)Mt>>>=at,tr-=at,qe.lens[qe.have++]=At;else{if(At===16){for(hr=at+2;tr<hr;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(Mt>>>=at,tr-=at,qe.have===0){Ot.msg="invalid bit length repeat",qe.mode=He;break}ur=qe.lens[qe.have-1],Ye=3+(Mt&3),Mt>>>=2,tr-=2}else if(At===17){for(hr=at+3;tr<hr;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}Mt>>>=at,tr-=at,ur=0,Ye=3+(Mt&7),Mt>>>=3,tr-=3}else{for(hr=at+7;tr<hr;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}Mt>>>=at,tr-=at,ur=0,Ye=11+(Mt&127),Mt>>>=7,tr-=7}if(qe.have+Ye>qe.nlen+qe.ndist){Ot.msg="invalid bit length repeat",qe.mode=He;break}for(;Ye--;)qe.lens[qe.have++]=ur}}if(qe.mode===He)break;if(qe.lens[256]===0){Ot.msg="invalid code -- missing end-of-block",qe.mode=He;break}if(qe.lenbits=9,Jr={bits:qe.lenbits},vr=c(p,qe.lens,0,qe.nlen,qe.lencode,0,qe.work,Jr),qe.lenbits=Jr.bits,vr){Ot.msg="invalid literal/lengths set",qe.mode=He;break}if(qe.distbits=6,qe.distcode=qe.distdyn,Jr={bits:qe.distbits},vr=c(m,qe.lens,qe.nlen,qe.ndist,qe.distcode,0,qe.work,Jr),qe.distbits=Jr.bits,vr){Ot.msg="invalid distances set",qe.mode=He;break}if(qe.mode=H,Ct===R)break e;case H:qe.mode=Q;case Q:if(Ht>=6&&bt>=258){Ot.next_out=Rt,Ot.avail_out=bt,Ot.next_in=Ae,Ot.avail_in=Ht,qe.hold=Mt,qe.bits=tr,v(Ot,Et),Rt=Ot.next_out,ot=Ot.output,bt=Ot.avail_out,Ae=Ot.next_in,Yt=Ot.input,Ht=Ot.avail_in,Mt=qe.hold,tr=qe.bits,qe.mode===T&&(qe.back=-1);break}for(qe.back=0;dr=qe.lencode[Mt&(1<<qe.lenbits)-1],at=dr>>>24,wt=dr>>>16&255,At=dr&65535,!(at<=tr);){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(wt&&!(wt&240)){for(Je=at,Lt=wt,sr=At;dr=qe.lencode[sr+((Mt&(1<<Je+Lt)-1)>>Je)],at=dr>>>24,wt=dr>>>16&255,At=dr&65535,!(Je+at<=tr);){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}Mt>>>=Je,tr-=Je,qe.back+=Je}if(Mt>>>=at,tr-=at,qe.back+=at,qe.length=At,wt===0){qe.mode=we;break}if(wt&32){qe.back=-1,qe.mode=T;break}if(wt&64){Ot.msg="invalid literal/length code",qe.mode=He;break}qe.extra=wt&15,qe.mode=oe;case oe:if(qe.extra){for(hr=qe.extra;tr<hr;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}qe.length+=Mt&(1<<qe.extra)-1,Mt>>>=qe.extra,tr-=qe.extra,qe.back+=qe.extra}qe.was=qe.length,qe.mode=_e;case _e:for(;dr=qe.distcode[Mt&(1<<qe.distbits)-1],at=dr>>>24,wt=dr>>>16&255,At=dr&65535,!(at<=tr);){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(!(wt&240)){for(Je=at,Lt=wt,sr=At;dr=qe.distcode[sr+((Mt&(1<<Je+Lt)-1)>>Je)],at=dr>>>24,wt=dr>>>16&255,At=dr&65535,!(Je+at<=tr);){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}Mt>>>=Je,tr-=Je,qe.back+=Je}if(Mt>>>=at,tr-=at,qe.back+=at,wt&64){Ot.msg="invalid distance code",qe.mode=He;break}qe.offset=At,qe.extra=wt&15,qe.mode=ge;case ge:if(qe.extra){for(hr=qe.extra;tr<hr;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}qe.offset+=Mt&(1<<qe.extra)-1,Mt>>>=qe.extra,tr-=qe.extra,qe.back+=qe.extra}if(qe.offset>qe.dmax){Ot.msg="invalid distance too far back",qe.mode=He;break}qe.mode=be;case be:if(bt===0)break e;if(Ye=Et-bt,qe.offset>Ye){if(Ye=qe.offset-Ye,Ye>qe.whave&&qe.sane){Ot.msg="invalid distance too far back",qe.mode=He;break}Ye>qe.wnext?(Ye-=qe.wnext,Tt=qe.wsize-Ye):Tt=qe.wnext-Ye,Ye>qe.length&&(Ye=qe.length),Wt=qe.window}else Wt=ot,Tt=Rt-qe.offset,Ye=qe.length;Ye>bt&&(Ye=bt),bt-=Ye,qe.length-=Ye;do ot[Rt++]=Wt[Tt++];while(--Ye);qe.length===0&&(qe.mode=Q);break;case we:if(bt===0)break e;ot[Rt++]=qe.length,bt--,qe.mode=Q;break;case Ee:if(qe.wrap){for(;tr<32;){if(Ht===0)break e;Ht--,Mt|=Yt[Ae++]<<tr,tr+=8}if(Et-=bt,Ot.total_out+=Et,qe.total+=Et,Et&&(Ot.adler=qe.check=qe.flags?E(qe.check,ot,Et,Rt-Et):w(qe.check,ot,Et,Rt-Et)),Et=bt,(qe.flags?Mt:_t(Mt))!==qe.check){Ot.msg="incorrect data check",qe.mode=He;break}Mt=0,tr=0}qe.mode=me;case me:if(qe.wrap&&qe.flags){for(;tr<32;){if(Ht===0)break e;Ht--,Mt+=Yt[Ae++]<<tr,tr+=8}if(Mt!==(qe.total&4294967295)){Ot.msg="incorrect length check",qe.mode=He;break}Mt=0,tr=0}qe.mode=Ke;case Ke:vr=O;break e;case He:vr=q;break e;case Ie:return b;case Le:default:return k}return Ot.next_out=Rt,Ot.avail_out=bt,Ot.next_in=Ae,Ot.avail_in=Ht,qe.hold=Mt,qe.bits=tr,(qe.wsize||Et!==Ot.avail_out&&qe.mode<He&&(qe.mode<Ee||Ct!==C))&&Xe(Ot,Ot.output,Ot.next_out,Et-Ot.avail_out)?(qe.mode=Ie,b):(Vt-=Ot.avail_in,Et-=Ot.avail_out,Ot.total_in+=Vt,Ot.total_out+=Et,qe.total+=Et,qe.wrap&&Et&&(Ot.adler=qe.check=qe.flags?E(qe.check,ot,Et,Ot.next_out-Et):w(qe.check,ot,Et,Ot.next_out-Et)),Ot.data_type=qe.bits+(qe.last?64:0)+(qe.mode===T?128:0)+(qe.mode===H||qe.mode===Y?256:0),(Vt===0&&Et===0||Ct===C)&&vr===S&&(vr=F),vr)}function It(Ot){if(!Ot||!Ot.state)return k;var Ct=Ot.state;return Ct.window&&(Ct.window=null),Ot.state=null,S}function ft(Ot,Ct){var qe;return!Ot||!Ot.state||(qe=Ot.state,!(qe.wrap&2))?k:(qe.head=Ct,Ct.done=!1,S)}function Jt(Ot,Ct){var qe=Ct.length,Yt,ot,Ae;return!Ot||!Ot.state||(Yt=Ot.state,Yt.wrap!==0&&Yt.mode!==$)?k:Yt.mode===$&&(ot=1,ot=w(ot,Ct,qe,0),ot!==Yt.check)?q:(Ae=Xe(Ot,Ct,qe,qe),Ae?(Yt.mode=Ie,b):(Yt.havedict=1,S))}f.inflateReset=lt,f.inflateReset2=dt,f.inflateResetKeep=gt,f.inflateInit=rt,f.inflateInit2=tt,f.inflate=st,f.inflateEnd=It,f.inflateGetHeader=ft,f.inflateSetDictionary=Jt,f.inflateInfo="pako inflate (from Nodeca project)"},4805:function(ie,f,_){"use strict";var h=_(50020),w=15,E=852,v=592,c=0,d=1,p=2,m=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],C=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],x=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],R=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];ie.exports=function(O,M,k,q,b,F,G,ue){var le=ue.bits,X=0,se=0,de=0,ye=0,he=0,K=0,B=0,L=0,$=0,T=0,N,j,Y,Z,z,fe=null,te=0,H,Q=new h.Buf16(w+1),oe=new h.Buf16(w+1),_e=null,ge=0,be,we,Ee;for(X=0;X<=w;X++)Q[X]=0;for(se=0;se<q;se++)Q[M[k+se]]++;for(he=le,ye=w;ye>=1&&Q[ye]===0;ye--);if(he>ye&&(he=ye),ye===0)return b[F++]=20971520,b[F++]=20971520,ue.bits=1,0;for(de=1;de<ye&&Q[de]===0;de++);for(he<de&&(he=de),L=1,X=1;X<=w;X++)if(L<<=1,L-=Q[X],L<0)return-1;if(L>0&&(O===c||ye!==1))return-1;for(oe[1]=0,X=1;X<w;X++)oe[X+1]=oe[X]+Q[X];for(se=0;se<q;se++)M[k+se]!==0&&(G[oe[M[k+se]]++]=se);if(O===c?(fe=_e=G,H=19):O===d?(fe=m,te-=257,_e=C,ge-=257,H=256):(fe=x,_e=R,H=-1),T=0,se=0,X=de,z=F,K=he,B=0,Y=-1,$=1<<he,Z=$-1,O===d&&$>E||O===p&&$>v)return 1;for(;;){be=X-B,G[se]<H?(we=0,Ee=G[se]):G[se]>H?(we=_e[ge+G[se]],Ee=fe[te+G[se]]):(we=96,Ee=0),N=1<<X-B,j=1<<K,de=j;do j-=N,b[z+(T>>B)+j]=be<<24|we<<16|Ee|0;while(j!==0);for(N=1<<X-1;T&N;)N>>=1;if(N!==0?(T&=N-1,T+=N):T=0,se++,--Q[X]===0){if(X===ye)break;X=M[k+G[se]]}if(X>he&&(T&Z)!==Y){for(B===0&&(B=he),z+=de,K=X-B,L=1<<K;K+B<ye&&(L-=Q[K+B],!(L<=0));)K++,L<<=1;if($+=1<<K,O===d&&$>E||O===p&&$>v)return 1;Y=T&Z,b[Y]=he<<24|K<<16|z-F|0}}return T!==0&&(b[z+T]=X-B<<24|4194304|0),ue.bits=he,0}},5317:function(ie){"use strict";ie.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},9984:function(ie,f,_){"use strict";var h=_(50020),w=4,E=0,v=1,c=2;function d(st){for(var It=st.length;--It>=0;)st[It]=0}var p=0,m=1,C=2,x=3,R=258,S=29,O=256,M=O+1+S,k=30,q=19,b=2*M+1,F=15,G=16,ue=7,le=256,X=16,se=17,de=18,ye=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],he=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=512,$=new Array((M+2)*2);d($);var T=new Array(k*2);d(T);var N=new Array(L);d(N);var j=new Array(R-x+1);d(j);var Y=new Array(S);d(Y);var Z=new Array(k);d(Z);function z(st,It,ft,Jt,Ot){this.static_tree=st,this.extra_bits=It,this.extra_base=ft,this.elems=Jt,this.max_length=Ot,this.has_stree=st&&st.length}var fe,te,H;function Q(st,It){this.dyn_tree=st,this.max_code=0,this.stat_desc=It}function oe(st){return st<256?N[st]:N[256+(st>>>7)]}function _e(st,It){st.pending_buf[st.pending++]=It&255,st.pending_buf[st.pending++]=It>>>8&255}function ge(st,It,ft){st.bi_valid>G-ft?(st.bi_buf|=It<<st.bi_valid&65535,_e(st,st.bi_buf),st.bi_buf=It>>G-st.bi_valid,st.bi_valid+=ft-G):(st.bi_buf|=It<<st.bi_valid&65535,st.bi_valid+=ft)}function be(st,It,ft){ge(st,ft[It*2],ft[It*2+1])}function we(st,It){var ft=0;do ft|=st&1,st>>>=1,ft<<=1;while(--It>0);return ft>>>1}function Ee(st){st.bi_valid===16?(_e(st,st.bi_buf),st.bi_buf=0,st.bi_valid=0):st.bi_valid>=8&&(st.pending_buf[st.pending++]=st.bi_buf&255,st.bi_buf>>=8,st.bi_valid-=8)}function me(st,It){var ft=It.dyn_tree,Jt=It.max_code,Ot=It.stat_desc.static_tree,Ct=It.stat_desc.has_stree,qe=It.stat_desc.extra_bits,Yt=It.stat_desc.extra_base,ot=It.stat_desc.max_length,Ae,Rt,Ht,bt,Mt,tr,Vt=0;for(bt=0;bt<=F;bt++)st.bl_count[bt]=0;for(ft[st.heap[st.heap_max]*2+1]=0,Ae=st.heap_max+1;Ae<b;Ae++)Rt=st.heap[Ae],bt=ft[ft[Rt*2+1]*2+1]+1,bt>ot&&(bt=ot,Vt++),ft[Rt*2+1]=bt,!(Rt>Jt)&&(st.bl_count[bt]++,Mt=0,Rt>=Yt&&(Mt=qe[Rt-Yt]),tr=ft[Rt*2],st.opt_len+=tr*(bt+Mt),Ct&&(st.static_len+=tr*(Ot[Rt*2+1]+Mt)));if(Vt!==0){do{for(bt=ot-1;st.bl_count[bt]===0;)bt--;st.bl_count[bt]--,st.bl_count[bt+1]+=2,st.bl_count[ot]--,Vt-=2}while(Vt>0);for(bt=ot;bt!==0;bt--)for(Rt=st.bl_count[bt];Rt!==0;)Ht=st.heap[--Ae],!(Ht>Jt)&&(ft[Ht*2+1]!==bt&&(st.opt_len+=(bt-ft[Ht*2+1])*ft[Ht*2],ft[Ht*2+1]=bt),Rt--)}}function Ke(st,It,ft){var Jt=new Array(F+1),Ot=0,Ct,qe;for(Ct=1;Ct<=F;Ct++)Jt[Ct]=Ot=Ot+ft[Ct-1]<<1;for(qe=0;qe<=It;qe++){var Yt=st[qe*2+1];Yt!==0&&(st[qe*2]=we(Jt[Yt]++,Yt))}}function He(){var st,It,ft,Jt,Ot,Ct=new Array(F+1);for(ft=0,Jt=0;Jt<S-1;Jt++)for(Y[Jt]=ft,st=0;st<1<<ye[Jt];st++)j[ft++]=Jt;for(j[ft-1]=Jt,Ot=0,Jt=0;Jt<16;Jt++)for(Z[Jt]=Ot,st=0;st<1<<he[Jt];st++)N[Ot++]=Jt;for(Ot>>=7;Jt<k;Jt++)for(Z[Jt]=Ot<<7,st=0;st<1<<he[Jt]-7;st++)N[256+Ot++]=Jt;for(It=0;It<=F;It++)Ct[It]=0;for(st=0;st<=143;)$[st*2+1]=8,st++,Ct[8]++;for(;st<=255;)$[st*2+1]=9,st++,Ct[9]++;for(;st<=279;)$[st*2+1]=7,st++,Ct[7]++;for(;st<=287;)$[st*2+1]=8,st++,Ct[8]++;for(Ke($,M+1,Ct),st=0;st<k;st++)T[st*2+1]=5,T[st*2]=we(st,5);fe=new z($,ye,O+1,M,F),te=new z(T,he,0,k,F),H=new z(new Array(0),K,0,q,ue)}function Ie(st){var It;for(It=0;It<M;It++)st.dyn_ltree[It*2]=0;for(It=0;It<k;It++)st.dyn_dtree[It*2]=0;for(It=0;It<q;It++)st.bl_tree[It*2]=0;st.dyn_ltree[le*2]=1,st.opt_len=st.static_len=0,st.last_lit=st.matches=0}function Le(st){st.bi_valid>8?_e(st,st.bi_buf):st.bi_valid>0&&(st.pending_buf[st.pending++]=st.bi_buf),st.bi_buf=0,st.bi_valid=0}function Ge(st,It,ft,Jt){Le(st),Jt&&(_e(st,ft),_e(st,~ft)),h.arraySet(st.pending_buf,st.window,It,ft,st.pending),st.pending+=ft}function Be(st,It,ft,Jt){var Ot=It*2,Ct=ft*2;return st[Ot]<st[Ct]||st[Ot]===st[Ct]&&Jt[It]<=Jt[ft]}function We(st,It,ft){for(var Jt=st.heap[ft],Ot=ft<<1;Ot<=st.heap_len&&(Ot<st.heap_len&&Be(It,st.heap[Ot+1],st.heap[Ot],st.depth)&&Ot++,!Be(It,Jt,st.heap[Ot],st.depth));)st.heap[ft]=st.heap[Ot],ft=Ot,Ot<<=1;st.heap[ft]=Jt}function Ze(st,It,ft){var Jt,Ot,Ct=0,qe,Yt;if(st.last_lit!==0)do Jt=st.pending_buf[st.d_buf+Ct*2]<<8|st.pending_buf[st.d_buf+Ct*2+1],Ot=st.pending_buf[st.l_buf+Ct],Ct++,Jt===0?be(st,Ot,It):(qe=j[Ot],be(st,qe+O+1,It),Yt=ye[qe],Yt!==0&&(Ot-=Y[qe],ge(st,Ot,Yt)),Jt--,qe=oe(Jt),be(st,qe,ft),Yt=he[qe],Yt!==0&&(Jt-=Z[qe],ge(st,Jt,Yt)));while(Ct<st.last_lit);be(st,le,It)}function _t(st,It){var ft=It.dyn_tree,Jt=It.stat_desc.static_tree,Ot=It.stat_desc.has_stree,Ct=It.stat_desc.elems,qe,Yt,ot=-1,Ae;for(st.heap_len=0,st.heap_max=b,qe=0;qe<Ct;qe++)ft[qe*2]!==0?(st.heap[++st.heap_len]=ot=qe,st.depth[qe]=0):ft[qe*2+1]=0;for(;st.heap_len<2;)Ae=st.heap[++st.heap_len]=ot<2?++ot:0,ft[Ae*2]=1,st.depth[Ae]=0,st.opt_len--,Ot&&(st.static_len-=Jt[Ae*2+1]);for(It.max_code=ot,qe=st.heap_len>>1;qe>=1;qe--)We(st,ft,qe);Ae=Ct;do qe=st.heap[1],st.heap[1]=st.heap[st.heap_len--],We(st,ft,1),Yt=st.heap[1],st.heap[--st.heap_max]=qe,st.heap[--st.heap_max]=Yt,ft[Ae*2]=ft[qe*2]+ft[Yt*2],st.depth[Ae]=(st.depth[qe]>=st.depth[Yt]?st.depth[qe]:st.depth[Yt])+1,ft[qe*2+1]=ft[Yt*2+1]=Ae,st.heap[1]=Ae++,We(st,ft,1);while(st.heap_len>=2);st.heap[--st.heap_max]=st.heap[1],me(st,It),Ke(ft,ot,st.bl_count)}function Ft(st,It,ft){var Jt,Ot=-1,Ct,qe=It[0*2+1],Yt=0,ot=7,Ae=4;for(qe===0&&(ot=138,Ae=3),It[(ft+1)*2+1]=65535,Jt=0;Jt<=ft;Jt++)Ct=qe,qe=It[(Jt+1)*2+1],!(++Yt<ot&&Ct===qe)&&(Yt<Ae?st.bl_tree[Ct*2]+=Yt:Ct!==0?(Ct!==Ot&&st.bl_tree[Ct*2]++,st.bl_tree[X*2]++):Yt<=10?st.bl_tree[se*2]++:st.bl_tree[de*2]++,Yt=0,Ot=Ct,qe===0?(ot=138,Ae=3):Ct===qe?(ot=6,Ae=3):(ot=7,Ae=4))}function gt(st,It,ft){var Jt,Ot=-1,Ct,qe=It[0*2+1],Yt=0,ot=7,Ae=4;for(qe===0&&(ot=138,Ae=3),Jt=0;Jt<=ft;Jt++)if(Ct=qe,qe=It[(Jt+1)*2+1],!(++Yt<ot&&Ct===qe)){if(Yt<Ae)do be(st,Ct,st.bl_tree);while(--Yt!==0);else Ct!==0?(Ct!==Ot&&(be(st,Ct,st.bl_tree),Yt--),be(st,X,st.bl_tree),ge(st,Yt-3,2)):Yt<=10?(be(st,se,st.bl_tree),ge(st,Yt-3,3)):(be(st,de,st.bl_tree),ge(st,Yt-11,7));Yt=0,Ot=Ct,qe===0?(ot=138,Ae=3):Ct===qe?(ot=6,Ae=3):(ot=7,Ae=4)}}function lt(st){var It;for(Ft(st,st.dyn_ltree,st.l_desc.max_code),Ft(st,st.dyn_dtree,st.d_desc.max_code),_t(st,st.bl_desc),It=q-1;It>=3&&st.bl_tree[B[It]*2+1]===0;It--);return st.opt_len+=3*(It+1)+5+5+4,It}function dt(st,It,ft,Jt){var Ot;for(ge(st,It-257,5),ge(st,ft-1,5),ge(st,Jt-4,4),Ot=0;Ot<Jt;Ot++)ge(st,st.bl_tree[B[Ot]*2+1],3);gt(st,st.dyn_ltree,It-1),gt(st,st.dyn_dtree,ft-1)}function tt(st){var It=4093624447,ft;for(ft=0;ft<=31;ft++,It>>>=1)if(It&1&&st.dyn_ltree[ft*2]!==0)return E;if(st.dyn_ltree[18]!==0||st.dyn_ltree[20]!==0||st.dyn_ltree[26]!==0)return v;for(ft=32;ft<O;ft++)if(st.dyn_ltree[ft*2]!==0)return v;return E}var rt=!1;function ke(st){rt||(He(),rt=!0),st.l_desc=new Q(st.dyn_ltree,fe),st.d_desc=new Q(st.dyn_dtree,te),st.bl_desc=new Q(st.bl_tree,H),st.bi_buf=0,st.bi_valid=0,Ie(st)}function xe(st,It,ft,Jt){ge(st,(p<<1)+(Jt?1:0),3),Ge(st,It,ft,!0)}function Pe(st){ge(st,m<<1,3),be(st,le,$),Ee(st)}function it(st,It,ft,Jt){var Ot,Ct,qe=0;st.level>0?(st.strm.data_type===c&&(st.strm.data_type=tt(st)),_t(st,st.l_desc),_t(st,st.d_desc),qe=lt(st),Ot=st.opt_len+3+7>>>3,Ct=st.static_len+3+7>>>3,Ct<=Ot&&(Ot=Ct)):Ot=Ct=ft+5,ft+4<=Ot&&It!==-1?xe(st,It,ft,Jt):st.strategy===w||Ct===Ot?(ge(st,(m<<1)+(Jt?1:0),3),Ze(st,$,T)):(ge(st,(C<<1)+(Jt?1:0),3),dt(st,st.l_desc.max_code+1,st.d_desc.max_code+1,qe+1),Ze(st,st.dyn_ltree,st.dyn_dtree)),Ie(st),Jt&&Le(st)}function Xe(st,It,ft){return st.pending_buf[st.d_buf+st.last_lit*2]=It>>>8&255,st.pending_buf[st.d_buf+st.last_lit*2+1]=It&255,st.pending_buf[st.l_buf+st.last_lit]=ft&255,st.last_lit++,It===0?st.dyn_ltree[ft*2]++:(st.matches++,It--,st.dyn_ltree[(j[ft]+O+1)*2]++,st.dyn_dtree[oe(It)*2]++),st.last_lit===st.lit_bufsize-1}f._tr_init=ke,f._tr_stored_block=xe,f._tr_flush_block=it,f._tr_tally=Xe,f._tr_align=Pe},84179:function(ie){"use strict";function f(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}ie.exports=f},34759:function(ie,f,_){"use strict";const{ErrorWithCause:h}=_(37484),{findCauseByReference:w,getErrorCause:E,messageWithCauses:v,stackWithCauses:c}=_(93716);ie.exports={ErrorWithCause:h,findCauseByReference:w,getErrorCause:E,stackWithCauses:c,messageWithCauses:v}},7274:function(ie){"use strict";ie.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},85409:function(ie){var f=ie.exports={},_,h;function w(){throw new Error("setTimeout has not been defined")}function E(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?_=setTimeout:_=w}catch{_=w}try{typeof clearTimeout=="function"?h=clearTimeout:h=E}catch{h=E}})();function v(M){if(_===setTimeout)return setTimeout(M,0);if((_===w||!_)&&setTimeout)return _=setTimeout,setTimeout(M,0);try{return _(M,0)}catch{try{return _.call(null,M,0)}catch{return _.call(this,M,0)}}}function c(M){if(h===clearTimeout)return clearTimeout(M);if((h===E||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(M);try{return h(M)}catch{try{return h.call(null,M)}catch{return h.call(this,M)}}}var d=[],p=!1,m,C=-1;function x(){!p||!m||(p=!1,m.length?d=m.concat(d):C=-1,d.length&&R())}function R(){if(!p){var M=v(x);p=!0;for(var k=d.length;k;){for(m=d,d=[];++C<k;)m&&m[C].run();C=-1,k=d.length}m=null,p=!1,c(M)}}f.nextTick=function(M){var k=new Array(arguments.length-1);if(arguments.length>1)for(var q=1;q<arguments.length;q++)k[q-1]=arguments[q];d.push(new S(M,k)),d.length===1&&!p&&v(R)};function S(M,k){this.fun=M,this.array=k}S.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={};function O(){}f.on=O,f.addListener=O,f.once=O,f.off=O,f.removeListener=O,f.removeAllListeners=O,f.emit=O,f.prependListener=O,f.prependOnceListener=O,f.listeners=function(M){return[]},f.binding=function(M){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(M){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},11239:function(ie,f,_){ie=_.nmd(ie);/*! https://mths.be/punycode v1.4.1 by @mathias */(function(h){var w=f&&!f.nodeType&&f,E=ie&&!ie.nodeType&&ie,v=typeof _.g=="object"&&_.g;(v.global===v||v.window===v||v.self===v)&&(h=v);var c,d=2147483647,p=36,m=1,C=26,x=38,R=700,S=72,O=128,M="-",k=/^xn--/,q=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},G=p-m,ue=Math.floor,le=String.fromCharCode,X;function se(Z){throw new RangeError(F[Z])}function de(Z,z){for(var fe=Z.length,te=[];fe--;)te[fe]=z(Z[fe]);return te}function ye(Z,z){var fe=Z.split("@"),te="";fe.length>1&&(te=fe[0]+"@",Z=fe[1]),Z=Z.replace(b,".");var H=Z.split("."),Q=de(H,z).join(".");return te+Q}function he(Z){for(var z=[],fe=0,te=Z.length,H,Q;fe<te;)H=Z.charCodeAt(fe++),H>=55296&&H<=56319&&fe<te?(Q=Z.charCodeAt(fe++),(Q&64512)==56320?z.push(((H&1023)<<10)+(Q&1023)+65536):(z.push(H),fe--)):z.push(H);return z}function K(Z){return de(Z,function(z){var fe="";return z>65535&&(z-=65536,fe+=le(z>>>10&1023|55296),z=56320|z&1023),fe+=le(z),fe}).join("")}function B(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:p}function L(Z,z){return Z+22+75*(Z<26)-((z!=0)<<5)}function $(Z,z,fe){var te=0;for(Z=fe?ue(Z/R):Z>>1,Z+=ue(Z/z);Z>G*C>>1;te+=p)Z=ue(Z/G);return ue(te+(G+1)*Z/(Z+x))}function T(Z){var z=[],fe=Z.length,te,H=0,Q=O,oe=S,_e,ge,be,we,Ee,me,Ke,He,Ie;for(_e=Z.lastIndexOf(M),_e<0&&(_e=0),ge=0;ge<_e;++ge)Z.charCodeAt(ge)>=128&&se("not-basic"),z.push(Z.charCodeAt(ge));for(be=_e>0?_e+1:0;be<fe;){for(we=H,Ee=1,me=p;be>=fe&&se("invalid-input"),Ke=B(Z.charCodeAt(be++)),(Ke>=p||Ke>ue((d-H)/Ee))&&se("overflow"),H+=Ke*Ee,He=me<=oe?m:me>=oe+C?C:me-oe,!(Ke<He);me+=p)Ie=p-He,Ee>ue(d/Ie)&&se("overflow"),Ee*=Ie;te=z.length+1,oe=$(H-we,te,we==0),ue(H/te)>d-Q&&se("overflow"),Q+=ue(H/te),H%=te,z.splice(H++,0,Q)}return K(z)}function N(Z){var z,fe,te,H,Q,oe,_e,ge,be,we,Ee,me=[],Ke,He,Ie,Le;for(Z=he(Z),Ke=Z.length,z=O,fe=0,Q=S,oe=0;oe<Ke;++oe)Ee=Z[oe],Ee<128&&me.push(le(Ee));for(te=H=me.length,H&&me.push(M);te<Ke;){for(_e=d,oe=0;oe<Ke;++oe)Ee=Z[oe],Ee>=z&&Ee<_e&&(_e=Ee);for(He=te+1,_e-z>ue((d-fe)/He)&&se("overflow"),fe+=(_e-z)*He,z=_e,oe=0;oe<Ke;++oe)if(Ee=Z[oe],Ee<z&&++fe>d&&se("overflow"),Ee==z){for(ge=fe,be=p;we=be<=Q?m:be>=Q+C?C:be-Q,!(ge<we);be+=p)Le=ge-we,Ie=p-we,me.push(le(L(we+Le%Ie,0))),ge=ue(Le/Ie);me.push(le(L(ge,0))),Q=$(fe,He,te==H),fe=0,++te}++fe,++z}return me.join("")}function j(Z){return ye(Z,function(z){return k.test(z)?T(z.slice(4).toLowerCase()):z})}function Y(Z){return ye(Z,function(z){return q.test(z)?"xn--"+N(z):z})}if(c={version:"1.4.1",ucs2:{decode:he,encode:K},decode:T,encode:N,toASCII:Y,toUnicode:j},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return c});else if(w&&E)if(ie.exports==w)E.exports=c;else for(X in c)c.hasOwnProperty(X)&&(w[X]=c[X]);else h.punycode=c})(this)},88085:function(ie){"use strict";var f=String.prototype.replace,_=/%20/g,h={RFC1738:"RFC1738",RFC3986:"RFC3986"};ie.exports={default:h.RFC3986,formatters:{RFC1738:function(w){return f.call(w,_,"+")},RFC3986:function(w){return String(w)}},RFC1738:h.RFC1738,RFC3986:h.RFC3986}},63365:function(ie,f,_){"use strict";var h=_(30836),w=_(64250),E=_(88085);ie.exports={formats:E,parse:w,stringify:h}},64250:function(ie,f,_){"use strict";var h=_(53952),w=Object.prototype.hasOwnProperty,E=Array.isArray,v={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:h.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},c=function(O){return O.replace(/&#(\d+);/g,function(M,k){return String.fromCharCode(parseInt(k,10))})},d=function(O,M,k){if(O&&typeof O=="string"&&M.comma&&O.indexOf(",")>-1)return O.split(",");if(M.throwOnLimitExceeded&&k>=M.arrayLimit)throw new RangeError("Array limit exceeded. Only "+M.arrayLimit+" element"+(M.arrayLimit===1?"":"s")+" allowed in an array.");return O},p="utf8=%26%2310003%3B",m="utf8=%E2%9C%93",C=function(M,k){var q={__proto__:null},b=k.ignoreQueryPrefix?M.replace(/^\?/,""):M;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var F=k.parameterLimit===1/0?void 0:k.parameterLimit,G=b.split(k.delimiter,k.throwOnLimitExceeded?F+1:F);if(k.throwOnLimitExceeded&&G.length>F)throw new RangeError("Parameter limit exceeded. Only "+F+" parameter"+(F===1?"":"s")+" allowed.");var ue=-1,le,X=k.charset;if(k.charsetSentinel)for(le=0;le<G.length;++le)G[le].indexOf("utf8=")===0&&(G[le]===m?X="utf-8":G[le]===p&&(X="iso-8859-1"),ue=le,le=G.length);for(le=0;le<G.length;++le)if(le!==ue){var se=G[le],de=se.indexOf("]="),ye=de===-1?se.indexOf("="):de+1,he,K;ye===-1?(he=k.decoder(se,v.decoder,X,"key"),K=k.strictNullHandling?null:""):(he=k.decoder(se.slice(0,ye),v.decoder,X,"key"),K=h.maybeMap(d(se.slice(ye+1),k,E(q[he])?q[he].length:0),function(L){return k.decoder(L,v.decoder,X,"value")})),K&&k.interpretNumericEntities&&X==="iso-8859-1"&&(K=c(String(K))),se.indexOf("[]=")>-1&&(K=E(K)?[K]:K);var B=w.call(q,he);B&&k.duplicates==="combine"?q[he]=h.combine(q[he],K):(!B||k.duplicates==="last")&&(q[he]=K)}return q},x=function(O,M,k,q){var b=0;if(O.length>0&&O[O.length-1]==="[]"){var F=O.slice(0,-1).join("");b=Array.isArray(M)&&M[F]?M[F].length:0}for(var G=q?M:d(M,k,b),ue=O.length-1;ue>=0;--ue){var le,X=O[ue];if(X==="[]"&&k.parseArrays)le=k.allowEmptyArrays&&(G===""||k.strictNullHandling&&G===null)?[]:h.combine([],G);else{le=k.plainObjects?{__proto__:null}:{};var se=X.charAt(0)==="["&&X.charAt(X.length-1)==="]"?X.slice(1,-1):X,de=k.decodeDotInKeys?se.replace(/%2E/g,"."):se,ye=parseInt(de,10);!k.parseArrays&&de===""?le={0:G}:!isNaN(ye)&&X!==de&&String(ye)===de&&ye>=0&&k.parseArrays&&ye<=k.arrayLimit?(le=[],le[ye]=G):de!=="__proto__"&&(le[de]=G)}G=le}return G},R=function(M,k,q,b){if(M){var F=q.allowDots?M.replace(/\.([^.[]+)/g,"[$1]"):M,G=/(\[[^[\]]*])/,ue=/(\[[^[\]]*])/g,le=q.depth>0&&G.exec(F),X=le?F.slice(0,le.index):F,se=[];if(X){if(!q.plainObjects&&w.call(Object.prototype,X)&&!q.allowPrototypes)return;se.push(X)}for(var de=0;q.depth>0&&(le=ue.exec(F))!==null&&de<q.depth;){if(de+=1,!q.plainObjects&&w.call(Object.prototype,le[1].slice(1,-1))&&!q.allowPrototypes)return;se.push(le[1])}if(le){if(q.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+q.depth+" and strictDepth is true");se.push("["+F.slice(le.index)+"]")}return x(se,k,q,b)}},S=function(M){if(!M)return v;if(typeof M.allowEmptyArrays<"u"&&typeof M.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof M.decodeDotInKeys<"u"&&typeof M.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(M.decoder!==null&&typeof M.decoder<"u"&&typeof M.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof M.charset<"u"&&M.charset!=="utf-8"&&M.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof M.throwOnLimitExceeded<"u"&&typeof M.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var k=typeof M.charset>"u"?v.charset:M.charset,q=typeof M.duplicates>"u"?v.duplicates:M.duplicates;if(q!=="combine"&&q!=="first"&&q!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof M.allowDots>"u"?M.decodeDotInKeys===!0?!0:v.allowDots:!!M.allowDots;return{allowDots:b,allowEmptyArrays:typeof M.allowEmptyArrays=="boolean"?!!M.allowEmptyArrays:v.allowEmptyArrays,allowPrototypes:typeof M.allowPrototypes=="boolean"?M.allowPrototypes:v.allowPrototypes,allowSparse:typeof M.allowSparse=="boolean"?M.allowSparse:v.allowSparse,arrayLimit:typeof M.arrayLimit=="number"?M.arrayLimit:v.arrayLimit,charset:k,charsetSentinel:typeof M.charsetSentinel=="boolean"?M.charsetSentinel:v.charsetSentinel,comma:typeof M.comma=="boolean"?M.comma:v.comma,decodeDotInKeys:typeof M.decodeDotInKeys=="boolean"?M.decodeDotInKeys:v.decodeDotInKeys,decoder:typeof M.decoder=="function"?M.decoder:v.decoder,delimiter:typeof M.delimiter=="string"||h.isRegExp(M.delimiter)?M.delimiter:v.delimiter,depth:typeof M.depth=="number"||M.depth===!1?+M.depth:v.depth,duplicates:q,ignoreQueryPrefix:M.ignoreQueryPrefix===!0,interpretNumericEntities:typeof M.interpretNumericEntities=="boolean"?M.interpretNumericEntities:v.interpretNumericEntities,parameterLimit:typeof M.parameterLimit=="number"?M.parameterLimit:v.parameterLimit,parseArrays:M.parseArrays!==!1,plainObjects:typeof M.plainObjects=="boolean"?M.plainObjects:v.plainObjects,strictDepth:typeof M.strictDepth=="boolean"?!!M.strictDepth:v.strictDepth,strictNullHandling:typeof M.strictNullHandling=="boolean"?M.strictNullHandling:v.strictNullHandling,throwOnLimitExceeded:typeof M.throwOnLimitExceeded=="boolean"?M.throwOnLimitExceeded:!1}};ie.exports=function(O,M){var k=S(M);if(O===""||O===null||typeof O>"u")return k.plainObjects?{__proto__:null}:{};for(var q=typeof O=="string"?C(O,k):O,b=k.plainObjects?{__proto__:null}:{},F=Object.keys(q),G=0;G<F.length;++G){var ue=F[G],le=R(ue,q[ue],k,typeof O=="string");b=h.merge(b,le,k)}return k.allowSparse===!0?b:h.compact(b)}},30836:function(ie,f,_){"use strict";var h=_(4198),w=_(53952),E=_(88085),v=Object.prototype.hasOwnProperty,c={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,F){return b+"["+F+"]"},repeat:function(b){return b}},d=Array.isArray,p=Array.prototype.push,m=function(q,b){p.apply(q,d(b)?b:[b])},C=Date.prototype.toISOString,x=E.default,R={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:w.encode,encodeValuesOnly:!1,filter:void 0,format:x,formatter:E.formatters[x],indices:!1,serializeDate:function(b){return C.call(b)},skipNulls:!1,strictNullHandling:!1},S=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},O={},M=function q(b,F,G,ue,le,X,se,de,ye,he,K,B,L,$,T,N,j,Y){for(var Z=b,z=Y,fe=0,te=!1;(z=z.get(O))!==void 0&&!te;){var H=z.get(b);if(fe+=1,typeof H<"u"){if(H===fe)throw new RangeError("Cyclic object value");te=!0}typeof z.get(O)>"u"&&(fe=0)}if(typeof he=="function"?Z=he(F,Z):Z instanceof Date?Z=L(Z):G==="comma"&&d(Z)&&(Z=w.maybeMap(Z,function(Ge){return Ge instanceof Date?L(Ge):Ge})),Z===null){if(X)return ye&&!N?ye(F,R.encoder,j,"key",$):F;Z=""}if(S(Z)||w.isBuffer(Z)){if(ye){var Q=N?F:ye(F,R.encoder,j,"key",$);return[T(Q)+"="+T(ye(Z,R.encoder,j,"value",$))]}return[T(F)+"="+T(String(Z))]}var oe=[];if(typeof Z>"u")return oe;var _e;if(G==="comma"&&d(Z))N&&ye&&(Z=w.maybeMap(Z,ye)),_e=[{value:Z.length>0?Z.join(",")||null:void 0}];else if(d(he))_e=he;else{var ge=Object.keys(Z);_e=K?ge.sort(K):ge}var be=de?String(F).replace(/\./g,"%2E"):String(F),we=ue&&d(Z)&&Z.length===1?be+"[]":be;if(le&&d(Z)&&Z.length===0)return we+"[]";for(var Ee=0;Ee<_e.length;++Ee){var me=_e[Ee],Ke=typeof me=="object"&&me&&typeof me.value<"u"?me.value:Z[me];if(!(se&&Ke===null)){var He=B&&de?String(me).replace(/\./g,"%2E"):String(me),Ie=d(Z)?typeof G=="function"?G(we,He):we:we+(B?"."+He:"["+He+"]");Y.set(b,fe);var Le=h();Le.set(O,Y),m(oe,q(Ke,Ie,G,ue,le,X,se,de,G==="comma"&&N&&d(Z)?null:ye,he,K,B,L,$,T,N,j,Le))}}return oe},k=function(b){if(!b)return R;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var F=b.charset||R.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var G=E.default;if(typeof b.format<"u"){if(!v.call(E.formatters,b.format))throw new TypeError("Unknown format option provided.");G=b.format}var ue=E.formatters[G],le=R.filter;(typeof b.filter=="function"||d(b.filter))&&(le=b.filter);var X;if(b.arrayFormat in c?X=b.arrayFormat:"indices"in b?X=b.indices?"indices":"repeat":X=R.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var se=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:R.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:R.addQueryPrefix,allowDots:se,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:R.allowEmptyArrays,arrayFormat:X,charset:F,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:R.charsetSentinel,commaRoundTrip:!!b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?R.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:R.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:R.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:R.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:R.encodeValuesOnly,filter:le,format:G,formatter:ue,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:R.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:R.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:R.strictNullHandling}};ie.exports=function(q,b){var F=q,G=k(b),ue,le;typeof G.filter=="function"?(le=G.filter,F=le("",F)):d(G.filter)&&(le=G.filter,ue=le);var X=[];if(typeof F!="object"||F===null)return"";var se=c[G.arrayFormat],de=se==="comma"&&G.commaRoundTrip;ue||(ue=Object.keys(F)),G.sort&&ue.sort(G.sort);for(var ye=h(),he=0;he<ue.length;++he){var K=ue[he],B=F[K];G.skipNulls&&B===null||m(X,M(B,K,se,de,G.allowEmptyArrays,G.strictNullHandling,G.skipNulls,G.encodeDotInKeys,G.encode?G.encoder:null,G.filter,G.sort,G.allowDots,G.serializeDate,G.format,G.formatter,G.encodeValuesOnly,G.charset,ye))}var L=X.join(G.delimiter),$=G.addQueryPrefix===!0?"?":"";return G.charsetSentinel&&(G.charset==="iso-8859-1"?$+="utf8=%26%2310003%3B&":$+="utf8=%E2%9C%93&"),L.length>0?$+L:""}},53952:function(ie,f,_){"use strict";var h=_(88085),w=Object.prototype.hasOwnProperty,E=Array.isArray,v=function(){for(var b=[],F=0;F<256;++F)b.push("%"+((F<16?"0":"")+F.toString(16)).toUpperCase());return b}(),c=function(F){for(;F.length>1;){var G=F.pop(),ue=G.obj[G.prop];if(E(ue)){for(var le=[],X=0;X<ue.length;++X)typeof ue[X]<"u"&&le.push(ue[X]);G.obj[G.prop]=le}}},d=function(F,G){for(var ue=G&&G.plainObjects?{__proto__:null}:{},le=0;le<F.length;++le)typeof F[le]<"u"&&(ue[le]=F[le]);return ue},p=function b(F,G,ue){if(!G)return F;if(typeof G!="object"&&typeof G!="function"){if(E(F))F.push(G);else if(F&&typeof F=="object")(ue&&(ue.plainObjects||ue.allowPrototypes)||!w.call(Object.prototype,G))&&(F[G]=!0);else return[F,G];return F}if(!F||typeof F!="object")return[F].concat(G);var le=F;return E(F)&&!E(G)&&(le=d(F,ue)),E(F)&&E(G)?(G.forEach(function(X,se){if(w.call(F,se)){var de=F[se];de&&typeof de=="object"&&X&&typeof X=="object"?F[se]=b(de,X,ue):F.push(X)}else F[se]=X}),F):Object.keys(G).reduce(function(X,se){var de=G[se];return w.call(X,se)?X[se]=b(X[se],de,ue):X[se]=de,X},le)},m=function(F,G){return Object.keys(G).reduce(function(ue,le){return ue[le]=G[le],ue},F)},C=function(b,F,G){var ue=b.replace(/\+/g," ");if(G==="iso-8859-1")return ue.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(ue)}catch{return ue}},x=1024,R=function(F,G,ue,le,X){if(F.length===0)return F;var se=F;if(typeof F=="symbol"?se=Symbol.prototype.toString.call(F):typeof F!="string"&&(se=String(F)),ue==="iso-8859-1")return escape(se).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var de="",ye=0;ye<se.length;ye+=x){for(var he=se.length>=x?se.slice(ye,ye+x):se,K=[],B=0;B<he.length;++B){var L=he.charCodeAt(B);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||X===h.RFC1738&&(L===40||L===41)){K[K.length]=he.charAt(B);continue}if(L<128){K[K.length]=v[L];continue}if(L<2048){K[K.length]=v[192|L>>6]+v[128|L&63];continue}if(L<55296||L>=57344){K[K.length]=v[224|L>>12]+v[128|L>>6&63]+v[128|L&63];continue}B+=1,L=65536+((L&1023)<<10|he.charCodeAt(B)&1023),K[K.length]=v[240|L>>18]+v[128|L>>12&63]+v[128|L>>6&63]+v[128|L&63]}de+=K.join("")}return de},S=function(F){for(var G=[{obj:{o:F},prop:"o"}],ue=[],le=0;le<G.length;++le)for(var X=G[le],se=X.obj[X.prop],de=Object.keys(se),ye=0;ye<de.length;++ye){var he=de[ye],K=se[he];typeof K=="object"&&K!==null&&ue.indexOf(K)===-1&&(G.push({obj:se,prop:he}),ue.push(K))}return c(G),F},O=function(F){return Object.prototype.toString.call(F)==="[object RegExp]"},M=function(F){return!F||typeof F!="object"?!1:!!(F.constructor&&F.constructor.isBuffer&&F.constructor.isBuffer(F))},k=function(F,G){return[].concat(F,G)},q=function(F,G){if(E(F)){for(var ue=[],le=0;le<F.length;le+=1)ue.push(G(F[le]));return ue}return G(F)};ie.exports={arrayToObject:d,assign:m,combine:k,compact:S,decode:C,encode:R,isBuffer:M,isRegExp:O,maybeMap:q,merge:p}},20289:function(ie){"use strict";function f(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,d.__proto__=p}var _={};function h(d,p,m){m||(m=Error);function C(R,S,O){return typeof p=="string"?p:p(R,S,O)}var x=function(R){f(S,R);function S(O,M,k){return R.call(this,C(O,M,k))||this}return S}(m);x.prototype.name=m.name,x.prototype.code=d,_[d]=x}function w(d,p){if(Array.isArray(d)){var m=d.length;return d=d.map(function(C){return String(C)}),m>2?"one of ".concat(p," ").concat(d.slice(0,m-1).join(", "),", or ")+d[m-1]:m===2?"one of ".concat(p," ").concat(d[0]," or ").concat(d[1]):"of ".concat(p," ").concat(d[0])}else return"of ".concat(p," ").concat(String(d))}function E(d,p,m){return d.substr(!m||m<0?0:+m,p.length)===p}function v(d,p,m){return(m===void 0||m>d.length)&&(m=d.length),d.substring(m-p.length,m)===p}function c(d,p,m){return typeof m!="number"&&(m=0),m+p.length>d.length?!1:d.indexOf(p,m)!==-1}h("ERR_INVALID_OPT_VALUE",function(d,p){return'The value "'+p+'" is invalid for option "'+d+'"'},TypeError),h("ERR_INVALID_ARG_TYPE",function(d,p,m){var C;typeof p=="string"&&E(p,"not ")?(C="must not be",p=p.replace(/^not /,"")):C="must be";var x;if(v(d," argument"))x="The ".concat(d," ").concat(C," ").concat(w(p,"type"));else{var R=c(d,".")?"property":"argument";x='The "'.concat(d,'" ').concat(R," ").concat(C," ").concat(w(p,"type"))}return x+=". Received type ".concat(typeof m),x},TypeError),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),h("ERR_METHOD_NOT_IMPLEMENTED",function(d){return"The "+d+" method is not implemented"}),h("ERR_STREAM_PREMATURE_CLOSE","Premature close"),h("ERR_STREAM_DESTROYED",function(d){return"Cannot call "+d+" after a stream was destroyed"}),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),h("ERR_STREAM_WRITE_AFTER_END","write after end"),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_UNKNOWN_ENCODING",function(d){return"Unknown encoding: "+d},TypeError),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),ie.exports.codes=_},35707:function(ie,f,_){"use strict";var h=_(85409),w=Object.keys||function(R){var S=[];for(var O in R)S.push(O);return S};ie.exports=m;var E=_(23033),v=_(92553);_(91193)(m,E);for(var c=w(v.prototype),d=0;d<c.length;d++){var p=c[d];m.prototype[p]||(m.prototype[p]=v.prototype[p])}function m(R){if(!(this instanceof m))return new m(R);E.call(this,R),v.call(this,R),this.allowHalfOpen=!0,R&&(R.readable===!1&&(this.readable=!1),R.writable===!1&&(this.writable=!1),R.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",C)))}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(m.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(m.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function C(){this._writableState.ended||h.nextTick(x,this)}function x(R){R.end()}Object.defineProperty(m.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(S){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=S,this._writableState.destroyed=S)}})},75271:function(ie,f,_){"use strict";ie.exports=w;var h=_(50141);_(91193)(w,h);function w(E){if(!(this instanceof w))return new w(E);h.call(this,E)}w.prototype._transform=function(E,v,c){c(null,E)}},23033:function(ie,f,_){"use strict";var h=_(85409);ie.exports=B;var w;B.ReadableState=K;var E=_(80381).EventEmitter,v=function(Le,Ge){return Le.listeners(Ge).length},c=_(82534),d=_(36533).Buffer,p=(typeof _.g<"u"?_.g:typeof self<"u"?self:{}).Uint8Array||function(){};function m(Ie){return d.from(Ie)}function C(Ie){return d.isBuffer(Ie)||Ie instanceof p}var x=_(49132),R;x&&x.debuglog?R=x.debuglog("stream"):R=function(){};var S=_(70020),O=_(50917),M=_(65750),k=M.getHighWaterMark,q=_(20289).codes,b=q.ERR_INVALID_ARG_TYPE,F=q.ERR_STREAM_PUSH_AFTER_EOF,G=q.ERR_METHOD_NOT_IMPLEMENTED,ue=q.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,le,X,se;_(91193)(B,c);var de=O.errorOrDestroy,ye=["error","close","destroy","pause","resume"];function he(Ie,Le,Ge){if(typeof Ie.prependListener=="function")return Ie.prependListener(Le,Ge);!Ie._events||!Ie._events[Le]?Ie.on(Le,Ge):Array.isArray(Ie._events[Le])?Ie._events[Le].unshift(Ge):Ie._events[Le]=[Ge,Ie._events[Le]]}function K(Ie,Le,Ge){w=w||_(35707),Ie=Ie||{},typeof Ge!="boolean"&&(Ge=Le instanceof w),this.objectMode=!!Ie.objectMode,Ge&&(this.objectMode=this.objectMode||!!Ie.readableObjectMode),this.highWaterMark=k(this,Ie,"readableHighWaterMark",Ge),this.buffer=new S,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=Ie.emitClose!==!1,this.autoDestroy=!!Ie.autoDestroy,this.destroyed=!1,this.defaultEncoding=Ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Ie.encoding&&(le||(le=_(86704).StringDecoder),this.decoder=new le(Ie.encoding),this.encoding=Ie.encoding)}function B(Ie){if(w=w||_(35707),!(this instanceof B))return new B(Ie);var Le=this instanceof w;this._readableState=new K(Ie,this,Le),this.readable=!0,Ie&&(typeof Ie.read=="function"&&(this._read=Ie.read),typeof Ie.destroy=="function"&&(this._destroy=Ie.destroy)),c.call(this)}Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Le){this._readableState&&(this._readableState.destroyed=Le)}}),B.prototype.destroy=O.destroy,B.prototype._undestroy=O.undestroy,B.prototype._destroy=function(Ie,Le){Le(Ie)},B.prototype.push=function(Ie,Le){var Ge=this._readableState,Be;return Ge.objectMode?Be=!0:typeof Ie=="string"&&(Le=Le||Ge.defaultEncoding,Le!==Ge.encoding&&(Ie=d.from(Ie,Le),Le=""),Be=!0),L(this,Ie,Le,!1,Be)},B.prototype.unshift=function(Ie){return L(this,Ie,null,!0,!1)};function L(Ie,Le,Ge,Be,We){R("readableAddChunk",Le);var Ze=Ie._readableState;if(Le===null)Ze.reading=!1,Z(Ie,Ze);else{var _t;if(We||(_t=T(Ze,Le)),_t)de(Ie,_t);else if(Ze.objectMode||Le&&Le.length>0)if(typeof Le!="string"&&!Ze.objectMode&&Object.getPrototypeOf(Le)!==d.prototype&&(Le=m(Le)),Be)Ze.endEmitted?de(Ie,new ue):$(Ie,Ze,Le,!0);else if(Ze.ended)de(Ie,new F);else{if(Ze.destroyed)return!1;Ze.reading=!1,Ze.decoder&&!Ge?(Le=Ze.decoder.write(Le),Ze.objectMode||Le.length!==0?$(Ie,Ze,Le,!1):te(Ie,Ze)):$(Ie,Ze,Le,!1)}else Be||(Ze.reading=!1,te(Ie,Ze))}return!Ze.ended&&(Ze.length<Ze.highWaterMark||Ze.length===0)}function $(Ie,Le,Ge,Be){Le.flowing&&Le.length===0&&!Le.sync?(Le.awaitDrain=0,Ie.emit("data",Ge)):(Le.length+=Le.objectMode?1:Ge.length,Be?Le.buffer.unshift(Ge):Le.buffer.push(Ge),Le.needReadable&&z(Ie)),te(Ie,Le)}function T(Ie,Le){var Ge;return!C(Le)&&typeof Le!="string"&&Le!==void 0&&!Ie.objectMode&&(Ge=new b("chunk",["string","Buffer","Uint8Array"],Le)),Ge}B.prototype.isPaused=function(){return this._readableState.flowing===!1},B.prototype.setEncoding=function(Ie){le||(le=_(86704).StringDecoder);var Le=new le(Ie);this._readableState.decoder=Le,this._readableState.encoding=this._readableState.decoder.encoding;for(var Ge=this._readableState.buffer.head,Be="";Ge!==null;)Be+=Le.write(Ge.data),Ge=Ge.next;return this._readableState.buffer.clear(),Be!==""&&this._readableState.buffer.push(Be),this._readableState.length=Be.length,this};var N=1073741824;function j(Ie){return Ie>=N?Ie=N:(Ie--,Ie|=Ie>>>1,Ie|=Ie>>>2,Ie|=Ie>>>4,Ie|=Ie>>>8,Ie|=Ie>>>16,Ie++),Ie}function Y(Ie,Le){return Ie<=0||Le.length===0&&Le.ended?0:Le.objectMode?1:Ie!==Ie?Le.flowing&&Le.length?Le.buffer.head.data.length:Le.length:(Ie>Le.highWaterMark&&(Le.highWaterMark=j(Ie)),Ie<=Le.length?Ie:Le.ended?Le.length:(Le.needReadable=!0,0))}B.prototype.read=function(Ie){R("read",Ie),Ie=parseInt(Ie,10);var Le=this._readableState,Ge=Ie;if(Ie!==0&&(Le.emittedReadable=!1),Ie===0&&Le.needReadable&&((Le.highWaterMark!==0?Le.length>=Le.highWaterMark:Le.length>0)||Le.ended))return R("read: emitReadable",Le.length,Le.ended),Le.length===0&&Le.ended?me(this):z(this),null;if(Ie=Y(Ie,Le),Ie===0&&Le.ended)return Le.length===0&&me(this),null;var Be=Le.needReadable;R("need readable",Be),(Le.length===0||Le.length-Ie<Le.highWaterMark)&&(Be=!0,R("length less than watermark",Be)),Le.ended||Le.reading?(Be=!1,R("reading or ended",Be)):Be&&(R("do read"),Le.reading=!0,Le.sync=!0,Le.length===0&&(Le.needReadable=!0),this._read(Le.highWaterMark),Le.sync=!1,Le.reading||(Ie=Y(Ge,Le)));var We;return Ie>0?We=Ee(Ie,Le):We=null,We===null?(Le.needReadable=Le.length<=Le.highWaterMark,Ie=0):(Le.length-=Ie,Le.awaitDrain=0),Le.length===0&&(Le.ended||(Le.needReadable=!0),Ge!==Ie&&Le.ended&&me(this)),We!==null&&this.emit("data",We),We};function Z(Ie,Le){if(R("onEofChunk"),!Le.ended){if(Le.decoder){var Ge=Le.decoder.end();Ge&&Ge.length&&(Le.buffer.push(Ge),Le.length+=Le.objectMode?1:Ge.length)}Le.ended=!0,Le.sync?z(Ie):(Le.needReadable=!1,Le.emittedReadable||(Le.emittedReadable=!0,fe(Ie)))}}function z(Ie){var Le=Ie._readableState;R("emitReadable",Le.needReadable,Le.emittedReadable),Le.needReadable=!1,Le.emittedReadable||(R("emitReadable",Le.flowing),Le.emittedReadable=!0,h.nextTick(fe,Ie))}function fe(Ie){var Le=Ie._readableState;R("emitReadable_",Le.destroyed,Le.length,Le.ended),!Le.destroyed&&(Le.length||Le.ended)&&(Ie.emit("readable"),Le.emittedReadable=!1),Le.needReadable=!Le.flowing&&!Le.ended&&Le.length<=Le.highWaterMark,we(Ie)}function te(Ie,Le){Le.readingMore||(Le.readingMore=!0,h.nextTick(H,Ie,Le))}function H(Ie,Le){for(;!Le.reading&&!Le.ended&&(Le.length<Le.highWaterMark||Le.flowing&&Le.length===0);){var Ge=Le.length;if(R("maybeReadMore read 0"),Ie.read(0),Ge===Le.length)break}Le.readingMore=!1}B.prototype._read=function(Ie){de(this,new G("_read()"))},B.prototype.pipe=function(Ie,Le){var Ge=this,Be=this._readableState;switch(Be.pipesCount){case 0:Be.pipes=Ie;break;case 1:Be.pipes=[Be.pipes,Ie];break;default:Be.pipes.push(Ie);break}Be.pipesCount+=1,R("pipe count=%d opts=%j",Be.pipesCount,Le);var We=(!Le||Le.end!==!1)&&Ie!==h.stdout&&Ie!==h.stderr,Ze=We?Ft:Pe;Be.endEmitted?h.nextTick(Ze):Ge.once("end",Ze),Ie.on("unpipe",_t);function _t(it,Xe){R("onunpipe"),it===Ge&&Xe&&Xe.hasUnpiped===!1&&(Xe.hasUnpiped=!0,dt())}function Ft(){R("onend"),Ie.end()}var gt=Q(Ge);Ie.on("drain",gt);var lt=!1;function dt(){R("cleanup"),Ie.removeListener("close",ke),Ie.removeListener("finish",xe),Ie.removeListener("drain",gt),Ie.removeListener("error",rt),Ie.removeListener("unpipe",_t),Ge.removeListener("end",Ft),Ge.removeListener("end",Pe),Ge.removeListener("data",tt),lt=!0,Be.awaitDrain&&(!Ie._writableState||Ie._writableState.needDrain)&>()}Ge.on("data",tt);function tt(it){R("ondata");var Xe=Ie.write(it);R("dest.write",Xe),Xe===!1&&((Be.pipesCount===1&&Be.pipes===Ie||Be.pipesCount>1&&He(Be.pipes,Ie)!==-1)&&!lt&&(R("false write response, pause",Be.awaitDrain),Be.awaitDrain++),Ge.pause())}function rt(it){R("onerror",it),Pe(),Ie.removeListener("error",rt),v(Ie,"error")===0&&de(Ie,it)}he(Ie,"error",rt);function ke(){Ie.removeListener("finish",xe),Pe()}Ie.once("close",ke);function xe(){R("onfinish"),Ie.removeListener("close",ke),Pe()}Ie.once("finish",xe);function Pe(){R("unpipe"),Ge.unpipe(Ie)}return Ie.emit("pipe",Ge),Be.flowing||(R("pipe resume"),Ge.resume()),Ie};function Q(Ie){return function(){var Ge=Ie._readableState;R("pipeOnDrain",Ge.awaitDrain),Ge.awaitDrain&&Ge.awaitDrain--,Ge.awaitDrain===0&&v(Ie,"data")&&(Ge.flowing=!0,we(Ie))}}B.prototype.unpipe=function(Ie){var Le=this._readableState,Ge={hasUnpiped:!1};if(Le.pipesCount===0)return this;if(Le.pipesCount===1)return Ie&&Ie!==Le.pipes?this:(Ie||(Ie=Le.pipes),Le.pipes=null,Le.pipesCount=0,Le.flowing=!1,Ie&&Ie.emit("unpipe",this,Ge),this);if(!Ie){var Be=Le.pipes,We=Le.pipesCount;Le.pipes=null,Le.pipesCount=0,Le.flowing=!1;for(var Ze=0;Ze<We;Ze++)Be[Ze].emit("unpipe",this,{hasUnpiped:!1});return this}var _t=He(Le.pipes,Ie);return _t===-1?this:(Le.pipes.splice(_t,1),Le.pipesCount-=1,Le.pipesCount===1&&(Le.pipes=Le.pipes[0]),Ie.emit("unpipe",this,Ge),this)},B.prototype.on=function(Ie,Le){var Ge=c.prototype.on.call(this,Ie,Le),Be=this._readableState;return Ie==="data"?(Be.readableListening=this.listenerCount("readable")>0,Be.flowing!==!1&&this.resume()):Ie==="readable"&&!Be.endEmitted&&!Be.readableListening&&(Be.readableListening=Be.needReadable=!0,Be.flowing=!1,Be.emittedReadable=!1,R("on readable",Be.length,Be.reading),Be.length?z(this):Be.reading||h.nextTick(_e,this)),Ge},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(Ie,Le){var Ge=c.prototype.removeListener.call(this,Ie,Le);return Ie==="readable"&&h.nextTick(oe,this),Ge},B.prototype.removeAllListeners=function(Ie){var Le=c.prototype.removeAllListeners.apply(this,arguments);return(Ie==="readable"||Ie===void 0)&&h.nextTick(oe,this),Le};function oe(Ie){var Le=Ie._readableState;Le.readableListening=Ie.listenerCount("readable")>0,Le.resumeScheduled&&!Le.paused?Le.flowing=!0:Ie.listenerCount("data")>0&&Ie.resume()}function _e(Ie){R("readable nexttick read 0"),Ie.read(0)}B.prototype.resume=function(){var Ie=this._readableState;return Ie.flowing||(R("resume"),Ie.flowing=!Ie.readableListening,ge(this,Ie)),Ie.paused=!1,this};function ge(Ie,Le){Le.resumeScheduled||(Le.resumeScheduled=!0,h.nextTick(be,Ie,Le))}function be(Ie,Le){R("resume",Le.reading),Le.reading||Ie.read(0),Le.resumeScheduled=!1,Ie.emit("resume"),we(Ie),Le.flowing&&!Le.reading&&Ie.read(0)}B.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function we(Ie){var Le=Ie._readableState;for(R("flow",Le.flowing);Le.flowing&&Ie.read()!==null;);}B.prototype.wrap=function(Ie){var Le=this,Ge=this._readableState,Be=!1;Ie.on("end",function(){if(R("wrapped end"),Ge.decoder&&!Ge.ended){var _t=Ge.decoder.end();_t&&_t.length&&Le.push(_t)}Le.push(null)}),Ie.on("data",function(_t){if(R("wrapped data"),Ge.decoder&&(_t=Ge.decoder.write(_t)),!(Ge.objectMode&&_t==null)&&!(!Ge.objectMode&&(!_t||!_t.length))){var Ft=Le.push(_t);Ft||(Be=!0,Ie.pause())}});for(var We in Ie)this[We]===void 0&&typeof Ie[We]=="function"&&(this[We]=function(Ft){return function(){return Ie[Ft].apply(Ie,arguments)}}(We));for(var Ze=0;Ze<ye.length;Ze++)Ie.on(ye[Ze],this.emit.bind(this,ye[Ze]));return this._read=function(_t){R("wrapped _read",_t),Be&&(Be=!1,Ie.resume())},this},typeof Symbol=="function"&&(B.prototype[Symbol.asyncIterator]=function(){return X===void 0&&(X=_(39536)),X(this)}),Object.defineProperty(B.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(B.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(B.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Le){this._readableState&&(this._readableState.flowing=Le)}}),B._fromList=Ee,Object.defineProperty(B.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Ee(Ie,Le){if(Le.length===0)return null;var Ge;return Le.objectMode?Ge=Le.buffer.shift():!Ie||Ie>=Le.length?(Le.decoder?Ge=Le.buffer.join(""):Le.buffer.length===1?Ge=Le.buffer.first():Ge=Le.buffer.concat(Le.length),Le.buffer.clear()):Ge=Le.buffer.consume(Ie,Le.decoder),Ge}function me(Ie){var Le=Ie._readableState;R("endReadable",Le.endEmitted),Le.endEmitted||(Le.ended=!0,h.nextTick(Ke,Le,Ie))}function Ke(Ie,Le){if(R("endReadableNT",Ie.endEmitted,Ie.length),!Ie.endEmitted&&Ie.length===0&&(Ie.endEmitted=!0,Le.readable=!1,Le.emit("end"),Ie.autoDestroy)){var Ge=Le._writableState;(!Ge||Ge.autoDestroy&&Ge.finished)&&Le.destroy()}}typeof Symbol=="function"&&(B.from=function(Ie,Le){return se===void 0&&(se=_(34918)),se(B,Ie,Le)});function He(Ie,Le){for(var Ge=0,Be=Ie.length;Ge<Be;Ge++)if(Ie[Ge]===Le)return Ge;return-1}},50141:function(ie,f,_){"use strict";ie.exports=m;var h=_(20289).codes,w=h.ERR_METHOD_NOT_IMPLEMENTED,E=h.ERR_MULTIPLE_CALLBACK,v=h.ERR_TRANSFORM_ALREADY_TRANSFORMING,c=h.ERR_TRANSFORM_WITH_LENGTH_0,d=_(35707);_(91193)(m,d);function p(R,S){var O=this._transformState;O.transforming=!1;var M=O.writecb;if(M===null)return this.emit("error",new E);O.writechunk=null,O.writecb=null,S!=null&&this.push(S),M(R);var k=this._readableState;k.reading=!1,(k.needReadable||k.length<k.highWaterMark)&&this._read(k.highWaterMark)}function m(R){if(!(this instanceof m))return new m(R);d.call(this,R),this._transformState={afterTransform:p.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,R&&(typeof R.transform=="function"&&(this._transform=R.transform),typeof R.flush=="function"&&(this._flush=R.flush)),this.on("prefinish",C)}function C(){var R=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(S,O){x(R,S,O)}):x(this,null,null)}m.prototype.push=function(R,S){return this._transformState.needTransform=!1,d.prototype.push.call(this,R,S)},m.prototype._transform=function(R,S,O){O(new w("_transform()"))},m.prototype._write=function(R,S,O){var M=this._transformState;if(M.writecb=O,M.writechunk=R,M.writeencoding=S,!M.transforming){var k=this._readableState;(M.needTransform||k.needReadable||k.length<k.highWaterMark)&&this._read(k.highWaterMark)}},m.prototype._read=function(R){var S=this._transformState;S.writechunk!==null&&!S.transforming?(S.transforming=!0,this._transform(S.writechunk,S.writeencoding,S.afterTransform)):S.needTransform=!0},m.prototype._destroy=function(R,S){d.prototype._destroy.call(this,R,function(O){S(O)})};function x(R,S,O){if(S)return R.emit("error",S);if(O!=null&&R.push(O),R._writableState.length)throw new c;if(R._transformState.transforming)throw new v;return R.push(null)}},92553:function(ie,f,_){"use strict";var h=_(85409);ie.exports=K;function w(we,Ee,me){this.chunk=we,this.encoding=Ee,this.callback=me,this.next=null}function E(we){var Ee=this;this.next=null,this.entry=null,this.finish=function(){be(Ee,we)}}var v;K.WritableState=ye;var c={deprecate:_(91947)},d=_(82534),p=_(36533).Buffer,m=(typeof _.g<"u"?_.g:typeof self<"u"?self:{}).Uint8Array||function(){};function C(we){return p.from(we)}function x(we){return p.isBuffer(we)||we instanceof m}var R=_(50917),S=_(65750),O=S.getHighWaterMark,M=_(20289).codes,k=M.ERR_INVALID_ARG_TYPE,q=M.ERR_METHOD_NOT_IMPLEMENTED,b=M.ERR_MULTIPLE_CALLBACK,F=M.ERR_STREAM_CANNOT_PIPE,G=M.ERR_STREAM_DESTROYED,ue=M.ERR_STREAM_NULL_VALUES,le=M.ERR_STREAM_WRITE_AFTER_END,X=M.ERR_UNKNOWN_ENCODING,se=R.errorOrDestroy;_(91193)(K,d);function de(){}function ye(we,Ee,me){v=v||_(35707),we=we||{},typeof me!="boolean"&&(me=Ee instanceof v),this.objectMode=!!we.objectMode,me&&(this.objectMode=this.objectMode||!!we.writableObjectMode),this.highWaterMark=O(this,we,"writableHighWaterMark",me),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Ke=we.decodeStrings===!1;this.decodeStrings=!Ke,this.defaultEncoding=we.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(He){Z(Ee,He)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=we.emitClose!==!1,this.autoDestroy=!!we.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new E(this)}ye.prototype.getBuffer=function(){for(var Ee=this.bufferedRequest,me=[];Ee;)me.push(Ee),Ee=Ee.next;return me},function(){try{Object.defineProperty(ye.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var he;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(he=Function.prototype[Symbol.hasInstance],Object.defineProperty(K,Symbol.hasInstance,{value:function(Ee){return he.call(this,Ee)?!0:this!==K?!1:Ee&&Ee._writableState instanceof ye}})):he=function(Ee){return Ee instanceof this};function K(we){v=v||_(35707);var Ee=this instanceof v;if(!Ee&&!he.call(K,this))return new K(we);this._writableState=new ye(we,this,Ee),this.writable=!0,we&&(typeof we.write=="function"&&(this._write=we.write),typeof we.writev=="function"&&(this._writev=we.writev),typeof we.destroy=="function"&&(this._destroy=we.destroy),typeof we.final=="function"&&(this._final=we.final)),d.call(this)}K.prototype.pipe=function(){se(this,new F)};function B(we,Ee){var me=new le;se(we,me),h.nextTick(Ee,me)}function L(we,Ee,me,Ke){var He;return me===null?He=new ue:typeof me!="string"&&!Ee.objectMode&&(He=new k("chunk",["string","Buffer"],me)),He?(se(we,He),h.nextTick(Ke,He),!1):!0}K.prototype.write=function(we,Ee,me){var Ke=this._writableState,He=!1,Ie=!Ke.objectMode&&x(we);return Ie&&!p.isBuffer(we)&&(we=C(we)),typeof Ee=="function"&&(me=Ee,Ee=null),Ie?Ee="buffer":Ee||(Ee=Ke.defaultEncoding),typeof me!="function"&&(me=de),Ke.ending?B(this,me):(Ie||L(this,Ke,we,me))&&(Ke.pendingcb++,He=T(this,Ke,Ie,we,Ee,me)),He},K.prototype.cork=function(){this._writableState.corked++},K.prototype.uncork=function(){var we=this._writableState;we.corked&&(we.corked--,!we.writing&&!we.corked&&!we.bufferProcessing&&we.bufferedRequest&&te(this,we))},K.prototype.setDefaultEncoding=function(Ee){if(typeof Ee=="string"&&(Ee=Ee.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ee+"").toLowerCase())>-1))throw new X(Ee);return this._writableState.defaultEncoding=Ee,this},Object.defineProperty(K.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $(we,Ee,me){return!we.objectMode&&we.decodeStrings!==!1&&typeof Ee=="string"&&(Ee=p.from(Ee,me)),Ee}Object.defineProperty(K.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function T(we,Ee,me,Ke,He,Ie){if(!me){var Le=$(Ee,Ke,He);Ke!==Le&&(me=!0,He="buffer",Ke=Le)}var Ge=Ee.objectMode?1:Ke.length;Ee.length+=Ge;var Be=Ee.length<Ee.highWaterMark;if(Be||(Ee.needDrain=!0),Ee.writing||Ee.corked){var We=Ee.lastBufferedRequest;Ee.lastBufferedRequest={chunk:Ke,encoding:He,isBuf:me,callback:Ie,next:null},We?We.next=Ee.lastBufferedRequest:Ee.bufferedRequest=Ee.lastBufferedRequest,Ee.bufferedRequestCount+=1}else N(we,Ee,!1,Ge,Ke,He,Ie);return Be}function N(we,Ee,me,Ke,He,Ie,Le){Ee.writelen=Ke,Ee.writecb=Le,Ee.writing=!0,Ee.sync=!0,Ee.destroyed?Ee.onwrite(new G("write")):me?we._writev(He,Ee.onwrite):we._write(He,Ie,Ee.onwrite),Ee.sync=!1}function j(we,Ee,me,Ke,He){--Ee.pendingcb,me?(h.nextTick(He,Ke),h.nextTick(_e,we,Ee),we._writableState.errorEmitted=!0,se(we,Ke)):(He(Ke),we._writableState.errorEmitted=!0,se(we,Ke),_e(we,Ee))}function Y(we){we.writing=!1,we.writecb=null,we.length-=we.writelen,we.writelen=0}function Z(we,Ee){var me=we._writableState,Ke=me.sync,He=me.writecb;if(typeof He!="function")throw new b;if(Y(me),Ee)j(we,me,Ke,Ee,He);else{var Ie=H(me)||we.destroyed;!Ie&&!me.corked&&!me.bufferProcessing&&me.bufferedRequest&&te(we,me),Ke?h.nextTick(z,we,me,Ie,He):z(we,me,Ie,He)}}function z(we,Ee,me,Ke){me||fe(we,Ee),Ee.pendingcb--,Ke(),_e(we,Ee)}function fe(we,Ee){Ee.length===0&&Ee.needDrain&&(Ee.needDrain=!1,we.emit("drain"))}function te(we,Ee){Ee.bufferProcessing=!0;var me=Ee.bufferedRequest;if(we._writev&&me&&me.next){var Ke=Ee.bufferedRequestCount,He=new Array(Ke),Ie=Ee.corkedRequestsFree;Ie.entry=me;for(var Le=0,Ge=!0;me;)He[Le]=me,me.isBuf||(Ge=!1),me=me.next,Le+=1;He.allBuffers=Ge,N(we,Ee,!0,Ee.length,He,"",Ie.finish),Ee.pendingcb++,Ee.lastBufferedRequest=null,Ie.next?(Ee.corkedRequestsFree=Ie.next,Ie.next=null):Ee.corkedRequestsFree=new E(Ee),Ee.bufferedRequestCount=0}else{for(;me;){var Be=me.chunk,We=me.encoding,Ze=me.callback,_t=Ee.objectMode?1:Be.length;if(N(we,Ee,!1,_t,Be,We,Ze),me=me.next,Ee.bufferedRequestCount--,Ee.writing)break}me===null&&(Ee.lastBufferedRequest=null)}Ee.bufferedRequest=me,Ee.bufferProcessing=!1}K.prototype._write=function(we,Ee,me){me(new q("_write()"))},K.prototype._writev=null,K.prototype.end=function(we,Ee,me){var Ke=this._writableState;return typeof we=="function"?(me=we,we=null,Ee=null):typeof Ee=="function"&&(me=Ee,Ee=null),we!=null&&this.write(we,Ee),Ke.corked&&(Ke.corked=1,this.uncork()),Ke.ending||ge(this,Ke,me),this},Object.defineProperty(K.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function H(we){return we.ending&&we.length===0&&we.bufferedRequest===null&&!we.finished&&!we.writing}function Q(we,Ee){we._final(function(me){Ee.pendingcb--,me&&se(we,me),Ee.prefinished=!0,we.emit("prefinish"),_e(we,Ee)})}function oe(we,Ee){!Ee.prefinished&&!Ee.finalCalled&&(typeof we._final=="function"&&!Ee.destroyed?(Ee.pendingcb++,Ee.finalCalled=!0,h.nextTick(Q,we,Ee)):(Ee.prefinished=!0,we.emit("prefinish")))}function _e(we,Ee){var me=H(Ee);if(me&&(oe(we,Ee),Ee.pendingcb===0&&(Ee.finished=!0,we.emit("finish"),Ee.autoDestroy))){var Ke=we._readableState;(!Ke||Ke.autoDestroy&&Ke.endEmitted)&&we.destroy()}return me}function ge(we,Ee,me){Ee.ending=!0,_e(we,Ee),me&&(Ee.finished?h.nextTick(me):we.once("finish",me)),Ee.ended=!0,we.writable=!1}function be(we,Ee,me){var Ke=we.entry;for(we.entry=null;Ke;){var He=Ke.callback;Ee.pendingcb--,He(me),Ke=Ke.next}Ee.corkedRequestsFree.next=we}Object.defineProperty(K.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Ee){this._writableState&&(this._writableState.destroyed=Ee)}}),K.prototype.destroy=R.destroy,K.prototype._undestroy=R.undestroy,K.prototype._destroy=function(we,Ee){Ee(we)}},39536:function(ie,f,_){"use strict";var h=_(85409),w;function E(le,X,se){return X=v(X),X in le?Object.defineProperty(le,X,{value:se,enumerable:!0,configurable:!0,writable:!0}):le[X]=se,le}function v(le){var X=c(le,"string");return typeof X=="symbol"?X:String(X)}function c(le,X){if(typeof le!="object"||le===null)return le;var se=le[Symbol.toPrimitive];if(se!==void 0){var de=se.call(le,X||"default");if(typeof de!="object")return de;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(le)}var d=_(32339),p=Symbol("lastResolve"),m=Symbol("lastReject"),C=Symbol("error"),x=Symbol("ended"),R=Symbol("lastPromise"),S=Symbol("handlePromise"),O=Symbol("stream");function M(le,X){return{value:le,done:X}}function k(le){var X=le[p];if(X!==null){var se=le[O].read();se!==null&&(le[R]=null,le[p]=null,le[m]=null,X(M(se,!1)))}}function q(le){h.nextTick(k,le)}function b(le,X){return function(se,de){le.then(function(){if(X[x]){se(M(void 0,!0));return}X[S](se,de)},de)}}var F=Object.getPrototypeOf(function(){}),G=Object.setPrototypeOf((w={get stream(){return this[O]},next:function(){var X=this,se=this[C];if(se!==null)return Promise.reject(se);if(this[x])return Promise.resolve(M(void 0,!0));if(this[O].destroyed)return new Promise(function(K,B){h.nextTick(function(){X[C]?B(X[C]):K(M(void 0,!0))})});var de=this[R],ye;if(de)ye=new Promise(b(de,this));else{var he=this[O].read();if(he!==null)return Promise.resolve(M(he,!1));ye=new Promise(this[S])}return this[R]=ye,ye}},E(w,Symbol.asyncIterator,function(){return this}),E(w,"return",function(){var X=this;return new Promise(function(se,de){X[O].destroy(null,function(ye){if(ye){de(ye);return}se(M(void 0,!0))})})}),w),F),ue=function(X){var se,de=Object.create(G,(se={},E(se,O,{value:X,writable:!0}),E(se,p,{value:null,writable:!0}),E(se,m,{value:null,writable:!0}),E(se,C,{value:null,writable:!0}),E(se,x,{value:X._readableState.endEmitted,writable:!0}),E(se,S,{value:function(he,K){var B=de[O].read();B?(de[R]=null,de[p]=null,de[m]=null,he(M(B,!1))):(de[p]=he,de[m]=K)},writable:!0}),se));return de[R]=null,d(X,function(ye){if(ye&&ye.code!=="ERR_STREAM_PREMATURE_CLOSE"){var he=de[m];he!==null&&(de[R]=null,de[p]=null,de[m]=null,he(ye)),de[C]=ye;return}var K=de[p];K!==null&&(de[R]=null,de[p]=null,de[m]=null,K(M(void 0,!0))),de[x]=!0}),X.on("readable",q.bind(null,de)),de};ie.exports=ue},70020:function(ie,f,_){"use strict";function h(k,q){var b=Object.keys(k);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(k);q&&(F=F.filter(function(G){return Object.getOwnPropertyDescriptor(k,G).enumerable})),b.push.apply(b,F)}return b}function w(k){for(var q=1;q<arguments.length;q++){var b=arguments[q]!=null?arguments[q]:{};q%2?h(Object(b),!0).forEach(function(F){E(k,F,b[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(b)):h(Object(b)).forEach(function(F){Object.defineProperty(k,F,Object.getOwnPropertyDescriptor(b,F))})}return k}function E(k,q,b){return q=p(q),q in k?Object.defineProperty(k,q,{value:b,enumerable:!0,configurable:!0,writable:!0}):k[q]=b,k}function v(k,q){if(!(k instanceof q))throw new TypeError("Cannot call a class as a function")}function c(k,q){for(var b=0;b<q.length;b++){var F=q[b];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(k,p(F.key),F)}}function d(k,q,b){return q&&c(k.prototype,q),b&&c(k,b),Object.defineProperty(k,"prototype",{writable:!1}),k}function p(k){var q=m(k,"string");return typeof q=="symbol"?q:String(q)}function m(k,q){if(typeof k!="object"||k===null)return k;var b=k[Symbol.toPrimitive];if(b!==void 0){var F=b.call(k,q||"default");if(typeof F!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return(q==="string"?String:Number)(k)}var C=_(36533),x=C.Buffer,R=_(20352),S=R.inspect,O=S&&S.custom||"inspect";function M(k,q,b){x.prototype.copy.call(k,q,b)}ie.exports=function(){function k(){v(this,k),this.head=null,this.tail=null,this.length=0}return d(k,[{key:"push",value:function(b){var F={data:b,next:null};this.length>0?this.tail.next=F:this.head=F,this.tail=F,++this.length}},{key:"unshift",value:function(b){var F={data:b,next:this.head};this.length===0&&(this.tail=F),this.head=F,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var F=this.head,G=""+F.data;F=F.next;)G+=b+F.data;return G}},{key:"concat",value:function(b){if(this.length===0)return x.alloc(0);for(var F=x.allocUnsafe(b>>>0),G=this.head,ue=0;G;)M(G.data,F,ue),ue+=G.data.length,G=G.next;return F}},{key:"consume",value:function(b,F){var G;return b<this.head.data.length?(G=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):b===this.head.data.length?G=this.shift():G=F?this._getString(b):this._getBuffer(b),G}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var F=this.head,G=1,ue=F.data;for(b-=ue.length;F=F.next;){var le=F.data,X=b>le.length?le.length:b;if(X===le.length?ue+=le:ue+=le.slice(0,b),b-=X,b===0){X===le.length?(++G,F.next?this.head=F.next:this.head=this.tail=null):(this.head=F,F.data=le.slice(X));break}++G}return this.length-=G,ue}},{key:"_getBuffer",value:function(b){var F=x.allocUnsafe(b),G=this.head,ue=1;for(G.data.copy(F),b-=G.data.length;G=G.next;){var le=G.data,X=b>le.length?le.length:b;if(le.copy(F,F.length-b,0,X),b-=X,b===0){X===le.length?(++ue,G.next?this.head=G.next:this.head=this.tail=null):(this.head=G,G.data=le.slice(X));break}++ue}return this.length-=ue,F}},{key:O,value:function(b,F){return S(this,w(w({},F),{},{depth:0,customInspect:!1}))}}]),k}()},50917:function(ie,f,_){"use strict";var h=_(85409);function w(m,C){var x=this,R=this._readableState&&this._readableState.destroyed,S=this._writableState&&this._writableState.destroyed;return R||S?(C?C(m):m&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,h.nextTick(d,this,m)):h.nextTick(d,this,m)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(m||null,function(O){!C&&O?x._writableState?x._writableState.errorEmitted?h.nextTick(v,x):(x._writableState.errorEmitted=!0,h.nextTick(E,x,O)):h.nextTick(E,x,O):C?(h.nextTick(v,x),C(O)):h.nextTick(v,x)}),this)}function E(m,C){d(m,C),v(m)}function v(m){m._writableState&&!m._writableState.emitClose||m._readableState&&!m._readableState.emitClose||m.emit("close")}function c(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function d(m,C){m.emit("error",C)}function p(m,C){var x=m._readableState,R=m._writableState;x&&x.autoDestroy||R&&R.autoDestroy?m.destroy(C):m.emit("error",C)}ie.exports={destroy:w,undestroy:c,errorOrDestroy:p}},32339:function(ie,f,_){"use strict";var h=_(20289).codes.ERR_STREAM_PREMATURE_CLOSE;function w(d){var p=!1;return function(){if(!p){p=!0;for(var m=arguments.length,C=new Array(m),x=0;x<m;x++)C[x]=arguments[x];d.apply(this,C)}}}function E(){}function v(d){return d.setHeader&&typeof d.abort=="function"}function c(d,p,m){if(typeof p=="function")return c(d,null,p);p||(p={}),m=w(m||E);var C=p.readable||p.readable!==!1&&d.readable,x=p.writable||p.writable!==!1&&d.writable,R=function(){d.writable||O()},S=d._writableState&&d._writableState.finished,O=function(){x=!1,S=!0,C||m.call(d)},M=d._readableState&&d._readableState.endEmitted,k=function(){C=!1,M=!0,x||m.call(d)},q=function(ue){m.call(d,ue)},b=function(){var ue;if(C&&!M)return(!d._readableState||!d._readableState.ended)&&(ue=new h),m.call(d,ue);if(x&&!S)return(!d._writableState||!d._writableState.ended)&&(ue=new h),m.call(d,ue)},F=function(){d.req.on("finish",O)};return v(d)?(d.on("complete",O),d.on("abort",b),d.req?F():d.on("request",F)):x&&!d._writableState&&(d.on("end",R),d.on("close",R)),d.on("end",k),d.on("finish",O),p.error!==!1&&d.on("error",q),d.on("close",b),function(){d.removeListener("complete",O),d.removeListener("abort",b),d.removeListener("request",F),d.req&&d.req.removeListener("finish",O),d.removeListener("end",R),d.removeListener("close",R),d.removeListener("finish",O),d.removeListener("end",k),d.removeListener("error",q),d.removeListener("close",b)}}ie.exports=c},34918:function(ie){ie.exports=function(){throw new Error("Readable.from is not available in the browser")}},35481:function(ie,f,_){"use strict";var h;function w(O){var M=!1;return function(){M||(M=!0,O.apply(void 0,arguments))}}var E=_(20289).codes,v=E.ERR_MISSING_ARGS,c=E.ERR_STREAM_DESTROYED;function d(O){if(O)throw O}function p(O){return O.setHeader&&typeof O.abort=="function"}function m(O,M,k,q){q=w(q);var b=!1;O.on("close",function(){b=!0}),h===void 0&&(h=_(32339)),h(O,{readable:M,writable:k},function(G){if(G)return q(G);b=!0,q()});var F=!1;return function(G){if(!b&&!F){if(F=!0,p(O))return O.abort();if(typeof O.destroy=="function")return O.destroy();q(G||new c("pipe"))}}}function C(O){O()}function x(O,M){return O.pipe(M)}function R(O){return!O.length||typeof O[O.length-1]!="function"?d:O.pop()}function S(){for(var O=arguments.length,M=new Array(O),k=0;k<O;k++)M[k]=arguments[k];var q=R(M);if(Array.isArray(M[0])&&(M=M[0]),M.length<2)throw new v("streams");var b,F=M.map(function(G,ue){var le=ue<M.length-1,X=ue>0;return m(G,le,X,function(se){b||(b=se),se&&F.forEach(C),!le&&(F.forEach(C),q(b))})});return M.reduce(x)}ie.exports=S},65750:function(ie,f,_){"use strict";var h=_(20289).codes.ERR_INVALID_OPT_VALUE;function w(v,c,d){return v.highWaterMark!=null?v.highWaterMark:c?v[d]:null}function E(v,c,d,p){var m=w(c,p,d);if(m!=null){if(!(isFinite(m)&&Math.floor(m)===m)||m<0){var C=p?d:"highWaterMark";throw new h(C,m)}return Math.floor(m)}return v.objectMode?16:16384}ie.exports={getHighWaterMark:E}},82534:function(ie,f,_){ie.exports=_(80381).EventEmitter},39212:function(ie){var f=function(_){"use strict";var h=Object.prototype,w=h.hasOwnProperty,E=Object.defineProperty||function(j,Y,Z){j[Y]=Z.value},v,c=typeof Symbol=="function"?Symbol:{},d=c.iterator||"@@iterator",p=c.asyncIterator||"@@asyncIterator",m=c.toStringTag||"@@toStringTag";function C(j,Y,Z){return Object.defineProperty(j,Y,{value:Z,enumerable:!0,configurable:!0,writable:!0}),j[Y]}try{C({},"")}catch{C=function(Y,Z,z){return Y[Z]=z}}function x(j,Y,Z,z){var fe=Y&&Y.prototype instanceof b?Y:b,te=Object.create(fe.prototype),H=new $(z||[]);return E(te,"_invoke",{value:he(j,Z,H)}),te}_.wrap=x;function R(j,Y,Z){try{return{type:"normal",arg:j.call(Y,Z)}}catch(z){return{type:"throw",arg:z}}}var S="suspendedStart",O="suspendedYield",M="executing",k="completed",q={};function b(){}function F(){}function G(){}var ue={};C(ue,d,function(){return this});var le=Object.getPrototypeOf,X=le&&le(le(T([])));X&&X!==h&&w.call(X,d)&&(ue=X);var se=G.prototype=b.prototype=Object.create(ue);F.prototype=G,E(se,"constructor",{value:G,configurable:!0}),E(G,"constructor",{value:F,configurable:!0}),F.displayName=C(G,m,"GeneratorFunction");function de(j){["next","throw","return"].forEach(function(Y){C(j,Y,function(Z){return this._invoke(Y,Z)})})}_.isGeneratorFunction=function(j){var Y=typeof j=="function"&&j.constructor;return Y?Y===F||(Y.displayName||Y.name)==="GeneratorFunction":!1},_.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,G):(j.__proto__=G,C(j,m,"GeneratorFunction")),j.prototype=Object.create(se),j},_.awrap=function(j){return{__await:j}};function ye(j,Y){function Z(te,H,Q,oe){var _e=R(j[te],j,H);if(_e.type==="throw")oe(_e.arg);else{var ge=_e.arg,be=ge.value;return be&&typeof be=="object"&&w.call(be,"__await")?Y.resolve(be.__await).then(function(we){Z("next",we,Q,oe)},function(we){Z("throw",we,Q,oe)}):Y.resolve(be).then(function(we){ge.value=we,Q(ge)},function(we){return Z("throw",we,Q,oe)})}}var z;function fe(te,H){function Q(){return new Y(function(oe,_e){Z(te,H,oe,_e)})}return z=z?z.then(Q,Q):Q()}E(this,"_invoke",{value:fe})}de(ye.prototype),C(ye.prototype,p,function(){return this}),_.AsyncIterator=ye,_.async=function(j,Y,Z,z,fe){fe===void 0&&(fe=Promise);var te=new ye(x(j,Y,Z,z),fe);return _.isGeneratorFunction(Y)?te:te.next().then(function(H){return H.done?H.value:te.next()})};function he(j,Y,Z){var z=S;return function(te,H){if(z===M)throw new Error("Generator is already running");if(z===k){if(te==="throw")throw H;return N()}for(Z.method=te,Z.arg=H;;){var Q=Z.delegate;if(Q){var oe=K(Q,Z);if(oe){if(oe===q)continue;return oe}}if(Z.method==="next")Z.sent=Z._sent=Z.arg;else if(Z.method==="throw"){if(z===S)throw z=k,Z.arg;Z.dispatchException(Z.arg)}else Z.method==="return"&&Z.abrupt("return",Z.arg);z=M;var _e=R(j,Y,Z);if(_e.type==="normal"){if(z=Z.done?k:O,_e.arg===q)continue;return{value:_e.arg,done:Z.done}}else _e.type==="throw"&&(z=k,Z.method="throw",Z.arg=_e.arg)}}}function K(j,Y){var Z=Y.method,z=j.iterator[Z];if(z===v)return Y.delegate=null,Z==="throw"&&j.iterator.return&&(Y.method="return",Y.arg=v,K(j,Y),Y.method==="throw")||Z!=="return"&&(Y.method="throw",Y.arg=new TypeError("The iterator does not provide a '"+Z+"' method")),q;var fe=R(z,j.iterator,Y.arg);if(fe.type==="throw")return Y.method="throw",Y.arg=fe.arg,Y.delegate=null,q;var te=fe.arg;if(!te)return Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,q;if(te.done)Y[j.resultName]=te.value,Y.next=j.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=v);else return te;return Y.delegate=null,q}de(se),C(se,m,"Generator"),C(se,d,function(){return this}),C(se,"toString",function(){return"[object Generator]"});function B(j){var Y={tryLoc:j[0]};1 in j&&(Y.catchLoc=j[1]),2 in j&&(Y.finallyLoc=j[2],Y.afterLoc=j[3]),this.tryEntries.push(Y)}function L(j){var Y=j.completion||{};Y.type="normal",delete Y.arg,j.completion=Y}function $(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(B,this),this.reset(!0)}_.keys=function(j){var Y=Object(j),Z=[];for(var z in Y)Z.push(z);return Z.reverse(),function fe(){for(;Z.length;){var te=Z.pop();if(te in Y)return fe.value=te,fe.done=!1,fe}return fe.done=!0,fe}};function T(j){if(j!=null){var Y=j[d];if(Y)return Y.call(j);if(typeof j.next=="function")return j;if(!isNaN(j.length)){var Z=-1,z=function fe(){for(;++Z<j.length;)if(w.call(j,Z))return fe.value=j[Z],fe.done=!1,fe;return fe.value=v,fe.done=!0,fe};return z.next=z}}throw new TypeError(typeof j+" is not iterable")}_.values=T;function N(){return{value:v,done:!0}}return $.prototype={constructor:$,reset:function(j){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(L),!j)for(var Y in this)Y.charAt(0)==="t"&&w.call(this,Y)&&!isNaN(+Y.slice(1))&&(this[Y]=v)},stop:function(){this.done=!0;var j=this.tryEntries[0],Y=j.completion;if(Y.type==="throw")throw Y.arg;return this.rval},dispatchException:function(j){if(this.done)throw j;var Y=this;function Z(oe,_e){return te.type="throw",te.arg=j,Y.next=oe,_e&&(Y.method="next",Y.arg=v),!!_e}for(var z=this.tryEntries.length-1;z>=0;--z){var fe=this.tryEntries[z],te=fe.completion;if(fe.tryLoc==="root")return Z("end");if(fe.tryLoc<=this.prev){var H=w.call(fe,"catchLoc"),Q=w.call(fe,"finallyLoc");if(H&&Q){if(this.prev<fe.catchLoc)return Z(fe.catchLoc,!0);if(this.prev<fe.finallyLoc)return Z(fe.finallyLoc)}else if(H){if(this.prev<fe.catchLoc)return Z(fe.catchLoc,!0)}else if(Q){if(this.prev<fe.finallyLoc)return Z(fe.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(j,Y){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var z=this.tryEntries[Z];if(z.tryLoc<=this.prev&&w.call(z,"finallyLoc")&&this.prev<z.finallyLoc){var fe=z;break}}fe&&(j==="break"||j==="continue")&&fe.tryLoc<=Y&&Y<=fe.finallyLoc&&(fe=null);var te=fe?fe.completion:{};return te.type=j,te.arg=Y,fe?(this.method="next",this.next=fe.finallyLoc,q):this.complete(te)},complete:function(j,Y){if(j.type==="throw")throw j.arg;return j.type==="break"||j.type==="continue"?this.next=j.arg:j.type==="return"?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):j.type==="normal"&&Y&&(this.next=Y),q},finish:function(j){for(var Y=this.tryEntries.length-1;Y>=0;--Y){var Z=this.tryEntries[Y];if(Z.finallyLoc===j)return this.complete(Z.completion,Z.afterLoc),L(Z),q}},catch:function(j){for(var Y=this.tryEntries.length-1;Y>=0;--Y){var Z=this.tryEntries[Y];if(Z.tryLoc===j){var z=Z.completion;if(z.type==="throw"){var fe=z.arg;L(Z)}return fe}}throw new Error("illegal catch attempt")},delegateYield:function(j,Y,Z){return this.delegate={iterator:T(j),resultName:Y,nextLoc:Z},this.method==="next"&&(this.arg=v),q}},_}(ie.exports);try{regeneratorRuntime=f}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=f:Function("r","regeneratorRuntime = r")(f)}},56608:function(ie,f,_){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var h=_(36533),w=h.Buffer;function E(c,d){for(var p in c)d[p]=c[p]}w.from&&w.alloc&&w.allocUnsafe&&w.allocUnsafeSlow?ie.exports=h:(E(h,f),f.Buffer=v);function v(c,d,p){return w(c,d,p)}v.prototype=Object.create(w.prototype),E(w,v),v.from=function(c,d,p){if(typeof c=="number")throw new TypeError("Argument must not be a number");return w(c,d,p)},v.alloc=function(c,d,p){if(typeof c!="number")throw new TypeError("Argument must be a number");var m=w(c);return d!==void 0?typeof p=="string"?m.fill(d,p):m.fill(d):m.fill(0),m},v.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return w(c)},v.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return h.SlowBuffer(c)}},43282:function(ie,f,_){"use strict";var h=_(98801),w=_(10092),E=h("RegExp.prototype.exec"),v=_(71102);ie.exports=function(d){if(!w(d))throw new v("`regex` must be a RegExp");return function(m){return E(d,m)!==null}}},67636:function(ie,f,_){const h=Symbol("SemVer ANY");class w{static get ANY(){return h}constructor(R,S){if(S=E(S),R instanceof w){if(R.loose===!!S.loose)return R;R=R.value}R=R.trim().split(/\s+/).join(" "),p("comparator",R,S),this.options=S,this.loose=!!S.loose,this.parse(R),this.semver===h?this.value="":this.value=this.operator+this.semver.version,p("comp",this)}parse(R){const S=this.options.loose?v[c.COMPARATORLOOSE]:v[c.COMPARATOR],O=R.match(S);if(!O)throw new TypeError(`Invalid comparator: ${R}`);this.operator=O[1]!==void 0?O[1]:"",this.operator==="="&&(this.operator=""),O[2]?this.semver=new m(O[2],this.options.loose):this.semver=h}toString(){return this.value}test(R){if(p("Comparator.test",R,this.options.loose),this.semver===h||R===h)return!0;if(typeof R=="string")try{R=new m(R,this.options)}catch{return!1}return d(R,this.operator,this.semver,this.options)}intersects(R,S){if(!(R instanceof w))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new C(R.value,S).test(this.value):R.operator===""?R.value===""?!0:new C(this.value,S).test(R.semver):(S=E(S),S.includePrerelease&&(this.value==="<0.0.0-0"||R.value==="<0.0.0-0")||!S.includePrerelease&&(this.value.startsWith("<0.0.0")||R.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&R.operator.startsWith(">")||this.operator.startsWith("<")&&R.operator.startsWith("<")||this.semver.version===R.semver.version&&this.operator.includes("=")&&R.operator.includes("=")||d(this.semver,"<",R.semver,S)&&this.operator.startsWith(">")&&R.operator.startsWith("<")||d(this.semver,">",R.semver,S)&&this.operator.startsWith("<")&&R.operator.startsWith(">")))}}ie.exports=w;const E=_(90327),{safeRe:v,t:c}=_(60722),d=_(72947),p=_(18244),m=_(6280),C=_(23643)},23643:function(ie,f,_){const h=/\s+/g;class w{constructor(N,j){if(j=c(j),N instanceof w)return N.loose===!!j.loose&&N.includePrerelease===!!j.includePrerelease?N:new w(N.raw,j);if(N instanceof d)return this.raw=N.value,this.set=[[N]],this.formatted=void 0,this;if(this.options=j,this.loose=!!j.loose,this.includePrerelease=!!j.includePrerelease,this.raw=N.trim().replace(h," "),this.set=this.raw.split("||").map(Y=>this.parseRange(Y.trim())).filter(Y=>Y.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const Y=this.set[0];if(this.set=this.set.filter(Z=>!q(Z[0])),this.set.length===0)this.set=[Y];else if(this.set.length>1){for(const Z of this.set)if(Z.length===1&&b(Z[0])){this.set=[Z];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let N=0;N<this.set.length;N++){N>0&&(this.formatted+="||");const j=this.set[N];for(let Y=0;Y<j.length;Y++)Y>0&&(this.formatted+=" "),this.formatted+=j[Y].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(N){const Y=((this.options.includePrerelease&&M)|(this.options.loose&&k))+":"+N,Z=v.get(Y);if(Z)return Z;const z=this.options.loose,fe=z?C[x.HYPHENRANGELOOSE]:C[x.HYPHENRANGE];N=N.replace(fe,L(this.options.includePrerelease)),p("hyphen replace",N),N=N.replace(C[x.COMPARATORTRIM],R),p("comparator trim",N),N=N.replace(C[x.TILDETRIM],S),p("tilde trim",N),N=N.replace(C[x.CARETTRIM],O),p("caret trim",N);let te=N.split(" ").map(_e=>G(_e,this.options)).join(" ").split(/\s+/).map(_e=>B(_e,this.options));z&&(te=te.filter(_e=>(p("loose invalid filter",_e,this.options),!!_e.match(C[x.COMPARATORLOOSE])))),p("range list",te);const H=new Map,Q=te.map(_e=>new d(_e,this.options));for(const _e of Q){if(q(_e))return[_e];H.set(_e.value,_e)}H.size>1&&H.has("")&&H.delete("");const oe=[...H.values()];return v.set(Y,oe),oe}intersects(N,j){if(!(N instanceof w))throw new TypeError("a Range is required");return this.set.some(Y=>F(Y,j)&&N.set.some(Z=>F(Z,j)&&Y.every(z=>Z.every(fe=>z.intersects(fe,j)))))}test(N){if(!N)return!1;if(typeof N=="string")try{N=new m(N,this.options)}catch{return!1}for(let j=0;j<this.set.length;j++)if($(this.set[j],N,this.options))return!0;return!1}}ie.exports=w;const E=_(53158),v=new E,c=_(90327),d=_(67636),p=_(18244),m=_(6280),{safeRe:C,t:x,comparatorTrimReplace:R,tildeTrimReplace:S,caretTrimReplace:O}=_(60722),{FLAG_INCLUDE_PRERELEASE:M,FLAG_LOOSE:k}=_(97374),q=T=>T.value==="<0.0.0-0",b=T=>T.value==="",F=(T,N)=>{let j=!0;const Y=T.slice();let Z=Y.pop();for(;j&&Y.length;)j=Y.every(z=>Z.intersects(z,N)),Z=Y.pop();return j},G=(T,N)=>(p("comp",T,N),T=se(T,N),p("caret",T),T=le(T,N),p("tildes",T),T=ye(T,N),p("xrange",T),T=K(T,N),p("stars",T),T),ue=T=>!T||T.toLowerCase()==="x"||T==="*",le=(T,N)=>T.trim().split(/\s+/).map(j=>X(j,N)).join(" "),X=(T,N)=>{const j=N.loose?C[x.TILDELOOSE]:C[x.TILDE];return T.replace(j,(Y,Z,z,fe,te)=>{p("tilde",T,Y,Z,z,fe,te);let H;return ue(Z)?H="":ue(z)?H=`>=${Z}.0.0 <${+Z+1}.0.0-0`:ue(fe)?H=`>=${Z}.${z}.0 <${Z}.${+z+1}.0-0`:te?(p("replaceTilde pr",te),H=`>=${Z}.${z}.${fe}-${te} <${Z}.${+z+1}.0-0`):H=`>=${Z}.${z}.${fe} <${Z}.${+z+1}.0-0`,p("tilde return",H),H})},se=(T,N)=>T.trim().split(/\s+/).map(j=>de(j,N)).join(" "),de=(T,N)=>{p("caret",T,N);const j=N.loose?C[x.CARETLOOSE]:C[x.CARET],Y=N.includePrerelease?"-0":"";return T.replace(j,(Z,z,fe,te,H)=>{p("caret",T,Z,z,fe,te,H);let Q;return ue(z)?Q="":ue(fe)?Q=`>=${z}.0.0${Y} <${+z+1}.0.0-0`:ue(te)?z==="0"?Q=`>=${z}.${fe}.0${Y} <${z}.${+fe+1}.0-0`:Q=`>=${z}.${fe}.0${Y} <${+z+1}.0.0-0`:H?(p("replaceCaret pr",H),z==="0"?fe==="0"?Q=`>=${z}.${fe}.${te}-${H} <${z}.${fe}.${+te+1}-0`:Q=`>=${z}.${fe}.${te}-${H} <${z}.${+fe+1}.0-0`:Q=`>=${z}.${fe}.${te}-${H} <${+z+1}.0.0-0`):(p("no pr"),z==="0"?fe==="0"?Q=`>=${z}.${fe}.${te}${Y} <${z}.${fe}.${+te+1}-0`:Q=`>=${z}.${fe}.${te}${Y} <${z}.${+fe+1}.0-0`:Q=`>=${z}.${fe}.${te} <${+z+1}.0.0-0`),p("caret return",Q),Q})},ye=(T,N)=>(p("replaceXRanges",T,N),T.split(/\s+/).map(j=>he(j,N)).join(" ")),he=(T,N)=>{T=T.trim();const j=N.loose?C[x.XRANGELOOSE]:C[x.XRANGE];return T.replace(j,(Y,Z,z,fe,te,H)=>{p("xRange",T,Y,Z,z,fe,te,H);const Q=ue(z),oe=Q||ue(fe),_e=oe||ue(te),ge=_e;return Z==="="&&ge&&(Z=""),H=N.includePrerelease?"-0":"",Q?Z===">"||Z==="<"?Y="<0.0.0-0":Y="*":Z&&ge?(oe&&(fe=0),te=0,Z===">"?(Z=">=",oe?(z=+z+1,fe=0,te=0):(fe=+fe+1,te=0)):Z==="<="&&(Z="<",oe?z=+z+1:fe=+fe+1),Z==="<"&&(H="-0"),Y=`${Z+z}.${fe}.${te}${H}`):oe?Y=`>=${z}.0.0${H} <${+z+1}.0.0-0`:_e&&(Y=`>=${z}.${fe}.0${H} <${z}.${+fe+1}.0-0`),p("xRange return",Y),Y})},K=(T,N)=>(p("replaceStars",T,N),T.trim().replace(C[x.STAR],"")),B=(T,N)=>(p("replaceGTE0",T,N),T.trim().replace(C[N.includePrerelease?x.GTE0PRE:x.GTE0],"")),L=T=>(N,j,Y,Z,z,fe,te,H,Q,oe,_e,ge)=>(ue(Y)?j="":ue(Z)?j=`>=${Y}.0.0${T?"-0":""}`:ue(z)?j=`>=${Y}.${Z}.0${T?"-0":""}`:fe?j=`>=${j}`:j=`>=${j}${T?"-0":""}`,ue(Q)?H="":ue(oe)?H=`<${+Q+1}.0.0-0`:ue(_e)?H=`<${Q}.${+oe+1}.0-0`:ge?H=`<=${Q}.${oe}.${_e}-${ge}`:T?H=`<${Q}.${oe}.${+_e+1}-0`:H=`<=${H}`,`${j} ${H}`.trim()),$=(T,N,j)=>{for(let Y=0;Y<T.length;Y++)if(!T[Y].test(N))return!1;if(N.prerelease.length&&!j.includePrerelease){for(let Y=0;Y<T.length;Y++)if(p(T[Y].semver),T[Y].semver!==d.ANY&&T[Y].semver.prerelease.length>0){const Z=T[Y].semver;if(Z.major===N.major&&Z.minor===N.minor&&Z.patch===N.patch)return!0}return!1}return!0}},6280:function(ie,f,_){const h=_(18244),{MAX_LENGTH:w,MAX_SAFE_INTEGER:E}=_(97374),{safeRe:v,safeSrc:c,t:d}=_(60722),p=_(90327),{compareIdentifiers:m}=_(42847);class C{constructor(R,S){if(S=p(S),R instanceof C){if(R.loose===!!S.loose&&R.includePrerelease===!!S.includePrerelease)return R;R=R.version}else if(typeof R!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof R}".`);if(R.length>w)throw new TypeError(`version is longer than ${w} characters`);h("SemVer",R,S),this.options=S,this.loose=!!S.loose,this.includePrerelease=!!S.includePrerelease;const O=R.trim().match(S.loose?v[d.LOOSE]:v[d.FULL]);if(!O)throw new TypeError(`Invalid Version: ${R}`);if(this.raw=R,this.major=+O[1],this.minor=+O[2],this.patch=+O[3],this.major>E||this.major<0)throw new TypeError("Invalid major version");if(this.minor>E||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>E||this.patch<0)throw new TypeError("Invalid patch version");O[4]?this.prerelease=O[4].split(".").map(M=>{if(/^[0-9]+$/.test(M)){const k=+M;if(k>=0&&k<E)return k}return M}):this.prerelease=[],this.build=O[5]?O[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(R){if(h("SemVer.compare",this.version,this.options,R),!(R instanceof C)){if(typeof R=="string"&&R===this.version)return 0;R=new C(R,this.options)}return R.version===this.version?0:this.compareMain(R)||this.comparePre(R)}compareMain(R){return R instanceof C||(R=new C(R,this.options)),m(this.major,R.major)||m(this.minor,R.minor)||m(this.patch,R.patch)}comparePre(R){if(R instanceof C||(R=new C(R,this.options)),this.prerelease.length&&!R.prerelease.length)return-1;if(!this.prerelease.length&&R.prerelease.length)return 1;if(!this.prerelease.length&&!R.prerelease.length)return 0;let S=0;do{const O=this.prerelease[S],M=R.prerelease[S];if(h("prerelease compare",S,O,M),O===void 0&&M===void 0)return 0;if(M===void 0)return 1;if(O===void 0)return-1;if(O===M)continue;return m(O,M)}while(++S)}compareBuild(R){R instanceof C||(R=new C(R,this.options));let S=0;do{const O=this.build[S],M=R.build[S];if(h("build compare",S,O,M),O===void 0&&M===void 0)return 0;if(M===void 0)return 1;if(O===void 0)return-1;if(O===M)continue;return m(O,M)}while(++S)}inc(R,S,O){if(R.startsWith("pre")){if(!S&&O===!1)throw new Error("invalid increment argument: identifier is empty");if(S){const M=new RegExp(`^${this.options.loose?c[d.PRERELEASELOOSE]:c[d.PRERELEASE]}$`),k=`-${S}`.match(M);if(!k||k[1]!==S)throw new Error(`invalid identifier: ${S}`)}}switch(R){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",S,O);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",S,O);break;case"prepatch":this.prerelease.length=0,this.inc("patch",S,O),this.inc("pre",S,O);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",S,O),this.inc("pre",S,O);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const M=Number(O)?1:0;if(this.prerelease.length===0)this.prerelease=[M];else{let k=this.prerelease.length;for(;--k>=0;)typeof this.prerelease[k]=="number"&&(this.prerelease[k]++,k=-2);if(k===-1){if(S===this.prerelease.join(".")&&O===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(M)}}if(S){let k=[S,M];O===!1&&(k=[S]),m(this.prerelease[0],S)===0?isNaN(this.prerelease[1])&&(this.prerelease=k):this.prerelease=k}break}default:throw new Error(`invalid increment argument: ${R}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}ie.exports=C},91802:function(ie,f,_){const h=_(51108),w=(E,v)=>{const c=h(E.trim().replace(/^[=v]+/,""),v);return c?c.version:null};ie.exports=w},72947:function(ie,f,_){const h=_(2589),w=_(98411),E=_(48864),v=_(51917),c=_(96279),d=_(8692),p=(m,C,x,R)=>{switch(C){case"===":return typeof m=="object"&&(m=m.version),typeof x=="object"&&(x=x.version),m===x;case"!==":return typeof m=="object"&&(m=m.version),typeof x=="object"&&(x=x.version),m!==x;case"":case"=":case"==":return h(m,x,R);case"!=":return w(m,x,R);case">":return E(m,x,R);case">=":return v(m,x,R);case"<":return c(m,x,R);case"<=":return d(m,x,R);default:throw new TypeError(`Invalid operator: ${C}`)}};ie.exports=p},55398:function(ie,f,_){const h=_(6280),w=_(51108),{safeRe:E,t:v}=_(60722),c=(d,p)=>{if(d instanceof h)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;p=p||{};let m=null;if(!p.rtl)m=d.match(p.includePrerelease?E[v.COERCEFULL]:E[v.COERCE]);else{const M=p.includePrerelease?E[v.COERCERTLFULL]:E[v.COERCERTL];let k;for(;(k=M.exec(d))&&(!m||m.index+m[0].length!==d.length);)(!m||k.index+k[0].length!==m.index+m[0].length)&&(m=k),M.lastIndex=k.index+k[1].length+k[2].length;M.lastIndex=-1}if(m===null)return null;const C=m[2],x=m[3]||"0",R=m[4]||"0",S=p.includePrerelease&&m[5]?`-${m[5]}`:"",O=p.includePrerelease&&m[6]?`+${m[6]}`:"";return w(`${C}.${x}.${R}${S}${O}`,p)};ie.exports=c},31521:function(ie,f,_){const h=_(6280),w=(E,v,c)=>{const d=new h(E,c),p=new h(v,c);return d.compare(p)||d.compareBuild(p)};ie.exports=w},25583:function(ie,f,_){const h=_(50244),w=(E,v)=>h(E,v,!0);ie.exports=w},50244:function(ie,f,_){const h=_(6280),w=(E,v,c)=>new h(E,c).compare(new h(v,c));ie.exports=w},74116:function(ie,f,_){const h=_(51108),w=(E,v)=>{const c=h(E,null,!0),d=h(v,null,!0),p=c.compare(d);if(p===0)return null;const m=p>0,C=m?c:d,x=m?d:c,R=!!C.prerelease.length;if(!!x.prerelease.length&&!R){if(!x.patch&&!x.minor)return"major";if(x.compareMain(C)===0)return x.minor&&!x.patch?"minor":"patch"}const O=R?"pre":"";return c.major!==d.major?O+"major":c.minor!==d.minor?O+"minor":c.patch!==d.patch?O+"patch":"prerelease"};ie.exports=w},2589:function(ie,f,_){const h=_(50244),w=(E,v,c)=>h(E,v,c)===0;ie.exports=w},48864:function(ie,f,_){const h=_(50244),w=(E,v,c)=>h(E,v,c)>0;ie.exports=w},51917:function(ie,f,_){const h=_(50244),w=(E,v,c)=>h(E,v,c)>=0;ie.exports=w},12547:function(ie,f,_){const h=_(6280),w=(E,v,c,d,p)=>{typeof c=="string"&&(p=d,d=c,c=void 0);try{return new h(E instanceof h?E.version:E,c).inc(v,d,p).version}catch{return null}};ie.exports=w},96279:function(ie,f,_){const h=_(50244),w=(E,v,c)=>h(E,v,c)<0;ie.exports=w},8692:function(ie,f,_){const h=_(50244),w=(E,v,c)=>h(E,v,c)<=0;ie.exports=w},11974:function(ie,f,_){const h=_(6280),w=(E,v)=>new h(E,v).major;ie.exports=w},38386:function(ie,f,_){const h=_(6280),w=(E,v)=>new h(E,v).minor;ie.exports=w},98411:function(ie,f,_){const h=_(50244),w=(E,v,c)=>h(E,v,c)!==0;ie.exports=w},51108:function(ie,f,_){const h=_(6280),w=(E,v,c=!1)=>{if(E instanceof h)return E;try{return new h(E,v)}catch(d){if(!c)return null;throw d}};ie.exports=w},70353:function(ie,f,_){const h=_(6280),w=(E,v)=>new h(E,v).patch;ie.exports=w},14605:function(ie,f,_){const h=_(51108),w=(E,v)=>{const c=h(E,v);return c&&c.prerelease.length?c.prerelease:null};ie.exports=w},61086:function(ie,f,_){const h=_(50244),w=(E,v,c)=>h(v,E,c);ie.exports=w},17041:function(ie,f,_){const h=_(31521),w=(E,v)=>E.sort((c,d)=>h(d,c,v));ie.exports=w},32298:function(ie,f,_){const h=_(23643),w=(E,v,c)=>{try{v=new h(v,c)}catch{return!1}return v.test(E)};ie.exports=w},82619:function(ie,f,_){const h=_(31521),w=(E,v)=>E.sort((c,d)=>h(c,d,v));ie.exports=w},46733:function(ie,f,_){const h=_(51108),w=(E,v)=>{const c=h(E,v);return c?c.version:null};ie.exports=w},74017:function(ie,f,_){const h=_(60722),w=_(97374),E=_(6280),v=_(42847),c=_(51108),d=_(46733),p=_(91802),m=_(12547),C=_(74116),x=_(11974),R=_(38386),S=_(70353),O=_(14605),M=_(50244),k=_(61086),q=_(25583),b=_(31521),F=_(82619),G=_(17041),ue=_(48864),le=_(96279),X=_(2589),se=_(98411),de=_(51917),ye=_(8692),he=_(72947),K=_(55398),B=_(67636),L=_(23643),$=_(32298),T=_(88107),N=_(9296),j=_(82922),Y=_(45329),Z=_(96742),z=_(58951),fe=_(94607),te=_(11370),H=_(42312),Q=_(27625),oe=_(63460);ie.exports={parse:c,valid:d,clean:p,inc:m,diff:C,major:x,minor:R,patch:S,prerelease:O,compare:M,rcompare:k,compareLoose:q,compareBuild:b,sort:F,rsort:G,gt:ue,lt:le,eq:X,neq:se,gte:de,lte:ye,cmp:he,coerce:K,Comparator:B,Range:L,satisfies:$,toComparators:T,maxSatisfying:N,minSatisfying:j,minVersion:Y,validRange:Z,outside:z,gtr:fe,ltr:te,intersects:H,simplifyRange:Q,subset:oe,SemVer:E,re:h.re,src:h.src,tokens:h.t,SEMVER_SPEC_VERSION:w.SEMVER_SPEC_VERSION,RELEASE_TYPES:w.RELEASE_TYPES,compareIdentifiers:v.compareIdentifiers,rcompareIdentifiers:v.rcompareIdentifiers}},97374:function(ie){const f="2.0.0",h=Number.MAX_SAFE_INTEGER||9007199254740991,w=16,E=250,v=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ie.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:w,MAX_SAFE_BUILD_LENGTH:E,MAX_SAFE_INTEGER:h,RELEASE_TYPES:v,SEMVER_SPEC_VERSION:f,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},18244:function(ie,f,_){var h=_(85409);const w=typeof h=="object"&&"{}".NODE_DEBUG&&/\bsemver\b/i.test("{}".NODE_DEBUG)?(...E)=>console.error("SEMVER",...E):()=>{};ie.exports=w},42847:function(ie){const f=/^[0-9]+$/,_=(w,E)=>{const v=f.test(w),c=f.test(E);return v&&c&&(w=+w,E=+E),w===E?0:v&&!c?-1:c&&!v?1:w<E?-1:1},h=(w,E)=>_(E,w);ie.exports={compareIdentifiers:_,rcompareIdentifiers:h}},53158:function(ie){class f{constructor(){this.max=1e3,this.map=new Map}get(h){const w=this.map.get(h);if(w!==void 0)return this.map.delete(h),this.map.set(h,w),w}delete(h){return this.map.delete(h)}set(h,w){if(!this.delete(h)&&w!==void 0){if(this.map.size>=this.max){const v=this.map.keys().next().value;this.delete(v)}this.map.set(h,w)}return this}}ie.exports=f},90327:function(ie){const f=Object.freeze({loose:!0}),_=Object.freeze({}),h=w=>w?typeof w!="object"?f:w:_;ie.exports=h},60722:function(ie,f,_){const{MAX_SAFE_COMPONENT_LENGTH:h,MAX_SAFE_BUILD_LENGTH:w,MAX_LENGTH:E}=_(97374),v=_(18244);f=ie.exports={};const c=f.re=[],d=f.safeRe=[],p=f.src=[],m=f.safeSrc=[],C=f.t={};let x=0;const R="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",E],[R,w]],O=k=>{for(const[q,b]of S)k=k.split(`${q}*`).join(`${q}{0,${b}}`).split(`${q}+`).join(`${q}{1,${b}}`);return k},M=(k,q,b)=>{const F=O(q),G=x++;v(k,G,q),C[k]=G,p[G]=q,m[G]=F,c[G]=new RegExp(q,b?"g":void 0),d[G]=new RegExp(F,b?"g":void 0)};M("NUMERICIDENTIFIER","0|[1-9]\\d*"),M("NUMERICIDENTIFIERLOOSE","\\d+"),M("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${R}*`),M("MAINVERSION",`(${p[C.NUMERICIDENTIFIER]})\\.(${p[C.NUMERICIDENTIFIER]})\\.(${p[C.NUMERICIDENTIFIER]})`),M("MAINVERSIONLOOSE",`(${p[C.NUMERICIDENTIFIERLOOSE]})\\.(${p[C.NUMERICIDENTIFIERLOOSE]})\\.(${p[C.NUMERICIDENTIFIERLOOSE]})`),M("PRERELEASEIDENTIFIER",`(?:${p[C.NUMERICIDENTIFIER]}|${p[C.NONNUMERICIDENTIFIER]})`),M("PRERELEASEIDENTIFIERLOOSE",`(?:${p[C.NUMERICIDENTIFIERLOOSE]}|${p[C.NONNUMERICIDENTIFIER]})`),M("PRERELEASE",`(?:-(${p[C.PRERELEASEIDENTIFIER]}(?:\\.${p[C.PRERELEASEIDENTIFIER]})*))`),M("PRERELEASELOOSE",`(?:-?(${p[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[C.PRERELEASEIDENTIFIERLOOSE]})*))`),M("BUILDIDENTIFIER",`${R}+`),M("BUILD",`(?:\\+(${p[C.BUILDIDENTIFIER]}(?:\\.${p[C.BUILDIDENTIFIER]})*))`),M("FULLPLAIN",`v?${p[C.MAINVERSION]}${p[C.PRERELEASE]}?${p[C.BUILD]}?`),M("FULL",`^${p[C.FULLPLAIN]}$`),M("LOOSEPLAIN",`[v=\\s]*${p[C.MAINVERSIONLOOSE]}${p[C.PRERELEASELOOSE]}?${p[C.BUILD]}?`),M("LOOSE",`^${p[C.LOOSEPLAIN]}$`),M("GTLT","((?:<|>)?=?)"),M("XRANGEIDENTIFIERLOOSE",`${p[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),M("XRANGEIDENTIFIER",`${p[C.NUMERICIDENTIFIER]}|x|X|\\*`),M("XRANGEPLAIN",`[v=\\s]*(${p[C.XRANGEIDENTIFIER]})(?:\\.(${p[C.XRANGEIDENTIFIER]})(?:\\.(${p[C.XRANGEIDENTIFIER]})(?:${p[C.PRERELEASE]})?${p[C.BUILD]}?)?)?`),M("XRANGEPLAINLOOSE",`[v=\\s]*(${p[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[C.XRANGEIDENTIFIERLOOSE]})(?:${p[C.PRERELEASELOOSE]})?${p[C.BUILD]}?)?)?`),M("XRANGE",`^${p[C.GTLT]}\\s*${p[C.XRANGEPLAIN]}$`),M("XRANGELOOSE",`^${p[C.GTLT]}\\s*${p[C.XRANGEPLAINLOOSE]}$`),M("COERCEPLAIN",`(^|[^\\d])(\\d{1,${h}})(?:\\.(\\d{1,${h}}))?(?:\\.(\\d{1,${h}}))?`),M("COERCE",`${p[C.COERCEPLAIN]}(?:$|[^\\d])`),M("COERCEFULL",p[C.COERCEPLAIN]+`(?:${p[C.PRERELEASE]})?(?:${p[C.BUILD]})?(?:$|[^\\d])`),M("COERCERTL",p[C.COERCE],!0),M("COERCERTLFULL",p[C.COERCEFULL],!0),M("LONETILDE","(?:~>?)"),M("TILDETRIM",`(\\s*)${p[C.LONETILDE]}\\s+`,!0),f.tildeTrimReplace="$1~",M("TILDE",`^${p[C.LONETILDE]}${p[C.XRANGEPLAIN]}$`),M("TILDELOOSE",`^${p[C.LONETILDE]}${p[C.XRANGEPLAINLOOSE]}$`),M("LONECARET","(?:\\^)"),M("CARETTRIM",`(\\s*)${p[C.LONECARET]}\\s+`,!0),f.caretTrimReplace="$1^",M("CARET",`^${p[C.LONECARET]}${p[C.XRANGEPLAIN]}$`),M("CARETLOOSE",`^${p[C.LONECARET]}${p[C.XRANGEPLAINLOOSE]}$`),M("COMPARATORLOOSE",`^${p[C.GTLT]}\\s*(${p[C.LOOSEPLAIN]})$|^$`),M("COMPARATOR",`^${p[C.GTLT]}\\s*(${p[C.FULLPLAIN]})$|^$`),M("COMPARATORTRIM",`(\\s*)${p[C.GTLT]}\\s*(${p[C.LOOSEPLAIN]}|${p[C.XRANGEPLAIN]})`,!0),f.comparatorTrimReplace="$1$2$3",M("HYPHENRANGE",`^\\s*(${p[C.XRANGEPLAIN]})\\s+-\\s+(${p[C.XRANGEPLAIN]})\\s*$`),M("HYPHENRANGELOOSE",`^\\s*(${p[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[C.XRANGEPLAINLOOSE]})\\s*$`),M("STAR","(<|>)?=?\\s*\\*"),M("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),M("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},94607:function(ie,f,_){const h=_(58951),w=(E,v,c)=>h(E,v,">",c);ie.exports=w},42312:function(ie,f,_){const h=_(23643),w=(E,v,c)=>(E=new h(E,c),v=new h(v,c),E.intersects(v,c));ie.exports=w},11370:function(ie,f,_){const h=_(58951),w=(E,v,c)=>h(E,v,"<",c);ie.exports=w},9296:function(ie,f,_){const h=_(6280),w=_(23643),E=(v,c,d)=>{let p=null,m=null,C=null;try{C=new w(c,d)}catch{return null}return v.forEach(x=>{C.test(x)&&(!p||m.compare(x)===-1)&&(p=x,m=new h(p,d))}),p};ie.exports=E},82922:function(ie,f,_){const h=_(6280),w=_(23643),E=(v,c,d)=>{let p=null,m=null,C=null;try{C=new w(c,d)}catch{return null}return v.forEach(x=>{C.test(x)&&(!p||m.compare(x)===1)&&(p=x,m=new h(p,d))}),p};ie.exports=E},45329:function(ie,f,_){const h=_(6280),w=_(23643),E=_(48864),v=(c,d)=>{c=new w(c,d);let p=new h("0.0.0");if(c.test(p)||(p=new h("0.0.0-0"),c.test(p)))return p;p=null;for(let m=0;m<c.set.length;++m){const C=c.set[m];let x=null;C.forEach(R=>{const S=new h(R.semver.version);switch(R.operator){case">":S.prerelease.length===0?S.patch++:S.prerelease.push(0),S.raw=S.format();case"":case">=":(!x||E(S,x))&&(x=S);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${R.operator}`)}}),x&&(!p||E(p,x))&&(p=x)}return p&&c.test(p)?p:null};ie.exports=v},58951:function(ie,f,_){const h=_(6280),w=_(67636),{ANY:E}=w,v=_(23643),c=_(32298),d=_(48864),p=_(96279),m=_(8692),C=_(51917),x=(R,S,O,M)=>{R=new h(R,M),S=new v(S,M);let k,q,b,F,G;switch(O){case">":k=d,q=m,b=p,F=">",G=">=";break;case"<":k=p,q=C,b=d,F="<",G="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(c(R,S,M))return!1;for(let ue=0;ue<S.set.length;++ue){const le=S.set[ue];let X=null,se=null;if(le.forEach(de=>{de.semver===E&&(de=new w(">=0.0.0")),X=X||de,se=se||de,k(de.semver,X.semver,M)?X=de:b(de.semver,se.semver,M)&&(se=de)}),X.operator===F||X.operator===G||(!se.operator||se.operator===F)&&q(R,se.semver))return!1;if(se.operator===G&&b(R,se.semver))return!1}return!0};ie.exports=x},27625:function(ie,f,_){const h=_(32298),w=_(50244);ie.exports=(E,v,c)=>{const d=[];let p=null,m=null;const C=E.sort((O,M)=>w(O,M,c));for(const O of C)h(O,v,c)?(m=O,p||(p=O)):(m&&d.push([p,m]),m=null,p=null);p&&d.push([p,null]);const x=[];for(const[O,M]of d)O===M?x.push(O):!M&&O===C[0]?x.push("*"):M?O===C[0]?x.push(`<=${M}`):x.push(`${O} - ${M}`):x.push(`>=${O}`);const R=x.join(" || "),S=typeof v.raw=="string"?v.raw:String(v);return R.length<S.length?R:v}},63460:function(ie,f,_){const h=_(23643),w=_(67636),{ANY:E}=w,v=_(32298),c=_(50244),d=(S,O,M={})=>{if(S===O)return!0;S=new h(S,M),O=new h(O,M);let k=!1;e:for(const q of S.set){for(const b of O.set){const F=C(q,b,M);if(k=k||F!==null,F)continue e}if(k)return!1}return!0},p=[new w(">=0.0.0-0")],m=[new w(">=0.0.0")],C=(S,O,M)=>{if(S===O)return!0;if(S.length===1&&S[0].semver===E){if(O.length===1&&O[0].semver===E)return!0;M.includePrerelease?S=p:S=m}if(O.length===1&&O[0].semver===E){if(M.includePrerelease)return!0;O=m}const k=new Set;let q,b;for(const ye of S)ye.operator===">"||ye.operator===">="?q=x(q,ye,M):ye.operator==="<"||ye.operator==="<="?b=R(b,ye,M):k.add(ye.semver);if(k.size>1)return null;let F;if(q&&b){if(F=c(q.semver,b.semver,M),F>0)return null;if(F===0&&(q.operator!==">="||b.operator!=="<="))return null}for(const ye of k){if(q&&!v(ye,String(q),M)||b&&!v(ye,String(b),M))return null;for(const he of O)if(!v(ye,String(he),M))return!1;return!0}let G,ue,le,X,se=b&&!M.includePrerelease&&b.semver.prerelease.length?b.semver:!1,de=q&&!M.includePrerelease&&q.semver.prerelease.length?q.semver:!1;se&&se.prerelease.length===1&&b.operator==="<"&&se.prerelease[0]===0&&(se=!1);for(const ye of O){if(X=X||ye.operator===">"||ye.operator===">=",le=le||ye.operator==="<"||ye.operator==="<=",q){if(de&&ye.semver.prerelease&&ye.semver.prerelease.length&&ye.semver.major===de.major&&ye.semver.minor===de.minor&&ye.semver.patch===de.patch&&(de=!1),ye.operator===">"||ye.operator===">="){if(G=x(q,ye,M),G===ye&&G!==q)return!1}else if(q.operator===">="&&!v(q.semver,String(ye),M))return!1}if(b){if(se&&ye.semver.prerelease&&ye.semver.prerelease.length&&ye.semver.major===se.major&&ye.semver.minor===se.minor&&ye.semver.patch===se.patch&&(se=!1),ye.operator==="<"||ye.operator==="<="){if(ue=R(b,ye,M),ue===ye&&ue!==b)return!1}else if(b.operator==="<="&&!v(b.semver,String(ye),M))return!1}if(!ye.operator&&(b||q)&&F!==0)return!1}return!(q&&le&&!b&&F!==0||b&&X&&!q&&F!==0||de||se)},x=(S,O,M)=>{if(!S)return O;const k=c(S.semver,O.semver,M);return k>0?S:k<0||O.operator===">"&&S.operator===">="?O:S},R=(S,O,M)=>{if(!S)return O;const k=c(S.semver,O.semver,M);return k<0?S:k>0||O.operator==="<"&&S.operator==="<="?O:S};ie.exports=d},88107:function(ie,f,_){const h=_(23643),w=(E,v)=>new h(E,v).set.map(c=>c.map(d=>d.value).join(" ").trim().split(" "));ie.exports=w},96742:function(ie,f,_){const h=_(23643),w=(E,v)=>{try{return new h(E,v).range||"*"}catch{return null}};ie.exports=w},79003:function(ie,f,_){"use strict";const h=Symbol("SemVer ANY");class w{static get ANY(){return h}constructor(R,S){if(S=E(S),R instanceof w){if(R.loose===!!S.loose)return R;R=R.value}R=R.trim().split(/\s+/).join(" "),p("comparator",R,S),this.options=S,this.loose=!!S.loose,this.parse(R),this.semver===h?this.value="":this.value=this.operator+this.semver.version,p("comp",this)}parse(R){const S=this.options.loose?v[c.COMPARATORLOOSE]:v[c.COMPARATOR],O=R.match(S);if(!O)throw new TypeError(`Invalid comparator: ${R}`);this.operator=O[1]!==void 0?O[1]:"",this.operator==="="&&(this.operator=""),O[2]?this.semver=new m(O[2],this.options.loose):this.semver=h}toString(){return this.value}test(R){if(p("Comparator.test",R,this.options.loose),this.semver===h||R===h)return!0;if(typeof R=="string")try{R=new m(R,this.options)}catch{return!1}return d(R,this.operator,this.semver,this.options)}intersects(R,S){if(!(R instanceof w))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new C(R.value,S).test(this.value):R.operator===""?R.value===""?!0:new C(this.value,S).test(R.semver):(S=E(S),S.includePrerelease&&(this.value==="<0.0.0-0"||R.value==="<0.0.0-0")||!S.includePrerelease&&(this.value.startsWith("<0.0.0")||R.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&R.operator.startsWith(">")||this.operator.startsWith("<")&&R.operator.startsWith("<")||this.semver.version===R.semver.version&&this.operator.includes("=")&&R.operator.includes("=")||d(this.semver,"<",R.semver,S)&&this.operator.startsWith(">")&&R.operator.startsWith("<")||d(this.semver,">",R.semver,S)&&this.operator.startsWith("<")&&R.operator.startsWith(">")))}}ie.exports=w;const E=_(12860),{safeRe:v,t:c}=_(86999),d=_(93566),p=_(4159),m=_(2771),C=_(62326)},62326:function(ie,f,_){"use strict";const h=/\s+/g;class w{constructor(N,j){if(j=c(j),N instanceof w)return N.loose===!!j.loose&&N.includePrerelease===!!j.includePrerelease?N:new w(N.raw,j);if(N instanceof d)return this.raw=N.value,this.set=[[N]],this.formatted=void 0,this;if(this.options=j,this.loose=!!j.loose,this.includePrerelease=!!j.includePrerelease,this.raw=N.trim().replace(h," "),this.set=this.raw.split("||").map(Y=>this.parseRange(Y.trim())).filter(Y=>Y.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const Y=this.set[0];if(this.set=this.set.filter(Z=>!q(Z[0])),this.set.length===0)this.set=[Y];else if(this.set.length>1){for(const Z of this.set)if(Z.length===1&&b(Z[0])){this.set=[Z];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let N=0;N<this.set.length;N++){N>0&&(this.formatted+="||");const j=this.set[N];for(let Y=0;Y<j.length;Y++)Y>0&&(this.formatted+=" "),this.formatted+=j[Y].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(N){const Y=((this.options.includePrerelease&&M)|(this.options.loose&&k))+":"+N,Z=v.get(Y);if(Z)return Z;const z=this.options.loose,fe=z?C[x.HYPHENRANGELOOSE]:C[x.HYPHENRANGE];N=N.replace(fe,L(this.options.includePrerelease)),p("hyphen replace",N),N=N.replace(C[x.COMPARATORTRIM],R),p("comparator trim",N),N=N.replace(C[x.TILDETRIM],S),p("tilde trim",N),N=N.replace(C[x.CARETTRIM],O),p("caret trim",N);let te=N.split(" ").map(_e=>G(_e,this.options)).join(" ").split(/\s+/).map(_e=>B(_e,this.options));z&&(te=te.filter(_e=>(p("loose invalid filter",_e,this.options),!!_e.match(C[x.COMPARATORLOOSE])))),p("range list",te);const H=new Map,Q=te.map(_e=>new d(_e,this.options));for(const _e of Q){if(q(_e))return[_e];H.set(_e.value,_e)}H.size>1&&H.has("")&&H.delete("");const oe=[...H.values()];return v.set(Y,oe),oe}intersects(N,j){if(!(N instanceof w))throw new TypeError("a Range is required");return this.set.some(Y=>F(Y,j)&&N.set.some(Z=>F(Z,j)&&Y.every(z=>Z.every(fe=>z.intersects(fe,j)))))}test(N){if(!N)return!1;if(typeof N=="string")try{N=new m(N,this.options)}catch{return!1}for(let j=0;j<this.set.length;j++)if($(this.set[j],N,this.options))return!0;return!1}}ie.exports=w;const E=_(62351),v=new E,c=_(12860),d=_(79003),p=_(4159),m=_(2771),{safeRe:C,t:x,comparatorTrimReplace:R,tildeTrimReplace:S,caretTrimReplace:O}=_(86999),{FLAG_INCLUDE_PRERELEASE:M,FLAG_LOOSE:k}=_(10229),q=T=>T.value==="<0.0.0-0",b=T=>T.value==="",F=(T,N)=>{let j=!0;const Y=T.slice();let Z=Y.pop();for(;j&&Y.length;)j=Y.every(z=>Z.intersects(z,N)),Z=Y.pop();return j},G=(T,N)=>(p("comp",T,N),T=se(T,N),p("caret",T),T=le(T,N),p("tildes",T),T=ye(T,N),p("xrange",T),T=K(T,N),p("stars",T),T),ue=T=>!T||T.toLowerCase()==="x"||T==="*",le=(T,N)=>T.trim().split(/\s+/).map(j=>X(j,N)).join(" "),X=(T,N)=>{const j=N.loose?C[x.TILDELOOSE]:C[x.TILDE];return T.replace(j,(Y,Z,z,fe,te)=>{p("tilde",T,Y,Z,z,fe,te);let H;return ue(Z)?H="":ue(z)?H=`>=${Z}.0.0 <${+Z+1}.0.0-0`:ue(fe)?H=`>=${Z}.${z}.0 <${Z}.${+z+1}.0-0`:te?(p("replaceTilde pr",te),H=`>=${Z}.${z}.${fe}-${te} <${Z}.${+z+1}.0-0`):H=`>=${Z}.${z}.${fe} <${Z}.${+z+1}.0-0`,p("tilde return",H),H})},se=(T,N)=>T.trim().split(/\s+/).map(j=>de(j,N)).join(" "),de=(T,N)=>{p("caret",T,N);const j=N.loose?C[x.CARETLOOSE]:C[x.CARET],Y=N.includePrerelease?"-0":"";return T.replace(j,(Z,z,fe,te,H)=>{p("caret",T,Z,z,fe,te,H);let Q;return ue(z)?Q="":ue(fe)?Q=`>=${z}.0.0${Y} <${+z+1}.0.0-0`:ue(te)?z==="0"?Q=`>=${z}.${fe}.0${Y} <${z}.${+fe+1}.0-0`:Q=`>=${z}.${fe}.0${Y} <${+z+1}.0.0-0`:H?(p("replaceCaret pr",H),z==="0"?fe==="0"?Q=`>=${z}.${fe}.${te}-${H} <${z}.${fe}.${+te+1}-0`:Q=`>=${z}.${fe}.${te}-${H} <${z}.${+fe+1}.0-0`:Q=`>=${z}.${fe}.${te}-${H} <${+z+1}.0.0-0`):(p("no pr"),z==="0"?fe==="0"?Q=`>=${z}.${fe}.${te}${Y} <${z}.${fe}.${+te+1}-0`:Q=`>=${z}.${fe}.${te}${Y} <${z}.${+fe+1}.0-0`:Q=`>=${z}.${fe}.${te} <${+z+1}.0.0-0`),p("caret return",Q),Q})},ye=(T,N)=>(p("replaceXRanges",T,N),T.split(/\s+/).map(j=>he(j,N)).join(" ")),he=(T,N)=>{T=T.trim();const j=N.loose?C[x.XRANGELOOSE]:C[x.XRANGE];return T.replace(j,(Y,Z,z,fe,te,H)=>{p("xRange",T,Y,Z,z,fe,te,H);const Q=ue(z),oe=Q||ue(fe),_e=oe||ue(te),ge=_e;return Z==="="&&ge&&(Z=""),H=N.includePrerelease?"-0":"",Q?Z===">"||Z==="<"?Y="<0.0.0-0":Y="*":Z&&ge?(oe&&(fe=0),te=0,Z===">"?(Z=">=",oe?(z=+z+1,fe=0,te=0):(fe=+fe+1,te=0)):Z==="<="&&(Z="<",oe?z=+z+1:fe=+fe+1),Z==="<"&&(H="-0"),Y=`${Z+z}.${fe}.${te}${H}`):oe?Y=`>=${z}.0.0${H} <${+z+1}.0.0-0`:_e&&(Y=`>=${z}.${fe}.0${H} <${z}.${+fe+1}.0-0`),p("xRange return",Y),Y})},K=(T,N)=>(p("replaceStars",T,N),T.trim().replace(C[x.STAR],"")),B=(T,N)=>(p("replaceGTE0",T,N),T.trim().replace(C[N.includePrerelease?x.GTE0PRE:x.GTE0],"")),L=T=>(N,j,Y,Z,z,fe,te,H,Q,oe,_e,ge)=>(ue(Y)?j="":ue(Z)?j=`>=${Y}.0.0${T?"-0":""}`:ue(z)?j=`>=${Y}.${Z}.0${T?"-0":""}`:fe?j=`>=${j}`:j=`>=${j}${T?"-0":""}`,ue(Q)?H="":ue(oe)?H=`<${+Q+1}.0.0-0`:ue(_e)?H=`<${Q}.${+oe+1}.0-0`:ge?H=`<=${Q}.${oe}.${_e}-${ge}`:T?H=`<${Q}.${oe}.${+_e+1}-0`:H=`<=${H}`,`${j} ${H}`.trim()),$=(T,N,j)=>{for(let Y=0;Y<T.length;Y++)if(!T[Y].test(N))return!1;if(N.prerelease.length&&!j.includePrerelease){for(let Y=0;Y<T.length;Y++)if(p(T[Y].semver),T[Y].semver!==d.ANY&&T[Y].semver.prerelease.length>0){const Z=T[Y].semver;if(Z.major===N.major&&Z.minor===N.minor&&Z.patch===N.patch)return!0}return!1}return!0}},2771:function(ie,f,_){"use strict";const h=_(4159),{MAX_LENGTH:w,MAX_SAFE_INTEGER:E}=_(10229),{safeRe:v,t:c}=_(86999),d=_(12860),{compareIdentifiers:p}=_(53436);class m{constructor(x,R){if(R=d(R),x instanceof m){if(x.loose===!!R.loose&&x.includePrerelease===!!R.includePrerelease)return x;x=x.version}else if(typeof x!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof x}".`);if(x.length>w)throw new TypeError(`version is longer than ${w} characters`);h("SemVer",x,R),this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease;const S=x.trim().match(R.loose?v[c.LOOSE]:v[c.FULL]);if(!S)throw new TypeError(`Invalid Version: ${x}`);if(this.raw=x,this.major=+S[1],this.minor=+S[2],this.patch=+S[3],this.major>E||this.major<0)throw new TypeError("Invalid major version");if(this.minor>E||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>E||this.patch<0)throw new TypeError("Invalid patch version");S[4]?this.prerelease=S[4].split(".").map(O=>{if(/^[0-9]+$/.test(O)){const M=+O;if(M>=0&&M<E)return M}return O}):this.prerelease=[],this.build=S[5]?S[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(x){if(h("SemVer.compare",this.version,this.options,x),!(x instanceof m)){if(typeof x=="string"&&x===this.version)return 0;x=new m(x,this.options)}return x.version===this.version?0:this.compareMain(x)||this.comparePre(x)}compareMain(x){return x instanceof m||(x=new m(x,this.options)),p(this.major,x.major)||p(this.minor,x.minor)||p(this.patch,x.patch)}comparePre(x){if(x instanceof m||(x=new m(x,this.options)),this.prerelease.length&&!x.prerelease.length)return-1;if(!this.prerelease.length&&x.prerelease.length)return 1;if(!this.prerelease.length&&!x.prerelease.length)return 0;let R=0;do{const S=this.prerelease[R],O=x.prerelease[R];if(h("prerelease compare",R,S,O),S===void 0&&O===void 0)return 0;if(O===void 0)return 1;if(S===void 0)return-1;if(S===O)continue;return p(S,O)}while(++R)}compareBuild(x){x instanceof m||(x=new m(x,this.options));let R=0;do{const S=this.build[R],O=x.build[R];if(h("build compare",R,S,O),S===void 0&&O===void 0)return 0;if(O===void 0)return 1;if(S===void 0)return-1;if(S===O)continue;return p(S,O)}while(++R)}inc(x,R,S){if(x.startsWith("pre")){if(!R&&S===!1)throw new Error("invalid increment argument: identifier is empty");if(R){const O=`-${R}`.match(this.options.loose?v[c.PRERELEASELOOSE]:v[c.PRERELEASE]);if(!O||O[1]!==R)throw new Error(`invalid identifier: ${R}`)}}switch(x){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",R,S);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",R,S);break;case"prepatch":this.prerelease.length=0,this.inc("patch",R,S),this.inc("pre",R,S);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",R,S),this.inc("pre",R,S);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const O=Number(S)?1:0;if(this.prerelease.length===0)this.prerelease=[O];else{let M=this.prerelease.length;for(;--M>=0;)typeof this.prerelease[M]=="number"&&(this.prerelease[M]++,M=-2);if(M===-1){if(R===this.prerelease.join(".")&&S===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(O)}}if(R){let M=[R,O];S===!1&&(M=[R]),p(this.prerelease[0],R)===0?isNaN(this.prerelease[1])&&(this.prerelease=M):this.prerelease=M}break}default:throw new Error(`invalid increment argument: ${x}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}ie.exports=m},69903:function(ie,f,_){"use strict";const h=_(1289),w=(E,v)=>{const c=h(E.trim().replace(/^[=v]+/,""),v);return c?c.version:null};ie.exports=w},93566:function(ie,f,_){"use strict";const h=_(1314),w=_(47238),E=_(17743),v=_(70236),c=_(88200),d=_(33765),p=(m,C,x,R)=>{switch(C){case"===":return typeof m=="object"&&(m=m.version),typeof x=="object"&&(x=x.version),m===x;case"!==":return typeof m=="object"&&(m=m.version),typeof x=="object"&&(x=x.version),m!==x;case"":case"=":case"==":return h(m,x,R);case"!=":return w(m,x,R);case">":return E(m,x,R);case">=":return v(m,x,R);case"<":return c(m,x,R);case"<=":return d(m,x,R);default:throw new TypeError(`Invalid operator: ${C}`)}};ie.exports=p},75585:function(ie,f,_){"use strict";const h=_(2771),w=_(1289),{safeRe:E,t:v}=_(86999),c=(d,p)=>{if(d instanceof h)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;p=p||{};let m=null;if(!p.rtl)m=d.match(p.includePrerelease?E[v.COERCEFULL]:E[v.COERCE]);else{const M=p.includePrerelease?E[v.COERCERTLFULL]:E[v.COERCERTL];let k;for(;(k=M.exec(d))&&(!m||m.index+m[0].length!==d.length);)(!m||k.index+k[0].length!==m.index+m[0].length)&&(m=k),M.lastIndex=k.index+k[1].length+k[2].length;M.lastIndex=-1}if(m===null)return null;const C=m[2],x=m[3]||"0",R=m[4]||"0",S=p.includePrerelease&&m[5]?`-${m[5]}`:"",O=p.includePrerelease&&m[6]?`+${m[6]}`:"";return w(`${C}.${x}.${R}${S}${O}`,p)};ie.exports=c},84104:function(ie,f,_){"use strict";const h=_(2771),w=(E,v,c)=>{const d=new h(E,c),p=new h(v,c);return d.compare(p)||d.compareBuild(p)};ie.exports=w},86002:function(ie,f,_){"use strict";const h=_(35469),w=(E,v)=>h(E,v,!0);ie.exports=w},35469:function(ie,f,_){"use strict";const h=_(2771),w=(E,v,c)=>new h(E,c).compare(new h(v,c));ie.exports=w},32223:function(ie,f,_){"use strict";const h=_(1289),w=(E,v)=>{const c=h(E,null,!0),d=h(v,null,!0),p=c.compare(d);if(p===0)return null;const m=p>0,C=m?c:d,x=m?d:c,R=!!C.prerelease.length;if(!!x.prerelease.length&&!R){if(!x.patch&&!x.minor)return"major";if(x.compareMain(C)===0)return x.minor&&!x.patch?"minor":"patch"}const O=R?"pre":"";return c.major!==d.major?O+"major":c.minor!==d.minor?O+"minor":c.patch!==d.patch?O+"patch":"prerelease"};ie.exports=w},1314:function(ie,f,_){"use strict";const h=_(35469),w=(E,v,c)=>h(E,v,c)===0;ie.exports=w},17743:function(ie,f,_){"use strict";const h=_(35469),w=(E,v,c)=>h(E,v,c)>0;ie.exports=w},70236:function(ie,f,_){"use strict";const h=_(35469),w=(E,v,c)=>h(E,v,c)>=0;ie.exports=w},10826:function(ie,f,_){"use strict";const h=_(2771),w=(E,v,c,d,p)=>{typeof c=="string"&&(p=d,d=c,c=void 0);try{return new h(E instanceof h?E.version:E,c).inc(v,d,p).version}catch{return null}};ie.exports=w},88200:function(ie,f,_){"use strict";const h=_(35469),w=(E,v,c)=>h(E,v,c)<0;ie.exports=w},33765:function(ie,f,_){"use strict";const h=_(35469),w=(E,v,c)=>h(E,v,c)<=0;ie.exports=w},64247:function(ie,f,_){"use strict";const h=_(2771),w=(E,v)=>new h(E,v).major;ie.exports=w},95363:function(ie,f,_){"use strict";const h=_(2771),w=(E,v)=>new h(E,v).minor;ie.exports=w},47238:function(ie,f,_){"use strict";const h=_(35469),w=(E,v,c)=>h(E,v,c)!==0;ie.exports=w},1289:function(ie,f,_){"use strict";const h=_(2771),w=(E,v,c=!1)=>{if(E instanceof h)return E;try{return new h(E,v)}catch(d){if(!c)return null;throw d}};ie.exports=w},67148:function(ie,f,_){"use strict";const h=_(2771),w=(E,v)=>new h(E,v).patch;ie.exports=w},43306:function(ie,f,_){"use strict";const h=_(1289),w=(E,v)=>{const c=h(E,v);return c&&c.prerelease.length?c.prerelease:null};ie.exports=w},41861:function(ie,f,_){"use strict";const h=_(35469),w=(E,v,c)=>h(v,E,c);ie.exports=w},4240:function(ie,f,_){"use strict";const h=_(84104),w=(E,v)=>E.sort((c,d)=>h(d,c,v));ie.exports=w},94163:function(ie,f,_){"use strict";const h=_(62326),w=(E,v,c)=>{try{v=new h(v,c)}catch{return!1}return v.test(E)};ie.exports=w},67256:function(ie,f,_){"use strict";const h=_(84104),w=(E,v)=>E.sort((c,d)=>h(c,d,v));ie.exports=w},59140:function(ie,f,_){"use strict";const h=_(1289),w=(E,v)=>{const c=h(E,v);return c?c.version:null};ie.exports=w},90032:function(ie,f,_){"use strict";const h=_(86999),w=_(10229),E=_(2771),v=_(53436),c=_(1289),d=_(59140),p=_(69903),m=_(10826),C=_(32223),x=_(64247),R=_(95363),S=_(67148),O=_(43306),M=_(35469),k=_(41861),q=_(86002),b=_(84104),F=_(67256),G=_(4240),ue=_(17743),le=_(88200),X=_(1314),se=_(47238),de=_(70236),ye=_(33765),he=_(93566),K=_(75585),B=_(79003),L=_(62326),$=_(94163),T=_(64678),N=_(79313),j=_(93835),Y=_(50898),Z=_(51913),z=_(46640),fe=_(46460),te=_(21573),H=_(67713),Q=_(52468),oe=_(52809);ie.exports={parse:c,valid:d,clean:p,inc:m,diff:C,major:x,minor:R,patch:S,prerelease:O,compare:M,rcompare:k,compareLoose:q,compareBuild:b,sort:F,rsort:G,gt:ue,lt:le,eq:X,neq:se,gte:de,lte:ye,cmp:he,coerce:K,Comparator:B,Range:L,satisfies:$,toComparators:T,maxSatisfying:N,minSatisfying:j,minVersion:Y,validRange:Z,outside:z,gtr:fe,ltr:te,intersects:H,simplifyRange:Q,subset:oe,SemVer:E,re:h.re,src:h.src,tokens:h.t,SEMVER_SPEC_VERSION:w.SEMVER_SPEC_VERSION,RELEASE_TYPES:w.RELEASE_TYPES,compareIdentifiers:v.compareIdentifiers,rcompareIdentifiers:v.rcompareIdentifiers}},10229:function(ie){"use strict";const f="2.0.0",h=Number.MAX_SAFE_INTEGER||9007199254740991,w=16,E=250,v=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ie.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:w,MAX_SAFE_BUILD_LENGTH:E,MAX_SAFE_INTEGER:h,RELEASE_TYPES:v,SEMVER_SPEC_VERSION:f,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},4159:function(ie,f,_){"use strict";var h=_(85409);const w=typeof h=="object"&&"{}".NODE_DEBUG&&/\bsemver\b/i.test("{}".NODE_DEBUG)?(...E)=>console.error("SEMVER",...E):()=>{};ie.exports=w},53436:function(ie){"use strict";const f=/^[0-9]+$/,_=(w,E)=>{const v=f.test(w),c=f.test(E);return v&&c&&(w=+w,E=+E),w===E?0:v&&!c?-1:c&&!v?1:w<E?-1:1},h=(w,E)=>_(E,w);ie.exports={compareIdentifiers:_,rcompareIdentifiers:h}},62351:function(ie){"use strict";class f{constructor(){this.max=1e3,this.map=new Map}get(h){const w=this.map.get(h);if(w!==void 0)return this.map.delete(h),this.map.set(h,w),w}delete(h){return this.map.delete(h)}set(h,w){if(!this.delete(h)&&w!==void 0){if(this.map.size>=this.max){const v=this.map.keys().next().value;this.delete(v)}this.map.set(h,w)}return this}}ie.exports=f},12860:function(ie){"use strict";const f=Object.freeze({loose:!0}),_=Object.freeze({}),h=w=>w?typeof w!="object"?f:w:_;ie.exports=h},86999:function(ie,f,_){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:h,MAX_SAFE_BUILD_LENGTH:w,MAX_LENGTH:E}=_(10229),v=_(4159);f=ie.exports={};const c=f.re=[],d=f.safeRe=[],p=f.src=[],m=f.safeSrc=[],C=f.t={};let x=0;const R="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",E],[R,w]],O=k=>{for(const[q,b]of S)k=k.split(`${q}*`).join(`${q}{0,${b}}`).split(`${q}+`).join(`${q}{1,${b}}`);return k},M=(k,q,b)=>{const F=O(q),G=x++;v(k,G,q),C[k]=G,p[G]=q,m[G]=F,c[G]=new RegExp(q,b?"g":void 0),d[G]=new RegExp(F,b?"g":void 0)};M("NUMERICIDENTIFIER","0|[1-9]\\d*"),M("NUMERICIDENTIFIERLOOSE","\\d+"),M("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${R}*`),M("MAINVERSION",`(${p[C.NUMERICIDENTIFIER]})\\.(${p[C.NUMERICIDENTIFIER]})\\.(${p[C.NUMERICIDENTIFIER]})`),M("MAINVERSIONLOOSE",`(${p[C.NUMERICIDENTIFIERLOOSE]})\\.(${p[C.NUMERICIDENTIFIERLOOSE]})\\.(${p[C.NUMERICIDENTIFIERLOOSE]})`),M("PRERELEASEIDENTIFIER",`(?:${p[C.NONNUMERICIDENTIFIER]}|${p[C.NUMERICIDENTIFIER]})`),M("PRERELEASEIDENTIFIERLOOSE",`(?:${p[C.NONNUMERICIDENTIFIER]}|${p[C.NUMERICIDENTIFIERLOOSE]})`),M("PRERELEASE",`(?:-(${p[C.PRERELEASEIDENTIFIER]}(?:\\.${p[C.PRERELEASEIDENTIFIER]})*))`),M("PRERELEASELOOSE",`(?:-?(${p[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[C.PRERELEASEIDENTIFIERLOOSE]})*))`),M("BUILDIDENTIFIER",`${R}+`),M("BUILD",`(?:\\+(${p[C.BUILDIDENTIFIER]}(?:\\.${p[C.BUILDIDENTIFIER]})*))`),M("FULLPLAIN",`v?${p[C.MAINVERSION]}${p[C.PRERELEASE]}?${p[C.BUILD]}?`),M("FULL",`^${p[C.FULLPLAIN]}$`),M("LOOSEPLAIN",`[v=\\s]*${p[C.MAINVERSIONLOOSE]}${p[C.PRERELEASELOOSE]}?${p[C.BUILD]}?`),M("LOOSE",`^${p[C.LOOSEPLAIN]}$`),M("GTLT","((?:<|>)?=?)"),M("XRANGEIDENTIFIERLOOSE",`${p[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),M("XRANGEIDENTIFIER",`${p[C.NUMERICIDENTIFIER]}|x|X|\\*`),M("XRANGEPLAIN",`[v=\\s]*(${p[C.XRANGEIDENTIFIER]})(?:\\.(${p[C.XRANGEIDENTIFIER]})(?:\\.(${p[C.XRANGEIDENTIFIER]})(?:${p[C.PRERELEASE]})?${p[C.BUILD]}?)?)?`),M("XRANGEPLAINLOOSE",`[v=\\s]*(${p[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[C.XRANGEIDENTIFIERLOOSE]})(?:${p[C.PRERELEASELOOSE]})?${p[C.BUILD]}?)?)?`),M("XRANGE",`^${p[C.GTLT]}\\s*${p[C.XRANGEPLAIN]}$`),M("XRANGELOOSE",`^${p[C.GTLT]}\\s*${p[C.XRANGEPLAINLOOSE]}$`),M("COERCEPLAIN",`(^|[^\\d])(\\d{1,${h}})(?:\\.(\\d{1,${h}}))?(?:\\.(\\d{1,${h}}))?`),M("COERCE",`${p[C.COERCEPLAIN]}(?:$|[^\\d])`),M("COERCEFULL",p[C.COERCEPLAIN]+`(?:${p[C.PRERELEASE]})?(?:${p[C.BUILD]})?(?:$|[^\\d])`),M("COERCERTL",p[C.COERCE],!0),M("COERCERTLFULL",p[C.COERCEFULL],!0),M("LONETILDE","(?:~>?)"),M("TILDETRIM",`(\\s*)${p[C.LONETILDE]}\\s+`,!0),f.tildeTrimReplace="$1~",M("TILDE",`^${p[C.LONETILDE]}${p[C.XRANGEPLAIN]}$`),M("TILDELOOSE",`^${p[C.LONETILDE]}${p[C.XRANGEPLAINLOOSE]}$`),M("LONECARET","(?:\\^)"),M("CARETTRIM",`(\\s*)${p[C.LONECARET]}\\s+`,!0),f.caretTrimReplace="$1^",M("CARET",`^${p[C.LONECARET]}${p[C.XRANGEPLAIN]}$`),M("CARETLOOSE",`^${p[C.LONECARET]}${p[C.XRANGEPLAINLOOSE]}$`),M("COMPARATORLOOSE",`^${p[C.GTLT]}\\s*(${p[C.LOOSEPLAIN]})$|^$`),M("COMPARATOR",`^${p[C.GTLT]}\\s*(${p[C.FULLPLAIN]})$|^$`),M("COMPARATORTRIM",`(\\s*)${p[C.GTLT]}\\s*(${p[C.LOOSEPLAIN]}|${p[C.XRANGEPLAIN]})`,!0),f.comparatorTrimReplace="$1$2$3",M("HYPHENRANGE",`^\\s*(${p[C.XRANGEPLAIN]})\\s+-\\s+(${p[C.XRANGEPLAIN]})\\s*$`),M("HYPHENRANGELOOSE",`^\\s*(${p[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[C.XRANGEPLAINLOOSE]})\\s*$`),M("STAR","(<|>)?=?\\s*\\*"),M("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),M("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},46460:function(ie,f,_){"use strict";const h=_(46640),w=(E,v,c)=>h(E,v,">",c);ie.exports=w},67713:function(ie,f,_){"use strict";const h=_(62326),w=(E,v,c)=>(E=new h(E,c),v=new h(v,c),E.intersects(v,c));ie.exports=w},21573:function(ie,f,_){"use strict";const h=_(46640),w=(E,v,c)=>h(E,v,"<",c);ie.exports=w},79313:function(ie,f,_){"use strict";const h=_(2771),w=_(62326),E=(v,c,d)=>{let p=null,m=null,C=null;try{C=new w(c,d)}catch{return null}return v.forEach(x=>{C.test(x)&&(!p||m.compare(x)===-1)&&(p=x,m=new h(p,d))}),p};ie.exports=E},93835:function(ie,f,_){"use strict";const h=_(2771),w=_(62326),E=(v,c,d)=>{let p=null,m=null,C=null;try{C=new w(c,d)}catch{return null}return v.forEach(x=>{C.test(x)&&(!p||m.compare(x)===1)&&(p=x,m=new h(p,d))}),p};ie.exports=E},50898:function(ie,f,_){"use strict";const h=_(2771),w=_(62326),E=_(17743),v=(c,d)=>{c=new w(c,d);let p=new h("0.0.0");if(c.test(p)||(p=new h("0.0.0-0"),c.test(p)))return p;p=null;for(let m=0;m<c.set.length;++m){const C=c.set[m];let x=null;C.forEach(R=>{const S=new h(R.semver.version);switch(R.operator){case">":S.prerelease.length===0?S.patch++:S.prerelease.push(0),S.raw=S.format();case"":case">=":(!x||E(S,x))&&(x=S);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${R.operator}`)}}),x&&(!p||E(p,x))&&(p=x)}return p&&c.test(p)?p:null};ie.exports=v},46640:function(ie,f,_){"use strict";const h=_(2771),w=_(79003),{ANY:E}=w,v=_(62326),c=_(94163),d=_(17743),p=_(88200),m=_(33765),C=_(70236),x=(R,S,O,M)=>{R=new h(R,M),S=new v(S,M);let k,q,b,F,G;switch(O){case">":k=d,q=m,b=p,F=">",G=">=";break;case"<":k=p,q=C,b=d,F="<",G="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(c(R,S,M))return!1;for(let ue=0;ue<S.set.length;++ue){const le=S.set[ue];let X=null,se=null;if(le.forEach(de=>{de.semver===E&&(de=new w(">=0.0.0")),X=X||de,se=se||de,k(de.semver,X.semver,M)?X=de:b(de.semver,se.semver,M)&&(se=de)}),X.operator===F||X.operator===G||(!se.operator||se.operator===F)&&q(R,se.semver))return!1;if(se.operator===G&&b(R,se.semver))return!1}return!0};ie.exports=x},52468:function(ie,f,_){"use strict";const h=_(94163),w=_(35469);ie.exports=(E,v,c)=>{const d=[];let p=null,m=null;const C=E.sort((O,M)=>w(O,M,c));for(const O of C)h(O,v,c)?(m=O,p||(p=O)):(m&&d.push([p,m]),m=null,p=null);p&&d.push([p,null]);const x=[];for(const[O,M]of d)O===M?x.push(O):!M&&O===C[0]?x.push("*"):M?O===C[0]?x.push(`<=${M}`):x.push(`${O} - ${M}`):x.push(`>=${O}`);const R=x.join(" || "),S=typeof v.raw=="string"?v.raw:String(v);return R.length<S.length?R:v}},52809:function(ie,f,_){"use strict";const h=_(62326),w=_(79003),{ANY:E}=w,v=_(94163),c=_(35469),d=(S,O,M={})=>{if(S===O)return!0;S=new h(S,M),O=new h(O,M);let k=!1;e:for(const q of S.set){for(const b of O.set){const F=C(q,b,M);if(k=k||F!==null,F)continue e}if(k)return!1}return!0},p=[new w(">=0.0.0-0")],m=[new w(">=0.0.0")],C=(S,O,M)=>{if(S===O)return!0;if(S.length===1&&S[0].semver===E){if(O.length===1&&O[0].semver===E)return!0;M.includePrerelease?S=p:S=m}if(O.length===1&&O[0].semver===E){if(M.includePrerelease)return!0;O=m}const k=new Set;let q,b;for(const ye of S)ye.operator===">"||ye.operator===">="?q=x(q,ye,M):ye.operator==="<"||ye.operator==="<="?b=R(b,ye,M):k.add(ye.semver);if(k.size>1)return null;let F;if(q&&b){if(F=c(q.semver,b.semver,M),F>0)return null;if(F===0&&(q.operator!==">="||b.operator!=="<="))return null}for(const ye of k){if(q&&!v(ye,String(q),M)||b&&!v(ye,String(b),M))return null;for(const he of O)if(!v(ye,String(he),M))return!1;return!0}let G,ue,le,X,se=b&&!M.includePrerelease&&b.semver.prerelease.length?b.semver:!1,de=q&&!M.includePrerelease&&q.semver.prerelease.length?q.semver:!1;se&&se.prerelease.length===1&&b.operator==="<"&&se.prerelease[0]===0&&(se=!1);for(const ye of O){if(X=X||ye.operator===">"||ye.operator===">=",le=le||ye.operator==="<"||ye.operator==="<=",q){if(de&&ye.semver.prerelease&&ye.semver.prerelease.length&&ye.semver.major===de.major&&ye.semver.minor===de.minor&&ye.semver.patch===de.patch&&(de=!1),ye.operator===">"||ye.operator===">="){if(G=x(q,ye,M),G===ye&&G!==q)return!1}else if(q.operator===">="&&!v(q.semver,String(ye),M))return!1}if(b){if(se&&ye.semver.prerelease&&ye.semver.prerelease.length&&ye.semver.major===se.major&&ye.semver.minor===se.minor&&ye.semver.patch===se.patch&&(se=!1),ye.operator==="<"||ye.operator==="<="){if(ue=R(b,ye,M),ue===ye&&ue!==b)return!1}else if(b.operator==="<="&&!v(b.semver,String(ye),M))return!1}if(!ye.operator&&(b||q)&&F!==0)return!1}return!(q&&le&&!b&&F!==0||b&&X&&!q&&F!==0||de||se)},x=(S,O,M)=>{if(!S)return O;const k=c(S.semver,O.semver,M);return k>0?S:k<0||O.operator===">"&&S.operator===">="?O:S},R=(S,O,M)=>{if(!S)return O;const k=c(S.semver,O.semver,M);return k<0?S:k>0||O.operator==="<"&&S.operator==="<="?O:S};ie.exports=d},64678:function(ie,f,_){"use strict";const h=_(62326),w=(E,v)=>new h(E,v).set.map(c=>c.map(d=>d.value).join(" ").trim().split(" "));ie.exports=w},51913:function(ie,f,_){"use strict";const h=_(62326),w=(E,v)=>{try{return new h(E,v).range||"*"}catch{return null}};ie.exports=w},7755:function(ie,f,_){"use strict";var h=_(49336),w=_(20022),E=_(491)(),v=_(25667),c=_(71102),d=h("%Math.floor%");ie.exports=function(m,C){if(typeof m!="function")throw new c("`fn` is not a function");if(typeof C!="number"||C<0||C>4294967295||d(C)!==C)throw new c("`length` must be a positive 32-bit integer");var x=arguments.length>2&&!!arguments[2],R=!0,S=!0;if("length"in m&&v){var O=v(m,"length");O&&!O.configurable&&(R=!1),O&&!O.writable&&(S=!1)}return(R||S||!x)&&(E?w(m,"length",C,!0,!0):w(m,"length",C)),m}},45755:function(ie,f,_){"use strict";var h=_(78311),w=_(71102),E=function(m,C,x){for(var R=m,S;(S=R.next)!=null;R=S)if(S.key===C)return R.next=S.next,x||(S.next=m.next,m.next=S),S},v=function(m,C){if(m){var x=E(m,C);return x&&x.value}},c=function(m,C,x){var R=E(m,C);R?R.value=x:m.next={key:C,next:m.next,value:x}},d=function(m,C){return m?!!E(m,C):!1},p=function(m,C){if(m)return E(m,C,!0)};ie.exports=function(){var C,x={assert:function(R){if(!x.has(R))throw new w("Side channel does not contain "+h(R))},delete:function(R){var S=C&&C.next,O=p(C,R);return O&&S&&S===O&&(C=void 0),!!O},get:function(R){return v(C,R)},has:function(R){return d(C,R)},set:function(R,S){C||(C={next:void 0}),c(C,R,S)}};return x}},84566:function(ie,f,_){"use strict";var h=_(49336),w=_(98801),E=_(78311),v=_(71102),c=h("%Map%",!0),d=w("Map.prototype.get",!0),p=w("Map.prototype.set",!0),m=w("Map.prototype.has",!0),C=w("Map.prototype.delete",!0),x=w("Map.prototype.size",!0);ie.exports=!!c&&function(){var S,O={assert:function(M){if(!O.has(M))throw new v("Side channel does not contain "+E(M))},delete:function(M){if(S){var k=C(S,M);return x(S)===0&&(S=void 0),k}return!1},get:function(M){if(S)return d(S,M)},has:function(M){return S?m(S,M):!1},set:function(M,k){S||(S=new c),p(S,M,k)}};return O}},53635:function(ie,f,_){"use strict";var h=_(49336),w=_(98801),E=_(78311),v=_(84566),c=_(71102),d=h("%WeakMap%",!0),p=w("WeakMap.prototype.get",!0),m=w("WeakMap.prototype.set",!0),C=w("WeakMap.prototype.has",!0),x=w("WeakMap.prototype.delete",!0);ie.exports=d?function(){var S,O,M={assert:function(k){if(!M.has(k))throw new c("Side channel does not contain "+E(k))},delete:function(k){if(d&&k&&(typeof k=="object"||typeof k=="function")){if(S)return x(S,k)}else if(v&&O)return O.delete(k);return!1},get:function(k){return d&&k&&(typeof k=="object"||typeof k=="function")&&S?p(S,k):O&&O.get(k)},has:function(k){return d&&k&&(typeof k=="object"||typeof k=="function")&&S?C(S,k):!!O&&O.has(k)},set:function(k,q){d&&k&&(typeof k=="object"||typeof k=="function")?(S||(S=new d),m(S,k,q)):v&&(O||(O=v()),O.set(k,q))}};return M}:v},4198:function(ie,f,_){"use strict";var h=_(71102),w=_(78311),E=_(45755),v=_(84566),c=_(53635),d=c||v||E;ie.exports=function(){var m,C={assert:function(x){if(!C.has(x))throw new h("Side channel does not contain "+w(x))},delete:function(x){return!!m&&m.delete(x)},get:function(x){return m&&m.get(x)},has:function(x){return!!m&&m.has(x)},set:function(x,R){m||(m=d()),m.set(x,R)}};return C}},43803:function(ie,f,_){ie.exports=E;var h=_(80381).EventEmitter,w=_(91193);w(E,h),E.Readable=_(23033),E.Writable=_(92553),E.Duplex=_(35707),E.Transform=_(50141),E.PassThrough=_(75271),E.finished=_(32339),E.pipeline=_(35481),E.Stream=E;function E(){h.call(this)}E.prototype.pipe=function(v,c){var d=this;function p(M){v.writable&&v.write(M)===!1&&d.pause&&d.pause()}d.on("data",p);function m(){d.readable&&d.resume&&d.resume()}v.on("drain",m),!v._isStdio&&(!c||c.end!==!1)&&(d.on("end",x),d.on("close",R));var C=!1;function x(){C||(C=!0,v.end())}function R(){C||(C=!0,typeof v.destroy=="function"&&v.destroy())}function S(M){if(O(),h.listenerCount(this,"error")===0)throw M}d.on("error",S),v.on("error",S);function O(){d.removeListener("data",p),v.removeListener("drain",m),d.removeListener("end",x),d.removeListener("close",R),d.removeListener("error",S),v.removeListener("error",S),d.removeListener("end",O),d.removeListener("close",O),v.removeListener("close",O)}return d.on("end",O),d.on("close",O),v.on("close",O),v.emit("pipe",d),v}},86704:function(ie,f,_){"use strict";var h=_(56608).Buffer,w=h.isEncoding||function(F){switch(F=""+F,F&&F.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function E(F){if(!F)return"utf8";for(var G;;)switch(F){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return F;default:if(G)return;F=(""+F).toLowerCase(),G=!0}}function v(F){var G=E(F);if(typeof G!="string"&&(h.isEncoding===w||!w(F)))throw new Error("Unknown encoding: "+F);return G||F}f.StringDecoder=c;function c(F){this.encoding=v(F);var G;switch(this.encoding){case"utf16le":this.text=S,this.end=O,G=4;break;case"utf8":this.fillLast=C,G=4;break;case"base64":this.text=M,this.end=k,G=3;break;default:this.write=q,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=h.allocUnsafe(G)}c.prototype.write=function(F){if(F.length===0)return"";var G,ue;if(this.lastNeed){if(G=this.fillLast(F),G===void 0)return"";ue=this.lastNeed,this.lastNeed=0}else ue=0;return ue<F.length?G?G+this.text(F,ue):this.text(F,ue):G||""},c.prototype.end=R,c.prototype.text=x,c.prototype.fillLast=function(F){if(this.lastNeed<=F.length)return F.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);F.copy(this.lastChar,this.lastTotal-this.lastNeed,0,F.length),this.lastNeed-=F.length};function d(F){return F<=127?0:F>>5===6?2:F>>4===14?3:F>>3===30?4:F>>6===2?-1:-2}function p(F,G,ue){var le=G.length-1;if(le<ue)return 0;var X=d(G[le]);return X>=0?(X>0&&(F.lastNeed=X-1),X):--le<ue||X===-2?0:(X=d(G[le]),X>=0?(X>0&&(F.lastNeed=X-2),X):--le<ue||X===-2?0:(X=d(G[le]),X>=0?(X>0&&(X===2?X=0:F.lastNeed=X-3),X):0))}function m(F,G,ue){if((G[0]&192)!==128)return F.lastNeed=0,"\uFFFD";if(F.lastNeed>1&&G.length>1){if((G[1]&192)!==128)return F.lastNeed=1,"\uFFFD";if(F.lastNeed>2&&G.length>2&&(G[2]&192)!==128)return F.lastNeed=2,"\uFFFD"}}function C(F){var G=this.lastTotal-this.lastNeed,ue=m(this,F,G);if(ue!==void 0)return ue;if(this.lastNeed<=F.length)return F.copy(this.lastChar,G,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);F.copy(this.lastChar,G,0,F.length),this.lastNeed-=F.length}function x(F,G){var ue=p(this,F,G);if(!this.lastNeed)return F.toString("utf8",G);this.lastTotal=ue;var le=F.length-(ue-this.lastNeed);return F.copy(this.lastChar,0,le),F.toString("utf8",G,le)}function R(F){var G=F&&F.length?this.write(F):"";return this.lastNeed?G+"\uFFFD":G}function S(F,G){if((F.length-G)%2===0){var ue=F.toString("utf16le",G);if(ue){var le=ue.charCodeAt(ue.length-1);if(le>=55296&&le<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=F[F.length-2],this.lastChar[1]=F[F.length-1],ue.slice(0,-1)}return ue}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=F[F.length-1],F.toString("utf16le",G,F.length-1)}function O(F){var G=F&&F.length?this.write(F):"";if(this.lastNeed){var ue=this.lastTotal-this.lastNeed;return G+this.lastChar.toString("utf16le",0,ue)}return G}function M(F,G){var ue=(F.length-G)%3;return ue===0?F.toString("base64",G):(this.lastNeed=3-ue,this.lastTotal=3,ue===1?this.lastChar[0]=F[F.length-1]:(this.lastChar[0]=F[F.length-2],this.lastChar[1]=F[F.length-1]),F.toString("base64",G,F.length-ue))}function k(F){var G=F&&F.length?this.write(F):"";return this.lastNeed?G+this.lastChar.toString("base64",0,3-this.lastNeed):G}function q(F){return F.toString(this.encoding)}function b(F){return F&&F.length?this.write(F):""}},18861:function(ie,f,_){(function(h){"use strict";var w=function(at){var wt,At=new Float64Array(16);if(at)for(wt=0;wt<at.length;wt++)At[wt]=at[wt];return At},E=function(){throw new Error("no PRNG")},v=new Uint8Array(16),c=new Uint8Array(32);c[0]=9;var d=w(),p=w([1]),m=w([56129,1]),C=w([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),x=w([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),R=w([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),S=w([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),O=w([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function M(at,wt,At,Je){at[wt]=At>>24&255,at[wt+1]=At>>16&255,at[wt+2]=At>>8&255,at[wt+3]=At&255,at[wt+4]=Je>>24&255,at[wt+5]=Je>>16&255,at[wt+6]=Je>>8&255,at[wt+7]=Je&255}function k(at,wt,At,Je,Lt){var sr,ur=0;for(sr=0;sr<Lt;sr++)ur|=at[wt+sr]^At[Je+sr];return(1&ur-1>>>8)-1}function q(at,wt,At,Je){return k(at,wt,At,Je,16)}function b(at,wt,At,Je){return k(at,wt,At,Je,32)}function F(at,wt,At,Je){for(var Lt=Je[0]&255|(Je[1]&255)<<8|(Je[2]&255)<<16|(Je[3]&255)<<24,sr=At[0]&255|(At[1]&255)<<8|(At[2]&255)<<16|(At[3]&255)<<24,ur=At[4]&255|(At[5]&255)<<8|(At[6]&255)<<16|(At[7]&255)<<24,vr=At[8]&255|(At[9]&255)<<8|(At[10]&255)<<16|(At[11]&255)<<24,kr=At[12]&255|(At[13]&255)<<8|(At[14]&255)<<16|(At[15]&255)<<24,Jr=Je[4]&255|(Je[5]&255)<<8|(Je[6]&255)<<16|(Je[7]&255)<<24,hr=wt[0]&255|(wt[1]&255)<<8|(wt[2]&255)<<16|(wt[3]&255)<<24,$r=wt[4]&255|(wt[5]&255)<<8|(wt[6]&255)<<16|(wt[7]&255)<<24,Hr=wt[8]&255|(wt[9]&255)<<8|(wt[10]&255)<<16|(wt[11]&255)<<24,rn=wt[12]&255|(wt[13]&255)<<8|(wt[14]&255)<<16|(wt[15]&255)<<24,_r=Je[8]&255|(Je[9]&255)<<8|(Je[10]&255)<<16|(Je[11]&255)<<24,pn=At[16]&255|(At[17]&255)<<8|(At[18]&255)<<16|(At[19]&255)<<24,$t=At[20]&255|(At[21]&255)<<8|(At[22]&255)<<16|(At[23]&255)<<24,In=At[24]&255|(At[25]&255)<<8|(At[26]&255)<<16|(At[27]&255)<<24,ln=At[28]&255|(At[29]&255)<<8|(At[30]&255)<<16|(At[31]&255)<<24,yn=Je[12]&255|(Je[13]&255)<<8|(Je[14]&255)<<16|(Je[15]&255)<<24,Fr=Lt,On=sr,En=ur,ee=vr,ve=kr,ze=Jr,yt=hr,vt=$r,ar=Hr,wr=rn,zt=_r,Kr=pn,Xt=$t,et=In,xt=ln,Kt=yn,kt,or=0;or<20;or+=2)kt=Fr+Xt|0,ve^=kt<<7|kt>>>25,kt=ve+Fr|0,ar^=kt<<9|kt>>>23,kt=ar+ve|0,Xt^=kt<<13|kt>>>19,kt=Xt+ar|0,Fr^=kt<<18|kt>>>14,kt=ze+On|0,wr^=kt<<7|kt>>>25,kt=wr+ze|0,et^=kt<<9|kt>>>23,kt=et+wr|0,On^=kt<<13|kt>>>19,kt=On+et|0,ze^=kt<<18|kt>>>14,kt=zt+yt|0,xt^=kt<<7|kt>>>25,kt=xt+zt|0,En^=kt<<9|kt>>>23,kt=En+xt|0,yt^=kt<<13|kt>>>19,kt=yt+En|0,zt^=kt<<18|kt>>>14,kt=Kt+Kr|0,ee^=kt<<7|kt>>>25,kt=ee+Kt|0,vt^=kt<<9|kt>>>23,kt=vt+ee|0,Kr^=kt<<13|kt>>>19,kt=Kr+vt|0,Kt^=kt<<18|kt>>>14,kt=Fr+ee|0,On^=kt<<7|kt>>>25,kt=On+Fr|0,En^=kt<<9|kt>>>23,kt=En+On|0,ee^=kt<<13|kt>>>19,kt=ee+En|0,Fr^=kt<<18|kt>>>14,kt=ze+ve|0,yt^=kt<<7|kt>>>25,kt=yt+ze|0,vt^=kt<<9|kt>>>23,kt=vt+yt|0,ve^=kt<<13|kt>>>19,kt=ve+vt|0,ze^=kt<<18|kt>>>14,kt=zt+wr|0,Kr^=kt<<7|kt>>>25,kt=Kr+zt|0,ar^=kt<<9|kt>>>23,kt=ar+Kr|0,wr^=kt<<13|kt>>>19,kt=wr+ar|0,zt^=kt<<18|kt>>>14,kt=Kt+xt|0,Xt^=kt<<7|kt>>>25,kt=Xt+Kt|0,et^=kt<<9|kt>>>23,kt=et+Xt|0,xt^=kt<<13|kt>>>19,kt=xt+et|0,Kt^=kt<<18|kt>>>14;Fr=Fr+Lt|0,On=On+sr|0,En=En+ur|0,ee=ee+vr|0,ve=ve+kr|0,ze=ze+Jr|0,yt=yt+hr|0,vt=vt+$r|0,ar=ar+Hr|0,wr=wr+rn|0,zt=zt+_r|0,Kr=Kr+pn|0,Xt=Xt+$t|0,et=et+In|0,xt=xt+ln|0,Kt=Kt+yn|0,at[0]=Fr>>>0&255,at[1]=Fr>>>8&255,at[2]=Fr>>>16&255,at[3]=Fr>>>24&255,at[4]=On>>>0&255,at[5]=On>>>8&255,at[6]=On>>>16&255,at[7]=On>>>24&255,at[8]=En>>>0&255,at[9]=En>>>8&255,at[10]=En>>>16&255,at[11]=En>>>24&255,at[12]=ee>>>0&255,at[13]=ee>>>8&255,at[14]=ee>>>16&255,at[15]=ee>>>24&255,at[16]=ve>>>0&255,at[17]=ve>>>8&255,at[18]=ve>>>16&255,at[19]=ve>>>24&255,at[20]=ze>>>0&255,at[21]=ze>>>8&255,at[22]=ze>>>16&255,at[23]=ze>>>24&255,at[24]=yt>>>0&255,at[25]=yt>>>8&255,at[26]=yt>>>16&255,at[27]=yt>>>24&255,at[28]=vt>>>0&255,at[29]=vt>>>8&255,at[30]=vt>>>16&255,at[31]=vt>>>24&255,at[32]=ar>>>0&255,at[33]=ar>>>8&255,at[34]=ar>>>16&255,at[35]=ar>>>24&255,at[36]=wr>>>0&255,at[37]=wr>>>8&255,at[38]=wr>>>16&255,at[39]=wr>>>24&255,at[40]=zt>>>0&255,at[41]=zt>>>8&255,at[42]=zt>>>16&255,at[43]=zt>>>24&255,at[44]=Kr>>>0&255,at[45]=Kr>>>8&255,at[46]=Kr>>>16&255,at[47]=Kr>>>24&255,at[48]=Xt>>>0&255,at[49]=Xt>>>8&255,at[50]=Xt>>>16&255,at[51]=Xt>>>24&255,at[52]=et>>>0&255,at[53]=et>>>8&255,at[54]=et>>>16&255,at[55]=et>>>24&255,at[56]=xt>>>0&255,at[57]=xt>>>8&255,at[58]=xt>>>16&255,at[59]=xt>>>24&255,at[60]=Kt>>>0&255,at[61]=Kt>>>8&255,at[62]=Kt>>>16&255,at[63]=Kt>>>24&255}function G(at,wt,At,Je){for(var Lt=Je[0]&255|(Je[1]&255)<<8|(Je[2]&255)<<16|(Je[3]&255)<<24,sr=At[0]&255|(At[1]&255)<<8|(At[2]&255)<<16|(At[3]&255)<<24,ur=At[4]&255|(At[5]&255)<<8|(At[6]&255)<<16|(At[7]&255)<<24,vr=At[8]&255|(At[9]&255)<<8|(At[10]&255)<<16|(At[11]&255)<<24,kr=At[12]&255|(At[13]&255)<<8|(At[14]&255)<<16|(At[15]&255)<<24,Jr=Je[4]&255|(Je[5]&255)<<8|(Je[6]&255)<<16|(Je[7]&255)<<24,hr=wt[0]&255|(wt[1]&255)<<8|(wt[2]&255)<<16|(wt[3]&255)<<24,$r=wt[4]&255|(wt[5]&255)<<8|(wt[6]&255)<<16|(wt[7]&255)<<24,Hr=wt[8]&255|(wt[9]&255)<<8|(wt[10]&255)<<16|(wt[11]&255)<<24,rn=wt[12]&255|(wt[13]&255)<<8|(wt[14]&255)<<16|(wt[15]&255)<<24,_r=Je[8]&255|(Je[9]&255)<<8|(Je[10]&255)<<16|(Je[11]&255)<<24,pn=At[16]&255|(At[17]&255)<<8|(At[18]&255)<<16|(At[19]&255)<<24,$t=At[20]&255|(At[21]&255)<<8|(At[22]&255)<<16|(At[23]&255)<<24,In=At[24]&255|(At[25]&255)<<8|(At[26]&255)<<16|(At[27]&255)<<24,ln=At[28]&255|(At[29]&255)<<8|(At[30]&255)<<16|(At[31]&255)<<24,yn=Je[12]&255|(Je[13]&255)<<8|(Je[14]&255)<<16|(Je[15]&255)<<24,Fr=Lt,On=sr,En=ur,ee=vr,ve=kr,ze=Jr,yt=hr,vt=$r,ar=Hr,wr=rn,zt=_r,Kr=pn,Xt=$t,et=In,xt=ln,Kt=yn,kt,or=0;or<20;or+=2)kt=Fr+Xt|0,ve^=kt<<7|kt>>>25,kt=ve+Fr|0,ar^=kt<<9|kt>>>23,kt=ar+ve|0,Xt^=kt<<13|kt>>>19,kt=Xt+ar|0,Fr^=kt<<18|kt>>>14,kt=ze+On|0,wr^=kt<<7|kt>>>25,kt=wr+ze|0,et^=kt<<9|kt>>>23,kt=et+wr|0,On^=kt<<13|kt>>>19,kt=On+et|0,ze^=kt<<18|kt>>>14,kt=zt+yt|0,xt^=kt<<7|kt>>>25,kt=xt+zt|0,En^=kt<<9|kt>>>23,kt=En+xt|0,yt^=kt<<13|kt>>>19,kt=yt+En|0,zt^=kt<<18|kt>>>14,kt=Kt+Kr|0,ee^=kt<<7|kt>>>25,kt=ee+Kt|0,vt^=kt<<9|kt>>>23,kt=vt+ee|0,Kr^=kt<<13|kt>>>19,kt=Kr+vt|0,Kt^=kt<<18|kt>>>14,kt=Fr+ee|0,On^=kt<<7|kt>>>25,kt=On+Fr|0,En^=kt<<9|kt>>>23,kt=En+On|0,ee^=kt<<13|kt>>>19,kt=ee+En|0,Fr^=kt<<18|kt>>>14,kt=ze+ve|0,yt^=kt<<7|kt>>>25,kt=yt+ze|0,vt^=kt<<9|kt>>>23,kt=vt+yt|0,ve^=kt<<13|kt>>>19,kt=ve+vt|0,ze^=kt<<18|kt>>>14,kt=zt+wr|0,Kr^=kt<<7|kt>>>25,kt=Kr+zt|0,ar^=kt<<9|kt>>>23,kt=ar+Kr|0,wr^=kt<<13|kt>>>19,kt=wr+ar|0,zt^=kt<<18|kt>>>14,kt=Kt+xt|0,Xt^=kt<<7|kt>>>25,kt=Xt+Kt|0,et^=kt<<9|kt>>>23,kt=et+Xt|0,xt^=kt<<13|kt>>>19,kt=xt+et|0,Kt^=kt<<18|kt>>>14;at[0]=Fr>>>0&255,at[1]=Fr>>>8&255,at[2]=Fr>>>16&255,at[3]=Fr>>>24&255,at[4]=ze>>>0&255,at[5]=ze>>>8&255,at[6]=ze>>>16&255,at[7]=ze>>>24&255,at[8]=zt>>>0&255,at[9]=zt>>>8&255,at[10]=zt>>>16&255,at[11]=zt>>>24&255,at[12]=Kt>>>0&255,at[13]=Kt>>>8&255,at[14]=Kt>>>16&255,at[15]=Kt>>>24&255,at[16]=yt>>>0&255,at[17]=yt>>>8&255,at[18]=yt>>>16&255,at[19]=yt>>>24&255,at[20]=vt>>>0&255,at[21]=vt>>>8&255,at[22]=vt>>>16&255,at[23]=vt>>>24&255,at[24]=ar>>>0&255,at[25]=ar>>>8&255,at[26]=ar>>>16&255,at[27]=ar>>>24&255,at[28]=wr>>>0&255,at[29]=wr>>>8&255,at[30]=wr>>>16&255,at[31]=wr>>>24&255}function ue(at,wt,At,Je){F(at,wt,At,Je)}function le(at,wt,At,Je){G(at,wt,At,Je)}var X=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function se(at,wt,At,Je,Lt,sr,ur){var vr=new Uint8Array(16),kr=new Uint8Array(64),Jr,hr;for(hr=0;hr<16;hr++)vr[hr]=0;for(hr=0;hr<8;hr++)vr[hr]=sr[hr];for(;Lt>=64;){for(ue(kr,vr,ur,X),hr=0;hr<64;hr++)at[wt+hr]=At[Je+hr]^kr[hr];for(Jr=1,hr=8;hr<16;hr++)Jr=Jr+(vr[hr]&255)|0,vr[hr]=Jr&255,Jr>>>=8;Lt-=64,wt+=64,Je+=64}if(Lt>0)for(ue(kr,vr,ur,X),hr=0;hr<Lt;hr++)at[wt+hr]=At[Je+hr]^kr[hr];return 0}function de(at,wt,At,Je,Lt){var sr=new Uint8Array(16),ur=new Uint8Array(64),vr,kr;for(kr=0;kr<16;kr++)sr[kr]=0;for(kr=0;kr<8;kr++)sr[kr]=Je[kr];for(;At>=64;){for(ue(ur,sr,Lt,X),kr=0;kr<64;kr++)at[wt+kr]=ur[kr];for(vr=1,kr=8;kr<16;kr++)vr=vr+(sr[kr]&255)|0,sr[kr]=vr&255,vr>>>=8;At-=64,wt+=64}if(At>0)for(ue(ur,sr,Lt,X),kr=0;kr<At;kr++)at[wt+kr]=ur[kr];return 0}function ye(at,wt,At,Je,Lt){var sr=new Uint8Array(32);le(sr,Je,Lt,X);for(var ur=new Uint8Array(8),vr=0;vr<8;vr++)ur[vr]=Je[vr+16];return de(at,wt,At,ur,sr)}function he(at,wt,At,Je,Lt,sr,ur){var vr=new Uint8Array(32);le(vr,sr,ur,X);for(var kr=new Uint8Array(8),Jr=0;Jr<8;Jr++)kr[Jr]=sr[Jr+16];return se(at,wt,At,Je,Lt,kr,vr)}var K=function(at){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var wt,At,Je,Lt,sr,ur,vr,kr;wt=at[0]&255|(at[1]&255)<<8,this.r[0]=wt&8191,At=at[2]&255|(at[3]&255)<<8,this.r[1]=(wt>>>13|At<<3)&8191,Je=at[4]&255|(at[5]&255)<<8,this.r[2]=(At>>>10|Je<<6)&7939,Lt=at[6]&255|(at[7]&255)<<8,this.r[3]=(Je>>>7|Lt<<9)&8191,sr=at[8]&255|(at[9]&255)<<8,this.r[4]=(Lt>>>4|sr<<12)&255,this.r[5]=sr>>>1&8190,ur=at[10]&255|(at[11]&255)<<8,this.r[6]=(sr>>>14|ur<<2)&8191,vr=at[12]&255|(at[13]&255)<<8,this.r[7]=(ur>>>11|vr<<5)&8065,kr=at[14]&255|(at[15]&255)<<8,this.r[8]=(vr>>>8|kr<<8)&8191,this.r[9]=kr>>>5&127,this.pad[0]=at[16]&255|(at[17]&255)<<8,this.pad[1]=at[18]&255|(at[19]&255)<<8,this.pad[2]=at[20]&255|(at[21]&255)<<8,this.pad[3]=at[22]&255|(at[23]&255)<<8,this.pad[4]=at[24]&255|(at[25]&255)<<8,this.pad[5]=at[26]&255|(at[27]&255)<<8,this.pad[6]=at[28]&255|(at[29]&255)<<8,this.pad[7]=at[30]&255|(at[31]&255)<<8};K.prototype.blocks=function(at,wt,At){for(var Je=this.fin?0:2048,Lt,sr,ur,vr,kr,Jr,hr,$r,Hr,rn,_r,pn,$t,In,ln,yn,Fr,On,En,ee=this.h[0],ve=this.h[1],ze=this.h[2],yt=this.h[3],vt=this.h[4],ar=this.h[5],wr=this.h[6],zt=this.h[7],Kr=this.h[8],Xt=this.h[9],et=this.r[0],xt=this.r[1],Kt=this.r[2],kt=this.r[3],or=this.r[4],Qr=this.r[5],Nr=this.r[6],An=this.r[7],mn=this.r[8],Nn=this.r[9];At>=16;)Lt=at[wt+0]&255|(at[wt+1]&255)<<8,ee+=Lt&8191,sr=at[wt+2]&255|(at[wt+3]&255)<<8,ve+=(Lt>>>13|sr<<3)&8191,ur=at[wt+4]&255|(at[wt+5]&255)<<8,ze+=(sr>>>10|ur<<6)&8191,vr=at[wt+6]&255|(at[wt+7]&255)<<8,yt+=(ur>>>7|vr<<9)&8191,kr=at[wt+8]&255|(at[wt+9]&255)<<8,vt+=(vr>>>4|kr<<12)&8191,ar+=kr>>>1&8191,Jr=at[wt+10]&255|(at[wt+11]&255)<<8,wr+=(kr>>>14|Jr<<2)&8191,hr=at[wt+12]&255|(at[wt+13]&255)<<8,zt+=(Jr>>>11|hr<<5)&8191,$r=at[wt+14]&255|(at[wt+15]&255)<<8,Kr+=(hr>>>8|$r<<8)&8191,Xt+=$r>>>5|Je,Hr=0,rn=Hr,rn+=ee*et,rn+=ve*(5*Nn),rn+=ze*(5*mn),rn+=yt*(5*An),rn+=vt*(5*Nr),Hr=rn>>>13,rn&=8191,rn+=ar*(5*Qr),rn+=wr*(5*or),rn+=zt*(5*kt),rn+=Kr*(5*Kt),rn+=Xt*(5*xt),Hr+=rn>>>13,rn&=8191,_r=Hr,_r+=ee*xt,_r+=ve*et,_r+=ze*(5*Nn),_r+=yt*(5*mn),_r+=vt*(5*An),Hr=_r>>>13,_r&=8191,_r+=ar*(5*Nr),_r+=wr*(5*Qr),_r+=zt*(5*or),_r+=Kr*(5*kt),_r+=Xt*(5*Kt),Hr+=_r>>>13,_r&=8191,pn=Hr,pn+=ee*Kt,pn+=ve*xt,pn+=ze*et,pn+=yt*(5*Nn),pn+=vt*(5*mn),Hr=pn>>>13,pn&=8191,pn+=ar*(5*An),pn+=wr*(5*Nr),pn+=zt*(5*Qr),pn+=Kr*(5*or),pn+=Xt*(5*kt),Hr+=pn>>>13,pn&=8191,$t=Hr,$t+=ee*kt,$t+=ve*Kt,$t+=ze*xt,$t+=yt*et,$t+=vt*(5*Nn),Hr=$t>>>13,$t&=8191,$t+=ar*(5*mn),$t+=wr*(5*An),$t+=zt*(5*Nr),$t+=Kr*(5*Qr),$t+=Xt*(5*or),Hr+=$t>>>13,$t&=8191,In=Hr,In+=ee*or,In+=ve*kt,In+=ze*Kt,In+=yt*xt,In+=vt*et,Hr=In>>>13,In&=8191,In+=ar*(5*Nn),In+=wr*(5*mn),In+=zt*(5*An),In+=Kr*(5*Nr),In+=Xt*(5*Qr),Hr+=In>>>13,In&=8191,ln=Hr,ln+=ee*Qr,ln+=ve*or,ln+=ze*kt,ln+=yt*Kt,ln+=vt*xt,Hr=ln>>>13,ln&=8191,ln+=ar*et,ln+=wr*(5*Nn),ln+=zt*(5*mn),ln+=Kr*(5*An),ln+=Xt*(5*Nr),Hr+=ln>>>13,ln&=8191,yn=Hr,yn+=ee*Nr,yn+=ve*Qr,yn+=ze*or,yn+=yt*kt,yn+=vt*Kt,Hr=yn>>>13,yn&=8191,yn+=ar*xt,yn+=wr*et,yn+=zt*(5*Nn),yn+=Kr*(5*mn),yn+=Xt*(5*An),Hr+=yn>>>13,yn&=8191,Fr=Hr,Fr+=ee*An,Fr+=ve*Nr,Fr+=ze*Qr,Fr+=yt*or,Fr+=vt*kt,Hr=Fr>>>13,Fr&=8191,Fr+=ar*Kt,Fr+=wr*xt,Fr+=zt*et,Fr+=Kr*(5*Nn),Fr+=Xt*(5*mn),Hr+=Fr>>>13,Fr&=8191,On=Hr,On+=ee*mn,On+=ve*An,On+=ze*Nr,On+=yt*Qr,On+=vt*or,Hr=On>>>13,On&=8191,On+=ar*kt,On+=wr*Kt,On+=zt*xt,On+=Kr*et,On+=Xt*(5*Nn),Hr+=On>>>13,On&=8191,En=Hr,En+=ee*Nn,En+=ve*mn,En+=ze*An,En+=yt*Nr,En+=vt*Qr,Hr=En>>>13,En&=8191,En+=ar*or,En+=wr*kt,En+=zt*Kt,En+=Kr*xt,En+=Xt*et,Hr+=En>>>13,En&=8191,Hr=(Hr<<2)+Hr|0,Hr=Hr+rn|0,rn=Hr&8191,Hr=Hr>>>13,_r+=Hr,ee=rn,ve=_r,ze=pn,yt=$t,vt=In,ar=ln,wr=yn,zt=Fr,Kr=On,Xt=En,wt+=16,At-=16;this.h[0]=ee,this.h[1]=ve,this.h[2]=ze,this.h[3]=yt,this.h[4]=vt,this.h[5]=ar,this.h[6]=wr,this.h[7]=zt,this.h[8]=Kr,this.h[9]=Xt},K.prototype.finish=function(at,wt){var At=new Uint16Array(10),Je,Lt,sr,ur;if(this.leftover){for(ur=this.leftover,this.buffer[ur++]=1;ur<16;ur++)this.buffer[ur]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(Je=this.h[1]>>>13,this.h[1]&=8191,ur=2;ur<10;ur++)this.h[ur]+=Je,Je=this.h[ur]>>>13,this.h[ur]&=8191;for(this.h[0]+=Je*5,Je=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=Je,Je=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=Je,At[0]=this.h[0]+5,Je=At[0]>>>13,At[0]&=8191,ur=1;ur<10;ur++)At[ur]=this.h[ur]+Je,Je=At[ur]>>>13,At[ur]&=8191;for(At[9]-=8192,Lt=(Je^1)-1,ur=0;ur<10;ur++)At[ur]&=Lt;for(Lt=~Lt,ur=0;ur<10;ur++)this.h[ur]=this.h[ur]&Lt|At[ur];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,sr=this.h[0]+this.pad[0],this.h[0]=sr&65535,ur=1;ur<8;ur++)sr=(this.h[ur]+this.pad[ur]|0)+(sr>>>16)|0,this.h[ur]=sr&65535;at[wt+0]=this.h[0]>>>0&255,at[wt+1]=this.h[0]>>>8&255,at[wt+2]=this.h[1]>>>0&255,at[wt+3]=this.h[1]>>>8&255,at[wt+4]=this.h[2]>>>0&255,at[wt+5]=this.h[2]>>>8&255,at[wt+6]=this.h[3]>>>0&255,at[wt+7]=this.h[3]>>>8&255,at[wt+8]=this.h[4]>>>0&255,at[wt+9]=this.h[4]>>>8&255,at[wt+10]=this.h[5]>>>0&255,at[wt+11]=this.h[5]>>>8&255,at[wt+12]=this.h[6]>>>0&255,at[wt+13]=this.h[6]>>>8&255,at[wt+14]=this.h[7]>>>0&255,at[wt+15]=this.h[7]>>>8&255},K.prototype.update=function(at,wt,At){var Je,Lt;if(this.leftover){for(Lt=16-this.leftover,Lt>At&&(Lt=At),Je=0;Je<Lt;Je++)this.buffer[this.leftover+Je]=at[wt+Je];if(At-=Lt,wt+=Lt,this.leftover+=Lt,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(At>=16&&(Lt=At-At%16,this.blocks(at,wt,Lt),wt+=Lt,At-=Lt),At){for(Je=0;Je<At;Je++)this.buffer[this.leftover+Je]=at[wt+Je];this.leftover+=At}};function B(at,wt,At,Je,Lt,sr){var ur=new K(sr);return ur.update(At,Je,Lt),ur.finish(at,wt),0}function L(at,wt,At,Je,Lt,sr){var ur=new Uint8Array(16);return B(ur,0,At,Je,Lt,sr),q(at,wt,ur,0)}function $(at,wt,At,Je,Lt){var sr;if(At<32)return-1;for(he(at,0,wt,0,At,Je,Lt),B(at,16,at,32,At-32,at),sr=0;sr<16;sr++)at[sr]=0;return 0}function T(at,wt,At,Je,Lt){var sr,ur=new Uint8Array(32);if(At<32||(ye(ur,0,32,Je,Lt),L(wt,16,wt,32,At-32,ur)!==0))return-1;for(he(at,0,wt,0,At,Je,Lt),sr=0;sr<32;sr++)at[sr]=0;return 0}function N(at,wt){var At;for(At=0;At<16;At++)at[At]=wt[At]|0}function j(at){var wt,At,Je=1;for(wt=0;wt<16;wt++)At=at[wt]+Je+65535,Je=Math.floor(At/65536),at[wt]=At-Je*65536;at[0]+=Je-1+37*(Je-1)}function Y(at,wt,At){for(var Je,Lt=~(At-1),sr=0;sr<16;sr++)Je=Lt&(at[sr]^wt[sr]),at[sr]^=Je,wt[sr]^=Je}function Z(at,wt){var At,Je,Lt,sr=w(),ur=w();for(At=0;At<16;At++)ur[At]=wt[At];for(j(ur),j(ur),j(ur),Je=0;Je<2;Je++){for(sr[0]=ur[0]-65517,At=1;At<15;At++)sr[At]=ur[At]-65535-(sr[At-1]>>16&1),sr[At-1]&=65535;sr[15]=ur[15]-32767-(sr[14]>>16&1),Lt=sr[15]>>16&1,sr[14]&=65535,Y(ur,sr,1-Lt)}for(At=0;At<16;At++)at[2*At]=ur[At]&255,at[2*At+1]=ur[At]>>8}function z(at,wt){var At=new Uint8Array(32),Je=new Uint8Array(32);return Z(At,at),Z(Je,wt),b(At,0,Je,0)}function fe(at){var wt=new Uint8Array(32);return Z(wt,at),wt[0]&1}function te(at,wt){var At;for(At=0;At<16;At++)at[At]=wt[2*At]+(wt[2*At+1]<<8);at[15]&=32767}function H(at,wt,At){for(var Je=0;Je<16;Je++)at[Je]=wt[Je]+At[Je]}function Q(at,wt,At){for(var Je=0;Je<16;Je++)at[Je]=wt[Je]-At[Je]}function oe(at,wt,At){var Je,Lt,sr=0,ur=0,vr=0,kr=0,Jr=0,hr=0,$r=0,Hr=0,rn=0,_r=0,pn=0,$t=0,In=0,ln=0,yn=0,Fr=0,On=0,En=0,ee=0,ve=0,ze=0,yt=0,vt=0,ar=0,wr=0,zt=0,Kr=0,Xt=0,et=0,xt=0,Kt=0,kt=At[0],or=At[1],Qr=At[2],Nr=At[3],An=At[4],mn=At[5],Nn=At[6],Vi=At[7],Kn=At[8],_s=At[9],Gs=At[10],zs=At[11],rs=At[12],to=At[13],ro=At[14],Ls=At[15];Je=wt[0],sr+=Je*kt,ur+=Je*or,vr+=Je*Qr,kr+=Je*Nr,Jr+=Je*An,hr+=Je*mn,$r+=Je*Nn,Hr+=Je*Vi,rn+=Je*Kn,_r+=Je*_s,pn+=Je*Gs,$t+=Je*zs,In+=Je*rs,ln+=Je*to,yn+=Je*ro,Fr+=Je*Ls,Je=wt[1],ur+=Je*kt,vr+=Je*or,kr+=Je*Qr,Jr+=Je*Nr,hr+=Je*An,$r+=Je*mn,Hr+=Je*Nn,rn+=Je*Vi,_r+=Je*Kn,pn+=Je*_s,$t+=Je*Gs,In+=Je*zs,ln+=Je*rs,yn+=Je*to,Fr+=Je*ro,On+=Je*Ls,Je=wt[2],vr+=Je*kt,kr+=Je*or,Jr+=Je*Qr,hr+=Je*Nr,$r+=Je*An,Hr+=Je*mn,rn+=Je*Nn,_r+=Je*Vi,pn+=Je*Kn,$t+=Je*_s,In+=Je*Gs,ln+=Je*zs,yn+=Je*rs,Fr+=Je*to,On+=Je*ro,En+=Je*Ls,Je=wt[3],kr+=Je*kt,Jr+=Je*or,hr+=Je*Qr,$r+=Je*Nr,Hr+=Je*An,rn+=Je*mn,_r+=Je*Nn,pn+=Je*Vi,$t+=Je*Kn,In+=Je*_s,ln+=Je*Gs,yn+=Je*zs,Fr+=Je*rs,On+=Je*to,En+=Je*ro,ee+=Je*Ls,Je=wt[4],Jr+=Je*kt,hr+=Je*or,$r+=Je*Qr,Hr+=Je*Nr,rn+=Je*An,_r+=Je*mn,pn+=Je*Nn,$t+=Je*Vi,In+=Je*Kn,ln+=Je*_s,yn+=Je*Gs,Fr+=Je*zs,On+=Je*rs,En+=Je*to,ee+=Je*ro,ve+=Je*Ls,Je=wt[5],hr+=Je*kt,$r+=Je*or,Hr+=Je*Qr,rn+=Je*Nr,_r+=Je*An,pn+=Je*mn,$t+=Je*Nn,In+=Je*Vi,ln+=Je*Kn,yn+=Je*_s,Fr+=Je*Gs,On+=Je*zs,En+=Je*rs,ee+=Je*to,ve+=Je*ro,ze+=Je*Ls,Je=wt[6],$r+=Je*kt,Hr+=Je*or,rn+=Je*Qr,_r+=Je*Nr,pn+=Je*An,$t+=Je*mn,In+=Je*Nn,ln+=Je*Vi,yn+=Je*Kn,Fr+=Je*_s,On+=Je*Gs,En+=Je*zs,ee+=Je*rs,ve+=Je*to,ze+=Je*ro,yt+=Je*Ls,Je=wt[7],Hr+=Je*kt,rn+=Je*or,_r+=Je*Qr,pn+=Je*Nr,$t+=Je*An,In+=Je*mn,ln+=Je*Nn,yn+=Je*Vi,Fr+=Je*Kn,On+=Je*_s,En+=Je*Gs,ee+=Je*zs,ve+=Je*rs,ze+=Je*to,yt+=Je*ro,vt+=Je*Ls,Je=wt[8],rn+=Je*kt,_r+=Je*or,pn+=Je*Qr,$t+=Je*Nr,In+=Je*An,ln+=Je*mn,yn+=Je*Nn,Fr+=Je*Vi,On+=Je*Kn,En+=Je*_s,ee+=Je*Gs,ve+=Je*zs,ze+=Je*rs,yt+=Je*to,vt+=Je*ro,ar+=Je*Ls,Je=wt[9],_r+=Je*kt,pn+=Je*or,$t+=Je*Qr,In+=Je*Nr,ln+=Je*An,yn+=Je*mn,Fr+=Je*Nn,On+=Je*Vi,En+=Je*Kn,ee+=Je*_s,ve+=Je*Gs,ze+=Je*zs,yt+=Je*rs,vt+=Je*to,ar+=Je*ro,wr+=Je*Ls,Je=wt[10],pn+=Je*kt,$t+=Je*or,In+=Je*Qr,ln+=Je*Nr,yn+=Je*An,Fr+=Je*mn,On+=Je*Nn,En+=Je*Vi,ee+=Je*Kn,ve+=Je*_s,ze+=Je*Gs,yt+=Je*zs,vt+=Je*rs,ar+=Je*to,wr+=Je*ro,zt+=Je*Ls,Je=wt[11],$t+=Je*kt,In+=Je*or,ln+=Je*Qr,yn+=Je*Nr,Fr+=Je*An,On+=Je*mn,En+=Je*Nn,ee+=Je*Vi,ve+=Je*Kn,ze+=Je*_s,yt+=Je*Gs,vt+=Je*zs,ar+=Je*rs,wr+=Je*to,zt+=Je*ro,Kr+=Je*Ls,Je=wt[12],In+=Je*kt,ln+=Je*or,yn+=Je*Qr,Fr+=Je*Nr,On+=Je*An,En+=Je*mn,ee+=Je*Nn,ve+=Je*Vi,ze+=Je*Kn,yt+=Je*_s,vt+=Je*Gs,ar+=Je*zs,wr+=Je*rs,zt+=Je*to,Kr+=Je*ro,Xt+=Je*Ls,Je=wt[13],ln+=Je*kt,yn+=Je*or,Fr+=Je*Qr,On+=Je*Nr,En+=Je*An,ee+=Je*mn,ve+=Je*Nn,ze+=Je*Vi,yt+=Je*Kn,vt+=Je*_s,ar+=Je*Gs,wr+=Je*zs,zt+=Je*rs,Kr+=Je*to,Xt+=Je*ro,et+=Je*Ls,Je=wt[14],yn+=Je*kt,Fr+=Je*or,On+=Je*Qr,En+=Je*Nr,ee+=Je*An,ve+=Je*mn,ze+=Je*Nn,yt+=Je*Vi,vt+=Je*Kn,ar+=Je*_s,wr+=Je*Gs,zt+=Je*zs,Kr+=Je*rs,Xt+=Je*to,et+=Je*ro,xt+=Je*Ls,Je=wt[15],Fr+=Je*kt,On+=Je*or,En+=Je*Qr,ee+=Je*Nr,ve+=Je*An,ze+=Je*mn,yt+=Je*Nn,vt+=Je*Vi,ar+=Je*Kn,wr+=Je*_s,zt+=Je*Gs,Kr+=Je*zs,Xt+=Je*rs,et+=Je*to,xt+=Je*ro,Kt+=Je*Ls,sr+=38*On,ur+=38*En,vr+=38*ee,kr+=38*ve,Jr+=38*ze,hr+=38*yt,$r+=38*vt,Hr+=38*ar,rn+=38*wr,_r+=38*zt,pn+=38*Kr,$t+=38*Xt,In+=38*et,ln+=38*xt,yn+=38*Kt,Lt=1,Je=sr+Lt+65535,Lt=Math.floor(Je/65536),sr=Je-Lt*65536,Je=ur+Lt+65535,Lt=Math.floor(Je/65536),ur=Je-Lt*65536,Je=vr+Lt+65535,Lt=Math.floor(Je/65536),vr=Je-Lt*65536,Je=kr+Lt+65535,Lt=Math.floor(Je/65536),kr=Je-Lt*65536,Je=Jr+Lt+65535,Lt=Math.floor(Je/65536),Jr=Je-Lt*65536,Je=hr+Lt+65535,Lt=Math.floor(Je/65536),hr=Je-Lt*65536,Je=$r+Lt+65535,Lt=Math.floor(Je/65536),$r=Je-Lt*65536,Je=Hr+Lt+65535,Lt=Math.floor(Je/65536),Hr=Je-Lt*65536,Je=rn+Lt+65535,Lt=Math.floor(Je/65536),rn=Je-Lt*65536,Je=_r+Lt+65535,Lt=Math.floor(Je/65536),_r=Je-Lt*65536,Je=pn+Lt+65535,Lt=Math.floor(Je/65536),pn=Je-Lt*65536,Je=$t+Lt+65535,Lt=Math.floor(Je/65536),$t=Je-Lt*65536,Je=In+Lt+65535,Lt=Math.floor(Je/65536),In=Je-Lt*65536,Je=ln+Lt+65535,Lt=Math.floor(Je/65536),ln=Je-Lt*65536,Je=yn+Lt+65535,Lt=Math.floor(Je/65536),yn=Je-Lt*65536,Je=Fr+Lt+65535,Lt=Math.floor(Je/65536),Fr=Je-Lt*65536,sr+=Lt-1+37*(Lt-1),Lt=1,Je=sr+Lt+65535,Lt=Math.floor(Je/65536),sr=Je-Lt*65536,Je=ur+Lt+65535,Lt=Math.floor(Je/65536),ur=Je-Lt*65536,Je=vr+Lt+65535,Lt=Math.floor(Je/65536),vr=Je-Lt*65536,Je=kr+Lt+65535,Lt=Math.floor(Je/65536),kr=Je-Lt*65536,Je=Jr+Lt+65535,Lt=Math.floor(Je/65536),Jr=Je-Lt*65536,Je=hr+Lt+65535,Lt=Math.floor(Je/65536),hr=Je-Lt*65536,Je=$r+Lt+65535,Lt=Math.floor(Je/65536),$r=Je-Lt*65536,Je=Hr+Lt+65535,Lt=Math.floor(Je/65536),Hr=Je-Lt*65536,Je=rn+Lt+65535,Lt=Math.floor(Je/65536),rn=Je-Lt*65536,Je=_r+Lt+65535,Lt=Math.floor(Je/65536),_r=Je-Lt*65536,Je=pn+Lt+65535,Lt=Math.floor(Je/65536),pn=Je-Lt*65536,Je=$t+Lt+65535,Lt=Math.floor(Je/65536),$t=Je-Lt*65536,Je=In+Lt+65535,Lt=Math.floor(Je/65536),In=Je-Lt*65536,Je=ln+Lt+65535,Lt=Math.floor(Je/65536),ln=Je-Lt*65536,Je=yn+Lt+65535,Lt=Math.floor(Je/65536),yn=Je-Lt*65536,Je=Fr+Lt+65535,Lt=Math.floor(Je/65536),Fr=Je-Lt*65536,sr+=Lt-1+37*(Lt-1),at[0]=sr,at[1]=ur,at[2]=vr,at[3]=kr,at[4]=Jr,at[5]=hr,at[6]=$r,at[7]=Hr,at[8]=rn,at[9]=_r,at[10]=pn,at[11]=$t,at[12]=In,at[13]=ln,at[14]=yn,at[15]=Fr}function _e(at,wt){oe(at,wt,wt)}function ge(at,wt){var At=w(),Je;for(Je=0;Je<16;Je++)At[Je]=wt[Je];for(Je=253;Je>=0;Je--)_e(At,At),Je!==2&&Je!==4&&oe(At,At,wt);for(Je=0;Je<16;Je++)at[Je]=At[Je]}function be(at,wt){var At=w(),Je;for(Je=0;Je<16;Je++)At[Je]=wt[Je];for(Je=250;Je>=0;Je--)_e(At,At),Je!==1&&oe(At,At,wt);for(Je=0;Je<16;Je++)at[Je]=At[Je]}function we(at,wt,At){var Je=new Uint8Array(32),Lt=new Float64Array(80),sr,ur,vr=w(),kr=w(),Jr=w(),hr=w(),$r=w(),Hr=w();for(ur=0;ur<31;ur++)Je[ur]=wt[ur];for(Je[31]=wt[31]&127|64,Je[0]&=248,te(Lt,At),ur=0;ur<16;ur++)kr[ur]=Lt[ur],hr[ur]=vr[ur]=Jr[ur]=0;for(vr[0]=hr[0]=1,ur=254;ur>=0;--ur)sr=Je[ur>>>3]>>>(ur&7)&1,Y(vr,kr,sr),Y(Jr,hr,sr),H($r,vr,Jr),Q(vr,vr,Jr),H(Jr,kr,hr),Q(kr,kr,hr),_e(hr,$r),_e(Hr,vr),oe(vr,Jr,vr),oe(Jr,kr,$r),H($r,vr,Jr),Q(vr,vr,Jr),_e(kr,vr),Q(Jr,hr,Hr),oe(vr,Jr,m),H(vr,vr,hr),oe(Jr,Jr,vr),oe(vr,hr,Hr),oe(hr,kr,Lt),_e(kr,$r),Y(vr,kr,sr),Y(Jr,hr,sr);for(ur=0;ur<16;ur++)Lt[ur+16]=vr[ur],Lt[ur+32]=Jr[ur],Lt[ur+48]=kr[ur],Lt[ur+64]=hr[ur];var rn=Lt.subarray(32),_r=Lt.subarray(16);return ge(rn,rn),oe(_r,_r,rn),Z(at,_r),0}function Ee(at,wt){return we(at,wt,c)}function me(at,wt){return E(wt,32),Ee(at,wt)}function Ke(at,wt,At){var Je=new Uint8Array(32);return we(Je,At,wt),le(at,v,Je,X)}var He=$,Ie=T;function Le(at,wt,At,Je,Lt,sr){var ur=new Uint8Array(32);return Ke(ur,Lt,sr),He(at,wt,At,Je,ur)}function Ge(at,wt,At,Je,Lt,sr){var ur=new Uint8Array(32);return Ke(ur,Lt,sr),Ie(at,wt,At,Je,ur)}var Be=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function We(at,wt,At,Je){for(var Lt=new Int32Array(16),sr=new Int32Array(16),ur,vr,kr,Jr,hr,$r,Hr,rn,_r,pn,$t,In,ln,yn,Fr,On,En,ee,ve,ze,yt,vt,ar,wr,zt,Kr,Xt=at[0],et=at[1],xt=at[2],Kt=at[3],kt=at[4],or=at[5],Qr=at[6],Nr=at[7],An=wt[0],mn=wt[1],Nn=wt[2],Vi=wt[3],Kn=wt[4],_s=wt[5],Gs=wt[6],zs=wt[7],rs=0;Je>=128;){for(ve=0;ve<16;ve++)ze=8*ve+rs,Lt[ve]=At[ze+0]<<24|At[ze+1]<<16|At[ze+2]<<8|At[ze+3],sr[ve]=At[ze+4]<<24|At[ze+5]<<16|At[ze+6]<<8|At[ze+7];for(ve=0;ve<80;ve++)if(ur=Xt,vr=et,kr=xt,Jr=Kt,hr=kt,$r=or,Hr=Qr,rn=Nr,_r=An,pn=mn,$t=Nn,In=Vi,ln=Kn,yn=_s,Fr=Gs,On=zs,yt=Nr,vt=zs,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=(kt>>>14|Kn<<18)^(kt>>>18|Kn<<14)^(Kn>>>9|kt<<23),vt=(Kn>>>14|kt<<18)^(Kn>>>18|kt<<14)^(kt>>>9|Kn<<23),ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,yt=kt&or^~kt&Qr,vt=Kn&_s^~Kn&Gs,ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,yt=Be[ve*2],vt=Be[ve*2+1],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,yt=Lt[ve%16],vt=sr[ve%16],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,En=zt&65535|Kr<<16,ee=ar&65535|wr<<16,yt=En,vt=ee,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=(Xt>>>28|An<<4)^(An>>>2|Xt<<30)^(An>>>7|Xt<<25),vt=(An>>>28|Xt<<4)^(Xt>>>2|An<<30)^(Xt>>>7|An<<25),ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,yt=Xt&et^Xt&xt^et&xt,vt=An&mn^An&Nn^mn&Nn,ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,rn=zt&65535|Kr<<16,On=ar&65535|wr<<16,yt=Jr,vt=In,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=En,vt=ee,ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,Jr=zt&65535|Kr<<16,In=ar&65535|wr<<16,et=ur,xt=vr,Kt=kr,kt=Jr,or=hr,Qr=$r,Nr=Hr,Xt=rn,mn=_r,Nn=pn,Vi=$t,Kn=In,_s=ln,Gs=yn,zs=Fr,An=On,ve%16===15)for(ze=0;ze<16;ze++)yt=Lt[ze],vt=sr[ze],ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=Lt[(ze+9)%16],vt=sr[(ze+9)%16],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,En=Lt[(ze+1)%16],ee=sr[(ze+1)%16],yt=(En>>>1|ee<<31)^(En>>>8|ee<<24)^En>>>7,vt=(ee>>>1|En<<31)^(ee>>>8|En<<24)^(ee>>>7|En<<25),ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,En=Lt[(ze+14)%16],ee=sr[(ze+14)%16],yt=(En>>>19|ee<<13)^(ee>>>29|En<<3)^En>>>6,vt=(ee>>>19|En<<13)^(En>>>29|ee<<3)^(ee>>>6|En<<26),ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,Lt[ze]=zt&65535|Kr<<16,sr[ze]=ar&65535|wr<<16;yt=Xt,vt=An,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[0],vt=wt[0],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[0]=Xt=zt&65535|Kr<<16,wt[0]=An=ar&65535|wr<<16,yt=et,vt=mn,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[1],vt=wt[1],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[1]=et=zt&65535|Kr<<16,wt[1]=mn=ar&65535|wr<<16,yt=xt,vt=Nn,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[2],vt=wt[2],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[2]=xt=zt&65535|Kr<<16,wt[2]=Nn=ar&65535|wr<<16,yt=Kt,vt=Vi,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[3],vt=wt[3],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[3]=Kt=zt&65535|Kr<<16,wt[3]=Vi=ar&65535|wr<<16,yt=kt,vt=Kn,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[4],vt=wt[4],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[4]=kt=zt&65535|Kr<<16,wt[4]=Kn=ar&65535|wr<<16,yt=or,vt=_s,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[5],vt=wt[5],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[5]=or=zt&65535|Kr<<16,wt[5]=_s=ar&65535|wr<<16,yt=Qr,vt=Gs,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[6],vt=wt[6],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[6]=Qr=zt&65535|Kr<<16,wt[6]=Gs=ar&65535|wr<<16,yt=Nr,vt=zs,ar=vt&65535,wr=vt>>>16,zt=yt&65535,Kr=yt>>>16,yt=at[7],vt=wt[7],ar+=vt&65535,wr+=vt>>>16,zt+=yt&65535,Kr+=yt>>>16,wr+=ar>>>16,zt+=wr>>>16,Kr+=zt>>>16,at[7]=Nr=zt&65535|Kr<<16,wt[7]=zs=ar&65535|wr<<16,rs+=128,Je-=128}return Je}function Ze(at,wt,At){var Je=new Int32Array(8),Lt=new Int32Array(8),sr=new Uint8Array(256),ur,vr=At;for(Je[0]=1779033703,Je[1]=3144134277,Je[2]=1013904242,Je[3]=2773480762,Je[4]=1359893119,Je[5]=2600822924,Je[6]=528734635,Je[7]=1541459225,Lt[0]=4089235720,Lt[1]=2227873595,Lt[2]=4271175723,Lt[3]=1595750129,Lt[4]=2917565137,Lt[5]=725511199,Lt[6]=4215389547,Lt[7]=327033209,We(Je,Lt,wt,At),At%=128,ur=0;ur<At;ur++)sr[ur]=wt[vr-At+ur];for(sr[At]=128,At=256-128*(At<112?1:0),sr[At-9]=0,M(sr,At-8,vr/536870912|0,vr<<3),We(Je,Lt,sr,At),ur=0;ur<8;ur++)M(at,8*ur,Je[ur],Lt[ur]);return 0}function _t(at,wt){var At=w(),Je=w(),Lt=w(),sr=w(),ur=w(),vr=w(),kr=w(),Jr=w(),hr=w();Q(At,at[1],at[0]),Q(hr,wt[1],wt[0]),oe(At,At,hr),H(Je,at[0],at[1]),H(hr,wt[0],wt[1]),oe(Je,Je,hr),oe(Lt,at[3],wt[3]),oe(Lt,Lt,x),oe(sr,at[2],wt[2]),H(sr,sr,sr),Q(ur,Je,At),Q(vr,sr,Lt),H(kr,sr,Lt),H(Jr,Je,At),oe(at[0],ur,vr),oe(at[1],Jr,kr),oe(at[2],kr,vr),oe(at[3],ur,Jr)}function Ft(at,wt,At){var Je;for(Je=0;Je<4;Je++)Y(at[Je],wt[Je],At)}function gt(at,wt){var At=w(),Je=w(),Lt=w();ge(Lt,wt[2]),oe(At,wt[0],Lt),oe(Je,wt[1],Lt),Z(at,Je),at[31]^=fe(At)<<7}function lt(at,wt,At){var Je,Lt;for(N(at[0],d),N(at[1],p),N(at[2],p),N(at[3],d),Lt=255;Lt>=0;--Lt)Je=At[Lt/8|0]>>(Lt&7)&1,Ft(at,wt,Je),_t(wt,at),_t(at,at),Ft(at,wt,Je)}function dt(at,wt){var At=[w(),w(),w(),w()];N(At[0],R),N(At[1],S),N(At[2],p),oe(At[3],R,S),lt(at,At,wt)}function tt(at,wt,At){var Je=new Uint8Array(64),Lt=[w(),w(),w(),w()],sr;for(At||E(wt,32),Ze(Je,wt,32),Je[0]&=248,Je[31]&=127,Je[31]|=64,dt(Lt,Je),gt(at,Lt),sr=0;sr<32;sr++)wt[sr+32]=at[sr];return 0}var rt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ke(at,wt){var At,Je,Lt,sr;for(Je=63;Je>=32;--Je){for(At=0,Lt=Je-32,sr=Je-12;Lt<sr;++Lt)wt[Lt]+=At-16*wt[Je]*rt[Lt-(Je-32)],At=Math.floor((wt[Lt]+128)/256),wt[Lt]-=At*256;wt[Lt]+=At,wt[Je]=0}for(At=0,Lt=0;Lt<32;Lt++)wt[Lt]+=At-(wt[31]>>4)*rt[Lt],At=wt[Lt]>>8,wt[Lt]&=255;for(Lt=0;Lt<32;Lt++)wt[Lt]-=At*rt[Lt];for(Je=0;Je<32;Je++)wt[Je+1]+=wt[Je]>>8,at[Je]=wt[Je]&255}function xe(at){var wt=new Float64Array(64),At;for(At=0;At<64;At++)wt[At]=at[At];for(At=0;At<64;At++)at[At]=0;ke(at,wt)}function Pe(at,wt,At,Je){var Lt=new Uint8Array(64),sr=new Uint8Array(64),ur=new Uint8Array(64),vr,kr,Jr=new Float64Array(64),hr=[w(),w(),w(),w()];Ze(Lt,Je,32),Lt[0]&=248,Lt[31]&=127,Lt[31]|=64;var $r=At+64;for(vr=0;vr<At;vr++)at[64+vr]=wt[vr];for(vr=0;vr<32;vr++)at[32+vr]=Lt[32+vr];for(Ze(ur,at.subarray(32),At+32),xe(ur),dt(hr,ur),gt(at,hr),vr=32;vr<64;vr++)at[vr]=Je[vr];for(Ze(sr,at,At+64),xe(sr),vr=0;vr<64;vr++)Jr[vr]=0;for(vr=0;vr<32;vr++)Jr[vr]=ur[vr];for(vr=0;vr<32;vr++)for(kr=0;kr<32;kr++)Jr[vr+kr]+=sr[vr]*Lt[kr];return ke(at.subarray(32),Jr),$r}function it(at,wt){var At=w(),Je=w(),Lt=w(),sr=w(),ur=w(),vr=w(),kr=w();return N(at[2],p),te(at[1],wt),_e(Lt,at[1]),oe(sr,Lt,C),Q(Lt,Lt,at[2]),H(sr,at[2],sr),_e(ur,sr),_e(vr,ur),oe(kr,vr,ur),oe(At,kr,Lt),oe(At,At,sr),be(At,At),oe(At,At,Lt),oe(At,At,sr),oe(At,At,sr),oe(at[0],At,sr),_e(Je,at[0]),oe(Je,Je,sr),z(Je,Lt)&&oe(at[0],at[0],O),_e(Je,at[0]),oe(Je,Je,sr),z(Je,Lt)?-1:(fe(at[0])===wt[31]>>7&&Q(at[0],d,at[0]),oe(at[3],at[0],at[1]),0)}function Xe(at,wt,At,Je){var Lt,sr=new Uint8Array(32),ur=new Uint8Array(64),vr=[w(),w(),w(),w()],kr=[w(),w(),w(),w()];if(At<64||it(kr,Je))return-1;for(Lt=0;Lt<At;Lt++)at[Lt]=wt[Lt];for(Lt=0;Lt<32;Lt++)at[Lt+32]=Je[Lt];if(Ze(ur,at,At),xe(ur),lt(vr,kr,ur),dt(kr,wt.subarray(32)),_t(vr,kr),gt(sr,vr),At-=64,b(wt,0,sr,0)){for(Lt=0;Lt<At;Lt++)at[Lt]=0;return-1}for(Lt=0;Lt<At;Lt++)at[Lt]=wt[Lt+64];return At}var st=32,It=24,ft=32,Jt=16,Ot=32,Ct=32,qe=32,Yt=32,ot=32,Ae=It,Rt=ft,Ht=Jt,bt=64,Mt=32,tr=64,Vt=32,Et=64;h.lowlevel={crypto_core_hsalsa20:le,crypto_stream_xor:he,crypto_stream:ye,crypto_stream_salsa20_xor:se,crypto_stream_salsa20:de,crypto_onetimeauth:B,crypto_onetimeauth_verify:L,crypto_verify_16:q,crypto_verify_32:b,crypto_secretbox:$,crypto_secretbox_open:T,crypto_scalarmult:we,crypto_scalarmult_base:Ee,crypto_box_beforenm:Ke,crypto_box_afternm:He,crypto_box:Le,crypto_box_open:Ge,crypto_box_keypair:me,crypto_hash:Ze,crypto_sign:Pe,crypto_sign_keypair:tt,crypto_sign_open:Xe,crypto_secretbox_KEYBYTES:st,crypto_secretbox_NONCEBYTES:It,crypto_secretbox_ZEROBYTES:ft,crypto_secretbox_BOXZEROBYTES:Jt,crypto_scalarmult_BYTES:Ot,crypto_scalarmult_SCALARBYTES:Ct,crypto_box_PUBLICKEYBYTES:qe,crypto_box_SECRETKEYBYTES:Yt,crypto_box_BEFORENMBYTES:ot,crypto_box_NONCEBYTES:Ae,crypto_box_ZEROBYTES:Rt,crypto_box_BOXZEROBYTES:Ht,crypto_sign_BYTES:bt,crypto_sign_PUBLICKEYBYTES:Mt,crypto_sign_SECRETKEYBYTES:tr,crypto_sign_SEEDBYTES:Vt,crypto_hash_BYTES:Et,gf:w,D:C,L:rt,pack25519:Z,unpack25519:te,M:oe,A:H,S:_e,Z:Q,pow2523:be,add:_t,set25519:N,modL:ke,scalarmult:lt,scalarbase:dt};function Ye(at,wt){if(at.length!==st)throw new Error("bad key size");if(wt.length!==It)throw new Error("bad nonce size")}function Tt(at,wt){if(at.length!==qe)throw new Error("bad public key size");if(wt.length!==Yt)throw new Error("bad secret key size")}function Wt(){for(var at=0;at<arguments.length;at++)if(!(arguments[at]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function dr(at){for(var wt=0;wt<at.length;wt++)at[wt]=0}h.randomBytes=function(at){var wt=new Uint8Array(at);return E(wt,at),wt},h.secretbox=function(at,wt,At){Wt(at,wt,At),Ye(At,wt);for(var Je=new Uint8Array(ft+at.length),Lt=new Uint8Array(Je.length),sr=0;sr<at.length;sr++)Je[sr+ft]=at[sr];return $(Lt,Je,Je.length,wt,At),Lt.subarray(Jt)},h.secretbox.open=function(at,wt,At){Wt(at,wt,At),Ye(At,wt);for(var Je=new Uint8Array(Jt+at.length),Lt=new Uint8Array(Je.length),sr=0;sr<at.length;sr++)Je[sr+Jt]=at[sr];return Je.length<32||T(Lt,Je,Je.length,wt,At)!==0?null:Lt.subarray(ft)},h.secretbox.keyLength=st,h.secretbox.nonceLength=It,h.secretbox.overheadLength=Jt,h.scalarMult=function(at,wt){if(Wt(at,wt),at.length!==Ct)throw new Error("bad n size");if(wt.length!==Ot)throw new Error("bad p size");var At=new Uint8Array(Ot);return we(At,at,wt),At},h.scalarMult.base=function(at){if(Wt(at),at.length!==Ct)throw new Error("bad n size");var wt=new Uint8Array(Ot);return Ee(wt,at),wt},h.scalarMult.scalarLength=Ct,h.scalarMult.groupElementLength=Ot,h.box=function(at,wt,At,Je){var Lt=h.box.before(At,Je);return h.secretbox(at,wt,Lt)},h.box.before=function(at,wt){Wt(at,wt),Tt(at,wt);var At=new Uint8Array(ot);return Ke(At,at,wt),At},h.box.after=h.secretbox,h.box.open=function(at,wt,At,Je){var Lt=h.box.before(At,Je);return h.secretbox.open(at,wt,Lt)},h.box.open.after=h.secretbox.open,h.box.keyPair=function(){var at=new Uint8Array(qe),wt=new Uint8Array(Yt);return me(at,wt),{publicKey:at,secretKey:wt}},h.box.keyPair.fromSecretKey=function(at){if(Wt(at),at.length!==Yt)throw new Error("bad secret key size");var wt=new Uint8Array(qe);return Ee(wt,at),{publicKey:wt,secretKey:new Uint8Array(at)}},h.box.publicKeyLength=qe,h.box.secretKeyLength=Yt,h.box.sharedKeyLength=ot,h.box.nonceLength=Ae,h.box.overheadLength=h.secretbox.overheadLength,h.sign=function(at,wt){if(Wt(at,wt),wt.length!==tr)throw new Error("bad secret key size");var At=new Uint8Array(bt+at.length);return Pe(At,at,at.length,wt),At},h.sign.open=function(at,wt){if(Wt(at,wt),wt.length!==Mt)throw new Error("bad public key size");var At=new Uint8Array(at.length),Je=Xe(At,at,at.length,wt);if(Je<0)return null;for(var Lt=new Uint8Array(Je),sr=0;sr<Lt.length;sr++)Lt[sr]=At[sr];return Lt},h.sign.detached=function(at,wt){for(var At=h.sign(at,wt),Je=new Uint8Array(bt),Lt=0;Lt<Je.length;Lt++)Je[Lt]=At[Lt];return Je},h.sign.detached.verify=function(at,wt,At){if(Wt(at,wt,At),wt.length!==bt)throw new Error("bad signature size");if(At.length!==Mt)throw new Error("bad public key size");var Je=new Uint8Array(bt+at.length),Lt=new Uint8Array(bt+at.length),sr;for(sr=0;sr<bt;sr++)Je[sr]=wt[sr];for(sr=0;sr<at.length;sr++)Je[sr+bt]=at[sr];return Xe(Lt,Je,Je.length,At)>=0},h.sign.keyPair=function(){var at=new Uint8Array(Mt),wt=new Uint8Array(tr);return tt(at,wt),{publicKey:at,secretKey:wt}},h.sign.keyPair.fromSecretKey=function(at){if(Wt(at),at.length!==tr)throw new Error("bad secret key size");for(var wt=new Uint8Array(Mt),At=0;At<wt.length;At++)wt[At]=at[32+At];return{publicKey:wt,secretKey:new Uint8Array(at)}},h.sign.keyPair.fromSeed=function(at){if(Wt(at),at.length!==Vt)throw new Error("bad seed size");for(var wt=new Uint8Array(Mt),At=new Uint8Array(tr),Je=0;Je<32;Je++)At[Je]=at[Je];return tt(wt,At,!0),{publicKey:wt,secretKey:At}},h.sign.publicKeyLength=Mt,h.sign.secretKeyLength=tr,h.sign.seedLength=Vt,h.sign.signatureLength=bt,h.hash=function(at){Wt(at);var wt=new Uint8Array(Et);return Ze(wt,at,at.length),wt},h.hash.hashLength=Et,h.verify=function(at,wt){return Wt(at,wt),at.length===0||wt.length===0||at.length!==wt.length?!1:k(at,0,wt,0,at.length)===0},h.setPRNG=function(at){E=at},function(){var at=typeof self<"u"?self.crypto||self.msCrypto:null;if(at&&at.getRandomValues){var wt=65536;h.setPRNG(function(At,Je){var Lt,sr=new Uint8Array(Je);for(Lt=0;Lt<Je;Lt+=wt)at.getRandomValues(sr.subarray(Lt,Lt+Math.min(Je-Lt,wt)));for(Lt=0;Lt<Je;Lt++)At[Lt]=sr[Lt];dr(sr)})}else at=_(16206),at&&at.randomBytes&&h.setPRNG(function(At,Je){var Lt,sr=at.randomBytes(Je);for(Lt=0;Lt<Je;Lt++)At[Lt]=sr[Lt];dr(sr)})}()})(ie.exports?ie.exports:self.nacl=self.nacl||{})},16934:function(ie,f){(function(_,h){"use strict";var w="0.7.40",E="",v="?",c="function",d="undefined",p="object",m="string",C="major",x="model",R="name",S="type",O="vendor",M="version",k="architecture",q="console",b="mobile",F="tablet",G="smarttv",ue="wearable",le="embedded",X=500,se="Amazon",de="Apple",ye="ASUS",he="BlackBerry",K="Browser",B="Chrome",L="Edge",$="Firefox",T="Google",N="Huawei",j="LG",Y="Microsoft",Z="Motorola",z="Opera",fe="Samsung",te="Sharp",H="Sony",Q="Xiaomi",oe="Zebra",_e="Facebook",ge="Chromium OS",be="Mac OS",we=" Browser",Ee=function(dt,tt){var rt={};for(var ke in dt)tt[ke]&&tt[ke].length%2===0?rt[ke]=tt[ke].concat(dt[ke]):rt[ke]=dt[ke];return rt},me=function(dt){for(var tt={},rt=0;rt<dt.length;rt++)tt[dt[rt].toUpperCase()]=dt[rt];return tt},Ke=function(dt,tt){return typeof dt===m?He(tt).indexOf(He(dt))!==-1:!1},He=function(dt){return dt.toLowerCase()},Ie=function(dt){return typeof dt===m?dt.replace(/[^\d\.]/g,E).split(".")[0]:h},Le=function(dt,tt){if(typeof dt===m)return dt=dt.replace(/^\s\s*/,E),typeof tt===d?dt:dt.substring(0,X)},Ge=function(dt,tt){for(var rt=0,ke,xe,Pe,it,Xe,st;rt<tt.length&&!Xe;){var It=tt[rt],ft=tt[rt+1];for(ke=xe=0;ke<It.length&&!Xe&&It[ke];)if(Xe=It[ke++].exec(dt),Xe)for(Pe=0;Pe<ft.length;Pe++)st=Xe[++xe],it=ft[Pe],typeof it===p&&it.length>0?it.length===2?typeof it[1]==c?this[it[0]]=it[1].call(this,st):this[it[0]]=it[1]:it.length===3?typeof it[1]===c&&!(it[1].exec&&it[1].test)?this[it[0]]=st?it[1].call(this,st,it[2]):h:this[it[0]]=st?st.replace(it[1],it[2]):h:it.length===4&&(this[it[0]]=st?it[3].call(this,st.replace(it[1],it[2])):h):this[it]=st||h;rt+=2}},Be=function(dt,tt){for(var rt in tt)if(typeof tt[rt]===p&&tt[rt].length>0){for(var ke=0;ke<tt[rt].length;ke++)if(Ke(tt[rt][ke],dt))return rt===v?h:rt}else if(Ke(tt[rt],dt))return rt===v?h:rt;return tt.hasOwnProperty("*")?tt["*"]:dt},We={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Ze={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},_t={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[M,[R,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[M,[R,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[R,M],[/opios[\/ ]+([\w\.]+)/i],[M,[R,z+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[M,[R,z+" GX"]],[/\bopr\/([\w\.]+)/i],[M,[R,z]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[M,[R,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[M,[R,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[R,M],[/quark(?:pc)?\/([-\w\.]+)/i],[M,[R,"Quark"]],[/\bddg\/([\w\.]+)/i],[M,[R,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[M,[R,"UC"+K]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[M,[R,"WeChat"]],[/konqueror\/([\w\.]+)/i],[M,[R,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[M,[R,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[M,[R,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[M,[R,"Smart Lenovo "+K]],[/(avast|avg)\/([\w\.]+)/i],[[R,/(.+)/,"$1 Secure "+K],M],[/\bfocus\/([\w\.]+)/i],[M,[R,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[M,[R,z+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[M,[R,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[M,[R,"Dolphin"]],[/coast\/([\w\.]+)/i],[M,[R,z+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[M,[R,"MIUI"+we]],[/fxios\/([\w\.-]+)/i],[M,[R,$]],[/\bqihoobrowser\/?([\w\.]*)/i],[M,[R,"360"]],[/\b(qq)\/([\w\.]+)/i],[[R,/(.+)/,"$1Browser"],M],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[R,/(.+)/,"$1"+we],M],[/samsungbrowser\/([\w\.]+)/i],[M,[R,fe+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[M,[R,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[R,"Sogou Mobile"],M],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[R,M],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[R],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[M,R],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[R,_e],M],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[R,M],[/\bgsa\/([\w\.]+) .*safari\//i],[M,[R,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[M,[R,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[M,[R,B+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[R,B+" WebView"],M],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[M,[R,"Android "+K]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[R,M],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[M,[R,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[M,R],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[R,[M,Be,We]],[/(webkit|khtml)\/([\w\.]+)/i],[R,M],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[R,"Netscape"],M],[/(wolvic|librewolf)\/([\w\.]+)/i],[R,M],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[M,[R,$+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[R,[M,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[R,[M,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[k,"amd64"]],[/(ia32(?=;))/i],[[k,He]],[/((?:i[346]|x)86)[;\)]/i],[[k,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[k,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[k,"armhf"]],[/windows (ce|mobile); ppc;/i],[[k,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[k,/ower/,E,He]],[/(sun4\w)[;\)]/i],[[k,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[k,He]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[x,[O,fe],[S,F]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[x,[O,fe],[S,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[x,[O,de],[S,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[x,[O,de],[S,F]],[/(macintosh);/i],[x,[O,de]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[x,[O,te],[S,b]],[/(?:honor)([-\w ]+)[;\)]/i],[x,[O,"Honor"],[S,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[x,[O,N],[S,F]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[x,[O,N],[S,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[x,/_/g," "],[O,Q],[S,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[x,/_/g," "],[O,Q],[S,F]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[x,[O,"OPPO"],[S,b]],[/\b(opd2\d{3}a?) bui/i],[x,[O,"OPPO"],[S,F]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[x,[O,"Vivo"],[S,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[x,[O,"Realme"],[S,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[x,[O,Z],[S,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[x,[O,Z],[S,F]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[x,[O,j],[S,F]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[x,[O,j],[S,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[x,[O,"Lenovo"],[S,F]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[x,/_/g," "],[O,"Nokia"],[S,b]],[/(pixel c)\b/i],[x,[O,T],[S,F]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[x,[O,T],[S,b]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[x,[O,H],[S,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[x,"Xperia Tablet"],[O,H],[S,F]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[x,[O,"OnePlus"],[S,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[x,[O,se],[S,F]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[x,/(.+)/g,"Fire Phone $1"],[O,se],[S,b]],[/(playbook);[-\w\),; ]+(rim)/i],[x,O,[S,F]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[x,[O,he],[S,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[x,[O,ye],[S,F]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[x,[O,ye],[S,b]],[/(nexus 9)/i],[x,[O,"HTC"],[S,F]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[O,[x,/_/g," "],[S,b]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[x,[O,"TCL"],[S,F]],[/(itel) ((\w+))/i],[[O,He],x,[S,Be,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[x,[O,"Acer"],[S,F]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[x,[O,"Meizu"],[S,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[x,[O,"Ulefone"],[S,b]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[x,[O,"Energizer"],[S,b]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[x,[O,"Cat"],[S,b]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[x,[O,"Smartfren"],[S,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[x,[O,"Nothing"],[S,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[O,x,[S,b]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[O,x,[S,F]],[/(surface duo)/i],[x,[O,Y],[S,F]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[x,[O,"Fairphone"],[S,b]],[/(u304aa)/i],[x,[O,"AT&T"],[S,b]],[/\bsie-(\w*)/i],[x,[O,"Siemens"],[S,b]],[/\b(rct\w+) b/i],[x,[O,"RCA"],[S,F]],[/\b(venue[\d ]{2,7}) b/i],[x,[O,"Dell"],[S,F]],[/\b(q(?:mv|ta)\w+) b/i],[x,[O,"Verizon"],[S,F]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[x,[O,"Barnes & Noble"],[S,F]],[/\b(tm\d{3}\w+) b/i],[x,[O,"NuVision"],[S,F]],[/\b(k88) b/i],[x,[O,"ZTE"],[S,F]],[/\b(nx\d{3}j) b/i],[x,[O,"ZTE"],[S,b]],[/\b(gen\d{3}) b.+49h/i],[x,[O,"Swiss"],[S,b]],[/\b(zur\d{3}) b/i],[x,[O,"Swiss"],[S,F]],[/\b((zeki)?tb.*\b) b/i],[x,[O,"Zeki"],[S,F]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[O,"Dragon Touch"],x,[S,F]],[/\b(ns-?\w{0,9}) b/i],[x,[O,"Insignia"],[S,F]],[/\b((nxa|next)-?\w{0,9}) b/i],[x,[O,"NextBook"],[S,F]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[O,"Voice"],x,[S,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[O,"LvTel"],x,[S,b]],[/\b(ph-1) /i],[x,[O,"Essential"],[S,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[x,[O,"Envizen"],[S,F]],[/\b(trio[-\w\. ]+) b/i],[x,[O,"MachSpeed"],[S,F]],[/\btu_(1491) b/i],[x,[O,"Rotor"],[S,F]],[/(shield[\w ]+) b/i],[x,[O,"Nvidia"],[S,F]],[/(sprint) (\w+)/i],[O,x,[S,b]],[/(kin\.[onetw]{3})/i],[[x,/\./g," "],[O,Y],[S,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[x,[O,oe],[S,F]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[x,[O,oe],[S,b]],[/smart-tv.+(samsung)/i],[O,[S,G]],[/hbbtv.+maple;(\d+)/i],[[x,/^/,"SmartTV"],[O,fe],[S,G]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[O,j],[S,G]],[/(apple) ?tv/i],[O,[x,de+" TV"],[S,G]],[/crkey/i],[[x,B+"cast"],[O,T],[S,G]],[/droid.+aft(\w+)( bui|\))/i],[x,[O,se],[S,G]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[x,[O,te],[S,G]],[/(bravia[\w ]+)( bui|\))/i],[x,[O,H],[S,G]],[/(mitv-\w{5}) bui/i],[x,[O,Q],[S,G]],[/Hbbtv.*(technisat) (.*);/i],[O,x,[S,G]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[O,Le],[x,Le],[S,G]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[S,G]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[O,x,[S,q]],[/droid.+; (shield) bui/i],[x,[O,"Nvidia"],[S,q]],[/(playstation [345portablevi]+)/i],[x,[O,H],[S,q]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[x,[O,Y],[S,q]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[x,[O,fe],[S,ue]],[/((pebble))app/i],[O,x,[S,ue]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[x,[O,de],[S,ue]],[/droid.+; (glass) \d/i],[x,[O,T],[S,ue]],[/droid.+; (wt63?0{2,3})\)/i],[x,[O,oe],[S,ue]],[/droid.+; (glass) \d/i],[x,[O,T],[S,ue]],[/(pico) (4|neo3(?: link|pro)?)/i],[O,x,[S,ue]],[/; (quest( \d| pro)?)/i],[x,[O,_e],[S,ue]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[O,[S,le]],[/(aeobc)\b/i],[x,[O,se],[S,le]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[x,[S,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[x,[S,F]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[S,F]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[S,b]],[/(android[-\w\. ]{0,9});.+buil/i],[x,[O,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[M,[R,L+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[R,M],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[M,[R,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[R,M],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[M,R]],os:[[/microsoft (windows) (vista|xp)/i],[R,M],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[R,[M,Be,Ze]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[M,Be,Ze],[R,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[M,/_/g,"."],[R,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[R,be],[M,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[M,R],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[R,M],[/\(bb(10);/i],[M,[R,he]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[M,[R,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[M,[R,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[M,[R,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[M,[R,"watchOS"]],[/crkey\/([\d\.]+)/i],[M,[R,B+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[R,ge],M],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[R,M],[/(sunos) ?([\w\.\d]*)/i],[[R,"Solaris"],M],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[R,M]]},Ft=function(dt,tt){if(typeof dt===p&&(tt=dt,dt=h),!(this instanceof Ft))return new Ft(dt,tt).getResult();var rt=typeof _!==d&&_.navigator?_.navigator:h,ke=dt||(rt&&rt.userAgent?rt.userAgent:E),xe=rt&&rt.userAgentData?rt.userAgentData:h,Pe=tt?Ee(_t,tt):_t,it=rt&&rt.userAgent==ke;return this.getBrowser=function(){var Xe={};return Xe[R]=h,Xe[M]=h,Ge.call(Xe,ke,Pe.browser),Xe[C]=Ie(Xe[M]),it&&rt&&rt.brave&&typeof rt.brave.isBrave==c&&(Xe[R]="Brave"),Xe},this.getCPU=function(){var Xe={};return Xe[k]=h,Ge.call(Xe,ke,Pe.cpu),Xe},this.getDevice=function(){var Xe={};return Xe[O]=h,Xe[x]=h,Xe[S]=h,Ge.call(Xe,ke,Pe.device),it&&!Xe[S]&&xe&&xe.mobile&&(Xe[S]=b),it&&Xe[x]=="Macintosh"&&rt&&typeof rt.standalone!==d&&rt.maxTouchPoints&&rt.maxTouchPoints>2&&(Xe[x]="iPad",Xe[S]=F),Xe},this.getEngine=function(){var Xe={};return Xe[R]=h,Xe[M]=h,Ge.call(Xe,ke,Pe.engine),Xe},this.getOS=function(){var Xe={};return Xe[R]=h,Xe[M]=h,Ge.call(Xe,ke,Pe.os),it&&!Xe[R]&&xe&&xe.platform&&xe.platform!="Unknown"&&(Xe[R]=xe.platform.replace(/chrome os/i,ge).replace(/macos/i,be)),Xe},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ke},this.setUA=function(Xe){return ke=typeof Xe===m&&Xe.length>X?Le(Xe,X):Xe,this},this.setUA(ke),this};Ft.VERSION=w,Ft.BROWSER=me([R,M,C]),Ft.CPU=me([k]),Ft.DEVICE=me([x,O,S,q,b,G,F,ue,le]),Ft.ENGINE=Ft.OS=me([R,M]),typeof f!==d?(d!=="object"&&ie.exports&&(f=ie.exports=Ft),f.UAParser=Ft):typeof define===c&&define.amd?define(function(){return Ft}):typeof _!==d&&(_.UAParser=Ft);var gt=typeof _!==d&&(_.jQuery||_.Zepto);if(gt&&!gt.ua){var lt=new Ft;gt.ua=lt.getResult(),gt.ua.get=function(){return lt.getUA()},gt.ua.set=function(dt){lt.setUA(dt);var tt=lt.getResult();for(var rt in tt)gt.ua[rt]=tt[rt]}}})(this)},65747:function(ie,f){(function(_,h){"use strict";var w="1.0.38",E="",v="?",c="function",d="undefined",p="object",m="string",C="major",x="model",R="name",S="type",O="vendor",M="version",k="architecture",q="console",b="mobile",F="tablet",G="smarttv",ue="wearable",le="embedded",X=500,se="Amazon",de="Apple",ye="ASUS",he="BlackBerry",K="Browser",B="Chrome",L="Edge",$="Firefox",T="Google",N="Huawei",j="LG",Y="Microsoft",Z="Motorola",z="Opera",fe="Samsung",te="Sharp",H="Sony",Q="Xiaomi",oe="Zebra",_e="Facebook",ge="Chromium OS",be="Mac OS",we=function(lt,dt){var tt={};for(var rt in lt)dt[rt]&&dt[rt].length%2===0?tt[rt]=dt[rt].concat(lt[rt]):tt[rt]=lt[rt];return tt},Ee=function(lt){for(var dt={},tt=0;tt<lt.length;tt++)dt[lt[tt].toUpperCase()]=lt[tt];return dt},me=function(lt,dt){return typeof lt===m?Ke(dt).indexOf(Ke(lt))!==-1:!1},Ke=function(lt){return lt.toLowerCase()},He=function(lt){return typeof lt===m?lt.replace(/[^\d\.]/g,E).split(".")[0]:h},Ie=function(lt,dt){if(typeof lt===m)return lt=lt.replace(/^\s\s*/,E),typeof dt===d?lt:lt.substring(0,X)},Le=function(lt,dt){for(var tt=0,rt,ke,xe,Pe,it,Xe;tt<dt.length&&!it;){var st=dt[tt],It=dt[tt+1];for(rt=ke=0;rt<st.length&&!it&&st[rt];)if(it=st[rt++].exec(lt),it)for(xe=0;xe<It.length;xe++)Xe=it[++ke],Pe=It[xe],typeof Pe===p&&Pe.length>0?Pe.length===2?typeof Pe[1]==c?this[Pe[0]]=Pe[1].call(this,Xe):this[Pe[0]]=Pe[1]:Pe.length===3?typeof Pe[1]===c&&!(Pe[1].exec&&Pe[1].test)?this[Pe[0]]=Xe?Pe[1].call(this,Xe,Pe[2]):h:this[Pe[0]]=Xe?Xe.replace(Pe[1],Pe[2]):h:Pe.length===4&&(this[Pe[0]]=Xe?Pe[3].call(this,Xe.replace(Pe[1],Pe[2])):h):this[Pe]=Xe||h;tt+=2}},Ge=function(lt,dt){for(var tt in dt)if(typeof dt[tt]===p&&dt[tt].length>0){for(var rt=0;rt<dt[tt].length;rt++)if(me(dt[tt][rt],lt))return tt===v?h:tt}else if(me(dt[tt],lt))return tt===v?h:tt;return lt},Be={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},We={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ze={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[M,[R,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[M,[R,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[R,M],[/opios[\/ ]+([\w\.]+)/i],[M,[R,z+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[M,[R,z+" GX"]],[/\bopr\/([\w\.]+)/i],[M,[R,z]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[M,[R,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[R,M],[/\bddg\/([\w\.]+)/i],[M,[R,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[M,[R,"UC"+K]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[M,[R,"WeChat"]],[/konqueror\/([\w\.]+)/i],[M,[R,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[M,[R,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[M,[R,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[M,[R,"Smart Lenovo "+K]],[/(avast|avg)\/([\w\.]+)/i],[[R,/(.+)/,"$1 Secure "+K],M],[/\bfocus\/([\w\.]+)/i],[M,[R,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[M,[R,z+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[M,[R,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[M,[R,"Dolphin"]],[/coast\/([\w\.]+)/i],[M,[R,z+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[M,[R,"MIUI "+K]],[/fxios\/([-\w\.]+)/i],[M,[R,$]],[/\bqihu|(qi?ho?o?|360)browser/i],[[R,"360 "+K]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[R,/(.+)/,"$1 "+K],M],[/samsungbrowser\/([\w\.]+)/i],[M,[R,fe+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[R,/_/g," "],M],[/metasr[\/ ]?([\d\.]+)/i],[M,[R,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[R,"Sogou Mobile"],M],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[R,M],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[R],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[R,_e],M],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[R,M],[/\bgsa\/([\w\.]+) .*safari\//i],[M,[R,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[M,[R,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[M,[R,B+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[R,B+" WebView"],M],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[M,[R,"Android "+K]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[R,M],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[M,[R,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[M,R],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[R,[M,Ge,Be]],[/(webkit|khtml)\/([\w\.]+)/i],[R,M],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[R,"Netscape"],M],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[M,[R,$+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[R,M],[/(cobalt)\/([\w\.]+)/i],[R,[M,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[k,"amd64"]],[/(ia32(?=;))/i],[[k,Ke]],[/((?:i[346]|x)86)[;\)]/i],[[k,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[k,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[k,"armhf"]],[/windows (ce|mobile); ppc;/i],[[k,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[k,/ower/,E,Ke]],[/(sun4\w)[;\)]/i],[[k,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[k,Ke]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[x,[O,fe],[S,F]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[x,[O,fe],[S,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[x,[O,de],[S,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[x,[O,de],[S,F]],[/(macintosh);/i],[x,[O,de]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[x,[O,te],[S,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[x,[O,N],[S,F]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[x,[O,N],[S,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[x,/_/g," "],[O,Q],[S,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[x,/_/g," "],[O,Q],[S,F]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[x,[O,"OPPO"],[S,b]],[/\b(opd2\d{3}a?) bui/i],[x,[O,"OPPO"],[S,F]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[x,[O,"Vivo"],[S,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[x,[O,"Realme"],[S,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[x,[O,Z],[S,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[x,[O,Z],[S,F]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[x,[O,j],[S,F]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[x,[O,j],[S,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[x,[O,"Lenovo"],[S,F]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[x,/_/g," "],[O,"Nokia"],[S,b]],[/(pixel c)\b/i],[x,[O,T],[S,F]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[x,[O,T],[S,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[x,[O,H],[S,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[x,"Xperia Tablet"],[O,H],[S,F]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[x,[O,"OnePlus"],[S,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[x,[O,se],[S,F]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[x,/(.+)/g,"Fire Phone $1"],[O,se],[S,b]],[/(playbook);[-\w\),; ]+(rim)/i],[x,O,[S,F]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[x,[O,he],[S,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[x,[O,ye],[S,F]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[x,[O,ye],[S,b]],[/(nexus 9)/i],[x,[O,"HTC"],[S,F]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[O,[x,/_/g," "],[S,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[x,[O,"Acer"],[S,F]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[x,[O,"Meizu"],[S,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[x,[O,"Ulefone"],[S,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[O,x,[S,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[O,x,[S,F]],[/(surface duo)/i],[x,[O,Y],[S,F]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[x,[O,"Fairphone"],[S,b]],[/(u304aa)/i],[x,[O,"AT&T"],[S,b]],[/\bsie-(\w*)/i],[x,[O,"Siemens"],[S,b]],[/\b(rct\w+) b/i],[x,[O,"RCA"],[S,F]],[/\b(venue[\d ]{2,7}) b/i],[x,[O,"Dell"],[S,F]],[/\b(q(?:mv|ta)\w+) b/i],[x,[O,"Verizon"],[S,F]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[x,[O,"Barnes & Noble"],[S,F]],[/\b(tm\d{3}\w+) b/i],[x,[O,"NuVision"],[S,F]],[/\b(k88) b/i],[x,[O,"ZTE"],[S,F]],[/\b(nx\d{3}j) b/i],[x,[O,"ZTE"],[S,b]],[/\b(gen\d{3}) b.+49h/i],[x,[O,"Swiss"],[S,b]],[/\b(zur\d{3}) b/i],[x,[O,"Swiss"],[S,F]],[/\b((zeki)?tb.*\b) b/i],[x,[O,"Zeki"],[S,F]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[O,"Dragon Touch"],x,[S,F]],[/\b(ns-?\w{0,9}) b/i],[x,[O,"Insignia"],[S,F]],[/\b((nxa|next)-?\w{0,9}) b/i],[x,[O,"NextBook"],[S,F]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[O,"Voice"],x,[S,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[O,"LvTel"],x,[S,b]],[/\b(ph-1) /i],[x,[O,"Essential"],[S,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[x,[O,"Envizen"],[S,F]],[/\b(trio[-\w\. ]+) b/i],[x,[O,"MachSpeed"],[S,F]],[/\btu_(1491) b/i],[x,[O,"Rotor"],[S,F]],[/(shield[\w ]+) b/i],[x,[O,"Nvidia"],[S,F]],[/(sprint) (\w+)/i],[O,x,[S,b]],[/(kin\.[onetw]{3})/i],[[x,/\./g," "],[O,Y],[S,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[x,[O,oe],[S,F]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[x,[O,oe],[S,b]],[/smart-tv.+(samsung)/i],[O,[S,G]],[/hbbtv.+maple;(\d+)/i],[[x,/^/,"SmartTV"],[O,fe],[S,G]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[O,j],[S,G]],[/(apple) ?tv/i],[O,[x,de+" TV"],[S,G]],[/crkey/i],[[x,B+"cast"],[O,T],[S,G]],[/droid.+aft(\w+)( bui|\))/i],[x,[O,se],[S,G]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[x,[O,te],[S,G]],[/(bravia[\w ]+)( bui|\))/i],[x,[O,H],[S,G]],[/(mitv-\w{5}) bui/i],[x,[O,Q],[S,G]],[/Hbbtv.*(technisat) (.*);/i],[O,x,[S,G]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[O,Ie],[x,Ie],[S,G]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[S,G]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[O,x,[S,q]],[/droid.+; (shield) bui/i],[x,[O,"Nvidia"],[S,q]],[/(playstation [345portablevi]+)/i],[x,[O,H],[S,q]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[x,[O,Y],[S,q]],[/((pebble))app/i],[O,x,[S,ue]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[x,[O,de],[S,ue]],[/droid.+; (glass) \d/i],[x,[O,T],[S,ue]],[/droid.+; (wt63?0{2,3})\)/i],[x,[O,oe],[S,ue]],[/(quest( \d| pro)?)/i],[x,[O,_e],[S,ue]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[O,[S,le]],[/(aeobc)\b/i],[x,[O,se],[S,le]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[x,[S,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[x,[S,F]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[S,F]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[S,b]],[/(android[-\w\. ]{0,9});.+buil/i],[x,[O,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[M,[R,L+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[M,[R,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[R,M],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[M,R]],os:[[/microsoft (windows) (vista|xp)/i],[R,M],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[R,[M,Ge,We]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[M,Ge,We],[R,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[M,/_/g,"."],[R,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[R,be],[M,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[M,R],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[R,M],[/\(bb(10);/i],[M,[R,he]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[M,[R,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[M,[R,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[M,[R,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[M,[R,"watchOS"]],[/crkey\/([\d\.]+)/i],[M,[R,B+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[R,ge],M],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[R,M],[/(sunos) ?([\w\.\d]*)/i],[[R,"Solaris"],M],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[R,M]]},_t=function(lt,dt){if(typeof lt===p&&(dt=lt,lt=h),!(this instanceof _t))return new _t(lt,dt).getResult();var tt=typeof _!==d&&_.navigator?_.navigator:h,rt=lt||(tt&&tt.userAgent?tt.userAgent:E),ke=tt&&tt.userAgentData?tt.userAgentData:h,xe=dt?we(Ze,dt):Ze,Pe=tt&&tt.userAgent==rt;return this.getBrowser=function(){var it={};return it[R]=h,it[M]=h,Le.call(it,rt,xe.browser),it[C]=He(it[M]),Pe&&tt&&tt.brave&&typeof tt.brave.isBrave==c&&(it[R]="Brave"),it},this.getCPU=function(){var it={};return it[k]=h,Le.call(it,rt,xe.cpu),it},this.getDevice=function(){var it={};return it[O]=h,it[x]=h,it[S]=h,Le.call(it,rt,xe.device),Pe&&!it[S]&&ke&&ke.mobile&&(it[S]=b),Pe&&it[x]=="Macintosh"&&tt&&typeof tt.standalone!==d&&tt.maxTouchPoints&&tt.maxTouchPoints>2&&(it[x]="iPad",it[S]=F),it},this.getEngine=function(){var it={};return it[R]=h,it[M]=h,Le.call(it,rt,xe.engine),it},this.getOS=function(){var it={};return it[R]=h,it[M]=h,Le.call(it,rt,xe.os),Pe&&!it[R]&&ke&&ke.platform&&ke.platform!="Unknown"&&(it[R]=ke.platform.replace(/chrome os/i,ge).replace(/macos/i,be)),it},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return rt},this.setUA=function(it){return rt=typeof it===m&&it.length>X?Ie(it,X):it,this},this.setUA(rt),this};_t.VERSION=w,_t.BROWSER=Ee([R,M,C]),_t.CPU=Ee([k]),_t.DEVICE=Ee([x,O,S,q,b,G,F,ue,le]),_t.ENGINE=_t.OS=Ee([R,M]),typeof f!==d?(d!=="object"&&ie.exports&&(f=ie.exports=_t),f.UAParser=_t):typeof define===c&&define.amd?define(function(){return _t}):typeof _!==d&&(_.UAParser=_t);var Ft=typeof _!==d&&(_.jQuery||_.Zepto);if(Ft&&!Ft.ua){var gt=new _t;Ft.ua=gt.getResult(),Ft.ua.get=function(){return gt.getUA()},Ft.ua.set=function(lt){gt.setUA(lt);var dt=gt.getResult();for(var tt in dt)Ft.ua[tt]=dt[tt]}}})(this)},71481:function(ie,f,_){"use strict";var h=_(11239);function w(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var E=/^([a-z0-9.+-]+:)/i,v=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r",`
|
||
`," "],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),C=["%","/","?",";","#"].concat(m),x=["/","?","#"],R=255,S=/^[+a-z0-9A-Z_-]{0,63}$/,O=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=_(63365);function F(X,se,de){if(X&&typeof X=="object"&&X instanceof w)return X;var ye=new w;return ye.parse(X,se,de),ye}w.prototype.parse=function(X,se,de){if(typeof X!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof X);var ye=X.indexOf("?"),he=ye!==-1&&ye<X.indexOf("#")?"?":"#",K=X.split(he),B=/\\/g;K[0]=K[0].replace(B,"/"),X=K.join(he);var L=X;if(L=L.trim(),!de&&X.split("#").length===1){var $=c.exec(L);if($)return this.path=L,this.href=L,this.pathname=$[1],$[2]?(this.search=$[2],se?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):se&&(this.search="",this.query={}),this}var T=E.exec(L);if(T){T=T[0];var N=T.toLowerCase();this.protocol=N,L=L.substr(T.length)}if(de||T||L.match(/^\/\/[^@/]+@[^@/]+/)){var j=L.substr(0,2)==="//";j&&!(T&&k[T])&&(L=L.substr(2),this.slashes=!0)}if(!k[T]&&(j||T&&!q[T])){for(var Y=-1,Z=0;Z<x.length;Z++){var z=L.indexOf(x[Z]);z!==-1&&(Y===-1||z<Y)&&(Y=z)}var fe,te;Y===-1?te=L.lastIndexOf("@"):te=L.lastIndexOf("@",Y),te!==-1&&(fe=L.slice(0,te),L=L.slice(te+1),this.auth=decodeURIComponent(fe)),Y=-1;for(var Z=0;Z<C.length;Z++){var z=L.indexOf(C[Z]);z!==-1&&(Y===-1||z<Y)&&(Y=z)}Y===-1&&(Y=L.length),this.host=L.slice(0,Y),L=L.slice(Y),this.parseHost(),this.hostname=this.hostname||"";var H=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!H)for(var Q=this.hostname.split(/\./),Z=0,oe=Q.length;Z<oe;Z++){var _e=Q[Z];if(_e&&!_e.match(S)){for(var ge="",be=0,we=_e.length;be<we;be++)_e.charCodeAt(be)>127?ge+="x":ge+=_e[be];if(!ge.match(S)){var Ee=Q.slice(0,Z),me=Q.slice(Z+1),Ke=_e.match(O);Ke&&(Ee.push(Ke[1]),me.unshift(Ke[2])),me.length&&(L="/"+me.join(".")+L),this.hostname=Ee.join(".");break}}}this.hostname.length>R?this.hostname="":this.hostname=this.hostname.toLowerCase(),H||(this.hostname=h.toASCII(this.hostname));var He=this.port?":"+this.port:"",Ie=this.hostname||"";this.host=Ie+He,this.href+=this.host,H&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!M[N])for(var Z=0,oe=m.length;Z<oe;Z++){var Le=m[Z];if(L.indexOf(Le)!==-1){var Ge=encodeURIComponent(Le);Ge===Le&&(Ge=escape(Le)),L=L.split(Le).join(Ge)}}var Be=L.indexOf("#");Be!==-1&&(this.hash=L.substr(Be),L=L.slice(0,Be));var We=L.indexOf("?");if(We!==-1?(this.search=L.substr(We),this.query=L.substr(We+1),se&&(this.query=b.parse(this.query)),L=L.slice(0,We)):se&&(this.search="",this.query={}),L&&(this.pathname=L),q[N]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var He=this.pathname||"",Ze=this.search||"";this.path=He+Ze}return this.href=this.format(),this};function G(X){return typeof X=="string"&&(X=F(X)),X instanceof w?X.format():w.prototype.format.call(X)}w.prototype.format=function(){var X=this.auth||"";X&&(X=encodeURIComponent(X),X=X.replace(/%3A/i,":"),X+="@");var se=this.protocol||"",de=this.pathname||"",ye=this.hash||"",he=!1,K="";this.host?he=X+this.host:this.hostname&&(he=X+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(he+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(K=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var B=this.search||K&&"?"+K||"";return se&&se.substr(-1)!==":"&&(se+=":"),this.slashes||(!se||q[se])&&he!==!1?(he="//"+(he||""),de&&de.charAt(0)!=="/"&&(de="/"+de)):he||(he=""),ye&&ye.charAt(0)!=="#"&&(ye="#"+ye),B&&B.charAt(0)!=="?"&&(B="?"+B),de=de.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),B=B.replace("#","%23"),se+he+de+B+ye};function ue(X,se){return F(X,!1,!0).resolve(se)}w.prototype.resolve=function(X){return this.resolveObject(F(X,!1,!0)).format()};function le(X,se){return X?F(X,!1,!0).resolveObject(se):se}w.prototype.resolveObject=function(X){if(typeof X=="string"){var se=new w;se.parse(X,!1,!0),X=se}for(var de=new w,ye=Object.keys(this),he=0;he<ye.length;he++){var K=ye[he];de[K]=this[K]}if(de.hash=X.hash,X.href==="")return de.href=de.format(),de;if(X.slashes&&!X.protocol){for(var B=Object.keys(X),L=0;L<B.length;L++){var $=B[L];$!=="protocol"&&(de[$]=X[$])}return q[de.protocol]&&de.hostname&&!de.pathname&&(de.pathname="/",de.path=de.pathname),de.href=de.format(),de}if(X.protocol&&X.protocol!==de.protocol){if(!q[X.protocol]){for(var T=Object.keys(X),N=0;N<T.length;N++){var j=T[N];de[j]=X[j]}return de.href=de.format(),de}if(de.protocol=X.protocol,!X.host&&!k[X.protocol]){for(var oe=(X.pathname||"").split("/");oe.length&&!(X.host=oe.shift()););X.host||(X.host=""),X.hostname||(X.hostname=""),oe[0]!==""&&oe.unshift(""),oe.length<2&&oe.unshift(""),de.pathname=oe.join("/")}else de.pathname=X.pathname;if(de.search=X.search,de.query=X.query,de.host=X.host||"",de.auth=X.auth,de.hostname=X.hostname||X.host,de.port=X.port,de.pathname||de.search){var Y=de.pathname||"",Z=de.search||"";de.path=Y+Z}return de.slashes=de.slashes||X.slashes,de.href=de.format(),de}var z=de.pathname&&de.pathname.charAt(0)==="/",fe=X.host||X.pathname&&X.pathname.charAt(0)==="/",te=fe||z||de.host&&X.pathname,H=te,Q=de.pathname&&de.pathname.split("/")||[],oe=X.pathname&&X.pathname.split("/")||[],_e=de.protocol&&!q[de.protocol];if(_e&&(de.hostname="",de.port=null,de.host&&(Q[0]===""?Q[0]=de.host:Q.unshift(de.host)),de.host="",X.protocol&&(X.hostname=null,X.port=null,X.host&&(oe[0]===""?oe[0]=X.host:oe.unshift(X.host)),X.host=null),te=te&&(oe[0]===""||Q[0]==="")),fe)de.host=X.host||X.host===""?X.host:de.host,de.hostname=X.hostname||X.hostname===""?X.hostname:de.hostname,de.search=X.search,de.query=X.query,Q=oe;else if(oe.length)Q||(Q=[]),Q.pop(),Q=Q.concat(oe),de.search=X.search,de.query=X.query;else if(X.search!=null){if(_e){de.host=Q.shift(),de.hostname=de.host;var ge=de.host&&de.host.indexOf("@")>0?de.host.split("@"):!1;ge&&(de.auth=ge.shift(),de.hostname=ge.shift(),de.host=de.hostname)}return de.search=X.search,de.query=X.query,(de.pathname!==null||de.search!==null)&&(de.path=(de.pathname?de.pathname:"")+(de.search?de.search:"")),de.href=de.format(),de}if(!Q.length)return de.pathname=null,de.search?de.path="/"+de.search:de.path=null,de.href=de.format(),de;for(var be=Q.slice(-1)[0],we=(de.host||X.host||Q.length>1)&&(be==="."||be==="..")||be==="",Ee=0,me=Q.length;me>=0;me--)be=Q[me],be==="."?Q.splice(me,1):be===".."?(Q.splice(me,1),Ee++):Ee&&(Q.splice(me,1),Ee--);if(!te&&!H)for(;Ee--;Ee)Q.unshift("..");te&&Q[0]!==""&&(!Q[0]||Q[0].charAt(0)!=="/")&&Q.unshift(""),we&&Q.join("/").substr(-1)!=="/"&&Q.push("");var Ke=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";if(_e){de.hostname=Ke?"":Q.length?Q.shift():"",de.host=de.hostname;var ge=de.host&&de.host.indexOf("@")>0?de.host.split("@"):!1;ge&&(de.auth=ge.shift(),de.hostname=ge.shift(),de.host=de.hostname)}return te=te||de.host&&Q.length,te&&!Ke&&Q.unshift(""),Q.length>0?de.pathname=Q.join("/"):(de.pathname=null,de.path=null),(de.pathname!==null||de.search!==null)&&(de.path=(de.pathname?de.pathname:"")+(de.search?de.search:"")),de.auth=X.auth||de.auth,de.slashes=de.slashes||X.slashes,de.href=de.format(),de},w.prototype.parseHost=function(){var X=this.host,se=v.exec(X);se&&(se=se[0],se!==":"&&(this.port=se.substr(1)),X=X.substr(0,X.length-se.length)),X&&(this.hostname=X)},f.parse=F,f.resolve=ue,f.resolveObject=le,f.format=G,f.Url=w},91947:function(ie,f,_){ie.exports=h;function h(E,v){if(w("noDeprecation"))return E;var c=!1;function d(){if(!c){if(w("throwDeprecation"))throw new Error(v);w("traceDeprecation")?console.trace(v):console.warn(v),c=!0}return E.apply(this,arguments)}return d}function w(E){try{if(!_.g.localStorage)return!1}catch{return!1}var v=_.g.localStorage[E];return v==null?!1:String(v).toLowerCase()==="true"}},56640:function(ie){ie.exports=function(_){return _&&typeof _=="object"&&typeof _.copy=="function"&&typeof _.fill=="function"&&typeof _.readUInt8=="function"}},90515:function(ie,f,_){"use strict";var h=_(5117),w=_(94204),E=_(1728),v=_(40006);function c(Ze){return Ze.call.bind(Ze)}var d=typeof BigInt<"u",p=typeof Symbol<"u",m=c(Object.prototype.toString),C=c(Number.prototype.valueOf),x=c(String.prototype.valueOf),R=c(Boolean.prototype.valueOf);if(d)var S=c(BigInt.prototype.valueOf);if(p)var O=c(Symbol.prototype.valueOf);function M(Ze,_t){if(typeof Ze!="object")return!1;try{return _t(Ze),!0}catch{return!1}}f.isArgumentsObject=h,f.isGeneratorFunction=w,f.isTypedArray=v;function k(Ze){return typeof Promise<"u"&&Ze instanceof Promise||Ze!==null&&typeof Ze=="object"&&typeof Ze.then=="function"&&typeof Ze.catch=="function"}f.isPromise=k;function q(Ze){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ze):v(Ze)||H(Ze)}f.isArrayBufferView=q;function b(Ze){return E(Ze)==="Uint8Array"}f.isUint8Array=b;function F(Ze){return E(Ze)==="Uint8ClampedArray"}f.isUint8ClampedArray=F;function G(Ze){return E(Ze)==="Uint16Array"}f.isUint16Array=G;function ue(Ze){return E(Ze)==="Uint32Array"}f.isUint32Array=ue;function le(Ze){return E(Ze)==="Int8Array"}f.isInt8Array=le;function X(Ze){return E(Ze)==="Int16Array"}f.isInt16Array=X;function se(Ze){return E(Ze)==="Int32Array"}f.isInt32Array=se;function de(Ze){return E(Ze)==="Float32Array"}f.isFloat32Array=de;function ye(Ze){return E(Ze)==="Float64Array"}f.isFloat64Array=ye;function he(Ze){return E(Ze)==="BigInt64Array"}f.isBigInt64Array=he;function K(Ze){return E(Ze)==="BigUint64Array"}f.isBigUint64Array=K;function B(Ze){return m(Ze)==="[object Map]"}B.working=typeof Map<"u"&&B(new Map);function L(Ze){return typeof Map>"u"?!1:B.working?B(Ze):Ze instanceof Map}f.isMap=L;function $(Ze){return m(Ze)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function T(Ze){return typeof Set>"u"?!1:$.working?$(Ze):Ze instanceof Set}f.isSet=T;function N(Ze){return m(Ze)==="[object WeakMap]"}N.working=typeof WeakMap<"u"&&N(new WeakMap);function j(Ze){return typeof WeakMap>"u"?!1:N.working?N(Ze):Ze instanceof WeakMap}f.isWeakMap=j;function Y(Ze){return m(Ze)==="[object WeakSet]"}Y.working=typeof WeakSet<"u"&&Y(new WeakSet);function Z(Ze){return Y(Ze)}f.isWeakSet=Z;function z(Ze){return m(Ze)==="[object ArrayBuffer]"}z.working=typeof ArrayBuffer<"u"&&z(new ArrayBuffer);function fe(Ze){return typeof ArrayBuffer>"u"?!1:z.working?z(Ze):Ze instanceof ArrayBuffer}f.isArrayBuffer=fe;function te(Ze){return m(Ze)==="[object DataView]"}te.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&te(new DataView(new ArrayBuffer(1),0,1));function H(Ze){return typeof DataView>"u"?!1:te.working?te(Ze):Ze instanceof DataView}f.isDataView=H;var Q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function oe(Ze){return m(Ze)==="[object SharedArrayBuffer]"}function _e(Ze){return typeof Q>"u"?!1:(typeof oe.working>"u"&&(oe.working=oe(new Q)),oe.working?oe(Ze):Ze instanceof Q)}f.isSharedArrayBuffer=_e;function ge(Ze){return m(Ze)==="[object AsyncFunction]"}f.isAsyncFunction=ge;function be(Ze){return m(Ze)==="[object Map Iterator]"}f.isMapIterator=be;function we(Ze){return m(Ze)==="[object Set Iterator]"}f.isSetIterator=we;function Ee(Ze){return m(Ze)==="[object Generator]"}f.isGeneratorObject=Ee;function me(Ze){return m(Ze)==="[object WebAssembly.Module]"}f.isWebAssemblyCompiledModule=me;function Ke(Ze){return M(Ze,C)}f.isNumberObject=Ke;function He(Ze){return M(Ze,x)}f.isStringObject=He;function Ie(Ze){return M(Ze,R)}f.isBooleanObject=Ie;function Le(Ze){return d&&M(Ze,S)}f.isBigIntObject=Le;function Ge(Ze){return p&&M(Ze,O)}f.isSymbolObject=Ge;function Be(Ze){return Ke(Ze)||He(Ze)||Ie(Ze)||Le(Ze)||Ge(Ze)}f.isBoxedPrimitive=Be;function We(Ze){return typeof Uint8Array<"u"&&(fe(Ze)||_e(Ze))}f.isAnyArrayBuffer=We,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ze){Object.defineProperty(f,Ze,{enumerable:!1,value:function(){throw new Error(Ze+" is not supported in userland")}})})},1344:function(ie,f,_){var h=_(85409),w=Object.getOwnPropertyDescriptors||function(Q){for(var oe=Object.keys(Q),_e={},ge=0;ge<oe.length;ge++)_e[oe[ge]]=Object.getOwnPropertyDescriptor(Q,oe[ge]);return _e},E=/%[sdj%]/g;f.format=function(H){if(!X(H)){for(var Q=[],oe=0;oe<arguments.length;oe++)Q.push(p(arguments[oe]));return Q.join(" ")}for(var oe=1,_e=arguments,ge=_e.length,be=String(H).replace(E,function(Ee){if(Ee==="%%")return"%";if(oe>=ge)return Ee;switch(Ee){case"%s":return String(_e[oe++]);case"%d":return Number(_e[oe++]);case"%j":try{return JSON.stringify(_e[oe++])}catch{return"[Circular]"}default:return Ee}}),we=_e[oe];oe<ge;we=_e[++oe])G(we)||!he(we)?be+=" "+we:be+=" "+p(we);return be},f.deprecate=function(H,Q){if(typeof h<"u"&&h.noDeprecation===!0)return H;if(typeof h>"u")return function(){return f.deprecate(H,Q).apply(this,arguments)};var oe=!1;function _e(){if(!oe){if(h.throwDeprecation)throw new Error(Q);h.traceDeprecation?console.trace(Q):console.error(Q),oe=!0}return H.apply(this,arguments)}return _e};var v={},c=/^$/;if("{}".NODE_DEBUG){var d="{}".NODE_DEBUG;d=d.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+d+"$","i")}f.debuglog=function(H){if(H=H.toUpperCase(),!v[H])if(c.test(H)){var Q=h.pid;v[H]=function(){var oe=f.format.apply(f,arguments);console.error("%s %d: %s",H,Q,oe)}}else v[H]=function(){};return v[H]};function p(H,Q){var oe={seen:[],stylize:C};return arguments.length>=3&&(oe.depth=arguments[2]),arguments.length>=4&&(oe.colors=arguments[3]),F(Q)?oe.showHidden=Q:Q&&f._extend(oe,Q),de(oe.showHidden)&&(oe.showHidden=!1),de(oe.depth)&&(oe.depth=2),de(oe.colors)&&(oe.colors=!1),de(oe.customInspect)&&(oe.customInspect=!0),oe.colors&&(oe.stylize=m),R(oe,H,oe.depth)}f.inspect=p,p.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},p.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function m(H,Q){var oe=p.styles[Q];return oe?"\x1B["+p.colors[oe][0]+"m"+H+"\x1B["+p.colors[oe][1]+"m":H}function C(H,Q){return H}function x(H){var Q={};return H.forEach(function(oe,_e){Q[oe]=!0}),Q}function R(H,Q,oe){if(H.customInspect&&Q&&L(Q.inspect)&&Q.inspect!==f.inspect&&!(Q.constructor&&Q.constructor.prototype===Q)){var _e=Q.inspect(oe,H);return X(_e)||(_e=R(H,_e,oe)),_e}var ge=S(H,Q);if(ge)return ge;var be=Object.keys(Q),we=x(be);if(H.showHidden&&(be=Object.getOwnPropertyNames(Q)),B(Q)&&(be.indexOf("message")>=0||be.indexOf("description")>=0))return O(Q);if(be.length===0){if(L(Q)){var Ee=Q.name?": "+Q.name:"";return H.stylize("[Function"+Ee+"]","special")}if(ye(Q))return H.stylize(RegExp.prototype.toString.call(Q),"regexp");if(K(Q))return H.stylize(Date.prototype.toString.call(Q),"date");if(B(Q))return O(Q)}var me="",Ke=!1,He=["{","}"];if(b(Q)&&(Ke=!0,He=["[","]"]),L(Q)){var Ie=Q.name?": "+Q.name:"";me=" [Function"+Ie+"]"}if(ye(Q)&&(me=" "+RegExp.prototype.toString.call(Q)),K(Q)&&(me=" "+Date.prototype.toUTCString.call(Q)),B(Q)&&(me=" "+O(Q)),be.length===0&&(!Ke||Q.length==0))return He[0]+me+He[1];if(oe<0)return ye(Q)?H.stylize(RegExp.prototype.toString.call(Q),"regexp"):H.stylize("[Object]","special");H.seen.push(Q);var Le;return Ke?Le=M(H,Q,oe,we,be):Le=be.map(function(Ge){return k(H,Q,oe,we,Ge,Ke)}),H.seen.pop(),q(Le,me,He)}function S(H,Q){if(de(Q))return H.stylize("undefined","undefined");if(X(Q)){var oe="'"+JSON.stringify(Q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return H.stylize(oe,"string")}if(le(Q))return H.stylize(""+Q,"number");if(F(Q))return H.stylize(""+Q,"boolean");if(G(Q))return H.stylize("null","null")}function O(H){return"["+Error.prototype.toString.call(H)+"]"}function M(H,Q,oe,_e,ge){for(var be=[],we=0,Ee=Q.length;we<Ee;++we)Z(Q,String(we))?be.push(k(H,Q,oe,_e,String(we),!0)):be.push("");return ge.forEach(function(me){me.match(/^\d+$/)||be.push(k(H,Q,oe,_e,me,!0))}),be}function k(H,Q,oe,_e,ge,be){var we,Ee,me;if(me=Object.getOwnPropertyDescriptor(Q,ge)||{value:Q[ge]},me.get?me.set?Ee=H.stylize("[Getter/Setter]","special"):Ee=H.stylize("[Getter]","special"):me.set&&(Ee=H.stylize("[Setter]","special")),Z(_e,ge)||(we="["+ge+"]"),Ee||(H.seen.indexOf(me.value)<0?(G(oe)?Ee=R(H,me.value,null):Ee=R(H,me.value,oe-1),Ee.indexOf(`
|
||
`)>-1&&(be?Ee=Ee.split(`
|
||
`).map(function(Ke){return" "+Ke}).join(`
|
||
`).slice(2):Ee=`
|
||
`+Ee.split(`
|
||
`).map(function(Ke){return" "+Ke}).join(`
|
||
`))):Ee=H.stylize("[Circular]","special")),de(we)){if(be&&ge.match(/^\d+$/))return Ee;we=JSON.stringify(""+ge),we.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(we=we.slice(1,-1),we=H.stylize(we,"name")):(we=we.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),we=H.stylize(we,"string"))}return we+": "+Ee}function q(H,Q,oe){var _e=0,ge=H.reduce(function(be,we){return _e++,we.indexOf(`
|
||
`)>=0&&_e++,be+we.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ge>60?oe[0]+(Q===""?"":Q+`
|
||
`)+" "+H.join(`,
|
||
`)+" "+oe[1]:oe[0]+Q+" "+H.join(", ")+" "+oe[1]}f.types=_(90515);function b(H){return Array.isArray(H)}f.isArray=b;function F(H){return typeof H=="boolean"}f.isBoolean=F;function G(H){return H===null}f.isNull=G;function ue(H){return H==null}f.isNullOrUndefined=ue;function le(H){return typeof H=="number"}f.isNumber=le;function X(H){return typeof H=="string"}f.isString=X;function se(H){return typeof H=="symbol"}f.isSymbol=se;function de(H){return H===void 0}f.isUndefined=de;function ye(H){return he(H)&&T(H)==="[object RegExp]"}f.isRegExp=ye,f.types.isRegExp=ye;function he(H){return typeof H=="object"&&H!==null}f.isObject=he;function K(H){return he(H)&&T(H)==="[object Date]"}f.isDate=K,f.types.isDate=K;function B(H){return he(H)&&(T(H)==="[object Error]"||H instanceof Error)}f.isError=B,f.types.isNativeError=B;function L(H){return typeof H=="function"}f.isFunction=L;function $(H){return H===null||typeof H=="boolean"||typeof H=="number"||typeof H=="string"||typeof H=="symbol"||typeof H>"u"}f.isPrimitive=$,f.isBuffer=_(56640);function T(H){return Object.prototype.toString.call(H)}function N(H){return H<10?"0"+H.toString(10):H.toString(10)}var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Y(){var H=new Date,Q=[N(H.getHours()),N(H.getMinutes()),N(H.getSeconds())].join(":");return[H.getDate(),j[H.getMonth()],Q].join(" ")}f.log=function(){console.log("%s - %s",Y(),f.format.apply(f,arguments))},f.inherits=_(91193),f._extend=function(H,Q){if(!Q||!he(Q))return H;for(var oe=Object.keys(Q),_e=oe.length;_e--;)H[oe[_e]]=Q[oe[_e]];return H};function Z(H,Q){return Object.prototype.hasOwnProperty.call(H,Q)}var z=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;f.promisify=function(Q){if(typeof Q!="function")throw new TypeError('The "original" argument must be of type Function');if(z&&Q[z]){var oe=Q[z];if(typeof oe!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(oe,z,{value:oe,enumerable:!1,writable:!1,configurable:!0}),oe}function oe(){for(var _e,ge,be=new Promise(function(me,Ke){_e=me,ge=Ke}),we=[],Ee=0;Ee<arguments.length;Ee++)we.push(arguments[Ee]);we.push(function(me,Ke){me?ge(me):_e(Ke)});try{Q.apply(this,we)}catch(me){ge(me)}return be}return Object.setPrototypeOf(oe,Object.getPrototypeOf(Q)),z&&Object.defineProperty(oe,z,{value:oe,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(oe,w(Q))},f.promisify.custom=z;function fe(H,Q){if(!H){var oe=new Error("Promise was rejected with a falsy value");oe.reason=H,H=oe}return Q(H)}function te(H){if(typeof H!="function")throw new TypeError('The "original" argument must be of type Function');function Q(){for(var oe=[],_e=0;_e<arguments.length;_e++)oe.push(arguments[_e]);var ge=oe.pop();if(typeof ge!="function")throw new TypeError("The last argument must be of type Function");var be=this,we=function(){return ge.apply(be,arguments)};H.apply(this,oe).then(function(Ee){h.nextTick(we.bind(null,null,Ee))},function(Ee){h.nextTick(fe.bind(null,Ee,we))})}return Object.setPrototypeOf(Q,Object.getPrototypeOf(H)),Object.defineProperties(Q,w(H)),Q}f.callbackify=te},33357:function(ie,f,_){"use strict";_.d(f,{v4:()=>S});var h,w=new Uint8Array(16);function E(){if(!h&&(h=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!h))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return h(w)}const v=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function c(O){return typeof O=="string"&&v.test(O)}const d=c;for(var p=[],m=0;m<256;++m)p.push((m+256).toString(16).substr(1));function C(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=(p[O[M+0]]+p[O[M+1]]+p[O[M+2]]+p[O[M+3]]+"-"+p[O[M+4]]+p[O[M+5]]+"-"+p[O[M+6]]+p[O[M+7]]+"-"+p[O[M+8]]+p[O[M+9]]+"-"+p[O[M+10]]+p[O[M+11]]+p[O[M+12]]+p[O[M+13]]+p[O[M+14]]+p[O[M+15]]).toLowerCase();if(!d(k))throw TypeError("Stringified UUID is invalid");return k}const x=C;function R(O,M,k){O=O||{};var q=O.random||(O.rng||E)();if(q[6]=q[6]&15|64,q[8]=q[8]&63|128,M){k=k||0;for(var b=0;b<16;++b)M[k+b]=q[b];return M}return x(q)}const S=R},1275:function(ie,f,_){"use strict";function h(ln){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(yn){return typeof yn}:function(yn){return yn&&typeof Symbol=="function"&&yn.constructor===Symbol&&yn!==Symbol.prototype?"symbol":typeof yn},h(ln)}Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var w=_r(_(36310)),E=_r(_(15802)),v=_r(_(15517)),c=_r(_(35440)),d=_r(_(75770)),p=_r(_(54010)),m=_r(_(36246)),C=_r(_(13639)),x=_r(_(94434)),R=_r(_(84714)),S=_r(_(41818)),O=_r(_(73673)),M=_r(_(98216)),k=_r(_(53747)),q=_r(_(69674)),b=_r(_(27843)),F=_r(_(40893)),G=_r(_(30191)),ue=rn(_(68136)),le=rn(_(33340)),X=_r(_(69320)),se=_r(_(28484)),de=_r(_(40256)),ye=_r(_(76842)),he=_r(_(10591)),K=_r(_(87851)),B=_r(_(74696)),L=_r(_(3468)),$=_r(_(45560)),T=_r(_(19179)),N=_r(_(9364)),j=_r(_(81571)),Y=_r(_(32589)),Z=_r(_(35186)),z=rn(_(3733)),fe=_r(_(83052)),te=_r(_(17816)),H=_r(_(2836)),Q=_r(_(98129)),oe=_r(_(8815)),_e=_r(_(63829)),ge=_r(_(13764)),be=_r(_(14148)),we=rn(_(95767)),Ee=_r(_(68821)),me=_r(_(8523)),Ke=_r(_(55567)),He=_r(_(29926)),Ie=_r(_(21333)),Le=_r(_(76154)),Ge=_r(_(21835)),Be=_r(_(5713)),We=_r(_(73600)),Ze=_r(_(87862)),_t=_r(_(2669)),Ft=_r(_(41712)),gt=_r(_(45588)),lt=_r(_(57951)),dt=_r(_(68876)),tt=_r(_(98839)),rt=_r(_(57915)),ke=_r(_(58860)),xe=_r(_(76663)),Pe=_r(_(15446)),it=_r(_(39695)),Xe=rn(_(5661)),st=_r(_(18700)),It=_r(_(53800)),ft=_r(_(15118)),Jt=_(95391),Ot=_r(_(5979)),Ct=_r(_(81487)),qe=_r(_(30540)),Yt=_r(_(51141)),ot=_r(_(49222)),Ae=_r(_(99288)),Rt=_r(_(15111)),Ht=_r(_(42647)),bt=_r(_(67772)),Mt=_r(_(6549)),tr=_r(_(41379)),Vt=_r(_(7272)),Et=_r(_(85247)),Ye=_r(_(72996)),Tt=rn(_(52049)),Wt=_r(_(92279)),dr=_r(_(46081)),at=_r(_(35835)),wt=_r(_(80)),At=_r(_(33699)),Je=_r(_(97163)),Lt=_r(_(76122)),sr=_r(_(98840)),ur=_r(_(85439)),vr=_r(_(14330)),kr=_r(_(2792)),Jr=_r(_(32694)),hr=_r(_(42081)),$r=_r(_(4252));function Hr(ln){if(typeof WeakMap!="function")return null;var yn=new WeakMap,Fr=new WeakMap;return(Hr=function(En){return En?Fr:yn})(ln)}function rn(ln,yn){if(!yn&&ln&&ln.__esModule)return ln;if(ln===null||h(ln)!="object"&&typeof ln!="function")return{default:ln};var Fr=Hr(yn);if(Fr&&Fr.has(ln))return Fr.get(ln);var On={__proto__:null},En=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ee in ln)if(ee!=="default"&&{}.hasOwnProperty.call(ln,ee)){var ve=En?Object.getOwnPropertyDescriptor(ln,ee):null;ve&&(ve.get||ve.set)?Object.defineProperty(On,ee,ve):On[ee]=ln[ee]}return On.default=ln,Fr&&Fr.set(ln,On),On}function _r(ln){return ln&&ln.__esModule?ln:{default:ln}}var pn="13.12.0",$t={version:pn,toDate:w.default,toFloat:E.default,toInt:v.default,toBoolean:c.default,equals:d.default,contains:p.default,matches:m.default,isEmail:C.default,isURL:x.default,isMACAddress:R.default,isIP:S.default,isIPRange:O.default,isFQDN:M.default,isBoolean:b.default,isIBAN:we.default,isBIC:Ee.default,isAbaRouting:G.default,isAlpha:ue.default,isAlphaLocales:ue.locales,isAlphanumeric:le.default,isAlphanumericLocales:le.locales,isNumeric:X.default,isPassportNumber:se.default,isPort:de.default,isLowercase:ye.default,isUppercase:he.default,isAscii:B.default,isFullWidth:L.default,isHalfWidth:$.default,isVariableWidth:T.default,isMultibyte:N.default,isSemVer:j.default,isSurrogatePair:Y.default,isInt:Z.default,isIMEI:K.default,isFloat:z.default,isFloatLocales:z.locales,isDecimal:fe.default,isHexadecimal:te.default,isOctal:H.default,isDivisibleBy:Q.default,isHexColor:oe.default,isRgbColor:_e.default,isHSL:ge.default,isISRC:be.default,isMD5:me.default,isHash:Ke.default,isJWT:He.default,isJSON:Ie.default,isEmpty:Le.default,isLength:Ge.default,isLocale:F.default,isByteLength:Be.default,isUUID:We.default,isMongoId:Ze.default,isAfter:_t.default,isBefore:Ft.default,isIn:gt.default,isLuhnNumber:lt.default,isCreditCard:dt.default,isIdentityCard:tt.default,isEAN:rt.default,isISIN:ke.default,isISBN:xe.default,isISSN:Pe.default,isMobilePhone:Xe.default,isMobilePhoneLocales:Xe.locales,isPostalCode:Tt.default,isPostalCodeLocales:Tt.locales,isEthereumAddress:st.default,isCurrency:It.default,isBtcAddress:ft.default,isISO6346:Jt.isISO6346,isFreightContainerID:Jt.isFreightContainerID,isISO6391:Ot.default,isISO8601:Ct.default,isRFC3339:qe.default,isISO31661Alpha2:Yt.default,isISO31661Alpha3:ot.default,isISO4217:Ae.default,isBase32:Rt.default,isBase58:Ht.default,isBase64:bt.default,isDataURI:Mt.default,isMagnetURI:tr.default,isMailtoURI:Vt.default,isMimeType:Et.default,isLatLong:Ye.default,ltrim:Wt.default,rtrim:dr.default,trim:at.default,escape:wt.default,unescape:At.default,stripLow:Je.default,whitelist:Lt.default,blacklist:sr.default,isWhitelisted:ur.default,normalizeEmail:vr.default,toString,isSlug:kr.default,isStrongPassword:hr.default,isTaxID:it.default,isDate:k.default,isTime:q.default,isLicensePlate:Jr.default,isVAT:$r.default,ibanLocales:we.locales},In=f.default=$t;ie.exports=f.default,ie.exports.default=f.default},83747:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.farsiLocales=f.englishLocales=f.dotDecimal=f.decimal=f.commaDecimal=f.bengaliLocales=f.arabicLocales=f.alphanumeric=f.alpha=void 0;for(var _=f.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},h=f.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},w=f.decimal={"en-US":".",ar:"\u066B"},E=f.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"],v,c=0;c<E.length;c++)v="en-".concat(E[c]),_[v]=_["en-US"],h[v]=h["en-US"],w[v]=w["en-US"];for(var d=f.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"],p,m=0;m<d.length;m++)p="ar-".concat(d[m]),_[p]=_.ar,h[p]=h.ar,w[p]=w.ar;for(var C=f.farsiLocales=["IR","AF"],x,R=0;R<C.length;R++)x="fa-".concat(C[R]),h[x]=h.fa,w[x]=w.ar;for(var S=f.bengaliLocales=["BD","IN"],O,M=0;M<S.length;M++)O="bn-".concat(S[M]),_[O]=_.bn,h[O]=h.bn,w[O]=w["en-US"];for(var k=f.dotDecimal=["ar-EG","ar-LB","ar-LY"],q=f.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"],b=0;b<k.length;b++)w[k[b]]=w["en-US"];for(var F=0;F<q.length;F++)w[q[F]]=",";_["fr-CA"]=_["fr-FR"],h["fr-CA"]=h["fr-FR"],_["pt-BR"]=_["pt-PT"],h["pt-BR"]=h["pt-PT"],w["pt-BR"]=w["pt-PT"],_["pl-Pl"]=_["pl-PL"],h["pl-Pl"]=h["pl-PL"],w["pl-Pl"]=w["pl-PL"],_["fa-AF"]=_.fa},98840:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){return(0,h.default)(v),v.replace(new RegExp("[".concat(c,"]+"),"g"),"")}ie.exports=f.default,ie.exports.default=f.default},54010:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=v(_(74565)),w=v(_(42882)),E=v(_(20768));function v(p){return p&&p.__esModule?p:{default:p}}var c={ignoreCase:!1,minOccurrences:1};function d(p,m,C){return(0,h.default)(p),C=(0,E.default)(C,c),C.ignoreCase?p.toLowerCase().split((0,w.default)(m).toLowerCase()).length>C.minOccurrences:p.split((0,w.default)(m)).length>C.minOccurrences}ie.exports=f.default,ie.exports.default=f.default},75770:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){return(0,h.default)(v),v===c}ie.exports=f.default,ie.exports.default=f.default},80:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){return(0,h.default)(v),v.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}ie.exports=f.default,ie.exports.default=f.default},30191:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function v(c){if((0,h.default)(c),!E.test(c))return!1;for(var d=0,p=0;p<c.length;p++)p%3===0?d+=c[p]*3:p%3===1?d+=c[p]*7:d+=c[p]*1;return d%10===0}ie.exports=f.default,ie.exports.default=f.default},2669:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(36310));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){var d=c?.comparisonDate||c||Date().toString(),p=(0,h.default)(d),m=(0,h.default)(v);return!!(m&&p&&m>p)}ie.exports=f.default,ie.exports.default=f.default},68136:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v,f.locales=void 0;var h=E(_(74565)),w=_(83747);function E(d){return d&&d.__esModule?d:{default:d}}function v(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,h.default)(d);var C=d,x=m.ignore;if(x)if(x instanceof RegExp)C=C.replace(x,"");else if(typeof x=="string")C=C.replace(new RegExp("[".concat(x.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(p in w.alpha)return w.alpha[p].test(C);throw new Error("Invalid locale '".concat(p,"'"))}var c=f.locales=Object.keys(w.alpha)},33340:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v,f.locales=void 0;var h=E(_(74565)),w=_(83747);function E(d){return d&&d.__esModule?d:{default:d}}function v(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,h.default)(d);var C=d,x=m.ignore;if(x)if(x instanceof RegExp)C=C.replace(x,"");else if(typeof x=="string")C=C.replace(new RegExp("[".concat(x.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(p in w.alphanumeric)return w.alphanumeric[p].test(C);throw new Error("Invalid locale '".concat(p,"'"))}var c=f.locales=Object.keys(w.alphanumeric)},74696:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^[\x00-\x7F]+$/;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},68821:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=E(_(74565)),w=_(51141);function E(d){return d&&d.__esModule?d:{default:d}}var v=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function c(d){(0,h.default)(d);var p=d.slice(4,6).toUpperCase();return!w.CountryCodes.has(p)&&p!=="XK"?!1:v.test(d)}ie.exports=f.default,ie.exports.default=f.default},15111:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=p;var h=E(_(74565)),w=E(_(20768));function E(m){return m&&m.__esModule?m:{default:m}}var v=/^[A-Z2-7]+=*$/,c=/^[A-HJKMNP-TV-Z0-9]+$/,d={crockford:!1};function p(m,C){if((0,h.default)(m),C=(0,w.default)(C,d),C.crockford)return c.test(m);var x=m.length;return!!(x%8===0&&v.test(m))}ie.exports=f.default,ie.exports.default=f.default},42647:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^[A-HJ-NP-Za-km-z1-9]*$/;function v(c){return(0,h.default)(c),!!E.test(c)}ie.exports=f.default,ie.exports.default=f.default},67772:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=p;var h=E(_(74565)),w=E(_(20768));function E(m){return m&&m.__esModule?m:{default:m}}var v=/[^A-Z0-9+\/=]/i,c=/^[A-Z0-9_\-]*$/i,d={urlSafe:!1};function p(m,C){(0,h.default)(m),C=(0,w.default)(C,d);var x=m.length;if(C.urlSafe)return c.test(m);if(x%4!==0||v.test(m))return!1;var R=m.indexOf("=");return R===-1||R===x-1||R===x-2&&m[x-1]==="="}ie.exports=f.default,ie.exports.default=f.default},41712:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=E(_(74565)),w=E(_(36310));function E(c){return c&&c.__esModule?c:{default:c}}function v(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:String(new Date);(0,h.default)(c);var p=(0,w.default)(d),m=(0,w.default)(c);return!!(m&&p&&m<p)}ie.exports=f.default,ie.exports.default=f.default},27843:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=w(_(74565));function w(p){return p&&p.__esModule?p:{default:p}}var E={loose:!1},v=["true","false","1","0"],c=[].concat(v,["yes","no"]);function d(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E;return(0,h.default)(p),m.loose?c.includes(p.toLowerCase()):v.includes(p)}ie.exports=f.default,ie.exports.default=f.default},15118:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=w(_(74565));function w(d){return d&&d.__esModule?d:{default:d}}var E=/^(bc1)[a-z0-9]{25,39}$/,v=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function c(d){return(0,h.default)(d),E.test(d)||v.test(d)}ie.exports=f.default,ie.exports.default=f.default},5713:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}function E(c){"@babel/helpers - typeof";return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},E(c)}function v(c,d){(0,h.default)(c);var p,m;E(d)==="object"?(p=d.min||0,m=d.max):(p=arguments[1],m=arguments[2]);var C=encodeURI(c).split(/%..|./).length-1;return C>=p&&(typeof m>"u"||C<=m)}ie.exports=f.default,ie.exports.default=f.default},68876:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=E(_(74565)),w=E(_(57951));function E(p){return p&&p.__esModule?p:{default:p}}var v={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},c=function(){var p=[];for(var m in v)v.hasOwnProperty(m)&&p.push(v[m]);return p}();function d(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,h.default)(p);var C=m.provider,x=p.replace(/[- ]+/g,"");if(C&&C.toLowerCase()in v){if(!v[C.toLowerCase()].test(x))return!1}else{if(C&&!(C.toLowerCase()in v))throw new Error("".concat(C," is not a valid credit card provider."));if(!c.some(function(R){return R.test(x)}))return!1}return(0,w.default)(p)}ie.exports=f.default,ie.exports.default=f.default},53800:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=E(_(20768)),w=E(_(74565));function E(p){return p&&p.__esModule?p:{default:p}}function v(p){var m="\\d{".concat(p.digits_after_decimal[0],"}");p.digits_after_decimal.forEach(function(b,F){F!==0&&(m="".concat(m,"|\\d{").concat(b,"}"))});var C="(".concat(p.symbol.replace(/\W/,function(b){return"\\".concat(b)}),")").concat(p.require_symbol?"":"?"),x="-?",R="[1-9]\\d*",S="[1-9]\\d{0,2}(\\".concat(p.thousands_separator,"\\d{3})*"),O=["0",R,S],M="(".concat(O.join("|"),")?"),k="(\\".concat(p.decimal_separator,"(").concat(m,"))").concat(p.require_decimal?"":"?"),q=M+(p.allow_decimal||p.require_decimal?k:"");return p.allow_negatives&&!p.parens_for_negatives&&(p.negative_sign_after_digits?q+=x:p.negative_sign_before_digits&&(q=x+q)),p.allow_negative_sign_placeholder?q="( (?!\\-))?".concat(q):p.allow_space_after_symbol?q=" ?".concat(q):p.allow_space_after_digits&&(q+="( (?!$))?"),p.symbol_after_digits?q+=C:q=C+q,p.allow_negatives&&(p.parens_for_negatives?q="(\\(".concat(q,"\\)|").concat(q,")"):p.negative_sign_before_digits||p.negative_sign_after_digits||(q=x+q)),new RegExp("^(?!-? )(?=.*\\d)".concat(q,"$"))}var c={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function d(p,m){return(0,w.default)(p),m=(0,h.default)(m,c),v(m).test(p)}ie.exports=f.default,ie.exports.default=f.default},6549:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=w(_(74565));function w(p){return p&&p.__esModule?p:{default:p}}var E=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,v=/^[a-z\-]+=[a-z0-9\-]+$/i,c=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function d(p){(0,h.default)(p);var m=p.split(",");if(m.length<2)return!1;var C=m.shift().trim().split(";"),x=C.shift();if(x.slice(0,5)!=="data:")return!1;var R=x.slice(5);if(R!==""&&!E.test(R))return!1;for(var S=0;S<C.length;S++)if(!(S===C.length-1&&C[S].toLowerCase()==="base64")&&!v.test(C[S]))return!1;for(var O=0;O<m.length;O++)if(!c.test(m[O]))return!1;return!0}ie.exports=f.default,ie.exports.default=f.default},53747:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=O;var h=w(_(20768));function w(M){return M&&M.__esModule?M:{default:M}}function E(M,k){return d(M)||c(M,k)||m(M,k)||v()}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(M,k){var q=M==null?null:typeof Symbol<"u"&&M[Symbol.iterator]||M["@@iterator"];if(q!=null){var b,F,G,ue,le=[],X=!0,se=!1;try{if(G=(q=q.call(M)).next,k===0){if(Object(q)!==q)return;X=!1}else for(;!(X=(b=G.call(q)).done)&&(le.push(b.value),le.length!==k);X=!0);}catch(de){se=!0,F=de}finally{try{if(!X&&q.return!=null&&(ue=q.return(),Object(ue)!==ue))return}finally{if(se)throw F}}return le}}function d(M){if(Array.isArray(M))return M}function p(M,k){var q=typeof Symbol<"u"&&M[Symbol.iterator]||M["@@iterator"];if(!q){if(Array.isArray(M)||(q=m(M))||k&&M&&typeof M.length=="number"){q&&(M=q);var b=0,F=function(){};return{s:F,n:function(){return b>=M.length?{done:!0}:{done:!1,value:M[b++]}},e:function(se){throw se},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var G=!0,ue=!1,le;return{s:function(){q=q.call(M)},n:function(){var se=q.next();return G=se.done,se},e:function(se){ue=!0,le=se},f:function(){try{!G&&q.return!=null&&q.return()}finally{if(ue)throw le}}}}function m(M,k){if(M){if(typeof M=="string")return C(M,k);var q=Object.prototype.toString.call(M).slice(8,-1);if(q==="Object"&&M.constructor&&(q=M.constructor.name),q==="Map"||q==="Set")return Array.from(M);if(q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(q))return C(M,k)}}function C(M,k){(k==null||k>M.length)&&(k=M.length);for(var q=0,b=new Array(k);q<k;q++)b[q]=M[q];return b}var x={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};function R(M){return/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(M)}function S(M,k){for(var q=[],b=Math.min(M.length,k.length),F=0;F<b;F++)q.push([M[F],k[F]]);return q}function O(M,k){if(typeof k=="string"?k=(0,h.default)({format:k},x):k=(0,h.default)(k,x),typeof M=="string"&&R(k.format)){var q=k.delimiters.find(function($){return k.format.indexOf($)!==-1}),b=k.strictMode?q:k.delimiters.find(function($){return M.indexOf($)!==-1}),F=S(M.split(b),k.format.toLowerCase().split(q)),G={},ue=p(F),le;try{for(ue.s();!(le=ue.n()).done;){var X=E(le.value,2),se=X[0],de=X[1];if(se.length!==de.length)return!1;G[de.charAt(0)]=se}}catch($){ue.e($)}finally{ue.f()}var ye=G.y;if(ye.startsWith("-"))return!1;if(G.y.length===2){var he=parseInt(G.y,10);if(isNaN(he))return!1;var K=new Date().getFullYear()%100;he<K?ye="20".concat(G.y):ye="19".concat(G.y)}var B=G.m;G.m.length===1&&(B="0".concat(G.m));var L=G.d;return G.d.length===1&&(L="0".concat(G.d)),new Date("".concat(ye,"-").concat(B,"-").concat(L,"T00:00:00.000Z")).getUTCDate()===+G.d}return k.strictMode?!1:Object.prototype.toString.call(M)==="[object Date]"&&isFinite(M)}ie.exports=f.default,ie.exports.default=f.default},83052:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=C;var h=c(_(20768)),w=c(_(74565)),E=c(_(75679)),v=_(83747);function c(x){return x&&x.__esModule?x:{default:x}}function d(x){var R=new RegExp("^[-+]?([0-9]+)?(\\".concat(v.decimal[x.locale],"[0-9]{").concat(x.decimal_digits,"})").concat(x.force_decimal?"":"?","$"));return R}var p={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},m=["","-","+"];function C(x,R){if((0,w.default)(x),R=(0,h.default)(R,p),R.locale in v.decimal)return!(0,E.default)(m,x.replace(/ /g,""))&&d(R).test(x);throw new Error("Invalid locale '".concat(R.locale,"'"))}ie.exports=f.default,ie.exports.default=f.default},98129:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=E(_(74565)),w=E(_(15802));function E(c){return c&&c.__esModule?c:{default:c}}function v(c,d){return(0,h.default)(c),(0,w.default)(c)%parseInt(d,10)===0}ie.exports=f.default,ie.exports.default=f.default},57915:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=m;var h=w(_(74565));function w(C){return C&&C.__esModule?C:{default:C}}var E=8,v=14,c=/^(\d{8}|\d{13}|\d{14})$/;function d(C,x){return C===E||C===v?x%2===0?3:1:x%2===0?1:3}function p(C){var x=C.slice(0,-1).split("").map(function(S,O){return Number(S)*d(C.length,O)}).reduce(function(S,O){return S+O},0),R=10-x%10;return R<10?R:0}function m(C){(0,h.default)(C);var x=Number(C.slice(-1));return c.test(C)&&x===p(C)}ie.exports=f.default,ie.exports.default=f.default},13639:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=q;var h=d(_(74565)),w=d(_(5713)),E=d(_(98216)),v=d(_(41818)),c=d(_(20768));function d(b){return b&&b.__esModule?b:{default:b}}var p={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},m=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,C=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,x=/^[a-z\d]+$/,R=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,S=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,O=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,M=254;function k(b){var F=b.replace(/^"(.+)"$/,"$1");if(!F.trim())return!1;var G=/[\.";<>]/.test(F);if(G){if(F===b)return!1;var ue=F.split('"').length===F.split('\\"').length;if(!ue)return!1}return!0}function q(b,F){if((0,h.default)(b),F=(0,c.default)(F,p),F.require_display_name||F.allow_display_name){var G=b.match(m);if(G){var ue=G[1];if(b=b.replace(ue,"").replace(/(^<|>$)/g,""),ue.endsWith(" ")&&(ue=ue.slice(0,-1)),!k(ue))return!1}else if(F.require_display_name)return!1}if(!F.ignore_max_length&&b.length>M)return!1;var le=b.split("@"),X=le.pop(),se=X.toLowerCase();if(F.host_blacklist.includes(se)||F.host_whitelist.length>0&&!F.host_whitelist.includes(se))return!1;var de=le.join("@");if(F.domain_specific_validation&&(se==="gmail.com"||se==="googlemail.com")){de=de.toLowerCase();var ye=de.split("+")[0];if(!(0,w.default)(ye.replace(/\./g,""),{min:6,max:30}))return!1;for(var he=ye.split("."),K=0;K<he.length;K++)if(!x.test(he[K]))return!1}if(F.ignore_max_length===!1&&(!(0,w.default)(de,{max:64})||!(0,w.default)(X,{max:254})))return!1;if(!(0,E.default)(X,{require_tld:F.require_tld,ignore_max_length:F.ignore_max_length,allow_underscores:F.allow_underscores})){if(!F.allow_ip_domain)return!1;if(!(0,v.default)(X)){if(!X.startsWith("[")||!X.endsWith("]"))return!1;var B=X.slice(1,-1);if(B.length===0||!(0,v.default)(B))return!1}}if(de[0]==='"')return de=de.slice(1,de.length-1),F.allow_utf8_local_part?O.test(de):R.test(de);for(var L=F.allow_utf8_local_part?S:C,$=de.split("."),T=0;T<$.length;T++)if(!L.test($[T]))return!1;return!(F.blacklisted_chars&&de.search(new RegExp("[".concat(F.blacklisted_chars,"]+"),"g"))!==-1)}ie.exports=f.default,ie.exports.default=f.default},76154:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=E(_(74565)),w=E(_(20768));function E(d){return d&&d.__esModule?d:{default:d}}var v={ignore_whitespace:!1};function c(d,p){return(0,h.default)(d),p=(0,w.default)(p,v),(p.ignore_whitespace?d.trim().length:d.length)===0}ie.exports=f.default,ie.exports.default=f.default},18700:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^(0x)[0-9a-f]{40}$/i;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},98216:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=E(_(74565)),w=E(_(20768));function E(d){return d&&d.__esModule?d:{default:d}}var v={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function c(d,p){(0,h.default)(d),p=(0,w.default)(p,v),p.allow_trailing_dot&&d[d.length-1]==="."&&(d=d.substring(0,d.length-1)),p.allow_wildcard===!0&&d.indexOf("*.")===0&&(d=d.substring(2));var m=d.split("."),C=m[m.length-1];return p.require_tld&&(m.length<2||!p.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(C)||/\s/.test(C))||!p.allow_numeric_tld&&/^\d+$/.test(C)?!1:m.every(function(x){return!(x.length>63&&!p.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(x)||/[\uff01-\uff5e]/.test(x)||/^-|-$/.test(x)||!p.allow_underscores&&/_/.test(x))})}ie.exports=f.default,ie.exports.default=f.default},3733:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v,f.locales=void 0;var h=E(_(74565)),w=_(83747);function E(d){return d&&d.__esModule?d:{default:d}}function v(d,p){(0,h.default)(d),p=p||{};var m=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(p.locale?w.decimal[p.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(d===""||d==="."||d===","||d==="-"||d==="+")return!1;var C=parseFloat(d.replace(",","."));return m.test(d)&&(!p.hasOwnProperty("min")||C>=p.min)&&(!p.hasOwnProperty("max")||C<=p.max)&&(!p.hasOwnProperty("lt")||C<p.lt)&&(!p.hasOwnProperty("gt")||C>p.gt)}var c=f.locales=Object.keys(w.decimal)},3468:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v,f.fullWidth=void 0;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=f.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function v(c){return(0,h.default)(c),E.test(c)}},13764:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=w(_(74565));function w(d){return d&&d.__esModule?d:{default:d}}var E=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,v=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function c(d){(0,h.default)(d);var p=d.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return p.indexOf(",")!==-1?E.test(p):v.test(p)}ie.exports=f.default,ie.exports.default=f.default},45560:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v,f.halfWidth=void 0;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=f.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function v(c){return(0,h.default)(c),E.test(c)}},55567:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function v(c,d){(0,h.default)(c);var p=new RegExp("^[a-fA-F0-9]{".concat(E[d],"}$"));return p.test(c)}ie.exports=f.default,ie.exports.default=f.default},8815:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},17816:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^(0x|0h)?[0-9A-F]+$/i;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},95767:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=p,f.locales=void 0;var h=w(_(74565));function w(C){return C&&C.__esModule?C:{default:C}}var E={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function v(C){var x=C.filter(function(R){return!(R in E)});return!(x.length>0)}function c(C,x){var R=C.replace(/[\s\-]+/gi,"").toUpperCase(),S=R.slice(0,2).toUpperCase(),O=S in E;if(x.whitelist){if(!v(x.whitelist))return!1;var M=x.whitelist.includes(S);if(!M)return!1}if(x.blacklist){var k=x.blacklist.includes(S);if(k)return!1}return O&&E[S].test(R)}function d(C){var x=C.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),R=x.slice(4)+x.slice(0,4),S=R.replace(/[A-Z]/g,function(M){return M.charCodeAt(0)-55}),O=S.match(/\d{1,7}/g).reduce(function(M,k){return Number(M+k)%97},"");return O===1}function p(C){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,h.default)(C),c(C,x)&&d(C)}var m=f.locales=Object.keys(E)},87851:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=w(_(74565));function w(d){return d&&d.__esModule?d:{default:d}}var E=/^[0-9]{15}$/,v=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function c(d,p){(0,h.default)(d),p=p||{};var m=E;if(p.allow_hyphens&&(m=v),!m.test(d))return!1;d=d.replace(/-/g,"");for(var C=0,x=2,R=14,S=0;S<R;S++){var O=d.substring(R-S-1,R-S),M=parseInt(O,10)*x;M>=10?C+=M%10+1:C+=M,x===1?x+=1:x-=1}var k=(10-C%10)%10;return k===parseInt(d.substring(14,15),10)}ie.exports=f.default,ie.exports.default=f.default},41818:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=m;var h=w(_(74565));function w(C){return C&&C.__esModule?C:{default:C}}var E="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",v="(".concat(E,"[.]){3}").concat(E),c=new RegExp("^".concat(v,"$")),d="(?:[0-9a-fA-F]{1,4})",p=new RegExp("^("+"(?:".concat(d,":){7}(?:").concat(d,"|:)|")+"(?:".concat(d,":){6}(?:").concat(v,"|:").concat(d,"|:)|")+"(?:".concat(d,":){5}(?::").concat(v,"|(:").concat(d,"){1,2}|:)|")+"(?:".concat(d,":){4}(?:(:").concat(d,"){0,1}:").concat(v,"|(:").concat(d,"){1,3}|:)|")+"(?:".concat(d,":){3}(?:(:").concat(d,"){0,2}:").concat(v,"|(:").concat(d,"){1,4}|:)|")+"(?:".concat(d,":){2}(?:(:").concat(d,"){0,3}:").concat(v,"|(:").concat(d,"){1,5}|:)|")+"(?:".concat(d,":){1}(?:(:").concat(d,"){0,4}:").concat(v,"|(:").concat(d,"){1,6}|:)|")+"(?::((?::".concat(d,"){0,5}:").concat(v,"|(?::").concat(d,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function m(C){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,h.default)(C),x=String(x),x?x==="4"?c.test(C):x==="6"?p.test(C):!1:m(C,4)||m(C,6)}ie.exports=f.default,ie.exports.default=f.default},73673:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=p;var h=E(_(74565)),w=E(_(41818));function E(m){return m&&m.__esModule?m:{default:m}}var v=/^\d{1,3}$/,c=32,d=128;function p(m){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(0,h.default)(m);var x=m.split("/");if(x.length!==2||!v.test(x[1])||x[1].length>1&&x[1].startsWith("0"))return!1;var R=(0,w.default)(x[0],C);if(!R)return!1;var S=null;switch(String(C)){case"4":S=c;break;case"6":S=d;break;default:S=(0,w.default)(x[0],"6")?d:c}return x[1]<=S&&x[1]>=0}ie.exports=f.default,ie.exports.default=f.default},76663:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=w(_(74565));function w(p){return p&&p.__esModule?p:{default:p}}var E=/^(?:[0-9]{9}X|[0-9]{10})$/,v=/^(?:[0-9]{13})$/,c=[1,3];function d(p,m){(0,h.default)(p);var C=String(m?.version||m);if(!(m!=null&&m.version||m))return d(p,{version:10})||d(p,{version:13});var x=p.replace(/[\s-]+/g,""),R=0;if(C==="10"){if(!E.test(x))return!1;for(var S=0;S<C-1;S++)R+=(S+1)*x.charAt(S);if(x.charAt(9)==="X"?R+=100:R+=10*x.charAt(9),R%11===0)return!0}else if(C==="13"){if(!v.test(x))return!1;for(var O=0;O<12;O++)R+=c[O%2]*x.charAt(O);if(x.charAt(12)-(10-R%10)%10===0)return!0}return!1}ie.exports=f.default,ie.exports.default=f.default},58860:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function v(c){if((0,h.default)(c),!E.test(c))return!1;for(var d=!0,p=0,m=c.length-2;m>=0;m--)if(c[m]>="A"&&c[m]<="Z")for(var C=c[m].charCodeAt(0)-55,x=C%10,R=Math.trunc(C/10),S=0,O=[x,R];S<O.length;S++){var M=O[S];d?M>=5?p+=1+(M-5)*2:p+=M*2:p+=M,d=!d}else{var k=c[m].charCodeAt(0)-48;d?k>=5?p+=1+(k-5)*2:p+=k*2:p+=k,d=!d}var q=Math.trunc((p+9)/10)*10-p;return+c[c.length-1]===q}ie.exports=f.default,ie.exports.default=f.default},51141:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.CountryCodes=void 0,f.default=v;var h=w(_(74565));function w(d){return d&&d.__esModule?d:{default:d}}var E=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function v(d){return(0,h.default)(d),E.has(d.toUpperCase())}var c=f.CountryCodes=E},49222:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function v(c){return(0,h.default)(c),E.has(c.toUpperCase())}ie.exports=f.default,ie.exports.default=f.default},99288:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.CurrencyCodes=void 0,f.default=v;var h=w(_(74565));function w(d){return d&&d.__esModule?d:{default:d}}var E=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function v(d){return(0,h.default)(d),E.has(d.toUpperCase())}var c=f.CurrencyCodes=E},95391:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.isFreightContainerID=void 0,f.isISO6346=c;var h=w(_(74565));function w(p){return p&&p.__esModule?p:{default:p}}var E=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,v=/^[0-9]$/;function c(p){if((0,h.default)(p),p=p.toUpperCase(),!E.test(p))return!1;if(p.length===11){for(var m=0,C=0;C<p.length-1;C++)if(v.test(p[C]))m+=p[C]*Math.pow(2,C);else{var x=void 0,R=p.charCodeAt(C)-55;R<11?x=R:R>=11&&R<=20?x=12+R%11:R>=21&&R<=30?x=23+R%21:x=34+R%31,m+=x*Math.pow(2,C)}var S=m%11;return Number(p[p.length-1])===S}return!0}var d=f.isFreightContainerID=c},5979:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function v(c){return(0,h.default)(c),E.has(c)}ie.exports=f.default,ie.exports.default=f.default},81487:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=w(_(74565));function w(p){return p&&p.__esModule?p:{default:p}}var E=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,v=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,c=function(m){var C=m.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(C){var x=Number(C[1]),R=Number(C[2]);return x%4===0&&x%100!==0||x%400===0?R<=366:R<=365}var S=m.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),O=S[1],M=S[2],k=S[3],q=M&&"0".concat(M).slice(-2),b=k&&"0".concat(k).slice(-2),F=new Date("".concat(O,"-").concat(q||"01","-").concat(b||"01"));return M&&k?F.getUTCFullYear()===O&&F.getUTCMonth()+1===M&&F.getUTCDate()===k:!0};function d(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,h.default)(p);var C=m.strictSeparator?v.test(p):E.test(p);return C&&m.strict?c(p):C}ie.exports=f.default,ie.exports.default=f.default},14148:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},15446:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E="^\\d{4}-?\\d{3}[\\dX]$";function v(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,h.default)(c);var p=E;if(p=d.require_hyphen?p.replace("?",""):p,p=d.case_sensitive?new RegExp(p):new RegExp(p,"i"),!p.test(c))return!1;for(var m=c.replace("-","").toUpperCase(),C=0,x=0;x<m.length;x++){var R=m[x];C+=(R==="X"?10:+R)*(8-x)}return C%11===0}ie.exports=f.default,ie.exports.default=f.default},98839:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=E(_(74565)),w=E(_(35186));function E(d){return d&&d.__esModule?d:{default:d}}var v={PL:function(p){(0,h.default)(p);var m={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(p!=null&&p.length===11&&(0,w.default)(p,{allow_leading_zeroes:!0})){var C=p.split("").slice(0,-1),x=C.reduce(function(O,M,k){return O+Number(M)*m[k+1]},0),R=x%10,S=Number(p.charAt(p.length-1));if(R===0&&S===0||S===10-R)return!0}return!1},ES:function(p){(0,h.default)(p);var m=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,C={X:0,Y:1,Z:2},x=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],R=p.trim().toUpperCase();if(!m.test(R))return!1;var S=R.slice(0,-1).replace(/[X,Y,Z]/g,function(O){return C[O]});return R.endsWith(x[S%23])},FI:function(p){if((0,h.default)(p),p.length!==11||!p.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/))return!1;var m="0123456789ABCDEFHJKLMNPRSTUVWXY",C=parseInt(p.slice(0,6),10)*1e3+parseInt(p.slice(7,10),10),x=C%31,R=m[x];return R===p.slice(10,11)},IN:function(p){var m=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,C=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],x=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],R=p.trim();if(!m.test(R))return!1;var S=0,O=R.replace(/\s/g,"").split("").map(Number).reverse();return O.forEach(function(M,k){S=C[S][x[k%8][M]]}),S===0},IR:function(p){if(!p.match(/^\d{10}$/)||(p="0000".concat(p).slice(p.length-6),parseInt(p.slice(3,9),10)===0))return!1;for(var m=parseInt(p.slice(9,10),10),C=0,x=0;x<9;x++)C+=parseInt(p.slice(x,x+1),10)*(10-x);return C%=11,C<2&&m===C||C>=2&&m===11-C},IT:function(p){return p.length!==9||p==="CA00000AA"?!1:p.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(p){var m=p.trim();if(isNaN(Number(m))||m.length!==11||m==="00000000000")return!1;var C=m.split("").map(Number),x=(11-(3*C[0]+7*C[1]+6*C[2]+1*C[3]+8*C[4]+9*C[5]+4*C[6]+5*C[7]+2*C[8])%11)%11,R=(11-(5*C[0]+4*C[1]+3*C[2]+2*C[3]+7*C[4]+6*C[5]+5*C[6]+4*C[7]+3*C[8]+2*x)%11)%11;return!(x!==C[9]||R!==C[10])},TH:function(p){if(!p.match(/^[1-8]\d{12}$/))return!1;for(var m=0,C=0;C<12;C++)m+=parseInt(p[C],10)*(13-C);return p[12]===((11-m%11)%10).toString()},LK:function(p){var m=/^[1-9]\d{8}[vx]$/i,C=/^[1-9]\d{11}$/i;return p.length===10&&m.test(p)?!0:!!(p.length===12&&C.test(p))},"he-IL":function(p){var m=/^\d{9}$/,C=p.trim();if(!m.test(C))return!1;for(var x=C,R=0,S,O=0;O<x.length;O++)S=Number(x[O])*(O%2+1),R+=S>9?S-9:S;return R%10===0},"ar-LY":function(p){var m=/^(1|2)\d{11}$/,C=p.trim();return!!m.test(C)},"ar-TN":function(p){var m=/^\d{8}$/,C=p.trim();return!!m.test(C)},"zh-CN":function(p){var m=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],C=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],x=["1","0","X","9","8","7","6","5","4","3","2"],R=function(G){return m.includes(G)},S=function(G){var ue=parseInt(G.substring(0,4),10),le=parseInt(G.substring(4,6),10),X=parseInt(G.substring(6),10),se=new Date(ue,le-1,X);return se>new Date?!1:se.getFullYear()===ue&&se.getMonth()===le-1&&se.getDate()===X},O=function(G){for(var ue=G.substring(0,17),le=0,X=0;X<17;X++)le+=parseInt(ue.charAt(X),10)*parseInt(C[X],10);var se=le%11;return x[se]},M=function(G){return O(G)===G.charAt(17).toUpperCase()},k=function(G){var ue=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(G);if(!ue)return!1;var le=G.substring(0,2);if(ue=R(le),!ue)return!1;var X="19".concat(G.substring(6,12));return ue=S(X),!!ue},q=function(G){var ue=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(G);if(!ue)return!1;var le=G.substring(0,2);if(ue=R(le),!ue)return!1;var X=G.substring(6,14);return ue=S(X),ue?M(G):!1},b=function(G){var ue=/^\d{15}|(\d{17}(\d|x|X))$/.test(G);return ue?G.length===15?k(G):q(G):!1};return b(p)},"zh-HK":function(p){p=p.trim();var m=/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/,C=/^[0-9]$/;if(p=p.toUpperCase(),!m.test(p))return!1;p=p.replace(/\[|\]|\(|\)/g,""),p.length===8&&(p="3".concat(p));for(var x=0,R=0;R<=7;R++){var S=void 0;C.test(p[R])?S=p[R]:S=(p[R].charCodeAt(0)-55)%11,x+=S*(9-R)}x%=11;var O;return x===0?O="0":x===1?O="A":O=String(11-x),O===p[p.length-1]},"zh-TW":function(p){var m={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},C=p.trim().toUpperCase();return/^[A-Z][0-9]{9}$/.test(C)?Array.from(C).reduce(function(x,R,S){if(S===0){var O=m[R];return O%10*9+Math.floor(O/10)}return S===9?(10-x%10-Number(R))%10===0:x+Number(R)*(9-S)},0):!1}};function c(d,p){if((0,h.default)(d),p in v)return v[p](d);if(p==="any"){for(var m in v)if(v.hasOwnProperty(m)){var C=v[m];if(C(d))return!0}return!1}throw new Error("Invalid locale '".concat(p,"'"))}ie.exports=f.default,ie.exports.default=f.default},45588:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=E(_(74565)),w=E(_(42882));function E(d){return d&&d.__esModule?d:{default:d}}function v(d){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},v(d)}function c(d,p){(0,h.default)(d);var m;if(Object.prototype.toString.call(p)==="[object Array]"){var C=[];for(m in p)({}).hasOwnProperty.call(p,m)&&(C[m]=(0,w.default)(p[m]));return C.indexOf(d)>=0}else{if(v(p)==="object")return p.hasOwnProperty(d);if(p&&typeof p.indexOf=="function")return p.indexOf(d)>=0}return!1}ie.exports=f.default,ie.exports.default=f.default},35186:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=w(_(74565));function w(d){return d&&d.__esModule?d:{default:d}}var E=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,v=/^[-+]?[0-9]+$/;function c(d,p){(0,h.default)(d),p=p||{};var m=p.allow_leading_zeroes===!1?E:v,C=!p.hasOwnProperty("min")||d>=p.min,x=!p.hasOwnProperty("max")||d<=p.max,R=!p.hasOwnProperty("lt")||d<p.lt,S=!p.hasOwnProperty("gt")||d>p.gt;return m.test(d)&&C&&x&&R&&S}ie.exports=f.default,ie.exports.default=f.default},21333:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=E(_(74565)),w=E(_(20768));function E(p){return p&&p.__esModule?p:{default:p}}function v(p){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},v(p)}var c={allow_primitives:!1};function d(p,m){(0,h.default)(p);try{m=(0,w.default)(m,c);var C=[];m.allow_primitives&&(C=[null,!1,!0]);var x=JSON.parse(p);return C.includes(x)||!!x&&v(x)==="object"}catch{}return!1}ie.exports=f.default,ie.exports.default=f.default},29926:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=E(_(74565)),w=E(_(67772));function E(c){return c&&c.__esModule?c:{default:c}}function v(c){(0,h.default)(c);var d=c.split("."),p=d.length;return p!==3?!1:d.reduce(function(m,C){return m&&(0,w.default)(C,{urlSafe:!0})},!0)}ie.exports=f.default,ie.exports.default=f.default},72996:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=C;var h=E(_(74565)),w=E(_(20768));function E(x){return x&&x.__esModule?x:{default:x}}var v=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,c=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,d=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,p=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,m={checkDMS:!1};function C(x,R){if((0,h.default)(x),R=(0,w.default)(R,m),!x.includes(","))return!1;var S=x.split(",");return S[0].startsWith("(")&&!S[1].endsWith(")")||S[1].endsWith(")")&&!S[0].startsWith("(")?!1:R.checkDMS?d.test(S[0])&&p.test(S[1]):v.test(S[0])&&c.test(S[1])}ie.exports=f.default,ie.exports.default=f.default},21835:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}function E(c){"@babel/helpers - typeof";return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},E(c)}function v(c,d){(0,h.default)(c);var p,m;E(d)==="object"?(p=d.min||0,m=d.max):(p=arguments[1]||0,m=arguments[2]);var C=c.match(/(\uFE0F|\uFE0E)/g)||[],x=c.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],R=c.length-C.length-x.length;return R>=p&&(typeof m>"u"||R<=m)}ie.exports=f.default,ie.exports.default=f.default},32694:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E={"cs-CZ":function(d){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(d)},"de-DE":function(d){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(d)},"de-LI":function(d){return/^FL[- ]?\d{1,5}[UZ]?$/.test(d)},"en-IN":function(d){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(d)},"es-AR":function(d){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(d)},"fi-FI":function(d){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(d)},"hu-HU":function(d){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(d)},"pt-BR":function(d){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(d)},"pt-PT":function(d){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(d)},"sq-AL":function(d){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(d)},"sv-SE":function(d){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(d.trim())},"en-PK":function(d){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(d.trim())}};function v(c,d){if((0,h.default)(c),d in E)return E[d](c);if(d==="any"){for(var p in E){var m=E[p];if(m(c))return!0}return!1}throw new Error("Invalid locale '".concat(d,"'"))}ie.exports=f.default,ie.exports.default=f.default},40893:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=b;var h=w(_(74565));function w(F){return F&&F.__esModule?F:{default:F}}var E="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",v="(([a-zA-Z]{2,3}(-".concat(E,")?)|([a-zA-Z]{5,8}))"),c="([A-Za-z]{4})",d="([A-Za-z]{2}|\\d{3})",p="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",m="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",C="(".concat(m,"(-[A-Za-z0-9]{2,8})+)"),x="(x(-[A-Za-z0-9]{1,8})+)",R="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",S="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",O="(".concat(R,"|").concat(S,")"),M="(-|_)",k="".concat(v,"(").concat(M).concat(c,")?(").concat(M).concat(d,")?(").concat(M).concat(p,")*(").concat(M).concat(C,")*(").concat(M).concat(x,")?"),q=new RegExp("(^".concat(x,"$)|(^").concat(O,"$)|(^").concat(k,"$)"));function b(F){return(0,h.default)(F),q.test(F)}ie.exports=f.default,ie.exports.default=f.default},76842:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){return(0,h.default)(v),v===v.toLowerCase()}ie.exports=f.default,ie.exports.default=f.default},57951:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){(0,h.default)(v);for(var c=v.replace(/[- ]+/g,""),d=0,p,m,C,x=c.length-1;x>=0;x--)p=c.substring(x,x+1),m=parseInt(p,10),C?(m*=2,m>=10?d+=m%10+1:d+=m):d+=m,C=!C;return!!(d%10===0&&c)}ie.exports=f.default,ie.exports.default=f.default},84714:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=C;var h=w(_(74565));function w(x){return x&&x.__esModule?x:{default:x}}var E=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,v=/^([0-9a-fA-F]){12}$/,c=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,d=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,p=/^([0-9a-fA-F]){16}$/,m=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function C(x,R){return(0,h.default)(x),R!=null&&R.eui&&(R.eui=String(R.eui)),R!=null&&R.no_colons||R!=null&&R.no_separators?R.eui==="48"?v.test(x):R.eui==="64"?p.test(x):v.test(x)||p.test(x):R?.eui==="48"?E.test(x)||c.test(x):R?.eui==="64"?d.test(x)||m.test(x):C(x,{eui:"48"})||C(x,{eui:"64"})}ie.exports=f.default,ie.exports.default=f.default},8523:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^[a-f0-9]{32}$/;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},41379:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function v(c){return(0,h.default)(c),c.indexOf("magnet:?")!==0?!1:E.test(c)}ie.exports=f.default,ie.exports.default=f.default},7272:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=O;var h=v(_(35835)),w=v(_(13639)),E=v(_(74565));function v(M){return M&&M.__esModule?M:{default:M}}function c(M,k){return m(M)||p(M,k)||x(M,k)||d()}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p(M,k){var q=M==null?null:typeof Symbol<"u"&&M[Symbol.iterator]||M["@@iterator"];if(q!=null){var b,F,G,ue,le=[],X=!0,se=!1;try{if(G=(q=q.call(M)).next,k===0){if(Object(q)!==q)return;X=!1}else for(;!(X=(b=G.call(q)).done)&&(le.push(b.value),le.length!==k);X=!0);}catch(de){se=!0,F=de}finally{try{if(!X&&q.return!=null&&(ue=q.return(),Object(ue)!==ue))return}finally{if(se)throw F}}return le}}function m(M){if(Array.isArray(M))return M}function C(M,k){var q=typeof Symbol<"u"&&M[Symbol.iterator]||M["@@iterator"];if(!q){if(Array.isArray(M)||(q=x(M))||k&&M&&typeof M.length=="number"){q&&(M=q);var b=0,F=function(){};return{s:F,n:function(){return b>=M.length?{done:!0}:{done:!1,value:M[b++]}},e:function(se){throw se},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var G=!0,ue=!1,le;return{s:function(){q=q.call(M)},n:function(){var se=q.next();return G=se.done,se},e:function(se){ue=!0,le=se},f:function(){try{!G&&q.return!=null&&q.return()}finally{if(ue)throw le}}}}function x(M,k){if(M){if(typeof M=="string")return R(M,k);var q=Object.prototype.toString.call(M).slice(8,-1);if(q==="Object"&&M.constructor&&(q=M.constructor.name),q==="Map"||q==="Set")return Array.from(M);if(q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(q))return R(M,k)}}function R(M,k){(k==null||k>M.length)&&(k=M.length);for(var q=0,b=new Array(k);q<k;q++)b[q]=M[q];return b}function S(M){var k=new Set(["subject","body","cc","bcc"]),q={cc:"",bcc:""},b=!1,F=M.split("&");if(F.length>4)return!1;var G=C(F),ue;try{for(G.s();!(ue=G.n()).done;){var le=ue.value,X=le.split("="),se=c(X,2),de=se[0],ye=se[1];if(de&&!k.has(de)){b=!0;break}ye&&(de==="cc"||de==="bcc")&&(q[de]=ye),de&&k.delete(de)}}catch(he){G.e(he)}finally{G.f()}return b?!1:q}function O(M,k){if((0,E.default)(M),M.indexOf("mailto:")!==0)return!1;var q=M.replace("mailto:","").split("?"),b=c(q,2),F=b[0],G=b[1],ue=G===void 0?"":G;if(!F&&!ue)return!0;var le=S(ue);return le?"".concat(F,",").concat(le.cc,",").concat(le.bcc).split(",").every(function(X){return X=(0,h.default)(X," "),X?(0,w.default)(X,k):!0}):!1}ie.exports=f.default,ie.exports.default=f.default},85247:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=d;var h=w(_(74565));function w(p){return p&&p.__esModule?p:{default:p}}var E=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,v=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,c=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function d(p){return(0,h.default)(p),E.test(p)||v.test(p)||c.test(p)}ie.exports=f.default,ie.exports.default=f.default},5661:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v,f.locales=void 0;var h=w(_(74565));function w(d){return d&&d.__esModule?d:{default:d}}var E={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};E["en-CA"]=E["en-US"],E["fr-CA"]=E["en-CA"],E["fr-BE"]=E["nl-BE"],E["zh-HK"]=E["en-HK"],E["zh-MO"]=E["en-MO"],E["ga-IE"]=E["en-IE"],E["fr-CH"]=E["de-CH"],E["it-CH"]=E["fr-CH"];function v(d,p,m){if((0,h.default)(d),m&&m.strictMode&&!d.startsWith("+"))return!1;if(Array.isArray(p))return p.some(function(R){if(E.hasOwnProperty(R)){var S=E[R];if(S.test(d))return!0}return!1});if(p in E)return E[p].test(d);if(!p||p==="any"){for(var C in E)if(E.hasOwnProperty(C)){var x=E[C];if(x.test(d))return!0}return!1}throw new Error("Invalid locale '".concat(p,"'"))}var c=f.locales=Object.keys(E)},87862:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=E(_(74565)),w=E(_(17816));function E(c){return c&&c.__esModule?c:{default:c}}function v(c){return(0,h.default)(c),(0,w.default)(c)&&c.length===24}ie.exports=f.default,ie.exports.default=f.default},9364:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/[^\x00-\x7F]/;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},69320:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=E(_(74565)),w=_(83747);function E(d){return d&&d.__esModule?d:{default:d}}var v=/^[0-9]+$/;function c(d,p){return(0,h.default)(d),p&&p.no_symbols?v.test(d):new RegExp("^[+-]?([0-9]*[".concat((p||{}).locale?w.decimal[p.locale]:".","])?[0-9]+$")).test(d)}ie.exports=f.default,ie.exports.default=f.default},2836:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^(0o)?[0-7]+$/i;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},28484:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};function v(c,d){(0,h.default)(c);var p=c.replace(/\s/g,"").toUpperCase();return d.toUpperCase()in E&&E[d].test(p)}ie.exports=f.default,ie.exports.default=f.default},40256:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(35186));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){return(0,h.default)(v,{allow_leading_zeroes:!1,min:0,max:65535})}ie.exports=f.default,ie.exports.default=f.default},52049:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=C,f.locales=void 0;var h=w(_(74565));function w(x){return x&&x.__esModule?x:{default:x}}var E=/^\d{3}$/,v=/^\d{4}$/,c=/^\d{5}$/,d=/^\d{6}$/,p={AD:/^AD\d{3}$/,AT:v,AU:v,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:v,BG:v,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:v,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:c,DK:v,DO:c,DZ:c,EE:c,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:c,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:v,ID:c,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:E,IT:c,JP:/^\d{3}\-\d{4}$/,KE:c,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:v,LV:/^LV\-\d{4}$/,LK:c,MG:E,MX:c,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:c,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:v,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:v,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:d,RU:d,SA:c,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:d,SI:v,SK:/^\d{3}\s?\d{2}$/,TH:c,TN:v,TW:/^\d{3}(\d{2})?$/,UA:c,US:/^\d{5}(-\d{4})?$/,ZA:v,ZM:c},m=f.locales=Object.keys(p);function C(x,R){if((0,h.default)(x),R in p)return p[R].test(x);if(R==="any"){for(var S in p)if(p.hasOwnProperty(S)){var O=p[S];if(O.test(x))return!0}return!1}throw new Error("Invalid locale '".concat(R,"'"))}},30540:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=q;var h=w(_(74565));function w(b){return b&&b.__esModule?b:{default:b}}var E=/[0-9]{4}/,v=/(0[1-9]|1[0-2])/,c=/([12]\d|0[1-9]|3[01])/,d=/([01][0-9]|2[0-3])/,p=/[0-5][0-9]/,m=/([0-5][0-9]|60)/,C=/(\.[0-9]+)?/,x=new RegExp("[-+]".concat(d.source,":").concat(p.source)),R=new RegExp("([zZ]|".concat(x.source,")")),S=new RegExp("".concat(d.source,":").concat(p.source,":").concat(m.source).concat(C.source)),O=new RegExp("".concat(E.source,"-").concat(v.source,"-").concat(c.source)),M=new RegExp("".concat(S.source).concat(R.source)),k=new RegExp("^".concat(O.source,"[ tT]").concat(M.source,"$"));function q(b){return(0,h.default)(b),k.test(b)}ie.exports=f.default,ie.exports.default=f.default},63829:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=p;var h=w(_(74565));function w(m){return m&&m.__esModule?m:{default:m}}var E=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,v=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,c=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,d=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;function p(m){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,h.default)(m),C?E.test(m)||v.test(m)||c.test(m)||d.test(m):E.test(m)||v.test(m)}ie.exports=f.default,ie.exports.default=f.default},81571:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=E(_(74565)),w=E(_(66648));function E(d){return d&&d.__esModule?d:{default:d}}var v=(0,w.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function c(d){return(0,h.default)(d),v.test(d)}ie.exports=f.default,ie.exports.default=f.default},2792:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},42081:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=S;var h=E(_(20768)),w=E(_(74565));function E(O){return O&&O.__esModule?O:{default:O}}var v=/^[A-Z]$/,c=/^[a-z]$/,d=/^[0-9]$/,p=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,m={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function C(O){var M={};return Array.from(O).forEach(function(k){var q=M[k];q?M[k]+=1:M[k]=1}),M}function x(O){var M=C(O),k={length:O.length,uniqueChars:Object.keys(M).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(M).forEach(function(q){v.test(q)?k.uppercaseCount+=M[q]:c.test(q)?k.lowercaseCount+=M[q]:d.test(q)?k.numberCount+=M[q]:p.test(q)&&(k.symbolCount+=M[q])}),k}function R(O,M){var k=0;return k+=O.uniqueChars*M.pointsPerUnique,k+=(O.length-O.uniqueChars)*M.pointsPerRepeat,O.lowercaseCount>0&&(k+=M.pointsForContainingLower),O.uppercaseCount>0&&(k+=M.pointsForContainingUpper),O.numberCount>0&&(k+=M.pointsForContainingNumber),O.symbolCount>0&&(k+=M.pointsForContainingSymbol),k}function S(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,w.default)(O);var k=x(O);return M=(0,h.default)(M||{},m),M.returnScore?R(k,M):k.length>=M.minLength&&k.lowercaseCount>=M.minLowercase&&k.uppercaseCount>=M.minUppercase&&k.numberCount>=M.minNumbers&&k.symbolCount>=M.minSymbols}ie.exports=f.default,ie.exports.default=f.default},32589:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function v(c){return(0,h.default)(c),E.test(c)}ie.exports=f.default,ie.exports.default=f.default},39695:function(ie,f,_){"use strict";function h(Be){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(We){return typeof We}:function(We){return We&&typeof Symbol=="function"&&We.constructor===Symbol&&We!==Symbol.prototype?"symbol":typeof We},h(Be)}Object.defineProperty(f,"__esModule",{value:!0}),f.default=Ge;var w=p(_(74565)),E=d(_(73996)),v=p(_(53747));function c(Be){if(typeof WeakMap!="function")return null;var We=new WeakMap,Ze=new WeakMap;return(c=function(Ft){return Ft?Ze:We})(Be)}function d(Be,We){if(!We&&Be&&Be.__esModule)return Be;if(Be===null||h(Be)!="object"&&typeof Be!="function")return{default:Be};var Ze=c(We);if(Ze&&Ze.has(Be))return Ze.get(Be);var _t={__proto__:null},Ft=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var gt in Be)if(gt!=="default"&&{}.hasOwnProperty.call(Be,gt)){var lt=Ft?Object.getOwnPropertyDescriptor(Be,gt):null;lt&&(lt.get||lt.set)?Object.defineProperty(_t,gt,lt):_t[gt]=Be[gt]}return _t.default=Be,Ze&&Ze.set(Be,_t),_t}function p(Be){return Be&&Be.__esModule?Be:{default:Be}}function m(Be){return S(Be)||R(Be)||x(Be)||C()}function C(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(Be,We){if(Be){if(typeof Be=="string")return O(Be,We);var Ze=Object.prototype.toString.call(Be).slice(8,-1);if(Ze==="Object"&&Be.constructor&&(Ze=Be.constructor.name),Ze==="Map"||Ze==="Set")return Array.from(Be);if(Ze==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ze))return O(Be,We)}}function R(Be){if(typeof Symbol<"u"&&Be[Symbol.iterator]!=null||Be["@@iterator"]!=null)return Array.from(Be)}function S(Be){if(Array.isArray(Be))return O(Be)}function O(Be,We){(We==null||We>Be.length)&&(We=Be.length);for(var Ze=0,_t=new Array(We);Ze<We;Ze++)_t[Ze]=Be[Ze];return _t}function M(Be){var We=Be.slice(0,2),Ze=parseInt(Be.slice(2,4),10);Ze>40?(Ze-=40,We="20".concat(We)):Ze>20?(Ze-=20,We="18".concat(We)):We="19".concat(We),Ze<10&&(Ze="0".concat(Ze));var _t="".concat(We,"/").concat(Ze,"/").concat(Be.slice(4,6));if(!(0,v.default)(_t,"YYYY/MM/DD"))return!1;for(var Ft=Be.split("").map(function(tt){return parseInt(tt,10)}),gt=[2,4,8,5,10,9,7,3,6],lt=0,dt=0;dt<gt.length;dt++)lt+=Ft[dt]*gt[dt];return lt=lt%11===10?0:lt%11,lt===Ft[9]}function k(Be){var We=Be.split(""),Ze=We.filter(function(Ft,gt){return gt%2}).map(function(Ft){return Number(Ft)*2}).join("").split(""),_t=We.filter(function(Ft,gt){return!(gt%2)}).concat(Ze).map(function(Ft){return Number(Ft)}).reduce(function(Ft,gt){return Ft+gt});return _t%10===0}function q(Be){Be=Be.replace(/\W/,"");var We=parseInt(Be.slice(0,2),10);if(Be.length===10)We<54?We="20".concat(We):We="19".concat(We);else{if(Be.slice(6)==="000")return!1;if(We<54)We="19".concat(We);else return!1}We.length===3&&(We=[We.slice(0,2),"0",We.slice(2)].join(""));var Ze=parseInt(Be.slice(2,4),10);if(Ze>50&&(Ze-=50),Ze>20){if(parseInt(We,10)<2004)return!1;Ze-=20}Ze<10&&(Ze="0".concat(Ze));var _t="".concat(We,"/").concat(Ze,"/").concat(Be.slice(4,6));if(!(0,v.default)(_t,"YYYY/MM/DD"))return!1;if(Be.length===10&&parseInt(Be,10)%11!==0){var Ft=parseInt(Be.slice(0,9),10)%11;if(parseInt(We,10)<1986&&Ft===10){if(parseInt(Be.slice(9),10)!==0)return!1}else return!1}return!0}function b(Be){return E.luhnCheck(Be)}function F(Be){for(var We=Be.split("").map(function(tt){return parseInt(tt,10)}),Ze=[],_t=0;_t<We.length-1;_t++){Ze.push("");for(var Ft=0;Ft<We.length-1;Ft++)We[_t]===We[Ft]&&(Ze[_t]+=Ft)}if(Ze=Ze.filter(function(tt){return tt.length>1}),Ze.length!==2&&Ze.length!==3)return!1;if(Ze[0].length===3){for(var gt=Ze[0].split("").map(function(tt){return parseInt(tt,10)}),lt=0,dt=0;dt<gt.length-1;dt++)gt[dt]+1===gt[dt+1]&&(lt+=1);if(lt===2)return!1}return E.iso7064Check(Be)}function G(Be){Be=Be.replace(/\W/,"");var We=parseInt(Be.slice(4,6),10),Ze=Be.slice(6,7);switch(Ze){case"0":case"1":case"2":case"3":We="19".concat(We);break;case"4":case"9":We<37?We="20".concat(We):We="19".concat(We);break;default:if(We<37)We="20".concat(We);else if(We>58)We="18".concat(We);else return!1;break}We.length===3&&(We=[We.slice(0,2),"0",We.slice(2)].join(""));var _t="".concat(We,"/").concat(Be.slice(2,4),"/").concat(Be.slice(0,2));if(!(0,v.default)(_t,"YYYY/MM/DD"))return!1;for(var Ft=Be.split("").map(function(tt){return parseInt(tt,10)}),gt=0,lt=4,dt=0;dt<9;dt++)gt+=Ft[dt]*lt,lt-=1,lt===1&&(lt=7);return gt%=11,gt===1?!1:gt===0?Ft[9]===0:Ft[9]===11-gt}function ue(Be){for(var We=Be.slice(0,8).split("").map(function(gt){return parseInt(gt,10)}),Ze=0,_t=1;_t<We.length;_t+=2)Ze+=We[_t];for(var Ft=0;Ft<We.length;Ft+=2)We[Ft]<2?Ze+=1-We[Ft]:(Ze+=2*(We[Ft]-2)+5,We[Ft]>4&&(Ze+=2));return String.fromCharCode(Ze%26+65)===Be.charAt(8)}function le(Be){for(var We=Be.split("").map(function(Ft){return parseInt(Ft,10)}),Ze=0,_t=0;_t<8;_t++)Ze+=We[_t]*Math.pow(2,8-_t);return Ze%11%10===We[8]}function X(Be){var We=E.reverseMultiplyAndSum(Be.split("").slice(0,7).map(function(Ze){return parseInt(Ze,10)}),8);return Be.length===9&&Be[8]!=="W"&&(We+=(Be[8].charCodeAt(0)-64)*9),We%=23,We===0?Be[7].toUpperCase()==="W":Be[7].toUpperCase()===String.fromCharCode(64+We)}var se={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function de(){var Be=[];for(var We in se)se.hasOwnProperty(We)&&Be.push.apply(Be,m(se[We]));return Be}function ye(Be){return de().indexOf(Be.slice(0,2))!==-1}function he(Be){for(var We=0,Ze=Be.split(""),_t=parseInt(Ze.pop(),10),Ft=0;Ft<Ze.length;Ft++)We+=Ze[9-Ft]*(2+Ft%6);var gt=11-We%11;return gt===11?gt=0:gt===10&&(gt=9),_t===gt}function K(Be){var We=Be.toUpperCase().split("");if(isNaN(parseInt(We[0],10))&&We.length>1){var Ze=0;switch(We[0]){case"Y":Ze=1;break;case"Z":Ze=2;break;default:}We.splice(0,1,Ze)}else for(;We.length<9;)We.unshift(0);var _t=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"];We=We.join("");var Ft=parseInt(We.slice(0,8),10)%23;return We[8]===_t[Ft]}function B(Be){var We=Be.slice(1,3),Ze=Be.slice(0,1);switch(Ze){case"1":case"2":We="18".concat(We);break;case"3":case"4":We="19".concat(We);break;default:We="20".concat(We);break}var _t="".concat(We,"/").concat(Be.slice(3,5),"/").concat(Be.slice(5,7));if(!(0,v.default)(_t,"YYYY/MM/DD"))return!1;for(var Ft=Be.split("").map(function(rt){return parseInt(rt,10)}),gt=0,lt=1,dt=0;dt<10;dt++)gt+=Ft[dt]*lt,lt+=1,lt===10&&(lt=1);if(gt%11===10){gt=0,lt=3;for(var tt=0;tt<10;tt++)gt+=Ft[tt]*lt,lt+=1,lt===10&&(lt=1);if(gt%11===10)return Ft[10]===0}return gt%11===Ft[10]}function L(Be){var We=Be.slice(4,6),Ze=Be.slice(6,7);switch(Ze){case"+":We="18".concat(We);break;case"-":We="19".concat(We);break;default:We="20".concat(We);break}var _t="".concat(We,"/").concat(Be.slice(2,4),"/").concat(Be.slice(0,2));if(!(0,v.default)(_t,"YYYY/MM/DD"))return!1;var Ft=parseInt(Be.slice(0,6)+Be.slice(7,10),10)%31;if(Ft<10)return Ft===parseInt(Be.slice(10),10);Ft-=10;var gt=["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"];return gt[Ft]===Be.slice(10)}function $(Be){if(Be.slice(2,4)!=="00"||Be.slice(4,6)!=="00"){var We="".concat(Be.slice(0,2),"/").concat(Be.slice(2,4),"/").concat(Be.slice(4,6));if(!(0,v.default)(We,"YY/MM/DD"))return!1}var Ze=97-parseInt(Be.slice(0,9),10)%97,_t=parseInt(Be.slice(9,11),10);return!(Ze!==_t&&(Ze=97-parseInt("2".concat(Be.slice(0,9)),10)%97,Ze!==_t))}function T(Be){Be=Be.replace(/\s/g,"");var We=parseInt(Be.slice(0,10),10)%511,Ze=parseInt(Be.slice(10,13),10);return We===Ze}function N(Be){var We="".concat(Be.slice(0,4),"/").concat(Be.slice(4,6),"/").concat(Be.slice(6,8));return!(0,v.default)(We,"YYYY/MM/DD")||!E.luhnCheck(Be.slice(0,12))?!1:E.verhoeffCheck("".concat(Be.slice(0,11)).concat(Be[12]))}function j(Be){return E.iso7064Check(Be)}function Y(Be){for(var We=Be.split("").map(function(Ft){return parseInt(Ft,10)}),Ze=8,_t=1;_t<9;_t++)Ze+=We[_t]*(_t+1);return Ze%11===We[9]}function Z(Be){for(var We=!1,Ze=!1,_t=0;_t<3;_t++)if(!We&&/[AEIOU]/.test(Be[_t]))We=!0;else if(!Ze&&We&&Be[_t]==="X")Ze=!0;else if(_t>0&&(We&&!Ze&&!/[AEIOU]/.test(Be[_t])||Ze&&!/X/.test(Be[_t])))return!1;return!0}function z(Be){var We=Be.toUpperCase().split("");if(!Z(We.slice(0,3))||!Z(We.slice(3,6)))return!1;for(var Ze=[6,7,9,10,12,13,14],_t={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},Ft=0,gt=Ze;Ft<gt.length;Ft++){var lt=gt[Ft];We[lt]in _t&&We.splice(lt,1,_t[We[lt]])}var dt={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"},tt=dt[We[8]],rt=parseInt(We[9]+We[10],10);rt>40&&(rt-=40),rt<10&&(rt="0".concat(rt));var ke="".concat(We[6]).concat(We[7],"/").concat(tt,"/").concat(rt);if(!(0,v.default)(ke,"YY/MM/DD"))return!1;for(var xe=0,Pe=1;Pe<We.length-1;Pe+=2){var it=parseInt(We[Pe],10);isNaN(it)&&(it=We[Pe].charCodeAt(0)-65),xe+=it}for(var Xe={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},st=0;st<We.length-1;st+=2){var It=0;if(We[st]in Xe)It=Xe[We[st]];else{var ft=parseInt(We[st],10);It=2*ft+1,ft>4&&(It+=2)}xe+=It}return String.fromCharCode(65+xe%26)===We[15]}function fe(Be){Be=Be.replace(/\W/,"");var We=Be.slice(0,2);if(We!=="32"){var Ze=Be.slice(2,4);if(Ze!=="00"){var _t=Be.slice(4,6);switch(Be[6]){case"0":_t="18".concat(_t);break;case"1":_t="19".concat(_t);break;default:_t="20".concat(_t);break}var Ft="".concat(_t,"/").concat(Be.slice(2,4),"/").concat(We);if(!(0,v.default)(Ft,"YYYY/MM/DD"))return!1}for(var gt=1101,lt=[1,6,3,7,9,10,5,8,4,2],dt=0;dt<Be.length-1;dt++)gt-=parseInt(Be[dt],10)*lt[dt];return parseInt(Be[10],10)===gt%11}return!0}function te(Be){if(Be.length!==9){for(var We=Be.toUpperCase().split("");We.length<8;)We.unshift(0);switch(Be[7]){case"A":case"P":if(parseInt(We[6],10)===0)return!1;break;default:{var Ze=parseInt(We.join("").slice(0,5),10);if(Ze>32e3)return!1;var _t=parseInt(We.join("").slice(5,7),10);if(Ze===_t)return!1}}}return!0}function H(Be){return E.reverseMultiplyAndSum(Be.split("").slice(0,8).map(function(We){return parseInt(We,10)}),9)%11===parseInt(Be[8],10)}function Q(Be){if(Be.length===10){for(var We=[6,5,7,2,3,4,5,6,7],Ze=0,_t=0;_t<We.length;_t++)Ze+=parseInt(Be[_t],10)*We[_t];return Ze%=11,Ze===10?!1:Ze===parseInt(Be[9],10)}var Ft=Be.slice(0,2),gt=parseInt(Be.slice(2,4),10);gt>80?(Ft="18".concat(Ft),gt-=80):gt>60?(Ft="22".concat(Ft),gt-=60):gt>40?(Ft="21".concat(Ft),gt-=40):gt>20?(Ft="20".concat(Ft),gt-=20):Ft="19".concat(Ft),gt<10&&(gt="0".concat(gt));var lt="".concat(Ft,"/").concat(gt,"/").concat(Be.slice(4,6));if(!(0,v.default)(lt,"YYYY/MM/DD"))return!1;for(var dt=0,tt=1,rt=0;rt<Be.length-1;rt++)dt+=parseInt(Be[rt],10)*tt%10,tt+=2,tt>10?tt=1:tt===5&&(tt+=2);return dt=10-dt%10,dt===parseInt(Be[10],10)}function oe(Be){if(Be.length===11){var We,Ze;if(We=0,Be==="11111111111"||Be==="22222222222"||Be==="33333333333"||Be==="44444444444"||Be==="55555555555"||Be==="66666666666"||Be==="77777777777"||Be==="88888888888"||Be==="99999999999"||Be==="00000000000")return!1;for(var _t=1;_t<=9;_t++)We+=parseInt(Be.substring(_t-1,_t),10)*(11-_t);if(Ze=We*10%11,Ze===10&&(Ze=0),Ze!==parseInt(Be.substring(9,10),10))return!1;We=0;for(var Ft=1;Ft<=10;Ft++)We+=parseInt(Be.substring(Ft-1,Ft),10)*(12-Ft);return Ze=We*10%11,Ze===10&&(Ze=0),Ze===parseInt(Be.substring(10,11),10)}if(Be==="00000000000000"||Be==="11111111111111"||Be==="22222222222222"||Be==="33333333333333"||Be==="44444444444444"||Be==="55555555555555"||Be==="66666666666666"||Be==="77777777777777"||Be==="88888888888888"||Be==="99999999999999")return!1;for(var gt=Be.length-2,lt=Be.substring(0,gt),dt=Be.substring(gt),tt=0,rt=gt-7,ke=gt;ke>=1;ke--)tt+=lt.charAt(gt-ke)*rt,rt-=1,rt<2&&(rt=9);var xe=tt%11<2?0:11-tt%11;if(xe!==parseInt(dt.charAt(0),10))return!1;gt+=1,lt=Be.substring(0,gt),tt=0,rt=gt-7;for(var Pe=gt;Pe>=1;Pe--)tt+=lt.charAt(gt-Pe)*rt,rt-=1,rt<2&&(rt=9);return xe=tt%11<2?0:11-tt%11,xe===parseInt(dt.charAt(1),10)}function _e(Be){var We=11-E.reverseMultiplyAndSum(Be.split("").slice(0,8).map(function(Ze){return parseInt(Ze,10)}),9)%11;return We>9?parseInt(Be[8],10)===0:We===parseInt(Be[8],10)}function ge(Be){if(Be.slice(0,4)!=="9000"){var We=Be.slice(1,3);switch(Be[0]){case"1":case"2":We="19".concat(We);break;case"3":case"4":We="18".concat(We);break;case"5":case"6":We="20".concat(We);break;default:}var Ze="".concat(We,"/").concat(Be.slice(3,5),"/").concat(Be.slice(5,7));if(Ze.length===8){if(!(0,v.default)(Ze,"YY/MM/DD"))return!1}else if(!(0,v.default)(Ze,"YYYY/MM/DD"))return!1;for(var _t=Be.split("").map(function(dt){return parseInt(dt,10)}),Ft=[2,7,9,1,4,6,3,5,8,2,7,9],gt=0,lt=0;lt<Ft.length;lt++)gt+=_t[lt]*Ft[lt];return gt%11===10?_t[12]===1:_t[12]===gt%11}return!0}function be(Be){if(Be.length===9){if(Be=Be.replace(/\W/,""),Be.slice(6)==="000")return!1;var We=parseInt(Be.slice(0,2),10);if(We>53)return!1;We<10?We="190".concat(We):We="19".concat(We);var Ze=parseInt(Be.slice(2,4),10);Ze>50&&(Ze-=50),Ze<10&&(Ze="0".concat(Ze));var _t="".concat(We,"/").concat(Ze,"/").concat(Be.slice(4,6));if(!(0,v.default)(_t,"YYYY/MM/DD"))return!1}return!0}function we(Be){var We=11-E.reverseMultiplyAndSum(Be.split("").slice(0,7).map(function(Ze){return parseInt(Ze,10)}),8)%11;return We===10?parseInt(Be[7],10)===0:We===parseInt(Be[7],10)}function Ee(Be){var We=Be.slice(0);Be.length>11&&(We=We.slice(2));var Ze="",_t=We.slice(2,4),Ft=parseInt(We.slice(4,6),10);if(Be.length>11)Ze=Be.slice(0,4);else if(Ze=Be.slice(0,2),Be.length===11&&Ft<60){var gt=new Date().getFullYear().toString(),lt=parseInt(gt.slice(0,2),10);if(gt=parseInt(gt,10),Be[6]==="-")parseInt("".concat(lt).concat(Ze),10)>gt?Ze="".concat(lt-1).concat(Ze):Ze="".concat(lt).concat(Ze);else if(Ze="".concat(lt-1).concat(Ze),gt-parseInt(Ze,10)<100)return!1}Ft>60&&(Ft-=60),Ft<10&&(Ft="0".concat(Ft));var dt="".concat(Ze,"/").concat(_t,"/").concat(Ft);if(dt.length===8){if(!(0,v.default)(dt,"YY/MM/DD"))return!1}else if(!(0,v.default)(dt,"YYYY/MM/DD"))return!1;return E.luhnCheck(Be.replace(/\W/,""))}function me(Be){for(var We=Be.split("").map(function(gt){return parseInt(gt,10)}),Ze=[-1,5,7,9,4,6,10,5,7],_t=0,Ft=0;Ft<Ze.length;Ft++)_t+=We[Ft]*Ze[Ft];return _t%11===10?We[9]===0:We[9]===_t%11}var Ke={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-AR":/(20|23|24|27|30|33|34)[0-9]{8}[0-9]/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/,"uk-UA":/^\d{10}$/};Ke["lb-LU"]=Ke["fr-LU"],Ke["lt-LT"]=Ke["et-EE"],Ke["nl-BE"]=Ke["fr-BE"],Ke["fr-CA"]=Ke["en-CA"];var He={"bg-BG":M,"cs-CZ":q,"de-AT":b,"de-DE":F,"dk-DK":G,"el-CY":ue,"el-GR":le,"en-CA":k,"en-IE":X,"en-US":ye,"es-AR":he,"es-ES":K,"et-EE":B,"fi-FI":L,"fr-BE":$,"fr-FR":T,"fr-LU":N,"hr-HR":j,"hu-HU":Y,"it-IT":z,"lv-LV":fe,"mt-MT":te,"nl-NL":H,"pl-PL":Q,"pt-BR":oe,"pt-PT":_e,"ro-RO":ge,"sk-SK":be,"sl-SI":we,"sv-SE":Ee,"uk-UA":me};He["lb-LU"]=He["fr-LU"],He["lt-LT"]=He["et-EE"],He["nl-BE"]=He["fr-BE"],He["fr-CA"]=He["en-CA"];var Ie=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,Le={"de-AT":Ie,"de-DE":/[\/\\]/g,"fr-BE":Ie};Le["nl-BE"]=Le["fr-BE"];function Ge(Be){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US";(0,w.default)(Be);var Ze=Be.slice(0);if(We in Ke)return We in Le&&(Ze=Ze.replace(Le[We],"")),Ke[We].test(Ze)?We in He?He[We](Ze):!0:!1;throw new Error("Invalid locale '".concat(We,"'"))}ie.exports=f.default,ie.exports.default=f.default},69674:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=w(_(20768));function w(d){return d&&d.__esModule?d:{default:d}}var E={hourFormat:"hour24",mode:"default"},v={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};function c(d,p){return p=(0,h.default)(p,E),typeof d!="string"?!1:v[p.hourFormat][p.mode].test(d)}ie.exports=f.default,ie.exports.default=f.default},94434:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=q;var h=c(_(74565)),w=c(_(98216)),E=c(_(41818)),v=c(_(20768));function c(b){return b&&b.__esModule?b:{default:b}}function d(b,F){return R(b)||x(b,F)||m(b,F)||p()}function p(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m(b,F){if(b){if(typeof b=="string")return C(b,F);var G=Object.prototype.toString.call(b).slice(8,-1);if(G==="Object"&&b.constructor&&(G=b.constructor.name),G==="Map"||G==="Set")return Array.from(b);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return C(b,F)}}function C(b,F){(F==null||F>b.length)&&(F=b.length);for(var G=0,ue=new Array(F);G<F;G++)ue[G]=b[G];return ue}function x(b,F){var G=b==null?null:typeof Symbol<"u"&&b[Symbol.iterator]||b["@@iterator"];if(G!=null){var ue,le,X,se,de=[],ye=!0,he=!1;try{if(X=(G=G.call(b)).next,F===0){if(Object(G)!==G)return;ye=!1}else for(;!(ye=(ue=X.call(G)).done)&&(de.push(ue.value),de.length!==F);ye=!0);}catch(K){he=!0,le=K}finally{try{if(!ye&&G.return!=null&&(se=G.return(),Object(se)!==se))return}finally{if(he)throw le}}return de}}function R(b){if(Array.isArray(b))return b}var S={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},O=/^\[([^\]]+)\](?::([0-9]+))?$/;function M(b){return Object.prototype.toString.call(b)==="[object RegExp]"}function k(b,F){for(var G=0;G<F.length;G++){var ue=F[G];if(b===ue||M(ue)&&ue.test(b))return!0}return!1}function q(b,F){if((0,h.default)(b),!b||/[\s<>]/.test(b)||b.indexOf("mailto:")===0||(F=(0,v.default)(F,S),F.validate_length&&b.length>=2083)||!F.allow_fragments&&b.includes("#")||!F.allow_query_components&&(b.includes("?")||b.includes("&")))return!1;var G,ue,le,X,se,de,ye,he;if(ye=b.split("#"),b=ye.shift(),ye=b.split("?"),b=ye.shift(),ye=b.split("://"),ye.length>1){if(G=ye.shift().toLowerCase(),F.require_valid_protocol&&F.protocols.indexOf(G)===-1)return!1}else{if(F.require_protocol)return!1;if(b.slice(0,2)==="//"){if(!F.allow_protocol_relative_urls)return!1;ye[0]=b.slice(2)}}if(b=ye.join("://"),b==="")return!1;if(ye=b.split("/"),b=ye.shift(),b===""&&!F.require_host)return!0;if(ye=b.split("@"),ye.length>1){if(F.disallow_auth||ye[0]===""||(ue=ye.shift(),ue.indexOf(":")>=0&&ue.split(":").length>2))return!1;var K=ue.split(":"),B=d(K,2),L=B[0],$=B[1];if(L===""&&$==="")return!1}X=ye.join("@"),de=null,he=null;var T=X.match(O);if(T?(le="",he=T[1],de=T[2]||null):(ye=X.split(":"),le=ye.shift(),ye.length&&(de=ye.join(":"))),de!==null&&de.length>0){if(se=parseInt(de,10),!/^[0-9]+$/.test(de)||se<=0||se>65535)return!1}else if(F.require_port)return!1;return F.host_whitelist?k(le,F.host_whitelist):le===""&&!F.require_host?!0:!(!(0,E.default)(le)&&!(0,w.default)(le,F)&&(!he||!(0,E.default)(he,6))||(le=le||he,F.host_blacklist&&k(le,F.host_blacklist)))}ie.exports=f.default,ie.exports.default=f.default},73600:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=w(_(74565));function w(c){return c&&c.__esModule?c:{default:c}}var E={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function v(c,d){(0,h.default)(c);var p=E[[void 0,null].includes(d)?"all":d];return!!p&&p.test(c)}ie.exports=f.default,ie.exports.default=f.default},10591:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){return(0,h.default)(v),v===v.toUpperCase()}ie.exports=f.default,ie.exports.default=f.default},4252:function(ie,f,_){"use strict";function h(S){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},h(S)}Object.defineProperty(f,"__esModule",{value:!0}),f.default=R,f.vatMatchers=void 0;var w=d(_(74565)),E=c(_(73996));function v(S){if(typeof WeakMap!="function")return null;var O=new WeakMap,M=new WeakMap;return(v=function(q){return q?M:O})(S)}function c(S,O){if(!O&&S&&S.__esModule)return S;if(S===null||h(S)!="object"&&typeof S!="function")return{default:S};var M=v(O);if(M&&M.has(S))return M.get(S);var k={__proto__:null},q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in S)if(b!=="default"&&{}.hasOwnProperty.call(S,b)){var F=q?Object.getOwnPropertyDescriptor(S,b):null;F&&(F.get||F.set)?Object.defineProperty(k,b,F):k[b]=S[b]}return k.default=S,M&&M.set(S,k),k}function d(S){return S&&S.__esModule?S:{default:S}}var p=function(O){var M=O.match(/^(AU)?(\d{11})$/);if(!M)return!1;var k=[10,1,3,5,7,9,11,13,15,17,19];O=O.replace(/^AU/,"");for(var q=(parseInt(O.slice(0,1),10)-1).toString()+O.slice(1),b=0,F=0;F<11;F++)b+=k[F]*q.charAt(F);return b!==0&&b%89===0},m=function(O){var M=function(q){var b=q.pop(),F=[5,4,3,2,7,6,5,4],G=(11-q.reduce(function(ue,le,X){return ue+le*F[X]},0)%11)%11;return b===G};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(O)&&M(O.match(/\d/g).map(function(k){return+k}))},C=function(O){var M=O.match(/^(PT)?(\d{9})$/);if(!M)return!1;var k=M[2],q=11-E.reverseMultiplyAndSum(k.split("").slice(0,8).map(function(b){return parseInt(b,10)}),9)%11;return q>9?parseInt(k[8],10)===0:q===parseInt(k[8],10)},x=f.vatMatchers={AT:function(O){return/^(AT)?U\d{8}$/.test(O)},BE:function(O){return/^(BE)?\d{10}$/.test(O)},BG:function(O){return/^(BG)?\d{9,10}$/.test(O)},HR:function(O){return/^(HR)?\d{11}$/.test(O)},CY:function(O){return/^(CY)?\w{9}$/.test(O)},CZ:function(O){return/^(CZ)?\d{8,10}$/.test(O)},DK:function(O){return/^(DK)?\d{8}$/.test(O)},EE:function(O){return/^(EE)?\d{9}$/.test(O)},FI:function(O){return/^(FI)?\d{8}$/.test(O)},FR:function(O){return/^(FR)?\w{2}\d{9}$/.test(O)},DE:function(O){return/^(DE)?\d{9}$/.test(O)},EL:function(O){return/^(EL)?\d{9}$/.test(O)},HU:function(O){return/^(HU)?\d{8}$/.test(O)},IE:function(O){return/^(IE)?\d{7}\w{1}(W)?$/.test(O)},IT:function(O){return/^(IT)?\d{11}$/.test(O)},LV:function(O){return/^(LV)?\d{11}$/.test(O)},LT:function(O){return/^(LT)?\d{9,12}$/.test(O)},LU:function(O){return/^(LU)?\d{8}$/.test(O)},MT:function(O){return/^(MT)?\d{8}$/.test(O)},NL:function(O){return/^(NL)?\d{9}B\d{2}$/.test(O)},PL:function(O){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(O)},PT:C,RO:function(O){return/^(RO)?\d{2,10}$/.test(O)},SK:function(O){return/^(SK)?\d{10}$/.test(O)},SI:function(O){return/^(SI)?\d{8}$/.test(O)},ES:function(O){return/^(ES)?\w\d{7}[A-Z]$/.test(O)},SE:function(O){return/^(SE)?\d{12}$/.test(O)},AL:function(O){return/^(AL)?\w{9}[A-Z]$/.test(O)},MK:function(O){return/^(MK)?\d{13}$/.test(O)},AU:p,BY:function(O){return/^(УНП )?\d{9}$/.test(O)},CA:function(O){return/^(CA)?\d{9}$/.test(O)},IS:function(O){return/^(IS)?\d{5,6}$/.test(O)},IN:function(O){return/^(IN)?\d{15}$/.test(O)},ID:function(O){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(O)},IL:function(O){return/^(IL)?\d{9}$/.test(O)},KZ:function(O){return/^(KZ)?\d{12}$/.test(O)},NZ:function(O){return/^(NZ)?\d{9}$/.test(O)},NG:function(O){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(O)},NO:function(O){return/^(NO)?\d{9}MVA$/.test(O)},PH:function(O){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(O)},RU:function(O){return/^(RU)?(\d{10}|\d{12})$/.test(O)},SM:function(O){return/^(SM)?\d{5}$/.test(O)},SA:function(O){return/^(SA)?\d{15}$/.test(O)},RS:function(O){return/^(RS)?\d{9}$/.test(O)},CH:m,TR:function(O){return/^(TR)?\d{10}$/.test(O)},UA:function(O){return/^(UA)?\d{12}$/.test(O)},GB:function(O){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(O)},UZ:function(O){return/^(UZ)?\d{9}$/.test(O)},AR:function(O){return/^(AR)?\d{11}$/.test(O)},BO:function(O){return/^(BO)?\d{7}$/.test(O)},BR:function(O){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(O)},CL:function(O){return/^(CL)?\d{8}-\d{1}$/.test(O)},CO:function(O){return/^(CO)?\d{10}$/.test(O)},CR:function(O){return/^(CR)?\d{9,12}$/.test(O)},EC:function(O){return/^(EC)?\d{13}$/.test(O)},SV:function(O){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(O)},GT:function(O){return/^(GT)?\d{7}-\d{1}$/.test(O)},HN:function(O){return/^(HN)?$/.test(O)},MX:function(O){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(O)},NI:function(O){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(O)},PA:function(O){return/^(PA)?$/.test(O)},PY:function(O){return/^(PY)?\d{6,8}-\d{1}$/.test(O)},PE:function(O){return/^(PE)?\d{11}$/.test(O)},DO:function(O){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(O)},UY:function(O){return/^(UY)?\d{12}$/.test(O)},VE:function(O){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(O)}};function R(S,O){if((0,w.default)(S),(0,w.default)(O),O in x)return x[O](S);throw new Error("Invalid country code: '".concat(O,"'"))}},19179:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;var h=v(_(74565)),w=_(3468),E=_(45560);function v(d){return d&&d.__esModule?d:{default:d}}function c(d){return(0,h.default)(d),w.fullWidth.test(d)&&E.halfWidth.test(d)}ie.exports=f.default,ie.exports.default=f.default},85439:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){(0,h.default)(v);for(var d=v.length-1;d>=0;d--)if(c.indexOf(v[d])===-1)return!1;return!0}ie.exports=f.default,ie.exports.default=f.default},92279:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){(0,h.default)(v);var d=c?new RegExp("^[".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return v.replace(d,"")}ie.exports=f.default,ie.exports.default=f.default},36246:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c,d){return(0,h.default)(v),Object.prototype.toString.call(c)!=="[object RegExp]"&&(c=new RegExp(c,d)),!!v.match(c)}ie.exports=f.default,ie.exports.default=f.default},14330:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=C;var h=w(_(20768));function w(x){return x&&x.__esModule?x:{default:x}}var E={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},v=["icloud.com","me.com"],c=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],d=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],p=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function m(x){return x.length>1?x:""}function C(x,R){R=(0,h.default)(R,E);var S=x.split("@"),O=S.pop(),M=S.join("@"),k=[M,O];if(k[1]=k[1].toLowerCase(),k[1]==="gmail.com"||k[1]==="googlemail.com"){if(R.gmail_remove_subaddress&&(k[0]=k[0].split("+")[0]),R.gmail_remove_dots&&(k[0]=k[0].replace(/\.+/g,m)),!k[0].length)return!1;(R.all_lowercase||R.gmail_lowercase)&&(k[0]=k[0].toLowerCase()),k[1]=R.gmail_convert_googlemaildotcom?"gmail.com":k[1]}else if(v.indexOf(k[1])>=0){if(R.icloud_remove_subaddress&&(k[0]=k[0].split("+")[0]),!k[0].length)return!1;(R.all_lowercase||R.icloud_lowercase)&&(k[0]=k[0].toLowerCase())}else if(c.indexOf(k[1])>=0){if(R.outlookdotcom_remove_subaddress&&(k[0]=k[0].split("+")[0]),!k[0].length)return!1;(R.all_lowercase||R.outlookdotcom_lowercase)&&(k[0]=k[0].toLowerCase())}else if(d.indexOf(k[1])>=0){if(R.yahoo_remove_subaddress){var q=k[0].split("-");k[0]=q.length>1?q.slice(0,-1).join("-"):q[0]}if(!k[0].length)return!1;(R.all_lowercase||R.yahoo_lowercase)&&(k[0]=k[0].toLowerCase())}else p.indexOf(k[1])>=0?((R.all_lowercase||R.yandex_lowercase)&&(k[0]=k[0].toLowerCase()),k[1]="yandex.ru"):R.all_lowercase&&(k[0]=k[0].toLowerCase());return k.join("@")}ie.exports=f.default,ie.exports.default=f.default},46081:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){if((0,h.default)(v),c){var d=new RegExp("[".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return v.replace(d,"")}for(var p=v.length-1;/\s/.test(v.charAt(p));)p-=1;return v.slice(0,p+1)}ie.exports=f.default,ie.exports.default=f.default},97163:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=E(_(74565)),w=E(_(98840));function E(c){return c&&c.__esModule?c:{default:c}}function v(c,d){(0,h.default)(c);var p=d?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,w.default)(c,p)}ie.exports=f.default,ie.exports.default=f.default},35440:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){return(0,h.default)(v),c?v==="1"||/^true$/i.test(v):v!=="0"&&!/^false$/i.test(v)&&v!==""}ie.exports=f.default,ie.exports.default=f.default},36310:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){return(0,h.default)(v),v=Date.parse(v),isNaN(v)?null:new Date(v)}ie.exports=f.default,ie.exports.default=f.default},15802:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(3733));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){return(0,h.default)(v)?parseFloat(v):NaN}ie.exports=f.default,ie.exports.default=f.default},15517:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){return(0,h.default)(v),parseInt(v,c||10)}ie.exports=f.default,ie.exports.default=f.default},35835:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=v;var h=E(_(46081)),w=E(_(92279));function E(c){return c&&c.__esModule?c:{default:c}}function v(c,d){return(0,h.default)((0,w.default)(c,d),d)}ie.exports=f.default,ie.exports.default=f.default},33699:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v){return(0,h.default)(v),v.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`").replace(/&/g,"&")}ie.exports=f.default,ie.exports.default=f.default},73996:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.iso7064Check=_,f.luhnCheck=h,f.reverseMultiplyAndSum=w,f.verhoeffCheck=E;function _(v){for(var c=10,d=0;d<v.length-1;d++)c=(parseInt(v[d],10)+c)%10===0?9:(parseInt(v[d],10)+c)%10*2%11;return c=c===1?0:11-c,c===parseInt(v[10],10)}function h(v){for(var c=0,d=!1,p=v.length-1;p>=0;p--){if(d){var m=parseInt(v[p],10)*2;m>9?c+=m.toString().split("").map(function(C){return parseInt(C,10)}).reduce(function(C,x){return C+x},0):c+=m}else c+=parseInt(v[p],10);d=!d}return c%10===0}function w(v,c){for(var d=0,p=0;p<v.length;p++)d+=v[p]*(c-p);return d}function E(v){for(var c=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],d=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],p=v.split("").reverse().join(""),m=0,C=0;C<p.length;C++)m=c[m][d[C%8][parseInt(p[C],10)]];return m===0}},74565:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=h;function _(w){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},_(w)}function h(w){var E=typeof w=="string"||w instanceof String;if(!E){var v=_(w);throw w===null?v="null":v==="object"&&(v=w.constructor.name),new TypeError("Expected a string but received a ".concat(v))}}ie.exports=f.default,ie.exports.default=f.default},75679:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var _=function(E,v){return E.some(function(c){return v===c})},h=f.default=_;ie.exports=f.default,ie.exports.default=f.default},20768:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=_;function _(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=arguments.length>1?arguments[1]:void 0;for(var E in w)typeof h[E]>"u"&&(h[E]=w[E]);return h}ie.exports=f.default,ie.exports.default=f.default},66648:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=_;function _(h,w){var E=h.join("");return new RegExp(E,w)}ie.exports=f.default,ie.exports.default=f.default},42882:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=h;function _(w){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},_(w)}function h(w){return _(w)==="object"&&w!==null?typeof w.toString=="function"?w=w.toString():w="[object Object]":(w===null||typeof w>"u"||isNaN(w)&&!w.length)&&(w=""),String(w)}ie.exports=f.default,ie.exports.default=f.default},76122:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=E;var h=w(_(74565));function w(v){return v&&v.__esModule?v:{default:v}}function E(v,c){return(0,h.default)(v),v.replace(new RegExp("[^".concat(c,"]+"),"g"),"")}ie.exports=f.default,ie.exports.default=f.default},1728:function(ie,f,_){"use strict";var h=_(87196),w=_(79639),E=_(17695),v=_(98801),c=_(25667),d=_(14252),p=v("Object.prototype.toString"),m=_(77185)(),C=typeof globalThis>"u"?_.g:globalThis,x=w(),R=v("String.prototype.slice"),S=v("Array.prototype.indexOf",!0)||function(b,F){for(var G=0;G<b.length;G+=1)if(b[G]===F)return G;return-1},O={__proto__:null};m&&c&&d?h(x,function(q){var b=new C[q];if(Symbol.toStringTag in b&&d){var F=d(b),G=c(F,Symbol.toStringTag);if(!G&&F){var ue=d(F);G=c(ue,Symbol.toStringTag)}O["$"+q]=E(G.get)}}):h(x,function(q){var b=new C[q],F=b.slice||b.set;F&&(O["$"+q]=E(F))});var M=function(b){var F=!1;return h(O,function(G,ue){if(!F)try{"$"+G(b)===ue&&(F=R(ue,1))}catch{}}),F},k=function(b){var F=!1;return h(O,function(G,ue){if(!F)try{G(b),F=R(ue,1)}catch{}}),F};ie.exports=function(b){if(!b||typeof b!="object")return!1;if(!m){var F=R(p(b),8,-1);return S(x,F)>-1?F:F!=="Object"?!1:k(b)}return c?M(b):null}},37498:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.ZodError=f.quotelessJson=f.ZodIssueCode=void 0;const h=_(51721);f.ZodIssueCode=h.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const w=v=>JSON.stringify(v,null,2).replace(/"([^"]+)":/g,"$1:");f.quotelessJson=w;class E extends Error{get errors(){return this.issues}constructor(c){super(),this.issues=[],this.addIssue=p=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};const d=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,d):this.__proto__=d,this.name="ZodError",this.issues=c}format(c){const d=c||function(C){return C.message},p={_errors:[]},m=C=>{for(const x of C.issues)if(x.code==="invalid_union")x.unionErrors.map(m);else if(x.code==="invalid_return_type")m(x.returnTypeError);else if(x.code==="invalid_arguments")m(x.argumentsError);else if(x.path.length===0)p._errors.push(d(x));else{let R=p,S=0;for(;S<x.path.length;){const O=x.path[S];S===x.path.length-1?(R[O]=R[O]||{_errors:[]},R[O]._errors.push(d(x))):R[O]=R[O]||{_errors:[]},R=R[O],S++}}};return m(this),p}static assert(c){if(!(c instanceof E))throw new Error(`Not a ZodError: ${c}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,h.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(c=d=>d.message){const d={},p=[];for(const m of this.issues)m.path.length>0?(d[m.path[0]]=d[m.path[0]]||[],d[m.path[0]].push(c(m))):p.push(c(m));return{formErrors:p,fieldErrors:d}}get formErrors(){return this.flatten()}}f.ZodError=E,E.create=v=>new E(v)},88652:function(ie,f,_){"use strict";var h=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(f,"__esModule",{value:!0}),f.getErrorMap=f.setErrorMap=f.defaultErrorMap=void 0;const w=h(_(10548));f.defaultErrorMap=w.default;let E=w.default;function v(d){E=d}f.setErrorMap=v;function c(){return E}f.getErrorMap=c},75772:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(88652),f),w(_(89082),f),w(_(35209),f),w(_(51721),f),w(_(51554),f),w(_(37498),f)},54439:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.errorUtil=void 0;var _;(function(h){h.errToObj=w=>typeof w=="string"?{message:w}:w||{},h.toString=w=>typeof w=="string"?w:w?.message})(_||(f.errorUtil=_={}))},89082:function(ie,f,_){"use strict";var h=this&&this.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(f,"__esModule",{value:!0}),f.isAsync=f.isValid=f.isDirty=f.isAborted=f.OK=f.DIRTY=f.INVALID=f.ParseStatus=f.addIssueToContext=f.EMPTY_PATH=f.makeIssue=void 0;const w=_(88652),E=h(_(10548)),v=O=>{const{data:M,path:k,errorMaps:q,issueData:b}=O,F=[...k,...b.path||[]],G={...b,path:F};if(b.message!==void 0)return{...b,path:F,message:b.message};let ue="";const le=q.filter(X=>!!X).slice().reverse();for(const X of le)ue=X(G,{data:M,defaultError:ue}).message;return{...b,path:F,message:ue}};f.makeIssue=v,f.EMPTY_PATH=[];function c(O,M){const k=(0,w.getErrorMap)(),q=(0,f.makeIssue)({issueData:M,data:O.data,path:O.path,errorMaps:[O.common.contextualErrorMap,O.schemaErrorMap,k,k===E.default?void 0:E.default].filter(b=>!!b)});O.common.issues.push(q)}f.addIssueToContext=c;class d{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(M,k){const q=[];for(const b of k){if(b.status==="aborted")return f.INVALID;b.status==="dirty"&&M.dirty(),q.push(b.value)}return{status:M.value,value:q}}static async mergeObjectAsync(M,k){const q=[];for(const b of k){const F=await b.key,G=await b.value;q.push({key:F,value:G})}return d.mergeObjectSync(M,q)}static mergeObjectSync(M,k){const q={};for(const b of k){const{key:F,value:G}=b;if(F.status==="aborted"||G.status==="aborted")return f.INVALID;F.status==="dirty"&&M.dirty(),G.status==="dirty"&&M.dirty(),F.value!=="__proto__"&&(typeof G.value<"u"||b.alwaysSet)&&(q[F.value]=G.value)}return{status:M.value,value:q}}}f.ParseStatus=d,f.INVALID=Object.freeze({status:"aborted"});const p=O=>({status:"dirty",value:O});f.DIRTY=p;const m=O=>({status:"valid",value:O});f.OK=m;const C=O=>O.status==="aborted";f.isAborted=C;const x=O=>O.status==="dirty";f.isDirty=x;const R=O=>O.status==="valid";f.isValid=R;const S=O=>typeof Promise<"u"&&O instanceof Promise;f.isAsync=S},35209:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0})},51721:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getParsedType=f.ZodParsedType=f.objectUtil=f.util=void 0;var _;(function(E){E.assertEqual=p=>p;function v(p){}E.assertIs=v;function c(p){throw new Error}E.assertNever=c,E.arrayToEnum=p=>{const m={};for(const C of p)m[C]=C;return m},E.getValidEnumValues=p=>{const m=E.objectKeys(p).filter(x=>typeof p[p[x]]!="number"),C={};for(const x of m)C[x]=p[x];return E.objectValues(C)},E.objectValues=p=>E.objectKeys(p).map(function(m){return p[m]}),E.objectKeys=typeof Object.keys=="function"?p=>Object.keys(p):p=>{const m=[];for(const C in p)Object.prototype.hasOwnProperty.call(p,C)&&m.push(C);return m},E.find=(p,m)=>{for(const C of p)if(m(C))return C},E.isInteger=typeof Number.isInteger=="function"?p=>Number.isInteger(p):p=>typeof p=="number"&&isFinite(p)&&Math.floor(p)===p;function d(p,m=" | "){return p.map(C=>typeof C=="string"?`'${C}'`:C).join(m)}E.joinValues=d,E.jsonStringifyReplacer=(p,m)=>typeof m=="bigint"?m.toString():m})(_||(f.util=_={}));var h;(function(E){E.mergeShapes=(v,c)=>({...v,...c})})(h||(f.objectUtil=h={})),f.ZodParsedType=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const w=E=>{switch(typeof E){case"undefined":return f.ZodParsedType.undefined;case"string":return f.ZodParsedType.string;case"number":return isNaN(E)?f.ZodParsedType.nan:f.ZodParsedType.number;case"boolean":return f.ZodParsedType.boolean;case"function":return f.ZodParsedType.function;case"bigint":return f.ZodParsedType.bigint;case"symbol":return f.ZodParsedType.symbol;case"object":return Array.isArray(E)?f.ZodParsedType.array:E===null?f.ZodParsedType.null:E.then&&typeof E.then=="function"&&E.catch&&typeof E.catch=="function"?f.ZodParsedType.promise:typeof Map<"u"&&E instanceof Map?f.ZodParsedType.map:typeof Set<"u"&&E instanceof Set?f.ZodParsedType.set:typeof Date<"u"&&E instanceof Date?f.ZodParsedType.date:f.ZodParsedType.object;default:return f.ZodParsedType.unknown}};f.getParsedType=w},78211:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(d,p,m,C){C===void 0&&(C=m);var x=Object.getOwnPropertyDescriptor(p,m);(!x||("get"in x?!p.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return p[m]}}),Object.defineProperty(d,C,x)}:function(d,p,m,C){C===void 0&&(C=m),d[C]=p[m]}),w=this&&this.__setModuleDefault||(Object.create?function(d,p){Object.defineProperty(d,"default",{enumerable:!0,value:p})}:function(d,p){d.default=p}),E=this&&this.__importStar||function(d){if(d&&d.__esModule)return d;var p={};if(d!=null)for(var m in d)m!=="default"&&Object.prototype.hasOwnProperty.call(d,m)&&h(p,d,m);return w(p,d),p},v=this&&this.__exportStar||function(d,p){for(var m in d)m!=="default"&&!Object.prototype.hasOwnProperty.call(p,m)&&h(p,d,m)};Object.defineProperty(f,"__esModule",{value:!0}),f.z=void 0;const c=E(_(75772));f.z=c,v(_(75772),f),f.default=c},10548:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0});const h=_(51721),w=_(37498),E=(v,c)=>{let d;switch(v.code){case w.ZodIssueCode.invalid_type:v.received===h.ZodParsedType.undefined?d="Required":d=`Expected ${v.expected}, received ${v.received}`;break;case w.ZodIssueCode.invalid_literal:d=`Invalid literal value, expected ${JSON.stringify(v.expected,h.util.jsonStringifyReplacer)}`;break;case w.ZodIssueCode.unrecognized_keys:d=`Unrecognized key(s) in object: ${h.util.joinValues(v.keys,", ")}`;break;case w.ZodIssueCode.invalid_union:d="Invalid input";break;case w.ZodIssueCode.invalid_union_discriminator:d=`Invalid discriminator value. Expected ${h.util.joinValues(v.options)}`;break;case w.ZodIssueCode.invalid_enum_value:d=`Invalid enum value. Expected ${h.util.joinValues(v.options)}, received '${v.received}'`;break;case w.ZodIssueCode.invalid_arguments:d="Invalid function arguments";break;case w.ZodIssueCode.invalid_return_type:d="Invalid function return type";break;case w.ZodIssueCode.invalid_date:d="Invalid date";break;case w.ZodIssueCode.invalid_string:typeof v.validation=="object"?"includes"in v.validation?(d=`Invalid input: must include "${v.validation.includes}"`,typeof v.validation.position=="number"&&(d=`${d} at one or more positions greater than or equal to ${v.validation.position}`)):"startsWith"in v.validation?d=`Invalid input: must start with "${v.validation.startsWith}"`:"endsWith"in v.validation?d=`Invalid input: must end with "${v.validation.endsWith}"`:h.util.assertNever(v.validation):v.validation!=="regex"?d=`Invalid ${v.validation}`:d="Invalid";break;case w.ZodIssueCode.too_small:v.type==="array"?d=`Array must contain ${v.exact?"exactly":v.inclusive?"at least":"more than"} ${v.minimum} element(s)`:v.type==="string"?d=`String must contain ${v.exact?"exactly":v.inclusive?"at least":"over"} ${v.minimum} character(s)`:v.type==="number"?d=`Number must be ${v.exact?"exactly equal to ":v.inclusive?"greater than or equal to ":"greater than "}${v.minimum}`:v.type==="date"?d=`Date must be ${v.exact?"exactly equal to ":v.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(v.minimum))}`:d="Invalid input";break;case w.ZodIssueCode.too_big:v.type==="array"?d=`Array must contain ${v.exact?"exactly":v.inclusive?"at most":"less than"} ${v.maximum} element(s)`:v.type==="string"?d=`String must contain ${v.exact?"exactly":v.inclusive?"at most":"under"} ${v.maximum} character(s)`:v.type==="number"?d=`Number must be ${v.exact?"exactly":v.inclusive?"less than or equal to":"less than"} ${v.maximum}`:v.type==="bigint"?d=`BigInt must be ${v.exact?"exactly":v.inclusive?"less than or equal to":"less than"} ${v.maximum}`:v.type==="date"?d=`Date must be ${v.exact?"exactly":v.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(v.maximum))}`:d="Invalid input";break;case w.ZodIssueCode.custom:d="Invalid input";break;case w.ZodIssueCode.invalid_intersection_types:d="Intersection results could not be merged";break;case w.ZodIssueCode.not_multiple_of:d=`Number must be a multiple of ${v.multipleOf}`;break;case w.ZodIssueCode.not_finite:d="Number must be finite";break;default:d=c.defaultError,h.util.assertNever(v)}return{message:d}};f.default=E},51554:function(ie,f,_){"use strict";var h=this&&this.__classPrivateFieldGet||function(Xt,et,xt,Kt){if(xt==="a"&&!Kt)throw new TypeError("Private accessor was defined without a getter");if(typeof et=="function"?Xt!==et||!Kt:!et.has(Xt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return xt==="m"?Kt:xt==="a"?Kt.call(Xt):Kt?Kt.value:et.get(Xt)},w=this&&this.__classPrivateFieldSet||function(Xt,et,xt,Kt,kt){if(Kt==="m")throw new TypeError("Private method is not writable");if(Kt==="a"&&!kt)throw new TypeError("Private accessor was defined without a setter");if(typeof et=="function"?Xt!==et||!kt:!et.has(Xt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Kt==="a"?kt.call(Xt,xt):kt?kt.value=xt:et.set(Xt,xt),xt},E,v;Object.defineProperty(f,"__esModule",{value:!0}),f.boolean=f.bigint=f.array=f.any=f.coerce=f.ZodFirstPartyTypeKind=f.late=f.ZodSchema=f.Schema=f.custom=f.ZodReadonly=f.ZodPipeline=f.ZodBranded=f.BRAND=f.ZodNaN=f.ZodCatch=f.ZodDefault=f.ZodNullable=f.ZodOptional=f.ZodTransformer=f.ZodEffects=f.ZodPromise=f.ZodNativeEnum=f.ZodEnum=f.ZodLiteral=f.ZodLazy=f.ZodFunction=f.ZodSet=f.ZodMap=f.ZodRecord=f.ZodTuple=f.ZodIntersection=f.ZodDiscriminatedUnion=f.ZodUnion=f.ZodObject=f.ZodArray=f.ZodVoid=f.ZodNever=f.ZodUnknown=f.ZodAny=f.ZodNull=f.ZodUndefined=f.ZodSymbol=f.ZodDate=f.ZodBoolean=f.ZodBigInt=f.ZodNumber=f.ZodString=f.datetimeRegex=f.ZodType=void 0,f.NEVER=f.void=f.unknown=f.union=f.undefined=f.tuple=f.transformer=f.symbol=f.string=f.strictObject=f.set=f.record=f.promise=f.preprocess=f.pipeline=f.ostring=f.optional=f.onumber=f.oboolean=f.object=f.number=f.nullable=f.null=f.never=f.nativeEnum=f.nan=f.map=f.literal=f.lazy=f.intersection=f.instanceof=f.function=f.enum=f.effect=f.discriminatedUnion=f.date=void 0;const c=_(88652),d=_(54439),p=_(89082),m=_(51721),C=_(37498);class x{constructor(et,xt,Kt,kt){this._cachedPath=[],this.parent=et,this.data=xt,this._path=Kt,this._key=kt}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const R=(Xt,et)=>{if((0,p.isValid)(et))return{success:!0,data:et.value};if(!Xt.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const xt=new C.ZodError(Xt.common.issues);return this._error=xt,this._error}}};function S(Xt){if(!Xt)return{};const{errorMap:et,invalid_type_error:xt,required_error:Kt,description:kt}=Xt;if(et&&(xt||Kt))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return et?{errorMap:et,description:kt}:{errorMap:(Qr,Nr)=>{var An,mn;const{message:Nn}=Xt;return Qr.code==="invalid_enum_value"?{message:Nn??Nr.defaultError}:typeof Nr.data>"u"?{message:(An=Nn??Kt)!==null&&An!==void 0?An:Nr.defaultError}:Qr.code!=="invalid_type"?{message:Nr.defaultError}:{message:(mn=Nn??xt)!==null&&mn!==void 0?mn:Nr.defaultError}},description:kt}}class O{get description(){return this._def.description}_getType(et){return(0,m.getParsedType)(et.data)}_getOrReturnCtx(et,xt){return xt||{common:et.parent.common,data:et.data,parsedType:(0,m.getParsedType)(et.data),schemaErrorMap:this._def.errorMap,path:et.path,parent:et.parent}}_processInputParams(et){return{status:new p.ParseStatus,ctx:{common:et.parent.common,data:et.data,parsedType:(0,m.getParsedType)(et.data),schemaErrorMap:this._def.errorMap,path:et.path,parent:et.parent}}}_parseSync(et){const xt=this._parse(et);if((0,p.isAsync)(xt))throw new Error("Synchronous parse encountered promise.");return xt}_parseAsync(et){const xt=this._parse(et);return Promise.resolve(xt)}parse(et,xt){const Kt=this.safeParse(et,xt);if(Kt.success)return Kt.data;throw Kt.error}safeParse(et,xt){var Kt;const kt={common:{issues:[],async:(Kt=xt?.async)!==null&&Kt!==void 0?Kt:!1,contextualErrorMap:xt?.errorMap},path:xt?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:et,parsedType:(0,m.getParsedType)(et)},or=this._parseSync({data:et,path:kt.path,parent:kt});return R(kt,or)}"~validate"(et){var xt,Kt;const kt={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:et,parsedType:(0,m.getParsedType)(et)};if(!this["~standard"].async)try{const or=this._parseSync({data:et,path:[],parent:kt});return(0,p.isValid)(or)?{value:or.value}:{issues:kt.common.issues}}catch(or){!((Kt=(xt=or?.message)===null||xt===void 0?void 0:xt.toLowerCase())===null||Kt===void 0)&&Kt.includes("encountered")&&(this["~standard"].async=!0),kt.common={issues:[],async:!0}}return this._parseAsync({data:et,path:[],parent:kt}).then(or=>(0,p.isValid)(or)?{value:or.value}:{issues:kt.common.issues})}async parseAsync(et,xt){const Kt=await this.safeParseAsync(et,xt);if(Kt.success)return Kt.data;throw Kt.error}async safeParseAsync(et,xt){const Kt={common:{issues:[],contextualErrorMap:xt?.errorMap,async:!0},path:xt?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:et,parsedType:(0,m.getParsedType)(et)},kt=this._parse({data:et,path:Kt.path,parent:Kt}),or=await((0,p.isAsync)(kt)?kt:Promise.resolve(kt));return R(Kt,or)}refine(et,xt){const Kt=kt=>typeof xt=="string"||typeof xt>"u"?{message:xt}:typeof xt=="function"?xt(kt):xt;return this._refinement((kt,or)=>{const Qr=et(kt),Nr=()=>or.addIssue({code:C.ZodIssueCode.custom,...Kt(kt)});return typeof Promise<"u"&&Qr instanceof Promise?Qr.then(An=>An?!0:(Nr(),!1)):Qr?!0:(Nr(),!1)})}refinement(et,xt){return this._refinement((Kt,kt)=>et(Kt)?!0:(kt.addIssue(typeof xt=="function"?xt(Kt,kt):xt),!1))}_refinement(et){return new ft({schema:this,typeName:Mt.ZodEffects,effect:{type:"refinement",refinement:et}})}superRefine(et){return this._refinement(et)}constructor(et){this.spa=this.safeParseAsync,this._def=et,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:xt=>this["~validate"](xt)}}optional(){return Jt.create(this,this._def)}nullable(){return Ot.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Le.create(this)}promise(){return It.create(this,this._def)}or(et){return We.create([this,et],this._def)}and(et){return gt.create(this,et,this._def)}transform(et){return new ft({...S(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:et}})}default(et){const xt=typeof et=="function"?et:()=>et;return new Ct({...S(this._def),innerType:this,defaultValue:xt,typeName:Mt.ZodDefault})}brand(){return new ot({typeName:Mt.ZodBranded,type:this,...S(this._def)})}catch(et){const xt=typeof et=="function"?et:()=>et;return new qe({...S(this._def),innerType:this,catchValue:xt,typeName:Mt.ZodCatch})}describe(et){const xt=this.constructor;return new xt({...this._def,description:et})}pipe(et){return Ae.create(this,et)}readonly(){return Rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}f.ZodType=O,f.Schema=O,f.ZodSchema=O;const M=/^c[^\s-]{8,}$/i,k=/^[0-9a-z]+$/,q=/^[0-9A-HJKMNP-TV-Z]{26}$/i,b=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,F=/^[a-z0-9_-]{21}$/i,G=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ue=/^[-+]?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)?)??$/,le=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,X="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let se;const de=/^(?:(?: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])$/,ye=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,he=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,B=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,L=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$="((\\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])))",T=new RegExp(`^${$}$`);function N(Xt){let et="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return Xt.precision?et=`${et}\\.\\d{${Xt.precision}}`:Xt.precision==null&&(et=`${et}(\\.\\d+)?`),et}function j(Xt){return new RegExp(`^${N(Xt)}$`)}function Y(Xt){let et=`${$}T${N(Xt)}`;const xt=[];return xt.push(Xt.local?"Z?":"Z"),Xt.offset&&xt.push("([+-]\\d{2}:?\\d{2})"),et=`${et}(${xt.join("|")})`,new RegExp(`^${et}$`)}f.datetimeRegex=Y;function Z(Xt,et){return!!((et==="v4"||!et)&&de.test(Xt)||(et==="v6"||!et)&&he.test(Xt))}function z(Xt,et){if(!G.test(Xt))return!1;try{const[xt]=Xt.split("."),Kt=xt.replace(/-/g,"+").replace(/_/g,"/").padEnd(xt.length+(4-xt.length%4)%4,"="),kt=JSON.parse(atob(Kt));return!(typeof kt!="object"||kt===null||!kt.typ||!kt.alg||et&&kt.alg!==et)}catch{return!1}}function fe(Xt,et){return!!((et==="v4"||!et)&&ye.test(Xt)||(et==="v6"||!et)&&K.test(Xt))}class te extends O{_parse(et){if(this._def.coerce&&(et.data=String(et.data)),this._getType(et)!==m.ZodParsedType.string){const or=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(or,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.string,received:or.parsedType}),p.INVALID}const Kt=new p.ParseStatus;let kt;for(const or of this._def.checks)if(or.kind==="min")et.data.length<or.value&&(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.too_small,minimum:or.value,type:"string",inclusive:!0,exact:!1,message:or.message}),Kt.dirty());else if(or.kind==="max")et.data.length>or.value&&(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.too_big,maximum:or.value,type:"string",inclusive:!0,exact:!1,message:or.message}),Kt.dirty());else if(or.kind==="length"){const Qr=et.data.length>or.value,Nr=et.data.length<or.value;(Qr||Nr)&&(kt=this._getOrReturnCtx(et,kt),Qr?(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.too_big,maximum:or.value,type:"string",inclusive:!0,exact:!0,message:or.message}):Nr&&(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.too_small,minimum:or.value,type:"string",inclusive:!0,exact:!0,message:or.message}),Kt.dirty())}else if(or.kind==="email")le.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"email",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty());else if(or.kind==="emoji")se||(se=new RegExp(X,"u")),se.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"emoji",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty());else if(or.kind==="uuid")b.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"uuid",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty());else if(or.kind==="nanoid")F.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"nanoid",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty());else if(or.kind==="cuid")M.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"cuid",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty());else if(or.kind==="cuid2")k.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"cuid2",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty());else if(or.kind==="ulid")q.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"ulid",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty());else if(or.kind==="url")try{new URL(et.data)}catch{kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"url",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty()}else or.kind==="regex"?(or.regex.lastIndex=0,or.regex.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"regex",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty())):or.kind==="trim"?et.data=et.data.trim():or.kind==="includes"?et.data.includes(or.value,or.position)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.invalid_string,validation:{includes:or.value,position:or.position},message:or.message}),Kt.dirty()):or.kind==="toLowerCase"?et.data=et.data.toLowerCase():or.kind==="toUpperCase"?et.data=et.data.toUpperCase():or.kind==="startsWith"?et.data.startsWith(or.value)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.invalid_string,validation:{startsWith:or.value},message:or.message}),Kt.dirty()):or.kind==="endsWith"?et.data.endsWith(or.value)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.invalid_string,validation:{endsWith:or.value},message:or.message}),Kt.dirty()):or.kind==="datetime"?Y(or).test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.invalid_string,validation:"datetime",message:or.message}),Kt.dirty()):or.kind==="date"?T.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.invalid_string,validation:"date",message:or.message}),Kt.dirty()):or.kind==="time"?j(or).test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.invalid_string,validation:"time",message:or.message}),Kt.dirty()):or.kind==="duration"?ue.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"duration",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty()):or.kind==="ip"?Z(et.data,or.version)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"ip",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty()):or.kind==="jwt"?z(et.data,or.alg)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"jwt",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty()):or.kind==="cidr"?fe(et.data,or.version)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"cidr",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty()):or.kind==="base64"?B.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"base64",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty()):or.kind==="base64url"?L.test(et.data)||(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{validation:"base64url",code:C.ZodIssueCode.invalid_string,message:or.message}),Kt.dirty()):m.util.assertNever(or);return{status:Kt.value,value:et.data}}_regex(et,xt,Kt){return this.refinement(kt=>et.test(kt),{validation:xt,code:C.ZodIssueCode.invalid_string,...d.errorUtil.errToObj(Kt)})}_addCheck(et){return new te({...this._def,checks:[...this._def.checks,et]})}email(et){return this._addCheck({kind:"email",...d.errorUtil.errToObj(et)})}url(et){return this._addCheck({kind:"url",...d.errorUtil.errToObj(et)})}emoji(et){return this._addCheck({kind:"emoji",...d.errorUtil.errToObj(et)})}uuid(et){return this._addCheck({kind:"uuid",...d.errorUtil.errToObj(et)})}nanoid(et){return this._addCheck({kind:"nanoid",...d.errorUtil.errToObj(et)})}cuid(et){return this._addCheck({kind:"cuid",...d.errorUtil.errToObj(et)})}cuid2(et){return this._addCheck({kind:"cuid2",...d.errorUtil.errToObj(et)})}ulid(et){return this._addCheck({kind:"ulid",...d.errorUtil.errToObj(et)})}base64(et){return this._addCheck({kind:"base64",...d.errorUtil.errToObj(et)})}base64url(et){return this._addCheck({kind:"base64url",...d.errorUtil.errToObj(et)})}jwt(et){return this._addCheck({kind:"jwt",...d.errorUtil.errToObj(et)})}ip(et){return this._addCheck({kind:"ip",...d.errorUtil.errToObj(et)})}cidr(et){return this._addCheck({kind:"cidr",...d.errorUtil.errToObj(et)})}datetime(et){var xt,Kt;return typeof et=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:et}):this._addCheck({kind:"datetime",precision:typeof et?.precision>"u"?null:et?.precision,offset:(xt=et?.offset)!==null&&xt!==void 0?xt:!1,local:(Kt=et?.local)!==null&&Kt!==void 0?Kt:!1,...d.errorUtil.errToObj(et?.message)})}date(et){return this._addCheck({kind:"date",message:et})}time(et){return typeof et=="string"?this._addCheck({kind:"time",precision:null,message:et}):this._addCheck({kind:"time",precision:typeof et?.precision>"u"?null:et?.precision,...d.errorUtil.errToObj(et?.message)})}duration(et){return this._addCheck({kind:"duration",...d.errorUtil.errToObj(et)})}regex(et,xt){return this._addCheck({kind:"regex",regex:et,...d.errorUtil.errToObj(xt)})}includes(et,xt){return this._addCheck({kind:"includes",value:et,position:xt?.position,...d.errorUtil.errToObj(xt?.message)})}startsWith(et,xt){return this._addCheck({kind:"startsWith",value:et,...d.errorUtil.errToObj(xt)})}endsWith(et,xt){return this._addCheck({kind:"endsWith",value:et,...d.errorUtil.errToObj(xt)})}min(et,xt){return this._addCheck({kind:"min",value:et,...d.errorUtil.errToObj(xt)})}max(et,xt){return this._addCheck({kind:"max",value:et,...d.errorUtil.errToObj(xt)})}length(et,xt){return this._addCheck({kind:"length",value:et,...d.errorUtil.errToObj(xt)})}nonempty(et){return this.min(1,d.errorUtil.errToObj(et))}trim(){return new te({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new te({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new te({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(et=>et.kind==="datetime")}get isDate(){return!!this._def.checks.find(et=>et.kind==="date")}get isTime(){return!!this._def.checks.find(et=>et.kind==="time")}get isDuration(){return!!this._def.checks.find(et=>et.kind==="duration")}get isEmail(){return!!this._def.checks.find(et=>et.kind==="email")}get isURL(){return!!this._def.checks.find(et=>et.kind==="url")}get isEmoji(){return!!this._def.checks.find(et=>et.kind==="emoji")}get isUUID(){return!!this._def.checks.find(et=>et.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(et=>et.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(et=>et.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(et=>et.kind==="cuid2")}get isULID(){return!!this._def.checks.find(et=>et.kind==="ulid")}get isIP(){return!!this._def.checks.find(et=>et.kind==="ip")}get isCIDR(){return!!this._def.checks.find(et=>et.kind==="cidr")}get isBase64(){return!!this._def.checks.find(et=>et.kind==="base64")}get isBase64url(){return!!this._def.checks.find(et=>et.kind==="base64url")}get minLength(){let et=null;for(const xt of this._def.checks)xt.kind==="min"&&(et===null||xt.value>et)&&(et=xt.value);return et}get maxLength(){let et=null;for(const xt of this._def.checks)xt.kind==="max"&&(et===null||xt.value<et)&&(et=xt.value);return et}}f.ZodString=te,te.create=Xt=>{var et;return new te({checks:[],typeName:Mt.ZodString,coerce:(et=Xt?.coerce)!==null&&et!==void 0?et:!1,...S(Xt)})};function H(Xt,et){const xt=(Xt.toString().split(".")[1]||"").length,Kt=(et.toString().split(".")[1]||"").length,kt=xt>Kt?xt:Kt,or=parseInt(Xt.toFixed(kt).replace(".","")),Qr=parseInt(et.toFixed(kt).replace(".",""));return or%Qr/Math.pow(10,kt)}class Q extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(et){if(this._def.coerce&&(et.data=Number(et.data)),this._getType(et)!==m.ZodParsedType.number){const or=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(or,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.number,received:or.parsedType}),p.INVALID}let Kt;const kt=new p.ParseStatus;for(const or of this._def.checks)or.kind==="int"?m.util.isInteger(et.data)||(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:or.message}),kt.dirty()):or.kind==="min"?(or.inclusive?et.data<or.value:et.data<=or.value)&&(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_small,minimum:or.value,type:"number",inclusive:or.inclusive,exact:!1,message:or.message}),kt.dirty()):or.kind==="max"?(or.inclusive?et.data>or.value:et.data>=or.value)&&(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_big,maximum:or.value,type:"number",inclusive:or.inclusive,exact:!1,message:or.message}),kt.dirty()):or.kind==="multipleOf"?H(et.data,or.value)!==0&&(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.not_multiple_of,multipleOf:or.value,message:or.message}),kt.dirty()):or.kind==="finite"?Number.isFinite(et.data)||(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.not_finite,message:or.message}),kt.dirty()):m.util.assertNever(or);return{status:kt.value,value:et.data}}gte(et,xt){return this.setLimit("min",et,!0,d.errorUtil.toString(xt))}gt(et,xt){return this.setLimit("min",et,!1,d.errorUtil.toString(xt))}lte(et,xt){return this.setLimit("max",et,!0,d.errorUtil.toString(xt))}lt(et,xt){return this.setLimit("max",et,!1,d.errorUtil.toString(xt))}setLimit(et,xt,Kt,kt){return new Q({...this._def,checks:[...this._def.checks,{kind:et,value:xt,inclusive:Kt,message:d.errorUtil.toString(kt)}]})}_addCheck(et){return new Q({...this._def,checks:[...this._def.checks,et]})}int(et){return this._addCheck({kind:"int",message:d.errorUtil.toString(et)})}positive(et){return this._addCheck({kind:"min",value:0,inclusive:!1,message:d.errorUtil.toString(et)})}negative(et){return this._addCheck({kind:"max",value:0,inclusive:!1,message:d.errorUtil.toString(et)})}nonpositive(et){return this._addCheck({kind:"max",value:0,inclusive:!0,message:d.errorUtil.toString(et)})}nonnegative(et){return this._addCheck({kind:"min",value:0,inclusive:!0,message:d.errorUtil.toString(et)})}multipleOf(et,xt){return this._addCheck({kind:"multipleOf",value:et,message:d.errorUtil.toString(xt)})}finite(et){return this._addCheck({kind:"finite",message:d.errorUtil.toString(et)})}safe(et){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:d.errorUtil.toString(et)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:d.errorUtil.toString(et)})}get minValue(){let et=null;for(const xt of this._def.checks)xt.kind==="min"&&(et===null||xt.value>et)&&(et=xt.value);return et}get maxValue(){let et=null;for(const xt of this._def.checks)xt.kind==="max"&&(et===null||xt.value<et)&&(et=xt.value);return et}get isInt(){return!!this._def.checks.find(et=>et.kind==="int"||et.kind==="multipleOf"&&m.util.isInteger(et.value))}get isFinite(){let et=null,xt=null;for(const Kt of this._def.checks){if(Kt.kind==="finite"||Kt.kind==="int"||Kt.kind==="multipleOf")return!0;Kt.kind==="min"?(xt===null||Kt.value>xt)&&(xt=Kt.value):Kt.kind==="max"&&(et===null||Kt.value<et)&&(et=Kt.value)}return Number.isFinite(xt)&&Number.isFinite(et)}}f.ZodNumber=Q,Q.create=Xt=>new Q({checks:[],typeName:Mt.ZodNumber,coerce:Xt?.coerce||!1,...S(Xt)});class oe extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(et){if(this._def.coerce)try{et.data=BigInt(et.data)}catch{return this._getInvalidInput(et)}if(this._getType(et)!==m.ZodParsedType.bigint)return this._getInvalidInput(et);let Kt;const kt=new p.ParseStatus;for(const or of this._def.checks)or.kind==="min"?(or.inclusive?et.data<or.value:et.data<=or.value)&&(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_small,type:"bigint",minimum:or.value,inclusive:or.inclusive,message:or.message}),kt.dirty()):or.kind==="max"?(or.inclusive?et.data>or.value:et.data>=or.value)&&(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_big,type:"bigint",maximum:or.value,inclusive:or.inclusive,message:or.message}),kt.dirty()):or.kind==="multipleOf"?et.data%or.value!==BigInt(0)&&(Kt=this._getOrReturnCtx(et,Kt),(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.not_multiple_of,multipleOf:or.value,message:or.message}),kt.dirty()):m.util.assertNever(or);return{status:kt.value,value:et.data}}_getInvalidInput(et){const xt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.bigint,received:xt.parsedType}),p.INVALID}gte(et,xt){return this.setLimit("min",et,!0,d.errorUtil.toString(xt))}gt(et,xt){return this.setLimit("min",et,!1,d.errorUtil.toString(xt))}lte(et,xt){return this.setLimit("max",et,!0,d.errorUtil.toString(xt))}lt(et,xt){return this.setLimit("max",et,!1,d.errorUtil.toString(xt))}setLimit(et,xt,Kt,kt){return new oe({...this._def,checks:[...this._def.checks,{kind:et,value:xt,inclusive:Kt,message:d.errorUtil.toString(kt)}]})}_addCheck(et){return new oe({...this._def,checks:[...this._def.checks,et]})}positive(et){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(et)})}negative(et){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(et)})}nonpositive(et){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(et)})}nonnegative(et){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(et)})}multipleOf(et,xt){return this._addCheck({kind:"multipleOf",value:et,message:d.errorUtil.toString(xt)})}get minValue(){let et=null;for(const xt of this._def.checks)xt.kind==="min"&&(et===null||xt.value>et)&&(et=xt.value);return et}get maxValue(){let et=null;for(const xt of this._def.checks)xt.kind==="max"&&(et===null||xt.value<et)&&(et=xt.value);return et}}f.ZodBigInt=oe,oe.create=Xt=>{var et;return new oe({checks:[],typeName:Mt.ZodBigInt,coerce:(et=Xt?.coerce)!==null&&et!==void 0?et:!1,...S(Xt)})};class _e extends O{_parse(et){if(this._def.coerce&&(et.data=!!et.data),this._getType(et)!==m.ZodParsedType.boolean){const Kt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.boolean,received:Kt.parsedType}),p.INVALID}return(0,p.OK)(et.data)}}f.ZodBoolean=_e,_e.create=Xt=>new _e({typeName:Mt.ZodBoolean,coerce:Xt?.coerce||!1,...S(Xt)});class ge extends O{_parse(et){if(this._def.coerce&&(et.data=new Date(et.data)),this._getType(et)!==m.ZodParsedType.date){const or=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(or,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.date,received:or.parsedType}),p.INVALID}if(isNaN(et.data.getTime())){const or=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(or,{code:C.ZodIssueCode.invalid_date}),p.INVALID}const Kt=new p.ParseStatus;let kt;for(const or of this._def.checks)or.kind==="min"?et.data.getTime()<or.value&&(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.too_small,message:or.message,inclusive:!0,exact:!1,minimum:or.value,type:"date"}),Kt.dirty()):or.kind==="max"?et.data.getTime()>or.value&&(kt=this._getOrReturnCtx(et,kt),(0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.too_big,message:or.message,inclusive:!0,exact:!1,maximum:or.value,type:"date"}),Kt.dirty()):m.util.assertNever(or);return{status:Kt.value,value:new Date(et.data.getTime())}}_addCheck(et){return new ge({...this._def,checks:[...this._def.checks,et]})}min(et,xt){return this._addCheck({kind:"min",value:et.getTime(),message:d.errorUtil.toString(xt)})}max(et,xt){return this._addCheck({kind:"max",value:et.getTime(),message:d.errorUtil.toString(xt)})}get minDate(){let et=null;for(const xt of this._def.checks)xt.kind==="min"&&(et===null||xt.value>et)&&(et=xt.value);return et!=null?new Date(et):null}get maxDate(){let et=null;for(const xt of this._def.checks)xt.kind==="max"&&(et===null||xt.value<et)&&(et=xt.value);return et!=null?new Date(et):null}}f.ZodDate=ge,ge.create=Xt=>new ge({checks:[],coerce:Xt?.coerce||!1,typeName:Mt.ZodDate,...S(Xt)});class be extends O{_parse(et){if(this._getType(et)!==m.ZodParsedType.symbol){const Kt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.symbol,received:Kt.parsedType}),p.INVALID}return(0,p.OK)(et.data)}}f.ZodSymbol=be,be.create=Xt=>new be({typeName:Mt.ZodSymbol,...S(Xt)});class we extends O{_parse(et){if(this._getType(et)!==m.ZodParsedType.undefined){const Kt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.undefined,received:Kt.parsedType}),p.INVALID}return(0,p.OK)(et.data)}}f.ZodUndefined=we,we.create=Xt=>new we({typeName:Mt.ZodUndefined,...S(Xt)});class Ee extends O{_parse(et){if(this._getType(et)!==m.ZodParsedType.null){const Kt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.null,received:Kt.parsedType}),p.INVALID}return(0,p.OK)(et.data)}}f.ZodNull=Ee,Ee.create=Xt=>new Ee({typeName:Mt.ZodNull,...S(Xt)});class me extends O{constructor(){super(...arguments),this._any=!0}_parse(et){return(0,p.OK)(et.data)}}f.ZodAny=me,me.create=Xt=>new me({typeName:Mt.ZodAny,...S(Xt)});class Ke extends O{constructor(){super(...arguments),this._unknown=!0}_parse(et){return(0,p.OK)(et.data)}}f.ZodUnknown=Ke,Ke.create=Xt=>new Ke({typeName:Mt.ZodUnknown,...S(Xt)});class He extends O{_parse(et){const xt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.never,received:xt.parsedType}),p.INVALID}}f.ZodNever=He,He.create=Xt=>new He({typeName:Mt.ZodNever,...S(Xt)});class Ie extends O{_parse(et){if(this._getType(et)!==m.ZodParsedType.undefined){const Kt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.void,received:Kt.parsedType}),p.INVALID}return(0,p.OK)(et.data)}}f.ZodVoid=Ie,Ie.create=Xt=>new Ie({typeName:Mt.ZodVoid,...S(Xt)});class Le extends O{_parse(et){const{ctx:xt,status:Kt}=this._processInputParams(et),kt=this._def;if(xt.parsedType!==m.ZodParsedType.array)return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.array,received:xt.parsedType}),p.INVALID;if(kt.exactLength!==null){const Qr=xt.data.length>kt.exactLength.value,Nr=xt.data.length<kt.exactLength.value;(Qr||Nr)&&((0,p.addIssueToContext)(xt,{code:Qr?C.ZodIssueCode.too_big:C.ZodIssueCode.too_small,minimum:Nr?kt.exactLength.value:void 0,maximum:Qr?kt.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:kt.exactLength.message}),Kt.dirty())}if(kt.minLength!==null&&xt.data.length<kt.minLength.value&&((0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.too_small,minimum:kt.minLength.value,type:"array",inclusive:!0,exact:!1,message:kt.minLength.message}),Kt.dirty()),kt.maxLength!==null&&xt.data.length>kt.maxLength.value&&((0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.too_big,maximum:kt.maxLength.value,type:"array",inclusive:!0,exact:!1,message:kt.maxLength.message}),Kt.dirty()),xt.common.async)return Promise.all([...xt.data].map((Qr,Nr)=>kt.type._parseAsync(new x(xt,Qr,xt.path,Nr)))).then(Qr=>p.ParseStatus.mergeArray(Kt,Qr));const or=[...xt.data].map((Qr,Nr)=>kt.type._parseSync(new x(xt,Qr,xt.path,Nr)));return p.ParseStatus.mergeArray(Kt,or)}get element(){return this._def.type}min(et,xt){return new Le({...this._def,minLength:{value:et,message:d.errorUtil.toString(xt)}})}max(et,xt){return new Le({...this._def,maxLength:{value:et,message:d.errorUtil.toString(xt)}})}length(et,xt){return new Le({...this._def,exactLength:{value:et,message:d.errorUtil.toString(xt)}})}nonempty(et){return this.min(1,et)}}f.ZodArray=Le,Le.create=(Xt,et)=>new Le({type:Xt,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...S(et)});function Ge(Xt){if(Xt instanceof Be){const et={};for(const xt in Xt.shape){const Kt=Xt.shape[xt];et[xt]=Jt.create(Ge(Kt))}return new Be({...Xt._def,shape:()=>et})}else return Xt instanceof Le?new Le({...Xt._def,type:Ge(Xt.element)}):Xt instanceof Jt?Jt.create(Ge(Xt.unwrap())):Xt instanceof Ot?Ot.create(Ge(Xt.unwrap())):Xt instanceof lt?lt.create(Xt.items.map(et=>Ge(et))):Xt}class Be extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const et=this._def.shape(),xt=m.util.objectKeys(et);return this._cached={shape:et,keys:xt}}_parse(et){if(this._getType(et)!==m.ZodParsedType.object){const mn=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(mn,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.object,received:mn.parsedType}),p.INVALID}const{status:Kt,ctx:kt}=this._processInputParams(et),{shape:or,keys:Qr}=this._getCached(),Nr=[];if(!(this._def.catchall instanceof He&&this._def.unknownKeys==="strip"))for(const mn in kt.data)Qr.includes(mn)||Nr.push(mn);const An=[];for(const mn of Qr){const Nn=or[mn],Vi=kt.data[mn];An.push({key:{status:"valid",value:mn},value:Nn._parse(new x(kt,Vi,kt.path,mn)),alwaysSet:mn in kt.data})}if(this._def.catchall instanceof He){const mn=this._def.unknownKeys;if(mn==="passthrough")for(const Nn of Nr)An.push({key:{status:"valid",value:Nn},value:{status:"valid",value:kt.data[Nn]}});else if(mn==="strict")Nr.length>0&&((0,p.addIssueToContext)(kt,{code:C.ZodIssueCode.unrecognized_keys,keys:Nr}),Kt.dirty());else if(mn!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const mn=this._def.catchall;for(const Nn of Nr){const Vi=kt.data[Nn];An.push({key:{status:"valid",value:Nn},value:mn._parse(new x(kt,Vi,kt.path,Nn)),alwaysSet:Nn in kt.data})}}return kt.common.async?Promise.resolve().then(async()=>{const mn=[];for(const Nn of An){const Vi=await Nn.key,Kn=await Nn.value;mn.push({key:Vi,value:Kn,alwaysSet:Nn.alwaysSet})}return mn}).then(mn=>p.ParseStatus.mergeObjectSync(Kt,mn)):p.ParseStatus.mergeObjectSync(Kt,An)}get shape(){return this._def.shape()}strict(et){return d.errorUtil.errToObj,new Be({...this._def,unknownKeys:"strict",...et!==void 0?{errorMap:(xt,Kt)=>{var kt,or,Qr,Nr;const An=(Qr=(or=(kt=this._def).errorMap)===null||or===void 0?void 0:or.call(kt,xt,Kt).message)!==null&&Qr!==void 0?Qr:Kt.defaultError;return xt.code==="unrecognized_keys"?{message:(Nr=d.errorUtil.errToObj(et).message)!==null&&Nr!==void 0?Nr:An}:{message:An}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(et){return new Be({...this._def,shape:()=>({...this._def.shape(),...et})})}merge(et){return new Be({unknownKeys:et._def.unknownKeys,catchall:et._def.catchall,shape:()=>({...this._def.shape(),...et._def.shape()}),typeName:Mt.ZodObject})}setKey(et,xt){return this.augment({[et]:xt})}catchall(et){return new Be({...this._def,catchall:et})}pick(et){const xt={};return m.util.objectKeys(et).forEach(Kt=>{et[Kt]&&this.shape[Kt]&&(xt[Kt]=this.shape[Kt])}),new Be({...this._def,shape:()=>xt})}omit(et){const xt={};return m.util.objectKeys(this.shape).forEach(Kt=>{et[Kt]||(xt[Kt]=this.shape[Kt])}),new Be({...this._def,shape:()=>xt})}deepPartial(){return Ge(this)}partial(et){const xt={};return m.util.objectKeys(this.shape).forEach(Kt=>{const kt=this.shape[Kt];et&&!et[Kt]?xt[Kt]=kt:xt[Kt]=kt.optional()}),new Be({...this._def,shape:()=>xt})}required(et){const xt={};return m.util.objectKeys(this.shape).forEach(Kt=>{if(et&&!et[Kt])xt[Kt]=this.shape[Kt];else{let or=this.shape[Kt];for(;or instanceof Jt;)or=or._def.innerType;xt[Kt]=or}}),new Be({...this._def,shape:()=>xt})}keyof(){return it(m.util.objectKeys(this.shape))}}f.ZodObject=Be,Be.create=(Xt,et)=>new Be({shape:()=>Xt,unknownKeys:"strip",catchall:He.create(),typeName:Mt.ZodObject,...S(et)}),Be.strictCreate=(Xt,et)=>new Be({shape:()=>Xt,unknownKeys:"strict",catchall:He.create(),typeName:Mt.ZodObject,...S(et)}),Be.lazycreate=(Xt,et)=>new Be({shape:Xt,unknownKeys:"strip",catchall:He.create(),typeName:Mt.ZodObject,...S(et)});class We extends O{_parse(et){const{ctx:xt}=this._processInputParams(et),Kt=this._def.options;function kt(or){for(const Nr of or)if(Nr.result.status==="valid")return Nr.result;for(const Nr of or)if(Nr.result.status==="dirty")return xt.common.issues.push(...Nr.ctx.common.issues),Nr.result;const Qr=or.map(Nr=>new C.ZodError(Nr.ctx.common.issues));return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_union,unionErrors:Qr}),p.INVALID}if(xt.common.async)return Promise.all(Kt.map(async or=>{const Qr={...xt,common:{...xt.common,issues:[]},parent:null};return{result:await or._parseAsync({data:xt.data,path:xt.path,parent:Qr}),ctx:Qr}})).then(kt);{let or;const Qr=[];for(const An of Kt){const mn={...xt,common:{...xt.common,issues:[]},parent:null},Nn=An._parseSync({data:xt.data,path:xt.path,parent:mn});if(Nn.status==="valid")return Nn;Nn.status==="dirty"&&!or&&(or={result:Nn,ctx:mn}),mn.common.issues.length&&Qr.push(mn.common.issues)}if(or)return xt.common.issues.push(...or.ctx.common.issues),or.result;const Nr=Qr.map(An=>new C.ZodError(An));return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_union,unionErrors:Nr}),p.INVALID}}get options(){return this._def.options}}f.ZodUnion=We,We.create=(Xt,et)=>new We({options:Xt,typeName:Mt.ZodUnion,...S(et)});const Ze=Xt=>Xt instanceof xe?Ze(Xt.schema):Xt instanceof ft?Ze(Xt.innerType()):Xt instanceof Pe?[Xt.value]:Xt instanceof Xe?Xt.options:Xt instanceof st?m.util.objectValues(Xt.enum):Xt instanceof Ct?Ze(Xt._def.innerType):Xt instanceof we?[void 0]:Xt instanceof Ee?[null]:Xt instanceof Jt?[void 0,...Ze(Xt.unwrap())]:Xt instanceof Ot?[null,...Ze(Xt.unwrap())]:Xt instanceof ot||Xt instanceof Rt?Ze(Xt.unwrap()):Xt instanceof qe?Ze(Xt._def.innerType):[];class _t extends O{_parse(et){const{ctx:xt}=this._processInputParams(et);if(xt.parsedType!==m.ZodParsedType.object)return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.object,received:xt.parsedType}),p.INVALID;const Kt=this.discriminator,kt=xt.data[Kt],or=this.optionsMap.get(kt);return or?xt.common.async?or._parseAsync({data:xt.data,path:xt.path,parent:xt}):or._parseSync({data:xt.data,path:xt.path,parent:xt}):((0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Kt]}),p.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(et,xt,Kt){const kt=new Map;for(const or of xt){const Qr=Ze(or.shape[et]);if(!Qr.length)throw new Error(`A discriminator value for key \`${et}\` could not be extracted from all schema options`);for(const Nr of Qr){if(kt.has(Nr))throw new Error(`Discriminator property ${String(et)} has duplicate value ${String(Nr)}`);kt.set(Nr,or)}}return new _t({typeName:Mt.ZodDiscriminatedUnion,discriminator:et,options:xt,optionsMap:kt,...S(Kt)})}}f.ZodDiscriminatedUnion=_t;function Ft(Xt,et){const xt=(0,m.getParsedType)(Xt),Kt=(0,m.getParsedType)(et);if(Xt===et)return{valid:!0,data:Xt};if(xt===m.ZodParsedType.object&&Kt===m.ZodParsedType.object){const kt=m.util.objectKeys(et),or=m.util.objectKeys(Xt).filter(Nr=>kt.indexOf(Nr)!==-1),Qr={...Xt,...et};for(const Nr of or){const An=Ft(Xt[Nr],et[Nr]);if(!An.valid)return{valid:!1};Qr[Nr]=An.data}return{valid:!0,data:Qr}}else if(xt===m.ZodParsedType.array&&Kt===m.ZodParsedType.array){if(Xt.length!==et.length)return{valid:!1};const kt=[];for(let or=0;or<Xt.length;or++){const Qr=Xt[or],Nr=et[or],An=Ft(Qr,Nr);if(!An.valid)return{valid:!1};kt.push(An.data)}return{valid:!0,data:kt}}else return xt===m.ZodParsedType.date&&Kt===m.ZodParsedType.date&&+Xt==+et?{valid:!0,data:Xt}:{valid:!1}}class gt extends O{_parse(et){const{status:xt,ctx:Kt}=this._processInputParams(et),kt=(or,Qr)=>{if((0,p.isAborted)(or)||(0,p.isAborted)(Qr))return p.INVALID;const Nr=Ft(or.value,Qr.value);return Nr.valid?(((0,p.isDirty)(or)||(0,p.isDirty)(Qr))&&xt.dirty(),{status:xt.value,value:Nr.data}):((0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_intersection_types}),p.INVALID)};return Kt.common.async?Promise.all([this._def.left._parseAsync({data:Kt.data,path:Kt.path,parent:Kt}),this._def.right._parseAsync({data:Kt.data,path:Kt.path,parent:Kt})]).then(([or,Qr])=>kt(or,Qr)):kt(this._def.left._parseSync({data:Kt.data,path:Kt.path,parent:Kt}),this._def.right._parseSync({data:Kt.data,path:Kt.path,parent:Kt}))}}f.ZodIntersection=gt,gt.create=(Xt,et,xt)=>new gt({left:Xt,right:et,typeName:Mt.ZodIntersection,...S(xt)});class lt extends O{_parse(et){const{status:xt,ctx:Kt}=this._processInputParams(et);if(Kt.parsedType!==m.ZodParsedType.array)return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.array,received:Kt.parsedType}),p.INVALID;if(Kt.data.length<this._def.items.length)return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p.INVALID;!this._def.rest&&Kt.data.length>this._def.items.length&&((0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xt.dirty());const or=[...Kt.data].map((Qr,Nr)=>{const An=this._def.items[Nr]||this._def.rest;return An?An._parse(new x(Kt,Qr,Kt.path,Nr)):null}).filter(Qr=>!!Qr);return Kt.common.async?Promise.all(or).then(Qr=>p.ParseStatus.mergeArray(xt,Qr)):p.ParseStatus.mergeArray(xt,or)}get items(){return this._def.items}rest(et){return new lt({...this._def,rest:et})}}f.ZodTuple=lt,lt.create=(Xt,et)=>{if(!Array.isArray(Xt))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lt({items:Xt,typeName:Mt.ZodTuple,rest:null,...S(et)})};class dt extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(et){const{status:xt,ctx:Kt}=this._processInputParams(et);if(Kt.parsedType!==m.ZodParsedType.object)return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.object,received:Kt.parsedType}),p.INVALID;const kt=[],or=this._def.keyType,Qr=this._def.valueType;for(const Nr in Kt.data)kt.push({key:or._parse(new x(Kt,Nr,Kt.path,Nr)),value:Qr._parse(new x(Kt,Kt.data[Nr],Kt.path,Nr)),alwaysSet:Nr in Kt.data});return Kt.common.async?p.ParseStatus.mergeObjectAsync(xt,kt):p.ParseStatus.mergeObjectSync(xt,kt)}get element(){return this._def.valueType}static create(et,xt,Kt){return xt instanceof O?new dt({keyType:et,valueType:xt,typeName:Mt.ZodRecord,...S(Kt)}):new dt({keyType:te.create(),valueType:et,typeName:Mt.ZodRecord,...S(xt)})}}f.ZodRecord=dt;class tt extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(et){const{status:xt,ctx:Kt}=this._processInputParams(et);if(Kt.parsedType!==m.ZodParsedType.map)return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.map,received:Kt.parsedType}),p.INVALID;const kt=this._def.keyType,or=this._def.valueType,Qr=[...Kt.data.entries()].map(([Nr,An],mn)=>({key:kt._parse(new x(Kt,Nr,Kt.path,[mn,"key"])),value:or._parse(new x(Kt,An,Kt.path,[mn,"value"]))}));if(Kt.common.async){const Nr=new Map;return Promise.resolve().then(async()=>{for(const An of Qr){const mn=await An.key,Nn=await An.value;if(mn.status==="aborted"||Nn.status==="aborted")return p.INVALID;(mn.status==="dirty"||Nn.status==="dirty")&&xt.dirty(),Nr.set(mn.value,Nn.value)}return{status:xt.value,value:Nr}})}else{const Nr=new Map;for(const An of Qr){const mn=An.key,Nn=An.value;if(mn.status==="aborted"||Nn.status==="aborted")return p.INVALID;(mn.status==="dirty"||Nn.status==="dirty")&&xt.dirty(),Nr.set(mn.value,Nn.value)}return{status:xt.value,value:Nr}}}}f.ZodMap=tt,tt.create=(Xt,et,xt)=>new tt({valueType:et,keyType:Xt,typeName:Mt.ZodMap,...S(xt)});class rt extends O{_parse(et){const{status:xt,ctx:Kt}=this._processInputParams(et);if(Kt.parsedType!==m.ZodParsedType.set)return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.set,received:Kt.parsedType}),p.INVALID;const kt=this._def;kt.minSize!==null&&Kt.data.size<kt.minSize.value&&((0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_small,minimum:kt.minSize.value,type:"set",inclusive:!0,exact:!1,message:kt.minSize.message}),xt.dirty()),kt.maxSize!==null&&Kt.data.size>kt.maxSize.value&&((0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.too_big,maximum:kt.maxSize.value,type:"set",inclusive:!0,exact:!1,message:kt.maxSize.message}),xt.dirty());const or=this._def.valueType;function Qr(An){const mn=new Set;for(const Nn of An){if(Nn.status==="aborted")return p.INVALID;Nn.status==="dirty"&&xt.dirty(),mn.add(Nn.value)}return{status:xt.value,value:mn}}const Nr=[...Kt.data.values()].map((An,mn)=>or._parse(new x(Kt,An,Kt.path,mn)));return Kt.common.async?Promise.all(Nr).then(An=>Qr(An)):Qr(Nr)}min(et,xt){return new rt({...this._def,minSize:{value:et,message:d.errorUtil.toString(xt)}})}max(et,xt){return new rt({...this._def,maxSize:{value:et,message:d.errorUtil.toString(xt)}})}size(et,xt){return this.min(et,xt).max(et,xt)}nonempty(et){return this.min(1,et)}}f.ZodSet=rt,rt.create=(Xt,et)=>new rt({valueType:Xt,minSize:null,maxSize:null,typeName:Mt.ZodSet,...S(et)});class ke extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(et){const{ctx:xt}=this._processInputParams(et);if(xt.parsedType!==m.ZodParsedType.function)return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.function,received:xt.parsedType}),p.INVALID;function Kt(Nr,An){return(0,p.makeIssue)({data:Nr,path:xt.path,errorMaps:[xt.common.contextualErrorMap,xt.schemaErrorMap,(0,c.getErrorMap)(),c.defaultErrorMap].filter(mn=>!!mn),issueData:{code:C.ZodIssueCode.invalid_arguments,argumentsError:An}})}function kt(Nr,An){return(0,p.makeIssue)({data:Nr,path:xt.path,errorMaps:[xt.common.contextualErrorMap,xt.schemaErrorMap,(0,c.getErrorMap)(),c.defaultErrorMap].filter(mn=>!!mn),issueData:{code:C.ZodIssueCode.invalid_return_type,returnTypeError:An}})}const or={errorMap:xt.common.contextualErrorMap},Qr=xt.data;if(this._def.returns instanceof It){const Nr=this;return(0,p.OK)(async function(...An){const mn=new C.ZodError([]),Nn=await Nr._def.args.parseAsync(An,or).catch(_s=>{throw mn.addIssue(Kt(An,_s)),mn}),Vi=await Reflect.apply(Qr,this,Nn);return await Nr._def.returns._def.type.parseAsync(Vi,or).catch(_s=>{throw mn.addIssue(kt(Vi,_s)),mn})})}else{const Nr=this;return(0,p.OK)(function(...An){const mn=Nr._def.args.safeParse(An,or);if(!mn.success)throw new C.ZodError([Kt(An,mn.error)]);const Nn=Reflect.apply(Qr,this,mn.data),Vi=Nr._def.returns.safeParse(Nn,or);if(!Vi.success)throw new C.ZodError([kt(Nn,Vi.error)]);return Vi.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...et){return new ke({...this._def,args:lt.create(et).rest(Ke.create())})}returns(et){return new ke({...this._def,returns:et})}implement(et){return this.parse(et)}strictImplement(et){return this.parse(et)}static create(et,xt,Kt){return new ke({args:et||lt.create([]).rest(Ke.create()),returns:xt||Ke.create(),typeName:Mt.ZodFunction,...S(Kt)})}}f.ZodFunction=ke;class xe extends O{get schema(){return this._def.getter()}_parse(et){const{ctx:xt}=this._processInputParams(et);return this._def.getter()._parse({data:xt.data,path:xt.path,parent:xt})}}f.ZodLazy=xe,xe.create=(Xt,et)=>new xe({getter:Xt,typeName:Mt.ZodLazy,...S(et)});class Pe extends O{_parse(et){if(et.data!==this._def.value){const xt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(xt,{received:xt.data,code:C.ZodIssueCode.invalid_literal,expected:this._def.value}),p.INVALID}return{status:"valid",value:et.data}}get value(){return this._def.value}}f.ZodLiteral=Pe,Pe.create=(Xt,et)=>new Pe({value:Xt,typeName:Mt.ZodLiteral,...S(et)});function it(Xt,et){return new Xe({values:Xt,typeName:Mt.ZodEnum,...S(et)})}class Xe extends O{constructor(){super(...arguments),E.set(this,void 0)}_parse(et){if(typeof et.data!="string"){const xt=this._getOrReturnCtx(et),Kt=this._def.values;return(0,p.addIssueToContext)(xt,{expected:m.util.joinValues(Kt),received:xt.parsedType,code:C.ZodIssueCode.invalid_type}),p.INVALID}if(h(this,E,"f")||w(this,E,new Set(this._def.values),"f"),!h(this,E,"f").has(et.data)){const xt=this._getOrReturnCtx(et),Kt=this._def.values;return(0,p.addIssueToContext)(xt,{received:xt.data,code:C.ZodIssueCode.invalid_enum_value,options:Kt}),p.INVALID}return(0,p.OK)(et.data)}get options(){return this._def.values}get enum(){const et={};for(const xt of this._def.values)et[xt]=xt;return et}get Values(){const et={};for(const xt of this._def.values)et[xt]=xt;return et}get Enum(){const et={};for(const xt of this._def.values)et[xt]=xt;return et}extract(et,xt=this._def){return Xe.create(et,{...this._def,...xt})}exclude(et,xt=this._def){return Xe.create(this.options.filter(Kt=>!et.includes(Kt)),{...this._def,...xt})}}f.ZodEnum=Xe,E=new WeakMap,Xe.create=it;class st extends O{constructor(){super(...arguments),v.set(this,void 0)}_parse(et){const xt=m.util.getValidEnumValues(this._def.values),Kt=this._getOrReturnCtx(et);if(Kt.parsedType!==m.ZodParsedType.string&&Kt.parsedType!==m.ZodParsedType.number){const kt=m.util.objectValues(xt);return(0,p.addIssueToContext)(Kt,{expected:m.util.joinValues(kt),received:Kt.parsedType,code:C.ZodIssueCode.invalid_type}),p.INVALID}if(h(this,v,"f")||w(this,v,new Set(m.util.getValidEnumValues(this._def.values)),"f"),!h(this,v,"f").has(et.data)){const kt=m.util.objectValues(xt);return(0,p.addIssueToContext)(Kt,{received:Kt.data,code:C.ZodIssueCode.invalid_enum_value,options:kt}),p.INVALID}return(0,p.OK)(et.data)}get enum(){return this._def.values}}f.ZodNativeEnum=st,v=new WeakMap,st.create=(Xt,et)=>new st({values:Xt,typeName:Mt.ZodNativeEnum,...S(et)});class It extends O{unwrap(){return this._def.type}_parse(et){const{ctx:xt}=this._processInputParams(et);if(xt.parsedType!==m.ZodParsedType.promise&&xt.common.async===!1)return(0,p.addIssueToContext)(xt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.promise,received:xt.parsedType}),p.INVALID;const Kt=xt.parsedType===m.ZodParsedType.promise?xt.data:Promise.resolve(xt.data);return(0,p.OK)(Kt.then(kt=>this._def.type.parseAsync(kt,{path:xt.path,errorMap:xt.common.contextualErrorMap})))}}f.ZodPromise=It,It.create=(Xt,et)=>new It({type:Xt,typeName:Mt.ZodPromise,...S(et)});class ft extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(et){const{status:xt,ctx:Kt}=this._processInputParams(et),kt=this._def.effect||null,or={addIssue:Qr=>{(0,p.addIssueToContext)(Kt,Qr),Qr.fatal?xt.abort():xt.dirty()},get path(){return Kt.path}};if(or.addIssue=or.addIssue.bind(or),kt.type==="preprocess"){const Qr=kt.transform(Kt.data,or);if(Kt.common.async)return Promise.resolve(Qr).then(async Nr=>{if(xt.value==="aborted")return p.INVALID;const An=await this._def.schema._parseAsync({data:Nr,path:Kt.path,parent:Kt});return An.status==="aborted"?p.INVALID:An.status==="dirty"||xt.value==="dirty"?(0,p.DIRTY)(An.value):An});{if(xt.value==="aborted")return p.INVALID;const Nr=this._def.schema._parseSync({data:Qr,path:Kt.path,parent:Kt});return Nr.status==="aborted"?p.INVALID:Nr.status==="dirty"||xt.value==="dirty"?(0,p.DIRTY)(Nr.value):Nr}}if(kt.type==="refinement"){const Qr=Nr=>{const An=kt.refinement(Nr,or);if(Kt.common.async)return Promise.resolve(An);if(An instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Nr};if(Kt.common.async===!1){const Nr=this._def.schema._parseSync({data:Kt.data,path:Kt.path,parent:Kt});return Nr.status==="aborted"?p.INVALID:(Nr.status==="dirty"&&xt.dirty(),Qr(Nr.value),{status:xt.value,value:Nr.value})}else return this._def.schema._parseAsync({data:Kt.data,path:Kt.path,parent:Kt}).then(Nr=>Nr.status==="aborted"?p.INVALID:(Nr.status==="dirty"&&xt.dirty(),Qr(Nr.value).then(()=>({status:xt.value,value:Nr.value}))))}if(kt.type==="transform")if(Kt.common.async===!1){const Qr=this._def.schema._parseSync({data:Kt.data,path:Kt.path,parent:Kt});if(!(0,p.isValid)(Qr))return Qr;const Nr=kt.transform(Qr.value,or);if(Nr instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:xt.value,value:Nr}}else return this._def.schema._parseAsync({data:Kt.data,path:Kt.path,parent:Kt}).then(Qr=>(0,p.isValid)(Qr)?Promise.resolve(kt.transform(Qr.value,or)).then(Nr=>({status:xt.value,value:Nr})):Qr);m.util.assertNever(kt)}}f.ZodEffects=ft,f.ZodTransformer=ft,ft.create=(Xt,et,xt)=>new ft({schema:Xt,typeName:Mt.ZodEffects,effect:et,...S(xt)}),ft.createWithPreprocess=(Xt,et,xt)=>new ft({schema:et,effect:{type:"preprocess",transform:Xt},typeName:Mt.ZodEffects,...S(xt)});class Jt extends O{_parse(et){return this._getType(et)===m.ZodParsedType.undefined?(0,p.OK)(void 0):this._def.innerType._parse(et)}unwrap(){return this._def.innerType}}f.ZodOptional=Jt,Jt.create=(Xt,et)=>new Jt({innerType:Xt,typeName:Mt.ZodOptional,...S(et)});class Ot extends O{_parse(et){return this._getType(et)===m.ZodParsedType.null?(0,p.OK)(null):this._def.innerType._parse(et)}unwrap(){return this._def.innerType}}f.ZodNullable=Ot,Ot.create=(Xt,et)=>new Ot({innerType:Xt,typeName:Mt.ZodNullable,...S(et)});class Ct extends O{_parse(et){const{ctx:xt}=this._processInputParams(et);let Kt=xt.data;return xt.parsedType===m.ZodParsedType.undefined&&(Kt=this._def.defaultValue()),this._def.innerType._parse({data:Kt,path:xt.path,parent:xt})}removeDefault(){return this._def.innerType}}f.ZodDefault=Ct,Ct.create=(Xt,et)=>new Ct({innerType:Xt,typeName:Mt.ZodDefault,defaultValue:typeof et.default=="function"?et.default:()=>et.default,...S(et)});class qe extends O{_parse(et){const{ctx:xt}=this._processInputParams(et),Kt={...xt,common:{...xt.common,issues:[]}},kt=this._def.innerType._parse({data:Kt.data,path:Kt.path,parent:{...Kt}});return(0,p.isAsync)(kt)?kt.then(or=>({status:"valid",value:or.status==="valid"?or.value:this._def.catchValue({get error(){return new C.ZodError(Kt.common.issues)},input:Kt.data})})):{status:"valid",value:kt.status==="valid"?kt.value:this._def.catchValue({get error(){return new C.ZodError(Kt.common.issues)},input:Kt.data})}}removeCatch(){return this._def.innerType}}f.ZodCatch=qe,qe.create=(Xt,et)=>new qe({innerType:Xt,typeName:Mt.ZodCatch,catchValue:typeof et.catch=="function"?et.catch:()=>et.catch,...S(et)});class Yt extends O{_parse(et){if(this._getType(et)!==m.ZodParsedType.nan){const Kt=this._getOrReturnCtx(et);return(0,p.addIssueToContext)(Kt,{code:C.ZodIssueCode.invalid_type,expected:m.ZodParsedType.nan,received:Kt.parsedType}),p.INVALID}return{status:"valid",value:et.data}}}f.ZodNaN=Yt,Yt.create=Xt=>new Yt({typeName:Mt.ZodNaN,...S(Xt)}),f.BRAND=Symbol("zod_brand");class ot extends O{_parse(et){const{ctx:xt}=this._processInputParams(et),Kt=xt.data;return this._def.type._parse({data:Kt,path:xt.path,parent:xt})}unwrap(){return this._def.type}}f.ZodBranded=ot;class Ae extends O{_parse(et){const{status:xt,ctx:Kt}=this._processInputParams(et);if(Kt.common.async)return(async()=>{const or=await this._def.in._parseAsync({data:Kt.data,path:Kt.path,parent:Kt});return or.status==="aborted"?p.INVALID:or.status==="dirty"?(xt.dirty(),(0,p.DIRTY)(or.value)):this._def.out._parseAsync({data:or.value,path:Kt.path,parent:Kt})})();{const kt=this._def.in._parseSync({data:Kt.data,path:Kt.path,parent:Kt});return kt.status==="aborted"?p.INVALID:kt.status==="dirty"?(xt.dirty(),{status:"dirty",value:kt.value}):this._def.out._parseSync({data:kt.value,path:Kt.path,parent:Kt})}}static create(et,xt){return new Ae({in:et,out:xt,typeName:Mt.ZodPipeline})}}f.ZodPipeline=Ae;class Rt extends O{_parse(et){const xt=this._def.innerType._parse(et),Kt=kt=>((0,p.isValid)(kt)&&(kt.value=Object.freeze(kt.value)),kt);return(0,p.isAsync)(xt)?xt.then(kt=>Kt(kt)):Kt(xt)}unwrap(){return this._def.innerType}}f.ZodReadonly=Rt,Rt.create=(Xt,et)=>new Rt({innerType:Xt,typeName:Mt.ZodReadonly,...S(et)});function Ht(Xt,et){const xt=typeof Xt=="function"?Xt(et):typeof Xt=="string"?{message:Xt}:Xt;return typeof xt=="string"?{message:xt}:xt}function bt(Xt,et={},xt){return Xt?me.create().superRefine((Kt,kt)=>{var or,Qr;const Nr=Xt(Kt);if(Nr instanceof Promise)return Nr.then(An=>{var mn,Nn;if(!An){const Vi=Ht(et,Kt),Kn=(Nn=(mn=Vi.fatal)!==null&&mn!==void 0?mn:xt)!==null&&Nn!==void 0?Nn:!0;kt.addIssue({code:"custom",...Vi,fatal:Kn})}});if(!Nr){const An=Ht(et,Kt),mn=(Qr=(or=An.fatal)!==null&&or!==void 0?or:xt)!==null&&Qr!==void 0?Qr:!0;kt.addIssue({code:"custom",...An,fatal:mn})}}):me.create()}f.custom=bt,f.late={object:Be.lazycreate};var Mt;(function(Xt){Xt.ZodString="ZodString",Xt.ZodNumber="ZodNumber",Xt.ZodNaN="ZodNaN",Xt.ZodBigInt="ZodBigInt",Xt.ZodBoolean="ZodBoolean",Xt.ZodDate="ZodDate",Xt.ZodSymbol="ZodSymbol",Xt.ZodUndefined="ZodUndefined",Xt.ZodNull="ZodNull",Xt.ZodAny="ZodAny",Xt.ZodUnknown="ZodUnknown",Xt.ZodNever="ZodNever",Xt.ZodVoid="ZodVoid",Xt.ZodArray="ZodArray",Xt.ZodObject="ZodObject",Xt.ZodUnion="ZodUnion",Xt.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Xt.ZodIntersection="ZodIntersection",Xt.ZodTuple="ZodTuple",Xt.ZodRecord="ZodRecord",Xt.ZodMap="ZodMap",Xt.ZodSet="ZodSet",Xt.ZodFunction="ZodFunction",Xt.ZodLazy="ZodLazy",Xt.ZodLiteral="ZodLiteral",Xt.ZodEnum="ZodEnum",Xt.ZodEffects="ZodEffects",Xt.ZodNativeEnum="ZodNativeEnum",Xt.ZodOptional="ZodOptional",Xt.ZodNullable="ZodNullable",Xt.ZodDefault="ZodDefault",Xt.ZodCatch="ZodCatch",Xt.ZodPromise="ZodPromise",Xt.ZodBranded="ZodBranded",Xt.ZodPipeline="ZodPipeline",Xt.ZodReadonly="ZodReadonly"})(Mt||(f.ZodFirstPartyTypeKind=Mt={}));class tr{constructor(...et){}}const Vt=(Xt,et={message:`Input not instance of ${Xt.name}`})=>bt(xt=>xt instanceof Xt,et);f.instanceof=Vt;const Et=te.create;f.string=Et;const Ye=Q.create;f.number=Ye;const Tt=Yt.create;f.nan=Tt;const Wt=oe.create;f.bigint=Wt;const dr=_e.create;f.boolean=dr;const at=ge.create;f.date=at;const wt=be.create;f.symbol=wt;const At=we.create;f.undefined=At;const Je=Ee.create;f.null=Je;const Lt=me.create;f.any=Lt;const sr=Ke.create;f.unknown=sr;const ur=He.create;f.never=ur;const vr=Ie.create;f.void=vr;const kr=Le.create;f.array=kr;const Jr=Be.create;f.object=Jr;const hr=Be.strictCreate;f.strictObject=hr;const $r=We.create;f.union=$r;const Hr=_t.create;f.discriminatedUnion=Hr;const rn=gt.create;f.intersection=rn;const _r=lt.create;f.tuple=_r;const pn=dt.create;f.record=pn;const $t=tt.create;f.map=$t;const In=rt.create;f.set=In;const ln=ke.create;f.function=ln;const yn=xe.create;f.lazy=yn;const Fr=Pe.create;f.literal=Fr;const On=Xe.create;f.enum=On;const En=st.create;f.nativeEnum=En;const ee=It.create;f.promise=ee;const ve=ft.create;f.effect=ve,f.transformer=ve;const ze=Jt.create;f.optional=ze;const yt=Ot.create;f.nullable=yt;const vt=ft.createWithPreprocess;f.preprocess=vt;const ar=Ae.create;f.pipeline=ar;const wr=()=>Et().optional();f.ostring=wr;const zt=()=>Ye().optional();f.onumber=zt;const Kr=()=>dr().optional();f.oboolean=Kr,f.coerce={string:Xt=>te.create({...Xt,coerce:!0}),number:Xt=>Q.create({...Xt,coerce:!0}),boolean:Xt=>_e.create({...Xt,coerce:!0}),bigint:Xt=>oe.create({...Xt,coerce:!0}),date:Xt=>ge.create({...Xt,coerce:!0})},f.NEVER=p.INVALID},87963:function(ie){"use strict";ie.exports={}},65943:function(){"use strict"},53263:function(){"use strict"},90861:function(){"use strict"},78172:function(){"use strict"},69094:function(){"use strict"},20352:function(){"use strict"},49132:function(){"use strict"},16206:function(){"use strict"},89235:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.StructError=void 0;class _ extends TypeError{constructor(w,E){let v;const{message:c,explanation:d,...p}=w,{path:m}=w,C=m.length===0?c:`At path: ${m.join(".")} -- ${c}`;super(d??C),d!=null&&(this.cause=C),Object.assign(this,p),this.name=this.constructor.name,this.failures=()=>v??(v=[w,...E()])}}f.StructError=_},7033:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(89235),f),w(_(98856),f),w(_(17917),f),w(_(39216),f),w(_(50705),f),w(_(65810),f)},98856:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.validate=f.is=f.mask=f.create=f.assert=f.Struct=void 0;const h=_(89235),w=_(22178);class E{constructor(x){const{type:R,schema:S,validator:O,refiner:M,coercer:k=b=>b,entries:q=function*(){}}=x;this.type=R,this.schema=S,this.entries=q,this.coercer=k,O?this.validator=(b,F)=>{const G=O(b,F);return(0,w.toFailures)(G,F,this,b)}:this.validator=()=>[],M?this.refiner=(b,F)=>{const G=M(b,F);return(0,w.toFailures)(G,F,this,b)}:this.refiner=()=>[]}assert(x,R){return v(x,this,R)}create(x,R){return c(x,this,R)}is(x){return p(x,this)}mask(x,R){return d(x,this,R)}validate(x,R={}){return m(x,this,R)}}f.Struct=E;function v(C,x,R){const S=m(C,x,{message:R});if(S[0])throw S[0]}f.assert=v;function c(C,x,R){const S=m(C,x,{coerce:!0,message:R});if(S[0])throw S[0];return S[1]}f.create=c;function d(C,x,R){const S=m(C,x,{coerce:!0,mask:!0,message:R});if(S[0])throw S[0];return S[1]}f.mask=d;function p(C,x){return!m(C,x)[0]}f.is=p;function m(C,x,R={}){const S=(0,w.run)(C,x,R),O=(0,w.shiftIterator)(S);return O[0]?[new h.StructError(O[0],function*(){for(const q of S)q[0]&&(yield q[0])}),void 0]:[void 0,O[1]]}f.validate=m},17917:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.trimmed=f.defaulted=f.coerce=void 0;const h=_(98856),w=_(22178),E=_(50705);function v(p,m,C){return new h.Struct({...p,coercer:(x,R)=>(0,h.is)(x,m)?p.coercer(C(x,R),R):p.coercer(x,R)})}f.coerce=v;function c(p,m,C={}){return v(p,(0,E.unknown)(),x=>{const R=typeof m=="function"?m():m;if(x===void 0)return R;if(!C.strict&&(0,w.isPlainObject)(x)&&(0,w.isPlainObject)(R)){const S={...x};let O=!1;for(const M in R)S[M]===void 0&&(S[M]=R[M],O=!0);if(O)return S}return x})}f.defaulted=c;function d(p){return v(p,(0,E.string)(),m=>m.trim())}f.trimmed=d},39216:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.refine=f.size=f.pattern=f.nonempty=f.min=f.max=f.empty=void 0;const h=_(98856),w=_(22178);function E(R){return x(R,"empty",S=>{const O=v(S);return O===0||`Expected an empty ${R.type} but received one with a size of \`${O}\``})}f.empty=E;function v(R){return R instanceof Map||R instanceof Set?R.size:R.length}function c(R,S,O={}){const{exclusive:M}=O;return x(R,"max",k=>M?k<S:k<=S||`Expected a ${R.type} less than ${M?"":"or equal to "}${S} but received \`${k}\``)}f.max=c;function d(R,S,O={}){const{exclusive:M}=O;return x(R,"min",k=>M?k>S:k>=S||`Expected a ${R.type} greater than ${M?"":"or equal to "}${S} but received \`${k}\``)}f.min=d;function p(R){return x(R,"nonempty",S=>v(S)>0||`Expected a nonempty ${R.type} but received an empty one`)}f.nonempty=p;function m(R,S){return x(R,"pattern",O=>S.test(O)||`Expected a ${R.type} matching \`/${S.source}/\` but received "${O}"`)}f.pattern=m;function C(R,S,O=S){const M=`Expected a ${R.type}`,k=S===O?`of \`${S}\``:`between \`${S}\` and \`${O}\``;return x(R,"size",q=>{if(typeof q=="number"||q instanceof Date)return S<=q&&q<=O||`${M} ${k} but received \`${q}\``;if(q instanceof Map||q instanceof Set){const{size:F}=q;return S<=F&&F<=O||`${M} with a size ${k} but received one with a size of \`${F}\``}const{length:b}=q;return S<=b&&b<=O||`${M} with a length ${k} but received one with a length of \`${b}\``})}f.size=C;function x(R,S,O){return new h.Struct({...R,*refiner(M,k){yield*R.refiner(M,k);const q=O(M,k),b=(0,w.toFailures)(q,k,R,M);for(const F of b)yield{...F,refinement:S}}})}f.refine=x},50705:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.unknown=f.union=f.type=f.tuple=f.string=f.set=f.regexp=f.record=f.optional=f.object=f.number=f.nullable=f.never=f.map=f.literal=f.intersection=f.integer=f.instance=f.func=f.enums=f.date=f.boolean=f.bigint=f.array=f.any=void 0;const h=_(98856),w=_(22178),E=_(65810);function v(){return(0,E.define)("any",()=>!0)}f.any=v;function c(L){return new h.Struct({type:"array",schema:L,*entries($){if(L&&Array.isArray($))for(const[T,N]of $.entries())yield[T,N,L]},coercer($){return Array.isArray($)?$.slice():$},validator($){return Array.isArray($)||`Expected an array value, but received: ${(0,w.print)($)}`}})}f.array=c;function d(){return(0,E.define)("bigint",L=>typeof L=="bigint")}f.bigint=d;function p(){return(0,E.define)("boolean",L=>typeof L=="boolean")}f.boolean=p;function m(){return(0,E.define)("date",L=>L instanceof Date&&!isNaN(L.getTime())||`Expected a valid \`Date\` object, but received: ${(0,w.print)(L)}`)}f.date=m;function C(L){const $={},T=L.map(N=>(0,w.print)(N)).join();for(const N of L)$[N]=N;return new h.Struct({type:"enums",schema:$,validator(N){return L.includes(N)||`Expected one of \`${T}\`, but received: ${(0,w.print)(N)}`}})}f.enums=C;function x(){return(0,E.define)("func",L=>typeof L=="function"||`Expected a function, but received: ${(0,w.print)(L)}`)}f.func=x;function R(L){return(0,E.define)("instance",$=>$ instanceof L||`Expected a \`${L.name}\` instance, but received: ${(0,w.print)($)}`)}f.instance=R;function S(){return(0,E.define)("integer",L=>typeof L=="number"&&!isNaN(L)&&Number.isInteger(L)||`Expected an integer, but received: ${(0,w.print)(L)}`)}f.integer=S;function O(L){return new h.Struct({type:"intersection",schema:null,*entries($,T){for(const{entries:N}of L)yield*N($,T)},*validator($,T){for(const{validator:N}of L)yield*N($,T)},*refiner($,T){for(const{refiner:N}of L)yield*N($,T)}})}f.intersection=O;function M(L){const $=(0,w.print)(L),T=typeof L;return new h.Struct({type:"literal",schema:T==="string"||T==="number"||T==="boolean"?L:null,validator(N){return N===L||`Expected the literal \`${$}\`, but received: ${(0,w.print)(N)}`}})}f.literal=M;function k(L,$){return new h.Struct({type:"map",schema:null,*entries(T){if(L&&$&&T instanceof Map)for(const[N,j]of T.entries())yield[N,N,L],yield[N,j,$]},coercer(T){return T instanceof Map?new Map(T):T},validator(T){return T instanceof Map||`Expected a \`Map\` object, but received: ${(0,w.print)(T)}`}})}f.map=k;function q(){return(0,E.define)("never",()=>!1)}f.never=q;function b(L){return new h.Struct({...L,validator:($,T)=>$===null||L.validator($,T),refiner:($,T)=>$===null||L.refiner($,T)})}f.nullable=b;function F(){return(0,E.define)("number",L=>typeof L=="number"&&!isNaN(L)||`Expected a number, but received: ${(0,w.print)(L)}`)}f.number=F;function G(L){const $=L?Object.keys(L):[],T=q();return new h.Struct({type:"object",schema:L??null,*entries(N){if(L&&(0,w.isObject)(N)){const j=new Set(Object.keys(N));for(const Y of $)j.delete(Y),yield[Y,N[Y],L[Y]];for(const Y of j)yield[Y,N[Y],T]}},validator(N){return(0,w.isObject)(N)||`Expected an object, but received: ${(0,w.print)(N)}`},coercer(N){return(0,w.isObject)(N)?{...N}:N}})}f.object=G;function ue(L){return new h.Struct({...L,validator:($,T)=>$===void 0||L.validator($,T),refiner:($,T)=>$===void 0||L.refiner($,T)})}f.optional=ue;function le(L,$){return new h.Struct({type:"record",schema:null,*entries(T){if((0,w.isObject)(T))for(const N in T){const j=T[N];yield[N,N,L],yield[N,j,$]}},validator(T){return(0,w.isObject)(T)||`Expected an object, but received: ${(0,w.print)(T)}`}})}f.record=le;function X(){return(0,E.define)("regexp",L=>L instanceof RegExp)}f.regexp=X;function se(L){return new h.Struct({type:"set",schema:null,*entries($){if(L&&$ instanceof Set)for(const T of $)yield[T,T,L]},coercer($){return $ instanceof Set?new Set($):$},validator($){return $ instanceof Set||`Expected a \`Set\` object, but received: ${(0,w.print)($)}`}})}f.set=se;function de(){return(0,E.define)("string",L=>typeof L=="string"||`Expected a string, but received: ${(0,w.print)(L)}`)}f.string=de;function ye(L){const $=q();return new h.Struct({type:"tuple",schema:null,*entries(T){if(Array.isArray(T)){const N=Math.max(L.length,T.length);for(let j=0;j<N;j++)yield[j,T[j],L[j]||$]}},validator(T){return Array.isArray(T)||`Expected an array, but received: ${(0,w.print)(T)}`}})}f.tuple=ye;function he(L){const $=Object.keys(L);return new h.Struct({type:"type",schema:L,*entries(T){if((0,w.isObject)(T))for(const N of $)yield[N,T[N],L[N]]},validator(T){return(0,w.isObject)(T)||`Expected an object, but received: ${(0,w.print)(T)}`},coercer(T){return(0,w.isObject)(T)?{...T}:T}})}f.type=he;function K(L){const $=L.map(T=>T.type).join(" | ");return new h.Struct({type:"union",schema:null,coercer(T){for(const N of L){const[j,Y]=N.validate(T,{coerce:!0});if(!j)return Y}return T},validator(T,N){const j=[];for(const Y of L){const[...Z]=(0,w.run)(T,Y,N),[z]=Z;if(!z?.[0])return[];for(const[fe]of Z)fe&&j.push(fe)}return[`Expected the value to satisfy a union of \`${$}\`, but received: ${(0,w.print)(T)}`,...j]}})}f.union=K;function B(){return(0,E.define)("unknown",()=>!0)}f.unknown=B},65810:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.pick=f.partial=f.omit=f.lazy=f.dynamic=f.deprecated=f.define=f.assign=void 0;const h=_(98856),w=_(50705);function E(...R){const S=R[0]?.type==="type",O=R.map(({schema:k})=>k),M=Object.assign({},...O);return S?(0,w.type)(M):(0,w.object)(M)}f.assign=E;function v(R,S){return new h.Struct({type:R,schema:null,validator:S})}f.define=v;function c(R,S){return new h.Struct({...R,refiner:(O,M)=>O===void 0||R.refiner(O,M),validator(O,M){return O===void 0?!0:(S(O,M),R.validator(O,M))}})}f.deprecated=c;function d(R){return new h.Struct({type:"dynamic",schema:null,*entries(S,O){yield*R(S,O).entries(S,O)},validator(S,O){return R(S,O).validator(S,O)},coercer(S,O){return R(S,O).coercer(S,O)},refiner(S,O){return R(S,O).refiner(S,O)}})}f.dynamic=d;function p(R){let S;return new h.Struct({type:"lazy",schema:null,*entries(O,M){S??(S=R()),yield*S.entries(O,M)},validator(O,M){return S??(S=R()),S.validator(O,M)},coercer(O,M){return S??(S=R()),S.coercer(O,M)},refiner(O,M){return S??(S=R()),S.refiner(O,M)}})}f.lazy=p;function m(R,S){const{schema:O}=R,M={...O};for(const k of S)delete M[k];switch(R.type){case"type":return(0,w.type)(M);default:return(0,w.object)(M)}}f.omit=m;function C(R){const S=R instanceof h.Struct,O=S?{...R.schema}:{...R};for(const M in O)O[M]=(0,w.optional)(O[M]);return S&&R.type==="type"?(0,w.type)(O):(0,w.object)(O)}f.partial=C;function x(R,S){const{schema:O}=R,M={};for(const k of S)M[k]=O[k];switch(R.type){case"type":return(0,w.type)(M);default:return(0,w.object)(M)}}f.pick=x},22178:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.run=f.toFailures=f.toFailure=f.shiftIterator=f.print=f.isPlainObject=f.isObject=void 0;function _(m){return h(m)&&typeof m[Symbol.iterator]=="function"}function h(m){return typeof m=="object"&&m!==null}f.isObject=h;function w(m){if(Object.prototype.toString.call(m)!=="[object Object]")return!1;const C=Object.getPrototypeOf(m);return C===null||C===Object.prototype}f.isPlainObject=w;function E(m){return typeof m=="symbol"?m.toString():typeof m=="string"?JSON.stringify(m):`${m}`}f.print=E;function v(m){const{done:C,value:x}=m.next();return C?void 0:x}f.shiftIterator=v;function c(m,C,x,R){if(m===!0)return;m===!1?m={}:typeof m=="string"&&(m={message:m});const{path:S,branch:O}=C,{type:M}=x,{refinement:k,message:q=`Expected a value of type \`${M}\`${k?` with refinement \`${k}\``:""}, but received: \`${E(R)}\``}=m;return{value:R,type:M,refinement:k,key:S[S.length-1],path:S,branch:O,...m,message:q}}f.toFailure=c;function*d(m,C,x,R){_(m)||(m=[m]);for(const S of m){const O=c(S,C,x,R);O&&(yield O)}}f.toFailures=d;function*p(m,C,x={}){const{path:R=[],branch:S=[m],coerce:O=!1,mask:M=!1}=x,k={path:R,branch:S};if(O&&(m=C.coercer(m,k),M&&C.type!=="type"&&h(C.schema)&&h(m)&&!Array.isArray(m)))for(const b in m)C.schema[b]===void 0&&delete m[b];let q="valid";for(const b of C.validator(m,k))b.explanation=x.message,q="not_valid",yield[b,void 0];for(let[b,F,G]of C.entries(m,k)){const ue=p(F,G,{path:b===void 0?R:[...R,b],branch:b===void 0?S:[...S,F],coerce:O,mask:M,message:x.message});for(const le of ue)le[0]?(q=le[0].refinement===null||le[0].refinement===void 0?"not_valid":"not_refined",yield[le[0],void 0]):O&&(F=le[1],b===void 0?m=F:m instanceof Map?m.set(b,F):m instanceof Set?m.add(F):h(m)&&(F!==void 0||b in m)&&(m[b]=F))}if(q!=="not_valid")for(const b of C.refiner(m,k))b.explanation=x.message,q="not_refined",yield[b,void 0];q==="valid"&&(yield[void 0,m])}f.run=p},82097:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.assertExhaustive=f.assertStruct=f.assert=f.AssertionError=void 0;const h=_(7033),w=_(13282);function E(x){return typeof x?.prototype?.constructor?.name=="string"}function v(x){return(0,w.getErrorMessage)(x).replace(/\.$/u,"")}function c(x,R){return E(x)?new x({message:R}):x({message:R})}class d extends Error{constructor(R){super(R.message),this.code="ERR_ASSERTION"}}f.AssertionError=d;function p(x,R="Assertion failed.",S=d){if(!x)throw R instanceof Error?R:c(S,R)}f.assert=p;function m(x,R,S="Assertion failed",O=d){try{(0,h.assert)(x,R)}catch(M){throw c(O,`${S}: ${v(M)}.`)}}f.assertStruct=m;function C(x){throw new Error("Invalid branch reached. Should be detected during compilation.")}f.assertExhaustive=C},27062:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.base64=void 0;const h=_(7033),w=_(82097),E=(v,c={})=>{const d=c.paddingRequired??!1,p=c.characterSet??"base64";let m;p==="base64"?m=String.raw`[A-Za-z0-9+\/]`:((0,w.assert)(p==="base64url"),m=String.raw`[-_A-Za-z0-9]`);let C;return d?C=new RegExp(`^(?:${m}{4})*(?:${m}{3}=|${m}{2}==)?$`,"u"):C=new RegExp(`^(?:${m}{4})*(?:${m}{2,3}|${m}{3}=|${m}{2}==)?$`,"u"),(0,h.pattern)(v,C)};f.base64=E},92788:function(ie,f,_){"use strict";var h=_(36533).Buffer;Object.defineProperty(f,"__esModule",{value:!0}),f.createDataView=f.concatBytes=f.valueToBytes=f.base64ToBytes=f.stringToBytes=f.numberToBytes=f.signedBigIntToBytes=f.bigIntToBytes=f.hexToBytes=f.bytesToBase64=f.bytesToString=f.bytesToNumber=f.bytesToSignedBigInt=f.bytesToBigInt=f.bytesToHex=f.assertIsBytes=f.isBytes=void 0;const w=_(42243),E=_(82097),v=_(2438),c=48,d=58,p=87;function m(){const B=[];return()=>{if(B.length===0)for(let L=0;L<256;L++)B.push(L.toString(16).padStart(2,"0"));return B}}const C=m();function x(B){return B instanceof Uint8Array}f.isBytes=x;function R(B){(0,E.assert)(x(B),"Value must be a Uint8Array.")}f.assertIsBytes=R;function S(B){if(R(B),B.length===0)return"0x";const L=C(),$=new Array(B.length);for(let T=0;T<B.length;T++)$[T]=L[B[T]];return(0,v.add0x)($.join(""))}f.bytesToHex=S;function O(B){R(B);const L=S(B);return BigInt(L)}f.bytesToBigInt=O;function M(B){R(B);let L=BigInt(0);for(const $ of B)L=(L<<BigInt(8))+BigInt($);return BigInt.asIntN(B.length*8,L)}f.bytesToSignedBigInt=M;function k(B){R(B);const L=O(B);return(0,E.assert)(L<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(L)}f.bytesToNumber=k;function q(B){return R(B),new TextDecoder().decode(B)}f.bytesToString=q;function b(B){return R(B),w.base64.encode(B)}f.bytesToBase64=b;function F(B){if(B?.toLowerCase?.()==="0x")return new Uint8Array;(0,v.assertIsHexString)(B);const L=(0,v.remove0x)(B).toLowerCase(),$=L.length%2===0?L:`0${L}`,T=new Uint8Array($.length/2);for(let N=0;N<T.length;N++){const j=$.charCodeAt(N*2),Y=$.charCodeAt(N*2+1),Z=j-(j<d?c:p),z=Y-(Y<d?c:p);T[N]=Z*16+z}return T}f.hexToBytes=F;function G(B){(0,E.assert)(typeof B=="bigint","Value must be a bigint."),(0,E.assert)(B>=BigInt(0),"Value must be a non-negative bigint.");const L=B.toString(16);return F(L)}f.bigIntToBytes=G;function ue(B,L){(0,E.assert)(L>0);const $=B>>BigInt(31);return!((~B&$)+(B&~$)>>BigInt(L*8+-1))}function le(B,L){(0,E.assert)(typeof B=="bigint","Value must be a bigint."),(0,E.assert)(typeof L=="number","Byte length must be a number."),(0,E.assert)(L>0,"Byte length must be greater than 0."),(0,E.assert)(ue(B,L),"Byte length is too small to represent the given value.");let $=B;const T=new Uint8Array(L);for(let N=0;N<T.length;N++)T[N]=Number(BigInt.asUintN(8,$)),$>>=BigInt(8);return T.reverse()}f.signedBigIntToBytes=le;function X(B){(0,E.assert)(typeof B=="number","Value must be a number."),(0,E.assert)(B>=0,"Value must be a non-negative number."),(0,E.assert)(Number.isSafeInteger(B),"Value is not a safe integer. Use `bigIntToBytes` instead.");const L=B.toString(16);return F(L)}f.numberToBytes=X;function se(B){return(0,E.assert)(typeof B=="string","Value must be a string."),new TextEncoder().encode(B)}f.stringToBytes=se;function de(B){return(0,E.assert)(typeof B=="string","Value must be a string."),w.base64.decode(B)}f.base64ToBytes=de;function ye(B){if(typeof B=="bigint")return G(B);if(typeof B=="number")return X(B);if(typeof B=="string")return B.startsWith("0x")?F(B):se(B);if(x(B))return B;throw new TypeError(`Unsupported value type: "${typeof B}".`)}f.valueToBytes=ye;function he(B){const L=new Array(B.length);let $=0;for(let N=0;N<B.length;N++){const j=ye(B[N]);L[N]=j,$+=j.length}const T=new Uint8Array($);for(let N=0,j=0;N<L.length;N++)T.set(L[N],j),j+=L[N].length;return T}f.concatBytes=he;function K(B){if(typeof h<"u"&&B instanceof h){const L=B.buffer.slice(B.byteOffset,B.byteOffset+B.byteLength);return new DataView(L)}return new DataView(B.buffer,B.byteOffset,B.byteLength)}f.createDataView=K},18516:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.toCaipAssetId=f.toCaipAssetType=f.toCaipAccountId=f.toCaipChainId=f.parseCaipAssetId=f.parseCaipAssetType=f.parseCaipAccountId=f.parseCaipChainId=f.isCaipAssetId=f.isCaipAssetType=f.isCaipTokenId=f.isCaipAssetReference=f.isCaipAssetNamespace=f.isCaipAccountAddress=f.isCaipAccountId=f.isCaipReference=f.isCaipNamespace=f.isCaipChainId=f.KnownCaipNamespace=f.CaipAssetTypeOrIdStruct=f.CaipAssetIdStruct=f.CaipAssetTypeStruct=f.CaipTokenIdStruct=f.CaipAssetReferenceStruct=f.CaipAssetNamespaceStruct=f.CaipAccountAddressStruct=f.CaipAccountIdStruct=f.CaipReferenceStruct=f.CaipNamespaceStruct=f.CaipChainIdStruct=f.CAIP_ASSET_ID_REGEX=f.CAIP_ASSET_TYPE_REGEX=f.CAIP_TOKEN_ID_REGEX=f.CAIP_ASSET_REFERENCE_REGEX=f.CAIP_ASSET_NAMESPACE_REGEX=f.CAIP_ACCOUNT_ADDRESS_REGEX=f.CAIP_ACCOUNT_ID_REGEX=f.CAIP_REFERENCE_REGEX=f.CAIP_NAMESPACE_REGEX=f.CAIP_CHAIN_ID_REGEX=void 0;const h=_(7033),w=_(81007);f.CAIP_CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,f.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,f.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,f.CAIP_ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,f.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,f.CAIP_ASSET_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,f.CAIP_ASSET_REFERENCE_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,f.CAIP_TOKEN_ID_REGEX=/^[-.%a-zA-Z0-9]{1,78}$/u,f.CAIP_ASSET_TYPE_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,f.CAIP_ASSET_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;const E=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u;f.CaipChainIdStruct=(0,w.definePattern)("CaipChainId",f.CAIP_CHAIN_ID_REGEX),f.CaipNamespaceStruct=(0,w.definePattern)("CaipNamespace",f.CAIP_NAMESPACE_REGEX),f.CaipReferenceStruct=(0,w.definePattern)("CaipReference",f.CAIP_REFERENCE_REGEX),f.CaipAccountIdStruct=(0,w.definePattern)("CaipAccountId",f.CAIP_ACCOUNT_ID_REGEX),f.CaipAccountAddressStruct=(0,w.definePattern)("CaipAccountAddress",f.CAIP_ACCOUNT_ADDRESS_REGEX),f.CaipAssetNamespaceStruct=(0,w.definePattern)("CaipAssetNamespace",f.CAIP_ASSET_NAMESPACE_REGEX),f.CaipAssetReferenceStruct=(0,w.definePattern)("CaipAssetReference",f.CAIP_ASSET_REFERENCE_REGEX),f.CaipTokenIdStruct=(0,w.definePattern)("CaipTokenId",f.CAIP_TOKEN_ID_REGEX),f.CaipAssetTypeStruct=(0,w.definePattern)("CaipAssetType",f.CAIP_ASSET_TYPE_REGEX),f.CaipAssetIdStruct=(0,w.definePattern)("CaipAssetId",f.CAIP_ASSET_ID_REGEX),f.CaipAssetTypeOrIdStruct=(0,w.definePattern)("CaipAssetTypeOrId",E);var v;(function(se){se.Bip122="bip122",se.Solana="solana",se.Eip155="eip155",se.Wallet="wallet"})(v=f.KnownCaipNamespace||(f.KnownCaipNamespace={}));function c(se){return(0,h.is)(se,f.CaipChainIdStruct)}f.isCaipChainId=c;function d(se){return(0,h.is)(se,f.CaipNamespaceStruct)}f.isCaipNamespace=d;function p(se){return(0,h.is)(se,f.CaipReferenceStruct)}f.isCaipReference=p;function m(se){return(0,h.is)(se,f.CaipAccountIdStruct)}f.isCaipAccountId=m;function C(se){return(0,h.is)(se,f.CaipAccountAddressStruct)}f.isCaipAccountAddress=C;function x(se){return(0,h.is)(se,f.CaipAssetNamespaceStruct)}f.isCaipAssetNamespace=x;function R(se){return(0,h.is)(se,f.CaipAssetReferenceStruct)}f.isCaipAssetReference=R;function S(se){return(0,h.is)(se,f.CaipTokenIdStruct)}f.isCaipTokenId=S;function O(se){return(0,h.is)(se,f.CaipAssetTypeStruct)}f.isCaipAssetType=O;function M(se){return(0,h.is)(se,f.CaipAssetIdStruct)}f.isCaipAssetId=M;function k(se){const de=f.CAIP_CHAIN_ID_REGEX.exec(se);if(!de?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:de.groups.namespace,reference:de.groups.reference}}f.parseCaipChainId=k;function q(se){const de=f.CAIP_ACCOUNT_ID_REGEX.exec(se);if(!de?.groups)throw new Error("Invalid CAIP account ID.");return{address:de.groups.accountAddress,chainId:de.groups.chainId,chain:{namespace:de.groups.namespace,reference:de.groups.reference}}}f.parseCaipAccountId=q;function b(se){const de=f.CAIP_ASSET_TYPE_REGEX.exec(se);if(!de?.groups)throw new Error("Invalid CAIP asset type.");return{assetNamespace:de.groups.assetNamespace,assetReference:de.groups.assetReference,chainId:de.groups.chainId,chain:{namespace:de.groups.namespace,reference:de.groups.reference}}}f.parseCaipAssetType=b;function F(se){const de=f.CAIP_ASSET_ID_REGEX.exec(se);if(!de?.groups)throw new Error("Invalid CAIP asset ID.");return{assetNamespace:de.groups.assetNamespace,assetReference:de.groups.assetReference,tokenId:de.groups.tokenId,chainId:de.groups.chainId,chain:{namespace:de.groups.namespace,reference:de.groups.reference}}}f.parseCaipAssetId=F;function G(se,de){if(!d(se))throw new Error(`Invalid "namespace", must match: ${f.CAIP_NAMESPACE_REGEX.toString()}`);if(!p(de))throw new Error(`Invalid "reference", must match: ${f.CAIP_REFERENCE_REGEX.toString()}`);return`${se}:${de}`}f.toCaipChainId=G;function ue(se,de,ye){if(!d(se))throw new Error(`Invalid "namespace", must match: ${f.CAIP_NAMESPACE_REGEX.toString()}`);if(!p(de))throw new Error(`Invalid "reference", must match: ${f.CAIP_REFERENCE_REGEX.toString()}`);if(!C(ye))throw new Error(`Invalid "accountAddress", must match: ${f.CAIP_ACCOUNT_ADDRESS_REGEX.toString()}`);return`${se}:${de}:${ye}`}f.toCaipAccountId=ue;function le(se,de,ye,he){if(!d(se))throw new Error(`Invalid "namespace", must match: ${f.CAIP_NAMESPACE_REGEX.toString()}`);if(!p(de))throw new Error(`Invalid "reference", must match: ${f.CAIP_REFERENCE_REGEX.toString()}`);if(!x(ye))throw new Error(`Invalid "assetNamespace", must match: ${f.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!R(he))throw new Error(`Invalid "assetReference", must match: ${f.CAIP_ASSET_REFERENCE_REGEX.toString()}`);return`${se}:${de}/${ye}:${he}`}f.toCaipAssetType=le;function X(se,de,ye,he,K){if(!d(se))throw new Error(`Invalid "namespace", must match: ${f.CAIP_NAMESPACE_REGEX.toString()}`);if(!p(de))throw new Error(`Invalid "reference", must match: ${f.CAIP_REFERENCE_REGEX.toString()}`);if(!x(ye))throw new Error(`Invalid "assetNamespace", must match: ${f.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!R(he))throw new Error(`Invalid "assetReference", must match: ${f.CAIP_ASSET_REFERENCE_REGEX.toString()}`);if(!S(K))throw new Error(`Invalid "tokenId", must match: ${f.CAIP_TOKEN_ID_REGEX.toString()}`);return`${se}:${de}/${ye}:${he}/${K}`}f.toCaipAssetId=X},51454:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.ChecksumStruct=void 0;const h=_(7033),w=_(27062);f.ChecksumStruct=(0,h.size)((0,w.base64)((0,h.string)(),{paddingRequired:!0}),44,44)},16141:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.createHex=f.createBytes=f.createBigInt=f.createNumber=void 0;const h=_(7033),w=_(82097),E=_(92788),v=_(2438),c=(0,h.union)([(0,h.number)(),(0,h.bigint)(),(0,h.string)(),v.StrictHexStruct]),d=(0,h.coerce)((0,h.number)(),c,Number),p=(0,h.coerce)((0,h.bigint)(),c,BigInt),m=(0,h.union)([v.StrictHexStruct,(0,h.instance)(Uint8Array)]),C=(0,h.coerce)((0,h.instance)(Uint8Array),(0,h.union)([v.StrictHexStruct]),E.hexToBytes),x=(0,h.coerce)(v.StrictHexStruct,(0,h.instance)(Uint8Array),E.bytesToHex);function R(k){try{const q=(0,h.create)(k,d);return(0,w.assert)(Number.isFinite(q),`Expected a number-like value, got "${k}".`),q}catch(q){throw q instanceof h.StructError?new Error(`Expected a number-like value, got "${k}".`):q}}f.createNumber=R;function S(k){try{return(0,h.create)(k,p)}catch(q){throw q instanceof h.StructError?new Error(`Expected a number-like value, got "${String(q.value)}".`):q}}f.createBigInt=S;function O(k){if(typeof k=="string"&&k.toLowerCase()==="0x")return new Uint8Array;try{return(0,h.create)(k,C)}catch(q){throw q instanceof h.StructError?new Error(`Expected a bytes-like value, got "${String(q.value)}".`):q}}f.createBytes=O;function M(k){if(k instanceof Uint8Array&&k.length===0||typeof k=="string"&&k.toLowerCase()==="0x")return"0x";try{return(0,h.create)(k,x)}catch(q){throw q instanceof h.StructError?new Error(`Expected a bytes-like value, got "${String(q.value)}".`):q}}f.createHex=M},95266:function(ie,f){"use strict";var _=this&&this.__classPrivateFieldGet||function(d,p,m,C){if(m==="a"&&!C)throw new TypeError("Private accessor was defined without a getter");if(typeof p=="function"?d!==p||!C:!p.has(d))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m==="m"?C:m==="a"?C.call(d):C?C.value:p.get(d)},h=this&&this.__classPrivateFieldSet||function(d,p,m,C,x){if(C==="m")throw new TypeError("Private method is not writable");if(C==="a"&&!x)throw new TypeError("Private accessor was defined without a setter");if(typeof p=="function"?d!==p||!x:!p.has(d))throw new TypeError("Cannot write private member to an object whose class did not declare it");return C==="a"?x.call(d,m):x?x.value=m:p.set(d,m),m},w,E;Object.defineProperty(f,"__esModule",{value:!0}),f.FrozenSet=f.FrozenMap=void 0;class v{get size(){return _(this,w,"f").size}[(w=new WeakMap,Symbol.iterator)](){return _(this,w,"f")[Symbol.iterator]()}constructor(p){w.set(this,void 0),h(this,w,new Map(p),"f"),Object.freeze(this)}entries(){return _(this,w,"f").entries()}forEach(p,m){return _(this,w,"f").forEach((C,x,R)=>p.call(m,C,x,this))}get(p){return _(this,w,"f").get(p)}has(p){return _(this,w,"f").has(p)}keys(){return _(this,w,"f").keys()}values(){return _(this,w,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([p,m])=>`${String(p)} => ${String(m)}`).join(", ")} `:""}}`}}f.FrozenMap=v;class c{get size(){return _(this,E,"f").size}[(E=new WeakMap,Symbol.iterator)](){return _(this,E,"f")[Symbol.iterator]()}constructor(p){E.set(this,void 0),h(this,E,new Set(p),"f"),Object.freeze(this)}entries(){return _(this,E,"f").entries()}forEach(p,m){return _(this,E,"f").forEach((C,x,R)=>p.call(m,C,x,this))}has(p){return _(this,E,"f").has(p)}keys(){return _(this,E,"f").keys()}values(){return _(this,E,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(p=>String(p)).join(", ")} `:""}}`}}f.FrozenSet=c,Object.freeze(v),Object.freeze(v.prototype),Object.freeze(c),Object.freeze(c.prototype)},94808:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0})},13282:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.wrapError=f.getErrorMessage=f.isErrorWithStack=f.isErrorWithMessage=f.isErrorWithCode=void 0;const h=_(34759),w=_(51619);function E(C){return C instanceof Error||(0,w.isObject)(C)&&C.constructor.name==="Error"}function v(C){return typeof C=="object"&&C!==null&&"code"in C}f.isErrorWithCode=v;function c(C){return typeof C=="object"&&C!==null&&"message"in C}f.isErrorWithMessage=c;function d(C){return typeof C=="object"&&C!==null&&"stack"in C}f.isErrorWithStack=d;function p(C){return c(C)&&typeof C.message=="string"?C.message:(0,w.isNullOrUndefined)(C)?"":String(C)}f.getErrorMessage=p;function m(C,x){if(E(C)){let R;return Error.length===2?R=new Error(x,{cause:C}):R=new h.ErrorWithCause(x,{cause:C}),v(C)&&(R.code=C.code),R}return x.length>0?new Error(`${String(C)}: ${x}`):new Error(String(C))}f.wrapError=m},2438:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.remove0x=f.add0x=f.isValidChecksumAddress=f.getChecksumAddress=f.isValidHexAddress=f.assertIsStrictHexString=f.assertIsHexString=f.isStrictHexString=f.isHexString=f.HexChecksumAddressStruct=f.HexAddressStruct=f.StrictHexStruct=f.HexStruct=void 0;const h=_(7033),w=_(44525),E=_(82097),v=_(92788);f.HexStruct=(0,h.pattern)((0,h.string)(),/^(?:0x)?[0-9a-f]+$/iu),f.StrictHexStruct=(0,h.pattern)((0,h.string)(),/^0x[0-9a-f]+$/iu),f.HexAddressStruct=(0,h.pattern)((0,h.string)(),/^0x[0-9a-f]{40}$/u),f.HexChecksumAddressStruct=(0,h.pattern)((0,h.string)(),/^0x[0-9a-fA-F]{40}$/u);function c(M){return(0,h.is)(M,f.HexStruct)}f.isHexString=c;function d(M){return(0,h.is)(M,f.StrictHexStruct)}f.isStrictHexString=d;function p(M){(0,E.assert)(c(M),"Value must be a hexadecimal string.")}f.assertIsHexString=p;function m(M){(0,E.assert)(d(M),'Value must be a hexadecimal string, starting with "0x".')}f.assertIsStrictHexString=m;function C(M){return(0,h.is)(M,f.HexAddressStruct)||R(M)}f.isValidHexAddress=C;function x(M){(0,E.assert)((0,h.is)(M,f.HexChecksumAddressStruct),"Invalid hex address.");const k=O(M.toLowerCase()),q=O((0,v.bytesToHex)((0,w.keccak_256)(k)));return`0x${k.split("").map((b,F)=>{const G=q[F];return(0,E.assert)((0,h.is)(G,(0,h.string)()),"Hash shorter than address."),parseInt(G,16)>7?b.toUpperCase():b}).join("")}`}f.getChecksumAddress=x;function R(M){return(0,h.is)(M,f.HexChecksumAddressStruct)?x(M)===M:!1}f.isValidChecksumAddress=R;function S(M){return M.startsWith("0x")?M:M.startsWith("0X")?`0x${M.substring(2)}`:`0x${M}`}f.add0x=S;function O(M){return M.startsWith("0x")||M.startsWith("0X")?M.substring(2):M}f.remove0x=O},29089:function(ie,f,_){"use strict";var h=this&&this.__createBinding||(Object.create?function(E,v,c,d){d===void 0&&(d=c);var p=Object.getOwnPropertyDescriptor(v,c);(!p||("get"in p?!v.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return v[c]}}),Object.defineProperty(E,d,p)}:function(E,v,c,d){d===void 0&&(d=c),E[d]=v[c]}),w=this&&this.__exportStar||function(E,v){for(var c in E)c!=="default"&&!Object.prototype.hasOwnProperty.call(v,c)&&h(v,E,c)};Object.defineProperty(f,"__esModule",{value:!0}),w(_(82097),f),w(_(27062),f),w(_(92788),f),w(_(18516),f),w(_(51454),f),w(_(16141),f),w(_(95266),f),w(_(94808),f),w(_(13282),f),w(_(2438),f),w(_(83625),f),w(_(16642),f),w(_(90090),f),w(_(51619),f),w(_(63472),f),w(_(79818),f),w(_(78158),f),w(_(81007),f),w(_(22836),f),w(_(66673),f),w(_(69516),f)},83625:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.getJsonRpcIdValidator=f.assertIsJsonRpcError=f.isJsonRpcError=f.assertIsJsonRpcFailure=f.isJsonRpcFailure=f.assertIsJsonRpcSuccess=f.isJsonRpcSuccess=f.assertIsJsonRpcResponse=f.isJsonRpcResponse=f.assertIsPendingJsonRpcResponse=f.isPendingJsonRpcResponse=f.JsonRpcResponseStruct=f.JsonRpcFailureStruct=f.JsonRpcSuccessStruct=f.PendingJsonRpcResponseStruct=f.assertIsJsonRpcRequest=f.isJsonRpcRequest=f.assertIsJsonRpcNotification=f.isJsonRpcNotification=f.JsonRpcNotificationStruct=f.JsonRpcRequestStruct=f.JsonRpcParamsStruct=f.JsonRpcErrorStruct=f.JsonRpcIdStruct=f.JsonRpcVersionStruct=f.jsonrpc2=f.getJsonSize=f.getSafeJson=f.isValidJson=f.JsonStruct=f.UnsafeJsonStruct=f.exactOptional=f.object=void 0;const h=_(7033),w=_(82097),E=_(51619),v=he=>(0,h.object)(he);f.object=v;function c({path:he,branch:K}){const B=he[he.length-1];return(0,E.hasProperty)(K[K.length-2],B)}function d(he){return new h.Struct({...he,type:`optional ${he.type}`,validator:(K,B)=>!c(B)||he.validator(K,B),refiner:(K,B)=>!c(B)||he.refiner(K,B)})}f.exactOptional=d;function p(he){if(he===null||typeof he=="boolean"||typeof he=="string"||typeof he=="number"&&Number.isFinite(he))return!0;if(typeof he=="object"){let K=!0;if(Array.isArray(he)){for(let L=0;L<he.length;L++)if(!p(he[L])){K=!1;break}return K}const B=Object.entries(he);for(let L=0;L<B.length;L++)if(typeof B[L][0]!="string"||!p(B[L][1])){K=!1;break}return K}return!1}f.UnsafeJsonStruct=(0,h.define)("JSON",he=>p(he)),f.JsonStruct=(0,h.coerce)(f.UnsafeJsonStruct,(0,h.refine)((0,h.any)(),"JSON",he=>(0,h.is)(he,f.UnsafeJsonStruct)),he=>JSON.parse(JSON.stringify(he,(K,B)=>{if(!(K==="__proto__"||K==="constructor"))return B})));function m(he){try{return C(he),!0}catch{return!1}}f.isValidJson=m;function C(he){return(0,h.create)(he,f.JsonStruct)}f.getSafeJson=C;function x(he){(0,w.assertStruct)(he,f.JsonStruct,"Invalid JSON value");const K=JSON.stringify(he);return new TextEncoder().encode(K).byteLength}f.getJsonSize=x,f.jsonrpc2="2.0",f.JsonRpcVersionStruct=(0,h.literal)(f.jsonrpc2),f.JsonRpcIdStruct=(0,h.nullable)((0,h.union)([(0,h.number)(),(0,h.string)()])),f.JsonRpcErrorStruct=(0,f.object)({code:(0,h.integer)(),message:(0,h.string)(),data:d(f.JsonStruct),stack:d((0,h.string)())}),f.JsonRpcParamsStruct=(0,h.union)([(0,h.record)((0,h.string)(),f.JsonStruct),(0,h.array)(f.JsonStruct)]),f.JsonRpcRequestStruct=(0,f.object)({id:f.JsonRpcIdStruct,jsonrpc:f.JsonRpcVersionStruct,method:(0,h.string)(),params:d(f.JsonRpcParamsStruct)}),f.JsonRpcNotificationStruct=(0,f.object)({jsonrpc:f.JsonRpcVersionStruct,method:(0,h.string)(),params:d(f.JsonRpcParamsStruct)});function R(he){return(0,h.is)(he,f.JsonRpcNotificationStruct)}f.isJsonRpcNotification=R;function S(he,K){(0,w.assertStruct)(he,f.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",K)}f.assertIsJsonRpcNotification=S;function O(he){return(0,h.is)(he,f.JsonRpcRequestStruct)}f.isJsonRpcRequest=O;function M(he,K){(0,w.assertStruct)(he,f.JsonRpcRequestStruct,"Invalid JSON-RPC request",K)}f.assertIsJsonRpcRequest=M,f.PendingJsonRpcResponseStruct=(0,h.object)({id:f.JsonRpcIdStruct,jsonrpc:f.JsonRpcVersionStruct,result:(0,h.optional)((0,h.unknown)()),error:(0,h.optional)(f.JsonRpcErrorStruct)}),f.JsonRpcSuccessStruct=(0,f.object)({id:f.JsonRpcIdStruct,jsonrpc:f.JsonRpcVersionStruct,result:f.JsonStruct}),f.JsonRpcFailureStruct=(0,f.object)({id:f.JsonRpcIdStruct,jsonrpc:f.JsonRpcVersionStruct,error:f.JsonRpcErrorStruct}),f.JsonRpcResponseStruct=(0,h.union)([f.JsonRpcSuccessStruct,f.JsonRpcFailureStruct]);function k(he){return(0,h.is)(he,f.PendingJsonRpcResponseStruct)}f.isPendingJsonRpcResponse=k;function q(he,K){(0,w.assertStruct)(he,f.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",K)}f.assertIsPendingJsonRpcResponse=q;function b(he){return(0,h.is)(he,f.JsonRpcResponseStruct)}f.isJsonRpcResponse=b;function F(he,K){(0,w.assertStruct)(he,f.JsonRpcResponseStruct,"Invalid JSON-RPC response",K)}f.assertIsJsonRpcResponse=F;function G(he){return(0,h.is)(he,f.JsonRpcSuccessStruct)}f.isJsonRpcSuccess=G;function ue(he,K){(0,w.assertStruct)(he,f.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",K)}f.assertIsJsonRpcSuccess=ue;function le(he){return(0,h.is)(he,f.JsonRpcFailureStruct)}f.isJsonRpcFailure=le;function X(he,K){(0,w.assertStruct)(he,f.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",K)}f.assertIsJsonRpcFailure=X;function se(he){return(0,h.is)(he,f.JsonRpcErrorStruct)}f.isJsonRpcError=se;function de(he,K){(0,w.assertStruct)(he,f.JsonRpcErrorStruct,"Invalid JSON-RPC error",K)}f.assertIsJsonRpcError=de;function ye(he){const{permitEmptyString:K,permitFractions:B,permitNull:L}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...he};return T=>!!(typeof T=="number"&&(B||Number.isInteger(T))||typeof T=="string"&&(K||T.length>0)||L&&T===null)}f.getJsonRpcIdValidator=ye},16642:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0})},90090:function(ie,f,_){"use strict";var h=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(f,"__esModule",{value:!0}),f.createModuleLogger=f.createProjectLogger=void 0;const E=(0,h(_(83328)).default)("metamask");function v(d){return E.extend(d)}f.createProjectLogger=v;function c(d,p){return d.extend(p)}f.createModuleLogger=c},51619:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.calculateNumberSize=f.calculateStringSize=f.isASCII=f.isPlainObject=f.ESCAPE_CHARACTERS_REGEXP=f.JsonSize=f.getKnownPropertyNames=f.hasProperty=f.isObject=f.isNullOrUndefined=f.isNonEmptyArray=void 0;function _(x){return Array.isArray(x)&&x.length>0}f.isNonEmptyArray=_;function h(x){return x==null}f.isNullOrUndefined=h;function w(x){return!!x&&typeof x=="object"&&!Array.isArray(x)}f.isObject=w;const E=(x,R)=>Object.hasOwnProperty.call(x,R);f.hasProperty=E;function v(x){return Object.getOwnPropertyNames(x)}f.getKnownPropertyNames=v;var c;(function(x){x[x.Null=4]="Null",x[x.Comma=1]="Comma",x[x.Wrapper=1]="Wrapper",x[x.True=4]="True",x[x.False=5]="False",x[x.Quote=1]="Quote",x[x.Colon=1]="Colon",x[x.Date=24]="Date"})(c=f.JsonSize||(f.JsonSize={})),f.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function d(x){if(typeof x!="object"||x===null)return!1;try{let R=x;for(;Object.getPrototypeOf(R)!==null;)R=Object.getPrototypeOf(R);return Object.getPrototypeOf(x)===R}catch{return!1}}f.isPlainObject=d;function p(x){return x.charCodeAt(0)<=127}f.isASCII=p;function m(x){return x.split("").reduce((S,O)=>p(O)?S+1:S+2,0)+(x.match(f.ESCAPE_CHARACTERS_REGEXP)??[]).length}f.calculateStringSize=m;function C(x){return x.toString().length}f.calculateNumberSize=C},63472:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.hexToBigInt=f.hexToNumber=f.bigIntToHex=f.numberToHex=void 0;const h=_(82097),w=_(2438),E=p=>((0,h.assert)(typeof p=="number","Value must be a number."),(0,h.assert)(p>=0,"Value must be a non-negative number."),(0,h.assert)(Number.isSafeInteger(p),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,w.add0x)(p.toString(16)));f.numberToHex=E;const v=p=>((0,h.assert)(typeof p=="bigint","Value must be a bigint."),(0,h.assert)(p>=0,"Value must be a non-negative bigint."),(0,w.add0x)(p.toString(16)));f.bigIntToHex=v;const c=p=>{(0,w.assertIsHexString)(p);const m=parseInt(p,16);return(0,h.assert)(Number.isSafeInteger(m),"Value is not a safe integer. Use `hexToBigInt` instead."),m};f.hexToNumber=c;const d=p=>((0,w.assertIsHexString)(p),BigInt((0,w.add0x)(p)));f.hexToBigInt=d},79818:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0})},78158:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.createDeferredPromise=void 0;function _({suppressUnhandledRejection:h=!1}={}){let w,E;const v=new Promise((c,d)=>{w=c,E=d});return h&&v.catch(c=>{}),{promise:v,resolve:w,reject:E}}f.createDeferredPromise=_},81007:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.definePattern=void 0;const h=_(7033);function w(E,v){return(0,h.define)(E,c=>typeof c=="string"&&v.test(c))}f.definePattern=w},22836:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.timeSince=f.inMilliseconds=f.Duration=void 0;var _;(function(c){c[c.Millisecond=1]="Millisecond",c[c.Second=1e3]="Second",c[c.Minute=6e4]="Minute",c[c.Hour=36e5]="Hour",c[c.Day=864e5]="Day",c[c.Week=6048e5]="Week",c[c.Year=31536e6]="Year"})(_=f.Duration||(f.Duration={}));const h=c=>Number.isInteger(c)&&c>=0,w=(c,d)=>{if(!h(c))throw new Error(`"${d}" must be a non-negative integer. Received: "${c}".`)};function E(c,d){return w(c,"count"),c*d}f.inMilliseconds=E;function v(c){return w(c,"timestamp"),Date.now()-c}f.timeSince=v},66673:function(ie,f){"use strict";Object.defineProperty(f,"__esModule",{value:!0})},69516:function(ie,f,_){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.satisfiesVersionRange=f.gtRange=f.gtVersion=f.assertIsSemVerRange=f.assertIsSemVerVersion=f.isValidSemVerRange=f.isValidSemVerVersion=f.VersionRangeStruct=f.VersionStruct=void 0;const h=_(7033),w=_(90032),E=_(82097);f.VersionStruct=(0,h.refine)((0,h.string)(),"Version",R=>(0,w.valid)(R)===null?`Expected SemVer version, got "${R}"`:!0),f.VersionRangeStruct=(0,h.refine)((0,h.string)(),"Version range",R=>(0,w.validRange)(R)===null?`Expected SemVer range, got "${R}"`:!0);function v(R){return(0,h.is)(R,f.VersionStruct)}f.isValidSemVerVersion=v;function c(R){return(0,h.is)(R,f.VersionRangeStruct)}f.isValidSemVerRange=c;function d(R){(0,E.assertStruct)(R,f.VersionStruct)}f.assertIsSemVerVersion=d;function p(R){(0,E.assertStruct)(R,f.VersionRangeStruct)}f.assertIsSemVerRange=p;function m(R,S){return(0,w.gt)(R,S)}f.gtVersion=m;function C(R,S){return(0,w.gtr)(R,S)}f.gtRange=C;function x(R,S){return(0,w.satisfies)(R,S,{includePrerelease:!0})}f.satisfiesVersionRange=x},79639:function(ie,f,_){"use strict";var h=_(7274),w=typeof globalThis>"u"?_.g:globalThis;ie.exports=function(){for(var v=[],c=0;c<h.length;c++)typeof w[h[c]]=="function"&&(v[v.length]=h[c]);return v}},23966:function(ie,f,_){"use strict";var h=_(85409),w=_(36533).Buffer;/*! Axios v1.8.3 Copyright (c) 2025 Matt Zabriskie and contributors */function E(Pt,Dt){return function(){return Pt.apply(Dt,arguments)}}const{toString:v}=Object.prototype,{getPrototypeOf:c}=Object,d=(Pt=>Dt=>{const nr=v.call(Dt);return Pt[nr]||(Pt[nr]=nr.slice(8,-1).toLowerCase())})(Object.create(null)),p=Pt=>(Pt=Pt.toLowerCase(),Dt=>d(Dt)===Pt),m=Pt=>Dt=>typeof Dt===Pt,{isArray:C}=Array,x=m("undefined");function R(Pt){return Pt!==null&&!x(Pt)&&Pt.constructor!==null&&!x(Pt.constructor)&&k(Pt.constructor.isBuffer)&&Pt.constructor.isBuffer(Pt)}const S=p("ArrayBuffer");function O(Pt){let Dt;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?Dt=ArrayBuffer.isView(Pt):Dt=Pt&&Pt.buffer&&S(Pt.buffer),Dt}const M=m("string"),k=m("function"),q=m("number"),b=Pt=>Pt!==null&&typeof Pt=="object",F=Pt=>Pt===!0||Pt===!1,G=Pt=>{if(d(Pt)!=="object")return!1;const Dt=c(Pt);return(Dt===null||Dt===Object.prototype||Object.getPrototypeOf(Dt)===null)&&!(Symbol.toStringTag in Pt)&&!(Symbol.iterator in Pt)},ue=p("Date"),le=p("File"),X=p("Blob"),se=p("FileList"),de=Pt=>b(Pt)&&k(Pt.pipe),ye=Pt=>{let Dt;return Pt&&(typeof FormData=="function"&&Pt instanceof FormData||k(Pt.append)&&((Dt=d(Pt))==="formdata"||Dt==="object"&&k(Pt.toString)&&Pt.toString()==="[object FormData]"))},he=p("URLSearchParams"),[K,B,L,$]=["ReadableStream","Request","Response","Headers"].map(p),T=Pt=>Pt.trim?Pt.trim():Pt.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function N(Pt,Dt,{allOwnKeys:nr=!1}={}){if(Pt===null||typeof Pt>"u")return;let ir,Tr;if(typeof Pt!="object"&&(Pt=[Pt]),C(Pt))for(ir=0,Tr=Pt.length;ir<Tr;ir++)Dt.call(null,Pt[ir],ir,Pt);else{const Ur=nr?Object.getOwnPropertyNames(Pt):Object.keys(Pt),Wr=Ur.length;let Sn;for(ir=0;ir<Wr;ir++)Sn=Ur[ir],Dt.call(null,Pt[Sn],Sn,Pt)}}function j(Pt,Dt){Dt=Dt.toLowerCase();const nr=Object.keys(Pt);let ir=nr.length,Tr;for(;ir-- >0;)if(Tr=nr[ir],Dt===Tr.toLowerCase())return Tr;return null}const Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:_.g,Z=Pt=>!x(Pt)&&Pt!==Y;function z(){const{caseless:Pt}=Z(this)&&this||{},Dt={},nr=(ir,Tr)=>{const Ur=Pt&&j(Dt,Tr)||Tr;G(Dt[Ur])&&G(ir)?Dt[Ur]=z(Dt[Ur],ir):G(ir)?Dt[Ur]=z({},ir):C(ir)?Dt[Ur]=ir.slice():Dt[Ur]=ir};for(let ir=0,Tr=arguments.length;ir<Tr;ir++)arguments[ir]&&N(arguments[ir],nr);return Dt}const fe=(Pt,Dt,nr,{allOwnKeys:ir}={})=>(N(Dt,(Tr,Ur)=>{nr&&k(Tr)?Pt[Ur]=E(Tr,nr):Pt[Ur]=Tr},{allOwnKeys:ir}),Pt),te=Pt=>(Pt.charCodeAt(0)===65279&&(Pt=Pt.slice(1)),Pt),H=(Pt,Dt,nr,ir)=>{Pt.prototype=Object.create(Dt.prototype,ir),Pt.prototype.constructor=Pt,Object.defineProperty(Pt,"super",{value:Dt.prototype}),nr&&Object.assign(Pt.prototype,nr)},Q=(Pt,Dt,nr,ir)=>{let Tr,Ur,Wr;const Sn={};if(Dt=Dt||{},Pt==null)return Dt;do{for(Tr=Object.getOwnPropertyNames(Pt),Ur=Tr.length;Ur-- >0;)Wr=Tr[Ur],(!ir||ir(Wr,Pt,Dt))&&!Sn[Wr]&&(Dt[Wr]=Pt[Wr],Sn[Wr]=!0);Pt=nr!==!1&&c(Pt)}while(Pt&&(!nr||nr(Pt,Dt))&&Pt!==Object.prototype);return Dt},oe=(Pt,Dt,nr)=>{Pt=String(Pt),(nr===void 0||nr>Pt.length)&&(nr=Pt.length),nr-=Dt.length;const ir=Pt.indexOf(Dt,nr);return ir!==-1&&ir===nr},_e=Pt=>{if(!Pt)return null;if(C(Pt))return Pt;let Dt=Pt.length;if(!q(Dt))return null;const nr=new Array(Dt);for(;Dt-- >0;)nr[Dt]=Pt[Dt];return nr},ge=(Pt=>Dt=>Pt&&Dt instanceof Pt)(typeof Uint8Array<"u"&&c(Uint8Array)),be=(Pt,Dt)=>{const ir=(Pt&&Pt[Symbol.iterator]).call(Pt);let Tr;for(;(Tr=ir.next())&&!Tr.done;){const Ur=Tr.value;Dt.call(Pt,Ur[0],Ur[1])}},we=(Pt,Dt)=>{let nr;const ir=[];for(;(nr=Pt.exec(Dt))!==null;)ir.push(nr);return ir},Ee=p("HTMLFormElement"),me=Pt=>Pt.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(nr,ir,Tr){return ir.toUpperCase()+Tr}),Ke=(({hasOwnProperty:Pt})=>(Dt,nr)=>Pt.call(Dt,nr))(Object.prototype),He=p("RegExp"),Ie=(Pt,Dt)=>{const nr=Object.getOwnPropertyDescriptors(Pt),ir={};N(nr,(Tr,Ur)=>{let Wr;(Wr=Dt(Tr,Ur,Pt))!==!1&&(ir[Ur]=Wr||Tr)}),Object.defineProperties(Pt,ir)},Le=Pt=>{Ie(Pt,(Dt,nr)=>{if(k(Pt)&&["arguments","caller","callee"].indexOf(nr)!==-1)return!1;const ir=Pt[nr];if(k(ir)){if(Dt.enumerable=!1,"writable"in Dt){Dt.writable=!1;return}Dt.set||(Dt.set=()=>{throw Error("Can not rewrite read-only method '"+nr+"'")})}})},Ge=(Pt,Dt)=>{const nr={},ir=Tr=>{Tr.forEach(Ur=>{nr[Ur]=!0})};return C(Pt)?ir(Pt):ir(String(Pt).split(Dt)),nr},Be=()=>{},We=(Pt,Dt)=>Pt!=null&&Number.isFinite(Pt=+Pt)?Pt:Dt;function Ze(Pt){return!!(Pt&&k(Pt.append)&&Pt[Symbol.toStringTag]==="FormData"&&Pt[Symbol.iterator])}const _t=Pt=>{const Dt=new Array(10),nr=(ir,Tr)=>{if(b(ir)){if(Dt.indexOf(ir)>=0)return;if(!("toJSON"in ir)){Dt[Tr]=ir;const Ur=C(ir)?[]:{};return N(ir,(Wr,Sn)=>{const Xn=nr(Wr,Tr+1);!x(Xn)&&(Ur[Sn]=Xn)}),Dt[Tr]=void 0,Ur}}return ir};return nr(Pt,0)},Ft=p("AsyncFunction"),gt=Pt=>Pt&&(b(Pt)||k(Pt))&&k(Pt.then)&&k(Pt.catch),lt=((Pt,Dt)=>Pt?setImmediate:Dt?((nr,ir)=>(Y.addEventListener("message",({source:Tr,data:Ur})=>{Tr===Y&&Ur===nr&&ir.length&&ir.shift()()},!1),Tr=>{ir.push(Tr),Y.postMessage(nr,"*")}))(`axios@${Math.random()}`,[]):nr=>setTimeout(nr))(typeof setImmediate=="function",k(Y.postMessage)),dt=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof h<"u"&&h.nextTick||lt;var tt={isArray:C,isArrayBuffer:S,isBuffer:R,isFormData:ye,isArrayBufferView:O,isString:M,isNumber:q,isBoolean:F,isObject:b,isPlainObject:G,isReadableStream:K,isRequest:B,isResponse:L,isHeaders:$,isUndefined:x,isDate:ue,isFile:le,isBlob:X,isRegExp:He,isFunction:k,isStream:de,isURLSearchParams:he,isTypedArray:ge,isFileList:se,forEach:N,merge:z,extend:fe,trim:T,stripBOM:te,inherits:H,toFlatObject:Q,kindOf:d,kindOfTest:p,endsWith:oe,toArray:_e,forEachEntry:be,matchAll:we,isHTMLForm:Ee,hasOwnProperty:Ke,hasOwnProp:Ke,reduceDescriptors:Ie,freezeMethods:Le,toObjectSet:Ge,toCamelCase:me,noop:Be,toFiniteNumber:We,findKey:j,global:Y,isContextDefined:Z,isSpecCompliantForm:Ze,toJSONObject:_t,isAsyncFn:Ft,isThenable:gt,setImmediate:lt,asap:dt};function rt(Pt,Dt,nr,ir,Tr){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=Pt,this.name="AxiosError",Dt&&(this.code=Dt),nr&&(this.config=nr),ir&&(this.request=ir),Tr&&(this.response=Tr,this.status=Tr.status?Tr.status:null)}tt.inherits(rt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:tt.toJSONObject(this.config),code:this.code,status:this.status}}});const ke=rt.prototype,xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(Pt=>{xe[Pt]={value:Pt}}),Object.defineProperties(rt,xe),Object.defineProperty(ke,"isAxiosError",{value:!0}),rt.from=(Pt,Dt,nr,ir,Tr,Ur)=>{const Wr=Object.create(ke);return tt.toFlatObject(Pt,Wr,function(Xn){return Xn!==Error.prototype},Sn=>Sn!=="isAxiosError"),rt.call(Wr,Pt.message,Dt,nr,ir,Tr),Wr.cause=Pt,Wr.name=Pt.name,Ur&&Object.assign(Wr,Ur),Wr};var Pe=null;function it(Pt){return tt.isPlainObject(Pt)||tt.isArray(Pt)}function Xe(Pt){return tt.endsWith(Pt,"[]")?Pt.slice(0,-2):Pt}function st(Pt,Dt,nr){return Pt?Pt.concat(Dt).map(function(Tr,Ur){return Tr=Xe(Tr),!nr&&Ur?"["+Tr+"]":Tr}).join(nr?".":""):Dt}function It(Pt){return tt.isArray(Pt)&&!Pt.some(it)}const ft=tt.toFlatObject(tt,{},null,function(Dt){return/^is[A-Z]/.test(Dt)});function Jt(Pt,Dt,nr){if(!tt.isObject(Pt))throw new TypeError("target must be an object");Dt=Dt||new FormData,nr=tt.toFlatObject(nr,{metaTokens:!0,dots:!1,indexes:!1},!1,function(xi,Hn){return!tt.isUndefined(Hn[xi])});const ir=nr.metaTokens,Tr=nr.visitor||Mn,Ur=nr.dots,Wr=nr.indexes,Xn=(nr.Blob||typeof Blob<"u"&&Blob)&&tt.isSpecCompliantForm(Dt);if(!tt.isFunction(Tr))throw new TypeError("visitor must be a function");function Wn(yi){if(yi===null)return"";if(tt.isDate(yi))return yi.toISOString();if(!Xn&&tt.isBlob(yi))throw new rt("Blob is not supported. Use a Buffer instead.");return tt.isArrayBuffer(yi)||tt.isTypedArray(yi)?Xn&&typeof Blob=="function"?new Blob([yi]):w.from(yi):yi}function Mn(yi,xi,Hn){let Os=yi;if(yi&&!Hn&&typeof yi=="object"){if(tt.endsWith(xi,"{}"))xi=ir?xi:xi.slice(0,-2),yi=JSON.stringify(yi);else if(tt.isArray(yi)&&It(yi)||(tt.isFileList(yi)||tt.endsWith(xi,"[]"))&&(Os=tt.toArray(yi)))return xi=Xe(xi),Os.forEach(function(Po,Fo){!(tt.isUndefined(Po)||Po===null)&&Dt.append(Wr===!0?st([xi],Fo,Ur):Wr===null?xi:xi+"[]",Wn(Po))}),!1}return it(yi)?!0:(Dt.append(st(Hn,xi,Ur),Wn(yi)),!1)}const Qn=[],Es=Object.assign(ft,{defaultVisitor:Mn,convertValue:Wn,isVisitable:it});function Bs(yi,xi){if(!tt.isUndefined(yi)){if(Qn.indexOf(yi)!==-1)throw Error("Circular reference detected in "+xi.join("."));Qn.push(yi),tt.forEach(yi,function(Os,Zs){(!(tt.isUndefined(Os)||Os===null)&&Tr.call(Dt,Os,tt.isString(Zs)?Zs.trim():Zs,xi,Es))===!0&&Bs(Os,xi?xi.concat(Zs):[Zs])}),Qn.pop()}}if(!tt.isObject(Pt))throw new TypeError("data must be an object");return Bs(Pt),Dt}function Ot(Pt){const Dt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(Pt).replace(/[!'()~]|%20|%00/g,function(ir){return Dt[ir]})}function Ct(Pt,Dt){this._pairs=[],Pt&&Jt(Pt,this,Dt)}const qe=Ct.prototype;qe.append=function(Dt,nr){this._pairs.push([Dt,nr])},qe.toString=function(Dt){const nr=Dt?function(ir){return Dt.call(this,ir,Ot)}:Ot;return this._pairs.map(function(Tr){return nr(Tr[0])+"="+nr(Tr[1])},"").join("&")};function Yt(Pt){return encodeURIComponent(Pt).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ot(Pt,Dt,nr){if(!Dt)return Pt;const ir=nr&&nr.encode||Yt;tt.isFunction(nr)&&(nr={serialize:nr});const Tr=nr&&nr.serialize;let Ur;if(Tr?Ur=Tr(Dt,nr):Ur=tt.isURLSearchParams(Dt)?Dt.toString():new Ct(Dt,nr).toString(ir),Ur){const Wr=Pt.indexOf("#");Wr!==-1&&(Pt=Pt.slice(0,Wr)),Pt+=(Pt.indexOf("?")===-1?"?":"&")+Ur}return Pt}class Ae{constructor(){this.handlers=[]}use(Dt,nr,ir){return this.handlers.push({fulfilled:Dt,rejected:nr,synchronous:ir?ir.synchronous:!1,runWhen:ir?ir.runWhen:null}),this.handlers.length-1}eject(Dt){this.handlers[Dt]&&(this.handlers[Dt]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(Dt){tt.forEach(this.handlers,function(ir){ir!==null&&Dt(ir)})}}var Rt=Ae,Ht={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bt=typeof URLSearchParams<"u"?URLSearchParams:Ct,Mt=typeof FormData<"u"?FormData:null,tr=typeof Blob<"u"?Blob:null,Vt={isBrowser:!0,classes:{URLSearchParams:bt,FormData:Mt,Blob:tr},protocols:["http","https","file","blob","url","data"]};const Et=!1,Ye=typeof navigator=="object"&&navigator||void 0,Tt=Et&&(!Ye||["ReactNative","NativeScript","NS"].indexOf(Ye.product)<0),Wt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dr=Et&&self.location.href||"http://localhost";var at=Object.freeze({__proto__:null,hasBrowserEnv:Et,hasStandardBrowserWebWorkerEnv:Wt,hasStandardBrowserEnv:Tt,navigator:Ye,origin:dr}),wt={...at,...Vt};function At(Pt,Dt){return Jt(Pt,new wt.classes.URLSearchParams,Object.assign({visitor:function(nr,ir,Tr,Ur){return wt.isNode&&tt.isBuffer(nr)?(this.append(ir,nr.toString("base64")),!1):Ur.defaultVisitor.apply(this,arguments)}},Dt))}function Je(Pt){return tt.matchAll(/\w+|\[(\w*)]/g,Pt).map(Dt=>Dt[0]==="[]"?"":Dt[1]||Dt[0])}function Lt(Pt){const Dt={},nr=Object.keys(Pt);let ir;const Tr=nr.length;let Ur;for(ir=0;ir<Tr;ir++)Ur=nr[ir],Dt[Ur]=Pt[Ur];return Dt}function sr(Pt){function Dt(nr,ir,Tr,Ur){let Wr=nr[Ur++];if(Wr==="__proto__")return!0;const Sn=Number.isFinite(+Wr),Xn=Ur>=nr.length;return Wr=!Wr&&tt.isArray(Tr)?Tr.length:Wr,Xn?(tt.hasOwnProp(Tr,Wr)?Tr[Wr]=[Tr[Wr],ir]:Tr[Wr]=ir,!Sn):((!Tr[Wr]||!tt.isObject(Tr[Wr]))&&(Tr[Wr]=[]),Dt(nr,ir,Tr[Wr],Ur)&&tt.isArray(Tr[Wr])&&(Tr[Wr]=Lt(Tr[Wr])),!Sn)}if(tt.isFormData(Pt)&&tt.isFunction(Pt.entries)){const nr={};return tt.forEachEntry(Pt,(ir,Tr)=>{Dt(Je(ir),Tr,nr,0)}),nr}return null}function ur(Pt,Dt,nr){if(tt.isString(Pt))try{return(Dt||JSON.parse)(Pt),tt.trim(Pt)}catch(ir){if(ir.name!=="SyntaxError")throw ir}return(nr||JSON.stringify)(Pt)}const vr={transitional:Ht,adapter:["xhr","http","fetch"],transformRequest:[function(Dt,nr){const ir=nr.getContentType()||"",Tr=ir.indexOf("application/json")>-1,Ur=tt.isObject(Dt);if(Ur&&tt.isHTMLForm(Dt)&&(Dt=new FormData(Dt)),tt.isFormData(Dt))return Tr?JSON.stringify(sr(Dt)):Dt;if(tt.isArrayBuffer(Dt)||tt.isBuffer(Dt)||tt.isStream(Dt)||tt.isFile(Dt)||tt.isBlob(Dt)||tt.isReadableStream(Dt))return Dt;if(tt.isArrayBufferView(Dt))return Dt.buffer;if(tt.isURLSearchParams(Dt))return nr.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),Dt.toString();let Sn;if(Ur){if(ir.indexOf("application/x-www-form-urlencoded")>-1)return At(Dt,this.formSerializer).toString();if((Sn=tt.isFileList(Dt))||ir.indexOf("multipart/form-data")>-1){const Xn=this.env&&this.env.FormData;return Jt(Sn?{"files[]":Dt}:Dt,Xn&&new Xn,this.formSerializer)}}return Ur||Tr?(nr.setContentType("application/json",!1),ur(Dt)):Dt}],transformResponse:[function(Dt){const nr=this.transitional||vr.transitional,ir=nr&&nr.forcedJSONParsing,Tr=this.responseType==="json";if(tt.isResponse(Dt)||tt.isReadableStream(Dt))return Dt;if(Dt&&tt.isString(Dt)&&(ir&&!this.responseType||Tr)){const Wr=!(nr&&nr.silentJSONParsing)&&Tr;try{return JSON.parse(Dt)}catch(Sn){if(Wr)throw Sn.name==="SyntaxError"?rt.from(Sn,rt.ERR_BAD_RESPONSE,this,null,this.response):Sn}}return Dt}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:wt.classes.FormData,Blob:wt.classes.Blob},validateStatus:function(Dt){return Dt>=200&&Dt<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};tt.forEach(["delete","get","head","post","put","patch"],Pt=>{vr.headers[Pt]={}});var kr=vr;const Jr=tt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var hr=Pt=>{const Dt={};let nr,ir,Tr;return Pt&&Pt.split(`
|
||
`).forEach(function(Wr){Tr=Wr.indexOf(":"),nr=Wr.substring(0,Tr).trim().toLowerCase(),ir=Wr.substring(Tr+1).trim(),!(!nr||Dt[nr]&&Jr[nr])&&(nr==="set-cookie"?Dt[nr]?Dt[nr].push(ir):Dt[nr]=[ir]:Dt[nr]=Dt[nr]?Dt[nr]+", "+ir:ir)}),Dt};const $r=Symbol("internals");function Hr(Pt){return Pt&&String(Pt).trim().toLowerCase()}function rn(Pt){return Pt===!1||Pt==null?Pt:tt.isArray(Pt)?Pt.map(rn):String(Pt)}function _r(Pt){const Dt=Object.create(null),nr=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let ir;for(;ir=nr.exec(Pt);)Dt[ir[1]]=ir[2];return Dt}const pn=Pt=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Pt.trim());function $t(Pt,Dt,nr,ir,Tr){if(tt.isFunction(ir))return ir.call(this,Dt,nr);if(Tr&&(Dt=nr),!!tt.isString(Dt)){if(tt.isString(ir))return Dt.indexOf(ir)!==-1;if(tt.isRegExp(ir))return ir.test(Dt)}}function In(Pt){return Pt.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Dt,nr,ir)=>nr.toUpperCase()+ir)}function ln(Pt,Dt){const nr=tt.toCamelCase(" "+Dt);["get","set","has"].forEach(ir=>{Object.defineProperty(Pt,ir+nr,{value:function(Tr,Ur,Wr){return this[ir].call(this,Dt,Tr,Ur,Wr)},configurable:!0})})}class yn{constructor(Dt){Dt&&this.set(Dt)}set(Dt,nr,ir){const Tr=this;function Ur(Sn,Xn,Wn){const Mn=Hr(Xn);if(!Mn)throw new Error("header name must be a non-empty string");const Qn=tt.findKey(Tr,Mn);(!Qn||Tr[Qn]===void 0||Wn===!0||Wn===void 0&&Tr[Qn]!==!1)&&(Tr[Qn||Xn]=rn(Sn))}const Wr=(Sn,Xn)=>tt.forEach(Sn,(Wn,Mn)=>Ur(Wn,Mn,Xn));if(tt.isPlainObject(Dt)||Dt instanceof this.constructor)Wr(Dt,nr);else if(tt.isString(Dt)&&(Dt=Dt.trim())&&!pn(Dt))Wr(hr(Dt),nr);else if(tt.isHeaders(Dt))for(const[Sn,Xn]of Dt.entries())Ur(Xn,Sn,ir);else Dt!=null&&Ur(nr,Dt,ir);return this}get(Dt,nr){if(Dt=Hr(Dt),Dt){const ir=tt.findKey(this,Dt);if(ir){const Tr=this[ir];if(!nr)return Tr;if(nr===!0)return _r(Tr);if(tt.isFunction(nr))return nr.call(this,Tr,ir);if(tt.isRegExp(nr))return nr.exec(Tr);throw new TypeError("parser must be boolean|regexp|function")}}}has(Dt,nr){if(Dt=Hr(Dt),Dt){const ir=tt.findKey(this,Dt);return!!(ir&&this[ir]!==void 0&&(!nr||$t(this,this[ir],ir,nr)))}return!1}delete(Dt,nr){const ir=this;let Tr=!1;function Ur(Wr){if(Wr=Hr(Wr),Wr){const Sn=tt.findKey(ir,Wr);Sn&&(!nr||$t(ir,ir[Sn],Sn,nr))&&(delete ir[Sn],Tr=!0)}}return tt.isArray(Dt)?Dt.forEach(Ur):Ur(Dt),Tr}clear(Dt){const nr=Object.keys(this);let ir=nr.length,Tr=!1;for(;ir--;){const Ur=nr[ir];(!Dt||$t(this,this[Ur],Ur,Dt,!0))&&(delete this[Ur],Tr=!0)}return Tr}normalize(Dt){const nr=this,ir={};return tt.forEach(this,(Tr,Ur)=>{const Wr=tt.findKey(ir,Ur);if(Wr){nr[Wr]=rn(Tr),delete nr[Ur];return}const Sn=Dt?In(Ur):String(Ur).trim();Sn!==Ur&&delete nr[Ur],nr[Sn]=rn(Tr),ir[Sn]=!0}),this}concat(...Dt){return this.constructor.concat(this,...Dt)}toJSON(Dt){const nr=Object.create(null);return tt.forEach(this,(ir,Tr)=>{ir!=null&&ir!==!1&&(nr[Tr]=Dt&&tt.isArray(ir)?ir.join(", "):ir)}),nr}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Dt,nr])=>Dt+": "+nr).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Dt){return Dt instanceof this?Dt:new this(Dt)}static concat(Dt,...nr){const ir=new this(Dt);return nr.forEach(Tr=>ir.set(Tr)),ir}static accessor(Dt){const ir=(this[$r]=this[$r]={accessors:{}}).accessors,Tr=this.prototype;function Ur(Wr){const Sn=Hr(Wr);ir[Sn]||(ln(Tr,Wr),ir[Sn]=!0)}return tt.isArray(Dt)?Dt.forEach(Ur):Ur(Dt),this}}yn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),tt.reduceDescriptors(yn.prototype,({value:Pt},Dt)=>{let nr=Dt[0].toUpperCase()+Dt.slice(1);return{get:()=>Pt,set(ir){this[nr]=ir}}}),tt.freezeMethods(yn);var Fr=yn;function On(Pt,Dt){const nr=this||kr,ir=Dt||nr,Tr=Fr.from(ir.headers);let Ur=ir.data;return tt.forEach(Pt,function(Sn){Ur=Sn.call(nr,Ur,Tr.normalize(),Dt?Dt.status:void 0)}),Tr.normalize(),Ur}function En(Pt){return!!(Pt&&Pt.__CANCEL__)}function ee(Pt,Dt,nr){rt.call(this,Pt??"canceled",rt.ERR_CANCELED,Dt,nr),this.name="CanceledError"}tt.inherits(ee,rt,{__CANCEL__:!0});function ve(Pt,Dt,nr){const ir=nr.config.validateStatus;!nr.status||!ir||ir(nr.status)?Pt(nr):Dt(new rt("Request failed with status code "+nr.status,[rt.ERR_BAD_REQUEST,rt.ERR_BAD_RESPONSE][Math.floor(nr.status/100)-4],nr.config,nr.request,nr))}function ze(Pt){const Dt=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Pt);return Dt&&Dt[1]||""}function yt(Pt,Dt){Pt=Pt||10;const nr=new Array(Pt),ir=new Array(Pt);let Tr=0,Ur=0,Wr;return Dt=Dt!==void 0?Dt:1e3,function(Xn){const Wn=Date.now(),Mn=ir[Ur];Wr||(Wr=Wn),nr[Tr]=Xn,ir[Tr]=Wn;let Qn=Ur,Es=0;for(;Qn!==Tr;)Es+=nr[Qn++],Qn=Qn%Pt;if(Tr=(Tr+1)%Pt,Tr===Ur&&(Ur=(Ur+1)%Pt),Wn-Wr<Dt)return;const Bs=Mn&&Wn-Mn;return Bs?Math.round(Es*1e3/Bs):void 0}}function vt(Pt,Dt){let nr=0,ir=1e3/Dt,Tr,Ur;const Wr=(Wn,Mn=Date.now())=>{nr=Mn,Tr=null,Ur&&(clearTimeout(Ur),Ur=null),Pt.apply(null,Wn)};return[(...Wn)=>{const Mn=Date.now(),Qn=Mn-nr;Qn>=ir?Wr(Wn,Mn):(Tr=Wn,Ur||(Ur=setTimeout(()=>{Ur=null,Wr(Tr)},ir-Qn)))},()=>Tr&&Wr(Tr)]}const ar=(Pt,Dt,nr=3)=>{let ir=0;const Tr=yt(50,250);return vt(Ur=>{const Wr=Ur.loaded,Sn=Ur.lengthComputable?Ur.total:void 0,Xn=Wr-ir,Wn=Tr(Xn),Mn=Wr<=Sn;ir=Wr;const Qn={loaded:Wr,total:Sn,progress:Sn?Wr/Sn:void 0,bytes:Xn,rate:Wn||void 0,estimated:Wn&&Sn&&Mn?(Sn-Wr)/Wn:void 0,event:Ur,lengthComputable:Sn!=null,[Dt?"download":"upload"]:!0};Pt(Qn)},nr)},wr=(Pt,Dt)=>{const nr=Pt!=null;return[ir=>Dt[0]({lengthComputable:nr,total:Pt,loaded:ir}),Dt[1]]},zt=Pt=>(...Dt)=>tt.asap(()=>Pt(...Dt));var Kr=wt.hasStandardBrowserEnv?((Pt,Dt)=>nr=>(nr=new URL(nr,wt.origin),Pt.protocol===nr.protocol&&Pt.host===nr.host&&(Dt||Pt.port===nr.port)))(new URL(wt.origin),wt.navigator&&/(msie|trident)/i.test(wt.navigator.userAgent)):()=>!0,Xt=wt.hasStandardBrowserEnv?{write(Pt,Dt,nr,ir,Tr,Ur){const Wr=[Pt+"="+encodeURIComponent(Dt)];tt.isNumber(nr)&&Wr.push("expires="+new Date(nr).toGMTString()),tt.isString(ir)&&Wr.push("path="+ir),tt.isString(Tr)&&Wr.push("domain="+Tr),Ur===!0&&Wr.push("secure"),document.cookie=Wr.join("; ")},read(Pt){const Dt=document.cookie.match(new RegExp("(^|;\\s*)("+Pt+")=([^;]*)"));return Dt?decodeURIComponent(Dt[3]):null},remove(Pt){this.write(Pt,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function et(Pt){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Pt)}function xt(Pt,Dt){return Dt?Pt.replace(/\/?\/$/,"")+"/"+Dt.replace(/^\/+/,""):Pt}function Kt(Pt,Dt,nr){let ir=!et(Dt);return Pt&&ir||nr==!1?xt(Pt,Dt):Dt}const kt=Pt=>Pt instanceof Fr?{...Pt}:Pt;function or(Pt,Dt){Dt=Dt||{};const nr={};function ir(Wn,Mn,Qn,Es){return tt.isPlainObject(Wn)&&tt.isPlainObject(Mn)?tt.merge.call({caseless:Es},Wn,Mn):tt.isPlainObject(Mn)?tt.merge({},Mn):tt.isArray(Mn)?Mn.slice():Mn}function Tr(Wn,Mn,Qn,Es){if(tt.isUndefined(Mn)){if(!tt.isUndefined(Wn))return ir(void 0,Wn,Qn,Es)}else return ir(Wn,Mn,Qn,Es)}function Ur(Wn,Mn){if(!tt.isUndefined(Mn))return ir(void 0,Mn)}function Wr(Wn,Mn){if(tt.isUndefined(Mn)){if(!tt.isUndefined(Wn))return ir(void 0,Wn)}else return ir(void 0,Mn)}function Sn(Wn,Mn,Qn){if(Qn in Dt)return ir(Wn,Mn);if(Qn in Pt)return ir(void 0,Wn)}const Xn={url:Ur,method:Ur,data:Ur,baseURL:Wr,transformRequest:Wr,transformResponse:Wr,paramsSerializer:Wr,timeout:Wr,timeoutMessage:Wr,withCredentials:Wr,withXSRFToken:Wr,adapter:Wr,responseType:Wr,xsrfCookieName:Wr,xsrfHeaderName:Wr,onUploadProgress:Wr,onDownloadProgress:Wr,decompress:Wr,maxContentLength:Wr,maxBodyLength:Wr,beforeRedirect:Wr,transport:Wr,httpAgent:Wr,httpsAgent:Wr,cancelToken:Wr,socketPath:Wr,responseEncoding:Wr,validateStatus:Sn,headers:(Wn,Mn,Qn)=>Tr(kt(Wn),kt(Mn),Qn,!0)};return tt.forEach(Object.keys(Object.assign({},Pt,Dt)),function(Mn){const Qn=Xn[Mn]||Tr,Es=Qn(Pt[Mn],Dt[Mn],Mn);tt.isUndefined(Es)&&Qn!==Sn||(nr[Mn]=Es)}),nr}var Qr=Pt=>{const Dt=or({},Pt);let{data:nr,withXSRFToken:ir,xsrfHeaderName:Tr,xsrfCookieName:Ur,headers:Wr,auth:Sn}=Dt;Dt.headers=Wr=Fr.from(Wr),Dt.url=ot(Kt(Dt.baseURL,Dt.url,Dt.allowAbsoluteUrls),Pt.params,Pt.paramsSerializer),Sn&&Wr.set("Authorization","Basic "+btoa((Sn.username||"")+":"+(Sn.password?unescape(encodeURIComponent(Sn.password)):"")));let Xn;if(tt.isFormData(nr)){if(wt.hasStandardBrowserEnv||wt.hasStandardBrowserWebWorkerEnv)Wr.setContentType(void 0);else if((Xn=Wr.getContentType())!==!1){const[Wn,...Mn]=Xn?Xn.split(";").map(Qn=>Qn.trim()).filter(Boolean):[];Wr.setContentType([Wn||"multipart/form-data",...Mn].join("; "))}}if(wt.hasStandardBrowserEnv&&(ir&&tt.isFunction(ir)&&(ir=ir(Dt)),ir||ir!==!1&&Kr(Dt.url))){const Wn=Tr&&Ur&&Xt.read(Ur);Wn&&Wr.set(Tr,Wn)}return Dt},An=typeof XMLHttpRequest<"u"&&function(Pt){return new Promise(function(nr,ir){const Tr=Qr(Pt);let Ur=Tr.data;const Wr=Fr.from(Tr.headers).normalize();let{responseType:Sn,onUploadProgress:Xn,onDownloadProgress:Wn}=Tr,Mn,Qn,Es,Bs,yi;function xi(){Bs&&Bs(),yi&&yi(),Tr.cancelToken&&Tr.cancelToken.unsubscribe(Mn),Tr.signal&&Tr.signal.removeEventListener("abort",Mn)}let Hn=new XMLHttpRequest;Hn.open(Tr.method.toUpperCase(),Tr.url,!0),Hn.timeout=Tr.timeout;function Os(){if(!Hn)return;const Po=Fr.from("getAllResponseHeaders"in Hn&&Hn.getAllResponseHeaders()),na={data:!Sn||Sn==="text"||Sn==="json"?Hn.responseText:Hn.response,status:Hn.status,statusText:Hn.statusText,headers:Po,config:Pt,request:Hn};ve(function(Mr){nr(Mr),xi()},function(Mr){ir(Mr),xi()},na),Hn=null}"onloadend"in Hn?Hn.onloadend=Os:Hn.onreadystatechange=function(){!Hn||Hn.readyState!==4||Hn.status===0&&!(Hn.responseURL&&Hn.responseURL.indexOf("file:")===0)||setTimeout(Os)},Hn.onabort=function(){Hn&&(ir(new rt("Request aborted",rt.ECONNABORTED,Pt,Hn)),Hn=null)},Hn.onerror=function(){ir(new rt("Network Error",rt.ERR_NETWORK,Pt,Hn)),Hn=null},Hn.ontimeout=function(){let Fo=Tr.timeout?"timeout of "+Tr.timeout+"ms exceeded":"timeout exceeded";const na=Tr.transitional||Ht;Tr.timeoutErrorMessage&&(Fo=Tr.timeoutErrorMessage),ir(new rt(Fo,na.clarifyTimeoutError?rt.ETIMEDOUT:rt.ECONNABORTED,Pt,Hn)),Hn=null},Ur===void 0&&Wr.setContentType(null),"setRequestHeader"in Hn&&tt.forEach(Wr.toJSON(),function(Fo,na){Hn.setRequestHeader(na,Fo)}),tt.isUndefined(Tr.withCredentials)||(Hn.withCredentials=!!Tr.withCredentials),Sn&&Sn!=="json"&&(Hn.responseType=Tr.responseType),Wn&&([Es,yi]=ar(Wn,!0),Hn.addEventListener("progress",Es)),Xn&&Hn.upload&&([Qn,Bs]=ar(Xn),Hn.upload.addEventListener("progress",Qn),Hn.upload.addEventListener("loadend",Bs)),(Tr.cancelToken||Tr.signal)&&(Mn=Po=>{Hn&&(ir(!Po||Po.type?new ee(null,Pt,Hn):Po),Hn.abort(),Hn=null)},Tr.cancelToken&&Tr.cancelToken.subscribe(Mn),Tr.signal&&(Tr.signal.aborted?Mn():Tr.signal.addEventListener("abort",Mn)));const Zs=ze(Tr.url);if(Zs&&wt.protocols.indexOf(Zs)===-1){ir(new rt("Unsupported protocol "+Zs+":",rt.ERR_BAD_REQUEST,Pt));return}Hn.send(Ur||null)})},Nn=(Pt,Dt)=>{const{length:nr}=Pt=Pt?Pt.filter(Boolean):[];if(Dt||nr){let ir=new AbortController,Tr;const Ur=function(Wn){if(!Tr){Tr=!0,Sn();const Mn=Wn instanceof Error?Wn:this.reason;ir.abort(Mn instanceof rt?Mn:new ee(Mn instanceof Error?Mn.message:Mn))}};let Wr=Dt&&setTimeout(()=>{Wr=null,Ur(new rt(`timeout ${Dt} of ms exceeded`,rt.ETIMEDOUT))},Dt);const Sn=()=>{Pt&&(Wr&&clearTimeout(Wr),Wr=null,Pt.forEach(Wn=>{Wn.unsubscribe?Wn.unsubscribe(Ur):Wn.removeEventListener("abort",Ur)}),Pt=null)};Pt.forEach(Wn=>Wn.addEventListener("abort",Ur));const{signal:Xn}=ir;return Xn.unsubscribe=()=>tt.asap(Sn),Xn}};const Vi=function*(Pt,Dt){let nr=Pt.byteLength;if(!Dt||nr<Dt){yield Pt;return}let ir=0,Tr;for(;ir<nr;)Tr=ir+Dt,yield Pt.slice(ir,Tr),ir=Tr},Kn=async function*(Pt,Dt){for await(const nr of _s(Pt))yield*Vi(nr,Dt)},_s=async function*(Pt){if(Pt[Symbol.asyncIterator]){yield*Pt;return}const Dt=Pt.getReader();try{for(;;){const{done:nr,value:ir}=await Dt.read();if(nr)break;yield ir}}finally{await Dt.cancel()}},Gs=(Pt,Dt,nr,ir)=>{const Tr=Kn(Pt,Dt);let Ur=0,Wr,Sn=Xn=>{Wr||(Wr=!0,ir&&ir(Xn))};return new ReadableStream({async pull(Xn){try{const{done:Wn,value:Mn}=await Tr.next();if(Wn){Sn(),Xn.close();return}let Qn=Mn.byteLength;if(nr){let Es=Ur+=Qn;nr(Es)}Xn.enqueue(new Uint8Array(Mn))}catch(Wn){throw Sn(Wn),Wn}},cancel(Xn){return Sn(Xn),Tr.return()}},{highWaterMark:2})},zs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",rs=zs&&typeof ReadableStream=="function",to=zs&&(typeof TextEncoder=="function"?(Pt=>Dt=>Pt.encode(Dt))(new TextEncoder):async Pt=>new Uint8Array(await new Response(Pt).arrayBuffer())),ro=(Pt,...Dt)=>{try{return!!Pt(...Dt)}catch{return!1}},Ls=rs&&ro(()=>{let Pt=!1;const Dt=new Request(wt.origin,{body:new ReadableStream,method:"POST",get duplex(){return Pt=!0,"half"}}).headers.has("Content-Type");return Pt&&!Dt}),cl=64*1024,Eh=rs&&ro(()=>tt.isReadableStream(new Response("").body)),Ro={stream:Eh&&(Pt=>Pt.body)};zs&&(Pt=>{["text","arrayBuffer","blob","formData","stream"].forEach(Dt=>{!Ro[Dt]&&(Ro[Dt]=tt.isFunction(Pt[Dt])?nr=>nr[Dt]():(nr,ir)=>{throw new rt(`Response type '${Dt}' is not supported`,rt.ERR_NOT_SUPPORT,ir)})})})(new Response);const Su=async Pt=>{if(Pt==null)return 0;if(tt.isBlob(Pt))return Pt.size;if(tt.isSpecCompliantForm(Pt))return(await new Request(wt.origin,{method:"POST",body:Pt}).arrayBuffer()).byteLength;if(tt.isArrayBufferView(Pt)||tt.isArrayBuffer(Pt))return Pt.byteLength;if(tt.isURLSearchParams(Pt)&&(Pt=Pt+""),tt.isString(Pt))return(await to(Pt)).byteLength},Yl=async(Pt,Dt)=>{const nr=tt.toFiniteNumber(Pt.getContentLength());return nr??Su(Dt)};var Th=zs&&(async Pt=>{let{url:Dt,method:nr,data:ir,signal:Tr,cancelToken:Ur,timeout:Wr,onDownloadProgress:Sn,onUploadProgress:Xn,responseType:Wn,headers:Mn,withCredentials:Qn="same-origin",fetchOptions:Es}=Qr(Pt);Wn=Wn?(Wn+"").toLowerCase():"text";let Bs=Nn([Tr,Ur&&Ur.toAbortSignal()],Wr),yi;const xi=Bs&&Bs.unsubscribe&&(()=>{Bs.unsubscribe()});let Hn;try{if(Xn&&Ls&&nr!=="get"&&nr!=="head"&&(Hn=await Yl(Mn,ir))!==0){let na=new Request(Dt,{method:"POST",body:ir,duplex:"half"}),ku;if(tt.isFormData(ir)&&(ku=na.headers.get("content-type"))&&Mn.setContentType(ku),na.body){const[Mr,Jl]=wr(Hn,ar(zt(Xn)));ir=Gs(na.body,cl,Mr,Jl)}}tt.isString(Qn)||(Qn=Qn?"include":"omit");const Os="credentials"in Request.prototype;yi=new Request(Dt,{...Es,signal:Bs,method:nr.toUpperCase(),headers:Mn.normalize().toJSON(),body:ir,duplex:"half",credentials:Os?Qn:void 0});let Zs=await fetch(yi);const Po=Eh&&(Wn==="stream"||Wn==="response");if(Eh&&(Sn||Po&&xi)){const na={};["status","statusText","headers"].forEach(gn=>{na[gn]=Zs[gn]});const ku=tt.toFiniteNumber(Zs.headers.get("content-length")),[Mr,Jl]=Sn&&wr(ku,ar(zt(Sn),!0))||[];Zs=new Response(Gs(Zs.body,cl,Mr,()=>{Jl&&Jl(),xi&&xi()}),na)}Wn=Wn||"text";let Fo=await Ro[tt.findKey(Ro,Wn)||"text"](Zs,Pt);return!Po&&xi&&xi(),await new Promise((na,ku)=>{ve(na,ku,{data:Fo,headers:Fr.from(Zs.headers),status:Zs.status,statusText:Zs.statusText,config:Pt,request:yi})})}catch(Os){throw xi&&xi(),Os&&Os.name==="TypeError"&&/fetch/i.test(Os.message)?Object.assign(new rt("Network Error",rt.ERR_NETWORK,Pt,yi),{cause:Os.cause||Os}):rt.from(Os,Os&&Os.code,Pt,yi)}});const Sh={http:Pe,xhr:An,fetch:Th};tt.forEach(Sh,(Pt,Dt)=>{if(Pt){try{Object.defineProperty(Pt,"name",{value:Dt})}catch{}Object.defineProperty(Pt,"adapterName",{value:Dt})}});const Bc=Pt=>`- ${Pt}`,Id=Pt=>tt.isFunction(Pt)||Pt===null||Pt===!1;var Iu={getAdapter:Pt=>{Pt=tt.isArray(Pt)?Pt:[Pt];const{length:Dt}=Pt;let nr,ir;const Tr={};for(let Ur=0;Ur<Dt;Ur++){nr=Pt[Ur];let Wr;if(ir=nr,!Id(nr)&&(ir=Sh[(Wr=String(nr)).toLowerCase()],ir===void 0))throw new rt(`Unknown adapter '${Wr}'`);if(ir)break;Tr[Wr||"#"+Ur]=ir}if(!ir){const Ur=Object.entries(Tr).map(([Sn,Xn])=>`adapter ${Sn} `+(Xn===!1?"is not supported by the environment":"is not available in the build"));let Wr=Dt?Ur.length>1?`since :
|
||
`+Ur.map(Bc).join(`
|
||
`):" "+Bc(Ur[0]):"as no adapter specified";throw new rt("There is no suitable adapter to dispatch the request "+Wr,"ERR_NOT_SUPPORT")}return ir},adapters:Sh};function kd(Pt){if(Pt.cancelToken&&Pt.cancelToken.throwIfRequested(),Pt.signal&&Pt.signal.aborted)throw new ee(null,Pt)}function Tg(Pt){return kd(Pt),Pt.headers=Fr.from(Pt.headers),Pt.data=On.call(Pt,Pt.transformRequest),["post","put","patch"].indexOf(Pt.method)!==-1&&Pt.headers.setContentType("application/x-www-form-urlencoded",!1),Iu.getAdapter(Pt.adapter||kr.adapter)(Pt).then(function(ir){return kd(Pt),ir.data=On.call(Pt,Pt.transformResponse,ir),ir.headers=Fr.from(ir.headers),ir},function(ir){return En(ir)||(kd(Pt),ir&&ir.response&&(ir.response.data=On.call(Pt,Pt.transformResponse,ir.response),ir.response.headers=Fr.from(ir.response.headers))),Promise.reject(ir)})}const Rd="1.8.3",Ju={};["object","boolean","number","function","string","symbol"].forEach((Pt,Dt)=>{Ju[Pt]=function(ir){return typeof ir===Pt||"a"+(Dt<1?"n ":" ")+Pt}});const Ds={};Ju.transitional=function(Dt,nr,ir){function Tr(Ur,Wr){return"[Axios v"+Rd+"] Transitional option '"+Ur+"'"+Wr+(ir?". "+ir:"")}return(Ur,Wr,Sn)=>{if(Dt===!1)throw new rt(Tr(Wr," has been removed"+(nr?" in "+nr:"")),rt.ERR_DEPRECATED);return nr&&!Ds[Wr]&&(Ds[Wr]=!0,console.warn(Tr(Wr," has been deprecated since v"+nr+" and will be removed in the near future"))),Dt?Dt(Ur,Wr,Sn):!0}},Ju.spelling=function(Dt){return(nr,ir)=>(console.warn(`${ir} is likely a misspelling of ${Dt}`),!0)};function qs(Pt,Dt,nr){if(typeof Pt!="object")throw new rt("options must be an object",rt.ERR_BAD_OPTION_VALUE);const ir=Object.keys(Pt);let Tr=ir.length;for(;Tr-- >0;){const Ur=ir[Tr],Wr=Dt[Ur];if(Wr){const Sn=Pt[Ur],Xn=Sn===void 0||Wr(Sn,Ur,Pt);if(Xn!==!0)throw new rt("option "+Ur+" must be "+Xn,rt.ERR_BAD_OPTION_VALUE);continue}if(nr!==!0)throw new rt("Unknown option "+Ur,rt.ERR_BAD_OPTION)}}var Cd={assertOptions:qs,validators:Ju};const Wa=Cd.validators;class Ih{constructor(Dt){this.defaults=Dt,this.interceptors={request:new Rt,response:new Rt}}async request(Dt,nr){try{return await this._request(Dt,nr)}catch(ir){if(ir instanceof Error){let Tr={};Error.captureStackTrace?Error.captureStackTrace(Tr):Tr=new Error;const Ur=Tr.stack?Tr.stack.replace(/^.+\n/,""):"";try{ir.stack?Ur&&!String(ir.stack).endsWith(Ur.replace(/^.+\n.+\n/,""))&&(ir.stack+=`
|
||
`+Ur):ir.stack=Ur}catch{}}throw ir}}_request(Dt,nr){typeof Dt=="string"?(nr=nr||{},nr.url=Dt):nr=Dt||{},nr=or(this.defaults,nr);const{transitional:ir,paramsSerializer:Tr,headers:Ur}=nr;ir!==void 0&&Cd.assertOptions(ir,{silentJSONParsing:Wa.transitional(Wa.boolean),forcedJSONParsing:Wa.transitional(Wa.boolean),clarifyTimeoutError:Wa.transitional(Wa.boolean)},!1),Tr!=null&&(tt.isFunction(Tr)?nr.paramsSerializer={serialize:Tr}:Cd.assertOptions(Tr,{encode:Wa.function,serialize:Wa.function},!0)),nr.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?nr.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:nr.allowAbsoluteUrls=!0),Cd.assertOptions(nr,{baseUrl:Wa.spelling("baseURL"),withXsrfToken:Wa.spelling("withXSRFToken")},!0),nr.method=(nr.method||this.defaults.method||"get").toLowerCase();let Wr=Ur&&tt.merge(Ur.common,Ur[nr.method]);Ur&&tt.forEach(["delete","get","head","post","put","patch","common"],yi=>{delete Ur[yi]}),nr.headers=Fr.concat(Wr,Ur);const Sn=[];let Xn=!0;this.interceptors.request.forEach(function(xi){typeof xi.runWhen=="function"&&xi.runWhen(nr)===!1||(Xn=Xn&&xi.synchronous,Sn.unshift(xi.fulfilled,xi.rejected))});const Wn=[];this.interceptors.response.forEach(function(xi){Wn.push(xi.fulfilled,xi.rejected)});let Mn,Qn=0,Es;if(!Xn){const yi=[Tg.bind(this),void 0];for(yi.unshift.apply(yi,Sn),yi.push.apply(yi,Wn),Es=yi.length,Mn=Promise.resolve(nr);Qn<Es;)Mn=Mn.then(yi[Qn++],yi[Qn++]);return Mn}Es=Sn.length;let Bs=nr;for(Qn=0;Qn<Es;){const yi=Sn[Qn++],xi=Sn[Qn++];try{Bs=yi(Bs)}catch(Hn){xi.call(this,Hn);break}}try{Mn=Tg.call(this,Bs)}catch(yi){return Promise.reject(yi)}for(Qn=0,Es=Wn.length;Qn<Es;)Mn=Mn.then(Wn[Qn++],Wn[Qn++]);return Mn}getUri(Dt){Dt=or(this.defaults,Dt);const nr=Kt(Dt.baseURL,Dt.url,Dt.allowAbsoluteUrls);return ot(nr,Dt.params,Dt.paramsSerializer)}}tt.forEach(["delete","get","head","options"],function(Dt){Ih.prototype[Dt]=function(nr,ir){return this.request(or(ir||{},{method:Dt,url:nr,data:(ir||{}).data}))}}),tt.forEach(["post","put","patch"],function(Dt){function nr(ir){return function(Ur,Wr,Sn){return this.request(or(Sn||{},{method:Dt,headers:ir?{"Content-Type":"multipart/form-data"}:{},url:Ur,data:Wr}))}}Ih.prototype[Dt]=nr(),Ih.prototype[Dt+"Form"]=nr(!0)});var kh=Ih;class Xl{constructor(Dt){if(typeof Dt!="function")throw new TypeError("executor must be a function.");let nr;this.promise=new Promise(function(Ur){nr=Ur});const ir=this;this.promise.then(Tr=>{if(!ir._listeners)return;let Ur=ir._listeners.length;for(;Ur-- >0;)ir._listeners[Ur](Tr);ir._listeners=null}),this.promise.then=Tr=>{let Ur;const Wr=new Promise(Sn=>{ir.subscribe(Sn),Ur=Sn}).then(Tr);return Wr.cancel=function(){ir.unsubscribe(Ur)},Wr},Dt(function(Ur,Wr,Sn){ir.reason||(ir.reason=new ee(Ur,Wr,Sn),nr(ir.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Dt){if(this.reason){Dt(this.reason);return}this._listeners?this._listeners.push(Dt):this._listeners=[Dt]}unsubscribe(Dt){if(!this._listeners)return;const nr=this._listeners.indexOf(Dt);nr!==-1&&this._listeners.splice(nr,1)}toAbortSignal(){const Dt=new AbortController,nr=ir=>{Dt.abort(ir)};return this.subscribe(nr),Dt.signal.unsubscribe=()=>this.unsubscribe(nr),Dt.signal}static source(){let Dt;return{token:new Xl(function(Tr){Dt=Tr}),cancel:Dt}}}var Rh=Xl;function U0(Pt){return function(nr){return Pt.apply(null,nr)}}function cv(Pt){return tt.isObject(Pt)&&Pt.isAxiosError===!0}const Co={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Co).forEach(([Pt,Dt])=>{Co[Dt]=Pt});var Sg=Co;function Qu(Pt){const Dt=new kh(Pt),nr=E(kh.prototype.request,Dt);return tt.extend(nr,kh.prototype,Dt,{allOwnKeys:!0}),tt.extend(nr,Dt,null,{allOwnKeys:!0}),nr.create=function(Tr){return Qu(or(Pt,Tr))},nr}const po=Qu(kr);po.Axios=kh,po.CanceledError=ee,po.CancelToken=Rh,po.isCancel=En,po.VERSION=Rd,po.toFormData=Jt,po.AxiosError=rt,po.Cancel=po.CanceledError,po.all=function(Dt){return Promise.all(Dt)},po.spread=U0,po.isAxiosError=cv,po.mergeConfig=or,po.AxiosHeaders=Fr,po.formToJSON=Pt=>sr(tt.isHTMLForm(Pt)?new FormData(Pt):Pt),po.getAdapter=Iu.getAdapter,po.HttpStatusCode=Sg,po.default=po,ie.exports=po},11814:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")(),v=_(52983);w.object.extend(proto,v),w.exportSymbol("TronWebProto.Account",null,E),w.exportSymbol("TronWebProto.Account.AccountResource",null,E),w.exportSymbol("TronWebProto.Account.Frozen",null,E),w.exportSymbol("TronWebProto.AccountId",null,E),w.exportSymbol("TronWebProto.AccountType",null,E),w.exportSymbol("TronWebProto.DelegatedResource",null,E),w.exportSymbol("TronWebProto.Exchange",null,E),w.exportSymbol("TronWebProto.Key",null,E),w.exportSymbol("TronWebProto.MarketOrderDetail",null,E),w.exportSymbol("TronWebProto.Permission",null,E),w.exportSymbol("TronWebProto.Permission.PermissionType",null,E),w.exportSymbol("TronWebProto.Proposal",null,E),w.exportSymbol("TronWebProto.Proposal.State",null,E),w.exportSymbol("TronWebProto.Transaction",null,E),w.exportSymbol("TronWebProto.Transaction.Contract",null,E),w.exportSymbol("TronWebProto.Transaction.Contract.ContractType",null,E),w.exportSymbol("TronWebProto.Transaction.Result",null,E),w.exportSymbol("TronWebProto.Transaction.Result.code",null,E),w.exportSymbol("TronWebProto.Transaction.Result.contractResult",null,E),w.exportSymbol("TronWebProto.Transaction.raw",null,E),w.exportSymbol("TronWebProto.Vote",null,E),w.exportSymbol("TronWebProto.Votes",null,E),w.exportSymbol("TronWebProto.Witness",null,E),w.exportSymbol("TronWebProto.authority",null,E),TronWebProto.AccountId=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.AccountId,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountId.displayName="TronWebProto.AccountId"),TronWebProto.Vote=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.Vote,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Vote.displayName="TronWebProto.Vote"),TronWebProto.Proposal=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.Proposal.repeatedFields_,null)},w.inherits(TronWebProto.Proposal,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Proposal.displayName="TronWebProto.Proposal"),TronWebProto.Exchange=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.Exchange,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Exchange.displayName="TronWebProto.Exchange"),TronWebProto.Account=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.Account.repeatedFields_,null)},w.inherits(TronWebProto.Account,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Account.displayName="TronWebProto.Account"),TronWebProto.Account.Frozen=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.Account.Frozen,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Account.Frozen.displayName="TronWebProto.Account.Frozen"),TronWebProto.Account.AccountResource=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.Account.AccountResource,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Account.AccountResource.displayName="TronWebProto.Account.AccountResource"),TronWebProto.Key=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.Key,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Key.displayName="TronWebProto.Key"),TronWebProto.DelegatedResource=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.DelegatedResource,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.DelegatedResource.displayName="TronWebProto.DelegatedResource"),TronWebProto.authority=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.authority,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.authority.displayName="TronWebProto.authority"),TronWebProto.Permission=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.Permission.repeatedFields_,null)},w.inherits(TronWebProto.Permission,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Permission.displayName="TronWebProto.Permission"),TronWebProto.Witness=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.Witness,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Witness.displayName="TronWebProto.Witness"),TronWebProto.Votes=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.Votes.repeatedFields_,null)},w.inherits(TronWebProto.Votes,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Votes.displayName="TronWebProto.Votes"),TronWebProto.MarketOrderDetail=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.MarketOrderDetail,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.MarketOrderDetail.displayName="TronWebProto.MarketOrderDetail"),TronWebProto.Transaction=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.Transaction.repeatedFields_,null)},w.inherits(TronWebProto.Transaction,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Transaction.displayName="TronWebProto.Transaction"),TronWebProto.Transaction.Contract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.Transaction.Contract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Transaction.Contract.displayName="TronWebProto.Transaction.Contract"),TronWebProto.Transaction.Result=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.Transaction.Result.repeatedFields_,null)},w.inherits(TronWebProto.Transaction.Result,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Transaction.Result.displayName="TronWebProto.Transaction.Result"),TronWebProto.Transaction.raw=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.Transaction.raw.repeatedFields_,null)},w.inherits(TronWebProto.Transaction.raw,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.Transaction.raw.displayName="TronWebProto.Transaction.raw"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountId.prototype.toObject=function(c){return TronWebProto.AccountId.toObject(c,this)},TronWebProto.AccountId.toObject=function(c,d){var p,m={name:d.getName_asB64(),address:d.getAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountId.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountId;return TronWebProto.AccountId.deserializeBinaryFromReader(p,d)},TronWebProto.AccountId.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setName(m);break;case 2:var m=d.readBytes();c.setAddress(m);break;default:d.skipField();break}}return c},TronWebProto.AccountId.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountId.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountId.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getName_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getAddress_asU8(),p.length>0&&d.writeBytes(2,p)},TronWebProto.AccountId.prototype.getName=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountId.prototype.getName_asB64=function(){return h.Message.bytesAsB64(this.getName())},TronWebProto.AccountId.prototype.getName_asU8=function(){return h.Message.bytesAsU8(this.getName())},TronWebProto.AccountId.prototype.setName=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.AccountId.prototype.getAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.AccountId.prototype.getAddress_asB64=function(){return h.Message.bytesAsB64(this.getAddress())},TronWebProto.AccountId.prototype.getAddress_asU8=function(){return h.Message.bytesAsU8(this.getAddress())},TronWebProto.AccountId.prototype.setAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Vote.prototype.toObject=function(c){return TronWebProto.Vote.toObject(c,this)},TronWebProto.Vote.toObject=function(c,d){var p,m={voteAddress:d.getVoteAddress_asB64(),voteCount:h.Message.getFieldWithDefault(d,2,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Vote.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Vote;return TronWebProto.Vote.deserializeBinaryFromReader(p,d)},TronWebProto.Vote.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setVoteAddress(m);break;case 2:var m=d.readInt64();c.setVoteCount(m);break;default:d.skipField();break}}return c},TronWebProto.Vote.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Vote.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Vote.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getVoteAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getVoteCount(),p!==0&&d.writeInt64(2,p)},TronWebProto.Vote.prototype.getVoteAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.Vote.prototype.getVoteAddress_asB64=function(){return h.Message.bytesAsB64(this.getVoteAddress())},TronWebProto.Vote.prototype.getVoteAddress_asU8=function(){return h.Message.bytesAsU8(this.getVoteAddress())},TronWebProto.Vote.prototype.setVoteAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.Vote.prototype.getVoteCount=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.Vote.prototype.setVoteCount=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.Proposal.repeatedFields_=[6],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Proposal.prototype.toObject=function(c){return TronWebProto.Proposal.toObject(c,this)},TronWebProto.Proposal.toObject=function(c,d){var p,m={proposalId:h.Message.getFieldWithDefault(d,1,0),proposerAddress:d.getProposerAddress_asB64(),parametersMap:(p=d.getParametersMap())?p.toObject(c,void 0):[],expirationTime:h.Message.getFieldWithDefault(d,4,0),createTime:h.Message.getFieldWithDefault(d,5,0),approvalsList:d.getApprovalsList_asB64(),state:h.Message.getFieldWithDefault(d,7,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Proposal.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Proposal;return TronWebProto.Proposal.deserializeBinaryFromReader(p,d)},TronWebProto.Proposal.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setProposalId(m);break;case 2:var m=d.readBytes();c.setProposerAddress(m);break;case 3:var m=c.getParametersMap();d.readMessage(m,function(C,x){h.Map.deserializeBinary(C,x,h.BinaryReader.prototype.readInt64,h.BinaryReader.prototype.readInt64,null,0,0)});break;case 4:var m=d.readInt64();c.setExpirationTime(m);break;case 5:var m=d.readInt64();c.setCreateTime(m);break;case 6:var m=d.readBytes();c.addApprovals(m);break;case 7:var m=d.readEnum();c.setState(m);break;default:d.skipField();break}}return c},TronWebProto.Proposal.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Proposal.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Proposal.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getProposalId(),p!==0&&d.writeInt64(1,p),p=c.getProposerAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getParametersMap(!0),p&&p.getLength()>0&&p.serializeBinary(3,d,h.BinaryWriter.prototype.writeInt64,h.BinaryWriter.prototype.writeInt64),p=c.getExpirationTime(),p!==0&&d.writeInt64(4,p),p=c.getCreateTime(),p!==0&&d.writeInt64(5,p),p=c.getApprovalsList_asU8(),p.length>0&&d.writeRepeatedBytes(6,p),p=c.getState(),p!==0&&d.writeEnum(7,p)},TronWebProto.Proposal.State={PENDING:0,DISAPPROVED:1,APPROVED:2,CANCELED:3},TronWebProto.Proposal.prototype.getProposalId=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.Proposal.prototype.setProposalId=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.Proposal.prototype.getProposerAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.Proposal.prototype.getProposerAddress_asB64=function(){return h.Message.bytesAsB64(this.getProposerAddress())},TronWebProto.Proposal.prototype.getProposerAddress_asU8=function(){return h.Message.bytesAsU8(this.getProposerAddress())},TronWebProto.Proposal.prototype.setProposerAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.Proposal.prototype.getParametersMap=function(c){return h.Message.getMapField(this,3,c,null)},TronWebProto.Proposal.prototype.clearParametersMap=function(){return this.getParametersMap().clear(),this},TronWebProto.Proposal.prototype.getExpirationTime=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.Proposal.prototype.setExpirationTime=function(c){return h.Message.setProto3IntField(this,4,c)},TronWebProto.Proposal.prototype.getCreateTime=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.Proposal.prototype.setCreateTime=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.Proposal.prototype.getApprovalsList=function(){return h.Message.getRepeatedField(this,6)},TronWebProto.Proposal.prototype.getApprovalsList_asB64=function(){return h.Message.bytesListAsB64(this.getApprovalsList())},TronWebProto.Proposal.prototype.getApprovalsList_asU8=function(){return h.Message.bytesListAsU8(this.getApprovalsList())},TronWebProto.Proposal.prototype.setApprovalsList=function(c){return h.Message.setField(this,6,c||[])},TronWebProto.Proposal.prototype.addApprovals=function(c,d){return h.Message.addToRepeatedField(this,6,c,d)},TronWebProto.Proposal.prototype.clearApprovalsList=function(){return this.setApprovalsList([])},TronWebProto.Proposal.prototype.getState=function(){return h.Message.getFieldWithDefault(this,7,0)},TronWebProto.Proposal.prototype.setState=function(c){return h.Message.setProto3EnumField(this,7,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Exchange.prototype.toObject=function(c){return TronWebProto.Exchange.toObject(c,this)},TronWebProto.Exchange.toObject=function(c,d){var p,m={exchangeId:h.Message.getFieldWithDefault(d,1,0),creatorAddress:d.getCreatorAddress_asB64(),createTime:h.Message.getFieldWithDefault(d,3,0),firstTokenId:d.getFirstTokenId_asB64(),firstTokenBalance:h.Message.getFieldWithDefault(d,7,0),secondTokenId:d.getSecondTokenId_asB64(),secondTokenBalance:h.Message.getFieldWithDefault(d,9,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Exchange.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Exchange;return TronWebProto.Exchange.deserializeBinaryFromReader(p,d)},TronWebProto.Exchange.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setExchangeId(m);break;case 2:var m=d.readBytes();c.setCreatorAddress(m);break;case 3:var m=d.readInt64();c.setCreateTime(m);break;case 6:var m=d.readBytes();c.setFirstTokenId(m);break;case 7:var m=d.readInt64();c.setFirstTokenBalance(m);break;case 8:var m=d.readBytes();c.setSecondTokenId(m);break;case 9:var m=d.readInt64();c.setSecondTokenBalance(m);break;default:d.skipField();break}}return c},TronWebProto.Exchange.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Exchange.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Exchange.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getExchangeId(),p!==0&&d.writeInt64(1,p),p=c.getCreatorAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getCreateTime(),p!==0&&d.writeInt64(3,p),p=c.getFirstTokenId_asU8(),p.length>0&&d.writeBytes(6,p),p=c.getFirstTokenBalance(),p!==0&&d.writeInt64(7,p),p=c.getSecondTokenId_asU8(),p.length>0&&d.writeBytes(8,p),p=c.getSecondTokenBalance(),p!==0&&d.writeInt64(9,p)},TronWebProto.Exchange.prototype.getExchangeId=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.Exchange.prototype.setExchangeId=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.Exchange.prototype.getCreatorAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.Exchange.prototype.getCreatorAddress_asB64=function(){return h.Message.bytesAsB64(this.getCreatorAddress())},TronWebProto.Exchange.prototype.getCreatorAddress_asU8=function(){return h.Message.bytesAsU8(this.getCreatorAddress())},TronWebProto.Exchange.prototype.setCreatorAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.Exchange.prototype.getCreateTime=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.Exchange.prototype.setCreateTime=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.Exchange.prototype.getFirstTokenId=function(){return h.Message.getFieldWithDefault(this,6,"")},TronWebProto.Exchange.prototype.getFirstTokenId_asB64=function(){return h.Message.bytesAsB64(this.getFirstTokenId())},TronWebProto.Exchange.prototype.getFirstTokenId_asU8=function(){return h.Message.bytesAsU8(this.getFirstTokenId())},TronWebProto.Exchange.prototype.setFirstTokenId=function(c){return h.Message.setProto3BytesField(this,6,c)},TronWebProto.Exchange.prototype.getFirstTokenBalance=function(){return h.Message.getFieldWithDefault(this,7,0)},TronWebProto.Exchange.prototype.setFirstTokenBalance=function(c){return h.Message.setProto3IntField(this,7,c)},TronWebProto.Exchange.prototype.getSecondTokenId=function(){return h.Message.getFieldWithDefault(this,8,"")},TronWebProto.Exchange.prototype.getSecondTokenId_asB64=function(){return h.Message.bytesAsB64(this.getSecondTokenId())},TronWebProto.Exchange.prototype.getSecondTokenId_asU8=function(){return h.Message.bytesAsU8(this.getSecondTokenId())},TronWebProto.Exchange.prototype.setSecondTokenId=function(c){return h.Message.setProto3BytesField(this,8,c)},TronWebProto.Exchange.prototype.getSecondTokenBalance=function(){return h.Message.getFieldWithDefault(this,9,0)},TronWebProto.Exchange.prototype.setSecondTokenBalance=function(c){return h.Message.setProto3IntField(this,9,c)},TronWebProto.Account.repeatedFields_=[5,7,16,33],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Account.prototype.toObject=function(c){return TronWebProto.Account.toObject(c,this)},TronWebProto.Account.toObject=function(c,d){var p,m={accountName:d.getAccountName_asB64(),type:h.Message.getFieldWithDefault(d,2,0),address:d.getAddress_asB64(),balance:h.Message.getFieldWithDefault(d,4,0),votesList:h.Message.toObjectList(d.getVotesList(),TronWebProto.Vote.toObject,c),assetMap:(p=d.getAssetMap())?p.toObject(c,void 0):[],assetv2Map:(p=d.getAssetv2Map())?p.toObject(c,void 0):[],frozenList:h.Message.toObjectList(d.getFrozenList(),TronWebProto.Account.Frozen.toObject,c),netUsage:h.Message.getFieldWithDefault(d,8,0),acquiredDelegatedFrozenBalanceForBandwidth:h.Message.getFieldWithDefault(d,41,0),delegatedFrozenBalanceForBandwidth:h.Message.getFieldWithDefault(d,42,0),oldTronPower:h.Message.getFieldWithDefault(d,46,0),tronPower:(p=d.getTronPower())&&TronWebProto.Account.Frozen.toObject(c,p),assetOptimized:h.Message.getBooleanFieldWithDefault(d,60,!1),createTime:h.Message.getFieldWithDefault(d,9,0),latestOprationTime:h.Message.getFieldWithDefault(d,10,0),allowance:h.Message.getFieldWithDefault(d,11,0),latestWithdrawTime:h.Message.getFieldWithDefault(d,12,0),code:d.getCode_asB64(),isWitness:h.Message.getBooleanFieldWithDefault(d,14,!1),isCommittee:h.Message.getBooleanFieldWithDefault(d,15,!1),frozenSupplyList:h.Message.toObjectList(d.getFrozenSupplyList(),TronWebProto.Account.Frozen.toObject,c),assetIssuedName:d.getAssetIssuedName_asB64(),assetIssuedId:d.getAssetIssuedId_asB64(),latestAssetOperationTimeMap:(p=d.getLatestAssetOperationTimeMap())?p.toObject(c,void 0):[],latestAssetOperationTimev2Map:(p=d.getLatestAssetOperationTimev2Map())?p.toObject(c,void 0):[],freeNetUsage:h.Message.getFieldWithDefault(d,19,0),freeAssetNetUsageMap:(p=d.getFreeAssetNetUsageMap())?p.toObject(c,void 0):[],freeAssetNetUsagev2Map:(p=d.getFreeAssetNetUsagev2Map())?p.toObject(c,void 0):[],latestConsumeTime:h.Message.getFieldWithDefault(d,21,0),latestConsumeFreeTime:h.Message.getFieldWithDefault(d,22,0),accountId:d.getAccountId_asB64(),accountResource:(p=d.getAccountResource())&&TronWebProto.Account.AccountResource.toObject(c,p),codehash:d.getCodehash_asB64(),ownerPermission:(p=d.getOwnerPermission())&&TronWebProto.Permission.toObject(c,p),witnessPermission:(p=d.getWitnessPermission())&&TronWebProto.Permission.toObject(c,p),activePermissionList:h.Message.toObjectList(d.getActivePermissionList(),TronWebProto.Permission.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Account.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Account;return TronWebProto.Account.deserializeBinaryFromReader(p,d)},TronWebProto.Account.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setAccountName(m);break;case 2:var m=d.readEnum();c.setType(m);break;case 3:var m=d.readBytes();c.setAddress(m);break;case 4:var m=d.readInt64();c.setBalance(m);break;case 5:var m=new TronWebProto.Vote;d.readMessage(m,TronWebProto.Vote.deserializeBinaryFromReader),c.addVotes(m);break;case 6:var m=c.getAssetMap();d.readMessage(m,function(C,x){h.Map.deserializeBinary(C,x,h.BinaryReader.prototype.readString,h.BinaryReader.prototype.readInt64,null,"",0)});break;case 56:var m=c.getAssetv2Map();d.readMessage(m,function(C,x){h.Map.deserializeBinary(C,x,h.BinaryReader.prototype.readString,h.BinaryReader.prototype.readInt64,null,"",0)});break;case 7:var m=new TronWebProto.Account.Frozen;d.readMessage(m,TronWebProto.Account.Frozen.deserializeBinaryFromReader),c.addFrozen(m);break;case 8:var m=d.readInt64();c.setNetUsage(m);break;case 41:var m=d.readInt64();c.setAcquiredDelegatedFrozenBalanceForBandwidth(m);break;case 42:var m=d.readInt64();c.setDelegatedFrozenBalanceForBandwidth(m);break;case 46:var m=d.readInt64();c.setOldTronPower(m);break;case 47:var m=new TronWebProto.Account.Frozen;d.readMessage(m,TronWebProto.Account.Frozen.deserializeBinaryFromReader),c.setTronPower(m);break;case 60:var m=d.readBool();c.setAssetOptimized(m);break;case 9:var m=d.readInt64();c.setCreateTime(m);break;case 10:var m=d.readInt64();c.setLatestOprationTime(m);break;case 11:var m=d.readInt64();c.setAllowance(m);break;case 12:var m=d.readInt64();c.setLatestWithdrawTime(m);break;case 13:var m=d.readBytes();c.setCode(m);break;case 14:var m=d.readBool();c.setIsWitness(m);break;case 15:var m=d.readBool();c.setIsCommittee(m);break;case 16:var m=new TronWebProto.Account.Frozen;d.readMessage(m,TronWebProto.Account.Frozen.deserializeBinaryFromReader),c.addFrozenSupply(m);break;case 17:var m=d.readBytes();c.setAssetIssuedName(m);break;case 57:var m=d.readBytes();c.setAssetIssuedId(m);break;case 18:var m=c.getLatestAssetOperationTimeMap();d.readMessage(m,function(C,x){h.Map.deserializeBinary(C,x,h.BinaryReader.prototype.readString,h.BinaryReader.prototype.readInt64,null,"",0)});break;case 58:var m=c.getLatestAssetOperationTimev2Map();d.readMessage(m,function(C,x){h.Map.deserializeBinary(C,x,h.BinaryReader.prototype.readString,h.BinaryReader.prototype.readInt64,null,"",0)});break;case 19:var m=d.readInt64();c.setFreeNetUsage(m);break;case 20:var m=c.getFreeAssetNetUsageMap();d.readMessage(m,function(C,x){h.Map.deserializeBinary(C,x,h.BinaryReader.prototype.readString,h.BinaryReader.prototype.readInt64,null,"",0)});break;case 59:var m=c.getFreeAssetNetUsagev2Map();d.readMessage(m,function(C,x){h.Map.deserializeBinary(C,x,h.BinaryReader.prototype.readString,h.BinaryReader.prototype.readInt64,null,"",0)});break;case 21:var m=d.readInt64();c.setLatestConsumeTime(m);break;case 22:var m=d.readInt64();c.setLatestConsumeFreeTime(m);break;case 23:var m=d.readBytes();c.setAccountId(m);break;case 26:var m=new TronWebProto.Account.AccountResource;d.readMessage(m,TronWebProto.Account.AccountResource.deserializeBinaryFromReader),c.setAccountResource(m);break;case 30:var m=d.readBytes();c.setCodehash(m);break;case 31:var m=new TronWebProto.Permission;d.readMessage(m,TronWebProto.Permission.deserializeBinaryFromReader),c.setOwnerPermission(m);break;case 32:var m=new TronWebProto.Permission;d.readMessage(m,TronWebProto.Permission.deserializeBinaryFromReader),c.setWitnessPermission(m);break;case 33:var m=new TronWebProto.Permission;d.readMessage(m,TronWebProto.Permission.deserializeBinaryFromReader),c.addActivePermission(m);break;default:d.skipField();break}}return c},TronWebProto.Account.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Account.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Account.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAccountName_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getType(),p!==0&&d.writeEnum(2,p),p=c.getAddress_asU8(),p.length>0&&d.writeBytes(3,p),p=c.getBalance(),p!==0&&d.writeInt64(4,p),p=c.getVotesList(),p.length>0&&d.writeRepeatedMessage(5,p,TronWebProto.Vote.serializeBinaryToWriter),p=c.getAssetMap(!0),p&&p.getLength()>0&&p.serializeBinary(6,d,h.BinaryWriter.prototype.writeString,h.BinaryWriter.prototype.writeInt64),p=c.getAssetv2Map(!0),p&&p.getLength()>0&&p.serializeBinary(56,d,h.BinaryWriter.prototype.writeString,h.BinaryWriter.prototype.writeInt64),p=c.getFrozenList(),p.length>0&&d.writeRepeatedMessage(7,p,TronWebProto.Account.Frozen.serializeBinaryToWriter),p=c.getNetUsage(),p!==0&&d.writeInt64(8,p),p=c.getAcquiredDelegatedFrozenBalanceForBandwidth(),p!==0&&d.writeInt64(41,p),p=c.getDelegatedFrozenBalanceForBandwidth(),p!==0&&d.writeInt64(42,p),p=c.getOldTronPower(),p!==0&&d.writeInt64(46,p),p=c.getTronPower(),p!=null&&d.writeMessage(47,p,TronWebProto.Account.Frozen.serializeBinaryToWriter),p=c.getAssetOptimized(),p&&d.writeBool(60,p),p=c.getCreateTime(),p!==0&&d.writeInt64(9,p),p=c.getLatestOprationTime(),p!==0&&d.writeInt64(10,p),p=c.getAllowance(),p!==0&&d.writeInt64(11,p),p=c.getLatestWithdrawTime(),p!==0&&d.writeInt64(12,p),p=c.getCode_asU8(),p.length>0&&d.writeBytes(13,p),p=c.getIsWitness(),p&&d.writeBool(14,p),p=c.getIsCommittee(),p&&d.writeBool(15,p),p=c.getFrozenSupplyList(),p.length>0&&d.writeRepeatedMessage(16,p,TronWebProto.Account.Frozen.serializeBinaryToWriter),p=c.getAssetIssuedName_asU8(),p.length>0&&d.writeBytes(17,p),p=c.getAssetIssuedId_asU8(),p.length>0&&d.writeBytes(57,p),p=c.getLatestAssetOperationTimeMap(!0),p&&p.getLength()>0&&p.serializeBinary(18,d,h.BinaryWriter.prototype.writeString,h.BinaryWriter.prototype.writeInt64),p=c.getLatestAssetOperationTimev2Map(!0),p&&p.getLength()>0&&p.serializeBinary(58,d,h.BinaryWriter.prototype.writeString,h.BinaryWriter.prototype.writeInt64),p=c.getFreeNetUsage(),p!==0&&d.writeInt64(19,p),p=c.getFreeAssetNetUsageMap(!0),p&&p.getLength()>0&&p.serializeBinary(20,d,h.BinaryWriter.prototype.writeString,h.BinaryWriter.prototype.writeInt64),p=c.getFreeAssetNetUsagev2Map(!0),p&&p.getLength()>0&&p.serializeBinary(59,d,h.BinaryWriter.prototype.writeString,h.BinaryWriter.prototype.writeInt64),p=c.getLatestConsumeTime(),p!==0&&d.writeInt64(21,p),p=c.getLatestConsumeFreeTime(),p!==0&&d.writeInt64(22,p),p=c.getAccountId_asU8(),p.length>0&&d.writeBytes(23,p),p=c.getAccountResource(),p!=null&&d.writeMessage(26,p,TronWebProto.Account.AccountResource.serializeBinaryToWriter),p=c.getCodehash_asU8(),p.length>0&&d.writeBytes(30,p),p=c.getOwnerPermission(),p!=null&&d.writeMessage(31,p,TronWebProto.Permission.serializeBinaryToWriter),p=c.getWitnessPermission(),p!=null&&d.writeMessage(32,p,TronWebProto.Permission.serializeBinaryToWriter),p=c.getActivePermissionList(),p.length>0&&d.writeRepeatedMessage(33,p,TronWebProto.Permission.serializeBinaryToWriter)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Account.Frozen.prototype.toObject=function(c){return TronWebProto.Account.Frozen.toObject(c,this)},TronWebProto.Account.Frozen.toObject=function(c,d){var p,m={frozenBalance:h.Message.getFieldWithDefault(d,1,0),expireTime:h.Message.getFieldWithDefault(d,2,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Account.Frozen.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Account.Frozen;return TronWebProto.Account.Frozen.deserializeBinaryFromReader(p,d)},TronWebProto.Account.Frozen.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setFrozenBalance(m);break;case 2:var m=d.readInt64();c.setExpireTime(m);break;default:d.skipField();break}}return c},TronWebProto.Account.Frozen.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Account.Frozen.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Account.Frozen.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getFrozenBalance(),p!==0&&d.writeInt64(1,p),p=c.getExpireTime(),p!==0&&d.writeInt64(2,p)},TronWebProto.Account.Frozen.prototype.getFrozenBalance=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.Account.Frozen.prototype.setFrozenBalance=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.Account.Frozen.prototype.getExpireTime=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.Account.Frozen.prototype.setExpireTime=function(c){return h.Message.setProto3IntField(this,2,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Account.AccountResource.prototype.toObject=function(c){return TronWebProto.Account.AccountResource.toObject(c,this)},TronWebProto.Account.AccountResource.toObject=function(c,d){var p,m={energyUsage:h.Message.getFieldWithDefault(d,1,0),frozenBalanceForEnergy:(p=d.getFrozenBalanceForEnergy())&&TronWebProto.Account.Frozen.toObject(c,p),latestConsumeTimeForEnergy:h.Message.getFieldWithDefault(d,3,0),acquiredDelegatedFrozenBalanceForEnergy:h.Message.getFieldWithDefault(d,4,0),delegatedFrozenBalanceForEnergy:h.Message.getFieldWithDefault(d,5,0),storageLimit:h.Message.getFieldWithDefault(d,6,0),storageUsage:h.Message.getFieldWithDefault(d,7,0),latestExchangeStorageTime:h.Message.getFieldWithDefault(d,8,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Account.AccountResource.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Account.AccountResource;return TronWebProto.Account.AccountResource.deserializeBinaryFromReader(p,d)},TronWebProto.Account.AccountResource.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setEnergyUsage(m);break;case 2:var m=new TronWebProto.Account.Frozen;d.readMessage(m,TronWebProto.Account.Frozen.deserializeBinaryFromReader),c.setFrozenBalanceForEnergy(m);break;case 3:var m=d.readInt64();c.setLatestConsumeTimeForEnergy(m);break;case 4:var m=d.readInt64();c.setAcquiredDelegatedFrozenBalanceForEnergy(m);break;case 5:var m=d.readInt64();c.setDelegatedFrozenBalanceForEnergy(m);break;case 6:var m=d.readInt64();c.setStorageLimit(m);break;case 7:var m=d.readInt64();c.setStorageUsage(m);break;case 8:var m=d.readInt64();c.setLatestExchangeStorageTime(m);break;default:d.skipField();break}}return c},TronWebProto.Account.AccountResource.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Account.AccountResource.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Account.AccountResource.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getEnergyUsage(),p!==0&&d.writeInt64(1,p),p=c.getFrozenBalanceForEnergy(),p!=null&&d.writeMessage(2,p,TronWebProto.Account.Frozen.serializeBinaryToWriter),p=c.getLatestConsumeTimeForEnergy(),p!==0&&d.writeInt64(3,p),p=c.getAcquiredDelegatedFrozenBalanceForEnergy(),p!==0&&d.writeInt64(4,p),p=c.getDelegatedFrozenBalanceForEnergy(),p!==0&&d.writeInt64(5,p),p=c.getStorageLimit(),p!==0&&d.writeInt64(6,p),p=c.getStorageUsage(),p!==0&&d.writeInt64(7,p),p=c.getLatestExchangeStorageTime(),p!==0&&d.writeInt64(8,p)},TronWebProto.Account.AccountResource.prototype.getEnergyUsage=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.Account.AccountResource.prototype.setEnergyUsage=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.Account.AccountResource.prototype.getFrozenBalanceForEnergy=function(){return h.Message.getWrapperField(this,TronWebProto.Account.Frozen,2)},TronWebProto.Account.AccountResource.prototype.setFrozenBalanceForEnergy=function(c){return h.Message.setWrapperField(this,2,c)},TronWebProto.Account.AccountResource.prototype.clearFrozenBalanceForEnergy=function(){return this.setFrozenBalanceForEnergy(void 0)},TronWebProto.Account.AccountResource.prototype.hasFrozenBalanceForEnergy=function(){return h.Message.getField(this,2)!=null},TronWebProto.Account.AccountResource.prototype.getLatestConsumeTimeForEnergy=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.Account.AccountResource.prototype.setLatestConsumeTimeForEnergy=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.Account.AccountResource.prototype.getAcquiredDelegatedFrozenBalanceForEnergy=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.Account.AccountResource.prototype.setAcquiredDelegatedFrozenBalanceForEnergy=function(c){return h.Message.setProto3IntField(this,4,c)},TronWebProto.Account.AccountResource.prototype.getDelegatedFrozenBalanceForEnergy=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.Account.AccountResource.prototype.setDelegatedFrozenBalanceForEnergy=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.Account.AccountResource.prototype.getStorageLimit=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.Account.AccountResource.prototype.setStorageLimit=function(c){return h.Message.setProto3IntField(this,6,c)},TronWebProto.Account.AccountResource.prototype.getStorageUsage=function(){return h.Message.getFieldWithDefault(this,7,0)},TronWebProto.Account.AccountResource.prototype.setStorageUsage=function(c){return h.Message.setProto3IntField(this,7,c)},TronWebProto.Account.AccountResource.prototype.getLatestExchangeStorageTime=function(){return h.Message.getFieldWithDefault(this,8,0)},TronWebProto.Account.AccountResource.prototype.setLatestExchangeStorageTime=function(c){return h.Message.setProto3IntField(this,8,c)},TronWebProto.Account.prototype.getAccountName=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.Account.prototype.getAccountName_asB64=function(){return h.Message.bytesAsB64(this.getAccountName())},TronWebProto.Account.prototype.getAccountName_asU8=function(){return h.Message.bytesAsU8(this.getAccountName())},TronWebProto.Account.prototype.setAccountName=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.Account.prototype.getType=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.Account.prototype.setType=function(c){return h.Message.setProto3EnumField(this,2,c)},TronWebProto.Account.prototype.getAddress=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.Account.prototype.getAddress_asB64=function(){return h.Message.bytesAsB64(this.getAddress())},TronWebProto.Account.prototype.getAddress_asU8=function(){return h.Message.bytesAsU8(this.getAddress())},TronWebProto.Account.prototype.setAddress=function(c){return h.Message.setProto3BytesField(this,3,c)},TronWebProto.Account.prototype.getBalance=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.Account.prototype.setBalance=function(c){return h.Message.setProto3IntField(this,4,c)},TronWebProto.Account.prototype.getVotesList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Vote,5)},TronWebProto.Account.prototype.setVotesList=function(c){return h.Message.setRepeatedWrapperField(this,5,c)},TronWebProto.Account.prototype.addVotes=function(c,d){return h.Message.addToRepeatedWrapperField(this,5,c,TronWebProto.Vote,d)},TronWebProto.Account.prototype.clearVotesList=function(){return this.setVotesList([])},TronWebProto.Account.prototype.getAssetMap=function(c){return h.Message.getMapField(this,6,c,null)},TronWebProto.Account.prototype.clearAssetMap=function(){return this.getAssetMap().clear(),this},TronWebProto.Account.prototype.getAssetv2Map=function(c){return h.Message.getMapField(this,56,c,null)},TronWebProto.Account.prototype.clearAssetv2Map=function(){return this.getAssetv2Map().clear(),this},TronWebProto.Account.prototype.getFrozenList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Account.Frozen,7)},TronWebProto.Account.prototype.setFrozenList=function(c){return h.Message.setRepeatedWrapperField(this,7,c)},TronWebProto.Account.prototype.addFrozen=function(c,d){return h.Message.addToRepeatedWrapperField(this,7,c,TronWebProto.Account.Frozen,d)},TronWebProto.Account.prototype.clearFrozenList=function(){return this.setFrozenList([])},TronWebProto.Account.prototype.getNetUsage=function(){return h.Message.getFieldWithDefault(this,8,0)},TronWebProto.Account.prototype.setNetUsage=function(c){return h.Message.setProto3IntField(this,8,c)},TronWebProto.Account.prototype.getAcquiredDelegatedFrozenBalanceForBandwidth=function(){return h.Message.getFieldWithDefault(this,41,0)},TronWebProto.Account.prototype.setAcquiredDelegatedFrozenBalanceForBandwidth=function(c){return h.Message.setProto3IntField(this,41,c)},TronWebProto.Account.prototype.getDelegatedFrozenBalanceForBandwidth=function(){return h.Message.getFieldWithDefault(this,42,0)},TronWebProto.Account.prototype.setDelegatedFrozenBalanceForBandwidth=function(c){return h.Message.setProto3IntField(this,42,c)},TronWebProto.Account.prototype.getOldTronPower=function(){return h.Message.getFieldWithDefault(this,46,0)},TronWebProto.Account.prototype.setOldTronPower=function(c){return h.Message.setProto3IntField(this,46,c)},TronWebProto.Account.prototype.getTronPower=function(){return h.Message.getWrapperField(this,TronWebProto.Account.Frozen,47)},TronWebProto.Account.prototype.setTronPower=function(c){return h.Message.setWrapperField(this,47,c)},TronWebProto.Account.prototype.clearTronPower=function(){return this.setTronPower(void 0)},TronWebProto.Account.prototype.hasTronPower=function(){return h.Message.getField(this,47)!=null},TronWebProto.Account.prototype.getAssetOptimized=function(){return h.Message.getBooleanFieldWithDefault(this,60,!1)},TronWebProto.Account.prototype.setAssetOptimized=function(c){return h.Message.setProto3BooleanField(this,60,c)},TronWebProto.Account.prototype.getCreateTime=function(){return h.Message.getFieldWithDefault(this,9,0)},TronWebProto.Account.prototype.setCreateTime=function(c){return h.Message.setProto3IntField(this,9,c)},TronWebProto.Account.prototype.getLatestOprationTime=function(){return h.Message.getFieldWithDefault(this,10,0)},TronWebProto.Account.prototype.setLatestOprationTime=function(c){return h.Message.setProto3IntField(this,10,c)},TronWebProto.Account.prototype.getAllowance=function(){return h.Message.getFieldWithDefault(this,11,0)},TronWebProto.Account.prototype.setAllowance=function(c){return h.Message.setProto3IntField(this,11,c)},TronWebProto.Account.prototype.getLatestWithdrawTime=function(){return h.Message.getFieldWithDefault(this,12,0)},TronWebProto.Account.prototype.setLatestWithdrawTime=function(c){return h.Message.setProto3IntField(this,12,c)},TronWebProto.Account.prototype.getCode=function(){return h.Message.getFieldWithDefault(this,13,"")},TronWebProto.Account.prototype.getCode_asB64=function(){return h.Message.bytesAsB64(this.getCode())},TronWebProto.Account.prototype.getCode_asU8=function(){return h.Message.bytesAsU8(this.getCode())},TronWebProto.Account.prototype.setCode=function(c){return h.Message.setProto3BytesField(this,13,c)},TronWebProto.Account.prototype.getIsWitness=function(){return h.Message.getBooleanFieldWithDefault(this,14,!1)},TronWebProto.Account.prototype.setIsWitness=function(c){return h.Message.setProto3BooleanField(this,14,c)},TronWebProto.Account.prototype.getIsCommittee=function(){return h.Message.getBooleanFieldWithDefault(this,15,!1)},TronWebProto.Account.prototype.setIsCommittee=function(c){return h.Message.setProto3BooleanField(this,15,c)},TronWebProto.Account.prototype.getFrozenSupplyList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Account.Frozen,16)},TronWebProto.Account.prototype.setFrozenSupplyList=function(c){return h.Message.setRepeatedWrapperField(this,16,c)},TronWebProto.Account.prototype.addFrozenSupply=function(c,d){return h.Message.addToRepeatedWrapperField(this,16,c,TronWebProto.Account.Frozen,d)},TronWebProto.Account.prototype.clearFrozenSupplyList=function(){return this.setFrozenSupplyList([])},TronWebProto.Account.prototype.getAssetIssuedName=function(){return h.Message.getFieldWithDefault(this,17,"")},TronWebProto.Account.prototype.getAssetIssuedName_asB64=function(){return h.Message.bytesAsB64(this.getAssetIssuedName())},TronWebProto.Account.prototype.getAssetIssuedName_asU8=function(){return h.Message.bytesAsU8(this.getAssetIssuedName())},TronWebProto.Account.prototype.setAssetIssuedName=function(c){return h.Message.setProto3BytesField(this,17,c)},TronWebProto.Account.prototype.getAssetIssuedId=function(){return h.Message.getFieldWithDefault(this,57,"")},TronWebProto.Account.prototype.getAssetIssuedId_asB64=function(){return h.Message.bytesAsB64(this.getAssetIssuedId())},TronWebProto.Account.prototype.getAssetIssuedId_asU8=function(){return h.Message.bytesAsU8(this.getAssetIssuedId())},TronWebProto.Account.prototype.setAssetIssuedId=function(c){return h.Message.setProto3BytesField(this,57,c)},TronWebProto.Account.prototype.getLatestAssetOperationTimeMap=function(c){return h.Message.getMapField(this,18,c,null)},TronWebProto.Account.prototype.clearLatestAssetOperationTimeMap=function(){return this.getLatestAssetOperationTimeMap().clear(),this},TronWebProto.Account.prototype.getLatestAssetOperationTimev2Map=function(c){return h.Message.getMapField(this,58,c,null)},TronWebProto.Account.prototype.clearLatestAssetOperationTimev2Map=function(){return this.getLatestAssetOperationTimev2Map().clear(),this},TronWebProto.Account.prototype.getFreeNetUsage=function(){return h.Message.getFieldWithDefault(this,19,0)},TronWebProto.Account.prototype.setFreeNetUsage=function(c){return h.Message.setProto3IntField(this,19,c)},TronWebProto.Account.prototype.getFreeAssetNetUsageMap=function(c){return h.Message.getMapField(this,20,c,null)},TronWebProto.Account.prototype.clearFreeAssetNetUsageMap=function(){return this.getFreeAssetNetUsageMap().clear(),this},TronWebProto.Account.prototype.getFreeAssetNetUsagev2Map=function(c){return h.Message.getMapField(this,59,c,null)},TronWebProto.Account.prototype.clearFreeAssetNetUsagev2Map=function(){return this.getFreeAssetNetUsagev2Map().clear(),this},TronWebProto.Account.prototype.getLatestConsumeTime=function(){return h.Message.getFieldWithDefault(this,21,0)},TronWebProto.Account.prototype.setLatestConsumeTime=function(c){return h.Message.setProto3IntField(this,21,c)},TronWebProto.Account.prototype.getLatestConsumeFreeTime=function(){return h.Message.getFieldWithDefault(this,22,0)},TronWebProto.Account.prototype.setLatestConsumeFreeTime=function(c){return h.Message.setProto3IntField(this,22,c)},TronWebProto.Account.prototype.getAccountId=function(){return h.Message.getFieldWithDefault(this,23,"")},TronWebProto.Account.prototype.getAccountId_asB64=function(){return h.Message.bytesAsB64(this.getAccountId())},TronWebProto.Account.prototype.getAccountId_asU8=function(){return h.Message.bytesAsU8(this.getAccountId())},TronWebProto.Account.prototype.setAccountId=function(c){return h.Message.setProto3BytesField(this,23,c)},TronWebProto.Account.prototype.getAccountResource=function(){return h.Message.getWrapperField(this,TronWebProto.Account.AccountResource,26)},TronWebProto.Account.prototype.setAccountResource=function(c){return h.Message.setWrapperField(this,26,c)},TronWebProto.Account.prototype.clearAccountResource=function(){return this.setAccountResource(void 0)},TronWebProto.Account.prototype.hasAccountResource=function(){return h.Message.getField(this,26)!=null},TronWebProto.Account.prototype.getCodehash=function(){return h.Message.getFieldWithDefault(this,30,"")},TronWebProto.Account.prototype.getCodehash_asB64=function(){return h.Message.bytesAsB64(this.getCodehash())},TronWebProto.Account.prototype.getCodehash_asU8=function(){return h.Message.bytesAsU8(this.getCodehash())},TronWebProto.Account.prototype.setCodehash=function(c){return h.Message.setProto3BytesField(this,30,c)},TronWebProto.Account.prototype.getOwnerPermission=function(){return h.Message.getWrapperField(this,TronWebProto.Permission,31)},TronWebProto.Account.prototype.setOwnerPermission=function(c){return h.Message.setWrapperField(this,31,c)},TronWebProto.Account.prototype.clearOwnerPermission=function(){return this.setOwnerPermission(void 0)},TronWebProto.Account.prototype.hasOwnerPermission=function(){return h.Message.getField(this,31)!=null},TronWebProto.Account.prototype.getWitnessPermission=function(){return h.Message.getWrapperField(this,TronWebProto.Permission,32)},TronWebProto.Account.prototype.setWitnessPermission=function(c){return h.Message.setWrapperField(this,32,c)},TronWebProto.Account.prototype.clearWitnessPermission=function(){return this.setWitnessPermission(void 0)},TronWebProto.Account.prototype.hasWitnessPermission=function(){return h.Message.getField(this,32)!=null},TronWebProto.Account.prototype.getActivePermissionList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Permission,33)},TronWebProto.Account.prototype.setActivePermissionList=function(c){return h.Message.setRepeatedWrapperField(this,33,c)},TronWebProto.Account.prototype.addActivePermission=function(c,d){return h.Message.addToRepeatedWrapperField(this,33,c,TronWebProto.Permission,d)},TronWebProto.Account.prototype.clearActivePermissionList=function(){return this.setActivePermissionList([])},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Key.prototype.toObject=function(c){return TronWebProto.Key.toObject(c,this)},TronWebProto.Key.toObject=function(c,d){var p,m={address:d.getAddress_asB64(),weight:h.Message.getFieldWithDefault(d,2,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Key.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Key;return TronWebProto.Key.deserializeBinaryFromReader(p,d)},TronWebProto.Key.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setAddress(m);break;case 2:var m=d.readInt64();c.setWeight(m);break;default:d.skipField();break}}return c},TronWebProto.Key.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Key.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Key.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getWeight(),p!==0&&d.writeInt64(2,p)},TronWebProto.Key.prototype.getAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.Key.prototype.getAddress_asB64=function(){return h.Message.bytesAsB64(this.getAddress())},TronWebProto.Key.prototype.getAddress_asU8=function(){return h.Message.bytesAsU8(this.getAddress())},TronWebProto.Key.prototype.setAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.Key.prototype.getWeight=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.Key.prototype.setWeight=function(c){return h.Message.setProto3IntField(this,2,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.DelegatedResource.prototype.toObject=function(c){return TronWebProto.DelegatedResource.toObject(c,this)},TronWebProto.DelegatedResource.toObject=function(c,d){var p,m={from:d.getFrom_asB64(),to:d.getTo_asB64(),frozenBalanceForBandwidth:h.Message.getFieldWithDefault(d,3,0),frozenBalanceForEnergy:h.Message.getFieldWithDefault(d,4,0),expireTimeForBandwidth:h.Message.getFieldWithDefault(d,5,0),expireTimeForEnergy:h.Message.getFieldWithDefault(d,6,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.DelegatedResource.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.DelegatedResource;return TronWebProto.DelegatedResource.deserializeBinaryFromReader(p,d)},TronWebProto.DelegatedResource.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setFrom(m);break;case 2:var m=d.readBytes();c.setTo(m);break;case 3:var m=d.readInt64();c.setFrozenBalanceForBandwidth(m);break;case 4:var m=d.readInt64();c.setFrozenBalanceForEnergy(m);break;case 5:var m=d.readInt64();c.setExpireTimeForBandwidth(m);break;case 6:var m=d.readInt64();c.setExpireTimeForEnergy(m);break;default:d.skipField();break}}return c},TronWebProto.DelegatedResource.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.DelegatedResource.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.DelegatedResource.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getFrom_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getTo_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getFrozenBalanceForBandwidth(),p!==0&&d.writeInt64(3,p),p=c.getFrozenBalanceForEnergy(),p!==0&&d.writeInt64(4,p),p=c.getExpireTimeForBandwidth(),p!==0&&d.writeInt64(5,p),p=c.getExpireTimeForEnergy(),p!==0&&d.writeInt64(6,p)},TronWebProto.DelegatedResource.prototype.getFrom=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.DelegatedResource.prototype.getFrom_asB64=function(){return h.Message.bytesAsB64(this.getFrom())},TronWebProto.DelegatedResource.prototype.getFrom_asU8=function(){return h.Message.bytesAsU8(this.getFrom())},TronWebProto.DelegatedResource.prototype.setFrom=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.DelegatedResource.prototype.getTo=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.DelegatedResource.prototype.getTo_asB64=function(){return h.Message.bytesAsB64(this.getTo())},TronWebProto.DelegatedResource.prototype.getTo_asU8=function(){return h.Message.bytesAsU8(this.getTo())},TronWebProto.DelegatedResource.prototype.setTo=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.DelegatedResource.prototype.getFrozenBalanceForBandwidth=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.DelegatedResource.prototype.setFrozenBalanceForBandwidth=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.DelegatedResource.prototype.getFrozenBalanceForEnergy=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.DelegatedResource.prototype.setFrozenBalanceForEnergy=function(c){return h.Message.setProto3IntField(this,4,c)},TronWebProto.DelegatedResource.prototype.getExpireTimeForBandwidth=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.DelegatedResource.prototype.setExpireTimeForBandwidth=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.DelegatedResource.prototype.getExpireTimeForEnergy=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.DelegatedResource.prototype.setExpireTimeForEnergy=function(c){return h.Message.setProto3IntField(this,6,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.authority.prototype.toObject=function(c){return TronWebProto.authority.toObject(c,this)},TronWebProto.authority.toObject=function(c,d){var p,m={account:(p=d.getAccount())&&TronWebProto.AccountId.toObject(c,p),permissionName:d.getPermissionName_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.authority.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.authority;return TronWebProto.authority.deserializeBinaryFromReader(p,d)},TronWebProto.authority.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=new TronWebProto.AccountId;d.readMessage(m,TronWebProto.AccountId.deserializeBinaryFromReader),c.setAccount(m);break;case 2:var m=d.readBytes();c.setPermissionName(m);break;default:d.skipField();break}}return c},TronWebProto.authority.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.authority.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.authority.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAccount(),p!=null&&d.writeMessage(1,p,TronWebProto.AccountId.serializeBinaryToWriter),p=c.getPermissionName_asU8(),p.length>0&&d.writeBytes(2,p)},TronWebProto.authority.prototype.getAccount=function(){return h.Message.getWrapperField(this,TronWebProto.AccountId,1)},TronWebProto.authority.prototype.setAccount=function(c){return h.Message.setWrapperField(this,1,c)},TronWebProto.authority.prototype.clearAccount=function(){return this.setAccount(void 0)},TronWebProto.authority.prototype.hasAccount=function(){return h.Message.getField(this,1)!=null},TronWebProto.authority.prototype.getPermissionName=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.authority.prototype.getPermissionName_asB64=function(){return h.Message.bytesAsB64(this.getPermissionName())},TronWebProto.authority.prototype.getPermissionName_asU8=function(){return h.Message.bytesAsU8(this.getPermissionName())},TronWebProto.authority.prototype.setPermissionName=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.Permission.repeatedFields_=[7],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Permission.prototype.toObject=function(c){return TronWebProto.Permission.toObject(c,this)},TronWebProto.Permission.toObject=function(c,d){var p,m={type:h.Message.getFieldWithDefault(d,1,0),id:h.Message.getFieldWithDefault(d,2,0),permissionName:h.Message.getFieldWithDefault(d,3,""),threshold:h.Message.getFieldWithDefault(d,4,0),parentId:h.Message.getFieldWithDefault(d,5,0),operations:d.getOperations_asB64(),keysList:h.Message.toObjectList(d.getKeysList(),TronWebProto.Key.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Permission.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Permission;return TronWebProto.Permission.deserializeBinaryFromReader(p,d)},TronWebProto.Permission.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readEnum();c.setType(m);break;case 2:var m=d.readInt32();c.setId(m);break;case 3:var m=d.readString();c.setPermissionName(m);break;case 4:var m=d.readInt64();c.setThreshold(m);break;case 5:var m=d.readInt32();c.setParentId(m);break;case 6:var m=d.readBytes();c.setOperations(m);break;case 7:var m=new TronWebProto.Key;d.readMessage(m,TronWebProto.Key.deserializeBinaryFromReader),c.addKeys(m);break;default:d.skipField();break}}return c},TronWebProto.Permission.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Permission.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Permission.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getType(),p!==0&&d.writeEnum(1,p),p=c.getId(),p!==0&&d.writeInt32(2,p),p=c.getPermissionName(),p.length>0&&d.writeString(3,p),p=c.getThreshold(),p!==0&&d.writeInt64(4,p),p=c.getParentId(),p!==0&&d.writeInt32(5,p),p=c.getOperations_asU8(),p.length>0&&d.writeBytes(6,p),p=c.getKeysList(),p.length>0&&d.writeRepeatedMessage(7,p,TronWebProto.Key.serializeBinaryToWriter)},TronWebProto.Permission.PermissionType={OWNER:0,WITNESS:1,ACTIVE:2},TronWebProto.Permission.prototype.getType=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.Permission.prototype.setType=function(c){return h.Message.setProto3EnumField(this,1,c)},TronWebProto.Permission.prototype.getId=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.Permission.prototype.setId=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.Permission.prototype.getPermissionName=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.Permission.prototype.setPermissionName=function(c){return h.Message.setProto3StringField(this,3,c)},TronWebProto.Permission.prototype.getThreshold=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.Permission.prototype.setThreshold=function(c){return h.Message.setProto3IntField(this,4,c)},TronWebProto.Permission.prototype.getParentId=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.Permission.prototype.setParentId=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.Permission.prototype.getOperations=function(){return h.Message.getFieldWithDefault(this,6,"")},TronWebProto.Permission.prototype.getOperations_asB64=function(){return h.Message.bytesAsB64(this.getOperations())},TronWebProto.Permission.prototype.getOperations_asU8=function(){return h.Message.bytesAsU8(this.getOperations())},TronWebProto.Permission.prototype.setOperations=function(c){return h.Message.setProto3BytesField(this,6,c)},TronWebProto.Permission.prototype.getKeysList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Key,7)},TronWebProto.Permission.prototype.setKeysList=function(c){return h.Message.setRepeatedWrapperField(this,7,c)},TronWebProto.Permission.prototype.addKeys=function(c,d){return h.Message.addToRepeatedWrapperField(this,7,c,TronWebProto.Key,d)},TronWebProto.Permission.prototype.clearKeysList=function(){return this.setKeysList([])},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Witness.prototype.toObject=function(c){return TronWebProto.Witness.toObject(c,this)},TronWebProto.Witness.toObject=function(c,d){var p,m={address:d.getAddress_asB64(),votecount:h.Message.getFieldWithDefault(d,2,0),pubkey:d.getPubkey_asB64(),url:h.Message.getFieldWithDefault(d,4,""),totalproduced:h.Message.getFieldWithDefault(d,5,0),totalmissed:h.Message.getFieldWithDefault(d,6,0),latestblocknum:h.Message.getFieldWithDefault(d,7,0),latestslotnum:h.Message.getFieldWithDefault(d,8,0),isjobs:h.Message.getBooleanFieldWithDefault(d,9,!1)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Witness.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Witness;return TronWebProto.Witness.deserializeBinaryFromReader(p,d)},TronWebProto.Witness.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setAddress(m);break;case 2:var m=d.readInt64();c.setVotecount(m);break;case 3:var m=d.readBytes();c.setPubkey(m);break;case 4:var m=d.readString();c.setUrl(m);break;case 5:var m=d.readInt64();c.setTotalproduced(m);break;case 6:var m=d.readInt64();c.setTotalmissed(m);break;case 7:var m=d.readInt64();c.setLatestblocknum(m);break;case 8:var m=d.readInt64();c.setLatestslotnum(m);break;case 9:var m=d.readBool();c.setIsjobs(m);break;default:d.skipField();break}}return c},TronWebProto.Witness.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Witness.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Witness.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getVotecount(),p!==0&&d.writeInt64(2,p),p=c.getPubkey_asU8(),p.length>0&&d.writeBytes(3,p),p=c.getUrl(),p.length>0&&d.writeString(4,p),p=c.getTotalproduced(),p!==0&&d.writeInt64(5,p),p=c.getTotalmissed(),p!==0&&d.writeInt64(6,p),p=c.getLatestblocknum(),p!==0&&d.writeInt64(7,p),p=c.getLatestslotnum(),p!==0&&d.writeInt64(8,p),p=c.getIsjobs(),p&&d.writeBool(9,p)},TronWebProto.Witness.prototype.getAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.Witness.prototype.getAddress_asB64=function(){return h.Message.bytesAsB64(this.getAddress())},TronWebProto.Witness.prototype.getAddress_asU8=function(){return h.Message.bytesAsU8(this.getAddress())},TronWebProto.Witness.prototype.setAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.Witness.prototype.getVotecount=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.Witness.prototype.setVotecount=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.Witness.prototype.getPubkey=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.Witness.prototype.getPubkey_asB64=function(){return h.Message.bytesAsB64(this.getPubkey())},TronWebProto.Witness.prototype.getPubkey_asU8=function(){return h.Message.bytesAsU8(this.getPubkey())},TronWebProto.Witness.prototype.setPubkey=function(c){return h.Message.setProto3BytesField(this,3,c)},TronWebProto.Witness.prototype.getUrl=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.Witness.prototype.setUrl=function(c){return h.Message.setProto3StringField(this,4,c)},TronWebProto.Witness.prototype.getTotalproduced=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.Witness.prototype.setTotalproduced=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.Witness.prototype.getTotalmissed=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.Witness.prototype.setTotalmissed=function(c){return h.Message.setProto3IntField(this,6,c)},TronWebProto.Witness.prototype.getLatestblocknum=function(){return h.Message.getFieldWithDefault(this,7,0)},TronWebProto.Witness.prototype.setLatestblocknum=function(c){return h.Message.setProto3IntField(this,7,c)},TronWebProto.Witness.prototype.getLatestslotnum=function(){return h.Message.getFieldWithDefault(this,8,0)},TronWebProto.Witness.prototype.setLatestslotnum=function(c){return h.Message.setProto3IntField(this,8,c)},TronWebProto.Witness.prototype.getIsjobs=function(){return h.Message.getBooleanFieldWithDefault(this,9,!1)},TronWebProto.Witness.prototype.setIsjobs=function(c){return h.Message.setProto3BooleanField(this,9,c)},TronWebProto.Votes.repeatedFields_=[2,3],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Votes.prototype.toObject=function(c){return TronWebProto.Votes.toObject(c,this)},TronWebProto.Votes.toObject=function(c,d){var p,m={address:d.getAddress_asB64(),oldVotesList:h.Message.toObjectList(d.getOldVotesList(),TronWebProto.Vote.toObject,c),newVotesList:h.Message.toObjectList(d.getNewVotesList(),TronWebProto.Vote.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Votes.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Votes;return TronWebProto.Votes.deserializeBinaryFromReader(p,d)},TronWebProto.Votes.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setAddress(m);break;case 2:var m=new TronWebProto.Vote;d.readMessage(m,TronWebProto.Vote.deserializeBinaryFromReader),c.addOldVotes(m);break;case 3:var m=new TronWebProto.Vote;d.readMessage(m,TronWebProto.Vote.deserializeBinaryFromReader),c.addNewVotes(m);break;default:d.skipField();break}}return c},TronWebProto.Votes.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Votes.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Votes.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getOldVotesList(),p.length>0&&d.writeRepeatedMessage(2,p,TronWebProto.Vote.serializeBinaryToWriter),p=c.getNewVotesList(),p.length>0&&d.writeRepeatedMessage(3,p,TronWebProto.Vote.serializeBinaryToWriter)},TronWebProto.Votes.prototype.getAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.Votes.prototype.getAddress_asB64=function(){return h.Message.bytesAsB64(this.getAddress())},TronWebProto.Votes.prototype.getAddress_asU8=function(){return h.Message.bytesAsU8(this.getAddress())},TronWebProto.Votes.prototype.setAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.Votes.prototype.getOldVotesList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Vote,2)},TronWebProto.Votes.prototype.setOldVotesList=function(c){return h.Message.setRepeatedWrapperField(this,2,c)},TronWebProto.Votes.prototype.addOldVotes=function(c,d){return h.Message.addToRepeatedWrapperField(this,2,c,TronWebProto.Vote,d)},TronWebProto.Votes.prototype.clearOldVotesList=function(){return this.setOldVotesList([])},TronWebProto.Votes.prototype.getNewVotesList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Vote,3)},TronWebProto.Votes.prototype.setNewVotesList=function(c){return h.Message.setRepeatedWrapperField(this,3,c)},TronWebProto.Votes.prototype.addNewVotes=function(c,d){return h.Message.addToRepeatedWrapperField(this,3,c,TronWebProto.Vote,d)},TronWebProto.Votes.prototype.clearNewVotesList=function(){return this.setNewVotesList([])},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.MarketOrderDetail.prototype.toObject=function(c){return TronWebProto.MarketOrderDetail.toObject(c,this)},TronWebProto.MarketOrderDetail.toObject=function(c,d){var p,m={makerorderid:d.getMakerorderid_asB64(),takerorderid:d.getTakerorderid_asB64(),fillsellquantity:h.Message.getFieldWithDefault(d,3,0),fillbuyquantity:h.Message.getFieldWithDefault(d,4,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.MarketOrderDetail.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.MarketOrderDetail;return TronWebProto.MarketOrderDetail.deserializeBinaryFromReader(p,d)},TronWebProto.MarketOrderDetail.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setMakerorderid(m);break;case 2:var m=d.readBytes();c.setTakerorderid(m);break;case 3:var m=d.readInt64();c.setFillsellquantity(m);break;case 4:var m=d.readInt64();c.setFillbuyquantity(m);break;default:d.skipField();break}}return c},TronWebProto.MarketOrderDetail.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.MarketOrderDetail.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.MarketOrderDetail.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getMakerorderid_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getTakerorderid_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getFillsellquantity(),p!==0&&d.writeInt64(3,p),p=c.getFillbuyquantity(),p!==0&&d.writeInt64(4,p)},TronWebProto.MarketOrderDetail.prototype.getMakerorderid=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asB64=function(){return h.Message.bytesAsB64(this.getMakerorderid())},TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asU8=function(){return h.Message.bytesAsU8(this.getMakerorderid())},TronWebProto.MarketOrderDetail.prototype.setMakerorderid=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.MarketOrderDetail.prototype.getTakerorderid=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asB64=function(){return h.Message.bytesAsB64(this.getTakerorderid())},TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asU8=function(){return h.Message.bytesAsU8(this.getTakerorderid())},TronWebProto.MarketOrderDetail.prototype.setTakerorderid=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.MarketOrderDetail.prototype.getFillsellquantity=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.MarketOrderDetail.prototype.setFillsellquantity=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.MarketOrderDetail.prototype.getFillbuyquantity=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.MarketOrderDetail.prototype.setFillbuyquantity=function(c){return h.Message.setProto3IntField(this,4,c)},TronWebProto.Transaction.repeatedFields_=[2,5],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.prototype.toObject=function(c){return TronWebProto.Transaction.toObject(c,this)},TronWebProto.Transaction.toObject=function(c,d){var p,m={rawData:(p=d.getRawData())&&TronWebProto.Transaction.raw.toObject(c,p),signatureList:d.getSignatureList_asB64(),retList:h.Message.toObjectList(d.getRetList(),TronWebProto.Transaction.Result.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Transaction.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Transaction;return TronWebProto.Transaction.deserializeBinaryFromReader(p,d)},TronWebProto.Transaction.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=new TronWebProto.Transaction.raw;d.readMessage(m,TronWebProto.Transaction.raw.deserializeBinaryFromReader),c.setRawData(m);break;case 2:var m=d.readBytes();c.addSignature(m);break;case 5:var m=new TronWebProto.Transaction.Result;d.readMessage(m,TronWebProto.Transaction.Result.deserializeBinaryFromReader),c.addRet(m);break;default:d.skipField();break}}return c},TronWebProto.Transaction.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Transaction.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Transaction.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getRawData(),p!=null&&d.writeMessage(1,p,TronWebProto.Transaction.raw.serializeBinaryToWriter),p=c.getSignatureList_asU8(),p.length>0&&d.writeRepeatedBytes(2,p),p=c.getRetList(),p.length>0&&d.writeRepeatedMessage(5,p,TronWebProto.Transaction.Result.serializeBinaryToWriter)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.Contract.prototype.toObject=function(c){return TronWebProto.Transaction.Contract.toObject(c,this)},TronWebProto.Transaction.Contract.toObject=function(c,d){var p,m={type:h.Message.getFieldWithDefault(d,1,0),parameter:(p=d.getParameter())&&v.Any.toObject(c,p),provider:d.getProvider_asB64(),contractname:d.getContractname_asB64(),permissionId:h.Message.getFieldWithDefault(d,5,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Transaction.Contract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Transaction.Contract;return TronWebProto.Transaction.Contract.deserializeBinaryFromReader(p,d)},TronWebProto.Transaction.Contract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readEnum();c.setType(m);break;case 2:var m=new v.Any;d.readMessage(m,v.Any.deserializeBinaryFromReader),c.setParameter(m);break;case 3:var m=d.readBytes();c.setProvider(m);break;case 4:var m=d.readBytes();c.setContractname(m);break;case 5:var m=d.readInt32();c.setPermissionId(m);break;default:d.skipField();break}}return c},TronWebProto.Transaction.Contract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Transaction.Contract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Transaction.Contract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getType(),p!==0&&d.writeEnum(1,p),p=c.getParameter(),p!=null&&d.writeMessage(2,p,v.Any.serializeBinaryToWriter),p=c.getProvider_asU8(),p.length>0&&d.writeBytes(3,p),p=c.getContractname_asU8(),p.length>0&&d.writeBytes(4,p),p=c.getPermissionId(),p!==0&&d.writeInt32(5,p)},TronWebProto.Transaction.Contract.ContractType={ACCOUNTCREATECONTRACT:0,TRANSFERCONTRACT:1,TRANSFERASSETCONTRACT:2,VOTEASSETCONTRACT:3,VOTEWITNESSCONTRACT:4,WITNESSCREATECONTRACT:5,ASSETISSUECONTRACT:6,WITNESSUPDATECONTRACT:8,PARTICIPATEASSETISSUECONTRACT:9,ACCOUNTUPDATECONTRACT:10,FREEZEBALANCECONTRACT:11,UNFREEZEBALANCECONTRACT:12,WITHDRAWBALANCECONTRACT:13,UNFREEZEASSETCONTRACT:14,UPDATEASSETCONTRACT:15,PROPOSALCREATECONTRACT:16,PROPOSALAPPROVECONTRACT:17,PROPOSALDELETECONTRACT:18,SETACCOUNTIDCONTRACT:19,CUSTOMCONTRACT:20,CREATESMARTCONTRACT:30,TRIGGERSMARTCONTRACT:31,GETCONTRACT:32,UPDATESETTINGCONTRACT:33,EXCHANGECREATECONTRACT:41,EXCHANGEINJECTCONTRACT:42,EXCHANGEWITHDRAWCONTRACT:43,EXCHANGETRANSACTIONCONTRACT:44,UPDATEENERGYLIMITCONTRACT:45,ACCOUNTPERMISSIONUPDATECONTRACT:46,CLEARABICONTRACT:48,UPDATEBROKERAGECONTRACT:49,SHIELDEDTRANSFERCONTRACT:51,MARKETSELLASSETCONTRACT:52,MARKETCANCELORDERCONTRACT:53,FREEZEBALANCEV2CONTRACT:54,UNFREEZEBALANCEV2CONTRACT:55,WITHDRAWEXPIREUNFREEZECONTRACT:56,DELEGATERESOURCECONTRACT:57,UNDELEGATERESOURCECONTRACT:58,CANCELALLUNFREEZEV2CONTRACT:59},TronWebProto.Transaction.Contract.prototype.getType=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.Transaction.Contract.prototype.setType=function(c){return h.Message.setProto3EnumField(this,1,c)},TronWebProto.Transaction.Contract.prototype.getParameter=function(){return h.Message.getWrapperField(this,v.Any,2)},TronWebProto.Transaction.Contract.prototype.setParameter=function(c){return h.Message.setWrapperField(this,2,c)},TronWebProto.Transaction.Contract.prototype.clearParameter=function(){return this.setParameter(void 0)},TronWebProto.Transaction.Contract.prototype.hasParameter=function(){return h.Message.getField(this,2)!=null},TronWebProto.Transaction.Contract.prototype.getProvider=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.Transaction.Contract.prototype.getProvider_asB64=function(){return h.Message.bytesAsB64(this.getProvider())},TronWebProto.Transaction.Contract.prototype.getProvider_asU8=function(){return h.Message.bytesAsU8(this.getProvider())},TronWebProto.Transaction.Contract.prototype.setProvider=function(c){return h.Message.setProto3BytesField(this,3,c)},TronWebProto.Transaction.Contract.prototype.getContractname=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.Transaction.Contract.prototype.getContractname_asB64=function(){return h.Message.bytesAsB64(this.getContractname())},TronWebProto.Transaction.Contract.prototype.getContractname_asU8=function(){return h.Message.bytesAsU8(this.getContractname())},TronWebProto.Transaction.Contract.prototype.setContractname=function(c){return h.Message.setProto3BytesField(this,4,c)},TronWebProto.Transaction.Contract.prototype.getPermissionId=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.Transaction.Contract.prototype.setPermissionId=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.Transaction.Result.repeatedFields_=[26],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.Result.prototype.toObject=function(c){return TronWebProto.Transaction.Result.toObject(c,this)},TronWebProto.Transaction.Result.toObject=function(c,d){var p,m={fee:h.Message.getFieldWithDefault(d,1,0),ret:h.Message.getFieldWithDefault(d,2,0),contractret:h.Message.getFieldWithDefault(d,3,0),assetissueid:h.Message.getFieldWithDefault(d,14,""),withdrawAmount:h.Message.getFieldWithDefault(d,15,0),unfreezeAmount:h.Message.getFieldWithDefault(d,16,0),exchangeReceivedAmount:h.Message.getFieldWithDefault(d,18,0),exchangeInjectAnotherAmount:h.Message.getFieldWithDefault(d,19,0),exchangeWithdrawAnotherAmount:h.Message.getFieldWithDefault(d,20,0),exchangeId:h.Message.getFieldWithDefault(d,21,0),shieldedTransactionFee:h.Message.getFieldWithDefault(d,22,0),orderid:d.getOrderid_asB64(),orderdetailsList:h.Message.toObjectList(d.getOrderdetailsList(),TronWebProto.MarketOrderDetail.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Transaction.Result.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Transaction.Result;return TronWebProto.Transaction.Result.deserializeBinaryFromReader(p,d)},TronWebProto.Transaction.Result.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setFee(m);break;case 2:var m=d.readEnum();c.setRet(m);break;case 3:var m=d.readEnum();c.setContractret(m);break;case 14:var m=d.readString();c.setAssetissueid(m);break;case 15:var m=d.readInt64();c.setWithdrawAmount(m);break;case 16:var m=d.readInt64();c.setUnfreezeAmount(m);break;case 18:var m=d.readInt64();c.setExchangeReceivedAmount(m);break;case 19:var m=d.readInt64();c.setExchangeInjectAnotherAmount(m);break;case 20:var m=d.readInt64();c.setExchangeWithdrawAnotherAmount(m);break;case 21:var m=d.readInt64();c.setExchangeId(m);break;case 22:var m=d.readInt64();c.setShieldedTransactionFee(m);break;case 25:var m=d.readBytes();c.setOrderid(m);break;case 26:var m=new TronWebProto.MarketOrderDetail;d.readMessage(m,TronWebProto.MarketOrderDetail.deserializeBinaryFromReader),c.addOrderdetails(m);break;default:d.skipField();break}}return c},TronWebProto.Transaction.Result.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Transaction.Result.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Transaction.Result.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getFee(),p!==0&&d.writeInt64(1,p),p=c.getRet(),p!==0&&d.writeEnum(2,p),p=c.getContractret(),p!==0&&d.writeEnum(3,p),p=c.getAssetissueid(),p.length>0&&d.writeString(14,p),p=c.getWithdrawAmount(),p!==0&&d.writeInt64(15,p),p=c.getUnfreezeAmount(),p!==0&&d.writeInt64(16,p),p=c.getExchangeReceivedAmount(),p!==0&&d.writeInt64(18,p),p=c.getExchangeInjectAnotherAmount(),p!==0&&d.writeInt64(19,p),p=c.getExchangeWithdrawAnotherAmount(),p!==0&&d.writeInt64(20,p),p=c.getExchangeId(),p!==0&&d.writeInt64(21,p),p=c.getShieldedTransactionFee(),p!==0&&d.writeInt64(22,p),p=c.getOrderid_asU8(),p.length>0&&d.writeBytes(25,p),p=c.getOrderdetailsList(),p.length>0&&d.writeRepeatedMessage(26,p,TronWebProto.MarketOrderDetail.serializeBinaryToWriter)},TronWebProto.Transaction.Result.code={SUCESS:0,FAILED:1},TronWebProto.Transaction.Result.contractResult={DEFAULT:0,SUCCESS:1,REVERT:2,BAD_JUMP_DESTINATION:3,OUT_OF_MEMORY:4,PRECOMPILED_CONTRACT:5,STACK_TOO_SMALL:6,STACK_TOO_LARGE:7,ILLEGAL_OPERATION:8,STACK_OVERFLOW:9,OUT_OF_ENERGY:10,OUT_OF_TIME:11,JVM_STACK_OVER_FLOW:12,UNKNOWN:13,TRANSFER_FAILED:14,INVALID_CODE:15},TronWebProto.Transaction.Result.prototype.getFee=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.Transaction.Result.prototype.setFee=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.Transaction.Result.prototype.getRet=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.Transaction.Result.prototype.setRet=function(c){return h.Message.setProto3EnumField(this,2,c)},TronWebProto.Transaction.Result.prototype.getContractret=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.Transaction.Result.prototype.setContractret=function(c){return h.Message.setProto3EnumField(this,3,c)},TronWebProto.Transaction.Result.prototype.getAssetissueid=function(){return h.Message.getFieldWithDefault(this,14,"")},TronWebProto.Transaction.Result.prototype.setAssetissueid=function(c){return h.Message.setProto3StringField(this,14,c)},TronWebProto.Transaction.Result.prototype.getWithdrawAmount=function(){return h.Message.getFieldWithDefault(this,15,0)},TronWebProto.Transaction.Result.prototype.setWithdrawAmount=function(c){return h.Message.setProto3IntField(this,15,c)},TronWebProto.Transaction.Result.prototype.getUnfreezeAmount=function(){return h.Message.getFieldWithDefault(this,16,0)},TronWebProto.Transaction.Result.prototype.setUnfreezeAmount=function(c){return h.Message.setProto3IntField(this,16,c)},TronWebProto.Transaction.Result.prototype.getExchangeReceivedAmount=function(){return h.Message.getFieldWithDefault(this,18,0)},TronWebProto.Transaction.Result.prototype.setExchangeReceivedAmount=function(c){return h.Message.setProto3IntField(this,18,c)},TronWebProto.Transaction.Result.prototype.getExchangeInjectAnotherAmount=function(){return h.Message.getFieldWithDefault(this,19,0)},TronWebProto.Transaction.Result.prototype.setExchangeInjectAnotherAmount=function(c){return h.Message.setProto3IntField(this,19,c)},TronWebProto.Transaction.Result.prototype.getExchangeWithdrawAnotherAmount=function(){return h.Message.getFieldWithDefault(this,20,0)},TronWebProto.Transaction.Result.prototype.setExchangeWithdrawAnotherAmount=function(c){return h.Message.setProto3IntField(this,20,c)},TronWebProto.Transaction.Result.prototype.getExchangeId=function(){return h.Message.getFieldWithDefault(this,21,0)},TronWebProto.Transaction.Result.prototype.setExchangeId=function(c){return h.Message.setProto3IntField(this,21,c)},TronWebProto.Transaction.Result.prototype.getShieldedTransactionFee=function(){return h.Message.getFieldWithDefault(this,22,0)},TronWebProto.Transaction.Result.prototype.setShieldedTransactionFee=function(c){return h.Message.setProto3IntField(this,22,c)},TronWebProto.Transaction.Result.prototype.getOrderid=function(){return h.Message.getFieldWithDefault(this,25,"")},TronWebProto.Transaction.Result.prototype.getOrderid_asB64=function(){return h.Message.bytesAsB64(this.getOrderid())},TronWebProto.Transaction.Result.prototype.getOrderid_asU8=function(){return h.Message.bytesAsU8(this.getOrderid())},TronWebProto.Transaction.Result.prototype.setOrderid=function(c){return h.Message.setProto3BytesField(this,25,c)},TronWebProto.Transaction.Result.prototype.getOrderdetailsList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.MarketOrderDetail,26)},TronWebProto.Transaction.Result.prototype.setOrderdetailsList=function(c){return h.Message.setRepeatedWrapperField(this,26,c)},TronWebProto.Transaction.Result.prototype.addOrderdetails=function(c,d){return h.Message.addToRepeatedWrapperField(this,26,c,TronWebProto.MarketOrderDetail,d)},TronWebProto.Transaction.Result.prototype.clearOrderdetailsList=function(){return this.setOrderdetailsList([])},TronWebProto.Transaction.raw.repeatedFields_=[9,11],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.raw.prototype.toObject=function(c){return TronWebProto.Transaction.raw.toObject(c,this)},TronWebProto.Transaction.raw.toObject=function(c,d){var p,m={refBlockBytes:d.getRefBlockBytes_asB64(),refBlockNum:h.Message.getFieldWithDefault(d,3,0),refBlockHash:d.getRefBlockHash_asB64(),expiration:h.Message.getFieldWithDefault(d,8,0),authsList:h.Message.toObjectList(d.getAuthsList(),TronWebProto.authority.toObject,c),data:d.getData_asB64(),contractList:h.Message.toObjectList(d.getContractList(),TronWebProto.Transaction.Contract.toObject,c),scripts:d.getScripts_asB64(),timestamp:h.Message.getFieldWithDefault(d,14,0),feeLimit:h.Message.getFieldWithDefault(d,18,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.Transaction.raw.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.Transaction.raw;return TronWebProto.Transaction.raw.deserializeBinaryFromReader(p,d)},TronWebProto.Transaction.raw.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setRefBlockBytes(m);break;case 3:var m=d.readInt64();c.setRefBlockNum(m);break;case 4:var m=d.readBytes();c.setRefBlockHash(m);break;case 8:var m=d.readInt64();c.setExpiration(m);break;case 9:var m=new TronWebProto.authority;d.readMessage(m,TronWebProto.authority.deserializeBinaryFromReader),c.addAuths(m);break;case 10:var m=d.readBytes();c.setData(m);break;case 11:var m=new TronWebProto.Transaction.Contract;d.readMessage(m,TronWebProto.Transaction.Contract.deserializeBinaryFromReader),c.addContract(m);break;case 12:var m=d.readBytes();c.setScripts(m);break;case 14:var m=d.readInt64();c.setTimestamp(m);break;case 18:var m=d.readInt64();c.setFeeLimit(m);break;default:d.skipField();break}}return c},TronWebProto.Transaction.raw.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.Transaction.raw.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.Transaction.raw.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getRefBlockBytes_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getRefBlockNum(),p!==0&&d.writeInt64(3,p),p=c.getRefBlockHash_asU8(),p.length>0&&d.writeBytes(4,p),p=c.getExpiration(),p!==0&&d.writeInt64(8,p),p=c.getAuthsList(),p.length>0&&d.writeRepeatedMessage(9,p,TronWebProto.authority.serializeBinaryToWriter),p=c.getData_asU8(),p.length>0&&d.writeBytes(10,p),p=c.getContractList(),p.length>0&&d.writeRepeatedMessage(11,p,TronWebProto.Transaction.Contract.serializeBinaryToWriter),p=c.getScripts_asU8(),p.length>0&&d.writeBytes(12,p),p=c.getTimestamp(),p!==0&&d.writeInt64(14,p),p=c.getFeeLimit(),p!==0&&d.writeInt64(18,p)},TronWebProto.Transaction.raw.prototype.getRefBlockBytes=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asB64=function(){return h.Message.bytesAsB64(this.getRefBlockBytes())},TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asU8=function(){return h.Message.bytesAsU8(this.getRefBlockBytes())},TronWebProto.Transaction.raw.prototype.setRefBlockBytes=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.Transaction.raw.prototype.getRefBlockNum=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.Transaction.raw.prototype.setRefBlockNum=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.Transaction.raw.prototype.getRefBlockHash=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.Transaction.raw.prototype.getRefBlockHash_asB64=function(){return h.Message.bytesAsB64(this.getRefBlockHash())},TronWebProto.Transaction.raw.prototype.getRefBlockHash_asU8=function(){return h.Message.bytesAsU8(this.getRefBlockHash())},TronWebProto.Transaction.raw.prototype.setRefBlockHash=function(c){return h.Message.setProto3BytesField(this,4,c)},TronWebProto.Transaction.raw.prototype.getExpiration=function(){return h.Message.getFieldWithDefault(this,8,0)},TronWebProto.Transaction.raw.prototype.setExpiration=function(c){return h.Message.setProto3IntField(this,8,c)},TronWebProto.Transaction.raw.prototype.getAuthsList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.authority,9)},TronWebProto.Transaction.raw.prototype.setAuthsList=function(c){return h.Message.setRepeatedWrapperField(this,9,c)},TronWebProto.Transaction.raw.prototype.addAuths=function(c,d){return h.Message.addToRepeatedWrapperField(this,9,c,TronWebProto.authority,d)},TronWebProto.Transaction.raw.prototype.clearAuthsList=function(){return this.setAuthsList([])},TronWebProto.Transaction.raw.prototype.getData=function(){return h.Message.getFieldWithDefault(this,10,"")},TronWebProto.Transaction.raw.prototype.getData_asB64=function(){return h.Message.bytesAsB64(this.getData())},TronWebProto.Transaction.raw.prototype.getData_asU8=function(){return h.Message.bytesAsU8(this.getData())},TronWebProto.Transaction.raw.prototype.setData=function(c){return h.Message.setProto3BytesField(this,10,c)},TronWebProto.Transaction.raw.prototype.getContractList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Transaction.Contract,11)},TronWebProto.Transaction.raw.prototype.setContractList=function(c){return h.Message.setRepeatedWrapperField(this,11,c)},TronWebProto.Transaction.raw.prototype.addContract=function(c,d){return h.Message.addToRepeatedWrapperField(this,11,c,TronWebProto.Transaction.Contract,d)},TronWebProto.Transaction.raw.prototype.clearContractList=function(){return this.setContractList([])},TronWebProto.Transaction.raw.prototype.getScripts=function(){return h.Message.getFieldWithDefault(this,12,"")},TronWebProto.Transaction.raw.prototype.getScripts_asB64=function(){return h.Message.bytesAsB64(this.getScripts())},TronWebProto.Transaction.raw.prototype.getScripts_asU8=function(){return h.Message.bytesAsU8(this.getScripts())},TronWebProto.Transaction.raw.prototype.setScripts=function(c){return h.Message.setProto3BytesField(this,12,c)},TronWebProto.Transaction.raw.prototype.getTimestamp=function(){return h.Message.getFieldWithDefault(this,14,0)},TronWebProto.Transaction.raw.prototype.setTimestamp=function(c){return h.Message.setProto3IntField(this,14,c)},TronWebProto.Transaction.raw.prototype.getFeeLimit=function(){return h.Message.getFieldWithDefault(this,18,0)},TronWebProto.Transaction.raw.prototype.setFeeLimit=function(c){return h.Message.setProto3IntField(this,18,c)},TronWebProto.Transaction.prototype.getRawData=function(){return h.Message.getWrapperField(this,TronWebProto.Transaction.raw,1)},TronWebProto.Transaction.prototype.setRawData=function(c){return h.Message.setWrapperField(this,1,c)},TronWebProto.Transaction.prototype.clearRawData=function(){return this.setRawData(void 0)},TronWebProto.Transaction.prototype.hasRawData=function(){return h.Message.getField(this,1)!=null},TronWebProto.Transaction.prototype.getSignatureList=function(){return h.Message.getRepeatedField(this,2)},TronWebProto.Transaction.prototype.getSignatureList_asB64=function(){return h.Message.bytesListAsB64(this.getSignatureList())},TronWebProto.Transaction.prototype.getSignatureList_asU8=function(){return h.Message.bytesListAsU8(this.getSignatureList())},TronWebProto.Transaction.prototype.setSignatureList=function(c){return h.Message.setField(this,2,c||[])},TronWebProto.Transaction.prototype.addSignature=function(c,d){return h.Message.addToRepeatedField(this,2,c,d)},TronWebProto.Transaction.prototype.clearSignatureList=function(){return this.setSignatureList([])},TronWebProto.Transaction.prototype.getRetList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.Transaction.Result,5)},TronWebProto.Transaction.prototype.setRetList=function(c){return h.Message.setRepeatedWrapperField(this,5,c)},TronWebProto.Transaction.prototype.addRet=function(c,d){return h.Message.addToRepeatedWrapperField(this,5,c,TronWebProto.Transaction.Result,d)},TronWebProto.Transaction.prototype.clearRetList=function(){return this.setRetList([])},TronWebProto.AccountType={NORMAL:0,ASSETISSUE:1,CONTRACT:2},w.object.extend(f,TronWebProto)},62724:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")(),v=_(11814);w.object.extend(proto,v),w.exportSymbol("TronWebProto.AccountCreateContract",null,E),w.exportSymbol("TronWebProto.AccountPermissionUpdateContract",null,E),w.exportSymbol("TronWebProto.AccountUpdateContract",null,E),w.exportSymbol("TronWebProto.SetAccountIdContract",null,E),TronWebProto.AccountCreateContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.AccountCreateContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountCreateContract.displayName="TronWebProto.AccountCreateContract"),TronWebProto.AccountUpdateContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.AccountUpdateContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountUpdateContract.displayName="TronWebProto.AccountUpdateContract"),TronWebProto.SetAccountIdContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.SetAccountIdContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.SetAccountIdContract.displayName="TronWebProto.SetAccountIdContract"),TronWebProto.AccountPermissionUpdateContract=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.AccountPermissionUpdateContract.repeatedFields_,null)},w.inherits(TronWebProto.AccountPermissionUpdateContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountPermissionUpdateContract.displayName="TronWebProto.AccountPermissionUpdateContract"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountCreateContract.prototype.toObject=function(c){return TronWebProto.AccountCreateContract.toObject(c,this)},TronWebProto.AccountCreateContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),accountAddress:d.getAccountAddress_asB64(),type:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountCreateContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountCreateContract;return TronWebProto.AccountCreateContract.deserializeBinaryFromReader(p,d)},TronWebProto.AccountCreateContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readBytes();c.setAccountAddress(m);break;case 3:var m=d.readEnum();c.setType(m);break;default:d.skipField();break}}return c},TronWebProto.AccountCreateContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountCreateContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountCreateContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getAccountAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getType(),p!==0&&d.writeEnum(3,p)},TronWebProto.AccountCreateContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AccountCreateContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.AccountCreateContract.prototype.getAccountAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.AccountCreateContract.prototype.getAccountAddress_asB64=function(){return h.Message.bytesAsB64(this.getAccountAddress())},TronWebProto.AccountCreateContract.prototype.getAccountAddress_asU8=function(){return h.Message.bytesAsU8(this.getAccountAddress())},TronWebProto.AccountCreateContract.prototype.setAccountAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.AccountCreateContract.prototype.getType=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.AccountCreateContract.prototype.setType=function(c){return h.Message.setProto3EnumField(this,3,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountUpdateContract.prototype.toObject=function(c){return TronWebProto.AccountUpdateContract.toObject(c,this)},TronWebProto.AccountUpdateContract.toObject=function(c,d){var p,m={accountName:d.getAccountName_asB64(),ownerAddress:d.getOwnerAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountUpdateContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountUpdateContract;return TronWebProto.AccountUpdateContract.deserializeBinaryFromReader(p,d)},TronWebProto.AccountUpdateContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setAccountName(m);break;case 2:var m=d.readBytes();c.setOwnerAddress(m);break;default:d.skipField();break}}return c},TronWebProto.AccountUpdateContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountUpdateContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountUpdateContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAccountName_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(2,p)},TronWebProto.AccountUpdateContract.prototype.getAccountName=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountUpdateContract.prototype.getAccountName_asB64=function(){return h.Message.bytesAsB64(this.getAccountName())},TronWebProto.AccountUpdateContract.prototype.getAccountName_asU8=function(){return h.Message.bytesAsU8(this.getAccountName())},TronWebProto.AccountUpdateContract.prototype.setAccountName=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.AccountUpdateContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AccountUpdateContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.SetAccountIdContract.prototype.toObject=function(c){return TronWebProto.SetAccountIdContract.toObject(c,this)},TronWebProto.SetAccountIdContract.toObject=function(c,d){var p,m={accountId:d.getAccountId_asB64(),ownerAddress:d.getOwnerAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.SetAccountIdContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.SetAccountIdContract;return TronWebProto.SetAccountIdContract.deserializeBinaryFromReader(p,d)},TronWebProto.SetAccountIdContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setAccountId(m);break;case 2:var m=d.readBytes();c.setOwnerAddress(m);break;default:d.skipField();break}}return c},TronWebProto.SetAccountIdContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.SetAccountIdContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.SetAccountIdContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAccountId_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(2,p)},TronWebProto.SetAccountIdContract.prototype.getAccountId=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.SetAccountIdContract.prototype.getAccountId_asB64=function(){return h.Message.bytesAsB64(this.getAccountId())},TronWebProto.SetAccountIdContract.prototype.getAccountId_asU8=function(){return h.Message.bytesAsU8(this.getAccountId())},TronWebProto.SetAccountIdContract.prototype.setAccountId=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.SetAccountIdContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.SetAccountIdContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.AccountPermissionUpdateContract.repeatedFields_=[4],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountPermissionUpdateContract.prototype.toObject=function(c){return TronWebProto.AccountPermissionUpdateContract.toObject(c,this)},TronWebProto.AccountPermissionUpdateContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),owner:(p=d.getOwner())&&v.Permission.toObject(c,p),witness:(p=d.getWitness())&&v.Permission.toObject(c,p),activesList:h.Message.toObjectList(d.getActivesList(),v.Permission.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountPermissionUpdateContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountPermissionUpdateContract;return TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader(p,d)},TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=new v.Permission;d.readMessage(m,v.Permission.deserializeBinaryFromReader),c.setOwner(m);break;case 3:var m=new v.Permission;d.readMessage(m,v.Permission.deserializeBinaryFromReader),c.setWitness(m);break;case 4:var m=new v.Permission;d.readMessage(m,v.Permission.deserializeBinaryFromReader),c.addActives(m);break;default:d.skipField();break}}return c},TronWebProto.AccountPermissionUpdateContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getOwner(),p!=null&&d.writeMessage(2,p,v.Permission.serializeBinaryToWriter),p=c.getWitness(),p!=null&&d.writeMessage(3,p,v.Permission.serializeBinaryToWriter),p=c.getActivesList(),p.length>0&&d.writeRepeatedMessage(4,p,v.Permission.serializeBinaryToWriter)},TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AccountPermissionUpdateContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.AccountPermissionUpdateContract.prototype.getOwner=function(){return h.Message.getWrapperField(this,v.Permission,2)},TronWebProto.AccountPermissionUpdateContract.prototype.setOwner=function(c){return h.Message.setWrapperField(this,2,c)},TronWebProto.AccountPermissionUpdateContract.prototype.clearOwner=function(){return this.setOwner(void 0)},TronWebProto.AccountPermissionUpdateContract.prototype.hasOwner=function(){return h.Message.getField(this,2)!=null},TronWebProto.AccountPermissionUpdateContract.prototype.getWitness=function(){return h.Message.getWrapperField(this,v.Permission,3)},TronWebProto.AccountPermissionUpdateContract.prototype.setWitness=function(c){return h.Message.setWrapperField(this,3,c)},TronWebProto.AccountPermissionUpdateContract.prototype.clearWitness=function(){return this.setWitness(void 0)},TronWebProto.AccountPermissionUpdateContract.prototype.hasWitness=function(){return h.Message.getField(this,3)!=null},TronWebProto.AccountPermissionUpdateContract.prototype.getActivesList=function(){return h.Message.getRepeatedWrapperField(this,v.Permission,4)},TronWebProto.AccountPermissionUpdateContract.prototype.setActivesList=function(c){return h.Message.setRepeatedWrapperField(this,4,c)},TronWebProto.AccountPermissionUpdateContract.prototype.addActives=function(c,d){return h.Message.addToRepeatedWrapperField(this,4,c,TronWebProto.Permission,d)},TronWebProto.AccountPermissionUpdateContract.prototype.clearActivesList=function(){return this.setActivesList([])},w.object.extend(f,TronWebProto)},69349:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")();w.exportSymbol("TronWebProto.AssetIssueContract",null,E),w.exportSymbol("TronWebProto.AssetIssueContract.FrozenSupply",null,E),w.exportSymbol("TronWebProto.ParticipateAssetIssueContract",null,E),w.exportSymbol("TronWebProto.TransferAssetContract",null,E),w.exportSymbol("TronWebProto.UnfreezeAssetContract",null,E),w.exportSymbol("TronWebProto.UpdateAssetContract",null,E),TronWebProto.AssetIssueContract=function(v){h.Message.initialize(this,v,0,-1,TronWebProto.AssetIssueContract.repeatedFields_,null)},w.inherits(TronWebProto.AssetIssueContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AssetIssueContract.displayName="TronWebProto.AssetIssueContract"),TronWebProto.AssetIssueContract.FrozenSupply=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.AssetIssueContract.FrozenSupply,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AssetIssueContract.FrozenSupply.displayName="TronWebProto.AssetIssueContract.FrozenSupply"),TronWebProto.TransferAssetContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.TransferAssetContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.TransferAssetContract.displayName="TronWebProto.TransferAssetContract"),TronWebProto.UnfreezeAssetContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.UnfreezeAssetContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UnfreezeAssetContract.displayName="TronWebProto.UnfreezeAssetContract"),TronWebProto.UpdateAssetContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.UpdateAssetContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UpdateAssetContract.displayName="TronWebProto.UpdateAssetContract"),TronWebProto.ParticipateAssetIssueContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ParticipateAssetIssueContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ParticipateAssetIssueContract.displayName="TronWebProto.ParticipateAssetIssueContract"),TronWebProto.AssetIssueContract.repeatedFields_=[5],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AssetIssueContract.prototype.toObject=function(v){return TronWebProto.AssetIssueContract.toObject(v,this)},TronWebProto.AssetIssueContract.toObject=function(v,c){var d,p={id:h.Message.getFieldWithDefault(c,41,""),ownerAddress:c.getOwnerAddress_asB64(),name:c.getName_asB64(),abbr:c.getAbbr_asB64(),totalSupply:h.Message.getFieldWithDefault(c,4,0),frozenSupplyList:h.Message.toObjectList(c.getFrozenSupplyList(),TronWebProto.AssetIssueContract.FrozenSupply.toObject,v),trxNum:h.Message.getFieldWithDefault(c,6,0),precision:h.Message.getFieldWithDefault(c,7,0),num:h.Message.getFieldWithDefault(c,8,0),startTime:h.Message.getFieldWithDefault(c,9,0),endTime:h.Message.getFieldWithDefault(c,10,0),order:h.Message.getFieldWithDefault(c,11,0),voteScore:h.Message.getFieldWithDefault(c,16,0),description:c.getDescription_asB64(),url:c.getUrl_asB64(),freeAssetNetLimit:h.Message.getFieldWithDefault(c,22,0),publicFreeAssetNetLimit:h.Message.getFieldWithDefault(c,23,0),publicFreeAssetNetUsage:h.Message.getFieldWithDefault(c,24,0),publicLatestFreeNetTime:h.Message.getFieldWithDefault(c,25,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.AssetIssueContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.AssetIssueContract;return TronWebProto.AssetIssueContract.deserializeBinaryFromReader(d,c)},TronWebProto.AssetIssueContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 41:var p=c.readString();v.setId(p);break;case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readBytes();v.setName(p);break;case 3:var p=c.readBytes();v.setAbbr(p);break;case 4:var p=c.readInt64();v.setTotalSupply(p);break;case 5:var p=new TronWebProto.AssetIssueContract.FrozenSupply;c.readMessage(p,TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader),v.addFrozenSupply(p);break;case 6:var p=c.readInt32();v.setTrxNum(p);break;case 7:var p=c.readInt32();v.setPrecision(p);break;case 8:var p=c.readInt32();v.setNum(p);break;case 9:var p=c.readInt64();v.setStartTime(p);break;case 10:var p=c.readInt64();v.setEndTime(p);break;case 11:var p=c.readInt64();v.setOrder(p);break;case 16:var p=c.readInt32();v.setVoteScore(p);break;case 20:var p=c.readBytes();v.setDescription(p);break;case 21:var p=c.readBytes();v.setUrl(p);break;case 22:var p=c.readInt64();v.setFreeAssetNetLimit(p);break;case 23:var p=c.readInt64();v.setPublicFreeAssetNetLimit(p);break;case 24:var p=c.readInt64();v.setPublicFreeAssetNetUsage(p);break;case 25:var p=c.readInt64();v.setPublicLatestFreeNetTime(p);break;default:c.skipField();break}}return v},TronWebProto.AssetIssueContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.AssetIssueContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.AssetIssueContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getId(),d.length>0&&c.writeString(41,d),d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getName_asU8(),d.length>0&&c.writeBytes(2,d),d=v.getAbbr_asU8(),d.length>0&&c.writeBytes(3,d),d=v.getTotalSupply(),d!==0&&c.writeInt64(4,d),d=v.getFrozenSupplyList(),d.length>0&&c.writeRepeatedMessage(5,d,TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter),d=v.getTrxNum(),d!==0&&c.writeInt32(6,d),d=v.getPrecision(),d!==0&&c.writeInt32(7,d),d=v.getNum(),d!==0&&c.writeInt32(8,d),d=v.getStartTime(),d!==0&&c.writeInt64(9,d),d=v.getEndTime(),d!==0&&c.writeInt64(10,d),d=v.getOrder(),d!==0&&c.writeInt64(11,d),d=v.getVoteScore(),d!==0&&c.writeInt32(16,d),d=v.getDescription_asU8(),d.length>0&&c.writeBytes(20,d),d=v.getUrl_asU8(),d.length>0&&c.writeBytes(21,d),d=v.getFreeAssetNetLimit(),d!==0&&c.writeInt64(22,d),d=v.getPublicFreeAssetNetLimit(),d!==0&&c.writeInt64(23,d),d=v.getPublicFreeAssetNetUsage(),d!==0&&c.writeInt64(24,d),d=v.getPublicLatestFreeNetTime(),d!==0&&c.writeInt64(25,d)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AssetIssueContract.FrozenSupply.prototype.toObject=function(v){return TronWebProto.AssetIssueContract.FrozenSupply.toObject(v,this)},TronWebProto.AssetIssueContract.FrozenSupply.toObject=function(v,c){var d,p={frozenAmount:h.Message.getFieldWithDefault(c,1,0),frozenDays:h.Message.getFieldWithDefault(c,2,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.AssetIssueContract.FrozenSupply;return TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader(d,c)},TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readInt64();v.setFrozenAmount(p);break;case 2:var p=c.readInt64();v.setFrozenDays(p);break;default:c.skipField();break}}return v},TronWebProto.AssetIssueContract.FrozenSupply.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getFrozenAmount(),d!==0&&c.writeInt64(1,d),d=v.getFrozenDays(),d!==0&&c.writeInt64(2,d)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenAmount=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenAmount=function(v){return h.Message.setProto3IntField(this,1,v)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenDays=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenDays=function(v){return h.Message.setProto3IntField(this,2,v)},TronWebProto.AssetIssueContract.prototype.getId=function(){return h.Message.getFieldWithDefault(this,41,"")},TronWebProto.AssetIssueContract.prototype.setId=function(v){return h.Message.setProto3StringField(this,41,v)},TronWebProto.AssetIssueContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AssetIssueContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.AssetIssueContract.prototype.getName=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.AssetIssueContract.prototype.getName_asB64=function(){return h.Message.bytesAsB64(this.getName())},TronWebProto.AssetIssueContract.prototype.getName_asU8=function(){return h.Message.bytesAsU8(this.getName())},TronWebProto.AssetIssueContract.prototype.setName=function(v){return h.Message.setProto3BytesField(this,2,v)},TronWebProto.AssetIssueContract.prototype.getAbbr=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.AssetIssueContract.prototype.getAbbr_asB64=function(){return h.Message.bytesAsB64(this.getAbbr())},TronWebProto.AssetIssueContract.prototype.getAbbr_asU8=function(){return h.Message.bytesAsU8(this.getAbbr())},TronWebProto.AssetIssueContract.prototype.setAbbr=function(v){return h.Message.setProto3BytesField(this,3,v)},TronWebProto.AssetIssueContract.prototype.getTotalSupply=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.AssetIssueContract.prototype.setTotalSupply=function(v){return h.Message.setProto3IntField(this,4,v)},TronWebProto.AssetIssueContract.prototype.getFrozenSupplyList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.AssetIssueContract.FrozenSupply,5)},TronWebProto.AssetIssueContract.prototype.setFrozenSupplyList=function(v){return h.Message.setRepeatedWrapperField(this,5,v)},TronWebProto.AssetIssueContract.prototype.addFrozenSupply=function(v,c){return h.Message.addToRepeatedWrapperField(this,5,v,TronWebProto.AssetIssueContract.FrozenSupply,c)},TronWebProto.AssetIssueContract.prototype.clearFrozenSupplyList=function(){return this.setFrozenSupplyList([])},TronWebProto.AssetIssueContract.prototype.getTrxNum=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.AssetIssueContract.prototype.setTrxNum=function(v){return h.Message.setProto3IntField(this,6,v)},TronWebProto.AssetIssueContract.prototype.getPrecision=function(){return h.Message.getFieldWithDefault(this,7,0)},TronWebProto.AssetIssueContract.prototype.setPrecision=function(v){return h.Message.setProto3IntField(this,7,v)},TronWebProto.AssetIssueContract.prototype.getNum=function(){return h.Message.getFieldWithDefault(this,8,0)},TronWebProto.AssetIssueContract.prototype.setNum=function(v){return h.Message.setProto3IntField(this,8,v)},TronWebProto.AssetIssueContract.prototype.getStartTime=function(){return h.Message.getFieldWithDefault(this,9,0)},TronWebProto.AssetIssueContract.prototype.setStartTime=function(v){return h.Message.setProto3IntField(this,9,v)},TronWebProto.AssetIssueContract.prototype.getEndTime=function(){return h.Message.getFieldWithDefault(this,10,0)},TronWebProto.AssetIssueContract.prototype.setEndTime=function(v){return h.Message.setProto3IntField(this,10,v)},TronWebProto.AssetIssueContract.prototype.getOrder=function(){return h.Message.getFieldWithDefault(this,11,0)},TronWebProto.AssetIssueContract.prototype.setOrder=function(v){return h.Message.setProto3IntField(this,11,v)},TronWebProto.AssetIssueContract.prototype.getVoteScore=function(){return h.Message.getFieldWithDefault(this,16,0)},TronWebProto.AssetIssueContract.prototype.setVoteScore=function(v){return h.Message.setProto3IntField(this,16,v)},TronWebProto.AssetIssueContract.prototype.getDescription=function(){return h.Message.getFieldWithDefault(this,20,"")},TronWebProto.AssetIssueContract.prototype.getDescription_asB64=function(){return h.Message.bytesAsB64(this.getDescription())},TronWebProto.AssetIssueContract.prototype.getDescription_asU8=function(){return h.Message.bytesAsU8(this.getDescription())},TronWebProto.AssetIssueContract.prototype.setDescription=function(v){return h.Message.setProto3BytesField(this,20,v)},TronWebProto.AssetIssueContract.prototype.getUrl=function(){return h.Message.getFieldWithDefault(this,21,"")},TronWebProto.AssetIssueContract.prototype.getUrl_asB64=function(){return h.Message.bytesAsB64(this.getUrl())},TronWebProto.AssetIssueContract.prototype.getUrl_asU8=function(){return h.Message.bytesAsU8(this.getUrl())},TronWebProto.AssetIssueContract.prototype.setUrl=function(v){return h.Message.setProto3BytesField(this,21,v)},TronWebProto.AssetIssueContract.prototype.getFreeAssetNetLimit=function(){return h.Message.getFieldWithDefault(this,22,0)},TronWebProto.AssetIssueContract.prototype.setFreeAssetNetLimit=function(v){return h.Message.setProto3IntField(this,22,v)},TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetLimit=function(){return h.Message.getFieldWithDefault(this,23,0)},TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetLimit=function(v){return h.Message.setProto3IntField(this,23,v)},TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetUsage=function(){return h.Message.getFieldWithDefault(this,24,0)},TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetUsage=function(v){return h.Message.setProto3IntField(this,24,v)},TronWebProto.AssetIssueContract.prototype.getPublicLatestFreeNetTime=function(){return h.Message.getFieldWithDefault(this,25,0)},TronWebProto.AssetIssueContract.prototype.setPublicLatestFreeNetTime=function(v){return h.Message.setProto3IntField(this,25,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransferAssetContract.prototype.toObject=function(v){return TronWebProto.TransferAssetContract.toObject(v,this)},TronWebProto.TransferAssetContract.toObject=function(v,c){var d,p={assetName:c.getAssetName_asB64(),ownerAddress:c.getOwnerAddress_asB64(),toAddress:c.getToAddress_asB64(),amount:h.Message.getFieldWithDefault(c,4,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.TransferAssetContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.TransferAssetContract;return TronWebProto.TransferAssetContract.deserializeBinaryFromReader(d,c)},TronWebProto.TransferAssetContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setAssetName(p);break;case 2:var p=c.readBytes();v.setOwnerAddress(p);break;case 3:var p=c.readBytes();v.setToAddress(p);break;case 4:var p=c.readInt64();v.setAmount(p);break;default:c.skipField();break}}return v},TronWebProto.TransferAssetContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.TransferAssetContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.TransferAssetContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getAssetName_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(2,d),d=v.getToAddress_asU8(),d.length>0&&c.writeBytes(3,d),d=v.getAmount(),d!==0&&c.writeInt64(4,d)},TronWebProto.TransferAssetContract.prototype.getAssetName=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.TransferAssetContract.prototype.getAssetName_asB64=function(){return h.Message.bytesAsB64(this.getAssetName())},TronWebProto.TransferAssetContract.prototype.getAssetName_asU8=function(){return h.Message.bytesAsU8(this.getAssetName())},TronWebProto.TransferAssetContract.prototype.setAssetName=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.TransferAssetContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.TransferAssetContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,2,v)},TronWebProto.TransferAssetContract.prototype.getToAddress=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.TransferAssetContract.prototype.getToAddress_asB64=function(){return h.Message.bytesAsB64(this.getToAddress())},TronWebProto.TransferAssetContract.prototype.getToAddress_asU8=function(){return h.Message.bytesAsU8(this.getToAddress())},TronWebProto.TransferAssetContract.prototype.setToAddress=function(v){return h.Message.setProto3BytesField(this,3,v)},TronWebProto.TransferAssetContract.prototype.getAmount=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.TransferAssetContract.prototype.setAmount=function(v){return h.Message.setProto3IntField(this,4,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnfreezeAssetContract.prototype.toObject=function(v){return TronWebProto.UnfreezeAssetContract.toObject(v,this)},TronWebProto.UnfreezeAssetContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64()};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.UnfreezeAssetContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.UnfreezeAssetContract;return TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader(d,c)},TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;default:c.skipField();break}}return v},TronWebProto.UnfreezeAssetContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d)},TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnfreezeAssetContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateAssetContract.prototype.toObject=function(v){return TronWebProto.UpdateAssetContract.toObject(v,this)},TronWebProto.UpdateAssetContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),description:c.getDescription_asB64(),url:c.getUrl_asB64(),newLimit:h.Message.getFieldWithDefault(c,4,0),newPublicLimit:h.Message.getFieldWithDefault(c,5,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.UpdateAssetContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.UpdateAssetContract;return TronWebProto.UpdateAssetContract.deserializeBinaryFromReader(d,c)},TronWebProto.UpdateAssetContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readBytes();v.setDescription(p);break;case 3:var p=c.readBytes();v.setUrl(p);break;case 4:var p=c.readInt64();v.setNewLimit(p);break;case 5:var p=c.readInt64();v.setNewPublicLimit(p);break;default:c.skipField();break}}return v},TronWebProto.UpdateAssetContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.UpdateAssetContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.UpdateAssetContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getDescription_asU8(),d.length>0&&c.writeBytes(2,d),d=v.getUrl_asU8(),d.length>0&&c.writeBytes(3,d),d=v.getNewLimit(),d!==0&&c.writeInt64(4,d),d=v.getNewPublicLimit(),d!==0&&c.writeInt64(5,d)},TronWebProto.UpdateAssetContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateAssetContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.UpdateAssetContract.prototype.getDescription=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.UpdateAssetContract.prototype.getDescription_asB64=function(){return h.Message.bytesAsB64(this.getDescription())},TronWebProto.UpdateAssetContract.prototype.getDescription_asU8=function(){return h.Message.bytesAsU8(this.getDescription())},TronWebProto.UpdateAssetContract.prototype.setDescription=function(v){return h.Message.setProto3BytesField(this,2,v)},TronWebProto.UpdateAssetContract.prototype.getUrl=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.UpdateAssetContract.prototype.getUrl_asB64=function(){return h.Message.bytesAsB64(this.getUrl())},TronWebProto.UpdateAssetContract.prototype.getUrl_asU8=function(){return h.Message.bytesAsU8(this.getUrl())},TronWebProto.UpdateAssetContract.prototype.setUrl=function(v){return h.Message.setProto3BytesField(this,3,v)},TronWebProto.UpdateAssetContract.prototype.getNewLimit=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.UpdateAssetContract.prototype.setNewLimit=function(v){return h.Message.setProto3IntField(this,4,v)},TronWebProto.UpdateAssetContract.prototype.getNewPublicLimit=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.UpdateAssetContract.prototype.setNewPublicLimit=function(v){return h.Message.setProto3IntField(this,5,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ParticipateAssetIssueContract.prototype.toObject=function(v){return TronWebProto.ParticipateAssetIssueContract.toObject(v,this)},TronWebProto.ParticipateAssetIssueContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),toAddress:c.getToAddress_asB64(),assetName:c.getAssetName_asB64(),amount:h.Message.getFieldWithDefault(c,4,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ParticipateAssetIssueContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ParticipateAssetIssueContract;return TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader(d,c)},TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readBytes();v.setToAddress(p);break;case 3:var p=c.readBytes();v.setAssetName(p);break;case 4:var p=c.readInt64();v.setAmount(p);break;default:c.skipField();break}}return v},TronWebProto.ParticipateAssetIssueContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getToAddress_asU8(),d.length>0&&c.writeBytes(2,d),d=v.getAssetName_asU8(),d.length>0&&c.writeBytes(3,d),d=v.getAmount(),d!==0&&c.writeInt64(4,d)},TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asB64=function(){return h.Message.bytesAsB64(this.getToAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asU8=function(){return h.Message.bytesAsU8(this.getToAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.setToAddress=function(v){return h.Message.setProto3BytesField(this,2,v)},TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asB64=function(){return h.Message.bytesAsB64(this.getAssetName())},TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asU8=function(){return h.Message.bytesAsU8(this.getAssetName())},TronWebProto.ParticipateAssetIssueContract.prototype.setAssetName=function(v){return h.Message.setProto3BytesField(this,3,v)},TronWebProto.ParticipateAssetIssueContract.prototype.getAmount=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.ParticipateAssetIssueContract.prototype.setAmount=function(v){return h.Message.setProto3IntField(this,4,v)},w.object.extend(f,TronWebProto)},99505:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")(),v=_(97899);w.object.extend(proto,v),w.exportSymbol("TronWebProto.AccountBalanceRequest",null,E),w.exportSymbol("TronWebProto.AccountBalanceResponse",null,E),w.exportSymbol("TronWebProto.AccountIdentifier",null,E),w.exportSymbol("TronWebProto.AccountTrace",null,E),w.exportSymbol("TronWebProto.BlockBalanceTrace",null,E),w.exportSymbol("TronWebProto.BlockBalanceTrace.BlockIdentifier",null,E),w.exportSymbol("TronWebProto.CancelAllUnfreezeV2Contract",null,E),w.exportSymbol("TronWebProto.DelegateResourceContract",null,E),w.exportSymbol("TronWebProto.FreezeBalanceContract",null,E),w.exportSymbol("TronWebProto.FreezeBalanceV2Contract",null,E),w.exportSymbol("TronWebProto.TransactionBalanceTrace",null,E),w.exportSymbol("TronWebProto.TransactionBalanceTrace.Operation",null,E),w.exportSymbol("TronWebProto.TransferContract",null,E),w.exportSymbol("TronWebProto.UnDelegateResourceContract",null,E),w.exportSymbol("TronWebProto.UnfreezeBalanceContract",null,E),w.exportSymbol("TronWebProto.UnfreezeBalanceV2Contract",null,E),w.exportSymbol("TronWebProto.WithdrawBalanceContract",null,E),w.exportSymbol("TronWebProto.WithdrawExpireUnfreezeContract",null,E),TronWebProto.FreezeBalanceContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.FreezeBalanceContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.FreezeBalanceContract.displayName="TronWebProto.FreezeBalanceContract"),TronWebProto.UnfreezeBalanceContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.UnfreezeBalanceContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UnfreezeBalanceContract.displayName="TronWebProto.UnfreezeBalanceContract"),TronWebProto.WithdrawBalanceContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.WithdrawBalanceContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.WithdrawBalanceContract.displayName="TronWebProto.WithdrawBalanceContract"),TronWebProto.TransferContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.TransferContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.TransferContract.displayName="TronWebProto.TransferContract"),TronWebProto.TransactionBalanceTrace=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.TransactionBalanceTrace.repeatedFields_,null)},w.inherits(TronWebProto.TransactionBalanceTrace,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.TransactionBalanceTrace.displayName="TronWebProto.TransactionBalanceTrace"),TronWebProto.TransactionBalanceTrace.Operation=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.TransactionBalanceTrace.Operation,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.TransactionBalanceTrace.Operation.displayName="TronWebProto.TransactionBalanceTrace.Operation"),TronWebProto.BlockBalanceTrace=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.BlockBalanceTrace.repeatedFields_,null)},w.inherits(TronWebProto.BlockBalanceTrace,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.BlockBalanceTrace.displayName="TronWebProto.BlockBalanceTrace"),TronWebProto.BlockBalanceTrace.BlockIdentifier=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.BlockBalanceTrace.BlockIdentifier,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.BlockBalanceTrace.BlockIdentifier.displayName="TronWebProto.BlockBalanceTrace.BlockIdentifier"),TronWebProto.AccountTrace=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.AccountTrace,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountTrace.displayName="TronWebProto.AccountTrace"),TronWebProto.AccountIdentifier=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.AccountIdentifier,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountIdentifier.displayName="TronWebProto.AccountIdentifier"),TronWebProto.AccountBalanceRequest=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.AccountBalanceRequest,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountBalanceRequest.displayName="TronWebProto.AccountBalanceRequest"),TronWebProto.AccountBalanceResponse=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.AccountBalanceResponse,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.AccountBalanceResponse.displayName="TronWebProto.AccountBalanceResponse"),TronWebProto.FreezeBalanceV2Contract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.FreezeBalanceV2Contract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.FreezeBalanceV2Contract.displayName="TronWebProto.FreezeBalanceV2Contract"),TronWebProto.UnfreezeBalanceV2Contract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.UnfreezeBalanceV2Contract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UnfreezeBalanceV2Contract.displayName="TronWebProto.UnfreezeBalanceV2Contract"),TronWebProto.WithdrawExpireUnfreezeContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.WithdrawExpireUnfreezeContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.WithdrawExpireUnfreezeContract.displayName="TronWebProto.WithdrawExpireUnfreezeContract"),TronWebProto.DelegateResourceContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.DelegateResourceContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.DelegateResourceContract.displayName="TronWebProto.DelegateResourceContract"),TronWebProto.UnDelegateResourceContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.UnDelegateResourceContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UnDelegateResourceContract.displayName="TronWebProto.UnDelegateResourceContract"),TronWebProto.CancelAllUnfreezeV2Contract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.CancelAllUnfreezeV2Contract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.CancelAllUnfreezeV2Contract.displayName="TronWebProto.CancelAllUnfreezeV2Contract"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.FreezeBalanceContract.prototype.toObject=function(c){return TronWebProto.FreezeBalanceContract.toObject(c,this)},TronWebProto.FreezeBalanceContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),frozenBalance:h.Message.getFieldWithDefault(d,2,0),frozenDuration:h.Message.getFieldWithDefault(d,3,0),resource:h.Message.getFieldWithDefault(d,10,0),receiverAddress:d.getReceiverAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.FreezeBalanceContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.FreezeBalanceContract;return TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader(p,d)},TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readInt64();c.setFrozenBalance(m);break;case 3:var m=d.readInt64();c.setFrozenDuration(m);break;case 10:var m=d.readEnum();c.setResource(m);break;case 15:var m=d.readBytes();c.setReceiverAddress(m);break;default:d.skipField();break}}return c},TronWebProto.FreezeBalanceContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.FreezeBalanceContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.FreezeBalanceContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getFrozenBalance(),p!==0&&d.writeInt64(2,p),p=c.getFrozenDuration(),p!==0&&d.writeInt64(3,p),p=c.getResource(),p!==0&&d.writeEnum(10,p),p=c.getReceiverAddress_asU8(),p.length>0&&d.writeBytes(15,p)},TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.FreezeBalanceContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.FreezeBalanceContract.prototype.getFrozenBalance=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.FreezeBalanceContract.prototype.setFrozenBalance=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.FreezeBalanceContract.prototype.getFrozenDuration=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.FreezeBalanceContract.prototype.setFrozenDuration=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.FreezeBalanceContract.prototype.getResource=function(){return h.Message.getFieldWithDefault(this,10,0)},TronWebProto.FreezeBalanceContract.prototype.setResource=function(c){return h.Message.setProto3EnumField(this,10,c)},TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress=function(){return h.Message.getFieldWithDefault(this,15,"")},TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asB64=function(){return h.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asU8=function(){return h.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.FreezeBalanceContract.prototype.setReceiverAddress=function(c){return h.Message.setProto3BytesField(this,15,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnfreezeBalanceContract.prototype.toObject=function(c){return TronWebProto.UnfreezeBalanceContract.toObject(c,this)},TronWebProto.UnfreezeBalanceContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),resource:h.Message.getFieldWithDefault(d,10,0),receiverAddress:d.getReceiverAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.UnfreezeBalanceContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.UnfreezeBalanceContract;return TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader(p,d)},TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 10:var m=d.readEnum();c.setResource(m);break;case 15:var m=d.readBytes();c.setReceiverAddress(m);break;default:d.skipField();break}}return c},TronWebProto.UnfreezeBalanceContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getResource(),p!==0&&d.writeEnum(10,p),p=c.getReceiverAddress_asU8(),p.length>0&&d.writeBytes(15,p)},TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.UnfreezeBalanceContract.prototype.getResource=function(){return h.Message.getFieldWithDefault(this,10,0)},TronWebProto.UnfreezeBalanceContract.prototype.setResource=function(c){return h.Message.setProto3EnumField(this,10,c)},TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress=function(){return h.Message.getFieldWithDefault(this,15,"")},TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asB64=function(){return h.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asU8=function(){return h.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.UnfreezeBalanceContract.prototype.setReceiverAddress=function(c){return h.Message.setProto3BytesField(this,15,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.WithdrawBalanceContract.prototype.toObject=function(c){return TronWebProto.WithdrawBalanceContract.toObject(c,this)},TronWebProto.WithdrawBalanceContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.WithdrawBalanceContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.WithdrawBalanceContract;return TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader(p,d)},TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;default:d.skipField();break}}return c},TronWebProto.WithdrawBalanceContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p)},TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WithdrawBalanceContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransferContract.prototype.toObject=function(c){return TronWebProto.TransferContract.toObject(c,this)},TronWebProto.TransferContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),toAddress:d.getToAddress_asB64(),amount:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.TransferContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.TransferContract;return TronWebProto.TransferContract.deserializeBinaryFromReader(p,d)},TronWebProto.TransferContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readBytes();c.setToAddress(m);break;case 3:var m=d.readInt64();c.setAmount(m);break;default:d.skipField();break}}return c},TronWebProto.TransferContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.TransferContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.TransferContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getToAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getAmount(),p!==0&&d.writeInt64(3,p)},TronWebProto.TransferContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.TransferContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.TransferContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.TransferContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.TransferContract.prototype.getToAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.TransferContract.prototype.getToAddress_asB64=function(){return h.Message.bytesAsB64(this.getToAddress())},TronWebProto.TransferContract.prototype.getToAddress_asU8=function(){return h.Message.bytesAsU8(this.getToAddress())},TronWebProto.TransferContract.prototype.setToAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.TransferContract.prototype.getAmount=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.TransferContract.prototype.setAmount=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.TransactionBalanceTrace.repeatedFields_=[2],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransactionBalanceTrace.prototype.toObject=function(c){return TronWebProto.TransactionBalanceTrace.toObject(c,this)},TronWebProto.TransactionBalanceTrace.toObject=function(c,d){var p,m={transactionIdentifier:d.getTransactionIdentifier_asB64(),operationList:h.Message.toObjectList(d.getOperationList(),TronWebProto.TransactionBalanceTrace.Operation.toObject,c),type:h.Message.getFieldWithDefault(d,3,""),status:h.Message.getFieldWithDefault(d,4,"")};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.TransactionBalanceTrace.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.TransactionBalanceTrace;return TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader(p,d)},TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setTransactionIdentifier(m);break;case 2:var m=new TronWebProto.TransactionBalanceTrace.Operation;d.readMessage(m,TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader),c.addOperation(m);break;case 3:var m=d.readString();c.setType(m);break;case 4:var m=d.readString();c.setStatus(m);break;default:d.skipField();break}}return c},TronWebProto.TransactionBalanceTrace.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getTransactionIdentifier_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getOperationList(),p.length>0&&d.writeRepeatedMessage(2,p,TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter),p=c.getType(),p.length>0&&d.writeString(3,p),p=c.getStatus(),p.length>0&&d.writeString(4,p)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransactionBalanceTrace.Operation.prototype.toObject=function(c){return TronWebProto.TransactionBalanceTrace.Operation.toObject(c,this)},TronWebProto.TransactionBalanceTrace.Operation.toObject=function(c,d){var p,m={operationIdentifier:h.Message.getFieldWithDefault(d,1,0),address:d.getAddress_asB64(),amount:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.TransactionBalanceTrace.Operation.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.TransactionBalanceTrace.Operation;return TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader(p,d)},TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setOperationIdentifier(m);break;case 2:var m=d.readBytes();c.setAddress(m);break;case 3:var m=d.readInt64();c.setAmount(m);break;default:d.skipField();break}}return c},TronWebProto.TransactionBalanceTrace.Operation.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOperationIdentifier(),p!==0&&d.writeInt64(1,p),p=c.getAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getAmount(),p!==0&&d.writeInt64(3,p)},TronWebProto.TransactionBalanceTrace.Operation.prototype.getOperationIdentifier=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.TransactionBalanceTrace.Operation.prototype.setOperationIdentifier=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asB64=function(){return h.Message.bytesAsB64(this.getAddress())},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asU8=function(){return h.Message.bytesAsU8(this.getAddress())},TronWebProto.TransactionBalanceTrace.Operation.prototype.setAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAmount=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.TransactionBalanceTrace.Operation.prototype.setAmount=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asB64=function(){return h.Message.bytesAsB64(this.getTransactionIdentifier())},TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asU8=function(){return h.Message.bytesAsU8(this.getTransactionIdentifier())},TronWebProto.TransactionBalanceTrace.prototype.setTransactionIdentifier=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.TransactionBalanceTrace.prototype.getOperationList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.TransactionBalanceTrace.Operation,2)},TronWebProto.TransactionBalanceTrace.prototype.setOperationList=function(c){return h.Message.setRepeatedWrapperField(this,2,c)},TronWebProto.TransactionBalanceTrace.prototype.addOperation=function(c,d){return h.Message.addToRepeatedWrapperField(this,2,c,TronWebProto.TransactionBalanceTrace.Operation,d)},TronWebProto.TransactionBalanceTrace.prototype.clearOperationList=function(){return this.setOperationList([])},TronWebProto.TransactionBalanceTrace.prototype.getType=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.TransactionBalanceTrace.prototype.setType=function(c){return h.Message.setProto3StringField(this,3,c)},TronWebProto.TransactionBalanceTrace.prototype.getStatus=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.TransactionBalanceTrace.prototype.setStatus=function(c){return h.Message.setProto3StringField(this,4,c)},TronWebProto.BlockBalanceTrace.repeatedFields_=[3],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.BlockBalanceTrace.prototype.toObject=function(c){return TronWebProto.BlockBalanceTrace.toObject(c,this)},TronWebProto.BlockBalanceTrace.toObject=function(c,d){var p,m={blockIdentifier:(p=d.getBlockIdentifier())&&TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(c,p),timestamp:h.Message.getFieldWithDefault(d,2,0),transactionBalanceTraceList:h.Message.toObjectList(d.getTransactionBalanceTraceList(),TronWebProto.TransactionBalanceTrace.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.BlockBalanceTrace.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.BlockBalanceTrace;return TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader(p,d)},TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=new TronWebProto.BlockBalanceTrace.BlockIdentifier;d.readMessage(m,TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),c.setBlockIdentifier(m);break;case 2:var m=d.readInt64();c.setTimestamp(m);break;case 3:var m=new TronWebProto.TransactionBalanceTrace;d.readMessage(m,TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader),c.addTransactionBalanceTrace(m);break;default:d.skipField();break}}return c},TronWebProto.BlockBalanceTrace.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.BlockBalanceTrace.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.BlockBalanceTrace.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getBlockIdentifier(),p!=null&&d.writeMessage(1,p,TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter),p=c.getTimestamp(),p!==0&&d.writeInt64(2,p),p=c.getTransactionBalanceTraceList(),p.length>0&&d.writeRepeatedMessage(3,p,TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.toObject=function(c){return TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(c,this)},TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject=function(c,d){var p,m={hash:d.getHash_asB64(),number:h.Message.getFieldWithDefault(d,2,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.BlockBalanceTrace.BlockIdentifier;return TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader(p,d)},TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setHash(m);break;case 2:var m=d.readInt64();c.setNumber(m);break;default:d.skipField();break}}return c},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getHash_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getNumber(),p!==0&&d.writeInt64(2,p)},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asB64=function(){return h.Message.bytesAsB64(this.getHash())},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asU8=function(){return h.Message.bytesAsU8(this.getHash())},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setHash=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getNumber=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setNumber=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.BlockBalanceTrace.prototype.getBlockIdentifier=function(){return h.Message.getWrapperField(this,TronWebProto.BlockBalanceTrace.BlockIdentifier,1)},TronWebProto.BlockBalanceTrace.prototype.setBlockIdentifier=function(c){return h.Message.setWrapperField(this,1,c)},TronWebProto.BlockBalanceTrace.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},TronWebProto.BlockBalanceTrace.prototype.hasBlockIdentifier=function(){return h.Message.getField(this,1)!=null},TronWebProto.BlockBalanceTrace.prototype.getTimestamp=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.BlockBalanceTrace.prototype.setTimestamp=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.BlockBalanceTrace.prototype.getTransactionBalanceTraceList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.TransactionBalanceTrace,3)},TronWebProto.BlockBalanceTrace.prototype.setTransactionBalanceTraceList=function(c){return h.Message.setRepeatedWrapperField(this,3,c)},TronWebProto.BlockBalanceTrace.prototype.addTransactionBalanceTrace=function(c,d){return h.Message.addToRepeatedWrapperField(this,3,c,TronWebProto.TransactionBalanceTrace,d)},TronWebProto.BlockBalanceTrace.prototype.clearTransactionBalanceTraceList=function(){return this.setTransactionBalanceTraceList([])},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountTrace.prototype.toObject=function(c){return TronWebProto.AccountTrace.toObject(c,this)},TronWebProto.AccountTrace.toObject=function(c,d){var p,m={balance:h.Message.getFieldWithDefault(d,1,0),placeholder:h.Message.getFieldWithDefault(d,99,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountTrace.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountTrace;return TronWebProto.AccountTrace.deserializeBinaryFromReader(p,d)},TronWebProto.AccountTrace.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setBalance(m);break;case 99:var m=d.readInt64();c.setPlaceholder(m);break;default:d.skipField();break}}return c},TronWebProto.AccountTrace.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountTrace.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountTrace.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getBalance(),p!==0&&d.writeInt64(1,p),p=c.getPlaceholder(),p!==0&&d.writeInt64(99,p)},TronWebProto.AccountTrace.prototype.getBalance=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.AccountTrace.prototype.setBalance=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.AccountTrace.prototype.getPlaceholder=function(){return h.Message.getFieldWithDefault(this,99,0)},TronWebProto.AccountTrace.prototype.setPlaceholder=function(c){return h.Message.setProto3IntField(this,99,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountIdentifier.prototype.toObject=function(c){return TronWebProto.AccountIdentifier.toObject(c,this)},TronWebProto.AccountIdentifier.toObject=function(c,d){var p,m={address:d.getAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountIdentifier.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountIdentifier;return TronWebProto.AccountIdentifier.deserializeBinaryFromReader(p,d)},TronWebProto.AccountIdentifier.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setAddress(m);break;default:d.skipField();break}}return c},TronWebProto.AccountIdentifier.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountIdentifier.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountIdentifier.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAddress_asU8(),p.length>0&&d.writeBytes(1,p)},TronWebProto.AccountIdentifier.prototype.getAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountIdentifier.prototype.getAddress_asB64=function(){return h.Message.bytesAsB64(this.getAddress())},TronWebProto.AccountIdentifier.prototype.getAddress_asU8=function(){return h.Message.bytesAsU8(this.getAddress())},TronWebProto.AccountIdentifier.prototype.setAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountBalanceRequest.prototype.toObject=function(c){return TronWebProto.AccountBalanceRequest.toObject(c,this)},TronWebProto.AccountBalanceRequest.toObject=function(c,d){var p,m={accountIdentifier:(p=d.getAccountIdentifier())&&TronWebProto.AccountIdentifier.toObject(c,p),blockIdentifier:(p=d.getBlockIdentifier())&&TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(c,p)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountBalanceRequest.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountBalanceRequest;return TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader(p,d)},TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=new TronWebProto.AccountIdentifier;d.readMessage(m,TronWebProto.AccountIdentifier.deserializeBinaryFromReader),c.setAccountIdentifier(m);break;case 2:var m=new TronWebProto.BlockBalanceTrace.BlockIdentifier;d.readMessage(m,TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),c.setBlockIdentifier(m);break;default:d.skipField();break}}return c},TronWebProto.AccountBalanceRequest.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountBalanceRequest.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountBalanceRequest.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAccountIdentifier(),p!=null&&d.writeMessage(1,p,TronWebProto.AccountIdentifier.serializeBinaryToWriter),p=c.getBlockIdentifier(),p!=null&&d.writeMessage(2,p,TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter)},TronWebProto.AccountBalanceRequest.prototype.getAccountIdentifier=function(){return h.Message.getWrapperField(this,TronWebProto.AccountIdentifier,1)},TronWebProto.AccountBalanceRequest.prototype.setAccountIdentifier=function(c){return h.Message.setWrapperField(this,1,c)},TronWebProto.AccountBalanceRequest.prototype.clearAccountIdentifier=function(){return this.setAccountIdentifier(void 0)},TronWebProto.AccountBalanceRequest.prototype.hasAccountIdentifier=function(){return h.Message.getField(this,1)!=null},TronWebProto.AccountBalanceRequest.prototype.getBlockIdentifier=function(){return h.Message.getWrapperField(this,TronWebProto.BlockBalanceTrace.BlockIdentifier,2)},TronWebProto.AccountBalanceRequest.prototype.setBlockIdentifier=function(c){return h.Message.setWrapperField(this,2,c)},TronWebProto.AccountBalanceRequest.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},TronWebProto.AccountBalanceRequest.prototype.hasBlockIdentifier=function(){return h.Message.getField(this,2)!=null},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountBalanceResponse.prototype.toObject=function(c){return TronWebProto.AccountBalanceResponse.toObject(c,this)},TronWebProto.AccountBalanceResponse.toObject=function(c,d){var p,m={balance:h.Message.getFieldWithDefault(d,1,0),blockIdentifier:(p=d.getBlockIdentifier())&&TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(c,p)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.AccountBalanceResponse.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.AccountBalanceResponse;return TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader(p,d)},TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setBalance(m);break;case 2:var m=new TronWebProto.BlockBalanceTrace.BlockIdentifier;d.readMessage(m,TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),c.setBlockIdentifier(m);break;default:d.skipField();break}}return c},TronWebProto.AccountBalanceResponse.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.AccountBalanceResponse.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.AccountBalanceResponse.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getBalance(),p!==0&&d.writeInt64(1,p),p=c.getBlockIdentifier(),p!=null&&d.writeMessage(2,p,TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter)},TronWebProto.AccountBalanceResponse.prototype.getBalance=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.AccountBalanceResponse.prototype.setBalance=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.AccountBalanceResponse.prototype.getBlockIdentifier=function(){return h.Message.getWrapperField(this,TronWebProto.BlockBalanceTrace.BlockIdentifier,2)},TronWebProto.AccountBalanceResponse.prototype.setBlockIdentifier=function(c){return h.Message.setWrapperField(this,2,c)},TronWebProto.AccountBalanceResponse.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},TronWebProto.AccountBalanceResponse.prototype.hasBlockIdentifier=function(){return h.Message.getField(this,2)!=null},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.FreezeBalanceV2Contract.prototype.toObject=function(c){return TronWebProto.FreezeBalanceV2Contract.toObject(c,this)},TronWebProto.FreezeBalanceV2Contract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),frozenBalance:h.Message.getFieldWithDefault(d,2,0),resource:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.FreezeBalanceV2Contract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.FreezeBalanceV2Contract;return TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader(p,d)},TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readInt64();c.setFrozenBalance(m);break;case 3:var m=d.readEnum();c.setResource(m);break;default:d.skipField();break}}return c},TronWebProto.FreezeBalanceV2Contract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getFrozenBalance(),p!==0&&d.writeInt64(2,p),p=c.getResource(),p!==0&&d.writeEnum(3,p)},TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.FreezeBalanceV2Contract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.FreezeBalanceV2Contract.prototype.getFrozenBalance=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.FreezeBalanceV2Contract.prototype.setFrozenBalance=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.FreezeBalanceV2Contract.prototype.getResource=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.FreezeBalanceV2Contract.prototype.setResource=function(c){return h.Message.setProto3EnumField(this,3,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnfreezeBalanceV2Contract.prototype.toObject=function(c){return TronWebProto.UnfreezeBalanceV2Contract.toObject(c,this)},TronWebProto.UnfreezeBalanceV2Contract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),unfreezeBalance:h.Message.getFieldWithDefault(d,2,0),resource:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.UnfreezeBalanceV2Contract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.UnfreezeBalanceV2Contract;return TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader(p,d)},TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readInt64();c.setUnfreezeBalance(m);break;case 3:var m=d.readEnum();c.setResource(m);break;default:d.skipField();break}}return c},TronWebProto.UnfreezeBalanceV2Contract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getUnfreezeBalance(),p!==0&&d.writeInt64(2,p),p=c.getResource(),p!==0&&d.writeEnum(3,p)},TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceV2Contract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.UnfreezeBalanceV2Contract.prototype.getUnfreezeBalance=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.UnfreezeBalanceV2Contract.prototype.setUnfreezeBalance=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.UnfreezeBalanceV2Contract.prototype.getResource=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.UnfreezeBalanceV2Contract.prototype.setResource=function(c){return h.Message.setProto3EnumField(this,3,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.WithdrawExpireUnfreezeContract.prototype.toObject=function(c){return TronWebProto.WithdrawExpireUnfreezeContract.toObject(c,this)},TronWebProto.WithdrawExpireUnfreezeContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.WithdrawExpireUnfreezeContract;return TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader(p,d)},TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;default:d.skipField();break}}return c},TronWebProto.WithdrawExpireUnfreezeContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p)},TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WithdrawExpireUnfreezeContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.DelegateResourceContract.prototype.toObject=function(c){return TronWebProto.DelegateResourceContract.toObject(c,this)},TronWebProto.DelegateResourceContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),resource:h.Message.getFieldWithDefault(d,2,0),balance:h.Message.getFieldWithDefault(d,3,0),receiverAddress:d.getReceiverAddress_asB64(),lock:h.Message.getBooleanFieldWithDefault(d,5,!1),lockPeriod:h.Message.getFieldWithDefault(d,6,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.DelegateResourceContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.DelegateResourceContract;return TronWebProto.DelegateResourceContract.deserializeBinaryFromReader(p,d)},TronWebProto.DelegateResourceContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readEnum();c.setResource(m);break;case 3:var m=d.readInt64();c.setBalance(m);break;case 4:var m=d.readBytes();c.setReceiverAddress(m);break;case 5:var m=d.readBool();c.setLock(m);break;case 6:var m=d.readInt64();c.setLockPeriod(m);break;default:d.skipField();break}}return c},TronWebProto.DelegateResourceContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.DelegateResourceContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.DelegateResourceContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getResource(),p!==0&&d.writeEnum(2,p),p=c.getBalance(),p!==0&&d.writeInt64(3,p),p=c.getReceiverAddress_asU8(),p.length>0&&d.writeBytes(4,p),p=c.getLock(),p&&d.writeBool(5,p),p=c.getLockPeriod(),p!==0&&d.writeInt64(6,p)},TronWebProto.DelegateResourceContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.DelegateResourceContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.DelegateResourceContract.prototype.getResource=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.DelegateResourceContract.prototype.setResource=function(c){return h.Message.setProto3EnumField(this,2,c)},TronWebProto.DelegateResourceContract.prototype.getBalance=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.DelegateResourceContract.prototype.setBalance=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.DelegateResourceContract.prototype.getReceiverAddress=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asB64=function(){return h.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asU8=function(){return h.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.DelegateResourceContract.prototype.setReceiverAddress=function(c){return h.Message.setProto3BytesField(this,4,c)},TronWebProto.DelegateResourceContract.prototype.getLock=function(){return h.Message.getBooleanFieldWithDefault(this,5,!1)},TronWebProto.DelegateResourceContract.prototype.setLock=function(c){return h.Message.setProto3BooleanField(this,5,c)},TronWebProto.DelegateResourceContract.prototype.getLockPeriod=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.DelegateResourceContract.prototype.setLockPeriod=function(c){return h.Message.setProto3IntField(this,6,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnDelegateResourceContract.prototype.toObject=function(c){return TronWebProto.UnDelegateResourceContract.toObject(c,this)},TronWebProto.UnDelegateResourceContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),resource:h.Message.getFieldWithDefault(d,2,0),balance:h.Message.getFieldWithDefault(d,3,0),receiverAddress:d.getReceiverAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.UnDelegateResourceContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.UnDelegateResourceContract;return TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader(p,d)},TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readEnum();c.setResource(m);break;case 3:var m=d.readInt64();c.setBalance(m);break;case 4:var m=d.readBytes();c.setReceiverAddress(m);break;default:d.skipField();break}}return c},TronWebProto.UnDelegateResourceContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getResource(),p!==0&&d.writeEnum(2,p),p=c.getBalance(),p!==0&&d.writeInt64(3,p),p=c.getReceiverAddress_asU8(),p.length>0&&d.writeBytes(4,p)},TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnDelegateResourceContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.UnDelegateResourceContract.prototype.getResource=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.UnDelegateResourceContract.prototype.setResource=function(c){return h.Message.setProto3EnumField(this,2,c)},TronWebProto.UnDelegateResourceContract.prototype.getBalance=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.UnDelegateResourceContract.prototype.setBalance=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asB64=function(){return h.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asU8=function(){return h.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.UnDelegateResourceContract.prototype.setReceiverAddress=function(c){return h.Message.setProto3BytesField(this,4,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.CancelAllUnfreezeV2Contract.prototype.toObject=function(c){return TronWebProto.CancelAllUnfreezeV2Contract.toObject(c,this)},TronWebProto.CancelAllUnfreezeV2Contract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.CancelAllUnfreezeV2Contract;return TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader(p,d)},TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;default:d.skipField();break}}return c},TronWebProto.CancelAllUnfreezeV2Contract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p)},TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.CancelAllUnfreezeV2Contract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},w.object.extend(f,TronWebProto)},97899:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")();w.exportSymbol("TronWebProto.ResourceCode",null,E),TronWebProto.ResourceCode={BANDWIDTH:0,ENERGY:1,TRON_POWER:2},w.object.extend(f,TronWebProto)},53440:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")();w.exportSymbol("TronWebProto.ExchangeCreateContract",null,E),w.exportSymbol("TronWebProto.ExchangeInjectContract",null,E),w.exportSymbol("TronWebProto.ExchangeTransactionContract",null,E),w.exportSymbol("TronWebProto.ExchangeWithdrawContract",null,E),TronWebProto.ExchangeCreateContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ExchangeCreateContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ExchangeCreateContract.displayName="TronWebProto.ExchangeCreateContract"),TronWebProto.ExchangeInjectContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ExchangeInjectContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ExchangeInjectContract.displayName="TronWebProto.ExchangeInjectContract"),TronWebProto.ExchangeWithdrawContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ExchangeWithdrawContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ExchangeWithdrawContract.displayName="TronWebProto.ExchangeWithdrawContract"),TronWebProto.ExchangeTransactionContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ExchangeTransactionContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ExchangeTransactionContract.displayName="TronWebProto.ExchangeTransactionContract"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ExchangeCreateContract.prototype.toObject=function(v){return TronWebProto.ExchangeCreateContract.toObject(v,this)},TronWebProto.ExchangeCreateContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),firstTokenId:c.getFirstTokenId_asB64(),firstTokenBalance:h.Message.getFieldWithDefault(c,3,0),secondTokenId:c.getSecondTokenId_asB64(),secondTokenBalance:h.Message.getFieldWithDefault(c,5,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ExchangeCreateContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ExchangeCreateContract;return TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader(d,c)},TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readBytes();v.setFirstTokenId(p);break;case 3:var p=c.readInt64();v.setFirstTokenBalance(p);break;case 4:var p=c.readBytes();v.setSecondTokenId(p);break;case 5:var p=c.readInt64();v.setSecondTokenBalance(p);break;default:c.skipField();break}}return v},TronWebProto.ExchangeCreateContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ExchangeCreateContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ExchangeCreateContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getFirstTokenId_asU8(),d.length>0&&c.writeBytes(2,d),d=v.getFirstTokenBalance(),d!==0&&c.writeInt64(3,d),d=v.getSecondTokenId_asU8(),d.length>0&&c.writeBytes(4,d),d=v.getSecondTokenBalance(),d!==0&&c.writeInt64(5,d)},TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeCreateContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asB64=function(){return h.Message.bytesAsB64(this.getFirstTokenId())},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asU8=function(){return h.Message.bytesAsU8(this.getFirstTokenId())},TronWebProto.ExchangeCreateContract.prototype.setFirstTokenId=function(v){return h.Message.setProto3BytesField(this,2,v)},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenBalance=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.ExchangeCreateContract.prototype.setFirstTokenBalance=function(v){return h.Message.setProto3IntField(this,3,v)},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asB64=function(){return h.Message.bytesAsB64(this.getSecondTokenId())},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asU8=function(){return h.Message.bytesAsU8(this.getSecondTokenId())},TronWebProto.ExchangeCreateContract.prototype.setSecondTokenId=function(v){return h.Message.setProto3BytesField(this,4,v)},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenBalance=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.ExchangeCreateContract.prototype.setSecondTokenBalance=function(v){return h.Message.setProto3IntField(this,5,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ExchangeInjectContract.prototype.toObject=function(v){return TronWebProto.ExchangeInjectContract.toObject(v,this)},TronWebProto.ExchangeInjectContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),exchangeId:h.Message.getFieldWithDefault(c,2,0),tokenId:c.getTokenId_asB64(),quant:h.Message.getFieldWithDefault(c,4,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ExchangeInjectContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ExchangeInjectContract;return TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader(d,c)},TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setExchangeId(p);break;case 3:var p=c.readBytes();v.setTokenId(p);break;case 4:var p=c.readInt64();v.setQuant(p);break;default:c.skipField();break}}return v},TronWebProto.ExchangeInjectContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ExchangeInjectContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ExchangeInjectContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getExchangeId(),d!==0&&c.writeInt64(2,d),d=v.getTokenId_asU8(),d.length>0&&c.writeBytes(3,d),d=v.getQuant(),d!==0&&c.writeInt64(4,d)},TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeInjectContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ExchangeInjectContract.prototype.getExchangeId=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.ExchangeInjectContract.prototype.setExchangeId=function(v){return h.Message.setProto3IntField(this,2,v)},TronWebProto.ExchangeInjectContract.prototype.getTokenId=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.ExchangeInjectContract.prototype.getTokenId_asB64=function(){return h.Message.bytesAsB64(this.getTokenId())},TronWebProto.ExchangeInjectContract.prototype.getTokenId_asU8=function(){return h.Message.bytesAsU8(this.getTokenId())},TronWebProto.ExchangeInjectContract.prototype.setTokenId=function(v){return h.Message.setProto3BytesField(this,3,v)},TronWebProto.ExchangeInjectContract.prototype.getQuant=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.ExchangeInjectContract.prototype.setQuant=function(v){return h.Message.setProto3IntField(this,4,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ExchangeWithdrawContract.prototype.toObject=function(v){return TronWebProto.ExchangeWithdrawContract.toObject(v,this)},TronWebProto.ExchangeWithdrawContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),exchangeId:h.Message.getFieldWithDefault(c,2,0),tokenId:c.getTokenId_asB64(),quant:h.Message.getFieldWithDefault(c,4,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ExchangeWithdrawContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ExchangeWithdrawContract;return TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader(d,c)},TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setExchangeId(p);break;case 3:var p=c.readBytes();v.setTokenId(p);break;case 4:var p=c.readInt64();v.setQuant(p);break;default:c.skipField();break}}return v},TronWebProto.ExchangeWithdrawContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getExchangeId(),d!==0&&c.writeInt64(2,d),d=v.getTokenId_asU8(),d.length>0&&c.writeBytes(3,d),d=v.getQuant(),d!==0&&c.writeInt64(4,d)},TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeWithdrawContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ExchangeWithdrawContract.prototype.getExchangeId=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.ExchangeWithdrawContract.prototype.setExchangeId=function(v){return h.Message.setProto3IntField(this,2,v)},TronWebProto.ExchangeWithdrawContract.prototype.getTokenId=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asB64=function(){return h.Message.bytesAsB64(this.getTokenId())},TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asU8=function(){return h.Message.bytesAsU8(this.getTokenId())},TronWebProto.ExchangeWithdrawContract.prototype.setTokenId=function(v){return h.Message.setProto3BytesField(this,3,v)},TronWebProto.ExchangeWithdrawContract.prototype.getQuant=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.ExchangeWithdrawContract.prototype.setQuant=function(v){return h.Message.setProto3IntField(this,4,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ExchangeTransactionContract.prototype.toObject=function(v){return TronWebProto.ExchangeTransactionContract.toObject(v,this)},TronWebProto.ExchangeTransactionContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),exchangeId:h.Message.getFieldWithDefault(c,2,0),tokenId:c.getTokenId_asB64(),quant:h.Message.getFieldWithDefault(c,4,0),expected:h.Message.getFieldWithDefault(c,5,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ExchangeTransactionContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ExchangeTransactionContract;return TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader(d,c)},TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setExchangeId(p);break;case 3:var p=c.readBytes();v.setTokenId(p);break;case 4:var p=c.readInt64();v.setQuant(p);break;case 5:var p=c.readInt64();v.setExpected(p);break;default:c.skipField();break}}return v},TronWebProto.ExchangeTransactionContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getExchangeId(),d!==0&&c.writeInt64(2,d),d=v.getTokenId_asU8(),d.length>0&&c.writeBytes(3,d),d=v.getQuant(),d!==0&&c.writeInt64(4,d),d=v.getExpected(),d!==0&&c.writeInt64(5,d)},TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeTransactionContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ExchangeTransactionContract.prototype.getExchangeId=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.ExchangeTransactionContract.prototype.setExchangeId=function(v){return h.Message.setProto3IntField(this,2,v)},TronWebProto.ExchangeTransactionContract.prototype.getTokenId=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asB64=function(){return h.Message.bytesAsB64(this.getTokenId())},TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asU8=function(){return h.Message.bytesAsU8(this.getTokenId())},TronWebProto.ExchangeTransactionContract.prototype.setTokenId=function(v){return h.Message.setProto3BytesField(this,3,v)},TronWebProto.ExchangeTransactionContract.prototype.getQuant=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.ExchangeTransactionContract.prototype.setQuant=function(v){return h.Message.setProto3IntField(this,4,v)},TronWebProto.ExchangeTransactionContract.prototype.getExpected=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.ExchangeTransactionContract.prototype.setExpected=function(v){return h.Message.setProto3IntField(this,5,v)},w.object.extend(f,TronWebProto)},853:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")();w.exportSymbol("TronWebProto.ProposalApproveContract",null,E),w.exportSymbol("TronWebProto.ProposalCreateContract",null,E),w.exportSymbol("TronWebProto.ProposalDeleteContract",null,E),TronWebProto.ProposalApproveContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ProposalApproveContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ProposalApproveContract.displayName="TronWebProto.ProposalApproveContract"),TronWebProto.ProposalCreateContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ProposalCreateContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ProposalCreateContract.displayName="TronWebProto.ProposalCreateContract"),TronWebProto.ProposalDeleteContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.ProposalDeleteContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ProposalDeleteContract.displayName="TronWebProto.ProposalDeleteContract"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ProposalApproveContract.prototype.toObject=function(v){return TronWebProto.ProposalApproveContract.toObject(v,this)},TronWebProto.ProposalApproveContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),proposalId:h.Message.getFieldWithDefault(c,2,0),isAddApproval:h.Message.getBooleanFieldWithDefault(c,3,!1)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ProposalApproveContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ProposalApproveContract;return TronWebProto.ProposalApproveContract.deserializeBinaryFromReader(d,c)},TronWebProto.ProposalApproveContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setProposalId(p);break;case 3:var p=c.readBool();v.setIsAddApproval(p);break;default:c.skipField();break}}return v},TronWebProto.ProposalApproveContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ProposalApproveContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ProposalApproveContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getProposalId(),d!==0&&c.writeInt64(2,d),d=v.getIsAddApproval(),d&&c.writeBool(3,d)},TronWebProto.ProposalApproveContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ProposalApproveContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ProposalApproveContract.prototype.getProposalId=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.ProposalApproveContract.prototype.setProposalId=function(v){return h.Message.setProto3IntField(this,2,v)},TronWebProto.ProposalApproveContract.prototype.getIsAddApproval=function(){return h.Message.getBooleanFieldWithDefault(this,3,!1)},TronWebProto.ProposalApproveContract.prototype.setIsAddApproval=function(v){return h.Message.setProto3BooleanField(this,3,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ProposalCreateContract.prototype.toObject=function(v){return TronWebProto.ProposalCreateContract.toObject(v,this)},TronWebProto.ProposalCreateContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),parametersMap:(d=c.getParametersMap())?d.toObject(v,void 0):[]};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ProposalCreateContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ProposalCreateContract;return TronWebProto.ProposalCreateContract.deserializeBinaryFromReader(d,c)},TronWebProto.ProposalCreateContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=v.getParametersMap();c.readMessage(p,function(m,C){h.Map.deserializeBinary(m,C,h.BinaryReader.prototype.readInt64,h.BinaryReader.prototype.readInt64,null,0,0)});break;default:c.skipField();break}}return v},TronWebProto.ProposalCreateContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ProposalCreateContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ProposalCreateContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getParametersMap(!0),d&&d.getLength()>0&&d.serializeBinary(2,c,h.BinaryWriter.prototype.writeInt64,h.BinaryWriter.prototype.writeInt64)},TronWebProto.ProposalCreateContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ProposalCreateContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ProposalCreateContract.prototype.getParametersMap=function(v){return h.Message.getMapField(this,2,v,null)},TronWebProto.ProposalCreateContract.prototype.clearParametersMap=function(){return this.getParametersMap().clear(),this},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ProposalDeleteContract.prototype.toObject=function(v){return TronWebProto.ProposalDeleteContract.toObject(v,this)},TronWebProto.ProposalDeleteContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),proposalId:h.Message.getFieldWithDefault(c,2,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.ProposalDeleteContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.ProposalDeleteContract;return TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader(d,c)},TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setProposalId(p);break;default:c.skipField();break}}return v},TronWebProto.ProposalDeleteContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.ProposalDeleteContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.ProposalDeleteContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getProposalId(),d!==0&&c.writeInt64(2,d)},TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ProposalDeleteContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.ProposalDeleteContract.prototype.getProposalId=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.ProposalDeleteContract.prototype.setProposalId=function(v){return h.Message.setProto3IntField(this,2,v)},w.object.extend(f,TronWebProto)},74662:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")(),v=_(11814);w.object.extend(proto,v),w.exportSymbol("TronWebProto.ClearABIContract",null,E),w.exportSymbol("TronWebProto.ContractState",null,E),w.exportSymbol("TronWebProto.CreateSmartContract",null,E),w.exportSymbol("TronWebProto.SmartContract",null,E),w.exportSymbol("TronWebProto.SmartContract.ABI",null,E),w.exportSymbol("TronWebProto.SmartContract.ABI.Entry",null,E),w.exportSymbol("TronWebProto.SmartContract.ABI.Entry.EntryType",null,E),w.exportSymbol("TronWebProto.SmartContract.ABI.Entry.Param",null,E),w.exportSymbol("TronWebProto.SmartContract.ABI.Entry.StateMutabilityType",null,E),w.exportSymbol("TronWebProto.SmartContractDataWrapper",null,E),w.exportSymbol("TronWebProto.TriggerSmartContract",null,E),w.exportSymbol("TronWebProto.UpdateEnergyLimitContract",null,E),w.exportSymbol("TronWebProto.UpdateSettingContract",null,E),TronWebProto.SmartContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.SmartContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.displayName="TronWebProto.SmartContract"),TronWebProto.SmartContract.ABI=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.SmartContract.ABI.repeatedFields_,null)},w.inherits(TronWebProto.SmartContract.ABI,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.ABI.displayName="TronWebProto.SmartContract.ABI"),TronWebProto.SmartContract.ABI.Entry=function(c){h.Message.initialize(this,c,0,-1,TronWebProto.SmartContract.ABI.Entry.repeatedFields_,null)},w.inherits(TronWebProto.SmartContract.ABI.Entry,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.ABI.Entry.displayName="TronWebProto.SmartContract.ABI.Entry"),TronWebProto.SmartContract.ABI.Entry.Param=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.SmartContract.ABI.Entry.Param,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.ABI.Entry.Param.displayName="TronWebProto.SmartContract.ABI.Entry.Param"),TronWebProto.ContractState=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.ContractState,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ContractState.displayName="TronWebProto.ContractState"),TronWebProto.CreateSmartContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.CreateSmartContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.CreateSmartContract.displayName="TronWebProto.CreateSmartContract"),TronWebProto.TriggerSmartContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.TriggerSmartContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.TriggerSmartContract.displayName="TronWebProto.TriggerSmartContract"),TronWebProto.ClearABIContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.ClearABIContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.ClearABIContract.displayName="TronWebProto.ClearABIContract"),TronWebProto.UpdateSettingContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.UpdateSettingContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UpdateSettingContract.displayName="TronWebProto.UpdateSettingContract"),TronWebProto.UpdateEnergyLimitContract=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.UpdateEnergyLimitContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UpdateEnergyLimitContract.displayName="TronWebProto.UpdateEnergyLimitContract"),TronWebProto.SmartContractDataWrapper=function(c){h.Message.initialize(this,c,0,-1,null,null)},w.inherits(TronWebProto.SmartContractDataWrapper,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.SmartContractDataWrapper.displayName="TronWebProto.SmartContractDataWrapper"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.prototype.toObject=function(c){return TronWebProto.SmartContract.toObject(c,this)},TronWebProto.SmartContract.toObject=function(c,d){var p,m={originAddress:d.getOriginAddress_asB64(),contractAddress:d.getContractAddress_asB64(),abi:(p=d.getAbi())&&TronWebProto.SmartContract.ABI.toObject(c,p),bytecode:d.getBytecode_asB64(),callValue:h.Message.getFieldWithDefault(d,5,0),consumeUserResourcePercent:h.Message.getFieldWithDefault(d,6,0),name:h.Message.getFieldWithDefault(d,7,""),originEnergyLimit:h.Message.getFieldWithDefault(d,8,0),codeHash:d.getCodeHash_asB64(),trxHash:d.getTrxHash_asB64(),version:h.Message.getFieldWithDefault(d,11,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.SmartContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.SmartContract;return TronWebProto.SmartContract.deserializeBinaryFromReader(p,d)},TronWebProto.SmartContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOriginAddress(m);break;case 2:var m=d.readBytes();c.setContractAddress(m);break;case 3:var m=new TronWebProto.SmartContract.ABI;d.readMessage(m,TronWebProto.SmartContract.ABI.deserializeBinaryFromReader),c.setAbi(m);break;case 4:var m=d.readBytes();c.setBytecode(m);break;case 5:var m=d.readInt64();c.setCallValue(m);break;case 6:var m=d.readInt64();c.setConsumeUserResourcePercent(m);break;case 7:var m=d.readString();c.setName(m);break;case 8:var m=d.readInt64();c.setOriginEnergyLimit(m);break;case 9:var m=d.readBytes();c.setCodeHash(m);break;case 10:var m=d.readBytes();c.setTrxHash(m);break;case 11:var m=d.readInt32();c.setVersion(m);break;default:d.skipField();break}}return c},TronWebProto.SmartContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.SmartContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.SmartContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOriginAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getContractAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getAbi(),p!=null&&d.writeMessage(3,p,TronWebProto.SmartContract.ABI.serializeBinaryToWriter),p=c.getBytecode_asU8(),p.length>0&&d.writeBytes(4,p),p=c.getCallValue(),p!==0&&d.writeInt64(5,p),p=c.getConsumeUserResourcePercent(),p!==0&&d.writeInt64(6,p),p=c.getName(),p.length>0&&d.writeString(7,p),p=c.getOriginEnergyLimit(),p!==0&&d.writeInt64(8,p),p=c.getCodeHash_asU8(),p.length>0&&d.writeBytes(9,p),p=c.getTrxHash_asU8(),p.length>0&&d.writeBytes(10,p),p=c.getVersion(),p!==0&&d.writeInt32(11,p)},TronWebProto.SmartContract.ABI.repeatedFields_=[1],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.ABI.prototype.toObject=function(c){return TronWebProto.SmartContract.ABI.toObject(c,this)},TronWebProto.SmartContract.ABI.toObject=function(c,d){var p,m={entrysList:h.Message.toObjectList(d.getEntrysList(),TronWebProto.SmartContract.ABI.Entry.toObject,c)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.SmartContract.ABI.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.SmartContract.ABI;return TronWebProto.SmartContract.ABI.deserializeBinaryFromReader(p,d)},TronWebProto.SmartContract.ABI.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=new TronWebProto.SmartContract.ABI.Entry;d.readMessage(m,TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader),c.addEntrys(m);break;default:d.skipField();break}}return c},TronWebProto.SmartContract.ABI.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.SmartContract.ABI.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.SmartContract.ABI.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getEntrysList(),p.length>0&&d.writeRepeatedMessage(1,p,TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter)},TronWebProto.SmartContract.ABI.Entry.repeatedFields_=[4,5],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.ABI.Entry.prototype.toObject=function(c){return TronWebProto.SmartContract.ABI.Entry.toObject(c,this)},TronWebProto.SmartContract.ABI.Entry.toObject=function(c,d){var p,m={anonymous:h.Message.getBooleanFieldWithDefault(d,1,!1),constant:h.Message.getBooleanFieldWithDefault(d,2,!1),name:h.Message.getFieldWithDefault(d,3,""),inputsList:h.Message.toObjectList(d.getInputsList(),TronWebProto.SmartContract.ABI.Entry.Param.toObject,c),outputsList:h.Message.toObjectList(d.getOutputsList(),TronWebProto.SmartContract.ABI.Entry.Param.toObject,c),type:h.Message.getFieldWithDefault(d,6,0),payable:h.Message.getBooleanFieldWithDefault(d,7,!1),statemutability:h.Message.getFieldWithDefault(d,8,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.SmartContract.ABI.Entry.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.SmartContract.ABI.Entry;return TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader(p,d)},TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBool();c.setAnonymous(m);break;case 2:var m=d.readBool();c.setConstant(m);break;case 3:var m=d.readString();c.setName(m);break;case 4:var m=new TronWebProto.SmartContract.ABI.Entry.Param;d.readMessage(m,TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader),c.addInputs(m);break;case 5:var m=new TronWebProto.SmartContract.ABI.Entry.Param;d.readMessage(m,TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader),c.addOutputs(m);break;case 6:var m=d.readEnum();c.setType(m);break;case 7:var m=d.readBool();c.setPayable(m);break;case 8:var m=d.readEnum();c.setStatemutability(m);break;default:d.skipField();break}}return c},TronWebProto.SmartContract.ABI.Entry.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getAnonymous(),p&&d.writeBool(1,p),p=c.getConstant(),p&&d.writeBool(2,p),p=c.getName(),p.length>0&&d.writeString(3,p),p=c.getInputsList(),p.length>0&&d.writeRepeatedMessage(4,p,TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter),p=c.getOutputsList(),p.length>0&&d.writeRepeatedMessage(5,p,TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter),p=c.getType(),p!==0&&d.writeEnum(6,p),p=c.getPayable(),p&&d.writeBool(7,p),p=c.getStatemutability(),p!==0&&d.writeEnum(8,p)},TronWebProto.SmartContract.ABI.Entry.EntryType={UNKNOWNENTRYTYPE:0,CONSTRUCTOR:1,FUNCTION:2,EVENT:3,FALLBACK:4,RECEIVE:5,ERROR:6},TronWebProto.SmartContract.ABI.Entry.StateMutabilityType={UNKNOWNMUTABILITYTYPE:0,PURE:1,VIEW:2,NONPAYABLE:3,PAYABLE:4},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.ABI.Entry.Param.prototype.toObject=function(c){return TronWebProto.SmartContract.ABI.Entry.Param.toObject(c,this)},TronWebProto.SmartContract.ABI.Entry.Param.toObject=function(c,d){var p,m={indexed:h.Message.getBooleanFieldWithDefault(d,1,!1),name:h.Message.getFieldWithDefault(d,2,""),type:h.Message.getFieldWithDefault(d,3,"")};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.SmartContract.ABI.Entry.Param;return TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader(p,d)},TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBool();c.setIndexed(m);break;case 2:var m=d.readString();c.setName(m);break;case 3:var m=d.readString();c.setType(m);break;default:d.skipField();break}}return c},TronWebProto.SmartContract.ABI.Entry.Param.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getIndexed(),p&&d.writeBool(1,p),p=c.getName(),p.length>0&&d.writeString(2,p),p=c.getType(),p.length>0&&d.writeString(3,p)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.getIndexed=function(){return h.Message.getBooleanFieldWithDefault(this,1,!1)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.setIndexed=function(c){return h.Message.setProto3BooleanField(this,1,c)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.getName=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.SmartContract.ABI.Entry.Param.prototype.setName=function(c){return h.Message.setProto3StringField(this,2,c)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.getType=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.SmartContract.ABI.Entry.Param.prototype.setType=function(c){return h.Message.setProto3StringField(this,3,c)},TronWebProto.SmartContract.ABI.Entry.prototype.getAnonymous=function(){return h.Message.getBooleanFieldWithDefault(this,1,!1)},TronWebProto.SmartContract.ABI.Entry.prototype.setAnonymous=function(c){return h.Message.setProto3BooleanField(this,1,c)},TronWebProto.SmartContract.ABI.Entry.prototype.getConstant=function(){return h.Message.getBooleanFieldWithDefault(this,2,!1)},TronWebProto.SmartContract.ABI.Entry.prototype.setConstant=function(c){return h.Message.setProto3BooleanField(this,2,c)},TronWebProto.SmartContract.ABI.Entry.prototype.getName=function(){return h.Message.getFieldWithDefault(this,3,"")},TronWebProto.SmartContract.ABI.Entry.prototype.setName=function(c){return h.Message.setProto3StringField(this,3,c)},TronWebProto.SmartContract.ABI.Entry.prototype.getInputsList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.SmartContract.ABI.Entry.Param,4)},TronWebProto.SmartContract.ABI.Entry.prototype.setInputsList=function(c){return h.Message.setRepeatedWrapperField(this,4,c)},TronWebProto.SmartContract.ABI.Entry.prototype.addInputs=function(c,d){return h.Message.addToRepeatedWrapperField(this,4,c,TronWebProto.SmartContract.ABI.Entry.Param,d)},TronWebProto.SmartContract.ABI.Entry.prototype.clearInputsList=function(){return this.setInputsList([])},TronWebProto.SmartContract.ABI.Entry.prototype.getOutputsList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.SmartContract.ABI.Entry.Param,5)},TronWebProto.SmartContract.ABI.Entry.prototype.setOutputsList=function(c){return h.Message.setRepeatedWrapperField(this,5,c)},TronWebProto.SmartContract.ABI.Entry.prototype.addOutputs=function(c,d){return h.Message.addToRepeatedWrapperField(this,5,c,TronWebProto.SmartContract.ABI.Entry.Param,d)},TronWebProto.SmartContract.ABI.Entry.prototype.clearOutputsList=function(){return this.setOutputsList([])},TronWebProto.SmartContract.ABI.Entry.prototype.getType=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.SmartContract.ABI.Entry.prototype.setType=function(c){return h.Message.setProto3EnumField(this,6,c)},TronWebProto.SmartContract.ABI.Entry.prototype.getPayable=function(){return h.Message.getBooleanFieldWithDefault(this,7,!1)},TronWebProto.SmartContract.ABI.Entry.prototype.setPayable=function(c){return h.Message.setProto3BooleanField(this,7,c)},TronWebProto.SmartContract.ABI.Entry.prototype.getStatemutability=function(){return h.Message.getFieldWithDefault(this,8,0)},TronWebProto.SmartContract.ABI.Entry.prototype.setStatemutability=function(c){return h.Message.setProto3EnumField(this,8,c)},TronWebProto.SmartContract.ABI.prototype.getEntrysList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.SmartContract.ABI.Entry,1)},TronWebProto.SmartContract.ABI.prototype.setEntrysList=function(c){return h.Message.setRepeatedWrapperField(this,1,c)},TronWebProto.SmartContract.ABI.prototype.addEntrys=function(c,d){return h.Message.addToRepeatedWrapperField(this,1,c,TronWebProto.SmartContract.ABI.Entry,d)},TronWebProto.SmartContract.ABI.prototype.clearEntrysList=function(){return this.setEntrysList([])},TronWebProto.SmartContract.prototype.getOriginAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.SmartContract.prototype.getOriginAddress_asB64=function(){return h.Message.bytesAsB64(this.getOriginAddress())},TronWebProto.SmartContract.prototype.getOriginAddress_asU8=function(){return h.Message.bytesAsU8(this.getOriginAddress())},TronWebProto.SmartContract.prototype.setOriginAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.SmartContract.prototype.getContractAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.SmartContract.prototype.getContractAddress_asB64=function(){return h.Message.bytesAsB64(this.getContractAddress())},TronWebProto.SmartContract.prototype.getContractAddress_asU8=function(){return h.Message.bytesAsU8(this.getContractAddress())},TronWebProto.SmartContract.prototype.setContractAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.SmartContract.prototype.getAbi=function(){return h.Message.getWrapperField(this,TronWebProto.SmartContract.ABI,3)},TronWebProto.SmartContract.prototype.setAbi=function(c){return h.Message.setWrapperField(this,3,c)},TronWebProto.SmartContract.prototype.clearAbi=function(){return this.setAbi(void 0)},TronWebProto.SmartContract.prototype.hasAbi=function(){return h.Message.getField(this,3)!=null},TronWebProto.SmartContract.prototype.getBytecode=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.SmartContract.prototype.getBytecode_asB64=function(){return h.Message.bytesAsB64(this.getBytecode())},TronWebProto.SmartContract.prototype.getBytecode_asU8=function(){return h.Message.bytesAsU8(this.getBytecode())},TronWebProto.SmartContract.prototype.setBytecode=function(c){return h.Message.setProto3BytesField(this,4,c)},TronWebProto.SmartContract.prototype.getCallValue=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.SmartContract.prototype.setCallValue=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.SmartContract.prototype.getConsumeUserResourcePercent=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.SmartContract.prototype.setConsumeUserResourcePercent=function(c){return h.Message.setProto3IntField(this,6,c)},TronWebProto.SmartContract.prototype.getName=function(){return h.Message.getFieldWithDefault(this,7,"")},TronWebProto.SmartContract.prototype.setName=function(c){return h.Message.setProto3StringField(this,7,c)},TronWebProto.SmartContract.prototype.getOriginEnergyLimit=function(){return h.Message.getFieldWithDefault(this,8,0)},TronWebProto.SmartContract.prototype.setOriginEnergyLimit=function(c){return h.Message.setProto3IntField(this,8,c)},TronWebProto.SmartContract.prototype.getCodeHash=function(){return h.Message.getFieldWithDefault(this,9,"")},TronWebProto.SmartContract.prototype.getCodeHash_asB64=function(){return h.Message.bytesAsB64(this.getCodeHash())},TronWebProto.SmartContract.prototype.getCodeHash_asU8=function(){return h.Message.bytesAsU8(this.getCodeHash())},TronWebProto.SmartContract.prototype.setCodeHash=function(c){return h.Message.setProto3BytesField(this,9,c)},TronWebProto.SmartContract.prototype.getTrxHash=function(){return h.Message.getFieldWithDefault(this,10,"")},TronWebProto.SmartContract.prototype.getTrxHash_asB64=function(){return h.Message.bytesAsB64(this.getTrxHash())},TronWebProto.SmartContract.prototype.getTrxHash_asU8=function(){return h.Message.bytesAsU8(this.getTrxHash())},TronWebProto.SmartContract.prototype.setTrxHash=function(c){return h.Message.setProto3BytesField(this,10,c)},TronWebProto.SmartContract.prototype.getVersion=function(){return h.Message.getFieldWithDefault(this,11,0)},TronWebProto.SmartContract.prototype.setVersion=function(c){return h.Message.setProto3IntField(this,11,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ContractState.prototype.toObject=function(c){return TronWebProto.ContractState.toObject(c,this)},TronWebProto.ContractState.toObject=function(c,d){var p,m={energyUsage:h.Message.getFieldWithDefault(d,1,0),energyFactor:h.Message.getFieldWithDefault(d,2,0),updateCycle:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.ContractState.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.ContractState;return TronWebProto.ContractState.deserializeBinaryFromReader(p,d)},TronWebProto.ContractState.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readInt64();c.setEnergyUsage(m);break;case 2:var m=d.readInt64();c.setEnergyFactor(m);break;case 3:var m=d.readInt64();c.setUpdateCycle(m);break;default:d.skipField();break}}return c},TronWebProto.ContractState.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.ContractState.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.ContractState.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getEnergyUsage(),p!==0&&d.writeInt64(1,p),p=c.getEnergyFactor(),p!==0&&d.writeInt64(2,p),p=c.getUpdateCycle(),p!==0&&d.writeInt64(3,p)},TronWebProto.ContractState.prototype.getEnergyUsage=function(){return h.Message.getFieldWithDefault(this,1,0)},TronWebProto.ContractState.prototype.setEnergyUsage=function(c){return h.Message.setProto3IntField(this,1,c)},TronWebProto.ContractState.prototype.getEnergyFactor=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.ContractState.prototype.setEnergyFactor=function(c){return h.Message.setProto3IntField(this,2,c)},TronWebProto.ContractState.prototype.getUpdateCycle=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.ContractState.prototype.setUpdateCycle=function(c){return h.Message.setProto3IntField(this,3,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.CreateSmartContract.prototype.toObject=function(c){return TronWebProto.CreateSmartContract.toObject(c,this)},TronWebProto.CreateSmartContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),newContract:(p=d.getNewContract())&&TronWebProto.SmartContract.toObject(c,p),callTokenValue:h.Message.getFieldWithDefault(d,3,0),tokenId:h.Message.getFieldWithDefault(d,4,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.CreateSmartContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.CreateSmartContract;return TronWebProto.CreateSmartContract.deserializeBinaryFromReader(p,d)},TronWebProto.CreateSmartContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=new TronWebProto.SmartContract;d.readMessage(m,TronWebProto.SmartContract.deserializeBinaryFromReader),c.setNewContract(m);break;case 3:var m=d.readInt64();c.setCallTokenValue(m);break;case 4:var m=d.readInt64();c.setTokenId(m);break;default:d.skipField();break}}return c},TronWebProto.CreateSmartContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.CreateSmartContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.CreateSmartContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getNewContract(),p!=null&&d.writeMessage(2,p,TronWebProto.SmartContract.serializeBinaryToWriter),p=c.getCallTokenValue(),p!==0&&d.writeInt64(3,p),p=c.getTokenId(),p!==0&&d.writeInt64(4,p)},TronWebProto.CreateSmartContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.CreateSmartContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.CreateSmartContract.prototype.getNewContract=function(){return h.Message.getWrapperField(this,TronWebProto.SmartContract,2)},TronWebProto.CreateSmartContract.prototype.setNewContract=function(c){return h.Message.setWrapperField(this,2,c)},TronWebProto.CreateSmartContract.prototype.clearNewContract=function(){return this.setNewContract(void 0)},TronWebProto.CreateSmartContract.prototype.hasNewContract=function(){return h.Message.getField(this,2)!=null},TronWebProto.CreateSmartContract.prototype.getCallTokenValue=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.CreateSmartContract.prototype.setCallTokenValue=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.CreateSmartContract.prototype.getTokenId=function(){return h.Message.getFieldWithDefault(this,4,0)},TronWebProto.CreateSmartContract.prototype.setTokenId=function(c){return h.Message.setProto3IntField(this,4,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.TriggerSmartContract.prototype.toObject=function(c){return TronWebProto.TriggerSmartContract.toObject(c,this)},TronWebProto.TriggerSmartContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),contractAddress:d.getContractAddress_asB64(),callValue:h.Message.getFieldWithDefault(d,3,0),data:d.getData_asB64(),callTokenValue:h.Message.getFieldWithDefault(d,5,0),tokenId:h.Message.getFieldWithDefault(d,6,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.TriggerSmartContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.TriggerSmartContract;return TronWebProto.TriggerSmartContract.deserializeBinaryFromReader(p,d)},TronWebProto.TriggerSmartContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readBytes();c.setContractAddress(m);break;case 3:var m=d.readInt64();c.setCallValue(m);break;case 4:var m=d.readBytes();c.setData(m);break;case 5:var m=d.readInt64();c.setCallTokenValue(m);break;case 6:var m=d.readInt64();c.setTokenId(m);break;default:d.skipField();break}}return c},TronWebProto.TriggerSmartContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.TriggerSmartContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.TriggerSmartContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getContractAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getCallValue(),p!==0&&d.writeInt64(3,p),p=c.getData_asU8(),p.length>0&&d.writeBytes(4,p),p=c.getCallTokenValue(),p!==0&&d.writeInt64(5,p),p=c.getTokenId(),p!==0&&d.writeInt64(6,p)},TronWebProto.TriggerSmartContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.TriggerSmartContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.TriggerSmartContract.prototype.getContractAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.TriggerSmartContract.prototype.getContractAddress_asB64=function(){return h.Message.bytesAsB64(this.getContractAddress())},TronWebProto.TriggerSmartContract.prototype.getContractAddress_asU8=function(){return h.Message.bytesAsU8(this.getContractAddress())},TronWebProto.TriggerSmartContract.prototype.setContractAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.TriggerSmartContract.prototype.getCallValue=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.TriggerSmartContract.prototype.setCallValue=function(c){return h.Message.setProto3IntField(this,3,c)},TronWebProto.TriggerSmartContract.prototype.getData=function(){return h.Message.getFieldWithDefault(this,4,"")},TronWebProto.TriggerSmartContract.prototype.getData_asB64=function(){return h.Message.bytesAsB64(this.getData())},TronWebProto.TriggerSmartContract.prototype.getData_asU8=function(){return h.Message.bytesAsU8(this.getData())},TronWebProto.TriggerSmartContract.prototype.setData=function(c){return h.Message.setProto3BytesField(this,4,c)},TronWebProto.TriggerSmartContract.prototype.getCallTokenValue=function(){return h.Message.getFieldWithDefault(this,5,0)},TronWebProto.TriggerSmartContract.prototype.setCallTokenValue=function(c){return h.Message.setProto3IntField(this,5,c)},TronWebProto.TriggerSmartContract.prototype.getTokenId=function(){return h.Message.getFieldWithDefault(this,6,0)},TronWebProto.TriggerSmartContract.prototype.setTokenId=function(c){return h.Message.setProto3IntField(this,6,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.ClearABIContract.prototype.toObject=function(c){return TronWebProto.ClearABIContract.toObject(c,this)},TronWebProto.ClearABIContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),contractAddress:d.getContractAddress_asB64()};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.ClearABIContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.ClearABIContract;return TronWebProto.ClearABIContract.deserializeBinaryFromReader(p,d)},TronWebProto.ClearABIContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readBytes();c.setContractAddress(m);break;default:d.skipField();break}}return c},TronWebProto.ClearABIContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.ClearABIContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.ClearABIContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getContractAddress_asU8(),p.length>0&&d.writeBytes(2,p)},TronWebProto.ClearABIContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.ClearABIContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ClearABIContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ClearABIContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.ClearABIContract.prototype.getContractAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.ClearABIContract.prototype.getContractAddress_asB64=function(){return h.Message.bytesAsB64(this.getContractAddress())},TronWebProto.ClearABIContract.prototype.getContractAddress_asU8=function(){return h.Message.bytesAsU8(this.getContractAddress())},TronWebProto.ClearABIContract.prototype.setContractAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateSettingContract.prototype.toObject=function(c){return TronWebProto.UpdateSettingContract.toObject(c,this)},TronWebProto.UpdateSettingContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),contractAddress:d.getContractAddress_asB64(),consumeUserResourcePercent:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.UpdateSettingContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.UpdateSettingContract;return TronWebProto.UpdateSettingContract.deserializeBinaryFromReader(p,d)},TronWebProto.UpdateSettingContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readBytes();c.setContractAddress(m);break;case 3:var m=d.readInt64();c.setConsumeUserResourcePercent(m);break;default:d.skipField();break}}return c},TronWebProto.UpdateSettingContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.UpdateSettingContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.UpdateSettingContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getContractAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getConsumeUserResourcePercent(),p!==0&&d.writeInt64(3,p)},TronWebProto.UpdateSettingContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateSettingContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.UpdateSettingContract.prototype.getContractAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.UpdateSettingContract.prototype.getContractAddress_asB64=function(){return h.Message.bytesAsB64(this.getContractAddress())},TronWebProto.UpdateSettingContract.prototype.getContractAddress_asU8=function(){return h.Message.bytesAsU8(this.getContractAddress())},TronWebProto.UpdateSettingContract.prototype.setContractAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.UpdateSettingContract.prototype.getConsumeUserResourcePercent=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.UpdateSettingContract.prototype.setConsumeUserResourcePercent=function(c){return h.Message.setProto3IntField(this,3,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateEnergyLimitContract.prototype.toObject=function(c){return TronWebProto.UpdateEnergyLimitContract.toObject(c,this)},TronWebProto.UpdateEnergyLimitContract.toObject=function(c,d){var p,m={ownerAddress:d.getOwnerAddress_asB64(),contractAddress:d.getContractAddress_asB64(),originEnergyLimit:h.Message.getFieldWithDefault(d,3,0)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.UpdateEnergyLimitContract.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.UpdateEnergyLimitContract;return TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader(p,d)},TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=d.readBytes();c.setOwnerAddress(m);break;case 2:var m=d.readBytes();c.setContractAddress(m);break;case 3:var m=d.readInt64();c.setOriginEnergyLimit(m);break;default:d.skipField();break}}return c},TronWebProto.UpdateEnergyLimitContract.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getOwnerAddress_asU8(),p.length>0&&d.writeBytes(1,p),p=c.getContractAddress_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getOriginEnergyLimit(),p!==0&&d.writeInt64(3,p)},TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.setOwnerAddress=function(c){return h.Message.setProto3BytesField(this,1,c)},TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asB64=function(){return h.Message.bytesAsB64(this.getContractAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asU8=function(){return h.Message.bytesAsU8(this.getContractAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.setContractAddress=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.UpdateEnergyLimitContract.prototype.getOriginEnergyLimit=function(){return h.Message.getFieldWithDefault(this,3,0)},TronWebProto.UpdateEnergyLimitContract.prototype.setOriginEnergyLimit=function(c){return h.Message.setProto3IntField(this,3,c)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContractDataWrapper.prototype.toObject=function(c){return TronWebProto.SmartContractDataWrapper.toObject(c,this)},TronWebProto.SmartContractDataWrapper.toObject=function(c,d){var p,m={smartContract:(p=d.getSmartContract())&&TronWebProto.SmartContract.toObject(c,p),runtimecode:d.getRuntimecode_asB64(),contractState:(p=d.getContractState())&&TronWebProto.ContractState.toObject(c,p)};return c&&(m.$jspbMessageInstance=d),m}),TronWebProto.SmartContractDataWrapper.deserializeBinary=function(c){var d=new h.BinaryReader(c),p=new TronWebProto.SmartContractDataWrapper;return TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader(p,d)},TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader=function(c,d){for(;d.nextField()&&!d.isEndGroup();){var p=d.getFieldNumber();switch(p){case 1:var m=new TronWebProto.SmartContract;d.readMessage(m,TronWebProto.SmartContract.deserializeBinaryFromReader),c.setSmartContract(m);break;case 2:var m=d.readBytes();c.setRuntimecode(m);break;case 3:var m=new TronWebProto.ContractState;d.readMessage(m,TronWebProto.ContractState.deserializeBinaryFromReader),c.setContractState(m);break;default:d.skipField();break}}return c},TronWebProto.SmartContractDataWrapper.prototype.serializeBinary=function(){var c=new h.BinaryWriter;return TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter(this,c),c.getResultBuffer()},TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter=function(c,d){var p=void 0;p=c.getSmartContract(),p!=null&&d.writeMessage(1,p,TronWebProto.SmartContract.serializeBinaryToWriter),p=c.getRuntimecode_asU8(),p.length>0&&d.writeBytes(2,p),p=c.getContractState(),p!=null&&d.writeMessage(3,p,TronWebProto.ContractState.serializeBinaryToWriter)},TronWebProto.SmartContractDataWrapper.prototype.getSmartContract=function(){return h.Message.getWrapperField(this,TronWebProto.SmartContract,1)},TronWebProto.SmartContractDataWrapper.prototype.setSmartContract=function(c){return h.Message.setWrapperField(this,1,c)},TronWebProto.SmartContractDataWrapper.prototype.clearSmartContract=function(){return this.setSmartContract(void 0)},TronWebProto.SmartContractDataWrapper.prototype.hasSmartContract=function(){return h.Message.getField(this,1)!=null},TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asB64=function(){return h.Message.bytesAsB64(this.getRuntimecode())},TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asU8=function(){return h.Message.bytesAsU8(this.getRuntimecode())},TronWebProto.SmartContractDataWrapper.prototype.setRuntimecode=function(c){return h.Message.setProto3BytesField(this,2,c)},TronWebProto.SmartContractDataWrapper.prototype.getContractState=function(){return h.Message.getWrapperField(this,TronWebProto.ContractState,3)},TronWebProto.SmartContractDataWrapper.prototype.setContractState=function(c){return h.Message.setWrapperField(this,3,c)},TronWebProto.SmartContractDataWrapper.prototype.clearContractState=function(){return this.setContractState(void 0)},TronWebProto.SmartContractDataWrapper.prototype.hasContractState=function(){return h.Message.getField(this,3)!=null},w.object.extend(f,TronWebProto)},60218:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")();w.exportSymbol("TronWebProto.BuyStorageBytesContract",null,E),w.exportSymbol("TronWebProto.BuyStorageContract",null,E),w.exportSymbol("TronWebProto.SellStorageContract",null,E),w.exportSymbol("TronWebProto.UpdateBrokerageContract",null,E),TronWebProto.BuyStorageBytesContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.BuyStorageBytesContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.BuyStorageBytesContract.displayName="TronWebProto.BuyStorageBytesContract"),TronWebProto.BuyStorageContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.BuyStorageContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.BuyStorageContract.displayName="TronWebProto.BuyStorageContract"),TronWebProto.SellStorageContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.SellStorageContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.SellStorageContract.displayName="TronWebProto.SellStorageContract"),TronWebProto.UpdateBrokerageContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.UpdateBrokerageContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.UpdateBrokerageContract.displayName="TronWebProto.UpdateBrokerageContract"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.BuyStorageBytesContract.prototype.toObject=function(v){return TronWebProto.BuyStorageBytesContract.toObject(v,this)},TronWebProto.BuyStorageBytesContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),bytes:h.Message.getFieldWithDefault(c,2,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.BuyStorageBytesContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.BuyStorageBytesContract;return TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader(d,c)},TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setBytes(p);break;default:c.skipField();break}}return v},TronWebProto.BuyStorageBytesContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getBytes(),d!==0&&c.writeInt64(2,d)},TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.BuyStorageBytesContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.BuyStorageBytesContract.prototype.getBytes=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.BuyStorageBytesContract.prototype.setBytes=function(v){return h.Message.setProto3IntField(this,2,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.BuyStorageContract.prototype.toObject=function(v){return TronWebProto.BuyStorageContract.toObject(v,this)},TronWebProto.BuyStorageContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),quant:h.Message.getFieldWithDefault(c,2,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.BuyStorageContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.BuyStorageContract;return TronWebProto.BuyStorageContract.deserializeBinaryFromReader(d,c)},TronWebProto.BuyStorageContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setQuant(p);break;default:c.skipField();break}}return v},TronWebProto.BuyStorageContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.BuyStorageContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.BuyStorageContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getQuant(),d!==0&&c.writeInt64(2,d)},TronWebProto.BuyStorageContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.BuyStorageContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.BuyStorageContract.prototype.getQuant=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.BuyStorageContract.prototype.setQuant=function(v){return h.Message.setProto3IntField(this,2,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.SellStorageContract.prototype.toObject=function(v){return TronWebProto.SellStorageContract.toObject(v,this)},TronWebProto.SellStorageContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),storageBytes:h.Message.getFieldWithDefault(c,2,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.SellStorageContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.SellStorageContract;return TronWebProto.SellStorageContract.deserializeBinaryFromReader(d,c)},TronWebProto.SellStorageContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt64();v.setStorageBytes(p);break;default:c.skipField();break}}return v},TronWebProto.SellStorageContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.SellStorageContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.SellStorageContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getStorageBytes(),d!==0&&c.writeInt64(2,d)},TronWebProto.SellStorageContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.SellStorageContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.SellStorageContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.SellStorageContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.SellStorageContract.prototype.getStorageBytes=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.SellStorageContract.prototype.setStorageBytes=function(v){return h.Message.setProto3IntField(this,2,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateBrokerageContract.prototype.toObject=function(v){return TronWebProto.UpdateBrokerageContract.toObject(v,this)},TronWebProto.UpdateBrokerageContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),brokerage:h.Message.getFieldWithDefault(c,2,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.UpdateBrokerageContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.UpdateBrokerageContract;return TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader(d,c)},TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readInt32();v.setBrokerage(p);break;default:c.skipField();break}}return v},TronWebProto.UpdateBrokerageContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getBrokerage(),d!==0&&c.writeInt32(2,d)},TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateBrokerageContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.UpdateBrokerageContract.prototype.getBrokerage=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.UpdateBrokerageContract.prototype.setBrokerage=function(v){return h.Message.setProto3IntField(this,2,v)},w.object.extend(f,TronWebProto)},75796:function(ie,f,_){var h=_(41765),w=h,E=typeof globalThis<"u"&&globalThis||!1||typeof E<"u"&&E||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")();w.exportSymbol("TronWebProto.VoteWitnessContract",null,E),w.exportSymbol("TronWebProto.VoteWitnessContract.Vote",null,E),w.exportSymbol("TronWebProto.WitnessCreateContract",null,E),w.exportSymbol("TronWebProto.WitnessUpdateContract",null,E),TronWebProto.WitnessCreateContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.WitnessCreateContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.WitnessCreateContract.displayName="TronWebProto.WitnessCreateContract"),TronWebProto.WitnessUpdateContract=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.WitnessUpdateContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.WitnessUpdateContract.displayName="TronWebProto.WitnessUpdateContract"),TronWebProto.VoteWitnessContract=function(v){h.Message.initialize(this,v,0,-1,TronWebProto.VoteWitnessContract.repeatedFields_,null)},w.inherits(TronWebProto.VoteWitnessContract,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.VoteWitnessContract.displayName="TronWebProto.VoteWitnessContract"),TronWebProto.VoteWitnessContract.Vote=function(v){h.Message.initialize(this,v,0,-1,null,null)},w.inherits(TronWebProto.VoteWitnessContract.Vote,h.Message),w.DEBUG&&!COMPILED&&(TronWebProto.VoteWitnessContract.Vote.displayName="TronWebProto.VoteWitnessContract.Vote"),h.Message.GENERATE_TO_OBJECT&&(TronWebProto.WitnessCreateContract.prototype.toObject=function(v){return TronWebProto.WitnessCreateContract.toObject(v,this)},TronWebProto.WitnessCreateContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),url:c.getUrl_asB64()};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.WitnessCreateContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.WitnessCreateContract;return TronWebProto.WitnessCreateContract.deserializeBinaryFromReader(d,c)},TronWebProto.WitnessCreateContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=c.readBytes();v.setUrl(p);break;default:c.skipField();break}}return v},TronWebProto.WitnessCreateContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.WitnessCreateContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.WitnessCreateContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getUrl_asU8(),d.length>0&&c.writeBytes(2,d)},TronWebProto.WitnessCreateContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WitnessCreateContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.WitnessCreateContract.prototype.getUrl=function(){return h.Message.getFieldWithDefault(this,2,"")},TronWebProto.WitnessCreateContract.prototype.getUrl_asB64=function(){return h.Message.bytesAsB64(this.getUrl())},TronWebProto.WitnessCreateContract.prototype.getUrl_asU8=function(){return h.Message.bytesAsU8(this.getUrl())},TronWebProto.WitnessCreateContract.prototype.setUrl=function(v){return h.Message.setProto3BytesField(this,2,v)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.WitnessUpdateContract.prototype.toObject=function(v){return TronWebProto.WitnessUpdateContract.toObject(v,this)},TronWebProto.WitnessUpdateContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),updateUrl:c.getUpdateUrl_asB64()};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.WitnessUpdateContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.WitnessUpdateContract;return TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader(d,c)},TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 12:var p=c.readBytes();v.setUpdateUrl(p);break;default:c.skipField();break}}return v},TronWebProto.WitnessUpdateContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.WitnessUpdateContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.WitnessUpdateContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getUpdateUrl_asU8(),d.length>0&&c.writeBytes(12,d)},TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WitnessUpdateContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl=function(){return h.Message.getFieldWithDefault(this,12,"")},TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asB64=function(){return h.Message.bytesAsB64(this.getUpdateUrl())},TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asU8=function(){return h.Message.bytesAsU8(this.getUpdateUrl())},TronWebProto.WitnessUpdateContract.prototype.setUpdateUrl=function(v){return h.Message.setProto3BytesField(this,12,v)},TronWebProto.VoteWitnessContract.repeatedFields_=[2],h.Message.GENERATE_TO_OBJECT&&(TronWebProto.VoteWitnessContract.prototype.toObject=function(v){return TronWebProto.VoteWitnessContract.toObject(v,this)},TronWebProto.VoteWitnessContract.toObject=function(v,c){var d,p={ownerAddress:c.getOwnerAddress_asB64(),votesList:h.Message.toObjectList(c.getVotesList(),TronWebProto.VoteWitnessContract.Vote.toObject,v),support:h.Message.getBooleanFieldWithDefault(c,3,!1)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.VoteWitnessContract.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.VoteWitnessContract;return TronWebProto.VoteWitnessContract.deserializeBinaryFromReader(d,c)},TronWebProto.VoteWitnessContract.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setOwnerAddress(p);break;case 2:var p=new TronWebProto.VoteWitnessContract.Vote;c.readMessage(p,TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader),v.addVotes(p);break;case 3:var p=c.readBool();v.setSupport(p);break;default:c.skipField();break}}return v},TronWebProto.VoteWitnessContract.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.VoteWitnessContract.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.VoteWitnessContract.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getOwnerAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getVotesList(),d.length>0&&c.writeRepeatedMessage(2,d,TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter),d=v.getSupport(),d&&c.writeBool(3,d)},h.Message.GENERATE_TO_OBJECT&&(TronWebProto.VoteWitnessContract.Vote.prototype.toObject=function(v){return TronWebProto.VoteWitnessContract.Vote.toObject(v,this)},TronWebProto.VoteWitnessContract.Vote.toObject=function(v,c){var d,p={voteAddress:c.getVoteAddress_asB64(),voteCount:h.Message.getFieldWithDefault(c,2,0)};return v&&(p.$jspbMessageInstance=c),p}),TronWebProto.VoteWitnessContract.Vote.deserializeBinary=function(v){var c=new h.BinaryReader(v),d=new TronWebProto.VoteWitnessContract.Vote;return TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader(d,c)},TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader=function(v,c){for(;c.nextField()&&!c.isEndGroup();){var d=c.getFieldNumber();switch(d){case 1:var p=c.readBytes();v.setVoteAddress(p);break;case 2:var p=c.readInt64();v.setVoteCount(p);break;default:c.skipField();break}}return v},TronWebProto.VoteWitnessContract.Vote.prototype.serializeBinary=function(){var v=new h.BinaryWriter;return TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter(this,v),v.getResultBuffer()},TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter=function(v,c){var d=void 0;d=v.getVoteAddress_asU8(),d.length>0&&c.writeBytes(1,d),d=v.getVoteCount(),d!==0&&c.writeInt64(2,d)},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asB64=function(){return h.Message.bytesAsB64(this.getVoteAddress())},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8=function(){return h.Message.bytesAsU8(this.getVoteAddress())},TronWebProto.VoteWitnessContract.Vote.prototype.setVoteAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteCount=function(){return h.Message.getFieldWithDefault(this,2,0)},TronWebProto.VoteWitnessContract.Vote.prototype.setVoteCount=function(v){return h.Message.setProto3IntField(this,2,v)},TronWebProto.VoteWitnessContract.prototype.getOwnerAddress=function(){return h.Message.getFieldWithDefault(this,1,"")},TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asB64=function(){return h.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asU8=function(){return h.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.VoteWitnessContract.prototype.setOwnerAddress=function(v){return h.Message.setProto3BytesField(this,1,v)},TronWebProto.VoteWitnessContract.prototype.getVotesList=function(){return h.Message.getRepeatedWrapperField(this,TronWebProto.VoteWitnessContract.Vote,2)},TronWebProto.VoteWitnessContract.prototype.setVotesList=function(v){return h.Message.setRepeatedWrapperField(this,2,v)},TronWebProto.VoteWitnessContract.prototype.addVotes=function(v,c){return h.Message.addToRepeatedWrapperField(this,2,v,TronWebProto.VoteWitnessContract.Vote,c)},TronWebProto.VoteWitnessContract.prototype.clearVotesList=function(){return this.setVotesList([])},TronWebProto.VoteWitnessContract.prototype.getSupport=function(){return h.Message.getBooleanFieldWithDefault(this,3,!1)},TronWebProto.VoteWitnessContract.prototype.setSupport=function(v){return h.Message.setProto3BooleanField(this,3,v)},w.object.extend(f,TronWebProto)},14904:function(ie,f,_){"use strict";_.d(f,{A:()=>h});function h(w,E){(E==null||E>w.length)&&(E=w.length);for(var v=0,c=new Array(E);v<E;v++)c[v]=w[v];return c}},45323:function(ie,f,_){"use strict";_.d(f,{A:()=>w});function h(E,v,c,d,p,m,C){try{var x=E[m](C),R=x.value}catch(S){c(S);return}x.done?v(R):Promise.resolve(R).then(d,p)}function w(E){return function(){var v=this,c=arguments;return new Promise(function(d,p){var m=E.apply(v,c);function C(R){h(m,d,p,C,x,"next",R)}function x(R){h(m,d,p,C,x,"throw",R)}C(void 0)})}}},73243:function(ie,f,_){"use strict";_.d(f,{A:()=>h});function h(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}},72092:function(ie,f,_){"use strict";_.d(f,{A:()=>w});function h(E,v){for(var c=0;c<v.length;c++){var d=v[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(E,d.key,d)}}function w(E,v,c){return v&&h(E.prototype,v),c&&h(E,c),E}},9495:function(ie,f,_){"use strict";_.d(f,{A:()=>h});function h(w,E){return E!=null&&typeof Symbol<"u"&&E[Symbol.hasInstance]?!!E[Symbol.hasInstance](w):w instanceof E}},37035:function(ie,f,_){"use strict";_.d(f,{A:()=>h});function h(w){if(typeof Symbol<"u"&&w[Symbol.iterator]!=null||w["@@iterator"]!=null)return Array.from(w)}},55493:function(ie,f,_){"use strict";_.d(f,{A:()=>d});var h=_(14904);function w(p){if(Array.isArray(p))return(0,h.A)(p)}var E=_(37035);function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=_(80883);function d(p){return w(p)||(0,E.A)(p)||(0,c.A)(p)||v()}},68675:function(ie,f,_){"use strict";_.d(f,{A:()=>h});function h(w){"@swc/helpers - typeof";return w&&w.constructor===Symbol?"symbol":typeof w}},80883:function(ie,f,_){"use strict";_.d(f,{A:()=>w});var h=_(14904);function w(E,v){if(E){if(typeof E=="string")return(0,h.A)(E,v);var c=Object.prototype.toString.call(E).slice(8,-1);if(c==="Object"&&E.constructor&&(c=E.constructor.name),c==="Map"||c==="Set")return Array.from(c);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return(0,h.A)(E,v)}}},37484:function(ie,f,_){"use strict";_.r(f),_.d(f,{ErrorWithCause:()=>h});class h extends Error{constructor(E,{cause:v}={}){super(E),this.name=h.name,v&&(this.cause=v),this.message=E}}},93716:function(ie,f,_){"use strict";_.r(f),_.d(f,{findCauseByReference:()=>h,getErrorCause:()=>w,messageWithCauses:()=>d,stackWithCauses:()=>v});const h=(p,m)=>{if(!p||!m||!(p instanceof Error)||!(m.prototype instanceof Error)&&m!==Error)return;const C=new Set;let x=p;for(;x&&!C.has(x);){if(C.add(x),x instanceof m)return x;x=w(x)}},w=p=>{if(!(!p||typeof p!="object"||!("cause"in p)))if(typeof p.cause=="function"){const m=p.cause();return m instanceof Error?m:void 0}else return p.cause instanceof Error?p.cause:void 0},E=(p,m)=>{if(!(p instanceof Error))return"";const C=p.stack||"";if(m.has(p))return C+`
|
||
causes have become circular...`;const x=w(p);return x?(m.add(p),C+`
|
||
caused by: `+E(x,m)):C},v=p=>E(p,new Set),c=(p,m,C)=>{if(!(p instanceof Error))return"";const x=C?"":p.message||"";if(m.has(p))return x+": ...";const R=w(p);if(R){m.add(p);const S="cause"in p&&typeof p.cause=="function";return x+(S?"":": ")+c(R,m,S)}else return x},d=p=>c(p,new Set)},69637:function(ie,f,_){"use strict";_.r(f),_.d(f,{TextDecoder:()=>S,TextEncoder:()=>O});function h(q,b,F){return b<=q&&q<=F}function w(q){if(q===void 0)return{};if(q===Object(q))return q;throw TypeError("Could not convert argument to dictionary")}function E(q){for(var b=String(q),F=b.length,G=0,ue=[];G<F;){var le=b.charCodeAt(G);if(le<55296||le>57343)ue.push(le);else if(56320<=le&&le<=57343)ue.push(65533);else if(55296<=le&&le<=56319)if(G===F-1)ue.push(65533);else{var X=q.charCodeAt(G+1);if(56320<=X&&X<=57343){var se=le&1023,de=X&1023;ue.push(65536+(se<<10)+de),G+=1}else ue.push(65533)}G+=1}return ue}function v(q){for(var b="",F=0;F<q.length;++F){var G=q[F];G<=65535?b+=String.fromCharCode(G):(G-=65536,b+=String.fromCharCode((G>>10)+55296,(G&1023)+56320))}return b}var c=-1;function d(q){this.tokens=[].slice.call(q)}d.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():c},prepend:function(q){if(Array.isArray(q))for(var b=q;b.length;)this.tokens.unshift(b.pop());else this.tokens.unshift(q)},push:function(q){if(Array.isArray(q))for(var b=q;b.length;)this.tokens.push(b.shift());else this.tokens.push(q)}};var p=-1;function m(q,b){if(q)throw TypeError("Decoder error");return b||65533}function C(){}C.prototype={handler:function(q,b){}};function x(){}x.prototype={handler:function(q,b){}};var R="utf-8";function S(q,b){if(!(this instanceof S))return new S(q,b);if(q=q!==void 0?String(q).toLowerCase():R,q!==R)throw new Error("Encoding not supported. Only utf-8 is supported");b=w(b),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!b.fatal,this._ignoreBOM=!!b.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}S.prototype={decode:function(b,F){var G;typeof b=="object"&&b instanceof ArrayBuffer?G=new Uint8Array(b):typeof b=="object"&&"buffer"in b&&b.buffer instanceof ArrayBuffer?G=new Uint8Array(b.buffer,b.byteOffset,b.byteLength):G=new Uint8Array(0),F=w(F),this._streaming||(this._decoder=new M({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!F.stream;for(var ue=new d(G),le=[],X;!ue.endOfStream()&&(X=this._decoder.handler(ue,ue.read()),X!==p);)X!==null&&(Array.isArray(X)?le.push.apply(le,X):le.push(X));if(!this._streaming){do{if(X=this._decoder.handler(ue,ue.read()),X===p)break;X!==null&&(Array.isArray(X)?le.push.apply(le,X):le.push(X))}while(!ue.endOfStream());this._decoder=null}return le.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(le[0]===65279?(this._BOMseen=!0,le.shift()):this._BOMseen=!0),v(le)}};function O(q,b){if(!(this instanceof O))return new O(q,b);if(q=q!==void 0?String(q).toLowerCase():R,q!==R)throw new Error("Encoding not supported. Only utf-8 is supported");b=w(b),this._streaming=!1,this._encoder=null,this._options={fatal:!!b.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}O.prototype={encode:function(b,F){b=b?String(b):"",F=w(F),this._streaming||(this._encoder=new k(this._options)),this._streaming=!!F.stream;for(var G=[],ue=new d(E(b)),le;!ue.endOfStream()&&(le=this._encoder.handler(ue,ue.read()),le!==p);)Array.isArray(le)?G.push.apply(G,le):G.push(le);if(!this._streaming){for(;le=this._encoder.handler(ue,ue.read()),le!==p;)Array.isArray(le)?G.push.apply(G,le):G.push(le);this._encoder=null}return new Uint8Array(G)}};function M(q){var b=q.fatal,F=0,G=0,ue=0,le=128,X=191;this.handler=function(se,de){if(de===c&&ue!==0)return ue=0,m(b);if(de===c)return p;if(ue===0){if(h(de,0,127))return de;if(h(de,194,223))ue=1,F=de-192;else if(h(de,224,239))de===224&&(le=160),de===237&&(X=159),ue=2,F=de-224;else if(h(de,240,244))de===240&&(le=144),de===244&&(X=143),ue=3,F=de-240;else return m(b);return F=F<<6*ue,null}if(!h(de,le,X))return F=ue=G=0,le=128,X=191,se.prepend(de),m(b);if(le=128,X=191,G+=1,F+=de-128<<6*(ue-G),G!==ue)return null;var ye=F;return F=ue=G=0,ye}}function k(q){var b=q.fatal;this.handler=function(F,G){if(G===c)return p;if(h(G,0,127))return G;var ue,le;h(G,128,2047)?(ue=1,le=192):h(G,2048,65535)?(ue=2,le=224):h(G,65536,1114111)&&(ue=3,le=240);for(var X=[(G>>6*ue)+le];ue>0;){var se=G>>6*(ue-1);X.push(128|se&63),ue-=1}return X}}},8386:function(ie){"use strict";ie.exports={rE:"16.1.0"}}},kW={};function tn(ie){var f=kW[ie];if(f!==void 0){if(f.error!==void 0)throw f.error;return f.exports}var _=kW[ie]={id:ie,loaded:!1,exports:{}};try{dle[ie].call(_.exports,_,_.exports,tn)}catch(h){throw _.error=h,h}return _.loaded=!0,_.exports}tn.n=ie=>{var f=ie&&ie.__esModule?()=>ie.default:()=>ie;return tn.d(f,{a:f}),f},tn.d=(ie,f)=>{for(var _ in f)tn.o(f,_)&&!tn.o(ie,_)&&Object.defineProperty(ie,_,{enumerable:!0,get:f[_]})},tn.hmd=ie=>(ie=Object.create(ie),ie.children||(ie.children=[]),Object.defineProperty(ie,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+ie.id)}}),ie),tn.g=(()=>{if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),tn.o=(ie,f)=>Object.prototype.hasOwnProperty.call(ie,f),tn.r=ie=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ie,"__esModule",{value:!0})},tn.nmd=ie=>(ie.paths=[],ie.children||(ie.children=[]),ie),tn.rv=()=>"1.5.2",tn.ruid="bundler=rspack@1.5.2";var B$e={};(()=>{"use strict";var ie={};tn.r(ie),tn.d(ie,{DO:()=>Vh,OG:()=>n_,My:()=>go,Ph:()=>ap,lX:()=>t_,Id:()=>Wg,fg:()=>s_,qj:()=>lf,aT:()=>Fg,aY:()=>$h,lq:()=>up,z:()=>cp,Q5:()=>ji});var f={};tn.r(f),tn.d(f,{aK:()=>Vf,e8:()=>pp,DO:()=>C_,OG:()=>oB,My:()=>vb,Ph:()=>wb,lX:()=>fw,Id:()=>Ab,fg:()=>x$,qj:()=>Qa,aT:()=>lw,r4:()=>w3,aY:()=>bb,x:()=>B_,lq:()=>dw,z:()=>x_,Q5:()=>hw});var _={};tn.r(_),tn.d(_,{base64DecodeFromString:()=>Hb,base64EncodeToString:()=>u8,byte2hexStr:()=>yk,byteArray2hexStr:()=>Xs,bytesToString:()=>a8,hextoString:()=>xG});var h={};tn.r(h),tn.d(h,{arrayEquals:()=>yme,base64DecodeFromString:()=>Hb,base64EncodeToString:()=>u8,bin2String:()=>gme,byte2hexStr:()=>yk,byteArray2hexStr:()=>Xs,bytesToString:()=>a8,getStringType:()=>vme,hexChar2byte:()=>BG,hexStr2byteArray:()=>zc,hextoString:()=>xG,isHexChar:()=>c8,isNumber:()=>OG,strToDate:()=>bme,stringToBytes:()=>mme});var w={};tn.r(w),tn.d(w,{hasProperties:()=>DG,hasProperty:()=>LG,isArray:()=>Ow,isBigNumber:()=>Eme,isBoolean:()=>MG,isFunction:()=>Tme,isHex:()=>$b,isInteger:()=>_y,isJson:()=>_me,isNotNullOrUndefined:()=>Vc,isObject:()=>sE,isString:()=>$c,isValidURL:()=>h8,mapEvent:()=>Sme,padLeft:()=>kme,parseEvent:()=>Ime,sleep:()=>Rme});var E={};tn.r(E),tn.d(E,{OG:()=>O8,My:()=>Fw,Ph:()=>Vb,lX:()=>x8,Id:()=>lE,fg:()=>qq,qj:()=>th,aT:()=>Ww,lq:()=>Hw,z:()=>B8,Q5:()=>fE});var v={};tn.r(v),tn.d(v,{AbiCoder:()=>Lp,FormatTypes:()=>rwe,Interface:()=>Jw,Mnemonic:()=>xy,Signature:()=>ca,SigningKey:()=>$u,Wordlist:()=>Dq,arrayify:()=>JY,concat:()=>bo,ethersHDNodeWallet:()=>nd,id:()=>Bl,isValidMnemonic:()=>nwe,joinSignature:()=>XY,keccak256:()=>Ss,recoverAddress:()=>zw,sha256:()=>gc,splitSignature:()=>twe,toUtf8Bytes:()=>Kc,toUtf8String:()=>kq,wordlists:()=>zve});var c={};tn.r(c),tn.d(c,{ADDRESS_PREFIX:()=>id,ADDRESS_PREFIX_BYTE:()=>eX,ADDRESS_PREFIX_REGEX:()=>Qw,ADDRESS_SIZE:()=>QY,TRON_BIP39_PATH_INDEX_0:()=>yP,TRON_BIP39_PATH_PREFIX:()=>tX,fromHex:()=>rX,fromPrivateKey:()=>iX,isAddress:()=>kE,isChecksumAddress:()=>nX,toChecksumAddress:()=>mP,toHex:()=>mi});var d={};tn.r(d),tn.d(d,{decode58:()=>lR,encode58:()=>sX});var p={};tn.r(p),tn.d(p,{hasBrowserEnv:()=>EP,hasStandardBrowserEnv:()=>Ywe,hasStandardBrowserWebWorkerEnv:()=>Xwe,navigator:()=>TP,origin:()=>Jwe});var m={};tn.r(m),tn.d(m,{decodeParams:()=>M2e,decodeParamsV2ByABI:()=>XX,encodeParams:()=>L2e,encodeParamsV2ByABI:()=>IR});var C={};tn.r(C),tn.d(C,{DeserializeTransaction:()=>e_e,txCheck:()=>kR,txCheckWithArgs:()=>MP,txJsonToPb:()=>NP,txJsonToPbWithArgs:()=>fJ,txPbToRawDataHex:()=>hJ,txPbToTxID:()=>pJ});var x={};tn.r(x),tn.d(x,{ECKeySign:()=>HP,SHA256:()=>d0,_signTypedData:()=>R_e,arrayToBase64String:()=>I_e,computeAddress:()=>NE,decode58Check:()=>x_e,decodeBase58Address:()=>IJ,ecRecover:()=>WP,genPriKey:()=>kJ,getAddressFromPriKey:()=>BR,getAddressFromPriKeyBase64String:()=>P_e,getBase58CheckAddress:()=>Hy,getBase58CheckAddressFromPriKeyBase64String:()=>B_e,getHexStrAddressFromPriKeyBase64String:()=>O_e,getPubKeyFromPriKey:()=>i2,getRowBytesFromTransactionBase64:()=>C_e,isAddressValid:()=>RJ,passwordToAddress:()=>N_e,pkToAddress:()=>OR,sha3:()=>CJ,signBytes:()=>k_e,signTransaction:()=>S_e});var R={};tn.r(R),tn.d(R,{generateAccount:()=>L_e,generateAccountWithMnemonic:()=>U_e,generateRandom:()=>D_e});var S={};tn.r(S),tn.d(S,{TRON_MESSAGE_PREFIX:()=>xJ,hashMessage:()=>zP,signMessage:()=>F_e,verifyMessage:()=>W_e});var O={};tn.r(O),tn.d(O,{aK:()=>u1,e8:()=>o2,DO:()=>ME,dJ:()=>WJ,OG:()=>YP,My:()=>a2,Ph:()=>a1,lX:()=>GP,Id:()=>LE,fg:()=>zJ,qj:()=>ah,aT:()=>c2,r4:()=>LR,aY:()=>o1,x:()=>JP,lq:()=>l2,z:()=>qP,zW:()=>u2,Q5:()=>DE});var M={};tn.r(M),tn.d(M,{fetch:()=>uRe,setTitle:()=>aRe});var k=tn(45323),q=tn(39212),b=tn.n(q);function F(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var G=tn(73243);function ue(r,e,n){if(!e.has(r))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(r)}function le(r,e){return e.get?e.get.call(r):e.value}function X(r,e){var n=ue(r,e,"get");return le(r,n)}function se(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}function de(r,e,n){se(r,e),e.set(r,n)}function ye(r,e,n){if(e.set)e.set.call(r,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function he(r,e,n){var i=ue(r,e,"set");return ye(r,i,n),n}function K(r,e,n){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return n}function B(r,e){se(r,e),e.add(r)}var L=tn(72092);function $(r,e){return $=Object.setPrototypeOf||function(i,s){return i.__proto__=s,i},$(r,e)}function T(r,e){return $(r,e)}function N(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&T(r,e)}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Y(r){return Y=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Y(r)}function Z(r){return Y(r)}var z=tn(68675);function fe(r,e){return e&&((0,z.A)(e)==="object"||typeof e=="function")?e:F(r)}function te(r){var e=j();return function(){var i=Z(r),s;if(e){var o=Z(this).constructor;s=Reflect.construct(i,arguments,o)}else s=i.apply(this,arguments);return fe(this,s)}}var H=tn(67918),Q={},oe={};function _e(r,e){if(Q[r])throw Error("Module ".concat(r," already registered"));Q[r]=e}function ge(r){return Q[r]}function be(r,e){if(oe[r])throw Error("Module ".concat(r," already registered"));oe[r]=e}var we=function(r){return oe[r]};const Ee=(r,e)=>r.unstable_is?r.unstable_is(e):e===r,me=r=>"init"in r,Ke=r=>!!r.write,He=r=>"v"in r||"e"in r,Ie=r=>{if("e"in r)throw r.e;if(!("v"in r))throw new Error("[Bug] atom state is not initialized");return r.v},Le=new WeakMap,Ge=r=>{var e;return Ze(r)&&!!((e=Le.get(r))!=null&&e[0])},Be=r=>{const e=Le.get(r);e?.[0]&&(e[0]=!1,e[1].forEach(n=>n()))},We=(r,e)=>{let n=Le.get(r);if(!n){n=[!0,new Set],Le.set(r,n);const i=()=>{n[0]=!1};r.then(i,i)}n[1].add(e)},Ze=r=>typeof r?.then=="function",_t=(r,e,n)=>{n.p.has(r)||(n.p.add(r),e.then(()=>{n.p.delete(r)},()=>{n.p.delete(r)}))},Ft=(r,e,n)=>{const i=n(r),s="v"in i,o=i.v;if(Ze(e))for(const a of i.d.keys())_t(r,e,n(a));i.v=e,delete i.e,(!s||!Object.is(o,i.v))&&(++i.n,Ze(o)&&Be(o))},gt=(r,e,n)=>{var i;const s=new Set;for(const o of((i=n.get(r))==null?void 0:i.t)||[])n.has(o)&&s.add(o);for(const o of e.p)s.add(o);return s},lt=()=>{const r=new Set,e=()=>{r.forEach(n=>n())};return e.add=n=>(r.add(n),()=>{r.delete(n)}),e},dt=()=>{const r={},e=new WeakMap,n=i=>{var s,o;(s=e.get(r))==null||s.forEach(a=>a(i)),(o=e.get(i))==null||o.forEach(a=>a())};return n.add=(i,s)=>{const o=i||r,a=(e.has(o)?e:e.set(o,new Set)).get(o);return a.add(s),()=>{a?.delete(s),a.size||e.delete(o)}},n},tt=r=>(r.c||(r.c=dt()),r.m||(r.m=dt()),r.u||(r.u=dt()),r.f||(r.f=lt()),r),rt=Symbol(),ke=r=>r[rt],Pe=(r=new WeakMap,e=new WeakMap,n=new WeakMap,i=new Set,s=new Set,o=new Set,a={},u=(I,...P)=>I.read(...P),l=(I,...P)=>I.write(...P),g=(I,P)=>{var D;return(D=I.unstable_onInit)==null?void 0:D.call(I,P)},y=(I,P)=>{var D;return(D=I.onMount)==null?void 0:D.call(I,P)},...A)=>{const I=A[0]||(Ve=>{if(!Ve)throw new Error("Atom is undefined or null");let pe=r.get(Ve);return pe||(pe={d:new Map,p:new Set,n:0},r.set(Ve,pe),g?.(Ve,Ue)),pe}),P=A[1]||(()=>{const Ve=[],pe=Se=>{try{Se()}catch(Ce){Ve.push(Ce)}};do{a.f&&pe(a.f);const Se=new Set,Ce=Se.add.bind(Se);i.forEach(je=>{var $e;return($e=e.get(je))==null?void 0:$e.l.forEach(Ce)}),i.clear(),o.forEach(Ce),o.clear(),s.forEach(Ce),s.clear(),Se.forEach(pe),i.size&&D()}while(i.size||o.size||s.size);if(Ve.length)throw new AggregateError(Ve)}),D=A[2]||(()=>{const Ve=[],pe=new WeakSet,Se=new WeakSet,Ce=Array.from(i);for(;Ce.length;){const je=Ce[Ce.length-1],$e=I(je);if(Se.has(je)){Ce.pop();continue}if(pe.has(je)){if(n.get(je)===$e.n)Ve.push([je,$e]);else if(n.has(je))throw new Error("[Bug] invalidated atom exists");Se.add(je),Ce.pop();continue}pe.add(je);for(const Qe of gt(je,$e,e))pe.has(Qe)||Ce.push(Qe)}for(let je=Ve.length-1;je>=0;--je){const[$e,Qe]=Ve[je];let nt=!1;for(const Ne of Qe.d.keys())if(Ne!==$e&&i.has(Ne)){nt=!0;break}nt&&(U($e),re($e)),n.delete($e)}}),U=A[3]||(Ve=>{var pe;const Se=I(Ve);if(He(Se)&&(e.has(Ve)&&n.get(Ve)!==Se.n||Array.from(Se.d).every(([ct,mt])=>U(ct).n===mt)))return Se;Se.d.clear();let Ce=!0;const je=()=>{e.has(Ve)&&(re(Ve),D(),P())},$e=ct=>{var mt;if(Ee(Ve,ct)){const er=I(ct);if(!He(er))if(me(ct))Ft(ct,ct.init,I);else throw new Error("no atom init");return Ie(er)}const Bt=U(ct);try{return Ie(Bt)}finally{Se.d.set(ct,Bt.n),Ge(Se.v)&&_t(Ve,Se.v,Bt),(mt=e.get(ct))==null||mt.t.add(Ve),Ce||je()}};let Qe,nt;const Ne={get signal(){return Qe||(Qe=new AbortController),Qe.signal},get setSelf(){return Ke(Ve)||console.warn("setSelf function cannot be used with read-only atom"),!nt&&Ke(Ve)&&(nt=(...ct)=>{if(Ce&&console.warn("setSelf function cannot be called in sync"),!Ce)try{return J(Ve,...ct)}finally{D(),P()}}),nt}},Me=Se.n;try{const ct=u(Ve,$e,Ne);return Ft(Ve,ct,I),Ze(ct)&&(We(ct,()=>Qe?.abort()),ct.then(je,je)),Se}catch(ct){return delete Se.v,Se.e=ct,++Se.n,Se}finally{Ce=!1,Me!==Se.n&&n.get(Ve)===Me&&(n.set(Ve,Se.n),i.add(Ve),(pe=a.c)==null||pe.call(a,Ve))}}),V=A[4]||(Ve=>{const pe=[Ve];for(;pe.length;){const Se=pe.pop(),Ce=I(Se);for(const je of gt(Se,Ce,e)){const $e=I(je);n.set(je,$e.n),pe.push(je)}}}),J=A[5]||((Ve,...pe)=>{let Se=!0;const Ce=$e=>Ie(U($e)),je=($e,...Qe)=>{var nt;const Ne=I($e);try{if(Ee(Ve,$e)){if(!me($e))throw new Error("atom not writable");const Me=Ne.n,ct=Qe[0];Ft($e,ct,I),re($e),Me!==Ne.n&&(i.add($e),(nt=a.c)==null||nt.call(a,$e),V($e));return}else return J($e,...Qe)}finally{Se||(D(),P())}};try{return l(Ve,Ce,je,...pe)}finally{Se=!1}}),re=A[6]||(Ve=>{var pe;const Se=I(Ve),Ce=e.get(Ve);if(Ce&&!Ge(Se.v)){for(const[je,$e]of Se.d)if(!Ce.d.has(je)){const Qe=I(je);ce(je).t.add(Ve),Ce.d.add(je),$e!==Qe.n&&(i.add(je),(pe=a.c)==null||pe.call(a,je),V(je))}for(const je of Ce.d||[])if(!Se.d.has(je)){Ce.d.delete(je);const $e=Re(je);$e?.t.delete(Ve)}}}),ce=A[7]||(Ve=>{var pe;const Se=I(Ve);let Ce=e.get(Ve);if(!Ce){U(Ve);for(const je of Se.d.keys())ce(je).t.add(Ve);if(Ce={l:new Set,d:new Set(Se.d.keys()),t:new Set},e.set(Ve,Ce),(pe=a.m)==null||pe.call(a,Ve),Ke(Ve)){const je=()=>{let $e=!0;const Qe=(...nt)=>{try{return J(Ve,...nt)}finally{$e||(D(),P())}};try{const nt=y(Ve,Qe);nt&&(Ce.u=()=>{$e=!0;try{nt()}finally{$e=!1}})}finally{$e=!1}};s.add(je)}}return Ce}),Re=A[8]||(Ve=>{var pe;const Se=I(Ve);let Ce=e.get(Ve);if(Ce&&!Ce.l.size&&!Array.from(Ce.t).some(je=>{var $e;return($e=e.get(je))==null?void 0:$e.d.has(Ve)})){Ce.u&&o.add(Ce.u),Ce=void 0,e.delete(Ve),(pe=a.u)==null||pe.call(a,Ve);for(const je of Se.d.keys()){const $e=Re(je);$e?.t.delete(Ve)}return}return Ce}),De=[r,e,n,i,s,o,a,u,l,g,y,I,P,D,U,V,J,re,ce,Re],Ue={get:Ve=>Ie(U(Ve)),set:(Ve,...pe)=>{try{return J(Ve,...pe)}finally{D(),P()}},sub:(Ve,pe)=>{const Ce=ce(Ve).l;return Ce.add(pe),P(),()=>{Ce.delete(pe),Re(Ve),P()}}};return Object.defineProperty(Ue,rt,{value:De}),Ue},it=null,Xe=tt,st=null,It=null,ft=null,Jt=null,Ot=null,Ct=null,qe=null,Yt=null,ot=null,Ae=null,Rt=null,Ht=null,bt=null;let Mt=0;function tr(r,e){const n=`atom${++Mt}`,i={toString(){return this.debugLabel?n+":"+this.debugLabel:n}};return typeof r=="function"?i.read=r:(i.init=r,i.read=Vt,i.write=Et),e&&(i.write=e),i}function Vt(r){return r(this)}function Et(r,e,n){return e(this,typeof n=="function"?n(r(this)):n)}const Ye=()=>{let r=0;const e=Xe({}),n=new WeakMap,i=new WeakMap,s=Pe(n,i,void 0,void 0,void 0,void 0,e,void 0,(u,l,g,...y)=>r?g(u,...y):u.write(l,g,...y)),o=new Set;return e.m.add(void 0,u=>{o.add(u);const l=n.get(u);l.m=i.get(u)}),e.u.add(void 0,u=>{o.delete(u);const l=n.get(u);delete l.m}),Object.assign(s,{dev4_get_internal_weak_map:()=>n,dev4_get_mounted_atoms:()=>o,dev4_restore_atoms:u=>{const l={read:()=>null,write:(g,y)=>{++r;try{for(const[A,I]of u)"init"in A&&y(A,I)}finally{--r}}};s.set(l)}})};function Tt(){return Ye()}let Wt;function dr(){return Wt||(Wt=Tt(),globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Wt),globalThis.__JOTAI_DEFAULT_STORE__!==Wt&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044")),Wt}function at(r){return r}var wt={isBackgroundAtomFirstSynced:!1,isBackgroundFinishInit:!1,supportDerive:!1,hasApiError:!1,apiDomain:"",staticHost:"",isNetworkOffline:!1,isDeviceTimeOff:!1,upgradeConfig:{}};function At(r){if(Array.isArray(r))return r}var Je=tn(37035);function Lt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var sr=tn(80883);function ur(r,e){return At(r)||(0,Je.A)(r,e)||(0,sr.A)(r,e)||Lt()}var vr=Object.prototype.hasOwnProperty;function kr(r,e){var n,i;if(r===e)return!0;if(r&&e&&(n=r.constructor)===e.constructor){if(n===Date)return r.getTime()===e.getTime();if(n===RegExp)return r.toString()===e.toString();if(n===Array){if((i=r.length)===e.length)for(;i--&&kr(r[i],e[i]););return i===-1}if(!n||typeof r=="object"){i=0;for(n in r)if(vr.call(r,n)&&++i&&!vr.call(e,n)||!(n in e)||!kr(r[n],e[n]))return!1;return Object.keys(e).length===i}}return r!==r&&e!==e}const Jr=new Error("timeout while waiting for mutex to become available"),hr=new Error("mutex already locked"),$r=new Error("request for lock canceled");var Hr=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};class rn{constructor(e,n=$r){this._value=e,this._cancelError=n,this._queue=[],this._weightedWaiters=[]}acquire(e=1,n=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((i,s)=>{const o={resolve:i,reject:s,weight:e,priority:n},a=pn(this._queue,u=>n<=u.priority);a===-1&&e<=this._value?this._dispatchItem(o):this._queue.splice(a+1,0,o)})}runExclusive(e){return Hr(this,arguments,void 0,function*(n,i=1,s=0){const[o,a]=yield this.acquire(i,s);try{return yield n(o)}finally{a()}})}waitForUnlock(e=1,n=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,n)?Promise.resolve():new Promise(i=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),_r(this._weightedWaiters[e-1],{resolve:i,priority:n})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const n=this._value;this._value-=e.weight,e.resolve([n,this._newReleaser(e.weight)])}_newReleaser(e){let n=!1;return()=>{n||(n=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const n=this._weightedWaiters[e-1];n&&(n.forEach(i=>i.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let n=this._value;n>0;n--){const i=this._weightedWaiters[n-1];if(!i)continue;const s=i.findIndex(o=>o.priority<=e);(s===-1?i:i.splice(0,s)).forEach(o=>o.resolve())}}}_couldLockImmediately(e,n){return(this._queue.length===0||this._queue[0].priority<n)&&e<=this._value}}function _r(r,e){const n=pn(r,i=>e.priority<=i.priority);r.splice(n+1,0,e)}function pn(r,e){for(let n=r.length-1;n>=0;n--)if(e(r[n]))return n;return-1}var $t=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};class In{constructor(e){this._semaphore=new rn(1,e)}acquire(){return $t(this,arguments,void 0,function*(e=0){const[,n]=yield this._semaphore.acquire(1,e);return n})}runExclusive(e,n=0){return this._semaphore.runExclusive(()=>e(),1,n)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}var ln=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};function yn(r,e,n=Jr){return{acquire:(i,s)=>{let o;if(Fr(r)?o=i:(o=void 0,s=i),o!==void 0&&o<=0)throw new Error(`invalid weight ${o}: must be positive`);return new Promise((a,u)=>ln(this,void 0,void 0,function*(){let l=!1;const g=setTimeout(()=>{l=!0,u(n)},e);try{const y=yield Fr(r)?r.acquire(o,s):r.acquire(s);l?(Array.isArray(y)?y[1]:y)():(clearTimeout(g),a(y))}catch(y){l||(clearTimeout(g),u(y))}}))},runExclusive(i,s,o){return ln(this,void 0,void 0,function*(){let a=()=>{};try{const u=yield this.acquire(s,o);return Array.isArray(u)?(a=u[1],yield i(u[0])):(a=u,yield i())}finally{a()}})},release(i){r.release(i)},cancel(){return r.cancel()},waitForUnlock:(i,s)=>{let o;if(Fr(r)?o=i:(o=void 0,s=i),o!==void 0&&o<=0)throw new Error(`invalid weight ${o}: must be positive`);return new Promise((a,u)=>{const l=setTimeout(()=>u(n),e);(Fr(r)?r.waitForUnlock(o,s):r.waitForUnlock(s)).then(()=>{clearTimeout(l),a()})})},isLocked:()=>r.isLocked(),getValue:()=>r.getValue(),setValue:i=>r.setValue(i)}}function Fr(r){return r.getValue!==void 0}function On(r,e=hr){return yn(r,0,e)}const En=globalThis.browser?.runtime?.id==null?globalThis.chrome:globalThis.browser,ee=ve();function ve(){const r={local:ze("local"),session:ze("session"),sync:ze("sync"),managed:ze("managed")},e=U=>{const V=r[U];if(V==null){const J=Object.keys(r).join(", ");throw Error(`Invalid area "${U}". Options: ${J}`)}return V},n=U=>{const V=U.indexOf(":"),J=U.substring(0,V),re=U.substring(V+1);if(re==null)throw Error(`Storage key should be in the form of "area:key", but received "${U}"`);return{driverArea:J,driverKey:re,driver:e(J)}},i=U=>U+"$",s=(U,V)=>{const J={...U};return Object.entries(V).forEach(([re,ce])=>{ce==null?delete J[re]:J[re]=ce}),J},o=(U,V)=>U??V??null,a=U=>typeof U=="object"&&!Array.isArray(U)?U:{},u=async(U,V,J)=>{const re=await U.getItem(V);return o(re,J?.fallback??J?.defaultValue)},l=async(U,V)=>{const J=i(V),re=await U.getItem(J);return a(re)},g=async(U,V,J)=>{await U.setItem(V,J??null)},y=async(U,V,J)=>{const re=i(V),ce=a(await U.getItem(re));await U.setItem(re,s(ce,J))},A=async(U,V,J)=>{if(await U.removeItem(V),J?.removeMeta){const re=i(V);await U.removeItem(re)}},I=async(U,V,J)=>{const re=i(V);if(J==null)await U.removeItem(re);else{const ce=a(await U.getItem(re));[J].flat().forEach(Re=>delete ce[Re]),await U.setItem(re,ce)}},P=(U,V,J)=>U.watch(V,J);return{getItem:async(U,V)=>{const{driver:J,driverKey:re}=n(U);return await u(J,re,V)},getItems:async U=>{const V=new Map,J=new Map,re=[];U.forEach(Re=>{let De,Ue;typeof Re=="string"?De=Re:"getValue"in Re?(De=Re.key,Ue={fallback:Re.fallback}):(De=Re.key,Ue=Re.options),re.push(De);const{driverArea:Ve,driverKey:pe}=n(De),Se=V.get(Ve)??[];V.set(Ve,Se.concat(pe)),J.set(De,Ue)});const ce=new Map;return await Promise.all(Array.from(V.entries()).map(async([Re,De])=>{(await r[Re].getItems(De)).forEach(Ve=>{const pe=`${Re}:${Ve.key}`,Se=J.get(pe),Ce=o(Ve.value,Se?.fallback??Se?.defaultValue);ce.set(pe,Ce)})})),re.map(Re=>({key:Re,value:ce.get(Re)}))},getMeta:async U=>{const{driver:V,driverKey:J}=n(U);return await l(V,J)},getMetas:async U=>{const V=U.map(ce=>{const Re=typeof ce=="string"?ce:ce.key,{driverArea:De,driverKey:Ue}=n(Re);return{key:Re,driverArea:De,driverKey:Ue,driverMetaKey:i(Ue)}}),J=V.reduce((ce,Re)=>(ce[Re.driverArea]??=[],ce[Re.driverArea].push(Re),ce),{}),re={};return await Promise.all(Object.entries(J).map(async([ce,Re])=>{const De=await En.storage[ce].get(Re.map(Ue=>Ue.driverMetaKey));Re.forEach(Ue=>{re[Ue.key]=De[Ue.driverMetaKey]??{}})})),V.map(ce=>({key:ce.key,meta:re[ce.key]}))},setItem:async(U,V)=>{const{driver:J,driverKey:re}=n(U);await g(J,re,V)},setItems:async U=>{const V={};U.forEach(J=>{const{driverArea:re,driverKey:ce}=n("key"in J?J.key:J.item.key);V[re]??=[],V[re].push({key:ce,value:J.value})}),await Promise.all(Object.entries(V).map(async([J,re])=>{await e(J).setItems(re)}))},setMeta:async(U,V)=>{const{driver:J,driverKey:re}=n(U);await y(J,re,V)},setMetas:async U=>{const V={};U.forEach(J=>{const{driverArea:re,driverKey:ce}=n("key"in J?J.key:J.item.key);V[re]??=[],V[re].push({key:ce,properties:J.meta})}),await Promise.all(Object.entries(V).map(async([J,re])=>{const ce=e(J),Re=re.map(({key:pe})=>i(pe));console.log(J,Re);const De=await ce.getItems(Re),Ue=Object.fromEntries(De.map(({key:pe,value:Se})=>[pe,a(Se)])),Ve=re.map(({key:pe,properties:Se})=>{const Ce=i(pe);return{key:Ce,value:s(Ue[Ce]??{},Se)}});await ce.setItems(Ve)}))},removeItem:async(U,V)=>{const{driver:J,driverKey:re}=n(U);await A(J,re,V)},removeItems:async U=>{const V={};U.forEach(J=>{let re,ce;typeof J=="string"?re=J:"getValue"in J?re=J.key:"item"in J?(re=J.item.key,ce=J.options):(re=J.key,ce=J.options);const{driverArea:Re,driverKey:De}=n(re);V[Re]??=[],V[Re].push(De),ce?.removeMeta&&V[Re].push(i(De))}),await Promise.all(Object.entries(V).map(async([J,re])=>{await e(J).removeItems(re)}))},clear:async U=>{await e(U).clear()},removeMeta:async(U,V)=>{const{driver:J,driverKey:re}=n(U);await I(J,re,V)},snapshot:async(U,V)=>{const re=await e(U).snapshot();return V?.excludeKeys?.forEach(ce=>{delete re[ce],delete re[i(ce)]}),re},restoreSnapshot:async(U,V)=>{await e(U).restoreSnapshot(V)},watch:(U,V)=>{const{driver:J,driverKey:re}=n(U);return P(J,re,V)},unwatch(){Object.values(r).forEach(U=>{U.unwatch()})},defineItem:(U,V)=>{const{driver:J,driverKey:re}=n(U),{version:ce=1,migrations:Re={}}=V??{};if(ce<1)throw Error("Storage item version cannot be less than 1. Initial versions should be set to 1, not 0.");const De=async()=>{const Ce=i(re),[{value:je},{value:$e}]=await J.getItems([re,Ce]);if(je==null)return;const Qe=$e?.v??1;if(Qe>ce)throw Error(`Version downgrade detected (v${Qe} -> v${ce}) for "${U}"`);if(Qe===ce)return;console.debug(`[@wxt-dev/storage] Running storage migration for ${U}: v${Qe} -> v${ce}`);const nt=Array.from({length:ce-Qe},(Me,ct)=>Qe+ct+1);let Ne=je;for(const Me of nt)try{Ne=await Re?.[Me]?.(Ne)??Ne}catch(ct){throw new yt(U,Me,{cause:ct})}await J.setItems([{key:re,value:Ne},{key:Ce,value:{...$e,v:ce}}]),console.debug(`[@wxt-dev/storage] Storage migration completed for ${U} v${ce}`,{migratedValue:Ne})},Ue=V?.migrations==null?Promise.resolve():De().catch(Ce=>{console.error(`[@wxt-dev/storage] Migration failed for ${U}`,Ce)}),Ve=new In,pe=()=>V?.fallback??V?.defaultValue??null,Se=()=>Ve.runExclusive(async()=>{const Ce=await J.getItem(re);if(Ce!=null||V?.init==null)return Ce;const je=await V.init();return await J.setItem(re,je),je});return Ue.then(Se),{key:U,get defaultValue(){return pe()},get fallback(){return pe()},getValue:async()=>(await Ue,V?.init?await Se():await u(J,re,V)),getMeta:async()=>(await Ue,await l(J,re)),setValue:async Ce=>(await Ue,await g(J,re,Ce)),setMeta:async Ce=>(await Ue,await y(J,re,Ce)),removeValue:async Ce=>(await Ue,await A(J,re,Ce)),removeMeta:async Ce=>(await Ue,await I(J,re,Ce)),watch:Ce=>P(J,re,(je,$e)=>Ce(je??pe(),$e??pe())),migrate:De}}}}function ze(r){const e=()=>{if(En.runtime==null)throw Error(["'wxt/storage' must be loaded in a web extension environment",`
|
||
- If thrown during a build, see https://github.com/wxt-dev/wxt/issues/371`,` - If thrown during tests, mock 'wxt/browser' correctly. See https://wxt.dev/guide/go-further/testing.html
|
||
`].join(`
|
||
`));if(En.storage==null)throw Error("You must add the 'storage' permission to your manifest to use 'wxt/storage'");const i=En.storage[r];if(i==null)throw Error(`"browser.storage.${r}" is undefined`);return i},n=new Set;return{getItem:async i=>(await e().get(i))[i],getItems:async i=>{const s=await e().get(i);return i.map(o=>({key:o,value:s[o]??null}))},setItem:async(i,s)=>{s==null?await e().remove(i):await e().set({[i]:s})},setItems:async i=>{const s=i.reduce((o,{key:a,value:u})=>(o[a]=u,o),{});await e().set(s)},removeItem:async i=>{await e().remove(i)},removeItems:async i=>{await e().remove(i)},clear:async()=>{await e().clear()},snapshot:async()=>await e().get(),restoreSnapshot:async i=>{await e().set(i)},watch(i,s){const o=a=>{const u=a[i];u!=null&&(kr(u.newValue,u.oldValue)||s(u.newValue??null,u.oldValue??null))};return e().onChanged.addListener(o),n.add(o),()=>{e().onChanged.removeListener(o),n.delete(o)}},unwatch(){n.forEach(i=>{e().onChanged.removeListener(i)}),n.clear()}}}class yt extends Error{constructor(e,n,i){super(`v${n} migration failed for "${e}"`,i),this.key=e,this.version=n}}function vt(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}var ar;(function(r){r.uiFunctionCall="uiFunctionCall",r.contentscriptFunctionCall="contentscriptFunctionCall",r.functionCallResult="functionCallResult",r.updateState="updateState",r.contentScriptEvent="contentScriptEvent"})(ar||(ar={}));var wr;(function(r){r.ui="ui",r.contentScript="contentScript",r.inPage="inPage"})(wr||(wr={}));var zt=Tt(),Kr=[],Xt={list:function(){return Kr},add:function(r){return Kr.push(r)},remove:function(r){var e=Kr.indexOf(r);e>-1&&Kr.splice(e,1)}};function et(r,e){try{r.postMessage(e)}catch(n){console.error("Port postMessage failed"),console.error(n)}}var xt=[],Kt={};function kt(r,e){Kt[r]=e;var n=zt.sub(e,(0,k.A)(b().mark(function i(){var s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,zt.get(e);case 2:for(s=D.sent,console.debug("[registerSharedAtomInBackground] atom changed:",r,s),o={type:ar.updateState,values:vt({},r,s),source:"update"},a=Xt.list(),u=!0,l=!1,g=void 0,D.prev=7,y=a[Symbol.iterator]();!(u=(A=y.next()).done);u=!0)I=A.value,et(I,o);D.next=15;break;case 11:D.prev=11,D.t0=D.catch(7),l=!0,g=D.t0;case 15:D.prev=15,D.prev=16,!u&&y.return!=null&&y.return();case 18:if(D.prev=18,!l){D.next=21;break}throw g;case 21:return D.finish(18);case 22:return D.finish(15);case 23:case"end":return D.stop()}},i,null,[[7,11,15,23],[16,,18,22]])})));xt.push(n)}function or(r){return Qr.apply(this,arguments)}function Qr(){return Qr=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:n={},i=!0,s=!1,o=void 0,D.prev=2,a=Object.entries(Kt)[Symbol.iterator]();case 4:if(i=(u=a.next()).done){D.next=13;break}return l=ur(u.value,2),g=l[0],y=l[1],D.next=8,zt.get(y);case 8:A=D.sent,n[g]=A;case 10:i=!0,D.next=4;break;case 13:D.next=19;break;case 15:D.prev=15,D.t0=D.catch(2),s=!0,o=D.t0;case 19:D.prev=19,D.prev=20,!i&&a.return!=null&&a.return();case 22:if(D.prev=22,!s){D.next=25;break}throw o;case 25:return D.finish(22);case 26:return D.finish(19);case 27:I={type:ar.updateState,values:n,source:"init"},et(e,I);case 29:case"end":return D.stop()}},r,null,[[2,15,19,27],[20,,22,26]])})),Qr.apply(this,arguments)}function Nr(r,e){var n={},i=e?.persistKeys||[],s=!0,o=!1,a=void 0;try{for(var u=Object.entries(r)[Symbol.iterator](),l;!(s=(l=u.next()).done);s=!0){var g=ur(l.value,2),y=g[0],A=g[1],I=tr(A);if(i.includes(y)){var P=An(y,A,!1);n["".concat(y,"BgAtom")]=P,kt(y,P)}else n["".concat(y,"BgAtom")]=I,kt(y,I)}}catch(D){o=!0,a=D}finally{try{!s&&u.return!=null&&u.return()}finally{if(o)throw a}}return n}function An(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=tr(e),s=function(){var u=(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,ee.getItem(o,{fallback:e});case 2:return g=A.sent,A.abrupt("return",g);case 4:case"end":return A.stop()}},l)}));return function(){return u.apply(this,arguments)}}();i.onMount=function(u){(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,s();case 2:g=A.sent,u(g);case 4:case"end":return A.stop()}},l)}))()};var o="local:atom-".concat(r),a=tr(function(){var u=(0,k.A)(b().mark(function l(g){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",g(i));case 1:case"end":return A.stop()}},l)}));return function(l){return u.apply(this,arguments)}}(),function(){var u=(0,k.A)(b().mark(function l(g,y,A){var I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return I=typeof A=="function"?A(g(i)):A,y(i,I),D.next=4,ee.setItem(o,I);case 4:case"end":return D.stop()}},l)}));return function(l,g,y){return u.apply(this,arguments)}}());return n&&zt.sub(a,function(){}),a}var mn=Nr(wt),Nn=mn.isBackgroundAtomFirstSyncedBgAtom,Vi=mn.isBackgroundFinishInitBgAtom,Kn=mn.supportDeriveBgAtom,_s=mn.hasApiErrorBgAtom,Gs=mn.apiDomainBgAtom,zs=mn.staticHostBgAtom,rs=mn.isNetworkOfflineBgAtom,to=mn.isDeviceTimeOffBgAtom,ro=mn.upgradeConfigBgAtom,Ls=function(){return zt.get(Kn)},cl=tr(0),Eh=function(){return zt.get(cl)>0},Ro=function(){zt.set(cl,function(r){return r+1})},Su=function(){zt.set(cl,function(r){var e=r-1;return e<0?0:e})};const Yl=Symbol("RESET");function Th(r){const e=atom(r,(n,i,s)=>{const o=typeof s=="function"?s(n(e)):s;i(e,o===Yl?r:o)});return e}function Sh(r,e){return atom(r,function(n,i,s){i(this,e(n(this),s))})}function Bc(r,e){let n=null;const i=new Map,s=new Set,o=u=>{let l;if(e===void 0)l=i.get(u);else for(const[y,A]of i)if(e(y,u)){l=A;break}if(l!==void 0)if(n?.(l[1],u))o.remove(u);else return l[0];const g=r(u);return i.set(u,[g,Date.now()]),a("CREATE",u,g),g},a=(u,l,g)=>{for(const y of s)y({type:u,param:l,atom:g})};return o.unstable_listen=u=>(s.add(u),()=>{s.delete(u)}),o.getParams=()=>i.keys(),o.remove=u=>{if(e===void 0){if(!i.has(u))return;const[l]=i.get(u);i.delete(u),a("REMOVE",u,l)}else for(const[l,[g]]of i)if(e(l,u)){i.delete(l),a("REMOVE",l,g);break}},o.setShouldRemove=u=>{if(n=u,!!n)for(const[l,[g,y]]of i)n(y,l)&&(i.delete(l),a("REMOVE",l,g))},o}const Id=(r,e,n)=>(e.has(n)?e:e.set(n,r())).get(n),Iu=new WeakMap,kd=(r,e,n,i)=>{const s=Id(()=>new WeakMap,Iu,e),o=Id(()=>new WeakMap,s,n);return Id(r,o,i)};function Tg(r,e,n=Object.is){return kd(()=>{const i=Symbol(),s=([a,u])=>{if(u===i)return e(a);const l=e(a,u);return n(u,l)?u:l},o=atom(a=>{const u=a(o),l=a(r);return s([l,u])});return o.init=i,o},r,e,n)}const Rd=new WeakSet,Ju=r=>{if(typeof r!="object"||r===null)return r;Object.freeze(r);const e=Object.getOwnPropertyNames(r);for(const n of e)Ju(r[n]);return r};function Ds(r){if(Rd.has(r))return r;Rd.add(r);const e=r.read;if(r.read=function(n,i){return Ju(e.call(this,n,i))},"write"in r){const n=r.write;r.write=function(i,s,...o){return n.call(this,i,(...a)=>(a[0]===r&&(a[1]=Ju(a[1])),s(...a)),...o)}}return r}function qs(r){return console.warn("[DEPRECATED] freezeAtomCreator is deprecated, define it on users end"),(...e)=>Ds(r(...e))}const Cd=(r,e,n)=>(e.has(n)?e:e.set(n,r())).get(n),Wa=new WeakMap,Ih=(r,e,n)=>{const i=Cd(()=>new WeakMap,Wa,e);return Cd(r,i,n)},kh=null,Xl=r=>!!r.write,Rh=r=>typeof r=="function";function U0(r,e){return Ih(()=>{const n=new WeakMap,i=(a,u)=>{let l=n.get(a);if(l)return l;const g=u&&n.get(u),y=[],A=[];return a.forEach((I,P)=>{const D=e?e(I):P;A[P]=D;const U=g&&g.atomList[g.keyList.indexOf(D)];if(U){y[P]=U;return}const V=re=>{const ce=re(s),Re=re(r),Ue=i(Re,ce?.arr).keyList.indexOf(D);if(Ue<0||Ue>=Re.length){const Ve=a[i(a).keyList.indexOf(D)];if(Ve)return Ve;throw new Error("splitAtom: index out of bounds for read")}return Re[Ue]},J=(re,ce,Re)=>{const De=re(s),Ue=re(r),pe=i(Ue,De?.arr).keyList.indexOf(D);if(pe<0||pe>=Ue.length)throw new Error("splitAtom: index out of bounds for write");const Se=Rh(Re)?Re(Ue[pe]):Re;Object.is(Ue[pe],Se)||ce(r,[...Ue.slice(0,pe),Se,...Ue.slice(pe+1)])};y[P]=Xl(r)?atom(V,J):atom(V)}),g&&g.keyList.length===A.length&&g.keyList.every((I,P)=>I===A[P])?l=g:l={arr:a,atomList:y,keyList:A},n.set(a,l),l},s=atom(a=>{const u=a(s),l=a(r);return i(l,u?.arr)});s.debugPrivate=!0,s.init=void 0;const o=Xl(r)?atom(a=>a(s).atomList,(a,u,l)=>{switch(l.type){case"remove":{const g=a(o).indexOf(l.atom);if(g>=0){const y=a(r);u(r,[...y.slice(0,g),...y.slice(g+1)])}break}case"insert":{const g=l.before?a(o).indexOf(l.before):a(o).length;if(g>=0){const y=a(r);u(r,[...y.slice(0,g),l.value,...y.slice(g)])}break}case"move":{const g=a(o).indexOf(l.atom),y=l.before?a(o).indexOf(l.before):a(o).length;if(g>=0&&y>=0){const A=a(r);g<y?u(r,[...A.slice(0,g),...A.slice(g+1,y),A[g],...A.slice(y)]):u(r,[...A.slice(0,y),A[g],...A.slice(y,g),...A.slice(g+1)])}break}}}):atom(a=>a(s).atomList);return o},r,e||kh)}function cv(r){const e=Symbol(),n=atom(e);n.debugPrivate=!0;const i=atom((s,o)=>{const a=s(n);return a!==e?a:r(s,o)},(s,o,a)=>{if(a===Yl)o(n,e);else if(typeof a=="function"){const u=s(i);o(n,a(u))}else o(n,a)});return i}const Co=r=>typeof r?.then=="function";function Sg(r){return e=>({...e,getItem:(i,s)=>{const o=u=>r(u)?u:s,a=e.getItem(i,s);return Co(a)?a.then(o):o(a)}})}function Qu(r=()=>{try{return self.localStorage}catch{return}},e){var n;let i,s;const o={getItem:(l,g)=>{var y,A;const I=D=>{if(D=D||"",i!==D){try{s=JSON.parse(D,e?.reviver)}catch{return g}i=D}return s},P=(A=(y=r())==null?void 0:y.getItem(l))!=null?A:null;return Co(P)?P.then(I):I(P)},setItem:(l,g)=>{var y;return(y=r())==null?void 0:y.setItem(l,JSON.stringify(g,e?.replacer))},removeItem:l=>{var g;return(g=r())==null?void 0:g.removeItem(l)}},a=l=>(g,y,A)=>l(g,I=>{let P;try{P=JSON.parse(I||"")}catch{P=A}y(P)});let u;try{u=(n=r())==null?void 0:n.subscribe}catch{}return u&&(o.subscribe=a(u)),o}const po=Qu();function Pt(r,e,n=po,i){const s=i?.getOnInit,o=atom(s?n.getItem(r,e):e);return o.debugPrivate=!0,o.onMount=u=>{u(n.getItem(r,e));let l;return n.subscribe&&(l=n.subscribe(r,u,e)),l},atom(u=>u(o),(u,l,g)=>{const y=typeof g=="function"?g(u(o)):g;return y===Yl?(l(o,e),n.removeItem(r)):y instanceof Promise?y.then(A=>(l(o,A),n.setItem(r,A))):(l(o,y),n.setItem(r,y))})}function Dt(r,e){const n=o=>{if("e"in o)throw o.e;return o.d},i=atom(o=>{var a;let u=r(o);const l=(a=u[Symbol.observable])==null?void 0:a.call(u);l&&(u=l);let g;const y=()=>new Promise(De=>{g=De}),A=e&&"initialValue"in e?{d:typeof e.initialValue=="function"?e.initialValue():e.initialValue}:y();let I,P;const D=De=>{P=De,g?.(De),I?.(De)};let U,V;const J=()=>!I,re=()=>{U&&(U.unsubscribe(),U=void 0)},ce=()=>{U&&(clearTimeout(V),U.unsubscribe()),U=u.subscribe({next:De=>D({d:De}),error:De=>D({e:De}),complete:()=>{}}),J()&&e?.unstable_timeout&&(V=setTimeout(re,e.unstable_timeout))};ce();const Re=atom(P||A);return Re.debugPrivate=!0,Re.onMount=De=>(I=De,P&&De(P),U?clearTimeout(V):ce(),()=>{I=void 0,e?.unstable_timeout?V=setTimeout(re,e.unstable_timeout):re()}),[Re,u,y,ce,J]});return i.debugPrivate=!0,atom(o=>{const[a]=o(i),u=o(a);return u instanceof Promise?u.then(n):n(u)},(o,a,u)=>{const[l,g,y,A,I]=o(i);if("next"in g)I()&&(a(l,y()),A()),g.next(u);else throw new Error("observable is not subject")})}const nr=new WeakMap,ir=(r,e)=>(nr.has(e)?nr:nr.set(e,r())).get(e),Tr=r=>r instanceof Promise,Ur=null;function Wr(r){return ir(()=>{const e=new WeakMap,n=atom(0);n.debugPrivate=!0;const i=atom((s,{setSelf:o})=>{s(n);let a;try{a=s(r)}catch(y){return{state:"hasError",error:y}}if(!Tr(a))return{state:"hasData",data:a};const u=a,l=e.get(u);if(l)return l;u.then(y=>{e.set(u,{state:"hasData",data:y}),o()},y=>{e.set(u,{state:"hasError",error:y}),o()});const g=e.get(u);return g||(e.set(u,Ur),Ur)},(s,o)=>{o(n,a=>a+1)});return i.debugPrivate=!0,atom(s=>s(i))},r)}const Sn=(r,e,n)=>(e.has(n)?e:e.set(n,r())).get(n),Xn=new WeakMap,Wn=(r,e,n)=>{const i=Sn(()=>new WeakMap,Xn,e);return Sn(r,i,n)},Mn=r=>r instanceof Promise,Qn=()=>{};function Es(r,e=Qn){return Wn(()=>{const n=new WeakMap,i=new WeakMap,s=atom(0);s.debugPrivate=!0;const o=atom((a,{setSelf:u})=>{a(s);const l=a(o),g=a(r);if(!Mn(g))return{v:g};if(g!==l?.p&&g.then(y=>{i.set(g,y),u()},y=>{n.set(g,y),u()}),n.has(g))throw n.get(g);return i.has(g)?{p:g,v:i.get(g)}:l&&"v"in l?{p:g,f:e(l.v),v:l.v}:{p:g,f:e()}},(a,u)=>{u(s,l=>l+1)});return o.init=void 0,o.debugPrivate=!0,atom(a=>{const u=a(o);return"f"in u?u.f:u.v},(a,u,...l)=>u(r,...l))},r,e)}function Bs(r,e){const n=atom(0);return n.debugPrivate=!0,atom((i,s)=>(i(n),r(i,s)),(i,s,...o)=>{if(o.length===0)s(n,a=>a+1);else{if(e)return e(i,s,...o);throw new Error("refresh must be called without arguments")}})}function yi(r){const e=atom(void 0);return delete e.init,Object.defineProperty(e,"init",{get(){return r()}}),e}var xi;(function(r){r.light="light",r.dark="dark",r.os="os",r.midnight="midnight"})(xi||(xi={}));var Hn=[{key:"en",text:"English",alias:["en-IN","en-AU","en-NZ","en-NG","en-KZ","en-ZA","en-BH","en-AE","en-JP"]},{key:"zh-CN",text:"\u7B80\u4F53\u4E2D\u6587"},{key:"zh-TW",text:"\u7E41\u9AD4\u4E2D\u6587",alias:["zh-TC"]},{key:"ru",text:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",alias:["ru-UA","ru-KZ"]},{key:"es",text:"Espa\xF1ol",alias:["es-AR","es-MX","es-LA"]},{key:"fr",text:"Fran\xE7ais",alias:["fr-AF"]},{key:"vi",text:"Ti\u1EBFng Vi\u1EC7t"},{key:"it",text:"Italiano"},{key:"pl",text:"Polski"},{key:"id",text:"Bahasa Indonesia"},{key:"uk",text:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},{key:"ar",text:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",alias:["ar-BH"]},{key:"pt",text:"Portugu\xEAs",alias:["pt-BR"]},{key:"ro",text:"Rom\xE2n\u0103"},{key:"bg",text:"\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"},{key:"cs",text:"\u010Ce\u0161tina"},{key:"lv",text:"latvie\u0161u valoda"},{key:"sv",text:"Svenska"},{key:"el",text:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},{key:"sk",text:"Sloven\u010Dina"},{key:"sl",text:"Sloven\u0161\u010Dina"},{key:"de",text:"Deutsch (Schweiz)"},{key:"kk",text:"\u049A\u0430\u0437\u0430\u049B\u0448\u0430",alias:["kk-KZ","kz"]},{key:"ja",text:"\u65E5\u672C\u8A9E"},{key:"hu",text:"magyar nyelv"},{key:"lo",text:"\u0EA5\u0EB2\u0EA7"},{key:"si",text:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD"}],Os=function(r){if(!r)return"en";var e=Hn,n=r.split("-")[0];(r==="zh-CN"||r==="zh-TW")&&(n=r);var i=!0,s=!1,o=void 0;try{for(var a=e[Symbol.iterator](),u;!(i=(u=a.next()).done);i=!0){var l=u.value;if(l.key===n)return l.key}}catch(g){s=!0,o=g}finally{try{!i&&a.return!=null&&a.return()}finally{if(s)throw o}}return"en"},Zs={theme:xi.os,currentLanguage:Os(navigator.language),currentCurrency:"USD",autoLockTimeMinutes:120,displayBalance:!0,hideSpanTransaction:!0,hideLowBalanceToken:!1,hideLowValue:!0,viewMode:"popup"},Po={preferenceSetting:Zs},Fo=Nr(Po).preferenceSettingBgAtom,na=Bc(function(r){return tr(function(){var e=(0,k.A)(b().mark(function n(i){var s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,i(Fo);case 2:return s=a.sent,a.abrupt("return",s[r]);case 4:case"end":return a.stop()}},n)}));return function(n){return e.apply(this,arguments)}}())}),ku=na("currentCurrency");function Mr(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable}))),i.forEach(function(s){vt(r,s,n[s])})}return r}function Jl(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),n.push.apply(n,i)}return n}function gn(r,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Jl(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))}),r}function Ch(r,e){if(r==null)return{};var n={},i=Object.keys(r),s,o;for(o=0;o<i.length;o++)s=i[o],!(e.indexOf(s)>=0)&&(n[s]=r[s]);return n}function bs(r,e){if(r==null)return{};var n=Ch(r,e),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(s=0;s<o.length;s++)i=o[s],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(r,i)&&(n[i]=r[i])}return n}const Nm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Bf;const F0=new Uint8Array(16);function lv(){if(!Bf&&(Bf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bf(F0)}const ma=[];for(let r=0;r<256;++r)ma.push((r+256).toString(16).slice(1));function kg(r,e=0){return ma[r[e+0]]+ma[r[e+1]]+ma[r[e+2]]+ma[r[e+3]]+"-"+ma[r[e+4]]+ma[r[e+5]]+"-"+ma[r[e+6]]+ma[r[e+7]]+"-"+ma[r[e+8]]+ma[r[e+9]]+"-"+ma[r[e+10]]+ma[r[e+11]]+ma[r[e+12]]+ma[r[e+13]]+ma[r[e+14]]+ma[r[e+15]]}function Mm(r,e=0){const n=kg(r,e);if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}const lA=null;function fv(r,e,n){if(Nm.randomUUID&&!e&&!r)return Nm.randomUUID();r=r||{};const i=r.random||(r.rng||lv)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let s=0;s<16;++s)e[n+s]=i[s];return e}return kg(i)}const Ha=fv;var xd="extension-id-key",Ql=null,Lm=function(){var r=(0,k.A)(b().mark(function e(){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=Ha(),s.next=3,ee.setItem("local:".concat(xd),n);case 3:Ql=null;case 4:case"end":return s.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),ll=function(){var r=(0,k.A)(b().mark(function e(){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return Ql||(Ql=fA()),i.abrupt("return",Ql);case 2:case"end":return i.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),fA=function(){var r=(0,k.A)(b().mark(function e(){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ee.getItem("local:".concat(xd));case 2:if(n=o.sent,n){o.next=8;break}return i=Ha(),o.next=7,ee.setItem("local:".concat(xd),i);case 7:n=i;case 8:return o.abrupt("return",n);case 9:case"end":return o.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),Dm=tn(504);const W0=Symbol.for("Dexie"),ec=globalThis[W0]||(globalThis[W0]=Dm);if(Dm.semVer!==ec.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Dm.semVer} and ${ec.semVer}`);const{liveQuery:Yo,mergeRanges:Of,rangesOverlap:Oc,RangeSet:_S,cmp:Rg,Entity:dv,PropModification:Ru,replacePrefix:H0,add:z0,remove:Bd}=ec,hv=ec;var Te=function(){"use strict";function r(n){(0,G.A)(this,r),this.tableName=n}var e=r.prototype;return e.toMap=function(){var i=this;return(0,k.A)(b().mark(function s(){var o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Fe.table(i.tableName).toArray();case 2:return o=u.sent,u.abrupt("return",(0,H.keyBy)(o,function(l){return l._id}));case 4:case"end":return u.stop()}},s)}))()},e.toArray=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Fe.table(i.tableName).toArray();case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}},s)}))()},e.upsert=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Fe.table(o.tableName).put(gn(Mr({},s),{_id:i}),i);case 2:case"end":return l.stop()}},a)}))()},e.update=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Fe.table(o.tableName).update(i,s);case 2:case"end":return l.stop()}},a)}))()},e.get=function(i){var s=this;return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Fe.table(s.tableName).get(i);case 2:return u.abrupt("return",u.sent);case 3:case"end":return u.stop()}},o)}))()},e.delete=function(i){var s=this;return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Fe.table(s.tableName).delete(i);case 2:return u.abrupt("return",u.sent);case 3:case"end":return u.stop()}},o)}))()},(0,L.A)(r,[{key:"table",get:function(){return Fe.table(this.tableName)}}]),r}(),Fe=new hv("BinanceWeb3WalletExtensionDB");function ut(r){return{index:r,types:{key:null,value:null}}}var St={walletMetaData:ut(""),accountMetaData:ut(""),permissions:ut(""),approvalRequest:ut(",origin,status,timestamp,[status+origin]"),preferences:ut(""),website:ut(""),tokenPreference:ut(""),translationResource:ut(""),sasProofKey:ut(""),sasEnableConfig:ut(""),customChain:ut(""),customChainToken:ut(""),customChainTx:ut(",[chainId+address]"),customChainBlock:ut(""),customChainTokenPreference:ut(""),recentSendAddress:ut(",[senderAddress+chainType]"),addressBook:ut("")},Nt=function(r){var e={};for(var n in r){var i=r[n].index;e[n]=i}return e};Fe.version(1).stores(Nt(St));function qt(r){return new Te(r)}function lr(){var r={};for(var e in St){var n=qt(e);r["".concat(e,"Table")]=n}return r}var gr=lr(),Er=gr.walletMetaDataTable,jt=gr.accountMetaDataTable,Qt=gr.permissionsTable,Gt=gr.approvalRequestTable,br=gr.preferencesTable,yr=gr.websiteTable,Sr=gr.translationResourceTable,Or=gr.sasProofKeyTable,Ir=gr.sasEnableConfigTable,Vr=gr.customChainTable,Gr=gr.customChainTokenTable,jr=gr.customChainTxTable,dn=gr.customChainTokenPreferenceTable,Pn=gr.customChainBlockTable,Dn=gr.recentSendAddressTable,Cn=gr.addressBookTable,Ln=new WeakMap,Yr=function(){"use strict";function r(){(0,G.A)(this,r),de(this,Ln,{writable:!0,value:[]})}var e=r.prototype;return e.init=function(){return(0,k.A)(b().mark(function i(){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:case"end":return o.stop()}},i)}))()},e.subscribe=function(i,s){X(this,Ln).push(zt.sub(i,(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.get(i);case 2:a=l.sent,s(a);case 4:case"end":return l.stop()}},o)}))))},(0,L.A)(r,[{key:"initDependency",get:function(){return[]}}]),r}(),Un=new WeakSet,ii=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),Un),s.name="preference",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,Un,Hi).call(o);case 2:case"end":return l.stop()}},a)}))()},i.getPreference=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,br.get(o);case 2:if(u=g.sent,u){g.next=7;break}return g.abrupt("return",Zs[o]);case 7:return g.abrupt("return",u.value);case 8:case"end":return g.stop()}},a)}))()},i.updatePreference=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,br.upsert(o,{value:a});case 2:return y.next=4,K(u,Un,Hi).call(u);case 4:case"end":return y.stop()}},l)}))()},n}(Yr);function Hi(){return Zi.apply(this,arguments)}function Zi(){return Zi=(0,k.A)(b().mark(function r(){var e,n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,br.toMap();case 2:e=a.sent,n=(0,H.cloneDeep)(Zs);for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s=e[i],n[i]=s.value);return a.next=7,zt.set(Fo,n);case 7:case"end":return a.stop()}},r)})),Zi.apply(this,arguments)}var Bi=new ii;_e("preference",{getPreference:Bi.getPreference.bind(Bi),updatePreference:Bi.updatePreference.bind(Bi)});var Cu="prod",Si=Cu==="prod",Li=tn(55493);const ia="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let $0=r=>crypto.getRandomValues(new Uint8Array(r)),ba=(r,e,n)=>{let i=(2<<Math.log2(r.length-1))-1,s=-~(1.6*i*e/r.length);return(o=e)=>{let a="";for(;;){let u=n(s),l=s|0;for(;l--;)if(a+=r[u[l]&i]||"",a.length>=o)return a}}},Od=(r,e=21)=>ba(r,e|0,$0),xh=(r=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(r|=0));for(;r--;)e+=ia[n[r]&63];return e};var Pc=function(){return xh()},Cg=function(){return Ha()},Um=function(){return tf(32)},xu=function(){return tf(32)},ef=function(){return"a-".concat(Pc())},Fm=function(){return"w-".concat(Pc())},M4=function(r){return"approval-".concat(r||Pc())},no=function(r,e){return e?"n-b-".concat(r,"-").concat(e):"n-b-".concat(r)},Pf=function(r){return"n-c-".concat(r)},Za=function(r){if(!r.startsWith("n-b-"))throw new Error("Network ID cannot be converted to Binance Chain ID");return r.split("-")[2]},ES=function(r){return!r||!r.startsWith("n-b-")?null:r.split("-")[2]},Pd=function(r){if(!r.startsWith("n-c-"))throw new Error("Network ID cannot be converted to Custom Chain ID");return r.split("-")[2]},za=function(r){return r?r.startsWith("n-c-"):!1},L4=function(r){if(r===null)return null;if(r!==void 0)return Za(r)},fl=function(r){return"t-b-".concat(r)},No=function(r,e){if(isNaN(Number(r)))throw Error("require chain id is number");return"t-c-".concat(r,"-").concat(e.toLowerCase())},Ya=function(r,e,n){return"tx-c-".concat(r,"-").concat(e,"-").concat(n).toLowerCase()},D4=function(r,e){return"block-".concat(r,"-").concat(e).toLowerCase()},U4=function(r){var e=r.split("-");return{chainId:e[2],txHash:e[3],userAddress:e[4]}},dA=function(r){return r.startsWith("t-c-")},Wm=function(r){if(!r.startsWith("t-b-"))throw new Error("Token ID cannot be converted to Binance Token ID");return r.split("-")[2]},Hm=function(r){if(!r.startsWith("t-c-"))throw new Error("Token ID is not custom chain token");var e=r.split("-");return{chainId:e[2],tokenContract:e[3]}},tf=function(r){return(0,Li.A)(Array(r)).map(function(){return Math.floor(Math.random()*16).toString(16)}).join("")},xg=function(r,e){return"sas-id-".concat(r,"-").concat(e)},Bg=function(){return"ab-".concat(Cg())},Nc=(0,H.once)(function(){var r=chrome.runtime.getManifest(),e=r.version;return e}),Og=function(){var r=(0,k.A)(b().mark(function e(){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Bh();case 2:return n=s.sent,s.abrupt("return",n.replace("/bapi/defi",""));case 4:case"end":return s.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),Bh=(0,H.once)((0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(Si){i.next=6;break}return i.next=3,ee.getItem("local:api_host");case 3:if(e=i.sent,!e){i.next=6;break}return i.abrupt("return",Nd(e));case 6:return i.abrupt("return",Nd("https://www.bnw3w.com/bapi/defi"));case 7:case"end":return i.stop()}},r)}))),Nd=function(r){return r.startsWith("http")||(r="http://".concat(r)),r.endsWith("/")&&(r=r.slice(0,-1)),r},F4=function(){var r=(0,k.A)(b().mark(function e(){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Bh();case 2:if(n=o.sent,i=n.includes("qa"),!i){o.next=8;break}return o.abrupt("return","");case 8:return o.abrupt("return","wss://nbstream.bnw3w.com");case 9:case"end":return o.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),W4=(0,H.once)((0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(Si){i.next=6;break}return i.next=3,ee.getItem("local:static_host");case 3:if(e=i.sent,!e){i.next=6;break}return i.abrupt("return",Nd(e));case 6:return i.abrupt("return",Nd("https://static.bnw3w.com"));case 7:case"end":return i.stop()}},r)}))),TS="Fetch timeout",hA=function(r,e){var n=Object.keys(e).map(function(s){var o=e[s];return(0,H.isNil)(o)?null:"".concat(s,"=").concat(encodeURIComponent(o))}).filter(function(s){return s!==null}).join("&"),i=r&&r.indexOf("?")===-1?"?":"&";return"".concat(r).concat(i).concat(n)},H4=5.5*1e3,zm=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D=arguments;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:i=D.length>1&&D[1]!==void 0?D[1]:{},s=i.timeout,o=i.retryOnTimeout,a=o===void 0?4:o,u=bs(i,["timeout","retryOnTimeout"]),l=0;case 3:if(!(l<a)){V.next=32;break}return g=Math.pow(2,l)*(s||H4),y=new AbortController,A=setTimeout(function(){y.abort(TS)},g),V.prev=7,V.next=10,fetch(n,gn(Mr({},u),{signal:y.signal}));case 10:return I=V.sent,A&&(clearTimeout(A),A=null),V.next=14,I.json();case 14:return P=V.sent,V.abrupt("return",P);case 18:if(V.prev=18,V.t0=V.catch(7),!(V.t0===TS&&l<a-1)){V.next=25;break}return console.debug("Timeout error for ".concat(n,", retrying...")),V.abrupt("continue",29);case 25:throw V.t0;case 26:return V.prev=26,A&&(clearTimeout(A),A=null),V.finish(26);case 29:l++,V.next=3;break;case 32:case"end":return V.stop()}},e,null,[[7,18,26,29]])}));return function(n){return r.apply(this,arguments)}}(),Oh=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u=arguments;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return i=u.length>1&&u[1]!==void 0?u[1]:{},g.next=3,dl();case 3:return s=g.sent,o=i.headers||{},a=Um(),g.abrupt("return",zm(n,gn(Mr({},i),{headers:gn(Mr({},o,s),{"x-w3w-tag":"CX2N43YMVWgRjhtq","x-trace-id":a})})).catch(function(){var y=(0,k.A)(b().mark(function A(I){return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:throw console.error("API Error: ".concat(a)),Error(I);case 2:case"end":return D.stop()}},A)}));return function(A){return y.apply(this,arguments)}}()));case 7:case"end":return g.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),Ph=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u=arguments;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=u.length>2&&u[2]!==void 0?u[2]:{},i&&Object.keys(i)&&(n=hA(n,i)),o=n,o.startsWith("http")){g.next=8;break}return g.next=6,Og();case 6:a=g.sent,o=a+n;case 8:return g.abrupt("return",Oh(o,s));case 9:case"end":return g.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Zt=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y=arguments;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(s=y.length>2&&y[2]!==void 0?y[2]:{},o=n,o.startsWith("http")){I.next=7;break}return I.next=5,Og();case 5:a=I.sent,o=a+n;case 7:return u=s.headers,l=u===void 0?{}:u,g=bs(s,["headers"]),I.abrupt("return",Oh(o,gn(Mr({},g),{method:"POST",headers:Mr({"Content-Type":"application/json"},l||{}),body:JSON.stringify(Mr({},i))})).then(function(P){if(Number(P.code)!==0)throw Error("".concat(P.code,":").concat(P.message));return P}));case 9:case"end":return I.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Xi=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a=arguments;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return s=a.length>2&&a[2]!==void 0?a[2]:{},i&&Object.keys(i)&&(n=hA(n,i)),l.next=4,Bh();case 4:return o=l.sent,l.abrupt("return",Oh(o+n,s).then(function(g){if(Number(g.code)!==0)throw Error("".concat(g.code,":").concat(g.message));return g}));case 6:case"end":return l.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Gn=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y,A=arguments;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return s=A.length>2&&A[2]!==void 0?A[2]:{},P.next=3,ll();case 3:return o=P.sent,P.next=6,Bh();case 6:return a=P.sent,u="".concat(a).concat(n),l=s.headers,g=l===void 0?{}:l,y=bs(s,["headers"]),P.abrupt("return",Oh(u,gn(Mr({},y),{method:"POST",headers:Mr({"Content-Type":"application/json"},g||{}),body:JSON.stringify(Mr({extensionId:o},i))})).then(function(D){if(Number(D.code)!==0)throw Error("".concat(D.code,":").concat(D.message));return D}));case 10:case"end":return P.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),dl=function(){var r=(0,k.A)(b().mark(function e(){var n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,ll();case 2:return n=g.sent,i=Nc(),g.next=6,ps();case 6:return s=g.sent,g.next=9,Bi.getPreference("currentLanguage");case 9:if(o=g.sent,a={clientType:"extension",clientVersion:i,extensionId:n,lang:o,"fvideo-id":wo.fvideoId||"","fvideo-token":wo.fvideoToken||""},!Si&&s&&(a["x-gray-env"]=s),Si){g.next=17;break}return g.next=15,ee.getItem("local:sign-gray-env");case 15:u=g.sent,u&&(a["sign-gray-env"]=u);case 17:return g.abrupt("return",a);case 18:case"end":return g.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),ps=(0,H.once)((0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!Si){i.next=2;break}return i.abrupt("return","");case 2:return i.next=4,ee.getItem("local:gray_env_tag");case 4:if(e=i.sent,!e){i.next=7;break}return i.abrupt("return",e);case 7:return i.abrupt("return","");case 8:case"end":return i.stop()}},r)}))),z4={fetchNetworkCoinAll:function(){return Ph("/bapi/capital/v2/public/capital/getNetworkCoinAll")},fetchAllAsset:function(){return Ph("/bapi/asset/v2/public/asset/asset/get-all-asset")},getDepositAddress:function(r){return Gn("/v1/public/wallet-direct/extension-wallet/capital/deposit/address",gn(Mr({},r),{isAgreement:!0}))}},$4={getChainNodesList:function(){return Ph("/bapi/defi/v1/public/wallet-direct/buw/chain/nodes")}},V4={check:function(e){var n=e?{"bnc-currency":e}:{};return Zt("/bapi/compliance/v1/friendly/compliance/market/business-compliance-check",{platform:"WEB"},{headers:n})}},V0={getCurrencyList:function(){return Ph("/bapi/asset/v1/public/asset-service/product/currency")}},j4={getDefiList:function(e){return Gn("/v1/friendly/wallet-direct/buw/wallet/defi/protocol/list",{address:e})},getDefiPositionList:function(e){return Gn("/v1/public/wallet-direct/extension-wallet/defi/protocol/list",{forceRefresh:e})},getDefiPositionListWithKeyIds:function(e){var n=e.walletIds,i=e.noRefresh,s=e.mpcKeyId;return Gn("/v1/public/wallet-direct/extension-wallet/defi/protocol/list/with/keyIds",{forceRefresh:!i,keyIds:n??void 0,mpcKeyId:s})},refreshDefiAsset:function(e){return Gn("/v1/friendly/wallet-direct/buw/wallet/defi/protocol/refresh",{address:e})}},K4={reportExtensionId:function(){return Gn("/v1/friendly/wallet-direct/buw/extension/extension-id/report",{})},getUpgradeConfig:function(){return Xi("/v1/public/wallet-direct/buw/extension/upgrade/config")},getApolloConfig:function(r){return Xi("/v1/public/wallet-direct/apollo/config/query",{apolloConfigKey:r})},getSystemTimestamp:function(){return Xi("/v1/public/wallet-direct/extension-wallet/system/timestamp")}},Mo;(function(r){r.LegacyFeeTemplate="LegacyFeeTemplate",r.SimpleFeeTemplate="SimpleFeeTemplate",r.Eip1559FeeTemplate="Eip1559FeeTemplate",r.SolanaFeeTemplate="SolanaFeeTemplate",r.TiredFeeTemplate="TiredFeeTemplate"})(Mo||(Mo={}));var pA;(function(r){r.CurrentWallet="currentWallet"})(pA||(pA={}));var gA;(function(r){r.CurrentWallet="currentWallet"})(gA||(gA={}));var ds;(function(r){r.High="High",r.Medium="Medium",r.Low="Low",r.Custom="Custom"})(ds||(ds={}));var RW=[Mo.Eip1559FeeTemplate,Mo.LegacyFeeTemplate,Mo.SolanaFeeTemplate],CW=null,G4={gasAccountList:function(r){var e=r.antiMev,n=bs(r,["antiMev"]),i=void 0;return e&&(i={"mev.protection":!0}),Gn("/v1/friendly/wallet-direct/buw/gas/account/list",gn(Mr({},n),{transactionConfig:i,supportedFeeTemplates:[Mo.LegacyFeeTemplate,Mo.Eip1559FeeTemplate,Mo.SolanaFeeTemplate,Mo.SimpleFeeTemplate]}))}};function rf(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=function(g){var y=o(g),A=i[y],I=Date.now();if(!A||A._timeout&&A._timeout<I){var P=r(g),D=0;u&&(D=Date.now()+u),i[y]={ret:P,_timeout:D}}return i[y].ret},i={},s=e.hashArg,o=s===void 0?function(l){return String(l)}:s,a=e.cacheTime,u=a===void 0?0:a;return n.clear=function(){i={}},n.removeCache=function(l){delete i[l]},n.setCache=function(l,g){var y=Date.now(),A=0;u&&(A=y+u),i[l]={ret:g,_timeout:A}},n.setExpireTimeout=function(l,g){if(!i[l]){console.warn("[setExpire]: No cache for key",l);return}i[l]._timeout=g},n}var q4={generateQRCode:function(e){var n=e.publicKeyHex,i=e.isFirstLogin;return Gn("/v1/friendly/wallet-direct/extension-wallet/login/qr-code",{publicKeyHex:n,isFirstLogin:i})},importMoreMPC:function(e){return Gn("/v1/friendly/wallet-direct/extension-wallet/import/mpc",e)},getAllMPCSimpleInfo:rf(function(){return Gn("/v1/friendly/wallet-direct/extension-wallet/query/mpc",{})},{cacheTime:3*1e3}),getImportedMPCWallet:rf(function(){return Gn("/v1/friendly/wallet-direct/extension-wallet/query/import/mpc",{})},{cacheTime:3*1e3}),pollQRCode:function(e){return Gn("/v1/friendly/wallet-direct/extension-wallet/authorize/confirm",{qrCodeId:e})},pollAddMore:function(e){return Gn("/v1/friendly/wallet-direct/extension-wallet/import/mpc/confirm",{serialNum:e})},cancelLogin:function(e){return Gn("/v1/friendly/wallet-direct/buw/extension/cancel/login",{qrCodeId:e})},cancelAddMore:function(e){return Gn("/v1/friendly/wallet-direct/extension-wallet/cancel/import",{serialNum:e})},pollLoginStatus:function(){return Gn("/v1/friendly/wallet-direct/buw/extension/oauth/authorize/query",{})},refreshAuthStatus:function(){return Gn("/v1/friendly/wallet-direct/buw/extension/oauth/authorize/refresh",{})},singleLogout:function(e){return Gn("/v1/friendly/wallet-direct/extension-wallet/single/logout",e)},switchMPCLogin:function(e){return Gn("/v1/friendly/wallet-direct/extension-wallet/switch/mpc",{keyId:e})},logoutSession:function(){return Gn("/v1/friendly/wallet-direct/buw/extension/logout",{})},delSession:function(){return Gn("/v1/friendly/wallet-direct/buw/extension/delete/session",{})},saveTxToApp:function(e){return Gn("/v1/friendly/wallet-direct/buw/extension/tx/data/save",e)},pushTxToApp:function(e){var n=Nc();return Gn("/v1/friendly/wallet-direct/task-message/send",Mr({source:"EXTENSION",clientVersion:n,destination:"APP"},e))},cancelTx:function(e){return Gn("/v1/friendly/wallet-direct/buw/extension/cancel/tx",{txId:e})},revokeTaskMessage:function(e){return Gn("/v1/friendly/wallet-direct/task-message/revoke",Mr({source:"EXTENSION",destination:"APP",forceCancel:!0},e))},pollTxResult:function(e){return Gn("/v1/friendly/wallet-direct/buw/extension/query/tx/result",{txId:e})},getJWT:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v2/friendly/wallet-direct/buw/extension/client/get/jwt",Mr({},i),{headers:{signature:n}})},sign:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/friendly/wallet-direct/buw/extension/sign",i,{headers:{signature:n}})},customNetworkSign:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/public/wallet-direct/buw/extension/custom-network-sign",i,{headers:{signature:n}})},preSignList:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/friendly/wallet-direct/buw/extension/preSign/list",i,{headers:{signature:n}})},batchSign:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/public/wallet-direct/extension-wallet/batch/sign",i,{headers:{signature:n}})},customNetworkBatchSign:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/public/wallet-direct/extension-wallet/custom/network/batch/sign",i,{headers:{signature:n}})},asyncKeyExchange:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/public/wallet-direct/extension-wallet/async/keyExchange",i,{headers:{signature:n}})},asyncPresignStart:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/public/wallet-direct/extension-wallet/async/presign/start",i,{headers:{signature:n}})},asyncPresignProgress:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/public/wallet-direct/extension-wallet/async/presign/progress",i,{headers:{signature:n}})}},Md={getNetworkList:function(){return Xi("/v1/public/wallet-direct/mgmt/networks")},activeNetworkList:function(){return Xi("/v1/public/wallet-direct/mgmt/networks/active")},getChainListChains:rf((0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Xi("/v1/public/wallet-direct/extension-wallet/customize/chains");case 2:return e=i.sent,i.abrupt("return",e.data);case 4:case"end":return i.stop()}},r)})),{cacheTime:10*60*1e3})},Z4={getPublicKey:function(r){return Xi("/v3/public/wallet-direct/buw/sign-delegate/public-key",r)},getConfig:function(){return Xi("/v2/public/wallet-direct/buw/sign-delegate/config")}},Y4={commonCheck:function(e){return(0,k.A)(b().mark(function n(){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Gn("/v2/public/wallet-direct/buw/extension/security/common-check",e));case 1:case"end":return s.stop()}},n)}))()},batchCheck:function(e){return(0,k.A)(b().mark(function n(){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Gn("/v2/public/wallet-direct/buw/security/batch-check",e));case 1:case"end":return s.stop()}},n)}))()},commonDataCollect:function(e){return(0,k.A)(b().mark(function n(){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Gn("/v1/public/wallet-direct/buw/extension/security/common-data-collect",e));case 1:case"end":return s.stop()}},n)}))()}},X4={parseMsg:function(e){var n=e.isMpc,i=bs(e,["isMpc"]),s=n?"/v1/friendly/wallet-direct/buw/message/mpc/parse-msg":"/v1/public/wallet-direct/buw/message/parse-msg";return Gn(s,i)},buildMsg:function(e){var n=e.isMpc,i=bs(e,["isMpc"]),s=n?"/v1/friendly/wallet-direct/buw/message/mpc/build-msg":"/v1/public/wallet-direct/buw/message/build-msg";return Gn(s,i)},customNetworkBuildMsg:function(e){return Gn("/v1/public/wallet-direct/buw/message/mpc/custom-network-build-msg",e)},parseTransaction:function(e){var n=e.isMpc,i=bs(e,["isMpc"]),s=n?"/v1/friendly/wallet-direct/buw/transaction/mpc/parse-transaction":"/v1/public/wallet-direct/buw/transaction/parse-transaction";return Gn(s,i)},buildTransaction:function(e){var n=e.isMpc,i=bs(e,["isMpc"]),s=n?"/v1/friendly/wallet-direct/buw/transaction/mpc/build-transaction":"/v1/public/wallet-direct/buw/transaction/build-transaction";return Gn(s,i)},customNetworkBuildTx:function(e){return Gn("/v1/public/wallet-direct/buw/transaction/mpc/custom-network-build-transaction",e)},compileTransaction:function(e){var n=e.isMpc,i=bs(e,["isMpc"]),s=n?"/v1/friendly/wallet-direct/buw/transaction/mpc/compile-with-signatures":"/v1/public/wallet-direct/buw/transaction/compile-with-signatures";return Gn(s,i)},broadcastTransaction:function(e){var n=e.isMpc,i=bs(e,["isMpc"]),s=n?"/v1/friendly/wallet-direct/buw/transaction/mpc/send-transaction":"/v1/public/wallet-direct/buw/transaction/send-transaction";return Gn(s,i)},pendingNonceCheck:function(e){return Gn("/v1/public/wallet-direct/extension-wallet/tx/pending-check",e)}},J4={getSwapSelectors:function(e){return Gn("/v3/public/wallet-direct/swap/aggregator/swap/get-selector",e)},searchSwapSelectors:function(e){return Gn("/v1/public/wallet-direct/swap/aggregator/swap/search",gn(Mr({},e),{page:1,pageSize:200}))},getSelectorInfo:function(e){return Gn("/v1/public/wallet-direct/swap/aggregator/swap/get-token",{tokens:e})},getAggregatorConfig:function(){return Xi("/v1/public/wallet-direct/extension-wallet/swap/aggregator/static/configs")},swapSecurityCheck:function(e){return Gn("/v1/public/wallet-direct/extension-wallet/swap/aggregator/dex/security-check",e)},mpcPreCheck:function(e){return Gn("/v1/public/wallet-direct/extension-wallet/swap/pre/check",e)},homePageCheck:function(e){return Gn("/v1/public/wallet-direct/extension-wallet/swap/home_page/check",e)},queryOrder:function(e){return Gn("/v1/public/wallet-direct/extension-wallet/swap/query-order",e)},sign:function(e){var n=e.signatureHex;return Gn("/v1/public/wallet-direct/extension-wallet/swap/aggregator/sign-transaction",e,{headers:{signature:n}})},batchSign:function(e){var n=e.signatureHex,i=bs(e,["signatureHex"]);return Gn("/v1/public/wallet-direct/extension-wallet/swap/aggregator/batch-sign-transaction",e,{headers:{signature:n}})}},Q4={fetchEstimateGas:function(e){return Xi("/v1/public/wallet-direct/buw/wallet/estimate/gas",{networkId:e})},fetchSolanaGas:function(){return Gn("/v1/public/wallet-direct/buw/wallet/solana/estimate/gas",{sourceType:"QUICK_SWAP"})},postGasPrice:function(e){return Gn("/v1/public/wallet-direct/extension-wallet/blockchain/gasPrice",e)}},j0={tokenStaticList:function(){return Xi("/v1/public/wallet-direct/wallet/token/static/list",{respondType:"Token Id",tokenListId:"Static_token_list",pageSize:100})},tokenSearchMultiChain:function(e){var n=e.keyword;return Xi("/v1/public/wallet-direct/wallet/token/search/multi/chain",{keyword:n})},tokenSearchSingleChain:function(e){return Xi("/v1/public/wallet-direct/wallet/token/search",e)},tokenInfo:function(e){var n=e.binanceTokenIdList;return Gn("/v1/public/wallet-direct/wallet/token/info/list",{tokenIdList:n})},tokenKLine:function(e){var n=e.binanceTokenId,i=e.interval;return Xi("/v1/public/wallet-direct/wallet/token/kline/info/list",{binanceTokenId:n,interval:i.toLowerCase()})},tokenKLinev2:function(e){return Xi("/v1/public/wallet-direct/buw/wallet/dex/market/token/kline",e)},tokenPriceInfo:function(e){var n=e.binanceTokenIdList;return Gn("/v1/public/wallet-direct/wallet/token/price/info/list",{tokenIdList:n})},tokenStatsInfo:function(e){var n=e.binanceTokenIdList;return Gn("/v1/public/wallet-direct/wallet/token/stats/info/list",{tokenIdList:n})},tokenHomepageBalance:function(e){return(0,k.A)(b().mark(function n(){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Gn("/v1/friendly/wallet-direct/wallet/home_page/token/list/with-keyIds",e));case 1:case"end":return s.stop()}},n)}))()},tokenInfoByContractAddress:function(e){return Gn("/v1/public/wallet-direct/wallet/token/info/list/chainId",{tokenMetaReqList:e})},tokenValidate:function(e){var n=e.chainId,i=e.contractAddress;return Xi("/v1/public/wallet-direct/wallet/token/validate",{chainId:n,contractAddress:i})},tokenImport:function(e){return Gn("/v3/public/wallet-direct/buw/wallet/token/import",e)},updateHomeTokenStatus:function(e){return Gn("/v1/public/wallet-direct/buw/extension-binance-tokens/manage",e)},tokenReceiveDefaultList:function(){return Xi("/v1/public/wallet-direct/buw/extension/wallet/token/receive/default/list")},tokenInfoAiNarrative:function(e){return Xi("/v1/public/wallet-direct/buw/wallet/token/ai/narrative/query",e)},tokenInfoMarketMeta:function(e){return Xi("/v3/public/wallet-direct/buw/wallet/market/token/meta/info",e)},tokenInfoMarketDynamicInfo:function(e){return Xi("/v4/public/wallet-direct/buw/wallet/market/token/dynamic/info",e)},tokenInfoTagsInfo:function(e){return Xi("/v1/public/wallet-direct/buw/wallet/dex/market/token/tag/info",e)},getOndoTokenList:function(){return Xi("/v1/public/wallet-direct/buw/wallet/market/token/rwa/stock/detail/list?type=1")},getAlphaTokenList:function(){return Xi("/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list")}},ex={approvalConfigInfo:(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-config-info"));case 1:case"end":return n.stop()}},r)})),approvalDetail:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-info-detail",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),approvalList:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-info-list",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),approvalNum:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-list-num",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),riskyApprovalNum:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-risky-num",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),approvalRecords:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-records",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),approvalRiskAlert:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-risky-alert",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),approvalBatchRiskAlert:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/batch-approve-risky-alert",{addresses:n.addresses.join(",")}));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),approvalRiskInfo:(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-risky-info"));case 1:case"end":return n.stop()}},r)})),approvalSpenderList:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/approve-spender-list",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),batchAddressCheckRisky:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/extension/risky/batch-address-risky",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}()},tx={getTokenAudit:function(e){var n=xu();return Gn("/v1/public/wallet-direct/security/token/audit",gn(Mr({},e),{requestId:n}))}},nf={getHistoryList:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/wallet/plugin/tx-history",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),getTxDetail:function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Xi("/v1/friendly/wallet-direct/wallet/plugin/tx-detail",n));case 1:case"end":return s.stop()}},e)}));return function(e){return r.apply(this,arguments)}}()},rx={getResource:function(e){return Ph(nx(e))},getOthersResource:function(e){return Ph(ix(e))}},nx=function(r){return"https://static.bnw3w.com/api/i18n/-/web/cms/".concat(r,"/w3w-extension")},ix=function(r){return"https://static.saasexch.com/static/bts/api/i18n/-/web/cms/".concat(r,"/w3w-extension-other")},sx={importKeyWalletCreate:function(e){return Gn("/v1/public/wallet-direct/mgmt/import-key/wallet/create",e)},importKeyWalletDelete:function(e){return Gn("/v1/public/wallet-direct/mgmt/import-key/wallet/delete",e)},uploadPrivateKeyAddress:function(e){return Gn("/v1/public/wallet-direct/mgmt/address/generate/private-key",e)},uploadSeedPhraseKeyAddress:function(e){return Gn("/v1/public/wallet-direct/mgmt/address/generate/seed-phrase",e)},balanceScan:function(e){return Gn("/v1/public/wallet-direct/import-key/balance/scan",e)},addressRiskCheck:function(e){return Gn("/v1/public/wallet-direct/mgmt/import-key/address/risk-check",e)}},hn={Asset:z4,ChainNodes:$4,Compliance:V4,Currency:V0,Defi:j4,Extension:K4,Gas:G4,MPCWallet:q4,Network:Md,Sas:Z4,Security:Y4,Sign:X4,Swap:J4,SwapGas:Q4,Token:j0,TokenApproval:ex,TokenAudit:tx,Transaction:nf,Translation:rx,Wallet:sx};function SS(r,e){var n=!1,i=Promise.resolve(),s=0;return function(){return n||Date.now()-s<e||(n=!0,i=new Promise(function(o,a){r().then(function(){n=!1,s=Date.now()}).then(o).catch(a)})),i}}var Nh=function(){"use strict";function r(n){(0,G.A)(this,r),this.dely=n,this.isFetching=!1,this.lastResultTime=0,this.lastPromise=Promise.resolve()}var e=r.prototype;return e.execute=function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this;return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!o.isFetching){A.next=2;break}return A.abrupt("return",o.lastPromise);case 2:if(u=(0,H.isFunction)(o.dely)?o.dely():o.dely,l=Date.now(),!(l>o.lastResultTime&&l-o.lastResultTime<u&&!s.force)){A.next=6;break}return A.abrupt("return",o.lastPromise);case 6:return o.isFetching=!0,o.lastPromise=i(),A.prev=8,A.next=11,o.lastPromise;case 11:return g=A.sent,A.abrupt("return",g);case 13:return A.prev=13,o.isFetching=!1,o.lastResultTime=Date.now(),A.finish(13);case 17:case"end":return A.stop()}},a,null,[[8,,13,17]])}))()},r}();function tc(r){return yA.apply(this,arguments)}function yA(){return yA=(0,k.A)(b().mark(function r(e){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(s){return setTimeout(s,e)}));case 1:case"end":return i.stop()}},r)})),yA.apply(this,arguments)}function pv(r){var e,n,i=new Promise(function(o){n=o,e=setTimeout(function(){o()},r)}),s=function(){clearTimeout(e),n()};return{promise:i,cancel:s}}function gv(r){return Array.isArray(r)&&r.length>0}function mA(r){return r==null}function $m(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}const Vm=(r,e)=>Object.hasOwnProperty.call(r,e);function xW(r){return Object.getOwnPropertyNames(r)}var sf;(function(r){r[r.Null=4]="Null",r[r.Comma=1]="Comma",r[r.Wrapper=1]="Wrapper",r[r.True=4]="True",r[r.False=5]="False",r[r.Quote=1]="Quote",r[r.Colon=1]="Colon",r[r.Date=24]="Date"})(sf=sf||(sf={}));const bA=/"|\\|\n|\r|\t/gu;function K0(r){if(typeof r!="object"||r===null)return!1;try{let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}catch{return!1}}function hl(r){return r.charCodeAt(0)<=127}function BW(r){return r.split("").reduce((n,i)=>hl(i)?n+1:n+2,0)+(r.match(bA)??[]).length}function ox(r){return r.toString().length}class IS extends TypeError{constructor(e,n){let i;const{message:s,explanation:o,...a}=e,{path:u}=e,l=u.length===0?s:`At path: ${u.join(".")} -- ${s}`;super(o??l),o!=null&&(this.cause=l),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>i??(i=[e,...n()])}}function jm(r){return lu(r)&&typeof r[Symbol.iterator]=="function"}function lu(r){return typeof r=="object"&&r!==null}function ax(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;const e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function Nf(r){return typeof r=="symbol"?r.toString():typeof r=="string"?JSON.stringify(r):`${r}`}function yv(r){const{done:e,value:n}=r.next();return e?void 0:n}function ux(r,e,n,i){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});const{path:s,branch:o}=e,{type:a}=n,{refinement:u,message:l=`Expected a value of type \`${a}\`${u?` with refinement \`${u}\``:""}, but received: \`${Nf(i)}\``}=r;return{value:i,type:a,refinement:u,key:s[s.length-1],path:s,branch:o,...r,message:l}}function*mv(r,e,n,i){jm(r)||(r=[r]);for(const s of r){const o=ux(s,e,n,i);o&&(yield o)}}function*ka(r,e,n={}){const{path:i=[],branch:s=[r],coerce:o=!1,mask:a=!1}=n,u={path:i,branch:s};if(o&&(r=e.coercer(r,u),a&&e.type!=="type"&&lu(e.schema)&&lu(r)&&!Array.isArray(r)))for(const g in r)e.schema[g]===void 0&&delete r[g];let l="valid";for(const g of e.validator(r,u))g.explanation=n.message,l="not_valid",yield[g,void 0];for(let[g,y,A]of e.entries(r,u)){const I=ka(y,A,{path:g===void 0?i:[...i,g],branch:g===void 0?s:[...s,y],coerce:o,mask:a,message:n.message});for(const P of I)P[0]?(l=P[0].refinement===null||P[0].refinement===void 0?"not_valid":"not_refined",yield[P[0],void 0]):o&&(y=P[1],g===void 0?r=y:r instanceof Map?r.set(g,y):r instanceof Set?r.add(y):lu(r)&&(y!==void 0||g in r)&&(r[g]=y))}if(l!=="not_valid")for(const g of e.refiner(r,u))g.explanation=n.message,l="not_refined",yield[g,void 0];l==="valid"&&(yield[void 0,r])}class Mc{constructor(e){const{type:n,schema:i,validator:s,refiner:o,coercer:a=l=>l,entries:u=function*(){}}=e;this.type=n,this.schema=i,this.entries=u,this.coercer=a,s?this.validator=(l,g)=>{const y=s(l,g);return mv(y,g,this,l)}:this.validator=()=>[],o?this.refiner=(l,g)=>{const y=o(l,g);return mv(y,g,this,l)}:this.refiner=()=>[]}assert(e,n){return kS(e,this,n)}create(e,n){return of(e,this,n)}is(e){return G0(e,this)}mask(e,n){return vA(e,this,n)}validate(e,n={}){return af(e,this,n)}}function kS(r,e,n){const i=af(r,e,{message:n});if(i[0])throw i[0]}function of(r,e,n){const i=af(r,e,{coerce:!0,message:n});if(i[0])throw i[0];return i[1]}function vA(r,e,n){const i=af(r,e,{coerce:!0,mask:!0,message:n});if(i[0])throw i[0];return i[1]}function G0(r,e){return!af(r,e)[0]}function af(r,e,n={}){const i=ka(r,e,n),s=yv(i);return s[0]?[new IS(s[0],function*(){for(const u of i)u[0]&&(yield u[0])}),void 0]:[void 0,s[1]]}function cx(...r){const e=r[0]?.type==="type",n=r.map(({schema:s})=>s),i=Object.assign({},...n);return e?type(i):object(i)}function sa(r,e){return new Mc({type:r,schema:null,validator:e})}function RS(r,e){return new Struct({...r,refiner:(n,i)=>n===void 0||r.refiner(n,i),validator(n,i){return n===void 0?!0:(e(n,i),r.validator(n,i))}})}function OW(r){return new Struct({type:"dynamic",schema:null,*entries(e,n){yield*r(e,n).entries(e,n)},validator(e,n){return r(e,n).validator(e,n)},coercer(e,n){return r(e,n).coercer(e,n)},refiner(e,n){return r(e,n).refiner(e,n)}})}function PW(r){let e;return new Struct({type:"lazy",schema:null,*entries(n,i){e??(e=r()),yield*e.entries(n,i)},validator(n,i){return e??(e=r()),e.validator(n,i)},coercer(n,i){return e??(e=r()),e.coercer(n,i)},refiner(n,i){return e??(e=r()),e.refiner(n,i)}})}function NW(r,e){const{schema:n}=r,i={...n};for(const s of e)delete i[s];switch(r.type){case"type":return type(i);default:return object(i)}}function CS(r){const e=r instanceof Struct,n=e?{...r.schema}:{...r};for(const i in n)n[i]=optional(n[i]);return e&&r.type==="type"?type(n):object(n)}function MW(r,e){const{schema:n}=r,i={};for(const s of e)i[s]=n[s];switch(r.type){case"type":return type(i);default:return object(i)}}function Km(){return sa("any",()=>!0)}function xS(r){return new Mc({type:"array",schema:r,*entries(e){if(r&&Array.isArray(e))for(const[n,i]of e.entries())yield[n,i,r]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${Nf(e)}`}})}function LW(){return define("bigint",r=>typeof r=="bigint")}function DW(){return define("boolean",r=>typeof r=="boolean")}function bv(){return define("date",r=>r instanceof Date&&!isNaN(r.getTime())||`Expected a valid \`Date\` object, but received: ${print(r)}`)}function UW(r){const e={},n=r.map(i=>print(i)).join();for(const i of r)e[i]=i;return new Struct({type:"enums",schema:e,validator(i){return r.includes(i)||`Expected one of \`${n}\`, but received: ${print(i)}`}})}function FW(){return define("func",r=>typeof r=="function"||`Expected a function, but received: ${print(r)}`)}function BS(r){return define("instance",e=>e instanceof r||`Expected a \`${r.name}\` instance, but received: ${print(e)}`)}function OS(){return sa("integer",r=>typeof r=="number"&&!isNaN(r)&&Number.isInteger(r)||`Expected an integer, but received: ${Nf(r)}`)}function WW(r){return new Struct({type:"intersection",schema:null,*entries(e,n){for(const{entries:i}of r)yield*i(e,n)},*validator(e,n){for(const{validator:i}of r)yield*i(e,n)},*refiner(e,n){for(const{refiner:i}of r)yield*i(e,n)}})}function lx(r){const e=Nf(r),n=typeof r;return new Mc({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?r:null,validator(i){return i===r||`Expected the literal \`${e}\`, but received: ${Nf(i)}`}})}function HW(r,e){return new Struct({type:"map",schema:null,*entries(n){if(r&&e&&n instanceof Map)for(const[i,s]of n.entries())yield[i,i,r],yield[i,s,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${print(n)}`}})}function wA(){return sa("never",()=>!1)}function AA(r){return new Mc({...r,validator:(e,n)=>e===null||r.validator(e,n),refiner:(e,n)=>e===null||r.refiner(e,n)})}function fx(){return sa("number",r=>typeof r=="number"&&!isNaN(r)||`Expected a number, but received: ${Nf(r)}`)}function vv(r){const e=r?Object.keys(r):[],n=wA();return new Mc({type:"object",schema:r??null,*entries(i){if(r&&lu(i)){const s=new Set(Object.keys(i));for(const o of e)s.delete(o),yield[o,i[o],r[o]];for(const o of s)yield[o,i[o],n]}},validator(i){return lu(i)||`Expected an object, but received: ${Nf(i)}`},coercer(i){return lu(i)?{...i}:i}})}function _A(r){return new Mc({...r,validator:(e,n)=>e===void 0||r.validator(e,n),refiner:(e,n)=>e===void 0||r.refiner(e,n)})}function PS(r,e){return new Mc({type:"record",schema:null,*entries(n){if(lu(n))for(const i in n){const s=n[i];yield[i,i,r],yield[i,s,e]}},validator(n){return lu(n)||`Expected an object, but received: ${Nf(n)}`}})}function dx(){return define("regexp",r=>r instanceof RegExp)}function EA(r){return new Struct({type:"set",schema:null,*entries(e){if(r&&e instanceof Set)for(const n of e)yield[n,n,r]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${print(e)}`}})}function Mf(){return sa("string",r=>typeof r=="string"||`Expected a string, but received: ${Nf(r)}`)}function hx(r){const e=wA();return new Struct({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const i=Math.max(r.length,n.length);for(let s=0;s<i;s++)yield[s,n[s],r[s]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${print(n)}`}})}function px(r){const e=Object.keys(r);return new Struct({type:"type",schema:r,*entries(n){if(isObject(n))for(const i of e)yield[i,n[i],r[i]]},validator(n){return isObject(n)||`Expected an object, but received: ${print(n)}`},coercer(n){return isObject(n)?{...n}:n}})}function TA(r){const e=r.map(n=>n.type).join(" | ");return new Mc({type:"union",schema:null,coercer(n){for(const i of r){const[s,o]=i.validate(n,{coerce:!0});if(!s)return o}return n},validator(n,i){const s=[];for(const o of r){const[...a]=ka(n,o,i),[u]=a;if(!u?.[0])return[];for(const[l]of a)l&&s.push(l)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${Nf(n)}`,...s]}})}function NS(){return sa("unknown",()=>!0)}function SA(r,e,n){return new Mc({...r,coercer:(i,s)=>G0(i,e)?r.coercer(n(i,s),s):r.coercer(i,s)})}function MS(r,e,n={}){return SA(r,unknown(),i=>{const s=typeof e=="function"?e():e;if(i===void 0)return s;if(!n.strict&&isPlainObject(i)&&isPlainObject(s)){const o={...i};let a=!1;for(const u in s)o[u]===void 0&&(o[u]=s[u],a=!0);if(a)return o}return i})}function gx(r){return SA(r,string(),e=>e.trim())}function LS(r){return Mh(r,"empty",e=>{const n=DS(e);return n===0||`Expected an empty ${r.type} but received one with a size of \`${n}\``})}function DS(r){return r instanceof Map||r instanceof Set?r.size:r.length}function US(r,e,n={}){const{exclusive:i}=n;return Mh(r,"max",s=>i?s<e:s<=e||`Expected a ${r.type} less than ${i?"":"or equal to "}${e} but received \`${s}\``)}function ss(r,e,n={}){const{exclusive:i}=n;return Mh(r,"min",s=>i?s>e:s>=e||`Expected a ${r.type} greater than ${i?"":"or equal to "}${e} but received \`${s}\``)}function zW(r){return Mh(r,"nonempty",e=>DS(e)>0||`Expected a nonempty ${r.type} but received an empty one`)}function wv(r,e){return Mh(r,"pattern",n=>e.test(n)||`Expected a ${r.type} matching \`/${e.source}/\` but received "${n}"`)}function Av(r,e,n=e){const i=`Expected a ${r.type}`,s=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Mh(r,"size",o=>{if(typeof o=="number"||o instanceof Date)return e<=o&&o<=n||`${i} ${s} but received \`${o}\``;if(o instanceof Map||o instanceof Set){const{size:u}=o;return e<=u&&u<=n||`${i} with a size ${s} but received one with a size of \`${u}\``}const{length:a}=o;return e<=a&&a<=n||`${i} with a length ${s} but received one with a length of \`${a}\``})}function Mh(r,e,n){return new Mc({...r,*refiner(i,s){yield*r.refiner(i,s);const o=n(i,s),a=mv(o,s,r,i);for(const u of a)yield{...u,refinement:e}}})}const Gm=r=>vv(r);function FS({path:r,branch:e}){const n=r[r.length-1];return Vm(e[e.length-2],n)}function Bu(r){return new Mc({...r,type:`optional ${r.type}`,validator:(e,n)=>!FS(n)||r.validator(e,n),refiner:(e,n)=>!FS(n)||r.refiner(e,n)})}function IA(r){if(r===null||typeof r=="boolean"||typeof r=="string"||typeof r=="number"&&Number.isFinite(r))return!0;if(typeof r=="object"){let e=!0;if(Array.isArray(r)){for(let i=0;i<r.length;i++)if(!IA(r[i])){e=!1;break}return e}const n=Object.entries(r);for(let i=0;i<n.length;i++)if(typeof n[i][0]!="string"||!IA(n[i][1])){e=!1;break}return e}return!1}const qm=sa("JSON",r=>IA(r)),Lh=SA(qm,Mh(Km(),"JSON",r=>G0(r,qm)),r=>JSON.parse(JSON.stringify(r,(e,n)=>{if(!(e==="__proto__"||e==="constructor"))return n})));function Zm(r){try{return WS(r),!0}catch{return!1}}function WS(r){return of(r,Lh)}function pl(r){assertStruct(r,Lh,"Invalid JSON value");const e=JSON.stringify(r);return new TextEncoder().encode(e).byteLength}const Z0=lx("2.0"),Ym=AA(TA([fx(),Mf()])),Y0=Gm({code:OS(),message:Mf(),data:Bu(Lh),stack:Bu(Mf())}),kA=TA([PS(Mf(),Lh),xS(Lh)]),_v=Gm({id:Ym,jsonrpc:Z0,method:Mf(),params:Bu(kA)}),RA=Gm({jsonrpc:Z0,method:Mf(),params:Bu(kA)});function HS(r){return is(r,RA)}function zS(r,e){assertStruct(r,RA,"Invalid JSON-RPC notification",e)}function X0(r){return is(r,_v)}function $W(r,e){assertStruct(r,_v,"Invalid JSON-RPC request",e)}const Ld=vv({id:Ym,jsonrpc:Z0,result:_A(NS()),error:_A(Y0)}),Ev=Gm({id:Ym,jsonrpc:Z0,result:Lh}),Tv=Gm({id:Ym,jsonrpc:Z0,error:Y0}),Sv=TA([Ev,Tv]);function VW(r){return is(r,Ld)}function jW(r,e){assertStruct(r,Ld,"Invalid pending JSON-RPC response",e)}function KW(r){return is(r,Sv)}function yx(r,e){assertStruct(r,Sv,"Invalid JSON-RPC response",e)}function mx(r){return is(r,Ev)}function GW(r,e){assertStruct(r,Ev,"Invalid JSON-RPC success response",e)}function bx(r){return is(r,Tv)}function vx(r,e){assertStruct(r,Tv,"Invalid JSON-RPC failure response",e)}function Lc(r){return is(r,Y0)}function Dd(r,e){assertStruct(r,Y0,"Invalid JSON-RPC error",e)}function qW(r){const{permitEmptyString:e,permitFractions:n,permitNull:i}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...r};return o=>!!(typeof o=="number"&&(n||Number.isInteger(o))||typeof o=="string"&&(e||o.length>0)||i&&o===null)}function Pg(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function Iv(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function Xa(r,...e){if(!Iv(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error("Uint8Array expected of length "+e+", got length="+r.length)}function CA(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Pg(r.outputLen),Pg(r.blockLen)}function Xm(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function wx(r,e){Xa(r);const n=e.outputLen;if(r.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const J0=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Jm(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function kv(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function ZW(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function Dh(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function uf(r,e){return r<<32-e|r>>>e}function Q0(r,e){return r<<e|r>>>32-e>>>0}const Ax=null;function Rv(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}const $S=null;function xA(r){for(let e=0;e<r.length;e++)r[e]=Rv(r[e])}const _x=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function VS(r){Xa(r);let e="";for(let n=0;n<r.length;n++)e+=_x[r[n]];return e}const gl={_0:48,_9:57,A:65,F:70,a:97,f:102};function BA(r){if(r>=gl._0&&r<=gl._9)return r-gl._0;if(r>=gl.A&&r<=gl.F)return r-(gl.A-10);if(r>=gl.a&&r<=gl.f)return r-(gl.a-10)}function OA(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=BA(r.charCodeAt(o)),u=BA(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}const Ex=async()=>{};async function jS(r,e,n){let i=Date.now();for(let s=0;s<r;s++){n(s);const o=Date.now()-i;o>=0&&o<e||(await Ex(),i+=o)}}function Lf(r){if(typeof r!="string")throw new Error("utf8ToBytes expected string, got "+typeof r);return new Uint8Array(new TextEncoder().encode(r))}function Uh(r){return typeof r=="string"&&(r=Lf(r)),Xa(r),r}function Ng(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];Xa(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}class KS{clone(){return this._cloneInto()}}function GS(r,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function PA(r){const e=i=>r().update(Uh(i)).digest(),n=r();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>r(),e}function YW(r){const e=(i,s)=>r(s).update(Uh(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function Fh(r){const e=(i,s)=>r(s).update(Uh(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function Cv(r=32){if(J0&&typeof J0.getRandomValues=="function")return J0.getRandomValues(new Uint8Array(r));if(J0&&typeof J0.randomBytes=="function")return J0.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}class xv extends KS{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,CA(e);const i=Uh(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?e.create().update(i).digest():i);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),o.fill(0)}update(e){return Xm(this),this.iHash.update(e),this}digestInto(e){Xm(this),Xa(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:i,finished:s,destroyed:o,blockLen:a,outputLen:u}=this;return e=e,e.finished=s,e.destroyed=o,e.blockLen=a,e.outputLen=u,e.oHash=n._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ep=(r,e,n)=>new xv(r,e).update(n).digest();ep.create=(r,e)=>new xv(r,e);function Qm(r,e,n,i){CA(r);const s=GS({dkLen:32,asyncTick:10},i),{c:o,dkLen:a,asyncTick:u}=s;if(Pg(o),Pg(a),Pg(u),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=Uh(e),g=Uh(n),y=new Uint8Array(a),A=ep.create(r,l),I=A._cloneInto().update(g);return{c:o,dkLen:a,asyncTick:u,DK:y,PRF:A,PRFSalt:I}}function tp(r,e,n,i,s){return r.destroy(),e.destroy(),i&&i.destroy(),s.fill(0),n}function Ni(r,e,n,i){const{c:s,dkLen:o,DK:a,PRF:u,PRFSalt:l}=Qm(r,e,n,i);let g;const y=new Uint8Array(4),A=createView(y),I=new Uint8Array(u.outputLen);for(let P=1,D=0;D<o;P++,D+=u.outputLen){const U=a.subarray(D,D+u.outputLen);A.setInt32(0,P,!1),(g=l._cloneInto(g)).update(y).digestInto(I),U.set(I.subarray(0,U.length));for(let V=1;V<s;V++){u._cloneInto(g).update(I).digestInto(I);for(let J=0;J<U.length;J++)U[J]^=I[J]}}return tp(u,l,a,g,I)}async function Bv(r,e,n,i){const{c:s,dkLen:o,asyncTick:a,DK:u,PRF:l,PRFSalt:g}=Qm(r,e,n,i);let y;const A=new Uint8Array(4),I=Dh(A),P=new Uint8Array(l.outputLen);for(let D=1,U=0;U<o;D++,U+=l.outputLen){const V=u.subarray(U,U+l.outputLen);I.setInt32(0,D,!1),(y=g._cloneInto(y)).update(A).digestInto(P),V.set(P.subarray(0,V.length)),await jS(s-1,a,()=>{l._cloneInto(y).update(P).digestInto(P);for(let J=0;J<V.length;J++)V[J]^=P[J]})}return tp(l,g,u,y,P)}function NA(r,e,n,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,n,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(n>>s&o),u=Number(n&o),l=i?4:0,g=i?0:4;r.setUint32(e+l,a,i),r.setUint32(e+g,u,i)}function rp(r,e,n){return r&e^~r&n}function Tx(r,e,n){return r&e^r&n^e&n}class eb extends KS{constructor(e,n,i,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Dh(this.buffer)}update(e){Xm(this);const{view:n,buffer:i,blockLen:s}=this;e=Uh(e);const o=e.length;for(let a=0;a<o;){const u=Math.min(s-this.pos,o-a);if(u===s){const l=Dh(e);for(;s<=o-a;a+=s)this.process(l,a);continue}i.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Xm(this),wx(e,this),this.finished=!0;const{buffer:n,view:i,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(i,0),a=0);for(let A=a;A<s;A++)n[A]=0;NA(i,s-8,BigInt(this.length*8),o),this.process(i,0);const u=Dh(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const g=l/4,y=this.get();if(g>y.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<g;A++)u.setUint32(4*A,y[A],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:i,length:s,finished:o,destroyed:a,pos:u}=this;return e.length=s,e.pos=u,e.finished=o,e.destroyed=a,s%n&&e.buffer.set(i),e}}const qS=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Wo=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Wh=new Uint32Array(64);class ZS extends eb{constructor(){super(64,32,8,!1),this.A=Wo[0]|0,this.B=Wo[1]|0,this.C=Wo[2]|0,this.D=Wo[3]|0,this.E=Wo[4]|0,this.F=Wo[5]|0,this.G=Wo[6]|0,this.H=Wo[7]|0}get(){const{A:e,B:n,C:i,D:s,E:o,F:a,G:u,H:l}=this;return[e,n,i,s,o,a,u,l]}set(e,n,i,s,o,a,u,l){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,n){for(let A=0;A<16;A++,n+=4)Wh[A]=e.getUint32(n,!1);for(let A=16;A<64;A++){const I=Wh[A-15],P=Wh[A-2],D=uf(I,7)^uf(I,18)^I>>>3,U=uf(P,17)^uf(P,19)^P>>>10;Wh[A]=U+Wh[A-7]+D+Wh[A-16]|0}let{A:i,B:s,C:o,D:a,E:u,F:l,G:g,H:y}=this;for(let A=0;A<64;A++){const I=uf(u,6)^uf(u,11)^uf(u,25),P=y+I+rp(u,l,g)+qS[A]+Wh[A]|0,U=(uf(i,2)^uf(i,13)^uf(i,22))+Tx(i,s,o)|0;y=g,g=l,l=u,u=a+P|0,a=o,o=s,s=i,i=P+U|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,g=g+this.G|0,y=y+this.H|0,this.set(i,s,o,a,u,l,g,y)}roundClean(){Wh.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class Sx extends ZS{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const Ov=PA(()=>new ZS),Ix=null,Pv=BigInt(2**32-1),MA=BigInt(32);function YS(r,e=!1){return e?{h:Number(r&Pv),l:Number(r>>MA&Pv)}:{h:Number(r>>MA&Pv)|0,l:Number(r&Pv)|0}}function Ud(r,e=!1){let n=new Uint32Array(r.length),i=new Uint32Array(r.length);for(let s=0;s<r.length;s++){const{h:o,l:a}=YS(r[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const Ou=(r,e)=>BigInt(r>>>0)<<MA|BigInt(e>>>0),LA=(r,e,n)=>r>>>n,kx=(r,e,n)=>r<<32-n|e>>>n,DA=(r,e,n)=>r>>>n|e<<32-n,Rx=(r,e,n)=>r<<32-n|e>>>n,Cx=(r,e,n)=>r<<64-n|e>>>n-32,tb=(r,e,n)=>r>>>n-32|e<<64-n,XS=(r,e)=>e,JS=(r,e)=>r,xx=(r,e,n)=>r<<n|e>>>32-n,Bx=(r,e,n)=>e<<n|r>>>32-n,Ox=(r,e,n)=>e<<n-32|r>>>64-n,Px=(r,e,n)=>r<<n-32|e>>>64-n;function QS(r,e,n,i){const s=(e>>>0)+(i>>>0);return{h:r+n+(s/2**32|0)|0,l:s|0}}const Ji={fromBig:YS,split:Ud,toBig:Ou,shrSH:LA,shrSL:kx,rotrSH:DA,rotrSL:Rx,rotrBH:Cx,rotrBL:tb,rotr32H:XS,rotr32L:JS,rotlSH:xx,rotlSL:Bx,rotlBH:Ox,rotlBL:Px,add:QS,add3L:(r,e,n)=>(r>>>0)+(e>>>0)+(n>>>0),add3H:(r,e,n,i)=>e+n+i+(r/2**32|0)|0,add4L:(r,e,n,i)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0),add4H:(r,e,n,i,s)=>e+n+i+s+(r/2**32|0)|0,add5H:(r,e,n,i,s,o)=>e+n+i+s+o+(r/2**32|0)|0,add5L:(r,e,n,i,s)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0)+(s>>>0)},[Mv,rI]=Ji.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),Ja=new Uint32Array(80),rc=new Uint32Array(80);class Lv extends eb{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:i,Bl:s,Ch:o,Cl:a,Dh:u,Dl:l,Eh:g,El:y,Fh:A,Fl:I,Gh:P,Gl:D,Hh:U,Hl:V}=this;return[e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V]}set(e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V){this.Ah=e|0,this.Al=n|0,this.Bh=i|0,this.Bl=s|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=g|0,this.El=y|0,this.Fh=A|0,this.Fl=I|0,this.Gh=P|0,this.Gl=D|0,this.Hh=U|0,this.Hl=V|0}process(e,n){for(let ce=0;ce<16;ce++,n+=4)Ja[ce]=e.getUint32(n),rc[ce]=e.getUint32(n+=4);for(let ce=16;ce<80;ce++){const Re=Ja[ce-15]|0,De=rc[ce-15]|0,Ue=Ji.rotrSH(Re,De,1)^Ji.rotrSH(Re,De,8)^Ji.shrSH(Re,De,7),Ve=Ji.rotrSL(Re,De,1)^Ji.rotrSL(Re,De,8)^Ji.shrSL(Re,De,7),pe=Ja[ce-2]|0,Se=rc[ce-2]|0,Ce=Ji.rotrSH(pe,Se,19)^Ji.rotrBH(pe,Se,61)^Ji.shrSH(pe,Se,6),je=Ji.rotrSL(pe,Se,19)^Ji.rotrBL(pe,Se,61)^Ji.shrSL(pe,Se,6),$e=Ji.add4L(Ve,je,rc[ce-7],rc[ce-16]),Qe=Ji.add4H($e,Ue,Ce,Ja[ce-7],Ja[ce-16]);Ja[ce]=Qe|0,rc[ce]=$e|0}let{Ah:i,Al:s,Bh:o,Bl:a,Ch:u,Cl:l,Dh:g,Dl:y,Eh:A,El:I,Fh:P,Fl:D,Gh:U,Gl:V,Hh:J,Hl:re}=this;for(let ce=0;ce<80;ce++){const Re=Ji.rotrSH(A,I,14)^Ji.rotrSH(A,I,18)^Ji.rotrBH(A,I,41),De=Ji.rotrSL(A,I,14)^Ji.rotrSL(A,I,18)^Ji.rotrBL(A,I,41),Ue=A&P^~A&U,Ve=I&D^~I&V,pe=Ji.add5L(re,De,Ve,rI[ce],rc[ce]),Se=Ji.add5H(pe,J,Re,Ue,Mv[ce],Ja[ce]),Ce=pe|0,je=Ji.rotrSH(i,s,28)^Ji.rotrBH(i,s,34)^Ji.rotrBH(i,s,39),$e=Ji.rotrSL(i,s,28)^Ji.rotrBL(i,s,34)^Ji.rotrBL(i,s,39),Qe=i&o^i&u^o&u,nt=s&a^s&l^a&l;J=U|0,re=V|0,U=P|0,V=D|0,P=A|0,D=I|0,{h:A,l:I}=Ji.add(g|0,y|0,Se|0,Ce|0),g=u|0,y=l|0,u=o|0,l=a|0,o=i|0,a=s|0;const Ne=Ji.add3L(Ce,$e,nt);i=Ji.add3H(Ne,Se,je,Qe),s=Ne|0}({h:i,l:s}=Ji.add(this.Ah|0,this.Al|0,i|0,s|0)),{h:o,l:a}=Ji.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=Ji.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:g,l:y}=Ji.add(this.Dh|0,this.Dl|0,g|0,y|0),{h:A,l:I}=Ji.add(this.Eh|0,this.El|0,A|0,I|0),{h:P,l:D}=Ji.add(this.Fh|0,this.Fl|0,P|0,D|0),{h:U,l:V}=Ji.add(this.Gh|0,this.Gl|0,U|0,V|0),{h:J,l:re}=Ji.add(this.Hh|0,this.Hl|0,J|0,re|0),this.set(i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re)}roundClean(){Ja.fill(0),rc.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Dx extends Lv{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class JW extends Lv{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class QW extends Lv{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const UA=PA(()=>new Lv),eH=null,tH=null,rH=null;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function np(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function FA(r,...e){if(!np(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error("Uint8Array expected of length "+e+", got length="+r.length)}function nI(r,e){return Array.isArray(e)?e.length===0?!0:r?e.every(n=>typeof n=="string"):e.every(n=>Number.isSafeInteger(n)):!1}function WA(r){if(typeof r!="function")throw new Error("function expected");return!0}function Hh(r,e){if(typeof e!="string")throw new Error(`${r}: string expected`);return!0}function ip(r){if(!Number.isSafeInteger(r))throw new Error(`invalid integer: ${r}`)}function rb(r){if(!Array.isArray(r))throw new Error("array expected")}function nb(r,e){if(!nI(!0,e))throw new Error(`${r}: array of strings expected`)}function HA(r,e){if(!nI(!1,e))throw new Error(`${r}: array of numbers expected`)}function Pu(...r){const e=o=>o,n=(o,a)=>u=>o(a(u)),i=r.map(o=>o.encode).reduceRight(n,e),s=r.map(o=>o.decode).reduce(n,e);return{encode:i,decode:s}}function nc(r){const e=typeof r=="string"?r.split(""):r,n=e.length;nb("alphabet",e);const i=new Map(e.map((s,o)=>[s,o]));return{encode:s=>(rb(s),s.map(o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${r}`);return e[o]})),decode:s=>(rb(s),s.map(o=>{Hh("alphabet.decode",o);const a=i.get(o);if(a===void 0)throw new Error(`Unknown letter: "${o}". Allowed: ${r}`);return a}))}}function Nu(r=""){return Hh("join",r),{encode:e=>(nb("join.decode",e),e.join(r)),decode:e=>(Hh("join.decode",e),e.split(r))}}function ib(r,e="="){return ip(r),Hh("padding",e),{encode(n){for(nb("padding.encode",n);n.length*r%8;)n.push(e);return n},decode(n){nb("padding.decode",n);let i=n.length;if(i*r%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;i>0&&n[i-1]===e;i--)if((i-1)*r%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,i)}}}function iI(r){return WA(r),{encode:e=>e,decode:e=>r(e)}}function zA(r,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(rb(r),!r.length)return[];let i=0;const s=[],o=Array.from(r,u=>{if(ip(u),u<0||u>=e)throw new Error(`invalid integer: ${u}`);return u}),a=o.length;for(;;){let u=0,l=!0;for(let g=i;g<a;g++){const y=o[g],A=e*u,I=A+y;if(!Number.isSafeInteger(I)||A/e!==u||I-y!==A)throw new Error("convertRadix: carry overflow");const P=I/n;u=I%n;const D=Math.floor(P);if(o[g]=D,!Number.isSafeInteger(D)||D*n+u!==I)throw new Error("convertRadix: carry overflow");if(l)D?l=!1:i=g;else continue}if(s.push(u),l)break}for(let u=0;u<r.length-1&&r[u]===0;u++)s.push(0);return s.reverse()}const sI=(r,e)=>e===0?r:sI(e,r%e),Dv=(r,e)=>r+(e-sI(r,e)),Uv=(()=>{let r=[];for(let e=0;e<40;e++)r.push(2**e);return r})();function Mu(r,e,n,i){if(rb(r),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Dv(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${Dv(e,n)}`);let s=0,o=0;const a=Uv[e],u=Uv[n]-1,l=[];for(const g of r){if(ip(g),g>=a)throw new Error(`convertRadix2: invalid data word=${g} from=${e}`);if(s=s<<e|g,o+e>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)l.push((s>>o-n&u)>>>0);const y=Uv[o];if(y===void 0)throw new Error("invalid carry");s&=y-1}if(s=s<<n-o&u,!i&&o>=e)throw new Error("Excess padding");if(!i&&s>0)throw new Error(`Non-zero padding: ${s}`);return i&&o>0&&l.push(s>>>0),l}function oI(r){ip(r);const e=2**8;return{encode:n=>{if(!np(n))throw new Error("radix.encode input should be Uint8Array");return zA(Array.from(n),e,r)},decode:n=>(HA("radix.decode",n),Uint8Array.from(zA(n,r,e)))}}function Dc(r,e=!1){if(ip(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(Dv(8,r)>32||Dv(r,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!np(n))throw new Error("radix2.encode input should be Uint8Array");return Mu(Array.from(n),8,r,!e)},decode:n=>(HA("radix2.decode",n),Uint8Array.from(Mu(n,r,8,e)))}}function aI(r){return WA(r),function(...e){try{return r.apply(null,e)}catch{}}}function $A(r,e){return ip(r),WA(e),{encode(n){if(!np(n))throw new Error("checksum.encode: input should be Uint8Array");const i=e(n).slice(0,r),s=new Uint8Array(n.length+r);return s.set(n),s.set(i,n.length),s},decode(n){if(!np(n))throw new Error("checksum.decode: input should be Uint8Array");const i=n.slice(0,-r),s=n.slice(-r),o=e(i).slice(0,r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return i}}}const Fv={alphabet:nc,chain:Pu,checksum:$A,convertRadix:zA,convertRadix2:Mu,radix:oI,radix2:Dc,join:Nu,padding:ib},nH=Pu(Dc(4),nc("0123456789ABCDEF"),Nu("")),iH=Pu(Dc(5),nc("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),ib(5),Nu("")),sH=Pu(Dc(5),nc("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Nu("")),uI=Pu(Dc(5),nc("0123456789ABCDEFGHIJKLMNOPQRSTUV"),ib(5),Nu("")),oH=Pu(Dc(5),nc("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Nu("")),aH=Pu(Dc(5),nc("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Nu(""),iI(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),cI=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",lI=(r,e)=>{Hh("base64",r);const n=e?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,i=e?"base64url":"base64";if(r.length>0&&!n.test(r))throw new Error("invalid base64");return Uint8Array.fromBase64(r,{alphabet:i,lastChunkHandling:"strict"})},fI=cI?{encode(r){return FA(r),r.toBase64()},decode(r){return lI(r,!1)}}:Pu(Dc(6),nc("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),ib(6),Nu("")),uH=Pu(Dc(6),nc("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Nu("")),cH=cI?{encode(r){return FA(r),r.toBase64({alphabet:"base64url"})},decode(r){return lI(r,!0)}}:Pu(Dc(6),nc("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),ib(6),Nu("")),lH=Pu(Dc(6),nc("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Nu("")),VA=r=>Pu(oI(58),nc(r),Nu("")),Ux=VA("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),fH=VA("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),dH=VA("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),hH=null,pH=null,Fx=r=>Pu($A(4,e=>r(r(e))),Ux),gH=null,jA=Pu(nc("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Nu("")),dI=[996825010,642813549,513874426,1027748829,705979059];function sb(r){const e=r>>25;let n=(r&33554431)<<5;for(let i=0;i<dI.length;i++)(e>>i&1)===1&&(n^=dI[i]);return n}function hI(r,e,n=1){const i=r.length;let s=1;for(let o=0;o<i;o++){const a=r.charCodeAt(o);if(a<33||a>126)throw new Error(`Invalid prefix (${r})`);s=sb(s)^a>>5}s=sb(s);for(let o=0;o<i;o++)s=sb(s)^r.charCodeAt(o)&31;for(let o of e)s=sb(s)^o;for(let o=0;o<6;o++)s=sb(s);return s^=n,jA.encode(Mu([s%Uv[30]],30,5,!1))}function Wv(r){const e=r==="bech32"?1:734539939,n=Dc(5),i=n.decode,s=n.encode,o=aI(i);function a(A,I,P=90){Hh("bech32.encode prefix",A),np(I)&&(I=Array.from(I)),HA("bech32.encode",I);const D=A.length;if(D===0)throw new TypeError(`Invalid prefix length ${D}`);const U=D+7+I.length;if(P!==!1&&U>P)throw new TypeError(`Length ${U} exceeds limit ${P}`);const V=A.toLowerCase(),J=hI(V,I,e);return`${V}1${jA.encode(I)}${J}`}function u(A,I=90){Hh("bech32.decode input",A);const P=A.length;if(P<8||I!==!1&&P>I)throw new TypeError(`invalid string length: ${P} (${A}). Expected (8..${I})`);const D=A.toLowerCase();if(A!==D&&A!==A.toUpperCase())throw new Error("String must be lowercase or uppercase");const U=D.lastIndexOf("1");if(U===0||U===-1)throw new Error('Letter "1" must be present between prefix and data only');const V=D.slice(0,U),J=D.slice(U+1);if(J.length<6)throw new Error("Data must be at least 6 characters long");const re=jA.decode(J).slice(0,-6),ce=hI(V,re,e);if(!J.endsWith(ce))throw new Error(`Invalid checksum in ${A}: expected "${ce}"`);return{prefix:V,words:re}}const l=aI(u);function g(A){const{prefix:I,words:P}=u(A,!1);return{prefix:I,words:P,bytes:i(P)}}function y(A,I){return a(A,s(I))}return{encode:a,decode:u,encodeFromBytes:y,decodeToBytes:g,decodeUnsafe:l,fromWords:i,fromWordsUnsafe:o,toWords:s}}const Wx=Wv("bech32"),yH=Wv("bech32m"),mH=null,wH=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function"?{encode(r){return FA(r),r.toHex()},decode(r){return Hh("hex",r),Uint8Array.fromHex(r)}}:Pu(Dc(4),nc("0123456789abcdef"),Nu(""),iI(r=>{if(typeof r!="string"||r.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()})),Hv=null,pI="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",AH=(r,e)=>{if(typeof r!="string"||!Hv.hasOwnProperty(r))throw new TypeError(pI);if(!np(e))throw new TypeError("bytesToString() expects Uint8Array");return Hv[r].encode(e)},Hx=null,_H=(r,e)=>{if(!Hv.hasOwnProperty(r))throw new TypeError(pI);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return Hv[r].decode(e)},KA=null;/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const zx=r=>r[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function gI(r){if(typeof r!="string")throw new TypeError("invalid mnemonic type: "+typeof r);return r.normalize("NFKD")}function GA(r){const e=gI(r),n=e.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:n}}function yI(r){Xa(r,16,20,24,28,32)}function $x(r,e=128){if(Pg(e),e%32!==0||e>256)throw new TypeError("Invalid entropy");return Kx(Cv(e/8),r)}const Vx=r=>{const e=8-r.length/4;return new Uint8Array([Ov(r)[0]>>e<<e])};function mI(r){if(!Array.isArray(r)||r.length!==2048||typeof r[0]!="string")throw new Error("Wordlist: expected array of 2048 strings");return r.forEach(e=>{if(typeof e!="string")throw new Error("wordlist: non-string element: "+e)}),Fv.chain(Fv.checksum(1,Vx),Fv.radix2(11,!0),Fv.alphabet(r))}function jx(r,e){const{words:n}=GA(r),i=mI(e).decode(n);return yI(i),i}function Kx(r,e){return yI(r),mI(e).encode(r).join(zx(e)?"\u3000":" ")}function EH(r,e){try{jx(r,e)}catch{return!1}return!0}const bI=r=>gI("mnemonic"+r);function Gx(r,e=""){return Bv(UA,GA(r).nfkd,bI(e),{c:2048,dkLen:64})}function TH(r,e=""){return pbkdf2(sha512,GA(r).nfkd,bI(e),{c:2048,dkLen:64})}const qx=`abandon
|
||
ability
|
||
able
|
||
about
|
||
above
|
||
absent
|
||
absorb
|
||
abstract
|
||
absurd
|
||
abuse
|
||
access
|
||
accident
|
||
account
|
||
accuse
|
||
achieve
|
||
acid
|
||
acoustic
|
||
acquire
|
||
across
|
||
act
|
||
action
|
||
actor
|
||
actress
|
||
actual
|
||
adapt
|
||
add
|
||
addict
|
||
address
|
||
adjust
|
||
admit
|
||
adult
|
||
advance
|
||
advice
|
||
aerobic
|
||
affair
|
||
afford
|
||
afraid
|
||
again
|
||
age
|
||
agent
|
||
agree
|
||
ahead
|
||
aim
|
||
air
|
||
airport
|
||
aisle
|
||
alarm
|
||
album
|
||
alcohol
|
||
alert
|
||
alien
|
||
all
|
||
alley
|
||
allow
|
||
almost
|
||
alone
|
||
alpha
|
||
already
|
||
also
|
||
alter
|
||
always
|
||
amateur
|
||
amazing
|
||
among
|
||
amount
|
||
amused
|
||
analyst
|
||
anchor
|
||
ancient
|
||
anger
|
||
angle
|
||
angry
|
||
animal
|
||
ankle
|
||
announce
|
||
annual
|
||
another
|
||
answer
|
||
antenna
|
||
antique
|
||
anxiety
|
||
any
|
||
apart
|
||
apology
|
||
appear
|
||
apple
|
||
approve
|
||
april
|
||
arch
|
||
arctic
|
||
area
|
||
arena
|
||
argue
|
||
arm
|
||
armed
|
||
armor
|
||
army
|
||
around
|
||
arrange
|
||
arrest
|
||
arrive
|
||
arrow
|
||
art
|
||
artefact
|
||
artist
|
||
artwork
|
||
ask
|
||
aspect
|
||
assault
|
||
asset
|
||
assist
|
||
assume
|
||
asthma
|
||
athlete
|
||
atom
|
||
attack
|
||
attend
|
||
attitude
|
||
attract
|
||
auction
|
||
audit
|
||
august
|
||
aunt
|
||
author
|
||
auto
|
||
autumn
|
||
average
|
||
avocado
|
||
avoid
|
||
awake
|
||
aware
|
||
away
|
||
awesome
|
||
awful
|
||
awkward
|
||
axis
|
||
baby
|
||
bachelor
|
||
bacon
|
||
badge
|
||
bag
|
||
balance
|
||
balcony
|
||
ball
|
||
bamboo
|
||
banana
|
||
banner
|
||
bar
|
||
barely
|
||
bargain
|
||
barrel
|
||
base
|
||
basic
|
||
basket
|
||
battle
|
||
beach
|
||
bean
|
||
beauty
|
||
because
|
||
become
|
||
beef
|
||
before
|
||
begin
|
||
behave
|
||
behind
|
||
believe
|
||
below
|
||
belt
|
||
bench
|
||
benefit
|
||
best
|
||
betray
|
||
better
|
||
between
|
||
beyond
|
||
bicycle
|
||
bid
|
||
bike
|
||
bind
|
||
biology
|
||
bird
|
||
birth
|
||
bitter
|
||
black
|
||
blade
|
||
blame
|
||
blanket
|
||
blast
|
||
bleak
|
||
bless
|
||
blind
|
||
blood
|
||
blossom
|
||
blouse
|
||
blue
|
||
blur
|
||
blush
|
||
board
|
||
boat
|
||
body
|
||
boil
|
||
bomb
|
||
bone
|
||
bonus
|
||
book
|
||
boost
|
||
border
|
||
boring
|
||
borrow
|
||
boss
|
||
bottom
|
||
bounce
|
||
box
|
||
boy
|
||
bracket
|
||
brain
|
||
brand
|
||
brass
|
||
brave
|
||
bread
|
||
breeze
|
||
brick
|
||
bridge
|
||
brief
|
||
bright
|
||
bring
|
||
brisk
|
||
broccoli
|
||
broken
|
||
bronze
|
||
broom
|
||
brother
|
||
brown
|
||
brush
|
||
bubble
|
||
buddy
|
||
budget
|
||
buffalo
|
||
build
|
||
bulb
|
||
bulk
|
||
bullet
|
||
bundle
|
||
bunker
|
||
burden
|
||
burger
|
||
burst
|
||
bus
|
||
business
|
||
busy
|
||
butter
|
||
buyer
|
||
buzz
|
||
cabbage
|
||
cabin
|
||
cable
|
||
cactus
|
||
cage
|
||
cake
|
||
call
|
||
calm
|
||
camera
|
||
camp
|
||
can
|
||
canal
|
||
cancel
|
||
candy
|
||
cannon
|
||
canoe
|
||
canvas
|
||
canyon
|
||
capable
|
||
capital
|
||
captain
|
||
car
|
||
carbon
|
||
card
|
||
cargo
|
||
carpet
|
||
carry
|
||
cart
|
||
case
|
||
cash
|
||
casino
|
||
castle
|
||
casual
|
||
cat
|
||
catalog
|
||
catch
|
||
category
|
||
cattle
|
||
caught
|
||
cause
|
||
caution
|
||
cave
|
||
ceiling
|
||
celery
|
||
cement
|
||
census
|
||
century
|
||
cereal
|
||
certain
|
||
chair
|
||
chalk
|
||
champion
|
||
change
|
||
chaos
|
||
chapter
|
||
charge
|
||
chase
|
||
chat
|
||
cheap
|
||
check
|
||
cheese
|
||
chef
|
||
cherry
|
||
chest
|
||
chicken
|
||
chief
|
||
child
|
||
chimney
|
||
choice
|
||
choose
|
||
chronic
|
||
chuckle
|
||
chunk
|
||
churn
|
||
cigar
|
||
cinnamon
|
||
circle
|
||
citizen
|
||
city
|
||
civil
|
||
claim
|
||
clap
|
||
clarify
|
||
claw
|
||
clay
|
||
clean
|
||
clerk
|
||
clever
|
||
click
|
||
client
|
||
cliff
|
||
climb
|
||
clinic
|
||
clip
|
||
clock
|
||
clog
|
||
close
|
||
cloth
|
||
cloud
|
||
clown
|
||
club
|
||
clump
|
||
cluster
|
||
clutch
|
||
coach
|
||
coast
|
||
coconut
|
||
code
|
||
coffee
|
||
coil
|
||
coin
|
||
collect
|
||
color
|
||
column
|
||
combine
|
||
come
|
||
comfort
|
||
comic
|
||
common
|
||
company
|
||
concert
|
||
conduct
|
||
confirm
|
||
congress
|
||
connect
|
||
consider
|
||
control
|
||
convince
|
||
cook
|
||
cool
|
||
copper
|
||
copy
|
||
coral
|
||
core
|
||
corn
|
||
correct
|
||
cost
|
||
cotton
|
||
couch
|
||
country
|
||
couple
|
||
course
|
||
cousin
|
||
cover
|
||
coyote
|
||
crack
|
||
cradle
|
||
craft
|
||
cram
|
||
crane
|
||
crash
|
||
crater
|
||
crawl
|
||
crazy
|
||
cream
|
||
credit
|
||
creek
|
||
crew
|
||
cricket
|
||
crime
|
||
crisp
|
||
critic
|
||
crop
|
||
cross
|
||
crouch
|
||
crowd
|
||
crucial
|
||
cruel
|
||
cruise
|
||
crumble
|
||
crunch
|
||
crush
|
||
cry
|
||
crystal
|
||
cube
|
||
culture
|
||
cup
|
||
cupboard
|
||
curious
|
||
current
|
||
curtain
|
||
curve
|
||
cushion
|
||
custom
|
||
cute
|
||
cycle
|
||
dad
|
||
damage
|
||
damp
|
||
dance
|
||
danger
|
||
daring
|
||
dash
|
||
daughter
|
||
dawn
|
||
day
|
||
deal
|
||
debate
|
||
debris
|
||
decade
|
||
december
|
||
decide
|
||
decline
|
||
decorate
|
||
decrease
|
||
deer
|
||
defense
|
||
define
|
||
defy
|
||
degree
|
||
delay
|
||
deliver
|
||
demand
|
||
demise
|
||
denial
|
||
dentist
|
||
deny
|
||
depart
|
||
depend
|
||
deposit
|
||
depth
|
||
deputy
|
||
derive
|
||
describe
|
||
desert
|
||
design
|
||
desk
|
||
despair
|
||
destroy
|
||
detail
|
||
detect
|
||
develop
|
||
device
|
||
devote
|
||
diagram
|
||
dial
|
||
diamond
|
||
diary
|
||
dice
|
||
diesel
|
||
diet
|
||
differ
|
||
digital
|
||
dignity
|
||
dilemma
|
||
dinner
|
||
dinosaur
|
||
direct
|
||
dirt
|
||
disagree
|
||
discover
|
||
disease
|
||
dish
|
||
dismiss
|
||
disorder
|
||
display
|
||
distance
|
||
divert
|
||
divide
|
||
divorce
|
||
dizzy
|
||
doctor
|
||
document
|
||
dog
|
||
doll
|
||
dolphin
|
||
domain
|
||
donate
|
||
donkey
|
||
donor
|
||
door
|
||
dose
|
||
double
|
||
dove
|
||
draft
|
||
dragon
|
||
drama
|
||
drastic
|
||
draw
|
||
dream
|
||
dress
|
||
drift
|
||
drill
|
||
drink
|
||
drip
|
||
drive
|
||
drop
|
||
drum
|
||
dry
|
||
duck
|
||
dumb
|
||
dune
|
||
during
|
||
dust
|
||
dutch
|
||
duty
|
||
dwarf
|
||
dynamic
|
||
eager
|
||
eagle
|
||
early
|
||
earn
|
||
earth
|
||
easily
|
||
east
|
||
easy
|
||
echo
|
||
ecology
|
||
economy
|
||
edge
|
||
edit
|
||
educate
|
||
effort
|
||
egg
|
||
eight
|
||
either
|
||
elbow
|
||
elder
|
||
electric
|
||
elegant
|
||
element
|
||
elephant
|
||
elevator
|
||
elite
|
||
else
|
||
embark
|
||
embody
|
||
embrace
|
||
emerge
|
||
emotion
|
||
employ
|
||
empower
|
||
empty
|
||
enable
|
||
enact
|
||
end
|
||
endless
|
||
endorse
|
||
enemy
|
||
energy
|
||
enforce
|
||
engage
|
||
engine
|
||
enhance
|
||
enjoy
|
||
enlist
|
||
enough
|
||
enrich
|
||
enroll
|
||
ensure
|
||
enter
|
||
entire
|
||
entry
|
||
envelope
|
||
episode
|
||
equal
|
||
equip
|
||
era
|
||
erase
|
||
erode
|
||
erosion
|
||
error
|
||
erupt
|
||
escape
|
||
essay
|
||
essence
|
||
estate
|
||
eternal
|
||
ethics
|
||
evidence
|
||
evil
|
||
evoke
|
||
evolve
|
||
exact
|
||
example
|
||
excess
|
||
exchange
|
||
excite
|
||
exclude
|
||
excuse
|
||
execute
|
||
exercise
|
||
exhaust
|
||
exhibit
|
||
exile
|
||
exist
|
||
exit
|
||
exotic
|
||
expand
|
||
expect
|
||
expire
|
||
explain
|
||
expose
|
||
express
|
||
extend
|
||
extra
|
||
eye
|
||
eyebrow
|
||
fabric
|
||
face
|
||
faculty
|
||
fade
|
||
faint
|
||
faith
|
||
fall
|
||
false
|
||
fame
|
||
family
|
||
famous
|
||
fan
|
||
fancy
|
||
fantasy
|
||
farm
|
||
fashion
|
||
fat
|
||
fatal
|
||
father
|
||
fatigue
|
||
fault
|
||
favorite
|
||
feature
|
||
february
|
||
federal
|
||
fee
|
||
feed
|
||
feel
|
||
female
|
||
fence
|
||
festival
|
||
fetch
|
||
fever
|
||
few
|
||
fiber
|
||
fiction
|
||
field
|
||
figure
|
||
file
|
||
film
|
||
filter
|
||
final
|
||
find
|
||
fine
|
||
finger
|
||
finish
|
||
fire
|
||
firm
|
||
first
|
||
fiscal
|
||
fish
|
||
fit
|
||
fitness
|
||
fix
|
||
flag
|
||
flame
|
||
flash
|
||
flat
|
||
flavor
|
||
flee
|
||
flight
|
||
flip
|
||
float
|
||
flock
|
||
floor
|
||
flower
|
||
fluid
|
||
flush
|
||
fly
|
||
foam
|
||
focus
|
||
fog
|
||
foil
|
||
fold
|
||
follow
|
||
food
|
||
foot
|
||
force
|
||
forest
|
||
forget
|
||
fork
|
||
fortune
|
||
forum
|
||
forward
|
||
fossil
|
||
foster
|
||
found
|
||
fox
|
||
fragile
|
||
frame
|
||
frequent
|
||
fresh
|
||
friend
|
||
fringe
|
||
frog
|
||
front
|
||
frost
|
||
frown
|
||
frozen
|
||
fruit
|
||
fuel
|
||
fun
|
||
funny
|
||
furnace
|
||
fury
|
||
future
|
||
gadget
|
||
gain
|
||
galaxy
|
||
gallery
|
||
game
|
||
gap
|
||
garage
|
||
garbage
|
||
garden
|
||
garlic
|
||
garment
|
||
gas
|
||
gasp
|
||
gate
|
||
gather
|
||
gauge
|
||
gaze
|
||
general
|
||
genius
|
||
genre
|
||
gentle
|
||
genuine
|
||
gesture
|
||
ghost
|
||
giant
|
||
gift
|
||
giggle
|
||
ginger
|
||
giraffe
|
||
girl
|
||
give
|
||
glad
|
||
glance
|
||
glare
|
||
glass
|
||
glide
|
||
glimpse
|
||
globe
|
||
gloom
|
||
glory
|
||
glove
|
||
glow
|
||
glue
|
||
goat
|
||
goddess
|
||
gold
|
||
good
|
||
goose
|
||
gorilla
|
||
gospel
|
||
gossip
|
||
govern
|
||
gown
|
||
grab
|
||
grace
|
||
grain
|
||
grant
|
||
grape
|
||
grass
|
||
gravity
|
||
great
|
||
green
|
||
grid
|
||
grief
|
||
grit
|
||
grocery
|
||
group
|
||
grow
|
||
grunt
|
||
guard
|
||
guess
|
||
guide
|
||
guilt
|
||
guitar
|
||
gun
|
||
gym
|
||
habit
|
||
hair
|
||
half
|
||
hammer
|
||
hamster
|
||
hand
|
||
happy
|
||
harbor
|
||
hard
|
||
harsh
|
||
harvest
|
||
hat
|
||
have
|
||
hawk
|
||
hazard
|
||
head
|
||
health
|
||
heart
|
||
heavy
|
||
hedgehog
|
||
height
|
||
hello
|
||
helmet
|
||
help
|
||
hen
|
||
hero
|
||
hidden
|
||
high
|
||
hill
|
||
hint
|
||
hip
|
||
hire
|
||
history
|
||
hobby
|
||
hockey
|
||
hold
|
||
hole
|
||
holiday
|
||
hollow
|
||
home
|
||
honey
|
||
hood
|
||
hope
|
||
horn
|
||
horror
|
||
horse
|
||
hospital
|
||
host
|
||
hotel
|
||
hour
|
||
hover
|
||
hub
|
||
huge
|
||
human
|
||
humble
|
||
humor
|
||
hundred
|
||
hungry
|
||
hunt
|
||
hurdle
|
||
hurry
|
||
hurt
|
||
husband
|
||
hybrid
|
||
ice
|
||
icon
|
||
idea
|
||
identify
|
||
idle
|
||
ignore
|
||
ill
|
||
illegal
|
||
illness
|
||
image
|
||
imitate
|
||
immense
|
||
immune
|
||
impact
|
||
impose
|
||
improve
|
||
impulse
|
||
inch
|
||
include
|
||
income
|
||
increase
|
||
index
|
||
indicate
|
||
indoor
|
||
industry
|
||
infant
|
||
inflict
|
||
inform
|
||
inhale
|
||
inherit
|
||
initial
|
||
inject
|
||
injury
|
||
inmate
|
||
inner
|
||
innocent
|
||
input
|
||
inquiry
|
||
insane
|
||
insect
|
||
inside
|
||
inspire
|
||
install
|
||
intact
|
||
interest
|
||
into
|
||
invest
|
||
invite
|
||
involve
|
||
iron
|
||
island
|
||
isolate
|
||
issue
|
||
item
|
||
ivory
|
||
jacket
|
||
jaguar
|
||
jar
|
||
jazz
|
||
jealous
|
||
jeans
|
||
jelly
|
||
jewel
|
||
job
|
||
join
|
||
joke
|
||
journey
|
||
joy
|
||
judge
|
||
juice
|
||
jump
|
||
jungle
|
||
junior
|
||
junk
|
||
just
|
||
kangaroo
|
||
keen
|
||
keep
|
||
ketchup
|
||
key
|
||
kick
|
||
kid
|
||
kidney
|
||
kind
|
||
kingdom
|
||
kiss
|
||
kit
|
||
kitchen
|
||
kite
|
||
kitten
|
||
kiwi
|
||
knee
|
||
knife
|
||
knock
|
||
know
|
||
lab
|
||
label
|
||
labor
|
||
ladder
|
||
lady
|
||
lake
|
||
lamp
|
||
language
|
||
laptop
|
||
large
|
||
later
|
||
latin
|
||
laugh
|
||
laundry
|
||
lava
|
||
law
|
||
lawn
|
||
lawsuit
|
||
layer
|
||
lazy
|
||
leader
|
||
leaf
|
||
learn
|
||
leave
|
||
lecture
|
||
left
|
||
leg
|
||
legal
|
||
legend
|
||
leisure
|
||
lemon
|
||
lend
|
||
length
|
||
lens
|
||
leopard
|
||
lesson
|
||
letter
|
||
level
|
||
liar
|
||
liberty
|
||
library
|
||
license
|
||
life
|
||
lift
|
||
light
|
||
like
|
||
limb
|
||
limit
|
||
link
|
||
lion
|
||
liquid
|
||
list
|
||
little
|
||
live
|
||
lizard
|
||
load
|
||
loan
|
||
lobster
|
||
local
|
||
lock
|
||
logic
|
||
lonely
|
||
long
|
||
loop
|
||
lottery
|
||
loud
|
||
lounge
|
||
love
|
||
loyal
|
||
lucky
|
||
luggage
|
||
lumber
|
||
lunar
|
||
lunch
|
||
luxury
|
||
lyrics
|
||
machine
|
||
mad
|
||
magic
|
||
magnet
|
||
maid
|
||
mail
|
||
main
|
||
major
|
||
make
|
||
mammal
|
||
man
|
||
manage
|
||
mandate
|
||
mango
|
||
mansion
|
||
manual
|
||
maple
|
||
marble
|
||
march
|
||
margin
|
||
marine
|
||
market
|
||
marriage
|
||
mask
|
||
mass
|
||
master
|
||
match
|
||
material
|
||
math
|
||
matrix
|
||
matter
|
||
maximum
|
||
maze
|
||
meadow
|
||
mean
|
||
measure
|
||
meat
|
||
mechanic
|
||
medal
|
||
media
|
||
melody
|
||
melt
|
||
member
|
||
memory
|
||
mention
|
||
menu
|
||
mercy
|
||
merge
|
||
merit
|
||
merry
|
||
mesh
|
||
message
|
||
metal
|
||
method
|
||
middle
|
||
midnight
|
||
milk
|
||
million
|
||
mimic
|
||
mind
|
||
minimum
|
||
minor
|
||
minute
|
||
miracle
|
||
mirror
|
||
misery
|
||
miss
|
||
mistake
|
||
mix
|
||
mixed
|
||
mixture
|
||
mobile
|
||
model
|
||
modify
|
||
mom
|
||
moment
|
||
monitor
|
||
monkey
|
||
monster
|
||
month
|
||
moon
|
||
moral
|
||
more
|
||
morning
|
||
mosquito
|
||
mother
|
||
motion
|
||
motor
|
||
mountain
|
||
mouse
|
||
move
|
||
movie
|
||
much
|
||
muffin
|
||
mule
|
||
multiply
|
||
muscle
|
||
museum
|
||
mushroom
|
||
music
|
||
must
|
||
mutual
|
||
myself
|
||
mystery
|
||
myth
|
||
naive
|
||
name
|
||
napkin
|
||
narrow
|
||
nasty
|
||
nation
|
||
nature
|
||
near
|
||
neck
|
||
need
|
||
negative
|
||
neglect
|
||
neither
|
||
nephew
|
||
nerve
|
||
nest
|
||
net
|
||
network
|
||
neutral
|
||
never
|
||
news
|
||
next
|
||
nice
|
||
night
|
||
noble
|
||
noise
|
||
nominee
|
||
noodle
|
||
normal
|
||
north
|
||
nose
|
||
notable
|
||
note
|
||
nothing
|
||
notice
|
||
novel
|
||
now
|
||
nuclear
|
||
number
|
||
nurse
|
||
nut
|
||
oak
|
||
obey
|
||
object
|
||
oblige
|
||
obscure
|
||
observe
|
||
obtain
|
||
obvious
|
||
occur
|
||
ocean
|
||
october
|
||
odor
|
||
off
|
||
offer
|
||
office
|
||
often
|
||
oil
|
||
okay
|
||
old
|
||
olive
|
||
olympic
|
||
omit
|
||
once
|
||
one
|
||
onion
|
||
online
|
||
only
|
||
open
|
||
opera
|
||
opinion
|
||
oppose
|
||
option
|
||
orange
|
||
orbit
|
||
orchard
|
||
order
|
||
ordinary
|
||
organ
|
||
orient
|
||
original
|
||
orphan
|
||
ostrich
|
||
other
|
||
outdoor
|
||
outer
|
||
output
|
||
outside
|
||
oval
|
||
oven
|
||
over
|
||
own
|
||
owner
|
||
oxygen
|
||
oyster
|
||
ozone
|
||
pact
|
||
paddle
|
||
page
|
||
pair
|
||
palace
|
||
palm
|
||
panda
|
||
panel
|
||
panic
|
||
panther
|
||
paper
|
||
parade
|
||
parent
|
||
park
|
||
parrot
|
||
party
|
||
pass
|
||
patch
|
||
path
|
||
patient
|
||
patrol
|
||
pattern
|
||
pause
|
||
pave
|
||
payment
|
||
peace
|
||
peanut
|
||
pear
|
||
peasant
|
||
pelican
|
||
pen
|
||
penalty
|
||
pencil
|
||
people
|
||
pepper
|
||
perfect
|
||
permit
|
||
person
|
||
pet
|
||
phone
|
||
photo
|
||
phrase
|
||
physical
|
||
piano
|
||
picnic
|
||
picture
|
||
piece
|
||
pig
|
||
pigeon
|
||
pill
|
||
pilot
|
||
pink
|
||
pioneer
|
||
pipe
|
||
pistol
|
||
pitch
|
||
pizza
|
||
place
|
||
planet
|
||
plastic
|
||
plate
|
||
play
|
||
please
|
||
pledge
|
||
pluck
|
||
plug
|
||
plunge
|
||
poem
|
||
poet
|
||
point
|
||
polar
|
||
pole
|
||
police
|
||
pond
|
||
pony
|
||
pool
|
||
popular
|
||
portion
|
||
position
|
||
possible
|
||
post
|
||
potato
|
||
pottery
|
||
poverty
|
||
powder
|
||
power
|
||
practice
|
||
praise
|
||
predict
|
||
prefer
|
||
prepare
|
||
present
|
||
pretty
|
||
prevent
|
||
price
|
||
pride
|
||
primary
|
||
print
|
||
priority
|
||
prison
|
||
private
|
||
prize
|
||
problem
|
||
process
|
||
produce
|
||
profit
|
||
program
|
||
project
|
||
promote
|
||
proof
|
||
property
|
||
prosper
|
||
protect
|
||
proud
|
||
provide
|
||
public
|
||
pudding
|
||
pull
|
||
pulp
|
||
pulse
|
||
pumpkin
|
||
punch
|
||
pupil
|
||
puppy
|
||
purchase
|
||
purity
|
||
purpose
|
||
purse
|
||
push
|
||
put
|
||
puzzle
|
||
pyramid
|
||
quality
|
||
quantum
|
||
quarter
|
||
question
|
||
quick
|
||
quit
|
||
quiz
|
||
quote
|
||
rabbit
|
||
raccoon
|
||
race
|
||
rack
|
||
radar
|
||
radio
|
||
rail
|
||
rain
|
||
raise
|
||
rally
|
||
ramp
|
||
ranch
|
||
random
|
||
range
|
||
rapid
|
||
rare
|
||
rate
|
||
rather
|
||
raven
|
||
raw
|
||
razor
|
||
ready
|
||
real
|
||
reason
|
||
rebel
|
||
rebuild
|
||
recall
|
||
receive
|
||
recipe
|
||
record
|
||
recycle
|
||
reduce
|
||
reflect
|
||
reform
|
||
refuse
|
||
region
|
||
regret
|
||
regular
|
||
reject
|
||
relax
|
||
release
|
||
relief
|
||
rely
|
||
remain
|
||
remember
|
||
remind
|
||
remove
|
||
render
|
||
renew
|
||
rent
|
||
reopen
|
||
repair
|
||
repeat
|
||
replace
|
||
report
|
||
require
|
||
rescue
|
||
resemble
|
||
resist
|
||
resource
|
||
response
|
||
result
|
||
retire
|
||
retreat
|
||
return
|
||
reunion
|
||
reveal
|
||
review
|
||
reward
|
||
rhythm
|
||
rib
|
||
ribbon
|
||
rice
|
||
rich
|
||
ride
|
||
ridge
|
||
rifle
|
||
right
|
||
rigid
|
||
ring
|
||
riot
|
||
ripple
|
||
risk
|
||
ritual
|
||
rival
|
||
river
|
||
road
|
||
roast
|
||
robot
|
||
robust
|
||
rocket
|
||
romance
|
||
roof
|
||
rookie
|
||
room
|
||
rose
|
||
rotate
|
||
rough
|
||
round
|
||
route
|
||
royal
|
||
rubber
|
||
rude
|
||
rug
|
||
rule
|
||
run
|
||
runway
|
||
rural
|
||
sad
|
||
saddle
|
||
sadness
|
||
safe
|
||
sail
|
||
salad
|
||
salmon
|
||
salon
|
||
salt
|
||
salute
|
||
same
|
||
sample
|
||
sand
|
||
satisfy
|
||
satoshi
|
||
sauce
|
||
sausage
|
||
save
|
||
say
|
||
scale
|
||
scan
|
||
scare
|
||
scatter
|
||
scene
|
||
scheme
|
||
school
|
||
science
|
||
scissors
|
||
scorpion
|
||
scout
|
||
scrap
|
||
screen
|
||
script
|
||
scrub
|
||
sea
|
||
search
|
||
season
|
||
seat
|
||
second
|
||
secret
|
||
section
|
||
security
|
||
seed
|
||
seek
|
||
segment
|
||
select
|
||
sell
|
||
seminar
|
||
senior
|
||
sense
|
||
sentence
|
||
series
|
||
service
|
||
session
|
||
settle
|
||
setup
|
||
seven
|
||
shadow
|
||
shaft
|
||
shallow
|
||
share
|
||
shed
|
||
shell
|
||
sheriff
|
||
shield
|
||
shift
|
||
shine
|
||
ship
|
||
shiver
|
||
shock
|
||
shoe
|
||
shoot
|
||
shop
|
||
short
|
||
shoulder
|
||
shove
|
||
shrimp
|
||
shrug
|
||
shuffle
|
||
shy
|
||
sibling
|
||
sick
|
||
side
|
||
siege
|
||
sight
|
||
sign
|
||
silent
|
||
silk
|
||
silly
|
||
silver
|
||
similar
|
||
simple
|
||
since
|
||
sing
|
||
siren
|
||
sister
|
||
situate
|
||
six
|
||
size
|
||
skate
|
||
sketch
|
||
ski
|
||
skill
|
||
skin
|
||
skirt
|
||
skull
|
||
slab
|
||
slam
|
||
sleep
|
||
slender
|
||
slice
|
||
slide
|
||
slight
|
||
slim
|
||
slogan
|
||
slot
|
||
slow
|
||
slush
|
||
small
|
||
smart
|
||
smile
|
||
smoke
|
||
smooth
|
||
snack
|
||
snake
|
||
snap
|
||
sniff
|
||
snow
|
||
soap
|
||
soccer
|
||
social
|
||
sock
|
||
soda
|
||
soft
|
||
solar
|
||
soldier
|
||
solid
|
||
solution
|
||
solve
|
||
someone
|
||
song
|
||
soon
|
||
sorry
|
||
sort
|
||
soul
|
||
sound
|
||
soup
|
||
source
|
||
south
|
||
space
|
||
spare
|
||
spatial
|
||
spawn
|
||
speak
|
||
special
|
||
speed
|
||
spell
|
||
spend
|
||
sphere
|
||
spice
|
||
spider
|
||
spike
|
||
spin
|
||
spirit
|
||
split
|
||
spoil
|
||
sponsor
|
||
spoon
|
||
sport
|
||
spot
|
||
spray
|
||
spread
|
||
spring
|
||
spy
|
||
square
|
||
squeeze
|
||
squirrel
|
||
stable
|
||
stadium
|
||
staff
|
||
stage
|
||
stairs
|
||
stamp
|
||
stand
|
||
start
|
||
state
|
||
stay
|
||
steak
|
||
steel
|
||
stem
|
||
step
|
||
stereo
|
||
stick
|
||
still
|
||
sting
|
||
stock
|
||
stomach
|
||
stone
|
||
stool
|
||
story
|
||
stove
|
||
strategy
|
||
street
|
||
strike
|
||
strong
|
||
struggle
|
||
student
|
||
stuff
|
||
stumble
|
||
style
|
||
subject
|
||
submit
|
||
subway
|
||
success
|
||
such
|
||
sudden
|
||
suffer
|
||
sugar
|
||
suggest
|
||
suit
|
||
summer
|
||
sun
|
||
sunny
|
||
sunset
|
||
super
|
||
supply
|
||
supreme
|
||
sure
|
||
surface
|
||
surge
|
||
surprise
|
||
surround
|
||
survey
|
||
suspect
|
||
sustain
|
||
swallow
|
||
swamp
|
||
swap
|
||
swarm
|
||
swear
|
||
sweet
|
||
swift
|
||
swim
|
||
swing
|
||
switch
|
||
sword
|
||
symbol
|
||
symptom
|
||
syrup
|
||
system
|
||
table
|
||
tackle
|
||
tag
|
||
tail
|
||
talent
|
||
talk
|
||
tank
|
||
tape
|
||
target
|
||
task
|
||
taste
|
||
tattoo
|
||
taxi
|
||
teach
|
||
team
|
||
tell
|
||
ten
|
||
tenant
|
||
tennis
|
||
tent
|
||
term
|
||
test
|
||
text
|
||
thank
|
||
that
|
||
theme
|
||
then
|
||
theory
|
||
there
|
||
they
|
||
thing
|
||
this
|
||
thought
|
||
three
|
||
thrive
|
||
throw
|
||
thumb
|
||
thunder
|
||
ticket
|
||
tide
|
||
tiger
|
||
tilt
|
||
timber
|
||
time
|
||
tiny
|
||
tip
|
||
tired
|
||
tissue
|
||
title
|
||
toast
|
||
tobacco
|
||
today
|
||
toddler
|
||
toe
|
||
together
|
||
toilet
|
||
token
|
||
tomato
|
||
tomorrow
|
||
tone
|
||
tongue
|
||
tonight
|
||
tool
|
||
tooth
|
||
top
|
||
topic
|
||
topple
|
||
torch
|
||
tornado
|
||
tortoise
|
||
toss
|
||
total
|
||
tourist
|
||
toward
|
||
tower
|
||
town
|
||
toy
|
||
track
|
||
trade
|
||
traffic
|
||
tragic
|
||
train
|
||
transfer
|
||
trap
|
||
trash
|
||
travel
|
||
tray
|
||
treat
|
||
tree
|
||
trend
|
||
trial
|
||
tribe
|
||
trick
|
||
trigger
|
||
trim
|
||
trip
|
||
trophy
|
||
trouble
|
||
truck
|
||
true
|
||
truly
|
||
trumpet
|
||
trust
|
||
truth
|
||
try
|
||
tube
|
||
tuition
|
||
tumble
|
||
tuna
|
||
tunnel
|
||
turkey
|
||
turn
|
||
turtle
|
||
twelve
|
||
twenty
|
||
twice
|
||
twin
|
||
twist
|
||
two
|
||
type
|
||
typical
|
||
ugly
|
||
umbrella
|
||
unable
|
||
unaware
|
||
uncle
|
||
uncover
|
||
under
|
||
undo
|
||
unfair
|
||
unfold
|
||
unhappy
|
||
uniform
|
||
unique
|
||
unit
|
||
universe
|
||
unknown
|
||
unlock
|
||
until
|
||
unusual
|
||
unveil
|
||
update
|
||
upgrade
|
||
uphold
|
||
upon
|
||
upper
|
||
upset
|
||
urban
|
||
urge
|
||
usage
|
||
use
|
||
used
|
||
useful
|
||
useless
|
||
usual
|
||
utility
|
||
vacant
|
||
vacuum
|
||
vague
|
||
valid
|
||
valley
|
||
valve
|
||
van
|
||
vanish
|
||
vapor
|
||
various
|
||
vast
|
||
vault
|
||
vehicle
|
||
velvet
|
||
vendor
|
||
venture
|
||
venue
|
||
verb
|
||
verify
|
||
version
|
||
very
|
||
vessel
|
||
veteran
|
||
viable
|
||
vibrant
|
||
vicious
|
||
victory
|
||
video
|
||
view
|
||
village
|
||
vintage
|
||
violin
|
||
virtual
|
||
virus
|
||
visa
|
||
visit
|
||
visual
|
||
vital
|
||
vivid
|
||
vocal
|
||
voice
|
||
void
|
||
volcano
|
||
volume
|
||
vote
|
||
voyage
|
||
wage
|
||
wagon
|
||
wait
|
||
walk
|
||
wall
|
||
walnut
|
||
want
|
||
warfare
|
||
warm
|
||
warrior
|
||
wash
|
||
wasp
|
||
waste
|
||
water
|
||
wave
|
||
way
|
||
wealth
|
||
weapon
|
||
wear
|
||
weasel
|
||
weather
|
||
web
|
||
wedding
|
||
weekend
|
||
weird
|
||
welcome
|
||
west
|
||
wet
|
||
whale
|
||
what
|
||
wheat
|
||
wheel
|
||
when
|
||
where
|
||
whip
|
||
whisper
|
||
wide
|
||
width
|
||
wife
|
||
wild
|
||
will
|
||
win
|
||
window
|
||
wine
|
||
wing
|
||
wink
|
||
winner
|
||
winter
|
||
wire
|
||
wisdom
|
||
wise
|
||
wish
|
||
witness
|
||
wolf
|
||
woman
|
||
wonder
|
||
wood
|
||
wool
|
||
word
|
||
work
|
||
world
|
||
worry
|
||
worth
|
||
wrap
|
||
wreck
|
||
wrestle
|
||
wrist
|
||
write
|
||
wrong
|
||
yard
|
||
year
|
||
yellow
|
||
you
|
||
young
|
||
youth
|
||
zebra
|
||
zero
|
||
zone
|
||
zoo`.split(`
|
||
`);var di;(function(r){r.hd="hd",r.privateKey="privateKey",r.mpc="mpc"})(di||(di={}));var SH=5,cf;(function(r){r.Cosmos="Cosmos",r.Evm="EVM",r.Move="MOVE",r.Near="NEAR",r.Polkadot="Polkadot",r.Sol="SOL",r.TRON="TRON",r.Ton="TON",r.Utxo="UTXO"})(cf||(cf={}));var nn;(function(r){r[r.evm=cf.Evm]="evm",r[r.solana=cf.Sol]="solana",r[r.utxo=cf.Utxo]="utxo",r[r.tron=cf.TRON]="tron",r[r.sui=cf.Move]="sui",r[r.ton=cf.Ton]="ton"})(nn||(nn={}));var Zx=[nn.evm,nn.solana,nn.tron,nn.sui,nn.ton],$s;(function(r){r.EVM_EOA="EVM_EOA",r.SOL_2="SOL_2",r.BTC_NATIVE_SEGWIT="BTC_NATIVE_SEGWIT",r.BTC_TAPROOT="BTC_TAPROOT",r.TRON="TRON",r.SUI="SUI",r.TON="TON"})($s||($s={}));var Ho;(function(r){r.active="active",r.autoLogout="autoLogout",r.manualLogout="manualLogout",r.mpLogout="mpLogout",r.absoluteExpireLogout="absoluteExpireLogout",r.logoutConfirmed="logoutConfirmed",r.deleted="deleted",r.passiveDeleted="passiveDeleted",r.deleteConfirmed="deleteConfirmed"})(Ho||(Ho={}));var sp;(function(r){r.active="active",r.deleted="deleted",r.logout="logout"})(sp||(sp={}));var zv=tn(90620),ic=tn.n(zv),Mg=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Yx(r);return e.encodeURIComponent?encodeURIComponent(n):n},Lg=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.decodeURIComponent&&(r=decodeURIComponent(r)),Xx(r)},vI=ic().lib.WordArray.random(16);function Yx(r){var e=ic().lib.WordArray.random(16),n=ic().AES.encrypt(r,vI,{iv:e,mode:ic().mode.CBC,padding:ic().pad.Pkcs7}),i=e.words.concat(n.ciphertext.words),s=e.sigBytes+n.ciphertext.sigBytes,o=ic().lib.WordArray.create(i,s);return ic().enc.Base64.stringify(o)}function Xx(r){var e=ic().enc.Base64.parse(r),n=ic().lib.WordArray.create(e.words.slice(0,4),16),i=ic().lib.WordArray.create(e.words.slice(4),e.sigBytes-16),s=ic().AES.decrypt({ciphertext:i},vI,{iv:n,mode:ic().mode.CBC,padding:ic().pad.Pkcs7});return s.toString(ic().enc.Utf8)}function ob(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}function Jx(r){if(typeof r!="boolean")throw new Error(`boolean expected, not ${r}`)}function Qx(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function Dg(r,...e){if(!Qx(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}function wI(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ob(r.outputLen),ob(r.blockLen)}function Df(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function qA(r,e){Dg(r);const n=e.outputLen;if(r.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const $v={number:ob,bool:Jx,bytes:Dg,hash:wI,exists:Df,output:qA},ab=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function t5(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}const r5=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength),AI=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Vv=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Uf=(r,e)=>r<<32-e|r>>>e,IH=(r,e)=>r<<e|r>>>32-e>>>0,_I=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,jv=r=>r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255,ZA=null;function EI(r){for(let e=0;e<r.length;e++)r[e]=jv(r[e])}const n5=null;function TI(r){abytes(r);let e="";for(let n=0;n<r.length;n++)e+=n5[r[n]];return e}const Ff=null;function SI(r){if(r>=Ff._0&&r<=Ff._9)return r-Ff._0;if(r>=Ff._A&&r<=Ff._F)return r-(Ff._A-10);if(r>=Ff._a&&r<=Ff._f)return r-(Ff._a-10)}function kH(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=SI(r.charCodeAt(o)),u=SI(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}const i5=async()=>{};async function RH(r,e,n){let i=Date.now();for(let s=0;s<r;s++){n(s);const o=Date.now()-i;o>=0&&o<e||(await i5(),i+=o)}}function s5(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Ug(r){return typeof r=="string"&&(r=s5(r)),Dg(r),r}function ub(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];Dg(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}class YA{clone(){return this._cloneInto()}}const o5=null;function CH(r,e){if(e!==void 0&&o5.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function XA(r){const e=i=>r().update(Ug(i)).digest(),n=r();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>r(),e}function xH(r){const e=(i,s)=>r(s).update(Ug(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function Wf(r){const e=(i,s)=>r(s).update(Ug(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function JA(r=32){if(ab&&typeof ab.getRandomValues=="function")return ab.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function a5(r,e,n,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,n,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(n>>s&o),u=Number(n&o),l=i?4:0,g=i?0:4;r.setUint32(e+l,a,i),r.setUint32(e+g,u,i)}const op=(r,e,n)=>r&e^~r&n,Gi=(r,e,n)=>r&e^r&n^e&n;class II extends YA{constructor(e,n,i,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Vv(this.buffer)}update(e){Df(this);const{view:n,buffer:i,blockLen:s}=this;e=Ug(e);const o=e.length;for(let a=0;a<o;){const u=Math.min(s-this.pos,o-a);if(u===s){const l=Vv(e);for(;s<=o-a;a+=s)this.process(l,a);continue}i.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Df(this),qA(e,this),this.finished=!0;const{buffer:n,view:i,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(i,0),a=0);for(let A=a;A<s;A++)n[A]=0;a5(i,s-8,BigInt(this.length*8),o),this.process(i,0);const u=Vv(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const g=l/4,y=this.get();if(g>y.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<g;A++)u.setUint32(4*A,y[A],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:i,length:s,finished:o,destroyed:a,pos:u}=this;return e.length=s,e.pos=u,e.finished=o,e.destroyed=a,s%n&&e.buffer.set(i),e}}const sc=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),io=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),zh=new Uint32Array(64);class Fd extends II{constructor(){super(64,32,8,!1),this.A=io[0]|0,this.B=io[1]|0,this.C=io[2]|0,this.D=io[3]|0,this.E=io[4]|0,this.F=io[5]|0,this.G=io[6]|0,this.H=io[7]|0}get(){const{A:e,B:n,C:i,D:s,E:o,F:a,G:u,H:l}=this;return[e,n,i,s,o,a,u,l]}set(e,n,i,s,o,a,u,l){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,n){for(let A=0;A<16;A++,n+=4)zh[A]=e.getUint32(n,!1);for(let A=16;A<64;A++){const I=zh[A-15],P=zh[A-2],D=Uf(I,7)^Uf(I,18)^I>>>3,U=Uf(P,17)^Uf(P,19)^P>>>10;zh[A]=U+zh[A-7]+D+zh[A-16]|0}let{A:i,B:s,C:o,D:a,E:u,F:l,G:g,H:y}=this;for(let A=0;A<64;A++){const I=Uf(u,6)^Uf(u,11)^Uf(u,25),P=y+I+op(u,l,g)+sc[A]+zh[A]|0,U=(Uf(i,2)^Uf(i,13)^Uf(i,22))+Gi(i,s,o)|0;y=g,g=l,l=u,u=a+P|0,a=o,o=s,s=i,i=P+U|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,g=g+this.G|0,y=y+this.H|0,this.set(i,s,o,a,u,l,g,y)}roundClean(){zh.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class BH extends Fd{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const QA=XA(()=>new Fd),OH=null;class kI extends YA{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,wI(e);const i=Ug(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?e.create().update(i).digest():i);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),o.fill(0)}update(e){return Df(this),this.iHash.update(e),this}digestInto(e){Df(this),Dg(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:i,finished:s,destroyed:o,blockLen:a,outputLen:u}=this;return e=e,e.finished=s,e.destroyed=o,e.blockLen=a,e.outputLen=u,e.oHash=n._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const e_=(r,e,n)=>new kI(r,e).update(n).digest();e_.create=(r,e)=>new kI(r,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Kv=null,Gv=BigInt(1),Wd=BigInt(2);function $h(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function Vh(r){if(!$h(r))throw new Error("Uint8Array expected")}const zo=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function go(r){Vh(r);let e="";for(let n=0;n<r.length;n++)e+=zo[r[n]];return e}function RI(r){const e=r.toString(16);return e.length&1?`0${e}`:e}function CI(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}const Hd={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function xI(r){if(r>=Hd._0&&r<=Hd._9)return r-Hd._0;if(r>=Hd._A&&r<=Hd._F)return r-(Hd._A-10);if(r>=Hd._a&&r<=Hd._f)return r-(Hd._a-10)}function Fg(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=xI(r.charCodeAt(o)),u=xI(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}function ap(r){return CI(go(r))}function t_(r){return Vh(r),CI(go(Uint8Array.from(r).reverse()))}function up(r,e){return Fg(r.toString(16).padStart(e*2,"0"))}function cp(r,e){return up(r,e).reverse()}function BI(r){return Fg(RI(r))}function lf(r,e,n){let i;if(typeof e=="string")try{i=Fg(e)}catch(o){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${o}`)}else if($h(e))i=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);const s=i.length;if(typeof n=="number"&&s!==n)throw new Error(`${r} expected ${n} bytes, got ${s}`);return i}function Wg(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];Vh(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}function r_(r,e){if(r.length!==e.length)return!1;let n=0;for(let i=0;i<r.length;i++)n|=r[i]^e[i];return n===0}function yl(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function cb(r){let e;for(e=0;r>Kv;r>>=Gv,e+=1);return e}function PH(r,e){return r>>BigInt(e)&Gv}function NH(r,e,n){return r|(n?Gv:Kv)<<BigInt(e)}const n_=r=>(Wd<<BigInt(r-1))-Gv,i_=r=>new Uint8Array(r),OI=r=>Uint8Array.from(r);function s_(r,e,n){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let i=i_(r),s=i_(r),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},u=(...A)=>n(s,i,...A),l=(A=i_())=>{s=u(OI([0]),A),i=u(),A.length!==0&&(s=u(OI([1]),A),i=u())},g=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let A=0;const I=[];for(;A<e;){i=u();const P=i.slice();I.push(P),A+=i.length}return Wg(...I)};return(A,I)=>{a(),l(A);let P;for(;!(P=I(g()));)l();return a(),P}}const zd={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||$h(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function ji(r,e,n={}){const i=(s,o,a)=>{const u=zd[o];if(typeof u!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=r[s];if(!(a&&l===void 0)&&!u(l,r))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(e))i(s,o,!1);for(const[s,o]of Object.entries(n))i(s,o,!0);return r}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const va=BigInt(0),os=BigInt(1),$d=BigInt(2),u5=BigInt(3),Us=BigInt(4),PI=BigInt(5),o_=BigInt(8),qv=BigInt(9),c5=BigInt(16);function fu(r,e){const n=r%e;return n>=va?n:e+n}function l5(r,e,n){if(n<=va||e<va)throw new Error("Expected power/modulo > 0");if(n===os)return va;let i=os;for(;e>va;)e&os&&(i=i*r%n),r=r*r%n,e>>=os;return i}function ml(r,e,n){let i=r;for(;e-- >va;)i*=i,i%=n;return i}function Zv(r,e){if(r===va||e<=va)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let n=fu(r,e),i=e,s=va,o=os,a=os,u=va;for(;n!==va;){const g=i/n,y=i%n,A=s-a*g,I=o-u*g;i=n,n=y,s=a,o=u,a=A,u=I}if(i!==os)throw new Error("invert: does not exist");return fu(s,e)}function f5(r){const e=(r-os)/$d;let n,i,s;for(n=r-os,i=0;n%$d===va;n/=$d,i++);for(s=$d;s<r&&l5(s,e,r)!==r-os;s++);if(i===1){const a=(r+os)/Us;return function(l,g){const y=l.pow(g,a);if(!l.eql(l.sqr(y),g))throw new Error("Cannot find square root");return y}}const o=(n+os)/$d;return function(u,l){if(u.pow(l,e)===u.neg(u.ONE))throw new Error("Cannot find square root");let g=i,y=u.pow(u.mul(u.ONE,s),n),A=u.pow(l,o),I=u.pow(l,n);for(;!u.eql(I,u.ONE);){if(u.eql(I,u.ZERO))return u.ZERO;let P=1;for(let U=u.sqr(I);P<g&&!u.eql(U,u.ONE);P++)U=u.sqr(U);const D=u.pow(y,os<<BigInt(g-P-1));y=u.sqr(D),A=u.mul(A,D),I=u.mul(I,y),g=P}return A}}function d5(r){if(r%Us===u5){const e=(r+os)/Us;return function(i,s){const o=i.pow(s,e);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(r%o_===PI){const e=(r-PI)/o_;return function(i,s){const o=i.mul(s,$d),a=i.pow(o,e),u=i.mul(s,a),l=i.mul(i.mul(u,$d),a),g=i.mul(u,i.sub(l,i.ONE));if(!i.eql(i.sqr(g),s))throw new Error("Cannot find square root");return g}}return r%c5,f5(r)}const MH=(r,e)=>(fu(r,e)&os)===os,h5=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function p5(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=h5.reduce((i,s)=>(i[s]="function",i),e);return ji(r,n)}function g5(r,e,n){if(n<va)throw new Error("Expected power > 0");if(n===va)return r.ONE;if(n===os)return e;let i=r.ONE,s=e;for(;n>va;)n&os&&(i=r.mul(i,s)),s=r.sqr(s),n>>=os;return i}function y5(r,e){const n=new Array(e.length),i=e.reduce((o,a,u)=>r.is0(a)?o:(n[u]=o,r.mul(o,a)),r.ONE),s=r.inv(i);return e.reduceRight((o,a,u)=>r.is0(a)?o:(n[u]=r.mul(o,n[u]),r.mul(o,a)),s),n}function LH(r,e,n){return r.mul(e,typeof n=="bigint"?Zv(n,r.ORDER):r.inv(n))}function NI(r){const e=(r.ORDER-os)/$d;return n=>{const i=r.pow(n,e);return r.eql(i,r.ZERO)||r.eql(i,r.ONE)}}function a_(r,e){const n=e!==void 0?e:r.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function u_(r,e,n=!1,i={}){if(r<=va)throw new Error(`Expected Field ORDER > 0, got ${r}`);const{nBitLength:s,nByteLength:o}=a_(r,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=d5(r),u=Object.freeze({ORDER:r,BITS:s,BYTES:o,MASK:n_(s),ZERO:va,ONE:os,create:l=>fu(l,r),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return va<=l&&l<r},is0:l=>l===va,isOdd:l=>(l&os)===os,neg:l=>fu(-l,r),eql:(l,g)=>l===g,sqr:l=>fu(l*l,r),add:(l,g)=>fu(l+g,r),sub:(l,g)=>fu(l-g,r),mul:(l,g)=>fu(l*g,r),pow:(l,g)=>g5(u,l,g),div:(l,g)=>fu(l*Zv(g,r),r),sqrN:l=>l*l,addN:(l,g)=>l+g,subN:(l,g)=>l-g,mulN:(l,g)=>l*g,inv:l=>Zv(l,r),sqrt:i.sqrt||(l=>a(u,l)),invertBatch:l=>y5(u,l),cmov:(l,g,y)=>y?g:l,toBytes:l=>n?cp(l,o):up(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?t_(l):ap(l)}});return Object.freeze(u)}function DH(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?n:r.neg(n)}function UH(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?r.neg(n):n}function FH(r,e,n=!1){r=ensureBytes("privateHash",r);const i=r.length,s=a_(e).nByteLength+8;if(s<24||i<s||i>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${i}`);const o=n?bytesToNumberLE(r):bytesToNumberBE(r);return fu(o,e-os)+os}function Ra(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function Lu(r){const e=Ra(r);return e+Math.ceil(e/2)}function m5(r,e,n=!1){const i=r.length,s=Ra(e),o=Lu(e);if(i<16||i<o||i>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const a=n?ap(r):t_(r),u=fu(a,e-os)+os;return n?cp(u,s):up(u,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const b5=BigInt(0),c_=BigInt(1);function MI(r,e){const n=(s,o)=>{const a=o.negate();return s?a:o},i=s=>{const o=Math.ceil(e/s)+1,a=2**(s-1);return{windows:o,windowSize:a}};return{constTimeNegate:n,unsafeLadder(s,o){let a=r.ZERO,u=s;for(;o>b5;)o&c_&&(a=a.add(u)),u=u.double(),o>>=c_;return a},precomputeWindow(s,o){const{windows:a,windowSize:u}=i(o),l=[];let g=s,y=g;for(let A=0;A<a;A++){y=g,l.push(y);for(let I=1;I<u;I++)y=y.add(g),l.push(y);g=y.double()}return l},wNAF(s,o,a){const{windows:u,windowSize:l}=i(s);let g=r.ZERO,y=r.BASE;const A=BigInt(2**s-1),I=2**s,P=BigInt(s);for(let D=0;D<u;D++){const U=D*l;let V=Number(a&A);a>>=P,V>l&&(V-=I,a+=c_);const J=U,re=U+Math.abs(V)-1,ce=D%2!==0,Re=V<0;V===0?y=y.add(n(ce,o[J])):g=g.add(n(Re,o[re]))}return{p:g,f:y}},wNAFCached(s,o,a,u){const l=s._WINDOW_SIZE||1;let g=o.get(s);return g||(g=this.precomputeWindow(s,l),l!==1&&o.set(s,u(g))),this.wNAF(l,g,a)}}}function LI(r){return p5(r.Fp),ji(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...a_(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function v5(r){const e=LI(r);ji(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:i,a:s}=e;if(n){if(!i.eql(s,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{Ph:w5,aT:DI}=ie,lp={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){const{Err:e}=lp;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");const n=r[1],i=r.subarray(2,n+2);if(!n||i.length!==n)throw new e("Invalid signature integer: wrong length");if(i[0]&128)throw new e("Invalid signature integer: negative");if(i[0]===0&&!(i[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:w5(i),l:r.subarray(n+2)}},toSig(r){const{Err:e}=lp,n=typeof r=="string"?DI(r):r;Vh(n);let i=n.length;if(i<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==i-2)throw new e("Invalid signature: incorrect length");const{d:s,l:o}=lp._parseInt(n.subarray(2)),{d:a,l:u}=lp._parseInt(o);if(u.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(r){const e=g=>Number.parseInt(g[0],16)&8?"00"+g:g,n=g=>{const y=g.toString(16);return y.length&1?`0${y}`:y},i=e(n(r.s)),s=e(n(r.r)),o=i.length/2,a=s.length/2,u=n(o),l=n(a);return`30${n(a+o+4)}02${l}${s}02${u}${i}`}},ff=BigInt(0),Xo=BigInt(1),Vd=BigInt(2),lb=BigInt(3),UI=BigInt(4);function A5(r){const e=v5(r),{Fp:n}=e,i=e.toBytes||((D,U,V)=>{const J=U.toAffine();return Wg(Uint8Array.from([4]),n.toBytes(J.x),n.toBytes(J.y))}),s=e.fromBytes||(D=>{const U=D.subarray(1),V=n.fromBytes(U.subarray(0,n.BYTES)),J=n.fromBytes(U.subarray(n.BYTES,2*n.BYTES));return{x:V,y:J}});function o(D){const{a:U,b:V}=e,J=n.sqr(D),re=n.mul(J,D);return n.add(n.add(re,n.mul(D,U)),V)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(D){return typeof D=="bigint"&&ff<D&&D<e.n}function u(D){if(!a(D))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(D){const{allowedPrivateKeyLengths:U,nByteLength:V,wrapPrivateKey:J,n:re}=e;if(U&&typeof D!="bigint"){if($h(D)&&(D=go(D)),typeof D!="string"||!U.includes(D.length))throw new Error("Invalid key");D=D.padStart(V*2,"0")}let ce;try{ce=typeof D=="bigint"?D:ap(lf("private key",D,V))}catch{throw new Error(`private key must be ${V} bytes, hex or bigint, not ${typeof D}`)}return J&&(ce=fu(ce,re)),u(ce),ce}const g=new Map;function y(D){if(!(D instanceof A))throw new Error("ProjectivePoint expected")}class A{constructor(U,V,J){if(this.px=U,this.py=V,this.pz=J,U==null||!n.isValid(U))throw new Error("x required");if(V==null||!n.isValid(V))throw new Error("y required");if(J==null||!n.isValid(J))throw new Error("z required")}static fromAffine(U){const{x:V,y:J}=U||{};if(!U||!n.isValid(V)||!n.isValid(J))throw new Error("invalid affine point");if(U instanceof A)throw new Error("projective point not allowed");const re=ce=>n.eql(ce,n.ZERO);return re(V)&&re(J)?A.ZERO:new A(V,J,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(U){const V=n.invertBatch(U.map(J=>J.pz));return U.map((J,re)=>J.toAffine(V[re])).map(A.fromAffine)}static fromHex(U){const V=A.fromAffine(s(lf("pointHex",U)));return V.assertValidity(),V}static fromPrivateKey(U){return A.BASE.multiply(l(U))}_setWindowSize(U){this._WINDOW_SIZE=U,g.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:U,y:V}=this.toAffine();if(!n.isValid(U)||!n.isValid(V))throw new Error("bad point: x or y not FE");const J=n.sqr(V),re=o(U);if(!n.eql(J,re))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:U}=this.toAffine();if(n.isOdd)return!n.isOdd(U);throw new Error("Field doesn't support isOdd")}equals(U){y(U);const{px:V,py:J,pz:re}=this,{px:ce,py:Re,pz:De}=U,Ue=n.eql(n.mul(V,De),n.mul(ce,re)),Ve=n.eql(n.mul(J,De),n.mul(Re,re));return Ue&&Ve}negate(){return new A(this.px,n.neg(this.py),this.pz)}double(){const{a:U,b:V}=e,J=n.mul(V,lb),{px:re,py:ce,pz:Re}=this;let De=n.ZERO,Ue=n.ZERO,Ve=n.ZERO,pe=n.mul(re,re),Se=n.mul(ce,ce),Ce=n.mul(Re,Re),je=n.mul(re,ce);return je=n.add(je,je),Ve=n.mul(re,Re),Ve=n.add(Ve,Ve),De=n.mul(U,Ve),Ue=n.mul(J,Ce),Ue=n.add(De,Ue),De=n.sub(Se,Ue),Ue=n.add(Se,Ue),Ue=n.mul(De,Ue),De=n.mul(je,De),Ve=n.mul(J,Ve),Ce=n.mul(U,Ce),je=n.sub(pe,Ce),je=n.mul(U,je),je=n.add(je,Ve),Ve=n.add(pe,pe),pe=n.add(Ve,pe),pe=n.add(pe,Ce),pe=n.mul(pe,je),Ue=n.add(Ue,pe),Ce=n.mul(ce,Re),Ce=n.add(Ce,Ce),pe=n.mul(Ce,je),De=n.sub(De,pe),Ve=n.mul(Ce,Se),Ve=n.add(Ve,Ve),Ve=n.add(Ve,Ve),new A(De,Ue,Ve)}add(U){y(U);const{px:V,py:J,pz:re}=this,{px:ce,py:Re,pz:De}=U;let Ue=n.ZERO,Ve=n.ZERO,pe=n.ZERO;const Se=e.a,Ce=n.mul(e.b,lb);let je=n.mul(V,ce),$e=n.mul(J,Re),Qe=n.mul(re,De),nt=n.add(V,J),Ne=n.add(ce,Re);nt=n.mul(nt,Ne),Ne=n.add(je,$e),nt=n.sub(nt,Ne),Ne=n.add(V,re);let Me=n.add(ce,De);return Ne=n.mul(Ne,Me),Me=n.add(je,Qe),Ne=n.sub(Ne,Me),Me=n.add(J,re),Ue=n.add(Re,De),Me=n.mul(Me,Ue),Ue=n.add($e,Qe),Me=n.sub(Me,Ue),pe=n.mul(Se,Ne),Ue=n.mul(Ce,Qe),pe=n.add(Ue,pe),Ue=n.sub($e,pe),pe=n.add($e,pe),Ve=n.mul(Ue,pe),$e=n.add(je,je),$e=n.add($e,je),Qe=n.mul(Se,Qe),Ne=n.mul(Ce,Ne),$e=n.add($e,Qe),Qe=n.sub(je,Qe),Qe=n.mul(Se,Qe),Ne=n.add(Ne,Qe),je=n.mul($e,Ne),Ve=n.add(Ve,je),je=n.mul(Me,Ne),Ue=n.mul(nt,Ue),Ue=n.sub(Ue,je),je=n.mul(nt,$e),pe=n.mul(Me,pe),pe=n.add(pe,je),new A(Ue,Ve,pe)}subtract(U){return this.add(U.negate())}is0(){return this.equals(A.ZERO)}wNAF(U){return P.wNAFCached(this,g,U,V=>{const J=n.invertBatch(V.map(re=>re.pz));return V.map((re,ce)=>re.toAffine(J[ce])).map(A.fromAffine)})}multiplyUnsafe(U){const V=A.ZERO;if(U===ff)return V;if(u(U),U===Xo)return this;const{endo:J}=e;if(!J)return P.unsafeLadder(this,U);let{k1neg:re,k1:ce,k2neg:Re,k2:De}=J.splitScalar(U),Ue=V,Ve=V,pe=this;for(;ce>ff||De>ff;)ce&Xo&&(Ue=Ue.add(pe)),De&Xo&&(Ve=Ve.add(pe)),pe=pe.double(),ce>>=Xo,De>>=Xo;return re&&(Ue=Ue.negate()),Re&&(Ve=Ve.negate()),Ve=new A(n.mul(Ve.px,J.beta),Ve.py,Ve.pz),Ue.add(Ve)}multiply(U){u(U);let V=U,J,re;const{endo:ce}=e;if(ce){const{k1neg:Re,k1:De,k2neg:Ue,k2:Ve}=ce.splitScalar(V);let{p:pe,f:Se}=this.wNAF(De),{p:Ce,f:je}=this.wNAF(Ve);pe=P.constTimeNegate(Re,pe),Ce=P.constTimeNegate(Ue,Ce),Ce=new A(n.mul(Ce.px,ce.beta),Ce.py,Ce.pz),J=pe.add(Ce),re=Se.add(je)}else{const{p:Re,f:De}=this.wNAF(V);J=Re,re=De}return A.normalizeZ([J,re])[0]}multiplyAndAddUnsafe(U,V,J){const re=A.BASE,ce=(De,Ue)=>Ue===ff||Ue===Xo||!De.equals(re)?De.multiplyUnsafe(Ue):De.multiply(Ue),Re=ce(this,V).add(ce(U,J));return Re.is0()?void 0:Re}toAffine(U){const{px:V,py:J,pz:re}=this,ce=this.is0();U==null&&(U=ce?n.ONE:n.inv(re));const Re=n.mul(V,U),De=n.mul(J,U),Ue=n.mul(re,U);if(ce)return{x:n.ZERO,y:n.ZERO};if(!n.eql(Ue,n.ONE))throw new Error("invZ was invalid");return{x:Re,y:De}}isTorsionFree(){const{h:U,isTorsionFree:V}=e;if(U===Xo)return!0;if(V)return V(A,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:U,clearCofactor:V}=e;return U===Xo?this:V?V(A,this):this.multiplyUnsafe(e.h)}toRawBytes(U=!0){return this.assertValidity(),i(A,this,U)}toHex(U=!0){return go(this.toRawBytes(U))}}A.BASE=new A(e.Gx,e.Gy,n.ONE),A.ZERO=new A(n.ZERO,n.ONE,n.ZERO);const I=e.nBitLength,P=MI(A,e.endo?Math.ceil(I/2):I);return{CURVE:e,ProjectivePoint:A,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}function _5(r){const e=LI(r);return ji(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function E5(r){const e=_5(r),{Fp:n,n:i}=e,s=n.BYTES+1,o=2*n.BYTES+1;function a(Ne){return ff<Ne&&Ne<n.ORDER}function u(Ne){return fu(Ne,i)}function l(Ne){return Zv(Ne,i)}const{ProjectivePoint:g,normPrivateKeyToScalar:y,weierstrassEquation:A,isWithinCurveOrder:I}=A5({...e,toBytes(Ne,Me,ct){const mt=Me.toAffine(),Bt=n.toBytes(mt.x),er=Wg;return ct?er(Uint8Array.from([Me.hasEvenY()?2:3]),Bt):er(Uint8Array.from([4]),Bt,n.toBytes(mt.y))},fromBytes(Ne){const Me=Ne.length,ct=Ne[0],mt=Ne.subarray(1);if(Me===s&&(ct===2||ct===3)){const Bt=ap(mt);if(!a(Bt))throw new Error("Point is not on curve");const er=A(Bt);let cr;try{cr=n.sqrt(er)}catch(Rr){const Pr=Rr instanceof Error?": "+Rr.message:"";throw new Error("Point is not on curve"+Pr)}const pr=(cr&Xo)===Xo;return(ct&1)===1!==pr&&(cr=n.neg(cr)),{x:Bt,y:cr}}else if(Me===o&&ct===4){const Bt=n.fromBytes(mt.subarray(0,n.BYTES)),er=n.fromBytes(mt.subarray(n.BYTES,2*n.BYTES));return{x:Bt,y:er}}else throw new Error(`Point of length ${Me} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}}),P=Ne=>go(up(Ne,e.nByteLength));function D(Ne){const Me=i>>Xo;return Ne>Me}function U(Ne){return D(Ne)?u(-Ne):Ne}const V=(Ne,Me,ct)=>ap(Ne.slice(Me,ct));class J{constructor(Me,ct,mt){this.r=Me,this.s=ct,this.recovery=mt,this.assertValidity()}static fromCompact(Me){const ct=e.nByteLength;return Me=lf("compactSignature",Me,ct*2),new J(V(Me,0,ct),V(Me,ct,2*ct))}static fromDER(Me){const{r:ct,s:mt}=lp.toSig(lf("DER",Me));return new J(ct,mt)}assertValidity(){if(!I(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!I(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Me){return new J(this.r,this.s,Me)}recoverPublicKey(Me){const{r:ct,s:mt,recovery:Bt}=this,er=Ve(lf("msgHash",Me));if(Bt==null||![0,1,2,3].includes(Bt))throw new Error("recovery id invalid");const cr=Bt===2||Bt===3?ct+e.n:ct;if(cr>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const pr=Bt&1?"03":"02",Dr=g.fromHex(pr+P(cr)),Rr=l(cr),Pr=u(-er*Rr),on=u(mt*Rr),xn=g.BASE.multiplyAndAddUnsafe(Dr,Pr,on);if(!xn)throw new Error("point at infinify");return xn.assertValidity(),xn}hasHighS(){return D(this.s)}normalizeS(){return this.hasHighS()?new J(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return Fg(this.toDERHex())}toDERHex(){return lp.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Fg(this.toCompactHex())}toCompactHex(){return P(this.r)+P(this.s)}}const re={isValidPrivateKey(Ne){try{return y(Ne),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const Ne=Lu(e.n);return m5(e.randomBytes(Ne),e.n)},precompute(Ne=8,Me=g.BASE){return Me._setWindowSize(Ne),Me.multiply(BigInt(3)),Me}};function ce(Ne,Me=!0){return g.fromPrivateKey(Ne).toRawBytes(Me)}function Re(Ne){const Me=$h(Ne),ct=typeof Ne=="string",mt=(Me||ct)&&Ne.length;return Me?mt===s||mt===o:ct?mt===2*s||mt===2*o:Ne instanceof g}function De(Ne,Me,ct=!0){if(Re(Ne))throw new Error("first arg must be private key");if(!Re(Me))throw new Error("second arg must be public key");return g.fromHex(Me).multiply(y(Ne)).toRawBytes(ct)}const Ue=e.bits2int||function(Ne){const Me=ap(Ne),ct=Ne.length*8-e.nBitLength;return ct>0?Me>>BigInt(ct):Me},Ve=e.bits2int_modN||function(Ne){return u(Ue(Ne))},pe=n_(e.nBitLength);function Se(Ne){if(typeof Ne!="bigint")throw new Error("bigint expected");if(!(ff<=Ne&&Ne<pe))throw new Error(`bigint expected < 2^${e.nBitLength}`);return up(Ne,e.nByteLength)}function Ce(Ne,Me,ct=je){if(["recovered","canonical"].some(Xr=>Xr in ct))throw new Error("sign() legacy options not supported");const{hash:mt,randomBytes:Bt}=e;let{lowS:er,prehash:cr,extraEntropy:pr}=ct;er==null&&(er=!0),Ne=lf("msgHash",Ne),cr&&(Ne=lf("prehashed msgHash",mt(Ne)));const Dr=Ve(Ne),Rr=y(Me),Pr=[Se(Rr),Se(Dr)];if(pr!=null&&pr!==!1){const Xr=pr===!0?Bt(n.BYTES):pr;Pr.push(lf("extraEntropy",Xr))}const on=Wg(...Pr),xn=Dr;function Ar(Xr){const Tn=Ue(Xr);if(!I(Tn))return;const Bn=l(Tn),ni=g.BASE.multiply(Tn).toAffine(),en=u(ni.x);if(en===ff)return;const si=u(Bn*u(xn+en*Rr));if(si===ff)return;let ei=(ni.x===en?0:2)|Number(ni.y&Xo),Ia=si;return er&&D(si)&&(Ia=U(si),ei^=1),new J(en,Ia,ei)}return{seed:on,k2sig:Ar}}const je={lowS:e.lowS,prehash:!1},$e={lowS:e.lowS,prehash:!1};function Qe(Ne,Me,ct=je){const{seed:mt,k2sig:Bt}=Ce(Ne,Me,ct),er=e;return s_(er.hash.outputLen,er.nByteLength,er.hmac)(mt,Bt)}g.BASE._setWindowSize(8);function nt(Ne,Me,ct,mt=$e){const Bt=Ne;if(Me=lf("msgHash",Me),ct=lf("publicKey",ct),"strict"in mt)throw new Error("options.strict was renamed to lowS");const{lowS:er,prehash:cr}=mt;let pr,Dr;try{if(typeof Bt=="string"||$h(Bt))try{pr=J.fromDER(Bt)}catch(ni){if(!(ni instanceof lp.Err))throw ni;pr=J.fromCompact(Bt)}else if(typeof Bt=="object"&&typeof Bt.r=="bigint"&&typeof Bt.s=="bigint"){const{r:ni,s:en}=Bt;pr=new J(ni,en)}else throw new Error("PARSE");Dr=g.fromHex(ct)}catch(ni){if(ni.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(er&&pr.hasHighS())return!1;cr&&(Me=e.hash(Me));const{r:Rr,s:Pr}=pr,on=Ve(Me),xn=l(Pr),Ar=u(on*xn),Xr=u(Rr*xn),Tn=g.BASE.multiplyAndAddUnsafe(Dr,Ar,Xr)?.toAffine();return Tn?u(Tn.x)===Rr:!1}return{CURVE:e,getPublicKey:ce,getSharedSecret:De,sign:Qe,verify:nt,ProjectivePoint:g,Signature:J,utils:re}}function Hg(r,e){const n=r.ORDER;let i=ff;for(let D=n-Xo;D%Vd===ff;D/=Vd)i+=Xo;const s=i,o=Vd<<s-Xo-Xo,a=o*Vd,u=(n-Xo)/a,l=(u-Xo)/Vd,g=a-Xo,y=o,A=r.pow(e,u),I=r.pow(e,(u+Xo)/Vd);let P=(D,U)=>{let V=A,J=r.pow(U,g),re=r.sqr(J);re=r.mul(re,U);let ce=r.mul(D,re);ce=r.pow(ce,l),ce=r.mul(ce,J),J=r.mul(ce,U),re=r.mul(ce,D);let Re=r.mul(re,J);ce=r.pow(Re,y);let De=r.eql(ce,r.ONE);J=r.mul(re,I),ce=r.mul(Re,V),re=r.cmov(J,re,De),Re=r.cmov(ce,Re,De);for(let Ue=s;Ue>Xo;Ue--){let Ve=Ue-Vd;Ve=Vd<<Ve-Xo;let pe=r.pow(Re,Ve);const Se=r.eql(pe,r.ONE);J=r.mul(re,V),V=r.mul(V,V),pe=r.mul(Re,V),re=r.cmov(J,re,Se),Re=r.cmov(pe,Re,Se)}return{isValid:De,value:re}};if(r.ORDER%UI===lb){const D=(r.ORDER-lb)/UI,U=r.sqrt(r.neg(e));P=(V,J)=>{let re=r.sqr(J);const ce=r.mul(V,J);re=r.mul(re,ce);let Re=r.pow(re,D);Re=r.mul(Re,ce);const De=r.mul(Re,U),Ue=r.mul(r.sqr(Re),J),Ve=r.eql(Ue,V);let pe=r.cmov(De,Re,Ve);return{isValid:Ve,value:pe}}}return P}function WH(r,e){if(mod.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=Hg(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return i=>{let s,o,a,u,l,g,y,A;s=r.sqr(i),s=r.mul(s,e.Z),o=r.sqr(s),o=r.add(o,s),a=r.add(o,r.ONE),a=r.mul(a,e.B),u=r.cmov(e.Z,r.neg(o),!r.eql(o,r.ZERO)),u=r.mul(u,e.A),o=r.sqr(a),g=r.sqr(u),l=r.mul(g,e.A),o=r.add(o,l),o=r.mul(o,a),g=r.mul(g,u),l=r.mul(g,e.B),o=r.add(o,l),y=r.mul(s,a);const{isValid:I,value:P}=n(o,g);A=r.mul(s,i),A=r.mul(A,P),y=r.cmov(y,a,I),A=r.cmov(A,P,I);const D=r.isOdd(i)===r.isOdd(A);return A=r.cmov(r.neg(A),A,D),y=r.div(y,u),{x:y,y:A}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function T5(r){return{hash:r,hmac:(e,...n)=>e_(r,e,ub(...n)),randomBytes:JA}}function S5(r,e){const n=i=>E5({...r,...T5(i)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Yv=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Xv=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l_=BigInt(1),fb=BigInt(2),FI=(r,e)=>(r+e/fb)/e;function WI(r){const e=Yv,n=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),u=BigInt(44),l=BigInt(88),g=r*r*r%e,y=g*g*r%e,A=ml(y,n,e)*y%e,I=ml(A,n,e)*y%e,P=ml(I,fb,e)*g%e,D=ml(P,s,e)*P%e,U=ml(D,o,e)*D%e,V=ml(U,u,e)*U%e,J=ml(V,l,e)*V%e,re=ml(J,u,e)*U%e,ce=ml(re,n,e)*y%e,Re=ml(ce,a,e)*D%e,De=ml(Re,i,e)*g%e,Ue=ml(De,fb,e);if(!f_.eql(f_.sqr(Ue),r))throw new Error("Cannot find square root");return Ue}const f_=u_(Yv,void 0,void 0,{sqrt:WI}),df=S5({a:BigInt(0),b:BigInt(7),Fp:f_,n:Xv,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=Xv,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-l_*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),u=FI(o*r,e),l=FI(-i*r,e);let g=fu(r-u*n-l*s,e),y=fu(-u*i-l*o,e);const A=g>a,I=y>a;if(A&&(g=e-g),I&&(y=e-y),g>a||y>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:A,k1:g,k2neg:I,k2:y}}}},QA),Jv=BigInt(0),HI=r=>typeof r=="bigint"&&Jv<r&&r<Yv,I5=r=>typeof r=="bigint"&&Jv<r&&r<Xv,zI=null;function d_(r,...e){let n=zI[r];if(n===void 0){const i=sha256(Uint8Array.from(r,s=>s.charCodeAt(0)));n=concatBytes(i,i),zI[r]=n}return sha256(concatBytes(n,...e))}const $I=r=>r.toRawBytes(!0).slice(1),h_=r=>numberToBytesBE(r,32),p_=r=>mod(r,Yv),db=r=>mod(r,Xv),g_=df.ProjectivePoint,k5=(r,e,n)=>g_.BASE.multiplyAndAddUnsafe(r,e,n);function y_(r){let e=df.utils.normPrivateKeyToScalar(r),n=g_.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:db(-e),bytes:$I(n)}}function R5(r){if(!HI(r))throw new Error("bad x: need 0 < x < p");const e=p_(r*r),n=p_(e*r+BigInt(7));let i=WI(n);i%fb!==Jv&&(i=p_(-i));const s=new g_(r,i,l_);return s.assertValidity(),s}function VI(...r){return db(bytesToNumberBE(d_("BIP0340/challenge",...r)))}function HH(r){return y_(r).bytes}function zH(r,e,n=randomBytes(32)){const i=ensureBytes("message",r),{bytes:s,scalar:o}=y_(e),a=ensureBytes("auxRand",n,32),u=h_(o^bytesToNumberBE(d_("BIP0340/aux",a))),l=d_("BIP0340/nonce",u,s,i),g=db(bytesToNumberBE(l));if(g===Jv)throw new Error("sign failed: k is zero");const{bytes:y,scalar:A}=y_(g),I=VI(y,s,i),P=new Uint8Array(64);if(P.set(y,0),P.set(h_(db(A+I*o)),32),!C5(P,i,s))throw new Error("sign: Invalid signature produced");return P}function C5(r,e,n){const i=ensureBytes("signature",r,64),s=ensureBytes("message",e),o=ensureBytes("publicKey",n,32);try{const a=R5(bytesToNumberBE(o)),u=bytesToNumberBE(i.subarray(0,32));if(!HI(u))return!1;const l=bytesToNumberBE(i.subarray(32,64));if(!I5(l))return!1;const g=VI(h_(u),$I(a),s),y=k5(a,l,db(-g));return!(!y||!y.hasEvenY()||y.toAffine().x!==u)}catch{return!1}}const $H=null,VH=null,jH=null,KH=null,jI=null,x5=null,B5=$v.bool,GH=$v.bytes;function qH(r){if(!(r instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof r}`);return new TextDecoder().decode(r)}function ZH(r){const e=r.startsWith("0x")?r.substring(2):r;return _hexToBytes(e)}function KI(r,e){if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}function hb(r){return e=>($v.bytes(e),r(e))}const YH=(()=>{const r=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,e=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:e&&!r?e("crypto"):void 0,web:r}})();function m_(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e<"u"&&e>0&&r.length!==2+2*e)}const Uc=r=>{if(typeof r!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof r}`);return m_(r)?r.slice(2):r};function zg(r){let e=r;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}function XH(r){if(typeof r!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof r}`);return utf8ToBytes(r).byteLength}function JH(r,e,n){if(Array.isArray(r)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof r}'`);if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof e}'`);return e[n===!0?"some":"every"](i=>r.indexOf(i)>=0)}function QH(r){let e="",n=0;const i=r.length;for(r.substring(0,2)==="0x"&&(n=2);n<i;n+=2){const s=parseInt(r.substr(n,2),16);e+=String.fromCharCode(s)}return e}function ez(r){const e=utf8ToBytes(r);return`0x${zg(bytesToUnprefixedHex(e)).replace(/^0+|0+$/g,"")}`}function GI(r){let e="";for(let n=0;n<r.length;n++){const s=r.charCodeAt(n).toString(16);e+=s.length<2?`0${s}`:s}return`0x${e}`}function tz(r,e,n){if(!Array.isArray(r))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof r}`);if(typeof e!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof r}`);const i=[];for(let s=0;s<r.length;s++){let o=r[s][e];if(n===!0&&!o)o="";else if(typeof o!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof o}`);i.push(o)}return i}const qI=function(r){if(!isHexString(r)){const e=`This method only supports 0x-prefixed hex strings but input was: ${r}`;throw new Error(e)}},ZI=function(r){if(!(r instanceof Uint8Array)){const e=`This method only supports Uint8Array but input was: ${r}`;throw new Error(e)}},rz=function(r){if(!Array.isArray(r)){const e=`This method only supports number arrays but input was: ${r}`;throw new Error(e)}},O5=function(r){if(typeof r!="string"){const e=`This method only supports strings but input was: ${r}`;throw new Error(e)}},YI=BigInt(0),P5=null,b_={},v_={};for(let r=0;r<16;r++){const e=r,n=r*16,i=r.toString(16).toLowerCase();v_[i]=e,v_[i.toUpperCase()]=e,b_[i]=n,b_[i.toUpperCase()]=n}function XI(r){const e=r.length,n=new Uint8Array(e/2);for(let i=0;i<e;i+=2)n[i/2]=b_[r[i]]+v_[r[i+1]];return n}const w_=r=>{if(r.slice(0,2)==="0x")throw new Error("hex string is prefixed with 0x, should be unprefixed");return XI(zg(r))},A_=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0")),Ca=r=>{let e="0x";if(r===void 0||r.length===0)return e;for(const n of r)e=`${e}${A_[n]}`;return e},__=[];for(let r=0;r<=256*256-1;r++)__[r]=BigInt(r);const jh=(r,e=!1)=>{e&&r.reverse();const n=Ca(r);return n==="0x"?YI:n.length===4?__[r[0]]:n.length===6?__[r[0]*256+r[1]]:BigInt(n)},nz=r=>{const e=Number(jh(r));if(!Number.isSafeInteger(e))throw new Error("Number exceeds 53 bits");return e},Du=r=>{if(typeof r!="string")throw new Error(`hex argument type ${typeof r} must be of type string`);if(!/^0x[0-9a-fA-F]*$/.test(r))throw new Error(`Input must be a 0x-prefixed hexadecimal string, got ${r}`);const e=r.slice(2);return XI(e.length%2===0?e:zg(e))},N5=r=>{if(!Number.isSafeInteger(r)||r<0)throw new Error(`Received an invalid integer type: ${r}`);return`0x${r.toString(16)}`},fp=r=>{const e=N5(r);return Du(e)},$g=(r,e=!1)=>{const n=bl(`0x${zg(r.toString(16))}`);return e?n.reverse():n},JI=r=>new Uint8Array(r),Qv=(r,e,n)=>n?r.length<e?new Uint8Array([...r,...JI(e-r.length)]):r.subarray(0,e):r.length<e?new Uint8Array([...JI(e-r.length),...r]):r.subarray(-e),M5=(r,e)=>(assertIsBytes(r),Qv(r,e,!1)),iz=(r,e)=>(assertIsBytes(r),Qv(r,e,!0)),E_=r=>{let e=r[0];for(;r.length>0&&e.toString()==="0";)r=r.slice(1),e=r[0];return r},QI=r=>(assertIsBytes(r),E_(r)),sz=r=>(assertIsArray(r),E_(r)),oz=r=>(assertIsHexString(r),`0x${E_(stripHexPrefix(r))}`),bl=r=>{if(r==null)return new Uint8Array;if(Array.isArray(r)||r instanceof Uint8Array)return Uint8Array.from(r);if(typeof r=="string"){if(!m_(r))throw new Error(`Cannot convert string to Uint8Array. toBytes only supports 0x-prefixed hex strings and this string was given: ${r}`);return Du(r)}if(typeof r=="number")return fp(r);if(typeof r=="bigint"){if(r<YI)throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${r}`);let e=r.toString(16);return e.length%2&&(e="0"+e),w_(e)}if(r.toBytes!==void 0)return r.toBytes();throw new Error("invalid type")},az=r=>BigInt.asIntN(256,jh(r)),uz=r=>$g(BigInt.asUintN(256,r)),cz=r=>typeof r!="string"||isHexString(r)?r:`0x${r}`,lz=(r,e=50)=>{const n=r instanceof Uint8Array?Ca(r):r,i=n.slice(0,2)==="0x"?e+2:e;return n.length<=i?n:n.slice(0,i)+"\u2026"},W=r=>{for(const[e,n]of Object.entries(r))if(n!==void 0&&n.length>0&&n[0]===0)throw new Error(`${e} cannot have leading zeroes, received: ${Ca(n)}`)},ne=r=>`0x${r.toString(16)}`,Oe=(...r)=>r.reduce((e,n)=>n>e?n:e),ht=(...r)=>r.reduce((e,n)=>n<e?n:e),Ut=r=>QI($g(r)),rr=(r,e=!0)=>{const n=$g(r);if(e&&n.length>20)throw Error(`Invalid address bytes length=${n.length} strict=${e}`);return M5(n,20)},mr=r=>QI(fp(r)),Cr=(r,e)=>{const n=jh(r),i=jh(e);return n>i?1:n<i?-1:0},Lr=r=>getRandomBytesSync(r),wn=(...r)=>{if(r.length===1)return r[0];const e=r.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n};function _n(r,e=!1){return r.length<4&&(r=Qv(r,4,e)),new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,e)}function Rn(r,e=!1){return r.length<8&&(r=Qv(r,8,e)),new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,e)}function Jn(r,e=!1){const n=new ArrayBuffer(4);return new DataView(n).setUint32(0,r,e),new Uint8Array(n)}function vi(r,e=!1){const n=new ArrayBuffer(8);return new DataView(n).setBigUint64(0,r,e),new Uint8Array(n)}function Ri(r){return jh(Du(m_(r)?r:`0x${r}`))}const ns=BigInt("0xffffffffffffffff"),Di=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),gs=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),Ts=df.CURVE.n,vl=df.CURVE.n/BigInt(2),oc=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),wa=Du("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"),Kh=Du("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"),O$e=Du("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"),P$e=Uint8Array.from([128]),N$e=16,M$e="0000000000000000000000000000000000000003",L$e=BigInt(-1),e3=BigInt(0),hle=BigInt(1),fz=BigInt(2),D$e=BigInt(3),U$e=BigInt(7),F$e=BigInt(8),ple=BigInt(27),W$e=BigInt(28),H$e=BigInt(31),z$e=BigInt(32),$$e=BigInt(64),V$e=BigInt(128),j$e=BigInt(255),K$e=BigInt(256),G$e=BigInt(96),q$e=BigInt(100),Z$e=BigInt(160),Y$e=BigInt(224),X$e=BigInt(7922816251426434e13),J$e=BigInt(1461501637330903e33),Q$e=BigInt(2695994666715064e52),eVe=null,tVe=BigInt(1e9);function rVe(r,e,n){e===BIGINT_0&&(e=BIGINT_1);const i=r/e,s=(r-i*e)*n/e,o=String(n).length-1-String(s).length;return`${i}.${"0".repeat(o)}${s}`}function dz(r){if(Array.isArray(r)){const n=[];let i=0;for(let s=0;s<r.length;s++){const o=dz(r[s]);n.push(o),i+=o.length}return yz(pz(i,192),...n)}const e=bz(r);return e.length===1&&e[0]<128?e:yz(pz(e.length,128),e)}function ew(r,e,n){if(n>r.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return r.slice(e,n)}function hz(r){if(r[0]===0)throw new Error("invalid RLP: extra zeros");return gz(mle(r))}function pz(r,e){if(r<56)return Uint8Array.from([r+e]);const n=F5(r),i=n.length/2,s=F5(e+55+i);return Uint8Array.from(U5(s+n))}function gle(r,e=!1){if(typeof r>"u"||r===null||r.length===0)return Uint8Array.from([]);const n=bz(r),i=D5(n);if(e)return{data:i.data,remainder:i.remainder.slice()};if(i.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return i.data}function D5(r){let e,n,i,s,o;const a=[],u=r[0];if(u<=127)return{data:r.slice(0,1),remainder:r.subarray(1)};if(u<=183){if(e=u-127,u===128?i=Uint8Array.from([]):i=ew(r,1,e),e===2&&i[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:i,remainder:r.subarray(e)}}else if(u<=191){if(n=u-182,r.length-1<n)throw new Error("invalid RLP: not enough bytes for string length");if(e=hz(ew(r,1,n)),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return i=ew(r,n,e+n),{data:i,remainder:r.subarray(e+n)}}else if(u<=247){for(e=u-191,s=ew(r,1,e);s.length;)o=D5(s),a.push(o.data),s=o.remainder;return{data:a,remainder:r.subarray(e)}}else{if(n=u-246,e=hz(ew(r,1,n)),e<56)throw new Error("invalid RLP: encoded list too short");const l=n+e;if(l>r.length)throw new Error("invalid RLP: total length is larger than the data");for(s=ew(r,n,l);s.length;)o=D5(s),a.push(o.data),s=o.remainder;return{data:a,remainder:r.subarray(l)}}}const yle=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function mle(r){let e="";for(let n=0;n<r.length;n++)e+=yle[r[n]];return e}function gz(r){const e=Number.parseInt(r,16);if(Number.isNaN(e))throw new Error("Invalid byte sequence");return e}function U5(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(r.length/2);for(let n=0;n<e.length;n++){const i=n*2;e[n]=gz(r.slice(i,i+2))}return e}function yz(...r){if(r.length===1)return r[0];const e=r.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}function ble(r){return new TextEncoder().encode(r)}function F5(r){if(r<0)throw new Error("Invalid integer as argument, must be unsigned!");const e=r.toString(16);return e.length%2?`0${e}`:e}function vle(r){return r.length%2?`0${r}`:r}function mz(r){return r.length>=2&&r[0]==="0"&&r[1]==="x"}function wle(r){return typeof r!="string"?r:mz(r)?r.slice(2):r}function bz(r){if(r instanceof Uint8Array)return r;if(typeof r=="string")return mz(r)?U5(vle(wle(r))):ble(r);if(typeof r=="number"||typeof r=="bigint")return r?U5(F5(r)):Uint8Array.from([]);if(r==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof r)}const nVe=null,tw={encode:dz,decode:gle},t3=BigInt(2**32-1),W5=BigInt(32);function vz(r,e=!1){return e?{h:Number(r&t3),l:Number(r>>W5&t3)}:{h:Number(r>>W5&t3)|0,l:Number(r&t3)|0}}function wz(r,e=!1){let n=new Uint32Array(r.length),i=new Uint32Array(r.length);for(let s=0;s<r.length;s++){const{h:o,l:a}=vz(r[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const Ale=(r,e)=>BigInt(r>>>0)<<W5|BigInt(e>>>0),_le=(r,e,n)=>r>>>n,Ele=(r,e,n)=>r<<32-n|e>>>n,Tle=(r,e,n)=>r>>>n|e<<32-n,Sle=(r,e,n)=>r<<32-n|e>>>n,Ile=(r,e,n)=>r<<64-n|e>>>n-32,kle=(r,e,n)=>r>>>n-32|e<<64-n,Rle=(r,e)=>e,Cle=(r,e)=>r,Az=(r,e,n)=>r<<n|e>>>32-n,_z=(r,e,n)=>e<<n|r>>>32-n,Ez=(r,e,n)=>e<<n-32|r>>>64-n,Tz=(r,e,n)=>r<<n-32|e>>>64-n;function xle(r,e,n,i){const s=(e>>>0)+(i>>>0);return{h:r+n+(s/2**32|0)|0,l:s|0}}const as={fromBig:vz,split:wz,toBig:Ale,shrSH:_le,shrSL:Ele,rotrSH:Tle,rotrSL:Sle,rotrBH:Ile,rotrBL:kle,rotr32H:Rle,rotr32L:Cle,rotlSH:Az,rotlSL:_z,rotlBH:Ez,rotlBL:Tz,add:xle,add3L:(r,e,n)=>(r>>>0)+(e>>>0)+(n>>>0),add3H:(r,e,n,i)=>e+n+i+(r/2**32|0)|0,add4L:(r,e,n,i)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0),add4H:(r,e,n,i,s)=>e+n+i+s+(r/2**32|0)|0,add5H:(r,e,n,i,s,o)=>e+n+i+s+o+(r/2**32|0)|0,add5L:(r,e,n,i,s)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0)+(s>>>0)},Sz=[],Iz=[],kz=[],Ble=BigInt(0),T_=BigInt(1),Ole=BigInt(2),Ple=BigInt(7),Nle=BigInt(256),Mle=BigInt(113);for(let r=0,e=T_,n=1,i=0;r<24;r++){[n,i]=[i,(2*n+3*i)%5],Sz.push(2*(5*i+n)),Iz.push((r+1)*(r+2)/2%64);let s=Ble;for(let o=0;o<7;o++)e=(e<<T_^(e>>Ple)*Mle)%Nle,e&Ole&&(s^=T_<<(T_<<BigInt(o))-T_);kz.push(s)}const[Lle,Dle]=wz(kz,!0),Rz=(r,e,n)=>n>32?Ez(r,e,n):Az(r,e,n),Cz=(r,e,n)=>n>32?Tz(r,e,n):_z(r,e,n);function Ule(r,e=24){const n=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let a=0;a<10;a++)n[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){const u=(a+8)%10,l=(a+2)%10,g=n[l],y=n[l+1],A=Rz(g,y,1)^n[u],I=Cz(g,y,1)^n[u+1];for(let P=0;P<50;P+=10)r[a+P]^=A,r[a+P+1]^=I}let s=r[2],o=r[3];for(let a=0;a<24;a++){const u=Iz[a],l=Rz(s,o,u),g=Cz(s,o,u),y=Sz[a];s=r[y],o=r[y+1],r[y]=l,r[y+1]=g}for(let a=0;a<50;a+=10){for(let u=0;u<10;u++)n[u]=r[a+u];for(let u=0;u<10;u++)r[a+u]^=~n[(u+2)%10]&n[(u+4)%10]}r[0]^=Lle[i],r[1]^=Dle[i]}n.fill(0)}class r3 extends YA{constructor(e,n,i,s=!1,o=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=i,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ob(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=AI(this.state)}keccak(){_I||EI(this.state32),Ule(this.state32,this.rounds),_I||EI(this.state32),this.posOut=0,this.pos=0}update(e){Df(this);const{blockLen:n,state:i}=this;e=Ug(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(n-this.pos,s-o);for(let u=0;u<a;u++)i[this.pos++]^=e[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:i,blockLen:s}=this;e[i]^=n,n&128&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Df(this,!1),Dg(e),this.finish();const n=this.state,{blockLen:i}=this;for(let s=0,o=e.length;s<o;){this.posOut>=i&&this.keccak();const a=Math.min(i-this.posOut,o-s);e.set(n.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ob(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(qA(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:i,outputLen:s,rounds:o,enableXOF:a}=this;return e||(e=new r3(n,i,s,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=i,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}}const n3=(r,e,n)=>XA(()=>new r3(e,r,n)),fVe=null,dVe=null,hVe=null,pVe=null,Fle=n3(1,144,224/8),xz=n3(1,136,256/8),Wle=n3(1,104,384/8),Hle=n3(1,72,512/8),gVe=(r,e,n)=>wrapXOFConstructorWithOpts((i={})=>new r3(e,r,i.dkLen===void 0?n:i.dkLen,!0)),yVe=null,mVe=null,bVe=hb(Fle),zle=(()=>{const r=hb(xz);return r.create=xz.create,r})(),vVe=hb(Wle),wVe=hb(Hle);class i3{constructor(e=BIGINT_0,n=BIGINT_0,i=KECCAK256_RLP,s=KECCAK256_NULL,o=null,a=0){this._nonce=null,this._balance=null,this._storageRoot=null,this._codeHash=null,this._codeSize=null,this._version=null,this._nonce=e,this._balance=n,this._storageRoot=i,this._codeHash=s,o===null&&s!==null&&!this.isContract()&&(o=0),this._codeSize=o,this._version=a,this._validate()}get version(){if(this._version!==null)return this._version;throw Error(`version=${this._version} not loaded`)}set version(e){this._version=e}get nonce(){if(this._nonce!==null)return this._nonce;throw Error(`nonce=${this._nonce} not loaded`)}set nonce(e){this._nonce=e}get balance(){if(this._balance!==null)return this._balance;throw Error(`balance=${this._balance} not loaded`)}set balance(e){this._balance=e}get storageRoot(){if(this._storageRoot!==null)return this._storageRoot;throw Error(`storageRoot=${this._storageRoot} not loaded`)}set storageRoot(e){this._storageRoot=e}get codeHash(){if(this._codeHash!==null)return this._codeHash;throw Error(`codeHash=${this._codeHash} not loaded`)}set codeHash(e){this._codeHash=e}get codeSize(){if(this._codeSize!==null)return this._codeSize;throw Error(`codeHash=${this._codeSize} not loaded`)}set codeSize(e){this._codeSize=e}static fromAccountData(e){const{nonce:n,balance:i,storageRoot:s,codeHash:o}=e;if(n===null||i===null||s===null||o===null)throw Error("Partial fields not supported in fromAccountData");return new i3(n!==void 0?bytesToBigInt(toBytes(n)):void 0,i!==void 0?bytesToBigInt(toBytes(i)):void 0,s!==void 0?toBytes(s):void 0,o!==void 0?toBytes(o):void 0)}static fromPartialAccountData(e){const{nonce:n,balance:i,storageRoot:s,codeHash:o,codeSize:a,version:u}=e;if(n===null&&i===null&&s===null&&o===null&&a===null&&u===null)throw Error("All partial fields null");return new i3(n!=null?bytesToBigInt(toBytes(n)):n,i!=null?bytesToBigInt(toBytes(i)):i,s!=null?toBytes(s):s,o!=null?toBytes(o):o,a!=null?bytesToInt(toBytes(a)):a,u!=null?bytesToInt(toBytes(u)):u)}static fromRlpSerializedAccount(e){const n=RLP.decode(e);if(!Array.isArray(n))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(n)}static fromRlpSerializedPartialAccount(e){const n=RLP.decode(e);if(!Array.isArray(n))throw new Error("Invalid serialized account input. Must be array");let i=null;if(Array.isArray(n[0])){const g=bytesToInt(n[0][0]);if(g!==0&&g!==1)throw new Error(`Invalid isNullIndicator=${g} for nonce`);g===1&&(i=bytesToBigInt(n[0][1]))}else throw new Error("Invalid partial nonce encoding. Must be array");let s=null;if(Array.isArray(n[1])){const g=bytesToInt(n[1][0]);if(g!==0&&g!==1)throw new Error(`Invalid isNullIndicator=${g} for balance`);g===1&&(s=bytesToBigInt(n[1][1]))}else throw new Error("Invalid partial balance encoding. Must be array");let o=null;if(Array.isArray(n[2])){const g=bytesToInt(n[2][0]);if(g!==0&&g!==1)throw new Error(`Invalid isNullIndicator=${g} for storageRoot`);g===1&&(o=n[2][1])}else throw new Error("Invalid partial storageRoot encoding. Must be array");let a=null;if(Array.isArray(n[3])){const g=bytesToInt(n[3][0]);if(g!==0&&g!==1)throw new Error(`Invalid isNullIndicator=${g} for codeHash`);g===1&&(a=n[3][1])}else throw new Error("Invalid partial codeHash encoding. Must be array");let u=null;if(Array.isArray(n[4])){const g=bytesToInt(n[4][0]);if(g!==0&&g!==1)throw new Error(`Invalid isNullIndicator=${g} for codeSize`);g===1&&(u=bytesToInt(n[4][1]))}else throw new Error("Invalid partial codeSize encoding. Must be array");let l=null;if(Array.isArray(n[5])){const g=bytesToInt(n[5][0]);if(g!==0&&g!==1)throw new Error(`Invalid isNullIndicator=${g} for version`);g===1&&(l=bytesToInt(n[5][1]))}else throw new Error("Invalid partial version encoding. Must be array");return this.fromPartialAccountData({balance:s,nonce:i,storageRoot:o,codeHash:a,codeSize:u,version:l})}static fromValuesArray(e){const[n,i,s,o]=e;return new i3(bytesToBigInt(n),bytesToBigInt(i),s,o)}_validate(){if(this._nonce!==null&&this._nonce<BIGINT_0)throw new Error("nonce must be greater than zero");if(this._balance!==null&&this._balance<BIGINT_0)throw new Error("balance must be greater than zero");if(this._storageRoot!==null&&this._storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this._codeHash!==null&&this._codeHash.length!==32)throw new Error("codeHash must have a length of 32");if(this._codeSize!==null&&this._codeSize<BIGINT_0)throw new Error("codeSize must be greater than zero")}raw(){return[bigIntToUnpaddedBytes(this.nonce),bigIntToUnpaddedBytes(this.balance),this.storageRoot,this.codeHash]}serialize(){return RLP.encode(this.raw())}serializeWithPartialInfo(){const e=[],n=intToUnpaddedBytes(0),i=intToUnpaddedBytes(1);return this._nonce!==null?e.push([i,bigIntToUnpaddedBytes(this._nonce)]):e.push([n]),this._balance!==null?e.push([i,bigIntToUnpaddedBytes(this._balance)]):e.push([n]),this._storageRoot!==null?e.push([i,this._storageRoot]):e.push([n]),this._codeHash!==null?e.push([i,this._codeHash]):e.push([n]),this._codeSize!==null?e.push([i,intToUnpaddedBytes(this._codeSize)]):e.push([n]),this._version!==null?e.push([i,intToUnpaddedBytes(this._version)]):e.push([n]),RLP.encode(e)}isContract(){if(this._codeHash===null&&this._codeSize===null)throw Error("Insufficient data as codeHash=null and codeSize=null");return this._codeHash!==null&&!equalsBytes(this._codeHash,KECCAK256_NULL)||this._codeSize!==null&&this._codeSize!==0}isEmpty(){return this._balance!==null&&this.balance!==BIGINT_0||this._nonce===null&&this.nonce!==BIGINT_0||this._codeHash!==null&&!equalsBytes(this.codeHash,KECCAK256_NULL)?!1:this.balance===BIGINT_0&&this.nonce===BIGINT_0&&equalsBytes(this.codeHash,KECCAK256_NULL)}}const Bz=function(r){try{O5(r)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(r)},$le=function(r,e){assertIsHexString(r);const n=stripHexPrefix(r).toLowerCase();let i="";e!==void 0&&(i=bytesToBigInt(toBytes(e)).toString()+"0x");const s=utf8ToBytes(i+n),o=bytesToHex(keccak256(s)).slice(2);let a="";for(let u=0;u<n.length;u++)parseInt(o[u],16)>=8?a+=n[u].toUpperCase():a+=n[u];return`0x${a}`},AVe=function(r,e){return Bz(r)&&$le(r,e)===r},_Ve=function(r,e){return assertIsBytes(r),assertIsBytes(e),bytesToBigInt(e)===BIGINT_0?keccak256(RLP.encode([r,Uint8Array.from([])])).subarray(-20):keccak256(RLP.encode([r,e])).subarray(-20)},EVe=function(r,e,n){if(assertIsBytes(r),assertIsBytes(e),assertIsBytes(n),r.length!==20)throw new Error("Expected from to be of length 20");if(e.length!==32)throw new Error("Expected salt to be of length 32");return keccak256(concatBytes(hexToBytes("0xff"),r,e,keccak256(n))).subarray(-20)},TVe=function(r){return secp256k1.utils.isValidPrivateKey(r)},SVe=function(r,e=!1){if(assertIsBytes(r),r.length===64)try{return secp256k1.ProjectivePoint.fromHex(concatBytes(Uint8Array.from([4]),r)),!0}catch{return!1}if(!e)return!1;try{return secp256k1.ProjectivePoint.fromHex(r),!0}catch{return!1}},Vle=function(r,e=!1){if(ZI(r),e&&r.length!==64&&(r=df.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r.length!==64)throw new Error("Expected pubKey to be of length 64");return zle(r).subarray(-20)},jle=function(r){return ZI(r),df.ProjectivePoint.fromPrivateKey(r).toRawBytes(!1).slice(1)},Oz=function(r){return Vle(jle(r))},kVe=function(r){return assertIsBytes(r),r.length!==64&&(r=secp256k1.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r},Kle=function(){const e=zeros(20);return bytesToHex(e)},RVe=function(r){try{assertIsString(r)}catch{return!1}return Kle()===r};function Gle(r){const[e,n,i,s]=r;return[e,n,i.length===0?KECCAK256_RLP:i,s.length===0?KECCAK256_NULL:s]}const Pz=new Uint8Array(0);function CVe(r){const[e,n,i,s]=r;return[e,n,equalsBytes(i,KECCAK256_RLP)?Pz:i,equalsBytes(s,KECCAK256_NULL)?Pz:s]}function xVe(r,e=!0){const n=e?Gle(r):r;return RLP.encode(n)}class Vg{constructor(e){if(e.length!==20)throw new Error("Invalid address length");this.bytes=e}static zero(){return new Vg(zeros(20))}static fromString(e){if(!isValidAddress(e))throw new Error(`Invalid address input=${e}`);return new Vg(hexToBytes(e))}static fromPublicKey(e){if(!(e instanceof Uint8Array))throw new Error("Public key should be Uint8Array");const n=pubToAddress(e);return new Vg(n)}static fromPrivateKey(e){if(!(e instanceof Uint8Array))throw new Error("Private key should be Uint8Array");const n=privateToAddress(e);return new Vg(n)}static generate(e,n){if(typeof n!="bigint")throw new Error("Expected nonce to be a bigint");return new Vg(generateAddress(e.bytes,bigIntToBytes(n)))}static generate2(e,n,i){if(!(n instanceof Uint8Array))throw new Error("Expected salt to be a Uint8Array");if(!(i instanceof Uint8Array))throw new Error("Expected initCode to be a Uint8Array");return new Vg(generateAddress2(e.bytes,n,i))}equals(e){return equalsBytes(this.bytes,e.bytes)}isZero(){return this.equals(Vg.zero())}isPrecompileOrSystemAddress(){const e=bytesToBigInt(this.bytes),n=BIGINT_0,i=BigInt("0xffff");return e>=n&&e<=i}toString(){return bytesToHex(this.bytes)}toBytes(){return new Uint8Array(this.bytes)}}var Nz;(function(r){r.String="string",r.Bytes="view",r.Number="number"})(Nz||(Nz={}));var Mz;(function(r){r.String="string",r.Bytes="view",r.JSON="json"})(Mz||(Mz={}));function qle(r){if(!Array.isArray(r))return!1;for(const e of r)if(Array.isArray(e)){if(!qle(e))return!1}else if(!(e instanceof Uint8Array))return!1;return!0}var rw;(function(r){r[r.Number=0]="Number",r[r.BigInt=1]="BigInt",r[r.Uint8Array=2]="Uint8Array",r[r.PrefixedHexString=3]="PrefixedHexString"})(rw||(rw={}));function BVe(r,e){if(r===null)return null;if(r===void 0)return;if(typeof r=="string"&&!isHexString(r))throw new Error(`A string must be provided with a 0x-prefix, given: ${r}`);if(typeof r=="number"&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=toBytes(r);switch(e){case rw.Uint8Array:return n;case rw.BigInt:return bytesToBigInt(n);case rw.Number:{const i=bytesToBigInt(n);if(i>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(i)}case rw.PrefixedHexString:return bytesToHex(n);default:throw new Error("unknown outputType")}}class s3{constructor(e,n,i,s){this.index=e,this.validatorIndex=n,this.address=i,this.amount=s}static fromWithdrawalData(e){const{index:n,validatorIndex:i,address:s,amount:o}=e,a=toType(n,TypeOutput.BigInt),u=toType(i,TypeOutput.BigInt),l=s instanceof Address?s:new Address(toBytes(s)),g=toType(o,TypeOutput.BigInt);return new s3(a,u,l,g)}static fromValuesArray(e){if(e.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[n,i,s,o]=e;return s3.fromWithdrawalData({index:n,validatorIndex:i,address:s,amount:o})}static toBytesArray(e){const{index:n,validatorIndex:i,address:s,amount:o}=e,a=toType(n,TypeOutput.BigInt)===BIGINT_0?new Uint8Array:toType(n,TypeOutput.Uint8Array),u=toType(i,TypeOutput.BigInt)===BIGINT_0?new Uint8Array:toType(i,TypeOutput.Uint8Array),l=s instanceof Address?s.bytes:toType(s,TypeOutput.Uint8Array),g=toType(o,TypeOutput.BigInt)===BIGINT_0?new Uint8Array:toType(o,TypeOutput.Uint8Array);return[a,u,l,g]}raw(){return s3.toBytesArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.bytes,amount:this.amount}}toJSON(){return{index:bigIntToHex(this.index),validatorIndex:bigIntToHex(this.validatorIndex),address:bytesToHex(this.address.bytes),amount:bigIntToHex(this.amount)}}}function o3(r,e,n){const i=df.sign(r,e),s=i.toCompactRawBytes(),o=s.slice(0,32),a=s.slice(32,64),u=n===void 0?BigInt(i.recovery+27):BigInt(i.recovery+35)+BigInt(n)*fz;return{r:o,s:a,v:u}}function nw(r,e){return r===e3||r===hle?r:e===void 0?r-ple:r-(e*fz+BigInt(35))}function a3(r){return r===BIGINT_0||r===BIGINT_1}const OVe=function(r,e,n,i,s){const o=concatBytes(setLengthLeft(n,32),setLengthLeft(i,32)),a=nw(e,s);if(!a3(a))throw new Error("Invalid signature v value");return secp256k1.Signature.fromCompact(o).addRecoveryBit(Number(a)).recoverPublicKey(r).toRawBytes(!1).slice(1)},PVe=function(r,e,n,i){const s=nw(r,i);if(!a3(s))throw new Error("Invalid signature v value");return bytesToHex(concatBytes(setLengthLeft(e,32),setLengthLeft(n,32),toBytes(r)))},NVe=function(r,e,n,i){const s=nw(r,i);if(!a3(s))throw new Error("Invalid signature v value");const o=Uint8Array.from([...n]);return(r>BigInt(28)&&r%BIGINT_2===BIGINT_1||r===BIGINT_1||r===BigInt(28))&&(o[0]|=128),bytesToHex(concatBytes(setLengthLeft(e,32),setLengthLeft(o,32)))},MVe=function(r){const e=toBytes(r);let n,i,s;if(e.length>=65)n=e.subarray(0,32),i=e.subarray(32,64),s=bytesToBigInt(e.subarray(64));else if(e.length===64)n=e.subarray(0,32),i=e.subarray(32,64),s=BigInt(bytesToInt(e.subarray(32,33))>>7),i[0]&=127;else throw new Error("Invalid signature length");return s<27&&(s=s+BIGINT_27),{v:s,r:n,s:i}},LVe=function(r,e,n,i=!0,s){if(e.length!==32||n.length!==32||!a3(nw(r,s)))return!1;const o=bytesToBigInt(e),a=bytesToBigInt(n);return!(o===BIGINT_0||o>=SECP256K1_ORDER||a===BIGINT_0||a>=SECP256K1_ORDER||i&&a>=SECP256K1_ORDER_DIV_2)},DVe=function(r){assertIsBytes(r);const e=utf8ToBytes(`Ethereum Signed Message:
|
||
${r.length}`);return keccak256(concatBytes(e,r))};var UVe=tn(80381);async function Zle(r,e,n){let i;for await(const s of e)try{s.length<2?s.call(r,n):await new Promise((o,a)=>{s.call(r,n,u=>{u?a(u):o()})})}catch(o){i=o}if(i)throw i}class FVe extends null{emit(e,...n){let[i,s]=n;const o=this;let a=o._events[e]??[];return s===void 0&&typeof i=="function"&&(s=i,i=void 0),(e==="newListener"||e==="removeListener")&&(i={event:i,fn:s},s=void 0),a=Array.isArray(a)?a:[a],Zle(o,a.slice(),i).then(s).catch(s),o.listenerCount(e)>0}once(e,n){const i=this;let s;if(typeof n!="function")throw new TypeError("listener must be a function");return n.length>=2?s=function(o,a){i.removeListener(e,s),n(o,a)}:s=function(o){i.removeListener(e,s),n(o,s)},i.on(e,s),i}first(e,n){let i=this._events[e]??[];if(typeof n!="function")throw new TypeError("listener must be a function");return Array.isArray(i)||(this._events[e]=i=[i]),i.unshift(n),this}before(e,n,i){return this.beforeOrAfter(e,n,i)}after(e,n,i){return this.beforeOrAfter(e,n,i,"after")}beforeOrAfter(e,n,i,s){let o=this._events[e]??[],a,u;const l=s==="after"?1:0;if(typeof i!="function")throw new TypeError("listener must be a function");if(typeof n!="function")throw new TypeError("target must be a function");for(Array.isArray(o)||(this._events[e]=o=[o]),u=o.length,a=o.length;a--;)if(o[a]===n){u=a+l;break}return o.splice(u,0,i),this}on(e,n){return super.on(e,n)}addListener(e,n){return super.addListener(e,n)}prependListener(e,n){return super.prependListener(e,n)}prependOnceListener(e,n){return super.prependOnceListener(e,n)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,n){return super.removeListener(e,n)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}const WVe=hb(QA),HVe=32,Yle=4096,u3=null,zVe=2,Xle=null,Jle=null;function Qle(r,e){const n=new Uint8Array(e*u3).fill(0);return n.set(r),n[r.byteLength]=128,n}function efe(r){const e=new Uint8Array(Jle);for(let n=0;n<Yle;n++){const i=new Uint8Array(32);i.set(r.subarray(n*31,(n+1)*31),0),e.set(i,n*32)}return e}const $Ve=r=>{const e=utf8ToBytes(r),n=e.byteLength;if(n===0)throw Error("invalid blob data");if(n>Xle)throw Error("blob data is too large");const i=Math.ceil(n/u3),s=Qle(e,i),o=[];for(let a=0;a<i;a++){const u=s.subarray(a*u3,(a+1)*u3),l=efe(u);o.push(l)}return o},VVe=(r,e)=>{const n=[];for(const i of e)n.push(r.blobToKzgCommitment(i));return n},jVe=(r,e,n)=>e.map((s,o)=>r.computeBlobKzgProof(s,n[o])),tfe=(r,e)=>{const n=new Uint8Array(32);return n.set([e],0),n.set(sha256(r).subarray(1),1),n},KVe=r=>{const e=[];for(const n of r)e.push(tfe(n,1));return e};function GVe(r){const e={};for(const n of Object.keys(r.alloc)){let{balance:i,code:s,storage:o,nonce:a}=r.alloc[n];const u=addHexPrefix(n.toLowerCase());i=isHexString(i)?i:bigIntToHex(BigInt(i)),s=s!==void 0?addHexPrefix(s):void 0,o=o!==void 0?Object.entries(o):void 0,a=a!==void 0?addHexPrefix(a):void 0,e[u]=[i,s,o,a]}return e}class Lz{constructor(e){this._database=e??new Map}async get(e){const n=e instanceof Uint8Array?bytesToUnprefixedHex(e):e.toString();return this._database.get(n)}async put(e,n){const i=e instanceof Uint8Array?bytesToUnprefixedHex(e):e.toString();this._database.set(i,n)}async del(e){const n=e instanceof Uint8Array?bytesToUnprefixedHex(e):e.toString();this._database.delete(n)}async batch(e){for(const n of e)n.type==="del"&&await this.del(n.key),n.type==="put"&&await this.put(n.key,n.value)}shallowCopy(){return new Lz(this._database)}open(){return Promise.resolve()}}var jg;(function(r){r[r.Deposit=0]="Deposit",r[r.Withdrawal=1]="Withdrawal",r[r.Consolidation=2]="Consolidation"})(jg||(jg={}));class H5{constructor(e){this.type=e}}class z5 extends H5{constructor(e,n,i,s,o){super(jg.Deposit),this.pubkey=e,this.withdrawalCredentials=n,this.amount=i,this.signature=s,this.index=o}static fromRequestData(e){const{pubkey:n,withdrawalCredentials:i,amount:s,signature:o,index:a}=e;return new z5(n,i,s,o,a)}static fromJSON(e){const{pubkey:n,withdrawalCredentials:i,amount:s,signature:o,index:a}=e;return this.fromRequestData({pubkey:Du(n),withdrawalCredentials:Du(i),amount:Ri(s),signature:Du(o),index:Ri(a)})}serialize(){const e=this.index===e3?new Uint8Array:$g(this.index),n=this.amount===e3?new Uint8Array:$g(this.amount);return ub(Uint8Array.from([this.type]),tw.encode([this.pubkey,this.withdrawalCredentials,n,this.signature,e]))}toJSON(){return{pubkey:Ca(this.pubkey),withdrawalCredentials:Ca(this.withdrawalCredentials),amount:ne(this.amount),signature:Ca(this.signature),index:ne(this.index)}}static deserialize(e){const[n,i,s,o,a]=tw.decode(e.slice(1));return this.fromRequestData({pubkey:n,withdrawalCredentials:i,amount:jh(s),signature:o,index:jh(a)})}}class $5 extends H5{constructor(e,n,i){super(jg.Withdrawal),this.sourceAddress=e,this.validatorPubkey=n,this.amount=i}static fromRequestData(e){const{sourceAddress:n,validatorPubkey:i,amount:s}=e;return new $5(n,i,s)}static fromJSON(e){const{sourceAddress:n,validatorPubkey:i,amount:s}=e;return this.fromRequestData({sourceAddress:Du(n),validatorPubkey:Du(i),amount:Ri(s)})}serialize(){const e=this.amount===e3?new Uint8Array:$g(this.amount);return ub(Uint8Array.from([this.type]),tw.encode([this.sourceAddress,this.validatorPubkey,e]))}toJSON(){return{sourceAddress:Ca(this.sourceAddress),validatorPubkey:Ca(this.validatorPubkey),amount:ne(this.amount)}}static deserialize(e){const[n,i,s]=tw.decode(e.slice(1));return this.fromRequestData({sourceAddress:n,validatorPubkey:i,amount:jh(s)})}}class V5 extends H5{constructor(e,n,i){super(jg.Consolidation),this.sourceAddress=e,this.sourcePubkey=n,this.targetPubkey=i}static fromRequestData(e){const{sourceAddress:n,sourcePubkey:i,targetPubkey:s}=e;return new V5(n,i,s)}static fromJSON(e){const{sourceAddress:n,sourcePubkey:i,targetPubkey:s}=e;return this.fromRequestData({sourceAddress:Du(n),sourcePubkey:Du(i),targetPubkey:Du(s)})}serialize(){return ub(Uint8Array.from([this.type]),tw.encode([this.sourceAddress,this.sourcePubkey,this.targetPubkey]))}toJSON(){return{sourceAddress:Ca(this.sourceAddress),sourcePubkey:Ca(this.sourcePubkey),targetPubkey:Ca(this.targetPubkey)}}static deserialize(e){const[n,i,s]=tw.decode(e.slice(1));return this.fromRequestData({sourceAddress:n,sourcePubkey:i,targetPubkey:s})}}class qVe{static fromSerializedRequest(e){switch(e[0]){case jg.Deposit:return z5.deserialize(e);case jg.Withdrawal:return $5.deserialize(e);case jg.Consolidation:return V5.deserialize(e);default:throw Error(`Invalid request type=${e[0]}`)}}}function Dz(r,e,n=0){const i=setLengthLeft(e.toBytes(),32);let s;return typeof n=="number"?s=setLengthRight(int32ToBytes(Number(n),!0),32):s=setLengthRight(bigIntToBytes(BigInt(n),!0).slice(0,32),32),r.getTreeKey(i,s,0).slice(0,31)}function ZVe(r,e,n){return r.verifyExecutionWitnessPreState(bytesToHex(e),JSON.stringify(n))}var zf;(function(r){r[r.Version=0]="Version",r[r.Balance=1]="Balance",r[r.Nonce=2]="Nonce",r[r.CodeHash=3]="CodeHash",r[r.CodeSize=4]="CodeSize"})(zf||(zf={}));const rfe=fp(zf.Version),nfe=fp(zf.Balance),ife=fp(zf.Nonce),sfe=fp(zf.CodeHash),ofe=fp(zf.CodeSize),Uz=64,j5=128,c3=256,afe=BigInt(256)**BigInt(31),YVe=(r,e)=>{switch(e){case zf.Version:return concatBytes(r,rfe);case zf.Balance:return concatBytes(r,nfe);case zf.Nonce:return concatBytes(r,ife);case zf.CodeHash:return concatBytes(r,sfe);case zf.CodeSize:return concatBytes(r,ofe);default:return concatBytes(r,e)}};function ufe(r){let e;r<j5-Uz?e=BigInt(Uz)+r:e=afe+r;const n=e/BigInt(c3),i=Number(e%BigInt(c3));return{treeIndex:n,subIndex:i}}function cfe(r){const e=Math.floor((j5+r)/c3),n=(j5+r)%c3;return{treeIndex:e,subIndex:n}}const XVe=async(r,e,n)=>{const{treeIndex:i,subIndex:s}=cfe(e);return concatBytes(Dz(n,r,i),toBytes(s))},JVe=r=>{if(r.length%31!==0){const e=31-r.length%31;r=setLengthRight(r,r.length+e)}throw new Error("Not implemented")},QVe=async(r,e,n)=>{const{treeIndex:i,subIndex:s}=ufe(e);return concatBytes(Dz(n,r,i),toBytes(s))};var S_=tn(68601);function lfe(r){return typeof r?.prototype?.constructor?.name=="string"}function ffe(r){return getErrorMessage(r).replace(/\.$/u,"")}function Fz(r,e){return lfe(r)?new r({message:e}):r({message:e})}class Wz extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}function K5(r,e="Assertion failed.",n=Wz){if(!r)throw e instanceof Error?e:Fz(n,e)}function eje(r,e,n="Assertion failed",i=Wz){try{assertSuperstruct(r,e)}catch(s){throw Fz(i,`${n}: ${ffe(s)}.`)}}function tje(r){throw new Error("Invalid branch reached. Should be detected during compilation.")}const dfe=wv(Mf(),/^(?:0x)?[0-9a-f]+$/iu),hfe=wv(Mf(),/^0x[0-9a-f]+$/iu),pfe=wv(Mf(),/^0x[0-9a-f]{40}$/u),Hz=wv(Mf(),/^0x[0-9a-fA-F]{40}$/u);function gfe(r){return G0(r,dfe)}function yfe(r){return is(r,hfe)}function mfe(r){K5(gfe(r),"Value must be a hexadecimal string.")}function rje(r){assert(yfe(r),'Value must be a hexadecimal string, starting with "0x".')}function nje(r){return is(r,pfe)||vfe(r)}function bfe(r){assert(is(r,Hz),"Invalid hex address.");const e=ys(r.toLowerCase()),n=ys(bytesToHex(keccak256(e)));return`0x${e.split("").map((i,s)=>{const o=n[s];return assert(is(o,string()),"Hash shorter than address."),parseInt(o,16)>7?i.toUpperCase():i}).join("")}`}function vfe(r){return is(r,Hz)?bfe(r)===r:!1}function du(r){return r.startsWith("0x")?r:r.startsWith("0X")?`0x${r.substring(2)}`:`0x${r}`}function ys(r){return r.startsWith("0x")||r.startsWith("0X")?r.substring(2):r}/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const zz={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,h:1n,a:0n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},{p:Kg,n:jd,Gx:wfe,Gy:Afe,b:$z}=zz,xa=32,pb=64,I_={publicKey:xa+1,publicKeyUncompressed:pb+1,signature:pb,seed:xa+xa/2},_fe=(...r)=>{"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...r)},yo=(r="")=>{const e=new Error(r);throw _fe(e,yo),e},Efe=r=>typeof r=="bigint",Tfe=r=>typeof r=="string",Sfe=r=>r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array",Fc=(r,e,n="")=>{const i=Sfe(r),s=r?.length,o=e!==void 0;if(!i||o&&s!==e){const a=n&&`"${n}" `,u=o?` of length ${e}`:"",l=i?`length=${s}`:`type=${typeof r}`;yo(a+"expected Uint8Array"+u+", got "+l)}return r},Gg=r=>new Uint8Array(r),Vz=(r,e)=>r.toString(16).padStart(e,"0"),jz=r=>Array.from(Fc(r)).map(e=>Vz(e,2)).join(""),dp={_0:48,_9:57,A:65,F:70,a:97,f:102},Kz=r=>{if(r>=dp._0&&r<=dp._9)return r-dp._0;if(r>=dp.A&&r<=dp.F)return r-(dp.A-10);if(r>=dp.a&&r<=dp.f)return r-(dp.a-10)},Gz=r=>{const e="hex invalid";if(!Tfe(r))return yo(e);const n=r.length,i=n/2;if(n%2)return yo(e);const s=Gg(i);for(let o=0,a=0;o<i;o++,a+=2){const u=Kz(r.charCodeAt(a)),l=Kz(r.charCodeAt(a+1));if(u===void 0||l===void 0)return yo(e);s[o]=u*16+l}return s},qz=()=>globalThis?.crypto,ije=()=>qz()?.subtle??yo("crypto.subtle must be defined, consider polyfill"),$f=(...r)=>{const e=Gg(r.reduce((i,s)=>i+Fc(s).length,0));let n=0;return r.forEach(i=>{e.set(i,n),n+=i.length}),e},l3=(r=xa)=>qz().getRandomValues(Gg(r)),iw=BigInt,gb=(r,e,n,i="bad number: out of range")=>Efe(r)&&e<=r&&r<n?r:yo(i),Ai=(r,e=Kg)=>{const n=r%e;return n>=0n?n:e+n},Al=r=>Ai(r,jd),f3=(r,e)=>{(r===0n||e<=0n)&&yo("no inverse n="+r+" mod="+e);let n=Ai(r,e),i=e,s=0n,o=1n,a=1n,u=0n;for(;n!==0n;){const l=i/n,g=i%n,y=s-a*l,A=o-u*l;i=n,n=g,s=a,o=u,a=y,u=A}return i===1n?Ai(s,e):yo("no inverse")},d3=r=>{const e=g3[r];return typeof e!="function"&&yo("hashes."+r+" not set"),e},sje=r=>d3("sha256")(r),G5=r=>r instanceof hu?r:yo("Point expected"),Zz=r=>Ai(Ai(r*r)*r+$z),Yz=r=>gb(r,0n,Kg),k_=r=>gb(r,1n,Kg),q5=r=>gb(r,1n,jd),sw=r=>(r&1n)===0n,h3=r=>Uint8Array.of(r),Xz=r=>h3(sw(r)?2:3),Jz=r=>{const e=Zz(k_(r));let n=1n;for(let i=e,s=(Kg+1n)/4n;s>0n;s>>=1n)s&1n&&(n=n*i%Kg),i=i*i%Kg;return Ai(n*n)===e?n:yo("sqrt invalid")};class hu{static BASE;static ZERO;X;Y;Z;constructor(e,n,i){this.X=Yz(e),this.Y=k_(n),this.Z=Yz(i),Object.freeze(this)}static CURVE(){return zz}static fromAffine(e){const{x:n,y:i}=e;return n===0n&&i===0n?yb:new hu(n,i,1n)}static fromBytes(e){Fc(e);const{publicKey:n,publicKeyUncompressed:i}=I_;let s;const o=e.length,a=e[0],u=e.subarray(1),l=ow(u,0,xa);if(o===n&&(a===2||a===3)){let g=Jz(l);const y=sw(g);sw(iw(a))!==y&&(g=Ai(-g)),s=new hu(l,g,1n)}return o===i&&a===4&&(s=new hu(l,ow(u,xa,pb),1n)),s?s.assertValidity():yo("bad point: not on curve")}static fromHex(e){return hu.fromBytes(Gz(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(e){const{X:n,Y:i,Z:s}=this,{X:o,Y:a,Z:u}=G5(e),l=Ai(n*u),g=Ai(o*s),y=Ai(i*u),A=Ai(a*s);return l===g&&y===A}is0(){return this.equals(yb)}negate(){return new hu(this.X,Ai(-this.Y),this.Z)}double(){return this.add(this)}add(e){const{X:n,Y:i,Z:s}=this,{X:o,Y:a,Z:u}=G5(e),l=0n,g=$z;let y=0n,A=0n,I=0n;const P=Ai(g*3n);let D=Ai(n*o),U=Ai(i*a),V=Ai(s*u),J=Ai(n+i),re=Ai(o+a);J=Ai(J*re),re=Ai(D+U),J=Ai(J-re),re=Ai(n+s);let ce=Ai(o+u);return re=Ai(re*ce),ce=Ai(D+V),re=Ai(re-ce),ce=Ai(i+s),y=Ai(a+u),ce=Ai(ce*y),y=Ai(U+V),ce=Ai(ce-y),I=Ai(l*re),y=Ai(P*V),I=Ai(y+I),y=Ai(U-I),I=Ai(U+I),A=Ai(y*I),U=Ai(D+D),U=Ai(U+D),V=Ai(l*V),re=Ai(P*re),U=Ai(U+V),V=Ai(D-V),V=Ai(l*V),re=Ai(re+V),D=Ai(U*re),A=Ai(A+D),D=Ai(ce*re),y=Ai(J*y),y=Ai(y-D),D=Ai(J*U),I=Ai(ce*I),I=Ai(I+D),new hu(y,A,I)}subtract(e){return this.add(G5(e).negate())}multiply(e,n=!0){if(!n&&e===0n)return yb;if(q5(e),e===1n)return this;if(this.equals(hp))return Dfe(e).p;let i=yb,s=hp;for(let o=this;e>0n;o=o.double(),e>>=1n)e&1n?i=i.add(o):n&&(s=s.add(o));return i}multiplyUnsafe(e){return this.multiply(e,!1)}toAffine(){const{X:e,Y:n,Z:i}=this;if(this.equals(yb))return{x:0n,y:0n};if(i===1n)return{x:e,y:n};const s=f3(i,Kg);return Ai(i*s)!==1n&&yo("inverse invalid"),{x:Ai(e*s),y:Ai(n*s)}}assertValidity(){const{x:e,y:n}=this.toAffine();return k_(e),k_(n),Ai(n*n)===Zz(e)?this:yo("bad point: not on curve")}toBytes(e=!0){const{x:n,y:i}=this.assertValidity().toAffine(),s=_l(n);return e?$f(Xz(i),s):$f(h3(4),s,_l(i))}toHex(e){return jz(this.toBytes(e))}}const hp=new hu(wfe,Afe,1n),yb=new hu(0n,1n,0n);hu.BASE=hp,hu.ZERO=yb;const Z5=(r,e,n)=>hp.multiply(e,!1).add(r.multiply(n,!1)).assertValidity(),qg=r=>iw("0x"+(jz(r)||"0")),ow=(r,e,n)=>qg(r.subarray(e,n)),Ife=2n**256n,_l=r=>Gz(Vz(gb(r,0n,Ife),pb)),R_=r=>{const e=qg(Fc(r,xa,"secret key"));return gb(e,1n,jd,"invalid secret key: outside of range")},Y5=r=>r>jd>>1n,kfe=(r,e=!0)=>hp.multiply(R_(r)).toBytes(e),oje=r=>{try{return!!R_(r)}catch{return!1}},aje=(r,e)=>{const{publicKey:n,publicKeyUncompressed:i}=I_;try{const s=r.length;return e===!0&&s!==n||e===!1&&s!==i?!1:!!hu.fromBytes(r)}catch{return!1}},Qz=r=>{[0,1,2,3].includes(r)||yo("recovery id must be valid and present")},Rfe=r=>{r!=null&&!r$.includes(r)&&yo(`Signature format must be one of: ${r$.join(", ")}`),r===Cfe&&yo('Signature format "der" is not supported: switch to noble-curves')},e$=(r,e=p3)=>{Rfe(e);const n=I_.signature,i=n+1;let s=`Signature format "${e}" expects Uint8Array with length `;e===p3&&r.length!==n&&yo(s+n),e===J5&&r.length!==i&&yo(s+i)};class mb{r;s;recovery;constructor(e,n,i){this.r=q5(e),this.s=q5(n),i!=null&&(this.recovery=i),Object.freeze(this)}static fromBytes(e,n=p3){e$(e,n);let i;n===J5&&(i=e[0],e=e.subarray(1));const s=ow(e,0,xa),o=ow(e,xa,pb);return new mb(s,o,i)}addRecoveryBit(e){return new mb(this.r,this.s,e)}hasHighS(){return Y5(this.s)}toBytes(e=p3){const{r:n,s:i,recovery:s}=this,o=$f(_l(n),_l(i));return e===J5?(Qz(s),$f(Uint8Array.of(s),o)):o}}const t$=r=>{const e=r.length*8-256;e>1024&&yo("msg invalid");const n=qg(r);return e>0?n>>iw(e):n},X5=r=>Al(t$(Fc(r))),p3="compact",J5="recovered",Cfe="der",r$=null,n$=null,uje="SHA-256",g3=null,aw=(r,e,n)=>(Fc(r,void 0,"message"),e.prehash?n?g3.sha256Async(r):d3("sha256")(r):r),i$=Gg(0),s$=h3(0),o$=h3(1),a$=1e3,u$="drbg: tried max amount of iterations",xfe=(r,e)=>{let n=Gg(xa),i=Gg(xa),s=0;const o=()=>{n.fill(1),i.fill(0)},a=(...y)=>d3("hmacSha256")(i,$f(n,...y)),u=(y=i$)=>{i=a(s$,y),n=a(),y.length!==0&&(i=a(o$,y),n=a())},l=()=>(s++>=a$&&yo(u$),n=a(),n);o(),u(r);let g;for(;!(g=e(l()));)u();return o(),g},Bfe=async(r,e)=>{let n=Gg(xa),i=Gg(xa),s=0;const o=()=>{n.fill(1),i.fill(0)},a=(...y)=>g3.hmacSha256Async(i,$f(n,...y)),u=async(y=i$)=>{i=await a(s$,y),n=await a(),y.length!==0&&(i=await a(o$,y),n=await a())},l=async()=>(s++>=a$&&yo(u$),n=await a(),n);o(),await u(r);let g;for(;!(g=e(await l()));)await u();return o(),g},c$=(r,e,n,i)=>{let{lowS:s,extraEntropy:o}=n;const a=_l,u=X5(r),l=a(u),g=R_(e),y=[a(g),l];if(o!=null&&o!==!1){const D=o===!0?l3(xa):o;y.push(Fc(D,void 0,"extraEntropy"))}const A=$f(...y),I=u;return i(A,D=>{const U=t$(D);if(!(1n<=U&&U<jd))return;const V=f3(U,jd),J=hp.multiply(U).toAffine(),re=Al(J.x);if(re===0n)return;const ce=Al(V*Al(I+re*g));if(ce===0n)return;let Re=(J.x===re?0:2)|Number(J.y&1n),De=ce;return s&&Y5(ce)&&(De=Al(-ce),Re^=1),new mb(re,De,Re).toBytes(n.format)})},l$=(r,e,n,i={})=>{const{lowS:s,format:o}=i;r instanceof mb&&yo("Signature must be in Uint8Array, use .toBytes()"),e$(r,o),Fc(n,void 0,"publicKey");try{const{r:a,s:u}=mb.fromBytes(r,o),l=X5(e),g=hu.fromBytes(n);if(s&&Y5(u))return!1;const y=f3(u,jd),A=Al(l*y),I=Al(a*y),P=Z5(g,A,I).toAffine();return Al(P.x)===a}catch{return!1}},uw=r=>{const e={};return Object.keys(n$).forEach(n=>{e[n]=r[n]??n$[n]}),e},cje=(r,e,n={})=>(n=uw(n),r=aw(r,n,!1),c$(r,e,n,xfe)),lje=async(r,e,n={})=>(n=uw(n),r=await aw(r,n,!0),c$(r,e,n,Bfe)),fje=(r,e,n,i={})=>(i=uw(i),e=aw(e,i,!1),l$(r,e,n,i)),dje=async(r,e,n,i={})=>(i=uw(i),e=await aw(e,i,!0),l$(r,e,n,i)),f$=(r,e)=>{const n=mb.fromBytes(r,"recovered"),{r:i,s,recovery:o}=n;Qz(o);const a=X5(Fc(e,xa)),u=o===2||o===3?i+jd:i;k_(u);const l=Xz(iw(o)),g=$f(l,_l(u)),y=hu.fromBytes(g),A=f3(u,jd),I=Al(-a*A),P=Al(s*A);return Z5(y,I,P).toBytes()},hje=(r,e,n={})=>(e=aw(e,uw(n),!1),f$(r,e)),pje=async(r,e,n={})=>(e=await aw(e,uw(n),!0),f$(r,e)),gje=(r,e,n=!0)=>hu.fromBytes(e).multiply(R_(r)).toBytes(n),Ofe=(r=l3(I_.seed))=>{Fc(r),(r.length<I_.seed||r.length>1024)&&yo("expected 40-1024b");const e=Ai(qg(r),jd-1n);return _l(e+1n)},d$=r=>e=>{const n=Ofe(e);return{secretKey:n,publicKey:r(n)}},yje=d$(kfe),mje=null,bje=null,h$=r=>Uint8Array.from("BIP0340/"+r,e=>e.charCodeAt(0)),p$="aux",g$="nonce",y$="challenge",Q5=(r,...e)=>{const n=d3("sha256"),i=n(h$(r));return n($f(i,i,...e))},eB=async(r,...e)=>{const n=g3.sha256Async,i=await n(h$(r));return await n($f(i,i,...e))},tB=r=>{const e=R_(r),n=hp.multiply(e),{x:i,y:s}=n.assertValidity().toAffine(),o=sw(s)?e:Al(-e),a=_l(i);return{d:o,px:a}},rB=r=>Al(qg(r)),m$=(...r)=>rB(Q5(y$,...r)),b$=async(...r)=>rB(await eB(y$,...r)),wje=d$(r=>tB(r).px),v$=(r,e,n)=>{const{px:i,d:s}=tB(e);return{m:Fc(r),px:i,d:s,a:Fc(n,xa)}},w$=r=>{const e=rB(r);e===0n&&yo("sign failed: k is zero");const{px:n,d:i}=tB(_l(e));return{rx:n,k:i}},A$=(r,e,n,i)=>$f(e,_l(Al(r+n*i))),_$="invalid signature produced",Aje=(r,e,n=l3(xa))=>{const{m:i,px:s,d:o,a}=v$(r,e,n),u=Q5(p$,a),l=_l(o^qg(u)),g=Q5(g$,l,s,i),{rx:y,k:A}=w$(g),I=m$(y,s,i),P=A$(A,y,I,o);return Nfe(P,i,s)||yo(_$),P},_je=async(r,e,n=l3(xa))=>{const{m:i,px:s,d:o,a}=v$(r,e,n),u=await eB(p$,a),l=_l(o^qg(u)),g=await eB(g$,l,s,i),{rx:y,k:A}=w$(g),I=await b$(y,s,i),P=A$(A,y,I,o);return await Mfe(P,i,s)||yo(_$),P},Pfe=(r,e)=>r instanceof Promise?r.then(e):e(r),E$=(r,e,n,i)=>{const s=Fc(r,pb,"signature"),o=Fc(e,void 0,"message"),a=Fc(n,xa,"publicKey");try{const u=qg(a),l=Jz(u),g=sw(l)?l:Ai(-l),y=new hu(u,g,1n).assertValidity(),A=_l(y.toAffine().x),I=ow(s,0,xa);gb(I,1n,Kg);const P=ow(s,xa,pb);gb(P,1n,jd);const D=$f(_l(I),A,o);return Pfe(i(D),U=>{const{x:V,y:J}=Z5(y,P,Al(-U)).toAffine();return!(!sw(J)||V!==I)})}catch{return!1}},Nfe=(r,e,n)=>E$(r,e,n,m$),Mfe=async(r,e,n)=>E$(r,e,n,b$),Eje=null,y3=8,T$=Math.ceil(256/y3)+1,nB=2**(y3-1),Lfe=()=>{const r=[];let e=hp,n=e;for(let i=0;i<T$;i++){n=e,r.push(n);for(let s=1;s<nB;s++)n=n.add(e),r.push(n);e=n.double()}return r};let S$;const I$=(r,e)=>{const n=e.negate();return r?n:e},Dfe=r=>{const e=S$||(S$=Lfe());let n=yb,i=hp;const s=2**y3,o=s,a=iw(s-1),u=iw(y3);for(let l=0;l<T$;l++){let g=Number(r&a);r>>=u,g>nB&&(g-=o,r+=1n);const y=l*nB,A=y,I=y+Math.abs(g)-1,P=l%2!==0,D=g<0;g===0?i=i.add(I$(P,e[A])):n=n.add(I$(D,e[I]))}return r!==0n&&yo("invalid wnaf"),{p:n,f:i}};var cw=tn(36533).Buffer,Zg=new WeakMap,m3=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,Zg,{writable:!0,value:void 0}),(0,H.isString)(n)?he(this,Zg,r.decodePK(n)):he(this,Zg,n)}var e=r.prototype;return e.signMessage=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return u=du(i),l=o3(bl(u),X(o,Zg)),g=(0,S_.concatSig)(cw.from(bl(l.v)),cw.from(l.r),cw.from(l.s)),A.abrupt("return",g);case 4:case"end":return A.stop()}},a)}))()},e.exportPrivateKey=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",Ca(X(i,Zg)));case 1:case"end":return a.stop()}},s)}))()},e.signTransaction=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return u=du(i),l=o3(bl(u),X(o,Zg)),g=(0,S_.concatSig)(cw.from(bl(l.v)),cw.from(l.r),cw.from(l.s)),y=nw(l.v),A=g.slice(0,g.length-2)+"0"+String(y),P.abrupt("return",A);case 6:case"end":return P.stop()}},a)}))()},e.getAddress=function(){var i=Ca(Oz(X(this,Zg)));return du(i).toLowerCase()},e.getPublicKeyHex=function(){var i=df.ProjectivePoint.fromPrivateKey(X(this,Zg)).toRawBytes(!0),s=Ca(i);return ys(s)},r.isValidPk=function(i){var s=ys(i);if(s.length!==64)return!1;try{var o=Ca(Oz(this.decodePK(i)));return ys(o).length===40}catch{return!1}},r.decodePK=function(i){return Du(du(i))},r}(),Ufe=function(r){var e=hu.fromHex(r),n=e.toHex(!1);return ys(n)},Ui=tn(36533);const[Ffe,Wfe]=as.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),Yg=new Uint32Array(80),Xg=new Uint32Array(80);class b3 extends II{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:i,Bl:s,Ch:o,Cl:a,Dh:u,Dl:l,Eh:g,El:y,Fh:A,Fl:I,Gh:P,Gl:D,Hh:U,Hl:V}=this;return[e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V]}set(e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V){this.Ah=e|0,this.Al=n|0,this.Bh=i|0,this.Bl=s|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=g|0,this.El=y|0,this.Fh=A|0,this.Fl=I|0,this.Gh=P|0,this.Gl=D|0,this.Hh=U|0,this.Hl=V|0}process(e,n){for(let ce=0;ce<16;ce++,n+=4)Yg[ce]=e.getUint32(n),Xg[ce]=e.getUint32(n+=4);for(let ce=16;ce<80;ce++){const Re=Yg[ce-15]|0,De=Xg[ce-15]|0,Ue=as.rotrSH(Re,De,1)^as.rotrSH(Re,De,8)^as.shrSH(Re,De,7),Ve=as.rotrSL(Re,De,1)^as.rotrSL(Re,De,8)^as.shrSL(Re,De,7),pe=Yg[ce-2]|0,Se=Xg[ce-2]|0,Ce=as.rotrSH(pe,Se,19)^as.rotrBH(pe,Se,61)^as.shrSH(pe,Se,6),je=as.rotrSL(pe,Se,19)^as.rotrBL(pe,Se,61)^as.shrSL(pe,Se,6),$e=as.add4L(Ve,je,Xg[ce-7],Xg[ce-16]),Qe=as.add4H($e,Ue,Ce,Yg[ce-7],Yg[ce-16]);Yg[ce]=Qe|0,Xg[ce]=$e|0}let{Ah:i,Al:s,Bh:o,Bl:a,Ch:u,Cl:l,Dh:g,Dl:y,Eh:A,El:I,Fh:P,Fl:D,Gh:U,Gl:V,Hh:J,Hl:re}=this;for(let ce=0;ce<80;ce++){const Re=as.rotrSH(A,I,14)^as.rotrSH(A,I,18)^as.rotrBH(A,I,41),De=as.rotrSL(A,I,14)^as.rotrSL(A,I,18)^as.rotrBL(A,I,41),Ue=A&P^~A&U,Ve=I&D^~I&V,pe=as.add5L(re,De,Ve,Wfe[ce],Xg[ce]),Se=as.add5H(pe,J,Re,Ue,Ffe[ce],Yg[ce]),Ce=pe|0,je=as.rotrSH(i,s,28)^as.rotrBH(i,s,34)^as.rotrBH(i,s,39),$e=as.rotrSL(i,s,28)^as.rotrBL(i,s,34)^as.rotrBL(i,s,39),Qe=i&o^i&u^o&u,nt=s&a^s&l^a&l;J=U|0,re=V|0,U=P|0,V=D|0,P=A|0,D=I|0,{h:A,l:I}=as.add(g|0,y|0,Se|0,Ce|0),g=u|0,y=l|0,u=o|0,l=a|0,o=i|0,a=s|0;const Ne=as.add3L(Ce,$e,nt);i=as.add3H(Ne,Se,je,Qe),s=Ne|0}({h:i,l:s}=as.add(this.Ah|0,this.Al|0,i|0,s|0)),{h:o,l:a}=as.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=as.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:g,l:y}=as.add(this.Dh|0,this.Dl|0,g|0,y|0),{h:A,l:I}=as.add(this.Eh|0,this.El|0,A|0,I|0),{h:P,l:D}=as.add(this.Fh|0,this.Fl|0,P|0,D|0),{h:U,l:V}=as.add(this.Gh|0,this.Gl|0,U|0,V|0),{h:J,l:re}=as.add(this.Hh|0,this.Hl|0,J|0,re|0),this.set(i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re)}roundClean(){Yg.fill(0),Xg.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Sje extends b3{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class Ije extends b3{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class kje extends b3{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Hfe=XA(()=>new b3),Rje=null,Cje=null,xje=null;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const iB=BigInt(0),v3=BigInt(1),zfe=BigInt(2);function bb(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function C_(r){if(!bb(r))throw new Error("Uint8Array expected")}function pp(r,e){if(typeof e!="boolean")throw new Error(`${r} must be valid boolean, got "${e}".`)}const $fe=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function vb(r){C_(r);let e="";for(let n=0;n<r.length;n++)e+=$fe[r[n]];return e}function Vfe(r){const e=r.toString(16);return e.length&1?`0${e}`:e}function k$(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}const gp={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function R$(r){if(r>=gp._0&&r<=gp._9)return r-gp._0;if(r>=gp._A&&r<=gp._F)return r-(gp._A-10);if(r>=gp._a&&r<=gp._f)return r-(gp._a-10)}function lw(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=R$(r.charCodeAt(o)),u=R$(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}function wb(r){return k$(vb(r))}function fw(r){return C_(r),k$(vb(Uint8Array.from(r).reverse()))}function dw(r,e){return lw(r.toString(16).padStart(e*2,"0"))}function x_(r,e){return dw(r,e).reverse()}function Bje(r){return lw(Vfe(r))}function Qa(r,e,n){let i;if(typeof e=="string")try{i=lw(e)}catch(o){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${o}`)}else if(bb(e))i=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);const s=i.length;if(typeof n=="number"&&s!==n)throw new Error(`${r} expected ${n} bytes, got ${s}`);return i}function Ab(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];C_(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}function Oje(r,e){if(r.length!==e.length)return!1;let n=0;for(let i=0;i<r.length;i++)n|=r[i]^e[i];return n===0}function Pje(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}const sB=r=>typeof r=="bigint"&&iB<=r;function w3(r,e,n){return sB(r)&&sB(e)&&sB(n)&&e<=r&&r<n}function Vf(r,e,n,i){if(!w3(e,n,i))throw new Error(`expected valid ${r}: ${n} <= n < ${i}, got ${typeof e} ${e}`)}function Nje(r){let e;for(e=0;r>iB;r>>=v3,e+=1);return e}function Mje(r,e){return r>>BigInt(e)&v3}function Lje(r,e,n){return r|(n?v3:iB)<<BigInt(e)}const oB=r=>(zfe<<BigInt(r-1))-v3,aB=r=>new Uint8Array(r),C$=r=>Uint8Array.from(r);function x$(r,e,n){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let i=aB(r),s=aB(r),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},u=(...A)=>n(s,i,...A),l=(A=aB())=>{s=u(C$([0]),A),i=u(),A.length!==0&&(s=u(C$([1]),A),i=u())},g=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let A=0;const I=[];for(;A<e;){i=u();const P=i.slice();I.push(P),A+=i.length}return Ab(...I)};return(A,I)=>{a(),l(A);let P;for(;!(P=I(g()));)l();return a(),P}}const jfe={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||bb(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function hw(r,e,n={}){const i=(s,o,a)=>{const u=jfe[o];if(typeof u!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=r[s];if(!(a&&l===void 0)&&!u(l,r))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(e))i(s,o,!1);for(const[s,o]of Object.entries(n))i(s,o,!0);return r}const Dje=()=>{throw new Error("not implemented")};function B_(r){const e=new WeakMap;return(n,...i)=>{const s=e.get(n);if(s!==void 0)return s;const o=r(n,...i);return e.set(n,o),o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const eu=BigInt(0),xo=BigInt(1),Jg=BigInt(2),Kfe=BigInt(3),uB=BigInt(4),B$=BigInt(5),O$=BigInt(8),Gfe=BigInt(9),qfe=BigInt(16);function $o(r,e){const n=r%e;return n>=eu?n:e+n}function Zfe(r,e,n){if(n<=eu||e<eu)throw new Error("Expected power/modulo > 0");if(n===xo)return eu;let i=xo;for(;e>eu;)e&xo&&(i=i*r%n),r=r*r%n,e>>=xo;return i}function Aa(r,e,n){let i=r;for(;e-- >eu;)i*=i,i%=n;return i}function A3(r,e){if(r===eu||e<=eu)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let n=$o(r,e),i=e,s=eu,o=xo,a=xo,u=eu;for(;n!==eu;){const g=i/n,y=i%n,A=s-a*g,I=o-u*g;i=n,n=y,s=a,o=u,a=A,u=I}if(i!==xo)throw new Error("invert: does not exist");return $o(s,e)}function Yfe(r){const e=(r-xo)/Jg;let n,i,s;for(n=r-xo,i=0;n%Jg===eu;n/=Jg,i++);for(s=Jg;s<r&&Zfe(s,e,r)!==r-xo;s++);if(i===1){const a=(r+xo)/uB;return function(l,g){const y=l.pow(g,a);if(!l.eql(l.sqr(y),g))throw new Error("Cannot find square root");return y}}const o=(n+xo)/Jg;return function(u,l){if(u.pow(l,e)===u.neg(u.ONE))throw new Error("Cannot find square root");let g=i,y=u.pow(u.mul(u.ONE,s),n),A=u.pow(l,o),I=u.pow(l,n);for(;!u.eql(I,u.ONE);){if(u.eql(I,u.ZERO))return u.ZERO;let P=1;for(let U=u.sqr(I);P<g&&!u.eql(U,u.ONE);P++)U=u.sqr(U);const D=u.pow(y,xo<<BigInt(g-P-1));y=u.sqr(D),A=u.mul(A,D),I=u.mul(I,y),g=P}return A}}function Xfe(r){if(r%uB===Kfe){const e=(r+xo)/uB;return function(i,s){const o=i.pow(s,e);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(r%O$===B$){const e=(r-B$)/O$;return function(i,s){const o=i.mul(s,Jg),a=i.pow(o,e),u=i.mul(s,a),l=i.mul(i.mul(u,Jg),a),g=i.mul(u,i.sub(l,i.ONE));if(!i.eql(i.sqr(g),s))throw new Error("Cannot find square root");return g}}return r%qfe,Yfe(r)}const Jfe=(r,e)=>($o(r,e)&xo)===xo,Qfe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ede(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Qfe.reduce((i,s)=>(i[s]="function",i),e);return hw(r,n)}function tde(r,e,n){if(n<eu)throw new Error("Expected power > 0");if(n===eu)return r.ONE;if(n===xo)return e;let i=r.ONE,s=e;for(;n>eu;)n&xo&&(i=r.mul(i,s)),s=r.sqr(s),n>>=xo;return i}function rde(r,e){const n=new Array(e.length),i=e.reduce((o,a,u)=>r.is0(a)?o:(n[u]=o,r.mul(o,a)),r.ONE),s=r.inv(i);return e.reduceRight((o,a,u)=>r.is0(a)?o:(n[u]=r.mul(o,n[u]),r.mul(o,a)),s),n}function Uje(r,e,n){return r.mul(e,typeof n=="bigint"?A3(n,r.ORDER):r.inv(n))}function nde(r){const e=(r-xo)/Jg;return(n,i)=>n.pow(i,e)}function Fje(r){const e=nde(r.ORDER);return n=>{const i=e(r,n);return r.eql(i,r.ZERO)||r.eql(i,r.ONE)}}function cB(r,e){const n=e!==void 0?e:r.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function P$(r,e,n=!1,i={}){if(r<=eu)throw new Error(`Expected Field ORDER > 0, got ${r}`);const{nBitLength:s,nByteLength:o}=cB(r,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=Xfe(r),u=Object.freeze({ORDER:r,BITS:s,BYTES:o,MASK:oB(s),ZERO:eu,ONE:xo,create:l=>$o(l,r),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return eu<=l&&l<r},is0:l=>l===eu,isOdd:l=>(l&xo)===xo,neg:l=>$o(-l,r),eql:(l,g)=>l===g,sqr:l=>$o(l*l,r),add:(l,g)=>$o(l+g,r),sub:(l,g)=>$o(l-g,r),mul:(l,g)=>$o(l*g,r),pow:(l,g)=>tde(u,l,g),div:(l,g)=>$o(l*A3(g,r),r),sqrN:l=>l*l,addN:(l,g)=>l+g,subN:(l,g)=>l-g,mulN:(l,g)=>l*g,inv:l=>A3(l,r),sqrt:i.sqrt||(l=>a(u,l)),invertBatch:l=>rde(u,l),cmov:(l,g,y)=>y?g:l,toBytes:l=>n?x_(l,o):dw(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?fw(l):wb(l)}});return Object.freeze(u)}function Wje(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?n:r.neg(n)}function Hje(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?r.neg(n):n}function zje(r,e,n=!1){r=ensureBytes("privateHash",r);const i=r.length,s=cB(e).nByteLength+8;if(s<24||i<s||i>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${i}`);const o=n?bytesToNumberLE(r):bytesToNumberBE(r);return $o(o,e-xo)+xo}function N$(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function M$(r){const e=N$(r);return e+Math.ceil(e/2)}function ide(r,e,n=!1){const i=r.length,s=N$(e),o=M$(e);if(i<16||i<o||i>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const a=n?wb(r):fw(r),u=$o(a,e-xo)+xo;return n?x_(u,s):dw(u,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const sde=BigInt(0),lB=BigInt(1),fB=new WeakMap,L$=new WeakMap;function D$(r,e){const n=(o,a)=>{const u=a.negate();return o?u:a},i=o=>{if(!Number.isSafeInteger(o)||o<=0||o>e)throw new Error(`Wrong window size=${o}, should be [1..${e}]`)},s=o=>{i(o);const a=Math.ceil(e/o)+1,u=2**(o-1);return{windows:a,windowSize:u}};return{constTimeNegate:n,unsafeLadder(o,a){let u=r.ZERO,l=o;for(;a>sde;)a&lB&&(u=u.add(l)),l=l.double(),a>>=lB;return u},precomputeWindow(o,a){const{windows:u,windowSize:l}=s(a),g=[];let y=o,A=y;for(let I=0;I<u;I++){A=y,g.push(A);for(let P=1;P<l;P++)A=A.add(y),g.push(A);y=A.double()}return g},wNAF(o,a,u){const{windows:l,windowSize:g}=s(o);let y=r.ZERO,A=r.BASE;const I=BigInt(2**o-1),P=2**o,D=BigInt(o);for(let U=0;U<l;U++){const V=U*g;let J=Number(u&I);u>>=D,J>g&&(J-=P,u+=lB);const re=V,ce=V+Math.abs(J)-1,Re=U%2!==0,De=J<0;J===0?A=A.add(n(Re,a[re])):y=y.add(n(De,a[ce]))}return{p:y,f:A}},wNAFCached(o,a,u){const l=L$.get(o)||1;let g=fB.get(o);return g||(g=this.precomputeWindow(o,l),l!==1&&fB.set(o,u(g))),this.wNAF(l,g,a)},setWindowSize(o,a){i(a),L$.set(o,a),fB.delete(o)}}}function dB(r){return ede(r.Fp),hw(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...cB(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Kd=BigInt(0),El=BigInt(1),_3=BigInt(2),ode=BigInt(8),ade={zip215:!0};function ude(r){const e=dB(r);return hw(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function cde(r){const e=ude(r),{Fp:n,n:i,prehash:s,hash:o,randomBytes:a,nByteLength:u,h:l}=e,g=_3<<BigInt(u*8)-El,y=n.create,A=e.uvRatio||((Ne,Me)=>{try{return{isValid:!0,value:n.sqrt(Ne*n.inv(Me))}}catch{return{isValid:!1,value:Kd}}}),I=e.adjustScalarBytes||(Ne=>Ne),P=e.domain||((Ne,Me,ct)=>{if(pp("phflag",ct),Me.length||ct)throw new Error("Contexts/pre-hash are not supported");return Ne});function D(Ne,Me){Vf("coordinate "+Ne,Me,Kd,g)}function U(Ne){if(!(Ne instanceof re))throw new Error("ExtendedPoint expected")}const V=B_((Ne,Me)=>{const{ex:ct,ey:mt,ez:Bt}=Ne,er=Ne.is0();Me==null&&(Me=er?ode:n.inv(Bt));const cr=y(ct*Me),pr=y(mt*Me),Dr=y(Bt*Me);if(er)return{x:Kd,y:El};if(Dr!==El)throw new Error("invZ was invalid");return{x:cr,y:pr}}),J=B_(Ne=>{const{a:Me,d:ct}=e;if(Ne.is0())throw new Error("bad point: ZERO");const{ex:mt,ey:Bt,ez:er,et:cr}=Ne,pr=y(mt*mt),Dr=y(Bt*Bt),Rr=y(er*er),Pr=y(Rr*Rr),on=y(pr*Me),xn=y(Rr*y(on+Dr)),Ar=y(Pr+y(ct*y(pr*Dr)));if(xn!==Ar)throw new Error("bad point: equation left != right (1)");const Xr=y(mt*Bt),Tn=y(er*cr);if(Xr!==Tn)throw new Error("bad point: equation left != right (2)");return!0});class re{constructor(Me,ct,mt,Bt){this.ex=Me,this.ey=ct,this.ez=mt,this.et=Bt,D("x",Me),D("y",ct),D("z",mt),D("t",Bt),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Me){if(Me instanceof re)throw new Error("extended point not allowed");const{x:ct,y:mt}=Me||{};return D("x",ct),D("y",mt),new re(ct,mt,El,y(ct*mt))}static normalizeZ(Me){const ct=n.invertBatch(Me.map(mt=>mt.ez));return Me.map((mt,Bt)=>mt.toAffine(ct[Bt])).map(re.fromAffine)}_setWindowSize(Me){De.setWindowSize(this,Me)}assertValidity(){J(this)}equals(Me){U(Me);const{ex:ct,ey:mt,ez:Bt}=this,{ex:er,ey:cr,ez:pr}=Me,Dr=y(ct*pr),Rr=y(er*Bt),Pr=y(mt*pr),on=y(cr*Bt);return Dr===Rr&&Pr===on}is0(){return this.equals(re.ZERO)}negate(){return new re(y(-this.ex),this.ey,this.ez,y(-this.et))}double(){const{a:Me}=e,{ex:ct,ey:mt,ez:Bt}=this,er=y(ct*ct),cr=y(mt*mt),pr=y(_3*y(Bt*Bt)),Dr=y(Me*er),Rr=ct+mt,Pr=y(y(Rr*Rr)-er-cr),on=Dr+cr,xn=on-pr,Ar=Dr-cr,Xr=y(Pr*xn),Tn=y(on*Ar),Bn=y(Pr*Ar),ni=y(xn*on);return new re(Xr,Tn,ni,Bn)}add(Me){U(Me);const{a:ct,d:mt}=e,{ex:Bt,ey:er,ez:cr,et:pr}=this,{ex:Dr,ey:Rr,ez:Pr,et:on}=Me;if(ct===BigInt(-1)){const Zo=y((er-Bt)*(Rr+Dr)),qa=y((er+Bt)*(Rr-Dr)),ya=y(qa-Zo);if(ya===Kd)return this.double();const Fa=y(cr*_3*on),Xu=y(pr*_3*Pr),_h=Xu+Fa,uA=qa+Zo,xs=Xu-Fa,Fn=y(_h*ya),lle=y(uA*xs),Pm=y(_h*xs),x$e=y(ya*uA);return new re(Fn,lle,x$e,Pm)}const xn=y(Bt*Dr),Ar=y(er*Rr),Xr=y(pr*mt*on),Tn=y(cr*Pr),Bn=y((Bt+er)*(Dr+Rr)-xn-Ar),ni=Tn-Xr,en=Tn+Xr,si=y(Ar-ct*xn),ei=y(Bn*ni),Ia=y(en*si),wi=y(Bn*si),ho=y(ni*en);return new re(ei,Ia,ho,wi)}subtract(Me){return this.add(Me.negate())}wNAF(Me){return De.wNAFCached(this,Me,re.normalizeZ)}multiply(Me){const ct=Me;Vf("scalar",ct,El,i);const{p:mt,f:Bt}=this.wNAF(ct);return re.normalizeZ([mt,Bt])[0]}multiplyUnsafe(Me){const ct=Me;return Vf("scalar",ct,Kd,i),ct===Kd?Re:this.equals(Re)||ct===El?this:this.equals(ce)?this.wNAF(ct).p:De.unsafeLadder(this,ct)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return De.unsafeLadder(this,i).is0()}toAffine(Me){return V(this,Me)}clearCofactor(){const{h:Me}=e;return Me===El?this:this.multiplyUnsafe(Me)}static fromHex(Me,ct=!1){const{d:mt,a:Bt}=e,er=n.BYTES;Me=Qa("pointHex",Me,er),pp("zip215",ct);const cr=Me.slice(),pr=Me[er-1];cr[er-1]=pr&-129;const Dr=fw(cr),Rr=ct?g:n.ORDER;Vf("pointHex.y",Dr,Kd,Rr);const Pr=y(Dr*Dr),on=y(Pr-El),xn=y(mt*Pr-Bt);let{isValid:Ar,value:Xr}=A(on,xn);if(!Ar)throw new Error("Point.fromHex: invalid y coordinate");const Tn=(Xr&El)===El,Bn=(pr&128)!==0;if(!ct&&Xr===Kd&&Bn)throw new Error("Point.fromHex: x=0 and x_0=1");return Bn!==Tn&&(Xr=y(-Xr)),re.fromAffine({x:Xr,y:Dr})}static fromPrivateKey(Me){return pe(Me).point}toRawBytes(){const{x:Me,y:ct}=this.toAffine(),mt=x_(ct,n.BYTES);return mt[mt.length-1]|=Me&El?128:0,mt}toHex(){return vb(this.toRawBytes())}}re.BASE=new re(e.Gx,e.Gy,El,y(e.Gx*e.Gy)),re.ZERO=new re(Kd,El,El,Kd);const{BASE:ce,ZERO:Re}=re,De=D$(re,u*8);function Ue(Ne){return $o(Ne,i)}function Ve(Ne){return Ue(fw(Ne))}function pe(Ne){const Me=u;Ne=Qa("private key",Ne,Me);const ct=Qa("hashed private key",o(Ne),2*Me),mt=I(ct.slice(0,Me)),Bt=ct.slice(Me,2*Me),er=Ve(mt),cr=ce.multiply(er),pr=cr.toRawBytes();return{head:mt,prefix:Bt,scalar:er,point:cr,pointBytes:pr}}function Se(Ne){return pe(Ne).pointBytes}function Ce(Ne=new Uint8Array,...Me){const ct=Ab(...Me);return Ve(o(P(ct,Qa("context",Ne),!!s)))}function je(Ne,Me,ct={}){Ne=Qa("message",Ne),s&&(Ne=s(Ne));const{prefix:mt,scalar:Bt,pointBytes:er}=pe(Me),cr=Ce(ct.context,mt,Ne),pr=ce.multiply(cr).toRawBytes(),Dr=Ce(ct.context,pr,er,Ne),Rr=Ue(cr+Dr*Bt);Vf("signature.s",Rr,Kd,i);const Pr=Ab(pr,x_(Rr,n.BYTES));return Qa("result",Pr,u*2)}const $e=ade;function Qe(Ne,Me,ct,mt=$e){const{context:Bt,zip215:er}=mt,cr=n.BYTES;Ne=Qa("signature",Ne,2*cr),Me=Qa("message",Me),er!==void 0&&pp("zip215",er),s&&(Me=s(Me));const pr=fw(Ne.slice(cr,2*cr));let Dr,Rr,Pr;try{Dr=re.fromHex(ct,er),Rr=re.fromHex(Ne.slice(0,cr),er),Pr=ce.multiplyUnsafe(pr)}catch{return!1}if(!er&&Dr.isSmallOrder())return!1;const on=Ce(Bt,Rr.toRawBytes(),Dr.toRawBytes(),Me);return Rr.add(Dr.multiplyUnsafe(on)).subtract(Pr).clearCofactor().equals(re.ZERO)}return ce._setWindowSize(8),{CURVE:e,getPublicKey:Se,sign:je,verify:Qe,ExtendedPoint:re,utils:{getExtendedPublicKey:pe,randomPrivateKey:()=>a(n.BYTES),precompute(Ne=8,Me=re.BASE){return Me._setWindowSize(Ne),Me.multiply(BigInt(3)),Me}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hB=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),U$=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),lde=BigInt(0),Gh=BigInt(1),pB=BigInt(2),$je=BigInt(3),F$=BigInt(5),W$=BigInt(8);function fde(r){const e=BigInt(10),n=BigInt(20),i=BigInt(40),s=BigInt(80),o=hB,u=r*r%o*r%o,l=Aa(u,pB,o)*u%o,g=Aa(l,Gh,o)*r%o,y=Aa(g,F$,o)*g%o,A=Aa(y,e,o)*y%o,I=Aa(A,n,o)*A%o,P=Aa(I,i,o)*I%o,D=Aa(P,s,o)*P%o,U=Aa(D,s,o)*P%o,V=Aa(U,e,o)*y%o;return{pow_p_5_8:Aa(V,pB,o)*r%o,b2:u}}function dde(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function gB(r,e){const n=hB,i=$o(e*e*e,n),s=$o(i*i*e,n),o=fde(r*s).pow_p_5_8;let a=$o(r*i*o,n);const u=$o(e*a*a,n),l=a,g=$o(a*U$,n),y=u===r,A=u===$o(-r,n),I=u===$o(-r*U$,n);return y&&(a=l),(A||I)&&(a=g),Jfe(a,n)&&(a=$o(-a,n)),{isValid:y||A,value:a}}const Vje=null,gi=P$(hB,void 0,!0),yB={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:gi,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:W$,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Hfe,randomBytes:JA,adjustScalarBytes:dde,uvRatio:gB},Ba=cde(yB);function jje(r,e,n){if(e.length>255)throw new Error("Context is too big");return concatBytes(utf8ToBytes("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,e.length]),e,r)}const Kje=null,Gje=null,qje=null;function Zje(r){const{y:e}=Ba.ExtendedPoint.fromHex(r),n=BigInt(1);return gi.toBytes(gi.create((n+e)*gi.inv(n-e)))}const Yje=null;function Xje(r){const e=yB.hash(r.subarray(0,32));return yB.adjustScalarBytes(e).subarray(0,32)}const Jje=null,hde=null,H$=null;function pde(r){const e=(gi.ORDER-F$)/W$,n=BigInt(486662);let i=gi.sqr(r);i=gi.mul(i,pB);let s=gi.add(i,gi.ONE),o=gi.neg(n),a=gi.sqr(s),u=gi.mul(a,s),l=gi.mul(i,n);l=gi.mul(l,o),l=gi.add(l,a),l=gi.mul(l,o);let g=gi.sqr(u);a=gi.sqr(g),g=gi.mul(g,u),g=gi.mul(g,l),a=gi.mul(a,g);let y=gi.pow(a,e);y=gi.mul(y,g);let A=gi.mul(y,H$);a=gi.sqr(y),a=gi.mul(a,u);let I=gi.eql(a,l),P=gi.cmov(A,y,I),D=gi.mul(o,i),U=gi.mul(y,r);U=gi.mul(U,hde);let V=gi.mul(U,H$),J=gi.mul(l,i);a=gi.sqr(U),a=gi.mul(a,u);let re=gi.eql(a,J),ce=gi.cmov(V,U,re);a=gi.sqr(P),a=gi.mul(a,u);let Re=gi.eql(a,l),De=gi.cmov(D,o,Re),Ue=gi.cmov(ce,P,Re),Ve=gi.isOdd(Ue);return Ue=gi.cmov(Ue,gi.neg(Ue),Re!==Ve),{xMn:De,xMd:s,yMn:Ue,yMd:Gh}}const gde=null;function Qje(r){const{xMn:e,xMd:n,yMn:i,yMd:s}=pde(r);let o=gi.mul(e,s);o=gi.mul(o,gde);let a=gi.mul(n,i),u=gi.sub(e,n),l=gi.add(e,n),g=gi.mul(a,l),y=gi.eql(g,gi.ZERO);o=gi.cmov(o,gi.ZERO,y),a=gi.cmov(a,gi.ONE,y),u=gi.cmov(u,gi.ONE,y),l=gi.cmov(l,gi.ONE,y);const A=gi.invertBatch([a,l]);return{x:gi.mul(o,A[0]),y:gi.mul(u,A[1])}}const eKe=null,tKe=null,rKe=null;function mB(r){if(!(r instanceof jf))throw new Error("RistrettoPoint expected")}const bB=null,yde=null,mde=null,bde=null,vde=null,z$=r=>gB(Gh,r),wde=null,vB=r=>Ba.CURVE.Fp.create(bytesToNumberLE(r)&wde);function $$(r){const{d:e}=Ba.CURVE,n=Ba.CURVE.Fp.ORDER,i=Ba.CURVE.Fp.create,s=i(bB*r*r),o=i((s+Gh)*bde);let a=BigInt(-1);const u=i((a-e*s)*i(s+e));let{isValid:l,value:g}=gB(o,u),y=i(g*r);isNegativeLE(y,n)||(y=i(-y)),l||(g=y),l||(a=s);const A=i(a*(s-Gh)*vde-u),I=g*g,P=i((g+g)*u),D=i(A*yde),U=i(Gh-I),V=i(Gh+I);return new Ba.ExtendedPoint(i(P*V),i(U*D),i(D*V),i(P*U))}class jf{constructor(e){this.ep=e}static fromAffine(e){return new jf(Ba.ExtendedPoint.fromAffine(e))}static hashToCurve(e){e=ensureBytes("ristrettoHash",e,64);const n=vB(e.slice(0,32)),i=$$(n),s=vB(e.slice(32,64)),o=$$(s);return new jf(i.add(o))}static fromHex(e){e=ensureBytes("ristrettoHex",e,32);const{a:n,d:i}=Ba.CURVE,s=Ba.CURVE.Fp.ORDER,o=Ba.CURVE.Fp.create,a="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",u=vB(e);if(!equalBytes(numberToBytesLE(u,32),e)||isNegativeLE(u,s))throw new Error(a);const l=o(u*u),g=o(Gh+n*l),y=o(Gh-n*l),A=o(g*g),I=o(y*y),P=o(n*i*A-I),{isValid:D,value:U}=z$(o(P*I)),V=o(U*y),J=o(U*V*P);let re=o((u+u)*V);isNegativeLE(re,s)&&(re=o(-re));const ce=o(g*J),Re=o(re*ce);if(!D||isNegativeLE(Re,s)||ce===lde)throw new Error(a);return new jf(new Ba.ExtendedPoint(re,ce,Gh,Re))}toRawBytes(){let{ex:e,ey:n,ez:i,et:s}=this.ep;const o=Ba.CURVE.Fp.ORDER,a=Ba.CURVE.Fp.create,u=a(a(i+n)*a(i-n)),l=a(e*n),g=a(l*l),{value:y}=z$(a(u*g)),A=a(y*u),I=a(y*l),P=a(A*I*s);let D;if(isNegativeLE(s*P,o)){let V=a(n*bB),J=a(e*bB);e=V,n=J,D=a(A*mde)}else D=I;isNegativeLE(e*P,o)&&(n=a(-n));let U=a((i-n)*D);return isNegativeLE(U,o)&&(U=a(-U)),numberToBytesLE(U,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(e){mB(e);const{ex:n,ey:i}=this.ep,{ex:s,ey:o}=e.ep,a=Ba.CURVE.Fp.create,u=a(n*o)===a(i*s),l=a(i*o)===a(n*s);return u||l}add(e){return mB(e),new jf(this.ep.add(e.ep))}subtract(e){return mB(e),new jf(this.ep.subtract(e.ep))}multiply(e){return new jf(this.ep.multiply(e))}multiplyUnsafe(e){return new jf(this.ep.multiplyUnsafe(e))}double(){return new jf(this.ep.double())}negate(){return new jf(this.ep.negate())}}const nKe=null,iKe=(r,e)=>{const n=e.DST,i=typeof n=="string"?utf8ToBytes(n):n,s=expand_message_xmd(r,i,64,sha512);return jf.hashToCurve(s)},sKe=null;var Ade=tn(83900),V$=tn.n(Ade),_de=tn(22265),hf=tn.n(_de);function E3(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}function oKe(r){if(typeof r!="boolean")throw new Error(`boolean expected, not ${r}`)}function Ede(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function wB(r,...e){if(!Ede(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}function aKe(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");E3(r.outputLen),E3(r.blockLen)}function T3(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function j$(r,e){wB(r);const n=e.outputLen;if(r.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const uKe=null,cKe=null;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function lKe(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}const fKe=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength),Tde=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),AB=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),qh=(r,e)=>r<<32-e|r>>>e,dKe=(r,e)=>r<<e|r>>>32-e>>>0,K$=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Sde=r=>r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255,hKe=null;function G$(r){for(let e=0;e<r.length;e++)r[e]=Sde(r[e])}const Ide=null;function pKe(r){abytes(r);let e="";for(let n=0;n<r.length;n++)e+=Ide[r[n]];return e}const yp=null;function q$(r){if(r>=yp._0&&r<=yp._9)return r-yp._0;if(r>=yp._A&&r<=yp._F)return r-(yp._A-10);if(r>=yp._a&&r<=yp._f)return r-(yp._a-10)}function gKe(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=q$(r.charCodeAt(o)),u=q$(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}const kde=async()=>{};async function yKe(r,e,n){let i=Date.now();for(let s=0;s<r;s++){n(s);const o=Date.now()-i;o>=0&&o<e||(await kde(),i+=o)}}function Rde(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function O_(r){return typeof r=="string"&&(r=Rde(r)),wB(r),r}function mKe(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];abytes(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}class Z${clone(){return this._cloneInto()}}const Cde=null;function bKe(r,e){if(e!==void 0&&Cde.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function Y$(r){const e=i=>r().update(O_(i)).digest(),n=r();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>r(),e}function vKe(r){const e=(i,s)=>r(s).update(O_(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function wKe(r){const e=(i,s)=>r(s).update(O_(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function AKe(r=32){if(crypto&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(new Uint8Array(r));if(crypto&&typeof crypto.randomBytes=="function")return crypto.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}function xde(r,e,n,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,n,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(n>>s&o),u=Number(n&o),l=i?4:0,g=i?0:4;r.setUint32(e+l,a,i),r.setUint32(e+g,u,i)}const Bde=(r,e,n)=>r&e^~r&n,Ode=(r,e,n)=>r&e^r&n^e&n;class Pde extends Z${constructor(e,n,i,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=AB(this.buffer)}update(e){T3(this);const{view:n,buffer:i,blockLen:s}=this;e=O_(e);const o=e.length;for(let a=0;a<o;){const u=Math.min(s-this.pos,o-a);if(u===s){const l=AB(e);for(;s<=o-a;a+=s)this.process(l,a);continue}i.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){T3(this),j$(e,this),this.finished=!0;const{buffer:n,view:i,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(i,0),a=0);for(let A=a;A<s;A++)n[A]=0;xde(i,s-8,BigInt(this.length*8),o),this.process(i,0);const u=AB(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const g=l/4,y=this.get();if(g>y.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<g;A++)u.setUint32(4*A,y[A],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:i,length:s,finished:o,destroyed:a,pos:u}=this;return e.length=s,e.pos=u,e.finished=o,e.destroyed=a,s%n&&e.buffer.set(i),e}}const Nde=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qg=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ey=new Uint32Array(64);class X$ extends Pde{constructor(){super(64,32,8,!1),this.A=Qg[0]|0,this.B=Qg[1]|0,this.C=Qg[2]|0,this.D=Qg[3]|0,this.E=Qg[4]|0,this.F=Qg[5]|0,this.G=Qg[6]|0,this.H=Qg[7]|0}get(){const{A:e,B:n,C:i,D:s,E:o,F:a,G:u,H:l}=this;return[e,n,i,s,o,a,u,l]}set(e,n,i,s,o,a,u,l){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,n){for(let A=0;A<16;A++,n+=4)ey[A]=e.getUint32(n,!1);for(let A=16;A<64;A++){const I=ey[A-15],P=ey[A-2],D=qh(I,7)^qh(I,18)^I>>>3,U=qh(P,17)^qh(P,19)^P>>>10;ey[A]=U+ey[A-7]+D+ey[A-16]|0}let{A:i,B:s,C:o,D:a,E:u,F:l,G:g,H:y}=this;for(let A=0;A<64;A++){const I=qh(u,6)^qh(u,11)^qh(u,25),P=y+I+Bde(u,l,g)+Nde[A]+ey[A]|0,U=(qh(i,2)^qh(i,13)^qh(i,22))+Ode(i,s,o)|0;y=g,g=l,l=u,u=a+P|0,a=o,o=s,s=i,i=P+U|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,g=g+this.G|0,y=y+this.H|0,this.set(i,s,o,a,u,l,g,y)}roundClean(){ey.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class _Ke extends X${constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const J$=Y$(()=>new X$),EKe=null;var _B=tn(59229),Br=tn(53857),EB=tn(19808);class Mde extends TypeError{constructor(e,n){let i;const{message:s,explanation:o,...a}=e,{path:u}=e,l=u.length===0?s:`At path: ${u.join(".")} -- ${s}`;super(o??l),o!=null&&(this.cause=l),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>i??(i=[e,...n()])}}function Lde(r){return pw(r)&&typeof r[Symbol.iterator]=="function"}function pw(r){return typeof r=="object"&&r!=null}function gw(r){return pw(r)&&!Array.isArray(r)}function Q$(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;const e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function tu(r){return typeof r=="symbol"?r.toString():typeof r=="string"?JSON.stringify(r):`${r}`}function Dde(r){const{done:e,value:n}=r.next();return e?void 0:n}function Ude(r,e,n,i){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});const{path:s,branch:o}=e,{type:a}=n,{refinement:u,message:l=`Expected a value of type \`${a}\`${u?` with refinement \`${u}\``:""}, but received: \`${tu(i)}\``}=r;return{value:i,type:a,refinement:u,key:s[s.length-1],path:s,branch:o,...r,message:l}}function*TB(r,e,n,i){Lde(r)||(r=[r]);for(const s of r){const o=Ude(s,e,n,i);o&&(yield o)}}function*SB(r,e,n={}){const{path:i=[],branch:s=[r],coerce:o=!1,mask:a=!1}=n,u={path:i,branch:s,mask:a};o&&(r=e.coercer(r,u));let l="valid";for(const g of e.validator(r,u))g.explanation=n.message,l="not_valid",yield[g,void 0];for(let[g,y,A]of e.entries(r,u)){const I=SB(y,A,{path:g===void 0?i:[...i,g],branch:g===void 0?s:[...s,y],coerce:o,mask:a,message:n.message});for(const P of I)P[0]?(l=P[0].refinement!=null?"not_refined":"not_valid",yield[P[0],void 0]):o&&(y=P[1],g===void 0?r=y:r instanceof Map?r.set(g,y):r instanceof Set?r.add(y):pw(r)&&(y!==void 0||g in r)&&(r[g]=y))}if(l!=="not_valid")for(const g of e.refiner(r,u))g.explanation=n.message,l="not_refined",yield[g,void 0];l==="valid"&&(yield[void 0,r])}class $a{constructor(e){const{type:n,schema:i,validator:s,refiner:o,coercer:a=l=>l,entries:u=function*(){}}=e;this.type=n,this.schema=i,this.entries=u,this.coercer=a,s?this.validator=(l,g)=>{const y=s(l,g);return TB(y,g,this,l)}:this.validator=()=>[],o?this.refiner=(l,g)=>{const y=o(l,g);return TB(y,g,this,l)}:this.refiner=()=>[]}assert(e,n){return Fde(e,this,n)}create(e,n){return P_(e,this,n)}is(e){return eV(e,this)}mask(e,n){return Wde(e,this,n)}validate(e,n={}){return N_(e,this,n)}}function Fde(r,e,n){const i=N_(r,e,{message:n});if(i[0])throw i[0]}function P_(r,e,n){const i=N_(r,e,{coerce:!0,message:n});if(i[0])throw i[0];return i[1]}function Wde(r,e,n){const i=N_(r,e,{coerce:!0,mask:!0,message:n});if(i[0])throw i[0];return i[1]}function eV(r,e){return!N_(r,e)[0]}function N_(r,e,n={}){const i=SB(r,e,n),s=Dde(i);return s[0]?[new Mde(s[0],function*(){for(const a of i)a[0]&&(yield a[0])}),void 0]:[void 0,s[1]]}function TKe(...r){const e=r[0].type==="type",n=r.map(s=>s.schema),i=Object.assign({},...n);return e?kn(i):S3(i)}function pf(r,e){return new $a({type:r,schema:null,validator:e})}function SKe(r,e){return new $a({...r,refiner:(n,i)=>n===void 0||r.refiner(n,i),validator(n,i){return n===void 0?!0:(e(n,i),r.validator(n,i))}})}function IKe(r){return new $a({type:"dynamic",schema:null,*entries(e,n){yield*r(e,n).entries(e,n)},validator(e,n){return r(e,n).validator(e,n)},coercer(e,n){return r(e,n).coercer(e,n)},refiner(e,n){return r(e,n).refiner(e,n)}})}function kKe(r){let e;return new $a({type:"lazy",schema:null,*entries(n,i){e??(e=r()),yield*e.entries(n,i)},validator(n,i){return e??(e=r()),e.validator(n,i)},coercer(n,i){return e??(e=r()),e.coercer(n,i)},refiner(n,i){return e??(e=r()),e.refiner(n,i)}})}function RKe(r,e){const{schema:n}=r,i={...n};for(const s of e)delete i[s];switch(r.type){case"type":return kn(i);default:return S3(i)}}function CKe(r){const e=r instanceof $a,n=e?{...r.schema}:{...r};for(const i in n)n[i]=Oi(n[i]);return e&&r.type==="type"?kn(n):S3(n)}function xKe(r,e){const{schema:n}=r,i={};for(const s of e)i[s]=n[s];switch(r.type){case"type":return kn(i);default:return S3(i)}}function BKe(r,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),pf(r,e)}function Hde(){return pf("any",()=>!0)}function oi(r){return new $a({type:"array",schema:r,*entries(e){if(r&&Array.isArray(e))for(const[n,i]of e.entries())yield[n,i,r]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${tu(e)}`}})}function OKe(){return pf("bigint",r=>typeof r=="bigint")}function Zh(){return pf("boolean",r=>typeof r=="boolean")}function PKe(){return pf("date",r=>r instanceof Date&&!isNaN(r.getTime())||`Expected a valid \`Date\` object, but received: ${tu(r)}`)}function NKe(r){const e={},n=r.map(i=>tu(i)).join();for(const i of r)e[i]=i;return new $a({type:"enums",schema:e,validator(i){return r.includes(i)||`Expected one of \`${n}\`, but received: ${tu(i)}`}})}function MKe(){return pf("func",r=>typeof r=="function"||`Expected a function, but received: ${tu(r)}`)}function IB(r){return pf("instance",e=>e instanceof r||`Expected a \`${r.name}\` instance, but received: ${tu(e)}`)}function LKe(){return pf("integer",r=>typeof r=="number"&&!isNaN(r)&&Number.isInteger(r)||`Expected an integer, but received: ${tu(r)}`)}function DKe(r){return new $a({type:"intersection",schema:null,*entries(e,n){for(const i of r)yield*i.entries(e,n)},*validator(e,n){for(const i of r)yield*i.validator(e,n)},*refiner(e,n){for(const i of r)yield*i.refiner(e,n)}})}function oa(r){const e=tu(r),n=typeof r;return new $a({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?r:null,validator(i){return i===r||`Expected the literal \`${e}\`, but received: ${tu(i)}`}})}function UKe(r,e){return new $a({type:"map",schema:null,*entries(n){if(r&&e&&n instanceof Map)for(const[i,s]of n.entries())yield[i,i,r],yield[i,s,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${tu(n)}`}})}function tV(){return pf("never",()=>!1)}function ai(r){return new $a({...r,validator:(e,n)=>e===null||r.validator(e,n),refiner:(e,n)=>e===null||r.refiner(e,n)})}function Zr(){return pf("number",r=>typeof r=="number"&&!isNaN(r)||`Expected a number, but received: ${tu(r)}`)}function S3(r){const e=r?Object.keys(r):[],n=tV();return new $a({type:"object",schema:r||null,*entries(i){if(r&&pw(i)){const s=new Set(Object.keys(i));for(const o of e)s.delete(o),yield[o,i[o],r[o]];for(const o of s)yield[o,i[o],n]}},validator(i){return gw(i)||`Expected an object, but received: ${tu(i)}`},coercer(i,s){if(!gw(i))return i;const o={...i};if(s.mask&&r)for(const a in o)r[a]===void 0&&delete o[a];return o}})}function Oi(r){return new $a({...r,validator:(e,n)=>e===void 0||r.validator(e,n),refiner:(e,n)=>e===void 0||r.refiner(e,n)})}function rV(r,e){return new $a({type:"record",schema:null,*entries(n){if(pw(n))for(const i in n){const s=n[i];yield[i,i,r],yield[i,s,e]}},validator(n){return gw(n)||`Expected an object, but received: ${tu(n)}`},coercer(n){return gw(n)?{...n}:n}})}function FKe(){return pf("regexp",r=>r instanceof RegExp)}function WKe(r){return new $a({type:"set",schema:null,*entries(e){if(r&&e instanceof Set)for(const n of e)yield[n,n,r]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${tu(e)}`}})}function zn(){return pf("string",r=>typeof r=="string"||`Expected a string, but received: ${tu(r)}`)}function kB(r){const e=tV();return new $a({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const i=Math.max(r.length,n.length);for(let s=0;s<i;s++)yield[s,n[s],r[s]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${tu(n)}`},coercer(n){return Array.isArray(n)?n.slice():n}})}function kn(r){const e=Object.keys(r);return new $a({type:"type",schema:r,*entries(n){if(pw(n))for(const i of e)yield[i,n[i],r[i]]},validator(n){return gw(n)||`Expected an object, but received: ${tu(n)}`},coercer(n){return gw(n)?{...n}:n}})}function Wc(r){const e=r.map(n=>n.type).join(" | ");return new $a({type:"union",schema:null,coercer(n,i){for(const s of r){const[o,a]=s.validate(n,{coerce:!0,mask:i.mask});if(!o)return a}return n},validator(n,i){const s=[];for(const o of r){const[...a]=SB(n,o,i),[u]=a;if(u[0])for(const[l]of a)l&&s.push(l);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${tu(n)}`,...s]}})}function _b(){return pf("unknown",()=>!0)}function Eb(r,e,n){return new $a({...r,coercer:(i,s)=>eV(i,e)?r.coercer(n(i,s),s):r.coercer(i,s)})}function HKe(r,e,n={}){return Eb(r,_b(),i=>{const s=typeof e=="function"?e():e;if(i===void 0)return s;if(!n.strict&&Q$(i)&&Q$(s)){const o={...i};let a=!1;for(const u in s)o[u]===void 0&&(o[u]=s[u],a=!0);if(a)return o}return i})}function zKe(r){return Eb(r,zn(),e=>e.trim())}function $Ke(r){return yw(r,"empty",e=>{const n=nV(e);return n===0||`Expected an empty ${r.type} but received one with a size of \`${n}\``})}function nV(r){return r instanceof Map||r instanceof Set?r.size:r.length}function VKe(r,e,n={}){const{exclusive:i}=n;return yw(r,"max",s=>i?s<e:s<=e||`Expected a ${r.type} less than ${i?"":"or equal to "}${e} but received \`${s}\``)}function jKe(r,e,n={}){const{exclusive:i}=n;return yw(r,"min",s=>i?s>e:s>=e||`Expected a ${r.type} greater than ${i?"":"or equal to "}${e} but received \`${s}\``)}function KKe(r){return yw(r,"nonempty",e=>nV(e)>0||`Expected a nonempty ${r.type} but received an empty one`)}function GKe(r,e){return yw(r,"pattern",n=>e.test(n)||`Expected a ${r.type} matching \`/${e.source}/\` but received "${n}"`)}function qKe(r,e,n=e){const i=`Expected a ${r.type}`,s=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return yw(r,"size",o=>{if(typeof o=="number"||o instanceof Date)return e<=o&&o<=n||`${i} ${s} but received \`${o}\``;if(o instanceof Map||o instanceof Set){const{size:a}=o;return e<=a&&a<=n||`${i} with a size ${s} but received one with a size of \`${a}\``}else{const{length:a}=o;return e<=a&&a<=n||`${i} with a length ${s} but received one with a length of \`${a}\``}})}function yw(r,e,n){return new $a({...r,*refiner(i,s){yield*r.refiner(i,s);const o=n(i,s),a=TB(o,s,r,i);for(const u of a)yield{...u,refinement:e}}})}var ZKe=tn(52149),iV=tn(86296),sV=tn.n(iV);const zde=iV;var $de=class extends sV(){socket;constructor(r,e,n){super(),this.socket=new self.WebSocket(r,n),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=i=>this.emit("message",i.data),this.socket.onerror=i=>this.emit("error",i),this.socket.onclose=i=>{this.emit("close",i.code,i.reason)}}send(r,e,n){const i=n||e;try{this.socket.send(r),i()}catch(s){i(s)}}close(r,e){this.socket.close(r,e)}addEventListener(r,e,n){this.socket.addEventListener(r,e,n)}};function oV(r,e){return new $de(r,e)}var Vde=class{encode(r){return JSON.stringify(r)}decode(r){return JSON.parse(r)}},jde=class extends sV(){address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(r,e="ws://localhost:8080",{autoconnect:n=!0,reconnect:i=!0,reconnect_interval:s=1e3,max_reconnects:o=5,...a}={},u,l){super(),this.webSocketFactory=r,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=n,this.ready=!1,this.reconnect=i,this.reconnect_timer_id=void 0,this.reconnect_interval=s,this.max_reconnects=o,this.rest_options=a,this.current_reconnects=0,this.generate_request_id=u||(()=>typeof this.rpc_id=="number"?++this.rpc_id:Number(this.rpc_id)+1),l?this.dataPack=l:this.dataPack=new Vde,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(r,e,n,i){return!i&&typeof n=="object"&&(i=n,n=null),new Promise((s,o)=>{if(!this.ready)return o(new Error("socket not ready"));const a=this.generate_request_id(r,e),u={jsonrpc:"2.0",method:r,params:e||void 0,id:a};this.socket.send(this.dataPack.encode(u),i,l=>{if(l)return o(l);this.queue[a]={promise:[s,o]},n&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],o(new Error("reply timeout"))},n))})})}async login(r){const e=await this.call("rpc.login",r);if(!e)throw new Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(r,e){return new Promise((n,i)=>{if(!this.ready)return i(new Error("socket not ready"));const s={jsonrpc:"2.0",method:r,params:e};this.socket.send(this.dataPack.encode(s),o=>{if(o)return i(o);n()})})}async subscribe(r){typeof r=="string"&&(r=[r]);const e=await this.call("rpc.on",r);if(typeof r=="string"&&e[r]!=="ok")throw new Error("Failed subscribing to an event '"+r+"' with: "+e[r]);return e}async unsubscribe(r){typeof r=="string"&&(r=[r]);const e=await this.call("rpc.off",r);if(typeof r=="string"&&e[r]!=="ok")throw new Error("Failed unsubscribing from an event with: "+e);return e}close(r,e){this.socket.close(r||1e3,e)}setAutoReconnect(r){this.reconnect=r}setReconnectInterval(r){this.reconnect_interval=r}setMaxReconnects(r){this.max_reconnects=r}_connect(r,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(r,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:n})=>{n instanceof ArrayBuffer&&(n=Ui.Buffer.from(n).toString());try{n=this.dataPack.decode(n)}catch{return}if(n.notification&&this.listeners(n.notification).length){if(!Object.keys(n.params).length)return this.emit(n.notification);const i=[n.notification];if(n.params.constructor===Object)i.push(n.params);else for(let s=0;s<n.params.length;s++)i.push(n.params[s]);return Promise.resolve().then(()=>{this.emit.apply(this,i)})}if(!this.queue[n.id])return n.method?Promise.resolve().then(()=>{this.emit(n.method,n?.params)}):void 0;"error"in n=="result"in n&&this.queue[n.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[n.id].timeout&&clearTimeout(this.queue[n.id].timeout),n.error?this.queue[n.id].promise[1](n.error):this.queue[n.id].promise[0](n.result),delete this.queue[n.id]}),this.socket.addEventListener("error",n=>this.emit("error",n)),this.socket.addEventListener("close",({code:n,reason:i})=>{this.ready&&setTimeout(()=>this.emit("close",n,i),0),this.ready=!1,this.socket=void 0,n!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(r,e),this.reconnect_interval)))})}},YKe=class extends null{constructor(r="ws://localhost:8080",{autoconnect:e=!0,reconnect:n=!0,reconnect_interval:i=1e3,max_reconnects:s=5}={},o){super(oV,r,{autoconnect:e,reconnect:n,reconnect_interval:i,max_reconnects:s},o)}};const I3=BigInt(2**32-1),RB=BigInt(32);function Kde(r,e=!1){return e?{h:Number(r&I3),l:Number(r>>RB&I3)}:{h:Number(r>>RB&I3)|0,l:Number(r&I3)|0}}function Gde(r,e=!1){let n=new Uint32Array(r.length),i=new Uint32Array(r.length);for(let s=0;s<r.length;s++){const{h:o,l:a}=Kde(r[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const XKe=(r,e)=>BigInt(r>>>0)<<RB|BigInt(e>>>0),JKe=(r,e,n)=>r>>>n,QKe=(r,e,n)=>r<<32-n|e>>>n,eGe=(r,e,n)=>r>>>n|e<<32-n,tGe=(r,e,n)=>r<<32-n|e>>>n,rGe=(r,e,n)=>r<<64-n|e>>>n-32,nGe=(r,e,n)=>r>>>n-32|e<<64-n,iGe=(r,e)=>e,sGe=(r,e)=>r,qde=(r,e,n)=>r<<n|e>>>32-n,Zde=(r,e,n)=>e<<n|r>>>32-n,Yde=(r,e,n)=>e<<n-32|r>>>64-n,Xde=(r,e,n)=>r<<n-32|e>>>64-n;function oGe(r,e,n,i){const s=(e>>>0)+(i>>>0);return{h:r+n+(s/2**32|0)|0,l:s|0}}const aGe=(r,e,n)=>(r>>>0)+(e>>>0)+(n>>>0),uGe=(r,e,n,i)=>e+n+i+(r/2**32|0)|0,cGe=(r,e,n,i)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0),lGe=(r,e,n,i,s)=>e+n+i+s+(r/2**32|0)|0,fGe=(r,e,n,i,s)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0)+(s>>>0),dGe=(r,e,n,i,s,o)=>e+n+i+s+o+(r/2**32|0)|0,hGe=null,pGe=null,aV=[],uV=[],cV=[],Jde=BigInt(0),M_=BigInt(1),Qde=BigInt(2),ehe=BigInt(7),the=BigInt(256),rhe=BigInt(113);for(let r=0,e=M_,n=1,i=0;r<24;r++){[n,i]=[i,(2*n+3*i)%5],aV.push(2*(5*i+n)),uV.push((r+1)*(r+2)/2%64);let s=Jde;for(let o=0;o<7;o++)e=(e<<M_^(e>>ehe)*rhe)%the,e&Qde&&(s^=M_<<(M_<<BigInt(o))-M_);cV.push(s)}const[nhe,ihe]=Gde(cV,!0),lV=(r,e,n)=>n>32?Yde(r,e,n):qde(r,e,n),fV=(r,e,n)=>n>32?Xde(r,e,n):Zde(r,e,n);function she(r,e=24){const n=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let a=0;a<10;a++)n[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){const u=(a+8)%10,l=(a+2)%10,g=n[l],y=n[l+1],A=lV(g,y,1)^n[u],I=fV(g,y,1)^n[u+1];for(let P=0;P<50;P+=10)r[a+P]^=A,r[a+P+1]^=I}let s=r[2],o=r[3];for(let a=0;a<24;a++){const u=uV[a],l=lV(s,o,u),g=fV(s,o,u),y=aV[a];s=r[y],o=r[y+1],r[y]=l,r[y+1]=g}for(let a=0;a<50;a+=10){for(let u=0;u<10;u++)n[u]=r[a+u];for(let u=0;u<10;u++)r[a+u]^=~n[(u+2)%10]&n[(u+4)%10]}r[0]^=nhe[i],r[1]^=ihe[i]}n.fill(0)}class k3 extends Z${constructor(e,n,i,s=!1,o=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=i,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,E3(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Tde(this.state)}keccak(){K$||G$(this.state32),she(this.state32,this.rounds),K$||G$(this.state32),this.posOut=0,this.pos=0}update(e){T3(this);const{blockLen:n,state:i}=this;e=O_(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(n-this.pos,s-o);for(let u=0;u<a;u++)i[this.pos++]^=e[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:i,blockLen:s}=this;e[i]^=n,n&128&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){T3(this,!1),wB(e),this.finish();const n=this.state,{blockLen:i}=this;for(let s=0,o=e.length;s<o;){this.posOut>=i&&this.keccak();const a=Math.min(i-this.posOut,o-s);e.set(n.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return E3(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(j$(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:i,outputLen:s,rounds:o,enableXOF:a}=this;return e||(e=new k3(n,i,s,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=i,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}}const ohe=(r,e,n)=>Y$(()=>new k3(e,r,n)),gGe=null,yGe=null,mGe=null,bGe=null,vGe=null,dV=ohe(1,136,256/8),wGe=null,AGe=null,_Ge=(r,e,n)=>wrapXOFConstructorWithOpts((i={})=>new k3(e,r,i.dkLen===void 0?n:i.dkLen,!0)),EGe=null,TGe=null;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function hV(r){r.lowS!==void 0&&pp("lowS",r.lowS),r.prehash!==void 0&&pp("prehash",r.prehash)}function ahe(r){const e=dB(r);hw(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:i,a:s}=e;if(n){if(!i.eql(s,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{Ph:uhe,aT:che}=f,Tb={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){const{Err:e}=Tb;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");const n=r[1],i=r.subarray(2,n+2);if(!n||i.length!==n)throw new e("Invalid signature integer: wrong length");if(i[0]&128)throw new e("Invalid signature integer: negative");if(i[0]===0&&!(i[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:uhe(i),l:r.subarray(n+2)}},toSig(r){const{Err:e}=Tb,n=typeof r=="string"?che(r):r;C_(n);let i=n.length;if(i<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==i-2)throw new e("Invalid signature: incorrect length");const{d:s,l:o}=Tb._parseInt(n.subarray(2)),{d:a,l:u}=Tb._parseInt(o);if(u.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(r){const e=g=>Number.parseInt(g[0],16)&8?"00"+g:g,n=g=>{const y=g.toString(16);return y.length&1?`0${y}`:y},i=e(n(r.s)),s=e(n(r.r)),o=i.length/2,a=s.length/2,u=n(o),l=n(a);return`30${n(a+o+4)}02${l}${s}02${u}${i}`}},Yh=BigInt(0),So=BigInt(1),ty=BigInt(2),R3=BigInt(3),pV=BigInt(4);function lhe(r){const e=ahe(r),{Fp:n}=e,i=e.toBytes||((D,U,V)=>{const J=U.toAffine();return Ab(Uint8Array.from([4]),n.toBytes(J.x),n.toBytes(J.y))}),s=e.fromBytes||(D=>{const U=D.subarray(1),V=n.fromBytes(U.subarray(0,n.BYTES)),J=n.fromBytes(U.subarray(n.BYTES,2*n.BYTES));return{x:V,y:J}});function o(D){const{a:U,b:V}=e,J=n.sqr(D),re=n.mul(J,D);return n.add(n.add(re,n.mul(D,U)),V)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(D){return w3(D,So,e.n)}function u(D){const{allowedPrivateKeyLengths:U,nByteLength:V,wrapPrivateKey:J,n:re}=e;if(U&&typeof D!="bigint"){if(bb(D)&&(D=vb(D)),typeof D!="string"||!U.includes(D.length))throw new Error("Invalid key");D=D.padStart(V*2,"0")}let ce;try{ce=typeof D=="bigint"?D:wb(Qa("private key",D,V))}catch{throw new Error(`private key must be ${V} bytes, hex or bigint, not ${typeof D}`)}return J&&(ce=$o(ce,re)),Vf("private key",ce,So,re),ce}function l(D){if(!(D instanceof A))throw new Error("ProjectivePoint expected")}const g=B_((D,U)=>{const{px:V,py:J,pz:re}=D;if(n.eql(re,n.ONE))return{x:V,y:J};const ce=D.is0();U==null&&(U=ce?n.ONE:n.inv(re));const Re=n.mul(V,U),De=n.mul(J,U),Ue=n.mul(re,U);if(ce)return{x:n.ZERO,y:n.ZERO};if(!n.eql(Ue,n.ONE))throw new Error("invZ was invalid");return{x:Re,y:De}}),y=B_(D=>{if(D.is0()){if(e.allowInfinityPoint&&!n.is0(D.py))return;throw new Error("bad point: ZERO")}const{x:U,y:V}=D.toAffine();if(!n.isValid(U)||!n.isValid(V))throw new Error("bad point: x or y not FE");const J=n.sqr(V),re=o(U);if(!n.eql(J,re))throw new Error("bad point: equation left != right");if(!D.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class A{constructor(U,V,J){if(this.px=U,this.py=V,this.pz=J,U==null||!n.isValid(U))throw new Error("x required");if(V==null||!n.isValid(V))throw new Error("y required");if(J==null||!n.isValid(J))throw new Error("z required");Object.freeze(this)}static fromAffine(U){const{x:V,y:J}=U||{};if(!U||!n.isValid(V)||!n.isValid(J))throw new Error("invalid affine point");if(U instanceof A)throw new Error("projective point not allowed");const re=ce=>n.eql(ce,n.ZERO);return re(V)&&re(J)?A.ZERO:new A(V,J,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(U){const V=n.invertBatch(U.map(J=>J.pz));return U.map((J,re)=>J.toAffine(V[re])).map(A.fromAffine)}static fromHex(U){const V=A.fromAffine(s(Qa("pointHex",U)));return V.assertValidity(),V}static fromPrivateKey(U){return A.BASE.multiply(u(U))}_setWindowSize(U){P.setWindowSize(this,U)}assertValidity(){y(this)}hasEvenY(){const{y:U}=this.toAffine();if(n.isOdd)return!n.isOdd(U);throw new Error("Field doesn't support isOdd")}equals(U){l(U);const{px:V,py:J,pz:re}=this,{px:ce,py:Re,pz:De}=U,Ue=n.eql(n.mul(V,De),n.mul(ce,re)),Ve=n.eql(n.mul(J,De),n.mul(Re,re));return Ue&&Ve}negate(){return new A(this.px,n.neg(this.py),this.pz)}double(){const{a:U,b:V}=e,J=n.mul(V,R3),{px:re,py:ce,pz:Re}=this;let De=n.ZERO,Ue=n.ZERO,Ve=n.ZERO,pe=n.mul(re,re),Se=n.mul(ce,ce),Ce=n.mul(Re,Re),je=n.mul(re,ce);return je=n.add(je,je),Ve=n.mul(re,Re),Ve=n.add(Ve,Ve),De=n.mul(U,Ve),Ue=n.mul(J,Ce),Ue=n.add(De,Ue),De=n.sub(Se,Ue),Ue=n.add(Se,Ue),Ue=n.mul(De,Ue),De=n.mul(je,De),Ve=n.mul(J,Ve),Ce=n.mul(U,Ce),je=n.sub(pe,Ce),je=n.mul(U,je),je=n.add(je,Ve),Ve=n.add(pe,pe),pe=n.add(Ve,pe),pe=n.add(pe,Ce),pe=n.mul(pe,je),Ue=n.add(Ue,pe),Ce=n.mul(ce,Re),Ce=n.add(Ce,Ce),pe=n.mul(Ce,je),De=n.sub(De,pe),Ve=n.mul(Ce,Se),Ve=n.add(Ve,Ve),Ve=n.add(Ve,Ve),new A(De,Ue,Ve)}add(U){l(U);const{px:V,py:J,pz:re}=this,{px:ce,py:Re,pz:De}=U;let Ue=n.ZERO,Ve=n.ZERO,pe=n.ZERO;const Se=e.a,Ce=n.mul(e.b,R3);let je=n.mul(V,ce),$e=n.mul(J,Re),Qe=n.mul(re,De),nt=n.add(V,J),Ne=n.add(ce,Re);nt=n.mul(nt,Ne),Ne=n.add(je,$e),nt=n.sub(nt,Ne),Ne=n.add(V,re);let Me=n.add(ce,De);return Ne=n.mul(Ne,Me),Me=n.add(je,Qe),Ne=n.sub(Ne,Me),Me=n.add(J,re),Ue=n.add(Re,De),Me=n.mul(Me,Ue),Ue=n.add($e,Qe),Me=n.sub(Me,Ue),pe=n.mul(Se,Ne),Ue=n.mul(Ce,Qe),pe=n.add(Ue,pe),Ue=n.sub($e,pe),pe=n.add($e,pe),Ve=n.mul(Ue,pe),$e=n.add(je,je),$e=n.add($e,je),Qe=n.mul(Se,Qe),Ne=n.mul(Ce,Ne),$e=n.add($e,Qe),Qe=n.sub(je,Qe),Qe=n.mul(Se,Qe),Ne=n.add(Ne,Qe),je=n.mul($e,Ne),Ve=n.add(Ve,je),je=n.mul(Me,Ne),Ue=n.mul(nt,Ue),Ue=n.sub(Ue,je),je=n.mul(nt,$e),pe=n.mul(Me,pe),pe=n.add(pe,je),new A(Ue,Ve,pe)}subtract(U){return this.add(U.negate())}is0(){return this.equals(A.ZERO)}wNAF(U){return P.wNAFCached(this,U,A.normalizeZ)}multiplyUnsafe(U){Vf("scalar",U,Yh,e.n);const V=A.ZERO;if(U===Yh)return V;if(U===So)return this;const{endo:J}=e;if(!J)return P.unsafeLadder(this,U);let{k1neg:re,k1:ce,k2neg:Re,k2:De}=J.splitScalar(U),Ue=V,Ve=V,pe=this;for(;ce>Yh||De>Yh;)ce&So&&(Ue=Ue.add(pe)),De&So&&(Ve=Ve.add(pe)),pe=pe.double(),ce>>=So,De>>=So;return re&&(Ue=Ue.negate()),Re&&(Ve=Ve.negate()),Ve=new A(n.mul(Ve.px,J.beta),Ve.py,Ve.pz),Ue.add(Ve)}multiply(U){const{endo:V,n:J}=e;Vf("scalar",U,So,J);let re,ce;if(V){const{k1neg:Re,k1:De,k2neg:Ue,k2:Ve}=V.splitScalar(U);let{p:pe,f:Se}=this.wNAF(De),{p:Ce,f:je}=this.wNAF(Ve);pe=P.constTimeNegate(Re,pe),Ce=P.constTimeNegate(Ue,Ce),Ce=new A(n.mul(Ce.px,V.beta),Ce.py,Ce.pz),re=pe.add(Ce),ce=Se.add(je)}else{const{p:Re,f:De}=this.wNAF(U);re=Re,ce=De}return A.normalizeZ([re,ce])[0]}multiplyAndAddUnsafe(U,V,J){const re=A.BASE,ce=(De,Ue)=>Ue===Yh||Ue===So||!De.equals(re)?De.multiplyUnsafe(Ue):De.multiply(Ue),Re=ce(this,V).add(ce(U,J));return Re.is0()?void 0:Re}toAffine(U){return g(this,U)}isTorsionFree(){const{h:U,isTorsionFree:V}=e;if(U===So)return!0;if(V)return V(A,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:U,clearCofactor:V}=e;return U===So?this:V?V(A,this):this.multiplyUnsafe(e.h)}toRawBytes(U=!0){return pp("isCompressed",U),this.assertValidity(),i(A,this,U)}toHex(U=!0){return pp("isCompressed",U),vb(this.toRawBytes(U))}}A.BASE=new A(e.Gx,e.Gy,n.ONE),A.ZERO=new A(n.ZERO,n.ONE,n.ZERO);const I=e.nBitLength,P=D$(A,e.endo?Math.ceil(I/2):I);return{CURVE:e,ProjectivePoint:A,normPrivateKeyToScalar:u,weierstrassEquation:o,isWithinCurveOrder:a}}function fhe(r){const e=dB(r);return hw(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function dhe(r){const e=fhe(r),{Fp:n,n:i}=e,s=n.BYTES+1,o=2*n.BYTES+1;function a(nt){return $o(nt,i)}function u(nt){return A3(nt,i)}const{ProjectivePoint:l,normPrivateKeyToScalar:g,weierstrassEquation:y,isWithinCurveOrder:A}=lhe({...e,toBytes(nt,Ne,Me){const ct=Ne.toAffine(),mt=n.toBytes(ct.x),Bt=Ab;return pp("isCompressed",Me),Me?Bt(Uint8Array.from([Ne.hasEvenY()?2:3]),mt):Bt(Uint8Array.from([4]),mt,n.toBytes(ct.y))},fromBytes(nt){const Ne=nt.length,Me=nt[0],ct=nt.subarray(1);if(Ne===s&&(Me===2||Me===3)){const mt=wb(ct);if(!w3(mt,So,n.ORDER))throw new Error("Point is not on curve");const Bt=y(mt);let er;try{er=n.sqrt(Bt)}catch(Dr){const Rr=Dr instanceof Error?": "+Dr.message:"";throw new Error("Point is not on curve"+Rr)}const cr=(er&So)===So;return(Me&1)===1!==cr&&(er=n.neg(er)),{x:mt,y:er}}else if(Ne===o&&Me===4){const mt=n.fromBytes(ct.subarray(0,n.BYTES)),Bt=n.fromBytes(ct.subarray(n.BYTES,2*n.BYTES));return{x:mt,y:Bt}}else throw new Error(`Point of length ${Ne} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}}),I=nt=>vb(dw(nt,e.nByteLength));function P(nt){const Ne=i>>So;return nt>Ne}function D(nt){return P(nt)?a(-nt):nt}const U=(nt,Ne,Me)=>wb(nt.slice(Ne,Me));class V{constructor(Ne,Me,ct){this.r=Ne,this.s=Me,this.recovery=ct,this.assertValidity()}static fromCompact(Ne){const Me=e.nByteLength;return Ne=Qa("compactSignature",Ne,Me*2),new V(U(Ne,0,Me),U(Ne,Me,2*Me))}static fromDER(Ne){const{r:Me,s:ct}=Tb.toSig(Qa("DER",Ne));return new V(Me,ct)}assertValidity(){Vf("r",this.r,So,i),Vf("s",this.s,So,i)}addRecoveryBit(Ne){return new V(this.r,this.s,Ne)}recoverPublicKey(Ne){const{r:Me,s:ct,recovery:mt}=this,Bt=Ue(Qa("msgHash",Ne));if(mt==null||![0,1,2,3].includes(mt))throw new Error("recovery id invalid");const er=mt===2||mt===3?Me+e.n:Me;if(er>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const cr=mt&1?"03":"02",pr=l.fromHex(cr+I(er)),Dr=u(er),Rr=a(-Bt*Dr),Pr=a(ct*Dr),on=l.BASE.multiplyAndAddUnsafe(pr,Rr,Pr);if(!on)throw new Error("point at infinify");return on.assertValidity(),on}hasHighS(){return P(this.s)}normalizeS(){return this.hasHighS()?new V(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return lw(this.toDERHex())}toDERHex(){return Tb.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return lw(this.toCompactHex())}toCompactHex(){return I(this.r)+I(this.s)}}const J={isValidPrivateKey(nt){try{return g(nt),!0}catch{return!1}},normPrivateKeyToScalar:g,randomPrivateKey:()=>{const nt=M$(e.n);return ide(e.randomBytes(nt),e.n)},precompute(nt=8,Ne=l.BASE){return Ne._setWindowSize(nt),Ne.multiply(BigInt(3)),Ne}};function re(nt,Ne=!0){return l.fromPrivateKey(nt).toRawBytes(Ne)}function ce(nt){const Ne=bb(nt),Me=typeof nt=="string",ct=(Ne||Me)&&nt.length;return Ne?ct===s||ct===o:Me?ct===2*s||ct===2*o:nt instanceof l}function Re(nt,Ne,Me=!0){if(ce(nt))throw new Error("first arg must be private key");if(!ce(Ne))throw new Error("second arg must be public key");return l.fromHex(Ne).multiply(g(nt)).toRawBytes(Me)}const De=e.bits2int||function(nt){const Ne=wb(nt),Me=nt.length*8-e.nBitLength;return Me>0?Ne>>BigInt(Me):Ne},Ue=e.bits2int_modN||function(nt){return a(De(nt))},Ve=oB(e.nBitLength);function pe(nt){return Vf(`num < 2^${e.nBitLength}`,nt,Yh,Ve),dw(nt,e.nByteLength)}function Se(nt,Ne,Me=Ce){if(["recovered","canonical"].some(Ar=>Ar in Me))throw new Error("sign() legacy options not supported");const{hash:ct,randomBytes:mt}=e;let{lowS:Bt,prehash:er,extraEntropy:cr}=Me;Bt==null&&(Bt=!0),nt=Qa("msgHash",nt),hV(Me),er&&(nt=Qa("prehashed msgHash",ct(nt)));const pr=Ue(nt),Dr=g(Ne),Rr=[pe(Dr),pe(pr)];if(cr!=null&&cr!==!1){const Ar=cr===!0?mt(n.BYTES):cr;Rr.push(Qa("extraEntropy",Ar))}const Pr=Ab(...Rr),on=pr;function xn(Ar){const Xr=De(Ar);if(!A(Xr))return;const Tn=u(Xr),Bn=l.BASE.multiply(Xr).toAffine(),ni=a(Bn.x);if(ni===Yh)return;const en=a(Tn*a(on+ni*Dr));if(en===Yh)return;let si=(Bn.x===ni?0:2)|Number(Bn.y&So),ei=en;return Bt&&P(en)&&(ei=D(en),si^=1),new V(ni,ei,si)}return{seed:Pr,k2sig:xn}}const Ce={lowS:e.lowS,prehash:!1},je={lowS:e.lowS,prehash:!1};function $e(nt,Ne,Me=Ce){const{seed:ct,k2sig:mt}=Se(nt,Ne,Me),Bt=e;return x$(Bt.hash.outputLen,Bt.nByteLength,Bt.hmac)(ct,mt)}l.BASE._setWindowSize(8);function Qe(nt,Ne,Me,ct=je){const mt=nt;if(Ne=Qa("msgHash",Ne),Me=Qa("publicKey",Me),"strict"in ct)throw new Error("options.strict was renamed to lowS");hV(ct);const{lowS:Bt,prehash:er}=ct;let cr,pr;try{if(typeof mt=="string"||bb(mt))try{cr=V.fromDER(mt)}catch(Bn){if(!(Bn instanceof Tb.Err))throw Bn;cr=V.fromCompact(mt)}else if(typeof mt=="object"&&typeof mt.r=="bigint"&&typeof mt.s=="bigint"){const{r:Bn,s:ni}=mt;cr=new V(Bn,ni)}else throw new Error("PARSE");pr=l.fromHex(Me)}catch(Bn){if(Bn.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Bt&&cr.hasHighS())return!1;er&&(Ne=e.hash(Ne));const{r:Dr,s:Rr}=cr,Pr=Ue(Ne),on=u(Rr),xn=a(Pr*on),Ar=a(Dr*on),Xr=l.BASE.multiplyAndAddUnsafe(pr,xn,Ar)?.toAffine();return Xr?a(Xr.x)===Dr:!1}return{CURVE:e,getPublicKey:re,getSharedSecret:Re,sign:$e,verify:Qe,ProjectivePoint:l,Signature:V,utils:J}}function hhe(r,e){const n=r.ORDER;let i=Yh;for(let D=n-So;D%ty===Yh;D/=ty)i+=So;const s=i,o=ty<<s-So-So,a=o*ty,u=(n-So)/a,l=(u-So)/ty,g=a-So,y=o,A=r.pow(e,u),I=r.pow(e,(u+So)/ty);let P=(D,U)=>{let V=A,J=r.pow(U,g),re=r.sqr(J);re=r.mul(re,U);let ce=r.mul(D,re);ce=r.pow(ce,l),ce=r.mul(ce,J),J=r.mul(ce,U),re=r.mul(ce,D);let Re=r.mul(re,J);ce=r.pow(Re,y);let De=r.eql(ce,r.ONE);J=r.mul(re,I),ce=r.mul(Re,V),re=r.cmov(J,re,De),Re=r.cmov(ce,Re,De);for(let Ue=s;Ue>So;Ue--){let Ve=Ue-ty;Ve=ty<<Ve-So;let pe=r.pow(Re,Ve);const Se=r.eql(pe,r.ONE);J=r.mul(re,V),V=r.mul(V,V),pe=r.mul(Re,V),re=r.cmov(J,re,Se),Re=r.cmov(pe,Re,Se)}return{isValid:De,value:re}};if(r.ORDER%pV===R3){const D=(r.ORDER-R3)/pV,U=r.sqrt(r.neg(e));P=(V,J)=>{let re=r.sqr(J);const ce=r.mul(V,J);re=r.mul(re,ce);let Re=r.pow(re,D);Re=r.mul(Re,ce);const De=r.mul(Re,U),Ue=r.mul(r.sqr(Re),J),Ve=r.eql(Ue,V);let pe=r.cmov(De,Re,Ve);return{isValid:Ve,value:pe}}}return P}function SGe(r,e){if(mod.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=hhe(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return i=>{let s,o,a,u,l,g,y,A;s=r.sqr(i),s=r.mul(s,e.Z),o=r.sqr(s),o=r.add(o,s),a=r.add(o,r.ONE),a=r.mul(a,e.B),u=r.cmov(e.Z,r.neg(o),!r.eql(o,r.ZERO)),u=r.mul(u,e.A),o=r.sqr(a),g=r.sqr(u),l=r.mul(g,e.A),o=r.add(o,l),o=r.mul(o,a),g=r.mul(g,u),l=r.mul(g,e.B),o=r.add(o,l),y=r.mul(s,a);const{isValid:I,value:P}=n(o,g);A=r.mul(s,i),A=r.mul(A,P),y=r.cmov(y,a,I),A=r.cmov(A,P,I);const D=r.isOdd(i)===r.isOdd(A);return A=r.cmov(r.neg(A),A,D),y=r.div(y,u),{x:y,y:A}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function phe(r){return{hash:r,hmac:(e,...n)=>e_(r,e,ub(...n)),randomBytes:JA}}function ghe(r,e){const n=i=>dhe({...r,...phe(i)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const L_=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),C3=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),D_=BigInt(1),x3=BigInt(2),gV=(r,e)=>(r+e/x3)/e;function yV(r){const e=L_,n=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),u=BigInt(44),l=BigInt(88),g=r*r*r%e,y=g*g*r%e,A=Aa(y,n,e)*y%e,I=Aa(A,n,e)*y%e,P=Aa(I,x3,e)*g%e,D=Aa(P,s,e)*P%e,U=Aa(D,o,e)*D%e,V=Aa(U,u,e)*U%e,J=Aa(V,l,e)*V%e,re=Aa(J,u,e)*U%e,ce=Aa(re,n,e)*y%e,Re=Aa(ce,a,e)*D%e,De=Aa(Re,i,e)*g%e,Ue=Aa(De,x3,e);if(!CB.eql(CB.sqr(Ue),r))throw new Error("Cannot find square root");return Ue}const CB=P$(L_,void 0,void 0,{sqrt:yV}),U_=ghe({a:BigInt(0),b:BigInt(7),Fp:CB,n:C3,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=C3,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-D_*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),u=gV(o*r,e),l=gV(-i*r,e);let g=$o(r-u*n-l*s,e),y=$o(-u*i-l*o,e);const A=g>a,I=y>a;if(A&&(g=e-g),I&&(y=e-y),g>a||y>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:A,k1:g,k2neg:I,k2:y}}}},QA),mV=BigInt(0),bV=null;function xB(r,...e){let n=bV[r];if(n===void 0){const i=sha256(Uint8Array.from(r,s=>s.charCodeAt(0)));n=concatBytes(i,i),bV[r]=n}return sha256(concatBytes(n,...e))}const vV=r=>r.toRawBytes(!0).slice(1),BB=r=>numberToBytesBE(r,32),OB=r=>mod(r,L_),F_=r=>mod(r,C3),PB=U_.ProjectivePoint,yhe=(r,e,n)=>PB.BASE.multiplyAndAddUnsafe(r,e,n);function NB(r){let e=U_.utils.normPrivateKeyToScalar(r),n=PB.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:F_(-e),bytes:vV(n)}}function mhe(r){aInRange("x",r,D_,L_);const e=OB(r*r),n=OB(e*r+BigInt(7));let i=yV(n);i%x3!==mV&&(i=OB(-i));const s=new PB(r,i,D_);return s.assertValidity(),s}const mw=null;function wV(...r){return F_(mw(xB("BIP0340/challenge",...r)))}function IGe(r){return NB(r).bytes}function kGe(r,e,n=randomBytes(32)){const i=ensureBytes("message",r),{bytes:s,scalar:o}=NB(e),a=ensureBytes("auxRand",n,32),u=BB(o^mw(xB("BIP0340/aux",a))),l=xB("BIP0340/nonce",u,s,i),g=F_(mw(l));if(g===mV)throw new Error("sign failed: k is zero");const{bytes:y,scalar:A}=NB(g),I=wV(y,s,i),P=new Uint8Array(64);if(P.set(y,0),P.set(BB(F_(A+I*o)),32),!bhe(P,i,s))throw new Error("sign: Invalid signature produced");return P}function bhe(r,e,n){const i=ensureBytes("signature",r,64),s=ensureBytes("message",e),o=ensureBytes("publicKey",n,32);try{const a=mhe(mw(o)),u=mw(i.subarray(0,32));if(!inRange(u,D_,L_))return!1;const l=mw(i.subarray(32,64));if(!inRange(l,D_,C3))return!1;const g=wV(BB(u),vV(a),s),y=yhe(a,l,F_(-g));return!(!y||!y.hasEvenY()||y.toAffine().x!==u)}catch{return!1}}const RGe=null,CGe=null,xGe=null,BGe=null,OGe=null,PGe=null,vhe=Ba.utils.randomPrivateKey,AV=()=>{const r=Ba.utils.randomPrivateKey(),e=B3(r),n=new Uint8Array(64);return n.set(r),n.set(e,32),{publicKey:e,secretKey:n}},B3=Ba.getPublicKey;function _V(r){try{return Ba.ExtendedPoint.fromHex(r),!0}catch{return!1}}const MB=(r,e)=>Ba.sign(r,e.slice(0,32)),whe=Ba.verify,us=r=>Ui.Buffer.isBuffer(r)?r:r instanceof Uint8Array?Ui.Buffer.from(r.buffer,r.byteOffset,r.byteLength):Ui.Buffer.from(r);class EV{constructor(e){Object.assign(this,e)}encode(){return Ui.Buffer.from((0,_B.serialize)(O3,this))}static decode(e){return(0,_B.deserialize)(O3,this,e)}static decodeUnchecked(e){return(0,_B.deserializeUnchecked)(O3,this,e)}}class NGe extends EV{constructor(e){if(super(e),this.enum="",Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(n=>{this.enum=n})}}const O3=new Map;var TV;const Ahe=32,mp=32;function _he(r){return r._bn!==void 0}let SV=1;class Vn extends EV{constructor(e){if(super({}),this._bn=void 0,_he(e))this._bn=e._bn;else{if(typeof e=="string"){const n=hf().decode(e);if(n.length!=mp)throw new Error("Invalid public key input");this._bn=new(V$())(n)}else this._bn=new(V$())(e);if(this._bn.byteLength()>mp)throw new Error("Invalid public key input")}}static unique(){const e=new Vn(SV);return SV+=1,new Vn(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return hf().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(Ui.Buffer);if(e.length===mp)return e;const n=Ui.Buffer.alloc(32);return e.copy(n,32-e.length),n}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,n,i){const s=Ui.Buffer.concat([e.toBuffer(),Ui.Buffer.from(n),i.toBuffer()]),o=J$(s);return new Vn(o)}static createProgramAddressSync(e,n){let i=Ui.Buffer.alloc(0);e.forEach(function(o){if(o.length>Ahe)throw new TypeError("Max seed length exceeded");i=Ui.Buffer.concat([i,us(o)])}),i=Ui.Buffer.concat([i,n.toBuffer(),Ui.Buffer.from("ProgramDerivedAddress")]);const s=J$(i);if(_V(s))throw new Error("Invalid seeds, address must fall off the curve");return new Vn(s)}static async createProgramAddress(e,n){return this.createProgramAddressSync(e,n)}static findProgramAddressSync(e,n){let i=255,s;for(;i!=0;){try{const o=e.concat(Ui.Buffer.from([i]));s=this.createProgramAddressSync(o,n)}catch(o){if(o instanceof TypeError)throw o;i--;continue}return[s,i]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,n){return this.findProgramAddressSync(e,n)}static isOnCurve(e){const n=new Vn(e);return _V(n.toBytes())}}TV=Vn,Vn.default=new TV("11111111111111111111111111111111"),O3.set(Vn,{kind:"struct",fields:[["_bn","u256"]]});class MGe{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const n=us(e);if(e.length!==64)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=us(vhe()),this._publicKey=us(B3(this._secretKey))}get publicKey(){return new Vn(this._publicKey)}get secretKey(){return Buffer.concat([this._secretKey,this._publicKey],64)}}const LGe=new Vn("BPFLoader1111111111111111111111111111111111"),Sb=1232,IV=127,P3=64;class kV extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(kV.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class RV extends Error{constructor(e,n){super(`Transaction was not confirmed in ${n.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(RV.prototype,"name",{value:"TransactionExpiredTimeoutError"});class W_ extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(W_.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class N3{constructor(e,n){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=n}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const n of this.keySegments()){if(e<n.length)return n[e];e-=n.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const i=new Map;this.keySegments().flat().forEach((o,a)=>{i.set(o.toBase58(),a)});const s=o=>{const a=i.get(o.toBase58());if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return e.map(o=>({programIdIndex:s(o.programId),accountKeyIndexes:o.keys.map(a=>s(a.pubkey)),data:o.data}))}}const vs=(r="publicKey")=>Br.blob(32,r),Ehe=(r="signature")=>BufferLayout.blob(64,r),Ib=(r="string")=>{const e=Br.struct([Br.u32("length"),Br.u32("lengthPadding"),Br.blob(Br.offset(Br.u32(),-8),"chars")],r),n=e.decode.bind(e),i=e.encode.bind(e),s=e;return s.decode=(o,a)=>n(o,a).chars.toString(),s.encode=(o,a,u)=>{const l={chars:Ui.Buffer.from(o,"utf8")};return i(l,a,u)},s.alloc=o=>Br.u32().span+Br.u32().span+Ui.Buffer.from(o,"utf8").length,s},The=(r="authorized")=>Br.struct([vs("staker"),vs("withdrawer")],r),She=(r="lockup")=>Br.struct([Br.ns64("unixTimestamp"),Br.ns64("epoch"),vs("custodian")],r),Ihe=(r="voteInit")=>Br.struct([vs("nodePubkey"),vs("authorizedVoter"),vs("authorizedWithdrawer"),Br.u8("commission")],r),khe=(r="voteAuthorizeWithSeedArgs")=>Br.struct([Br.u32("voteAuthorizationType"),vs("currentAuthorityDerivedKeyOwnerPubkey"),Ib("currentAuthorityDerivedKeySeed"),vs("newAuthorized")],r);function CV(r,e){const n=s=>{if(s.span>=0)return s.span;if(typeof s.alloc=="function")return s.alloc(e[s.property]);if("count"in s&&"elementLayout"in s){const o=e[s.property];if(Array.isArray(o))return o.length*n(s.elementLayout)}else if("fields"in s)return CV({layout:s},e[s.property]);return 0};let i=0;return r.layout.fields.forEach(s=>{i+=n(s)}),i}function Tl(r){let e=0,n=0;for(;;){let i=r.shift();if(e|=(i&127)<<n*7,n+=1,!(i&128))break}return e}function gf(r,e){let n=e;for(;;){let i=n&127;if(n>>=7,n==0){r.push(i);break}else i|=128,r.push(i)}}function Ys(r,e){if(!r)throw new Error(e||"Assertion failed")}class M3{constructor(e,n){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=n}static compile(e,n){const i=new Map,s=a=>{const u=a.toBase58();let l=i.get(u);return l===void 0&&(l={isSigner:!1,isWritable:!1,isInvoked:!1},i.set(u,l)),l},o=s(n);o.isSigner=!0,o.isWritable=!0;for(const a of e){s(a.programId).isInvoked=!0;for(const u of a.keys){const l=s(u.pubkey);l.isSigner||=u.isSigner,l.isWritable||=u.isWritable}}return new M3(n,i)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Ys(e.length<=256,"Max static account keys length exceeded");const n=e.filter(([,l])=>l.isSigner&&l.isWritable),i=e.filter(([,l])=>l.isSigner&&!l.isWritable),s=e.filter(([,l])=>!l.isSigner&&l.isWritable),o=e.filter(([,l])=>!l.isSigner&&!l.isWritable),a={numRequiredSignatures:n.length+i.length,numReadonlySignedAccounts:i.length,numReadonlyUnsignedAccounts:o.length};{Ys(n.length>0,"Expected at least one writable signer key");const[l]=n[0];Ys(l===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const u=[...n.map(([l])=>new Vn(l)),...i.map(([l])=>new Vn(l)),...s.map(([l])=>new Vn(l)),...o.map(([l])=>new Vn(l))];return[a,u]}extractTableLookup(e){const[n,i]=this.drainKeysFoundInLookupTable(e.state.addresses,a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[s,o]=this.drainKeysFoundInLookupTable(e.state.addresses,a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(n.length===0&&s.length===0))return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:s},{writable:i,readonly:o}]}drainKeysFoundInLookupTable(e,n){const i=new Array,s=new Array;for(const[o,a]of this.keyMetaMap.entries())if(n(a)){const u=new Vn(o),l=e.findIndex(g=>g.equals(u));l>=0&&(Ys(l<256,"Max lookup table index exceeded"),i.push(l),s.push(u),this.keyMetaMap.delete(o))}return[i,s]}}const xV="Reached end of buffer unexpectedly";function Xh(r){if(r.length===0)throw new Error(xV);return r.shift()}function Sl(r,...e){const[n]=e;if(e.length===2?n+(e[1]??0)>r.length:n>=r.length)throw new Error(xV);return r.splice(...e)}class bp{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(n=>new Vn(n)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(n=>this.indexToProgramIds.set(n.programIdIndex,this.accountKeys[n.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:hf().decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new N3(this.staticAccountKeys)}static compile(e){const n=M3.compile(e.instructions,e.payerKey),[i,s]=n.getMessageComponents(),a=new N3(s).compileInstructions(e.instructions).map(u=>({programIdIndex:u.programIdIndex,accounts:u.accountKeyIndexes,data:hf().encode(u.data)}));return new bp({header:i,accountKeys:s,recentBlockhash:e.recentBlockhash,instructions:a})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const i=e-n,o=this.accountKeys.length-n-this.header.numReadonlyUnsignedAccounts;return i<o}else{const i=n-this.header.numReadonlySignedAccounts;return e<i}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,n)=>!this.isProgramId(n))}serialize(){const e=this.accountKeys.length;let n=[];gf(n,e);const i=this.instructions.map(A=>{const{accounts:I,programIdIndex:P}=A,D=Array.from(hf().decode(A.data));let U=[];gf(U,I.length);let V=[];return gf(V,D.length),{programIdIndex:P,keyIndicesCount:Ui.Buffer.from(U),keyIndices:I,dataLength:Ui.Buffer.from(V),data:D}});let s=[];gf(s,i.length);let o=Ui.Buffer.alloc(Sb);Ui.Buffer.from(s).copy(o);let a=s.length;i.forEach(A=>{const P=Br.struct([Br.u8("programIdIndex"),Br.blob(A.keyIndicesCount.length,"keyIndicesCount"),Br.seq(Br.u8("keyIndex"),A.keyIndices.length,"keyIndices"),Br.blob(A.dataLength.length,"dataLength"),Br.seq(Br.u8("userdatum"),A.data.length,"data")]).encode(A,o,a);a+=P}),o=o.slice(0,a);const u=Br.struct([Br.blob(1,"numRequiredSignatures"),Br.blob(1,"numReadonlySignedAccounts"),Br.blob(1,"numReadonlyUnsignedAccounts"),Br.blob(n.length,"keyCount"),Br.seq(vs("key"),e,"keys"),vs("recentBlockhash")]),l={numRequiredSignatures:Ui.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Ui.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Ui.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Ui.Buffer.from(n),keys:this.accountKeys.map(A=>us(A.toBytes())),recentBlockhash:hf().decode(this.recentBlockhash)};let g=Ui.Buffer.alloc(2048);const y=u.encode(l,g);return o.copy(g,y),g.slice(0,y+o.length)}static from(e){let n=[...e];const i=Xh(n);if(i!==(i&IV))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const s=Xh(n),o=Xh(n),a=Tl(n);let u=[];for(let I=0;I<a;I++){const P=Sl(n,0,mp);u.push(new Vn(Ui.Buffer.from(P)))}const l=Sl(n,0,mp),g=Tl(n);let y=[];for(let I=0;I<g;I++){const P=Xh(n),D=Tl(n),U=Sl(n,0,D),V=Tl(n),J=Sl(n,0,V),re=hf().encode(Ui.Buffer.from(J));y.push({programIdIndex:P,accounts:U,data:re})}const A={header:{numRequiredSignatures:i,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:o},recentBlockhash:hf().encode(Ui.Buffer.from(l)),accountKeys:u,instructions:y};return new bp(A)}}class H_{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const n of this.addressTableLookups)e+=n.readonlyIndexes.length+n.writableIndexes.length;return e}getAccountKeys(e){let n;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");n=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)n=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new N3(this.staticAccountKeys,n)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures,i=this.staticAccountKeys.length;if(e>=i){const s=e-i,o=this.addressTableLookups.reduce((a,u)=>a+u.writableIndexes.length,0);return s<o}else if(e>=this.header.numRequiredSignatures){const s=e-n,a=i-n-this.header.numReadonlyUnsignedAccounts;return s<a}else{const s=n-this.header.numReadonlySignedAccounts;return e<s}}resolveAddressTableLookups(e){const n={writable:[],readonly:[]};for(const i of this.addressTableLookups){const s=e.find(o=>o.key.equals(i.accountKey));if(!s)throw new Error(`Failed to find address lookup table account for table key ${i.accountKey.toBase58()}`);for(const o of i.writableIndexes)if(o<s.state.addresses.length)n.writable.push(s.state.addresses[o]);else throw new Error(`Failed to find address for index ${o} in address lookup table ${i.accountKey.toBase58()}`);for(const o of i.readonlyIndexes)if(o<s.state.addresses.length)n.readonly.push(s.state.addresses[o]);else throw new Error(`Failed to find address for index ${o} in address lookup table ${i.accountKey.toBase58()}`)}return n}static compile(e){const n=M3.compile(e.instructions,e.payerKey),i=new Array,s={writable:new Array,readonly:new Array},o=e.addressLookupTableAccounts||[];for(const y of o){const A=n.extractTableLookup(y);if(A!==void 0){const[I,{writable:P,readonly:D}]=A;i.push(I),s.writable.push(...P),s.readonly.push(...D)}}const[a,u]=n.getMessageComponents(),g=new N3(u,s).compileInstructions(e.instructions);return new H_({header:a,staticAccountKeys:u,recentBlockhash:e.recentBlockhash,compiledInstructions:g,addressTableLookups:i})}serialize(){const e=Array();gf(e,this.staticAccountKeys.length);const n=this.serializeInstructions(),i=Array();gf(i,this.compiledInstructions.length);const s=this.serializeAddressTableLookups(),o=Array();gf(o,this.addressTableLookups.length);const a=BufferLayout.struct([BufferLayout.u8("prefix"),BufferLayout.struct([BufferLayout.u8("numRequiredSignatures"),BufferLayout.u8("numReadonlySignedAccounts"),BufferLayout.u8("numReadonlyUnsignedAccounts")],"header"),BufferLayout.blob(e.length,"staticAccountKeysLength"),BufferLayout.seq(vs(),this.staticAccountKeys.length,"staticAccountKeys"),vs("recentBlockhash"),BufferLayout.blob(i.length,"instructionsLength"),BufferLayout.blob(n.length,"serializedInstructions"),BufferLayout.blob(o.length,"addressTableLookupsLength"),BufferLayout.blob(s.length,"serializedAddressTableLookups")]),u=new Uint8Array(Sb),g=a.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(y=>y.toBytes()),recentBlockhash:bs58.decode(this.recentBlockhash),instructionsLength:new Uint8Array(i),serializedInstructions:n,addressTableLookupsLength:new Uint8Array(o),serializedAddressTableLookups:s},u);return u.slice(0,g)}serializeInstructions(){let e=0;const n=new Uint8Array(Sb);for(const i of this.compiledInstructions){const s=Array();gf(s,i.accountKeyIndexes.length);const o=Array();gf(o,i.data.length);const a=BufferLayout.struct([BufferLayout.u8("programIdIndex"),BufferLayout.blob(s.length,"encodedAccountKeyIndexesLength"),BufferLayout.seq(BufferLayout.u8(),i.accountKeyIndexes.length,"accountKeyIndexes"),BufferLayout.blob(o.length,"encodedDataLength"),BufferLayout.blob(i.data.length,"data")]);e+=a.encode({programIdIndex:i.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(s),accountKeyIndexes:i.accountKeyIndexes,encodedDataLength:new Uint8Array(o),data:i.data},n,e)}return n.slice(0,e)}serializeAddressTableLookups(){let e=0;const n=new Uint8Array(Sb);for(const i of this.addressTableLookups){const s=Array();gf(s,i.writableIndexes.length);const o=Array();gf(o,i.readonlyIndexes.length);const a=BufferLayout.struct([vs("accountKey"),BufferLayout.blob(s.length,"encodedWritableIndexesLength"),BufferLayout.seq(BufferLayout.u8(),i.writableIndexes.length,"writableIndexes"),BufferLayout.blob(o.length,"encodedReadonlyIndexesLength"),BufferLayout.seq(BufferLayout.u8(),i.readonlyIndexes.length,"readonlyIndexes")]);e+=a.encode({accountKey:i.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(s),writableIndexes:i.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(o),readonlyIndexes:i.readonlyIndexes},n,e)}return n.slice(0,e)}static deserialize(e){let n=[...e];const i=Xh(n),s=i&IV;Ys(i!==s,"Expected versioned message but received legacy message");const o=s;Ys(o===0,`Expected versioned message with version 0 but found version ${o}`);const a={numRequiredSignatures:Xh(n),numReadonlySignedAccounts:Xh(n),numReadonlyUnsignedAccounts:Xh(n)},u=[],l=Tl(n);for(let D=0;D<l;D++)u.push(new Vn(Sl(n,0,mp)));const g=bs58.encode(Sl(n,0,mp)),y=Tl(n),A=[];for(let D=0;D<y;D++){const U=Xh(n),V=Tl(n),J=Sl(n,0,V),re=Tl(n),ce=new Uint8Array(Sl(n,0,re));A.push({programIdIndex:U,accountKeyIndexes:J,data:ce})}const I=Tl(n),P=[];for(let D=0;D<I;D++){const U=new Vn(Sl(n,0,mp)),V=Tl(n),J=Sl(n,0,V),re=Tl(n),ce=Sl(n,0,re);P.push({accountKey:U,writableIndexes:J,readonlyIndexes:ce})}return new H_({header:a,staticAccountKeys:u,recentBlockhash:g,compiledInstructions:A,addressTableLookups:P})}}const Rhe=null;let ry=null;const Che=Ui.Buffer.alloc(P3).fill(0);class Lo{constructor(e){this.keys=void 0,this.programId=void 0,this.data=Ui.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:n,isWritable:i})=>({pubkey:e.toJSON(),isSigner:n,isWritable:i})),programId:this.programId.toJSON(),data:[...this.data]}}}class so{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:n,nonceInfo:i}=e;this.minNonceContextSlot=n,this.nonceInfo=i}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:n,lastValidBlockHeight:i}=e;this.recentBlockhash=n,this.lastValidBlockHeight=i}else{const{recentBlockhash:n,nonceInfo:i}=e;i&&(this.nonceInfo=i),this.recentBlockhash=n}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(n=>{"instructions"in n?this.instructions=this.instructions.concat(n.instructions):"data"in n&&"programId"in n&&"keys"in n?this.instructions.push(n):this.instructions.push(new Lo(n))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?n=[this.nonceInfo.nonceInstruction,...this.instructions]:n=this.instructions):(e=this.recentBlockhash,n=this.instructions),!e)throw new Error("Transaction recentBlockhash required");n.length<1&&console.warn("No instructions provided");let i;if(this.feePayer)i=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)i=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let U=0;U<n.length;U++)if(n[U].programId===void 0)throw new Error(`Transaction instruction index ${U} has undefined program id`);const s=[],o=[];n.forEach(U=>{U.keys.forEach(J=>{o.push({...J})});const V=U.programId.toString();s.includes(V)||s.push(V)}),s.forEach(U=>{o.push({pubkey:new Vn(U),isSigner:!1,isWritable:!1})});const a=[];o.forEach(U=>{const V=U.pubkey.toString(),J=a.findIndex(re=>re.pubkey.toString()===V);J>-1?(a[J].isWritable=a[J].isWritable||U.isWritable,a[J].isSigner=a[J].isSigner||U.isSigner):a.push(U)}),a.sort(function(U,V){if(U.isSigner!==V.isSigner)return U.isSigner?-1:1;if(U.isWritable!==V.isWritable)return U.isWritable?-1:1;const J={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return U.pubkey.toBase58().localeCompare(V.pubkey.toBase58(),"en",J)});const u=a.findIndex(U=>U.pubkey.equals(i));if(u>-1){const[U]=a.splice(u,1);U.isSigner=!0,U.isWritable=!0,a.unshift(U)}else a.unshift({pubkey:i,isSigner:!0,isWritable:!0});for(const U of this.signatures){const V=a.findIndex(J=>J.pubkey.equals(U.publicKey));if(V>-1)a[V].isSigner||(a[V].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${U.publicKey.toString()}`)}let l=0,g=0,y=0;const A=[],I=[];a.forEach(({pubkey:U,isSigner:V,isWritable:J})=>{V?(A.push(U.toString()),l+=1,J||(g+=1)):(I.push(U.toString()),J||(y+=1))});const P=A.concat(I),D=n.map(U=>{const{data:V,programId:J}=U;return{programIdIndex:P.indexOf(J.toString()),accounts:U.keys.map(re=>P.indexOf(re.pubkey.toString())),data:hf().encode(V)}});return D.forEach(U=>{Ys(U.programIdIndex>=0),U.accounts.forEach(V=>Ys(V>=0))}),new bp({header:{numRequiredSignatures:l,numReadonlySignedAccounts:g,numReadonlyUnsignedAccounts:y},accountKeys:P,recentBlockhash:e,instructions:D})}_compile(){const e=this.compileMessage(),n=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===n.length&&this.signatures.every((s,o)=>n[o].equals(s.publicKey))||(this.signatures=n.map(i=>({signature:null,publicKey:i}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const n=new Set;this.signatures=e.filter(i=>{const s=i.toString();return n.has(s)?!1:(n.add(s),!0)}).map(i=>({signature:null,publicKey:i}))}sign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,i=[];for(const o of e){const a=o.publicKey.toString();n.has(a)||(n.add(a),i.push(o))}this.signatures=i.map(o=>({signature:null,publicKey:o.publicKey}));const s=this._compile();this._partialSign(s,...i)}partialSign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,i=[];for(const o of e){const a=o.publicKey.toString();n.has(a)||(n.add(a),i.push(o))}const s=this._compile();this._partialSign(s,...i)}_partialSign(e,...n){const i=e.serialize();n.forEach(s=>{const o=MB(i,s.secretKey);this._addSignature(s.publicKey,us(o))})}addSignature(e,n){this._compile(),this._addSignature(e,n)}_addSignature(e,n){Ys(n.length===64);const i=this.signatures.findIndex(s=>e.equals(s.publicKey));if(i<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[i].signature=Ui.Buffer.from(n)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,n){const i={};for(const{signature:s,publicKey:o}of this.signatures)s===null?n&&(i.missing||=[]).push(o):whe(s,e,o.toBytes())||(i.invalid||=[]).push(o);return i.invalid||i.missing?i:void 0}serialize(e){const{requireAllSignatures:n,verifySignatures:i}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),s=this.serializeMessage();if(i){const o=this._getMessageSignednessErrors(s,n);if(o){let a="Signature verification failed.";throw o.invalid&&(a+=`
|
||
Invalid signature for public key${o.invalid.length===1?"":"(s)"} [\`${o.invalid.map(u=>u.toBase58()).join("`, `")}\`].`),o.missing&&(a+=`
|
||
Missing signature for public key${o.missing.length===1?"":"(s)"} [\`${o.missing.map(u=>u.toBase58()).join("`, `")}\`].`),new Error(a)}}return this._serialize(s)}_serialize(e){const{signatures:n}=this,i=[];gf(i,n.length);const s=i.length+n.length*64+e.length,o=Ui.Buffer.alloc(s);return Ys(n.length<256),Ui.Buffer.from(i).copy(o,0),n.forEach(({signature:a},u)=>{a!==null&&(Ys(a.length===64,"signature has invalid length"),Ui.Buffer.from(a).copy(o,i.length+u*64))}),e.copy(o,i.length+n.length*64),Ys(o.length<=Sb,`Transaction too large: ${o.length} > ${Sb}`),o}get keys(){return Ys(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Ys(this.instructions.length===1),this.instructions[0].programId}get data(){return Ys(this.instructions.length===1),this.instructions[0].data}static from(e){let n=[...e];const i=Tl(n);let s=[];for(let o=0;o<i;o++){const a=Sl(n,0,P3);s.push(hf().encode(Ui.Buffer.from(a)))}return so.populate(bp.from(n),s)}static populate(e,n=[]){const i=new so;return i.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(i.feePayer=e.accountKeys[0]),n.forEach((s,o)=>{const a={signature:s==hf().encode(Che)?null:hf().decode(s),publicKey:e.accountKeys[o]};i.signatures.push(a)}),e.instructions.forEach(s=>{const o=s.accounts.map(a=>{const u=e.accountKeys[a];return{pubkey:u,isSigner:i.signatures.some(l=>l.publicKey.toString()===u.toString())||e.isAccountSigner(a),isWritable:e.isAccountWritable(a)}});i.instructions.push(new Lo({keys:o,programId:e.accountKeys[s.programIdIndex],data:hf().decode(s.data)}))}),i._message=e,i._json=i.toJSON(),i}}class BV{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,n){const{header:i,compiledInstructions:s,recentBlockhash:o}=e,{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:l}=i,g=a-u;Ys(g>0,"Message header is invalid");const y=e.staticAccountKeys.length-a-l;Ys(y>=0,"Message header is invalid");const A=e.getAccountKeys(n),I=A.get(0);if(I===void 0)throw new Error("Failed to decompile message because no account keys were found");const P=[];for(const D of s){const U=[];for(const J of D.accountKeyIndexes){const re=A.get(J);if(re===void 0)throw new Error(`Failed to find key for account key index ${J}`);const ce=J<a;let Re;ce?Re=J<g:J<A.staticAccountKeys.length?Re=J-a<y:Re=J-A.staticAccountKeys.length<A.accountKeysFromLookups.writable.length,U.push({pubkey:re,isSigner:J<i.numRequiredSignatures,isWritable:Re})}const V=A.get(D.programIdIndex);if(V===void 0)throw new Error(`Failed to find program id for program id index ${D.programIdIndex}`);P.push(new Lo({programId:V,data:us(D.data),keys:U}))}return new BV({payerKey:I,instructions:P,recentBlockhash:o})}compileToLegacyMessage(){return bp.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return H_.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class OV{get version(){return this.message.version}constructor(e,n){if(this.signatures=void 0,this.message=void 0,n!==void 0)Ys(n.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{const i=[];for(let s=0;s<e.header.numRequiredSignatures;s++)i.push(new Uint8Array(P3));this.signatures=i}this.message=e}serialize(){const e=this.message.serialize(),n=Array();gf(n,this.signatures.length);const i=BufferLayout.struct([BufferLayout.blob(n.length,"encodedSignaturesLength"),BufferLayout.seq(Ehe(),this.signatures.length,"signatures"),BufferLayout.blob(e.length,"serializedMessage")]),s=new Uint8Array(2048),o=i.encode({encodedSignaturesLength:new Uint8Array(n),signatures:this.signatures,serializedMessage:e},s);return s.slice(0,o)}static deserialize(e){let n=[...e];const i=[],s=Tl(n);for(let a=0;a<s;a++)i.push(new Uint8Array(Sl(n,0,P3)));const o=Rhe.deserialize(new Uint8Array(n));return new OV(o,i)}sign(e){const n=this.message.serialize(),i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const s of e){const o=i.findIndex(a=>a.equals(s.publicKey));Ys(o>=0,`Cannot sign with non signer key ${s.publicKey.toBase58()}`),this.signatures[o]=MB(n,s.secretKey)}}addSignature(e,n){Ys(n.byteLength===64,"Signature must be 64 bytes long");const s=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(o=>o.equals(e));Ys(s>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[s]=n}}const PV=1e3/(160/64),vp=new Vn("SysvarC1ock11111111111111111111111111111111"),WGe=new Vn("SysvarEpochSchedu1e111111111111111111111111"),HGe=new Vn("Sysvar1nstructions1111111111111111111111111"),LB=new Vn("SysvarRecentB1ockHashes11111111111111111111"),z_=new Vn("SysvarRent111111111111111111111111111111111"),zGe=new Vn("SysvarRewards111111111111111111111111111111"),$Ge=new Vn("SysvarS1otHashes111111111111111111111111111"),VGe=new Vn("SysvarS1otHistory11111111111111111111111111"),DB=new Vn("SysvarStakeHistory1111111111111111111111111");class L3 extends Error{constructor({action:e,signature:n,transactionMessage:i,logs:s}){const o=s?`Logs:
|
||
${JSON.stringify(s.slice(-10),null,2)}. `:"",a="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let u;switch(e){case"send":u=`Transaction ${n} resulted in an error.
|
||
${i}. `+o+a;break;case"simulate":u=`Simulation failed.
|
||
Message: ${i}.
|
||
`+o+a;break;default:u=`Unknown action '${(l=>l)(e)}'`}super(u),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=n,this.transactionMessage=i,this.transactionLogs=s||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((n,i)=>{e.getTransaction(this.signature).then(s=>{if(s&&s.meta&&s.meta.logMessages){const o=s.meta.logMessages;this.transactionLogs=o,n(o)}else i(new Error("Log messages not found"))}).catch(i)})),await this.transactionLogs}}const jGe=null;class _i extends Error{constructor({code:e,message:n,data:i},s){super(s!=null?`${s}: ${n}`:n),this.code=void 0,this.data=void 0,this.code=e,this.data=i,this.name="SolanaJSONRPCError"}}async function NV(r,e,n,i){const s=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,maxRetries:i.maxRetries,minContextSlot:i.minContextSlot},o=await r.sendTransaction(e,n,s);let a;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)a=(await r.confirmTransaction({abortSignal:i?.abortSignal,signature:o,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},i&&i.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){const{nonceInstruction:u}=e.nonceInfo,l=u.keys[0].pubkey;a=(await r.confirmTransaction({abortSignal:i?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:l,nonceValue:e.nonceInfo.nonce,signature:o},i&&i.commitment)).value}else i?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),a=(await r.confirmTransaction(o,i&&i.commitment)).value;if(a.err)throw o!=null?new L3({action:"send",signature:o,transactionMessage:`Status: (${JSON.stringify(a)})`}):new Error(`Transaction ${o} failed (${JSON.stringify(a)})`);return o}function kb(r){return new Promise(e=>setTimeout(e,r))}function Fs(r,e){const n=r.layout.span>=0?r.layout.span:CV(r,e),i=Ui.Buffer.alloc(n),s=Object.assign({instruction:r.index},e);return r.layout.encode(s,i),i}function oo(r,e){let n;try{n=r.layout.decode(e)}catch(i){throw new Error("invalid instruction; "+i)}if(n.instruction!==r.index)throw new Error(`invalid instruction; instruction index mismatch ${n.instruction} != ${r.index}`);return n}const xhe=Br.nu64("lamportsPerSignature"),MV=Br.struct([Br.u32("version"),Br.u32("state"),vs("authorizedPubkey"),vs("nonce"),Br.struct([xhe],"feeCalculator")]),LV=MV.span;class UB{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const n=MV.decode(us(e),0);return new UB({authorizedPubkey:new Vn(n.authorizedPubkey),nonce:new Vn(n.nonce).toString(),feeCalculator:n.feeCalculator})}}const Bhe=r=>{const e=r.decode.bind(r),n=r.encode.bind(r);return{decode:e,encode:n}},bw=(r=>e=>{const n=(0,Br.blob)(r,e),{encode:i,decode:s}=Bhe(n),o=n;return o.decode=(a,u)=>{const l=s(a,u);return(0,EB.toBigIntLE)(Ui.Buffer.from(l))},o.encode=(a,u,l)=>{const g=(0,EB.toBufferLE)(a,r);return i(g,u,l)},o})(8);class GGe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const i=BufferLayout.u32("instruction").decode(e.data);let s;for(const[o,a]of Object.entries(Vo))if(a.index==i){s=o;break}if(!s)throw new Error("Instruction type incorrect; not a SystemInstruction");return s}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:n,space:i,programId:s}=oo(Vo.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:n,space:i,programId:new Vn(s)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:n}=oo(Vo.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:n}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:n,seed:i,programId:s}=oo(Vo.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:n,seed:i,programId:new Vn(s)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:n}=oo(Vo.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:n}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:n,seed:i,space:s,programId:o}=oo(Vo.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Vn(n),seed:i,space:s,programId:new Vn(o)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:n}=oo(Vo.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new Vn(n)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:n,seed:i,programId:s}=oo(Vo.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Vn(n),seed:i,programId:new Vn(s)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:n,seed:i,lamports:s,space:o,programId:a}=oo(Vo.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new Vn(n),seed:i,lamports:s,space:o,programId:new Vn(a)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:n}=oo(Vo.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new Vn(n)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),oo(Vo.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:n}=oo(Vo.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:n}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:n}=oo(Vo.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new Vn(n)}}static checkProgramId(e){if(!e.equals(Uu.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}const Vo=Object.freeze({Create:{index:0,layout:Br.struct([Br.u32("instruction"),Br.ns64("lamports"),Br.ns64("space"),vs("programId")])},Assign:{index:1,layout:Br.struct([Br.u32("instruction"),vs("programId")])},Transfer:{index:2,layout:Br.struct([Br.u32("instruction"),bw("lamports")])},CreateWithSeed:{index:3,layout:Br.struct([Br.u32("instruction"),vs("base"),Ib("seed"),Br.ns64("lamports"),Br.ns64("space"),vs("programId")])},AdvanceNonceAccount:{index:4,layout:Br.struct([Br.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:Br.struct([Br.u32("instruction"),Br.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:Br.struct([Br.u32("instruction"),vs("authorized")])},AuthorizeNonceAccount:{index:7,layout:Br.struct([Br.u32("instruction"),vs("authorized")])},Allocate:{index:8,layout:Br.struct([Br.u32("instruction"),Br.ns64("space")])},AllocateWithSeed:{index:9,layout:Br.struct([Br.u32("instruction"),vs("base"),Ib("seed"),Br.ns64("space"),vs("programId")])},AssignWithSeed:{index:10,layout:Br.struct([Br.u32("instruction"),vs("base"),Ib("seed"),vs("programId")])},TransferWithSeed:{index:11,layout:Br.struct([Br.u32("instruction"),bw("lamports"),Ib("seed"),vs("programId")])},UpgradeNonceAccount:{index:12,layout:Br.struct([Br.u32("instruction")])}});class Uu{constructor(){}static createAccount(e){const n=Vo.Create,i=Fs(n,{lamports:e.lamports,space:e.space,programId:us(e.programId.toBuffer())});return new Lo({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:i})}static transfer(e){let n,i;if("basePubkey"in e){const s=Vo.TransferWithSeed;n=Fs(s,{lamports:BigInt(e.lamports),seed:e.seed,programId:us(e.programId.toBuffer())}),i=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const s=Vo.Transfer;n=Fs(s,{lamports:BigInt(e.lamports)}),i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Lo({keys:i,programId:this.programId,data:n})}static assign(e){let n,i;if("basePubkey"in e){const s=Vo.AssignWithSeed;n=Fs(s,{base:us(e.basePubkey.toBuffer()),seed:e.seed,programId:us(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const s=Vo.Assign;n=Fs(s,{programId:us(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Lo({keys:i,programId:this.programId,data:n})}static createAccountWithSeed(e){const n=Vo.CreateWithSeed,i=Fs(n,{base:us(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:us(e.programId.toBuffer())});let s=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||s.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Lo({keys:s,programId:this.programId,data:i})}static createNonceAccount(e){const n=new so;"basePubkey"in e&&"seed"in e?n.add(Uu.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:LV,programId:this.programId})):n.add(Uu.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:LV,programId:this.programId}));const i={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return n.add(this.nonceInitialize(i)),n}static nonceInitialize(e){const n=Vo.InitializeNonceAccount,i=Fs(n,{authorized:us(e.authorizedPubkey.toBuffer())}),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:LB,isSigner:!1,isWritable:!1},{pubkey:z_,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Lo(s)}static nonceAdvance(e){const n=Vo.AdvanceNonceAccount,i=Fs(n),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:LB,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Lo(s)}static nonceWithdraw(e){const n=Vo.WithdrawNonceAccount,i=Fs(n,{lamports:e.lamports});return new Lo({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:LB,isSigner:!1,isWritable:!1},{pubkey:z_,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static nonceAuthorize(e){const n=Vo.AuthorizeNonceAccount,i=Fs(n,{authorized:us(e.newAuthorizedPubkey.toBuffer())});return new Lo({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static allocate(e){let n,i;if("basePubkey"in e){const s=Vo.AllocateWithSeed;n=Fs(s,{base:us(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:us(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const s=Vo.Allocate;n=Fs(s,{space:e.space}),i=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Lo({keys:i,programId:this.programId,data:n})}}Uu.programId=new Vn("11111111111111111111111111111111");const Ohe=Sb-300;class vw{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/vw.chunkSize)+1+1)}static async load(e,n,i,s,o){{const A=await e.getMinimumBalanceForRentExemption(o.length),I=await e.getAccountInfo(i.publicKey,"confirmed");let P=null;if(I!==null){if(I.executable)return console.error("Program load failed, account is already executable"),!1;I.data.length!==o.length&&(P=P||new so,P.add(Uu.allocate({accountPubkey:i.publicKey,space:o.length}))),I.owner.equals(s)||(P=P||new so,P.add(Uu.assign({accountPubkey:i.publicKey,programId:s}))),I.lamports<A&&(P=P||new so,P.add(Uu.transfer({fromPubkey:n.publicKey,toPubkey:i.publicKey,lamports:A-I.lamports})))}else P=new so().add(Uu.createAccount({fromPubkey:n.publicKey,newAccountPubkey:i.publicKey,lamports:A>0?A:1,space:o.length,programId:s}));P!==null&&await NV(e,P,[n,i],{commitment:"confirmed"})}const a=Br.struct([Br.u32("instruction"),Br.u32("offset"),Br.u32("bytesLength"),Br.u32("bytesLengthPadding"),Br.seq(Br.u8("byte"),Br.offset(Br.u32(),-8),"bytes")]),u=vw.chunkSize;let l=0,g=o,y=[];for(;g.length>0;){const A=g.slice(0,u),I=Ui.Buffer.alloc(u+16);a.encode({instruction:0,offset:l,bytes:A,bytesLength:0,bytesLengthPadding:0},I);const P=new so().add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:s,data:I});y.push(NV(e,P,[n,i],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await kb(1e3/4),l+=u,g=g.slice(u)}await Promise.all(y);{const A=Br.struct([Br.u32("instruction")]),I=Ui.Buffer.alloc(A.span);A.encode({instruction:1},I);const P=new so().add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:z_,isSigner:!1,isWritable:!1}],programId:s,data:I}),D="processed",U=await e.sendTransaction(P,[n,i],{preflightCommitment:D}),{context:V,value:J}=await e.confirmTransaction({signature:U,lastValidBlockHeight:P.lastValidBlockHeight,blockhash:P.recentBlockhash},D);if(J.err)throw new Error(`Transaction ${U} failed (${JSON.stringify(J)})`);for(;;){try{if(await e.getSlot({commitment:D})>V.slot)break}catch{}await new Promise(re=>setTimeout(re,Math.round(PV/2)))}}return!0}}vw.chunkSize=Ohe;const qGe=new Vn("BPFLoader2111111111111111111111111111111111");class ZGe{static getMinNumSignatures(e){return vw.getMinNumSignatures(e)}static load(e,n,i,s,o){return vw.load(e,n,i,o,s)}}function YGe(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var FB,DV;function XGe(){if(DV)return FB;DV=1;var r=Object.prototype.toString,e=Object.keys||function(i){var s=[];for(var o in i)s.push(o);return s};function n(i,s){var o,a,u,l,g,y,A;if(i===!0)return"true";if(i===!1)return"false";switch(typeof i){case"object":if(i===null)return null;if(i.toJSON&&typeof i.toJSON=="function")return n(i.toJSON(),s);if(A=r.call(i),A==="[object Array]"){for(u="[",a=i.length-1,o=0;o<a;o++)u+=n(i[o],!0)+",";return a>-1&&(u+=n(i[o],!0)),u+"]"}else if(A==="[object Object]"){for(l=e(i).sort(),a=l.length,u="",o=0;o<a;)g=l[o],y=n(i[g],!1),y!==void 0&&(u&&(u+=","),u+=JSON.stringify(g)+":"+y),o++;return"{"+u+"}"}else return JSON.stringify(i);case"function":case"undefined":return s?null:void 0;case"string":return JSON.stringify(i);default:return isFinite(i)?i:null}}return FB=function(i){var s=n(i,!1);if(s!==void 0)return""+s},FB}var JGe=null,UV=null;const $_=32;function WB(r){let e=0;for(;r>1;)r/=2,e++;return e}function Phe(r){return r===0?1:(r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r|=r>>32,r+1)}class Nhe{constructor(e,n,i,s,o){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=n,this.warmup=i,this.firstNormalEpoch=s,this.firstNormalSlot=o}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const n=WB(Phe(e+$_+1))-WB($_)-1,i=this.getSlotsInEpoch(n),s=e-(i-$_);return[n,s]}else{const n=e-this.firstNormalSlot,i=Math.floor(n/this.slotsPerEpoch),s=this.firstNormalEpoch+i,o=n%this.slotsPerEpoch;return[s,o]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*$_:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+WB($_)):this.slotsPerEpoch}}var Mhe=globalThis.fetch;class Lhe extends jde{constructor(e,n,i){const s=o=>{const a=oV(o,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...n});return"socket"in a?this.underlyingSocket=a.socket:this.underlyingSocket=a,a};super(s,e,n,i),this.underlyingSocket=void 0}call(...e){const n=this.underlyingSocket?.readyState;return n===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+n+")"))}notify(...e){const n=this.underlyingSocket?.readyState;return n===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+n+")"))}}function Dhe(r,e){let n;try{n=r.layout.decode(e)}catch(i){throw new Error("invalid instruction; "+i)}if(n.typeIndex!==r.index)throw new Error(`invalid account data; account type mismatch ${n.typeIndex} != ${r.index}`);return n}const FV=56;class WV{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const n=Dhe(Uhe,e),i=e.length-FV;Ys(i>=0,"lookup table is invalid"),Ys(i%32===0,"lookup table is invalid");const s=i/32,{addresses:o}=BufferLayout.struct([BufferLayout.seq(vs(),s,"addresses")]).decode(e.slice(FV));return{deactivationSlot:n.deactivationSlot,lastExtendedSlot:n.lastExtendedSlot,lastExtendedSlotStartIndex:n.lastExtendedStartIndex,authority:n.authority.length!==0?new Vn(n.authority[0]):void 0,addresses:o.map(a=>new Vn(a))}}}const Uhe={index:1,layout:Br.struct([Br.u32("typeIndex"),bw("deactivationSlot"),Br.nu64("lastExtendedSlot"),Br.u8("lastExtendedStartIndex"),Br.u8(),Br.seq(vs(),Br.offset(Br.u8(),-1),"authority")])},Fhe=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function Whe(r){const e=r.match(Fhe);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${r}\``);const[n,i,s,o]=e,a=r.startsWith("https:")?"wss:":"ws:",u=s==null?null:parseInt(s.slice(1),10),l=u==null?"":`:${u+1}`;return`${a}//${i}${l}${o}`}const aa=Eb(IB(Vn),zn(),r=>new Vn(r)),HV=kB([zn(),oa("base64")]),HB=Eb(IB(Ui.Buffer),HV,r=>Ui.Buffer.from(r[0],"base64")),Hhe=null;function zhe(r){if(/^https?:/.test(r)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return r}function Do(r){let e,n;if(typeof r=="string")e=r;else if(r){const{commitment:i,...s}=r;e=i,n=s}return{commitment:e,config:n}}function zV(r){return r.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function $V(r){return Wc([kn({jsonrpc:oa("2.0"),id:zn(),result:r}),kn({jsonrpc:oa("2.0"),id:zn(),error:kn({code:_b(),message:zn(),data:Oi(Hde())})})])}const $he=$V(_b());function cs(r){return Eb($V(r),$he,e=>"error"in e?e:{...e,result:P_(e.result,r)})}function Oa(r){return cs(kn({context:kn({slot:Zr()}),value:r}))}function D3(r){return kn({context:kn({slot:Zr()}),value:r})}function zB(r,e){return r===0?new H_({header:e.header,staticAccountKeys:e.accountKeys.map(n=>new Vn(n)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(n=>({programIdIndex:n.programIdIndex,accountKeyIndexes:n.accounts,data:bs58.decode(n.data)})),addressTableLookups:e.addressTableLookups}):new bp(e)}const Vhe=kn({foundation:Zr(),foundationTerm:Zr(),initial:Zr(),taper:Zr(),terminal:Zr()}),jhe=cs(oi(ai(kn({epoch:Zr(),effectiveSlot:Zr(),amount:Zr(),postBalance:Zr(),commission:Oi(ai(Zr()))})))),Khe=oi(kn({slot:Zr(),prioritizationFee:Zr()})),Ghe=kn({total:Zr(),validator:Zr(),foundation:Zr(),epoch:Zr()}),qhe=kn({epoch:Zr(),slotIndex:Zr(),slotsInEpoch:Zr(),absoluteSlot:Zr(),blockHeight:Oi(Zr()),transactionCount:Oi(Zr())}),Zhe=kn({slotsPerEpoch:Zr(),leaderScheduleSlotOffset:Zr(),warmup:Zh(),firstNormalEpoch:Zr(),firstNormalSlot:Zr()}),Yhe=rV(zn(),oi(Zr())),Rb=ai(Wc([kn({}),zn()])),Xhe=kn({err:Rb}),Jhe=oa("receivedSignature"),Qhe=kn({"solana-core":zn(),"feature-set":Oi(Zr())}),e0e=kn({program:zn(),programId:aa,parsed:_b()}),t0e=kn({programId:aa,accounts:oi(aa),data:zn()}),VV=Oa(kn({err:ai(Wc([kn({}),zn()])),logs:ai(oi(zn())),accounts:Oi(ai(oi(ai(kn({executable:Zh(),owner:zn(),lamports:Zr(),data:oi(zn()),rentEpoch:Oi(Zr())}))))),unitsConsumed:Oi(Zr()),returnData:Oi(ai(kn({programId:zn(),data:kB([zn(),oa("base64")])}))),innerInstructions:Oi(ai(oi(kn({index:Zr(),instructions:oi(Wc([e0e,t0e]))}))))})),r0e=Oa(kn({byIdentity:rV(zn(),oi(Zr())),range:kn({firstSlot:Zr(),lastSlot:Zr()})}));function n0e(r,e,n,i,s,o){const a=n||Mhe;let u;o!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let l;return i&&(l=async(y,A)=>{const I=await new Promise((P,D)=>{try{i(y,A,(U,V)=>P([U,V]))}catch(U){D(U)}});return await a(...I)}),new RpcClient(async(y,A)=>{const I={method:"POST",body:y,agent:u,headers:Object.assign({"Content-Type":"application/json"},e||{},npe)};try{let P=5,D,U=500;for(;l?D=await l(r,I):D=await a(r,I),!(D.status!==429||s===!0||(P-=1,P===0));)console.error(`Server responded with ${D.status} ${D.statusText}. Retrying after ${U}ms delay...`),await kb(U),U*=2;const V=await D.text();D.ok?A(null,V):A(new Error(`${D.status} ${D.statusText}: ${V}`))}catch(P){P instanceof Error&&A(P)}},{})}function i0e(r){return(e,n)=>new Promise((i,s)=>{r.request(e,n,(o,a)=>{if(o){s(o);return}i(a)})})}function s0e(r){return e=>new Promise((n,i)=>{e.length===0&&n([]);const s=e.map(o=>r.request(o.methodName,o.args));r.request(s,(o,a)=>{if(o){i(o);return}n(a)})})}const o0e=cs(Vhe),a0e=cs(Ghe),u0e=cs(Khe),c0e=cs(qhe),l0e=cs(Zhe),f0e=cs(Yhe),d0e=cs(Zr()),h0e=Oa(kn({total:Zr(),circulating:Zr(),nonCirculating:Zr(),nonCirculatingAccounts:oi(aa)})),$B=kn({amount:zn(),uiAmount:ai(Zr()),decimals:Zr(),uiAmountString:Oi(zn())}),p0e=Oa(oi(kn({address:aa,amount:zn(),uiAmount:ai(Zr()),decimals:Zr(),uiAmountString:Oi(zn())}))),g0e=Oa(oi(kn({pubkey:aa,account:kn({executable:Zh(),owner:aa,lamports:Zr(),data:HB,rentEpoch:Zr()})}))),VB=kn({program:zn(),parsed:_b(),space:Zr()}),y0e=Oa(oi(kn({pubkey:aa,account:kn({executable:Zh(),owner:aa,lamports:Zr(),data:VB,rentEpoch:Zr()})}))),m0e=Oa(oi(kn({lamports:Zr(),address:aa}))),V_=kn({executable:Zh(),owner:aa,lamports:Zr(),data:HB,rentEpoch:Zr()}),b0e=kn({pubkey:aa,account:V_}),v0e=Eb(Wc([IB(Ui.Buffer),VB]),Wc([HV,VB]),r=>Array.isArray(r)?P_(r,HB):r),jB=kn({executable:Zh(),owner:aa,lamports:Zr(),data:v0e,rentEpoch:Zr()}),w0e=kn({pubkey:aa,account:jB}),A0e=kn({state:Wc([oa("active"),oa("inactive"),oa("activating"),oa("deactivating")]),active:Zr(),inactive:Zr()}),_0e=cs(oi(kn({signature:zn(),slot:Zr(),err:Rb,memo:ai(zn()),blockTime:Oi(ai(Zr()))}))),E0e=cs(oi(kn({signature:zn(),slot:Zr(),err:Rb,memo:ai(zn()),blockTime:Oi(ai(Zr()))}))),T0e=kn({subscription:Zr(),result:D3(V_)}),S0e=kn({pubkey:aa,account:V_}),I0e=kn({subscription:Zr(),result:D3(S0e)}),k0e=kn({parent:Zr(),slot:Zr(),root:Zr()}),R0e=kn({subscription:Zr(),result:k0e}),C0e=Wc([kn({type:Wc([oa("firstShredReceived"),oa("completed"),oa("optimisticConfirmation"),oa("root")]),slot:Zr(),timestamp:Zr()}),kn({type:oa("createdBank"),parent:Zr(),slot:Zr(),timestamp:Zr()}),kn({type:oa("frozen"),slot:Zr(),timestamp:Zr(),stats:kn({numTransactionEntries:Zr(),numSuccessfulTransactions:Zr(),numFailedTransactions:Zr(),maxTransactionsPerEntry:Zr()})}),kn({type:oa("dead"),slot:Zr(),timestamp:Zr(),err:zn()})]),x0e=kn({subscription:Zr(),result:C0e}),B0e=kn({subscription:Zr(),result:D3(Wc([Xhe,Jhe]))}),O0e=kn({subscription:Zr(),result:Zr()}),P0e=kn({pubkey:zn(),gossip:ai(zn()),tpu:ai(zn()),rpc:ai(zn()),version:ai(zn())}),jV=kn({votePubkey:zn(),nodePubkey:zn(),activatedStake:Zr(),epochVoteAccount:Zh(),epochCredits:oi(kB([Zr(),Zr(),Zr()])),commission:Zr(),lastVote:Zr(),rootSlot:ai(Zr())}),N0e=cs(kn({current:oi(jV),delinquent:oi(jV)})),M0e=Wc([oa("processed"),oa("confirmed"),oa("finalized")]),L0e=kn({slot:Zr(),confirmations:ai(Zr()),err:Rb,confirmationStatus:Oi(M0e)}),D0e=Oa(oi(ai(L0e))),U0e=cs(Zr()),KV=kn({accountKey:aa,writableIndexes:oi(Zr()),readonlyIndexes:oi(Zr())}),KB=kn({signatures:oi(zn()),message:kn({accountKeys:oi(zn()),header:kn({numRequiredSignatures:Zr(),numReadonlySignedAccounts:Zr(),numReadonlyUnsignedAccounts:Zr()}),instructions:oi(kn({accounts:oi(Zr()),data:zn(),programIdIndex:Zr()})),recentBlockhash:zn(),addressTableLookups:Oi(oi(KV))})}),GV=kn({pubkey:aa,signer:Zh(),writable:Zh(),source:Oi(Wc([oa("transaction"),oa("lookupTable")]))}),qV=kn({accountKeys:oi(GV),signatures:oi(zn())}),ZV=kn({parsed:_b(),program:zn(),programId:aa}),YV=kn({accounts:oi(aa),data:zn(),programId:aa}),F0e=Wc([YV,ZV]),W0e=Wc([kn({parsed:_b(),program:zn(),programId:zn()}),kn({accounts:oi(zn()),data:zn(),programId:zn()})]),XV=Eb(F0e,W0e,r=>"accounts"in r?P_(r,YV):P_(r,ZV)),JV=kn({signatures:oi(zn()),message:kn({accountKeys:oi(GV),instructions:oi(XV),recentBlockhash:zn(),addressTableLookups:Oi(ai(oi(KV)))})}),U3=kn({accountIndex:Zr(),mint:zn(),owner:Oi(zn()),programId:Oi(zn()),uiTokenAmount:$B}),QV=kn({writable:oi(aa),readonly:oi(aa)}),F3=kn({err:Rb,fee:Zr(),innerInstructions:Oi(ai(oi(kn({index:Zr(),instructions:oi(kn({accounts:oi(Zr()),data:zn(),programIdIndex:Zr()}))})))),preBalances:oi(Zr()),postBalances:oi(Zr()),logMessages:Oi(ai(oi(zn()))),preTokenBalances:Oi(ai(oi(U3))),postTokenBalances:Oi(ai(oi(U3))),loadedAddresses:Oi(QV),computeUnitsConsumed:Oi(Zr())}),GB=kn({err:Rb,fee:Zr(),innerInstructions:Oi(ai(oi(kn({index:Zr(),instructions:oi(XV)})))),preBalances:oi(Zr()),postBalances:oi(Zr()),logMessages:Oi(ai(oi(zn()))),preTokenBalances:Oi(ai(oi(U3))),postTokenBalances:Oi(ai(oi(U3))),loadedAddresses:Oi(QV),computeUnitsConsumed:Oi(Zr())}),ww=Wc([oa(0),oa("legacy")]),Cb=kn({pubkey:zn(),lamports:Zr(),postBalance:ai(Zr()),rewardType:ai(zn()),commission:Oi(ai(Zr()))}),H0e=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),transactions:oi(kn({transaction:KB,meta:ai(F3),version:Oi(ww)})),rewards:Oi(oi(Cb)),blockTime:ai(Zr()),blockHeight:ai(Zr())}))),z0e=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),rewards:Oi(oi(Cb)),blockTime:ai(Zr()),blockHeight:ai(Zr())}))),$0e=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),transactions:oi(kn({transaction:qV,meta:ai(F3),version:Oi(ww)})),rewards:Oi(oi(Cb)),blockTime:ai(Zr()),blockHeight:ai(Zr())}))),V0e=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),transactions:oi(kn({transaction:JV,meta:ai(GB),version:Oi(ww)})),rewards:Oi(oi(Cb)),blockTime:ai(Zr()),blockHeight:ai(Zr())}))),j0e=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),transactions:oi(kn({transaction:qV,meta:ai(GB),version:Oi(ww)})),rewards:Oi(oi(Cb)),blockTime:ai(Zr()),blockHeight:ai(Zr())}))),K0e=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),rewards:Oi(oi(Cb)),blockTime:ai(Zr()),blockHeight:ai(Zr())}))),G0e=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),transactions:oi(kn({transaction:KB,meta:ai(F3)})),rewards:Oi(oi(Cb)),blockTime:ai(Zr())}))),ej=cs(ai(kn({blockhash:zn(),previousBlockhash:zn(),parentSlot:Zr(),signatures:oi(zn()),blockTime:ai(Zr())}))),qB=cs(ai(kn({slot:Zr(),meta:ai(F3),blockTime:Oi(ai(Zr())),transaction:KB,version:Oi(ww)}))),W3=cs(ai(kn({slot:Zr(),transaction:JV,meta:ai(GB),blockTime:Oi(ai(Zr())),version:Oi(ww)}))),q0e=Oa(kn({blockhash:zn(),lastValidBlockHeight:Zr()})),Z0e=Oa(Zh()),Y0e=kn({slot:Zr(),numTransactions:Zr(),numSlots:Zr(),samplePeriodSecs:Zr()}),X0e=cs(oi(Y0e)),J0e=Oa(ai(kn({feeCalculator:kn({lamportsPerSignature:Zr()})}))),Q0e=cs(zn()),epe=cs(zn()),tpe=kn({err:Rb,logs:oi(zn()),signature:zn()}),rpe=kn({result:D3(tpe),subscription:Zr()}),npe={"solana-client":"js/1.0.0-maintenance"};class QGe{constructor(e,n){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const g={};return async y=>{const{commitment:A,config:I}=Do(y),P=this._buildArgs([],A,void 0,I),D=UV(P);return g[D]=g[D]??(async()=>{try{const U=await this._rpcRequest("getBlockHeight",P),V=create(U,cs(number()));if("error"in V)throw new _i(V.error,"failed to get block height information");return V.result}finally{delete g[D]}})(),await g[D]}})();let i,s,o,a,u,l;n&&typeof n=="string"?this._commitment=n:n&&(this._commitment=n.commitment,this._confirmTransactionInitialTimeout=n.confirmTransactionInitialTimeout,i=n.wsEndpoint,s=n.httpHeaders,o=n.fetch,a=n.fetchMiddleware,u=n.disableRetryOnRateLimit,l=n.httpAgent),this._rpcEndpoint=zhe(e),this._rpcWsEndpoint=i||Whe(e),this._rpcClient=n0e(e,s,o,a,u,l),this._rpcRequest=i0e(this._rpcClient),this._rpcBatchRequest=s0e(this._rpcClient),this._rpcWebSocket=new Lhe(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgs([e.toBase58()],i,void 0,s),a=await this._rpcRequest("getBalance",o),u=create(a,Oa(number()));if("error"in u)throw new _i(u.error,`failed to get balance for ${e.toBase58()}`);return u.result}async getBalance(e,n){return await this.getBalanceAndContext(e,n).then(i=>i.value).catch(i=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+i)})}async getBlockTime(e){const n=await this._rpcRequest("getBlockTime",[e]),i=create(n,cs(nullable(number())));if("error"in i)throw new _i(i.error,`failed to get block time for slot ${e}`);return i.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),n=create(e,cs(number()));if("error"in n)throw new _i(n.error,"failed to get minimum ledger slot");return n.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),n=create(e,d0e);if("error"in n)throw new _i(n.error,"failed to get first available block");return n.result}async getSupply(e){let n={};typeof e=="string"?n={commitment:e}:e?n={...e,commitment:e&&e.commitment||this.commitment}:n={commitment:this.commitment};const i=await this._rpcRequest("getSupply",[n]),s=create(i,h0e);if("error"in s)throw new _i(s.error,"failed to get supply");return s.result}async getTokenSupply(e,n){const i=this._buildArgs([e.toBase58()],n),s=await this._rpcRequest("getTokenSupply",i),o=create(s,Oa($B));if("error"in o)throw new _i(o.error,"failed to get token supply");return o.result}async getTokenAccountBalance(e,n){const i=this._buildArgs([e.toBase58()],n),s=await this._rpcRequest("getTokenAccountBalance",i),o=create(s,Oa($B));if("error"in o)throw new _i(o.error,"failed to get token account balance");return o.result}async getTokenAccountsByOwner(e,n,i){const{commitment:s,config:o}=Do(i);let a=[e.toBase58()];"mint"in n?a.push({mint:n.mint.toBase58()}):a.push({programId:n.programId.toBase58()});const u=this._buildArgs(a,s,"base64",o),l=await this._rpcRequest("getTokenAccountsByOwner",u),g=create(l,g0e);if("error"in g)throw new _i(g.error,`failed to get token accounts owned by account ${e.toBase58()}`);return g.result}async getParsedTokenAccountsByOwner(e,n,i){let s=[e.toBase58()];"mint"in n?s.push({mint:n.mint.toBase58()}):s.push({programId:n.programId.toBase58()});const o=this._buildArgs(s,i,"jsonParsed"),a=await this._rpcRequest("getTokenAccountsByOwner",o),u=create(a,y0e);if("error"in u)throw new _i(u.error,`failed to get token accounts owned by account ${e.toBase58()}`);return u.result}async getLargestAccounts(e){const n={...e,commitment:e&&e.commitment||this.commitment},i=n.filter||n.commitment?[n]:[],s=await this._rpcRequest("getLargestAccounts",i),o=create(s,m0e);if("error"in o)throw new _i(o.error,"failed to get largest accounts");return o.result}async getTokenLargestAccounts(e,n){const i=this._buildArgs([e.toBase58()],n),s=await this._rpcRequest("getTokenLargestAccounts",i),o=create(s,p0e);if("error"in o)throw new _i(o.error,"failed to get token largest accounts");return o.result}async getAccountInfoAndContext(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgs([e.toBase58()],i,"base64",s),a=await this._rpcRequest("getAccountInfo",o),u=create(a,Oa(nullable(V_)));if("error"in u)throw new _i(u.error,`failed to get info about account ${e.toBase58()}`);return u.result}async getParsedAccountInfo(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgs([e.toBase58()],i,"jsonParsed",s),a=await this._rpcRequest("getAccountInfo",o),u=create(a,Oa(nullable(jB)));if("error"in u)throw new _i(u.error,`failed to get info about account ${e.toBase58()}`);return u.result}async getAccountInfo(e,n){try{return(await this.getAccountInfoAndContext(e,n)).value}catch(i){throw new Error("failed to get info about account "+e.toBase58()+": "+i)}}async getMultipleParsedAccounts(e,n){const{commitment:i,config:s}=Do(n),o=e.map(g=>g.toBase58()),a=this._buildArgs([o],i,"jsonParsed",s),u=await this._rpcRequest("getMultipleAccounts",a),l=create(u,Oa(array(nullable(jB))));if("error"in l)throw new _i(l.error,`failed to get info for accounts ${o}`);return l.result}async getMultipleAccountsInfoAndContext(e,n){const{commitment:i,config:s}=Do(n),o=e.map(g=>g.toBase58()),a=this._buildArgs([o],i,"base64",s),u=await this._rpcRequest("getMultipleAccounts",a),l=create(u,Oa(array(nullable(V_))));if("error"in l)throw new _i(l.error,`failed to get info for accounts ${o}`);return l.result}async getMultipleAccountsInfo(e,n){return(await this.getMultipleAccountsInfoAndContext(e,n)).value}async getStakeActivation(e,n,i){const{commitment:s,config:o}=Do(n),a=this._buildArgs([e.toBase58()],s,void 0,{...o,epoch:i??o?.epoch}),u=await this._rpcRequest("getStakeActivation",a),l=create(u,cs(A0e));if("error"in l)throw new _i(l.error,`failed to get Stake Activation ${e.toBase58()}`);return l.result}async getProgramAccounts(e,n){const{commitment:i,config:s}=Do(n),{encoding:o,...a}=s||{},u=this._buildArgs([e.toBase58()],i,o||"base64",{...a,...a.filters?{filters:zV(a.filters)}:null}),l=await this._rpcRequest("getProgramAccounts",u),g=array(b0e),y=a.withContext===!0?create(l,Oa(g)):create(l,cs(g));if("error"in y)throw new _i(y.error,`failed to get accounts owned by program ${e.toBase58()}`);return y.result}async getParsedProgramAccounts(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgs([e.toBase58()],i,"jsonParsed",s),a=await this._rpcRequest("getProgramAccounts",o),u=create(a,cs(array(w0e)));if("error"in u)throw new _i(u.error,`failed to get accounts owned by program ${e.toBase58()}`);return u.result}async confirmTransaction(e,n){let i;if(typeof e=="string")i=e;else{const o=e;if(o.abortSignal?.aborted)return Promise.reject(o.abortSignal.reason);i=o.signature}let s;try{s=bs58.decode(i)}catch{throw new Error("signature must be base58 encoded: "+i)}return Ys(s.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:n||this.commitment,signature:i}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:n||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:n||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((n,i)=>{e!=null&&(e.aborted?i(e.reason):e.addEventListener("abort",()=>{i(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:n}){let i,s,o=!1;const a=new Promise((l,g)=>{try{i=this.onSignature(n,(A,I)=>{i=void 0;const P={context:I,value:A};l({__type:ry.PROCESSED,response:P})},e);const y=new Promise(A=>{i==null?A():s=this._onSubscriptionStateChange(i,I=>{I==="subscribed"&&A()})});(async()=>{if(await y,o)return;const A=await this.getSignatureStatus(n);if(o||A==null)return;const{context:I,value:P}=A;if(P!=null)if(P?.err)g(P.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(P.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(P.confirmationStatus==="processed"||P.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}o=!0,l({__type:ry.PROCESSED,response:{context:I,value:P}})}})()}catch(y){g(y)}});return{abortConfirmation:()=>{s&&(s(),s=void 0),i!=null&&(this.removeSignatureListener(i),i=void 0)},confirmationPromise:a}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:n,lastValidBlockHeight:i,signature:s}}){let o=!1;const a=new Promise(A=>{const I=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let P=await I();if(!o){for(;P<=i;)if(await kb(1e3),o||(P=await I(),o))return;A({__type:ry.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:u,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:e,signature:s}),g=this.getCancellationPromise(n);let y;try{const A=await Promise.race([g,l,a]);if(A.__type===ry.PROCESSED)y=A.response;else throw new kV(s)}finally{o=!0,u()}return y}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:n,minContextSlot:i,nonceAccountPubkey:s,nonceValue:o,signature:a}}){let u=!1;const l=new Promise(P=>{let D=o,U=null;const V=async()=>{try{const{context:J,value:re}=await this.getNonceAndContext(s,{commitment:e,minContextSlot:i});return U=J.slot,re?.nonce}catch{return D}};(async()=>{if(D=await V(),!u)for(;;){if(o!==D){P({__type:ry.NONCE_INVALID,slotInWhichNonceDidAdvance:U});return}if(await kb(2e3),u||(D=await V(),u))return}})()}),{abortConfirmation:g,confirmationPromise:y}=this.getTransactionConfirmationPromise({commitment:e,signature:a}),A=this.getCancellationPromise(n);let I;try{const P=await Promise.race([A,y,l]);if(P.__type===ry.PROCESSED)I=P.response;else{let D;for(;;){const U=await this.getSignatureStatus(a);if(U==null)break;if(U.context.slot<(P.slotInWhichNonceDidAdvance??i)){await kb(400);continue}D=U;break}if(D?.value){const U=e||"finalized",{confirmationStatus:V}=D.value;switch(U){case"processed":case"recent":if(V!=="processed"&&V!=="confirmed"&&V!=="finalized")throw new W_(a);break;case"confirmed":case"single":case"singleGossip":if(V!=="confirmed"&&V!=="finalized")throw new W_(a);break;case"finalized":case"max":case"root":if(V!=="finalized")throw new W_(a);break;default:}I={context:D.context,value:{err:D.value.err}}}else throw new W_(a)}}finally{u=!0,g()}return I}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:n}){let i;const s=new Promise(l=>{let g=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{g=this._confirmTransactionInitialTimeout||3e4;break}}i=setTimeout(()=>l({__type:ry.TIMED_OUT,timeoutMs:g}),g)}),{abortConfirmation:o,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:e,signature:n});let u;try{const l=await Promise.race([a,s]);if(l.__type===ry.PROCESSED)u=l.response;else throw new RV(n,l.timeoutMs/1e3)}finally{clearTimeout(i),o()}return u}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),n=create(e,cs(array(P0e)));if("error"in n)throw new _i(n.error,"failed to get cluster nodes");return n.result}async getVoteAccounts(e){const n=this._buildArgs([],e),i=await this._rpcRequest("getVoteAccounts",n),s=create(i,N0e);if("error"in s)throw new _i(s.error,"failed to get vote accounts");return s.result}async getSlot(e){const{commitment:n,config:i}=Do(e),s=this._buildArgs([],n,void 0,i),o=await this._rpcRequest("getSlot",s),a=create(o,cs(number()));if("error"in a)throw new _i(a.error,"failed to get slot");return a.result}async getSlotLeader(e){const{commitment:n,config:i}=Do(e),s=this._buildArgs([],n,void 0,i),o=await this._rpcRequest("getSlotLeader",s),a=create(o,cs(string()));if("error"in a)throw new _i(a.error,"failed to get slot leader");return a.result}async getSlotLeaders(e,n){const i=[e,n],s=await this._rpcRequest("getSlotLeaders",i),o=create(s,cs(array(aa)));if("error"in o)throw new _i(o.error,"failed to get slot leaders");return o.result}async getSignatureStatus(e,n){const{context:i,value:s}=await this.getSignatureStatuses([e],n);Ys(s.length===1);const o=s[0];return{context:i,value:o}}async getSignatureStatuses(e,n){const i=[e];n&&i.push(n);const s=await this._rpcRequest("getSignatureStatuses",i),o=create(s,D0e);if("error"in o)throw new _i(o.error,"failed to get signature status");return o.result}async getTransactionCount(e){const{commitment:n,config:i}=Do(e),s=this._buildArgs([],n,void 0,i),o=await this._rpcRequest("getTransactionCount",s),a=create(o,cs(number()));if("error"in a)throw new _i(a.error,"failed to get transaction count");return a.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const n=this._buildArgs([],e),i=await this._rpcRequest("getInflationGovernor",n),s=create(i,o0e);if("error"in s)throw new _i(s.error,"failed to get inflation");return s.result}async getInflationReward(e,n,i){const{commitment:s,config:o}=Do(i),a=this._buildArgs([e.map(g=>g.toBase58())],s,void 0,{...o,epoch:n??o?.epoch}),u=await this._rpcRequest("getInflationReward",a),l=create(u,jhe);if("error"in l)throw new _i(l.error,"failed to get inflation reward");return l.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),n=create(e,a0e);if("error"in n)throw new _i(n.error,"failed to get inflation rate");return n.result}async getEpochInfo(e){const{commitment:n,config:i}=Do(e),s=this._buildArgs([],n,void 0,i),o=await this._rpcRequest("getEpochInfo",s),a=create(o,c0e);if("error"in a)throw new _i(a.error,"failed to get epoch info");return a.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),n=create(e,l0e);if("error"in n)throw new _i(n.error,"failed to get epoch schedule");const i=n.result;return new Nhe(i.slotsPerEpoch,i.leaderScheduleSlotOffset,i.warmup,i.firstNormalEpoch,i.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),n=create(e,f0e);if("error"in n)throw new _i(n.error,"failed to get leader schedule");return n.result}async getMinimumBalanceForRentExemption(e,n){const i=this._buildArgs([e],n),s=await this._rpcRequest("getMinimumBalanceForRentExemption",i),o=create(s,U0e);return"error"in o?(console.warn("Unable to fetch minimum balance for rent exemption"),0):o.result}async getRecentBlockhashAndContext(e){const{context:n,value:{blockhash:i}}=await this.getLatestBlockhashAndContext(e);return{context:n,value:{blockhash:i,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){const n=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),i=create(n,X0e);if("error"in i)throw new _i(i.error,"failed to get recent performance samples");return i.result}async getFeeCalculatorForBlockhash(e,n){const i=this._buildArgs([e],n),s=await this._rpcRequest("getFeeCalculatorForBlockhash",i),o=create(s,J0e);if("error"in o)throw new _i(o.error,"failed to get fee calculator");const{context:a,value:u}=o.result;return{context:a,value:u!==null?u.feeCalculator:null}}async getFeeForMessage(e,n){const i=us(e.serialize()).toString("base64"),s=this._buildArgs([i],n),o=await this._rpcRequest("getFeeForMessage",s),a=create(o,Oa(nullable(number())));if("error"in a)throw new _i(a.error,"failed to get fee for message");if(a.result===null)throw new Error("invalid blockhash");return a.result}async getRecentPrioritizationFees(e){const n=e?.lockedWritableAccounts?.map(a=>a.toBase58()),i=n?.length?[n]:[],s=await this._rpcRequest("getRecentPrioritizationFees",i),o=create(s,u0e);if("error"in o)throw new _i(o.error,"failed to get recent prioritization fees");return o.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(n){throw new Error("failed to get recent blockhash: "+n)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(n){throw new Error("failed to get recent blockhash: "+n)}}async getLatestBlockhashAndContext(e){const{commitment:n,config:i}=Do(e),s=this._buildArgs([],n,void 0,i),o=await this._rpcRequest("getLatestBlockhash",s),a=create(o,q0e);if("error"in a)throw new _i(a.error,"failed to get latest blockhash");return a.result}async isBlockhashValid(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgs([e],i,void 0,s),a=await this._rpcRequest("isBlockhashValid",o),u=create(a,Z0e);if("error"in u)throw new _i(u.error,"failed to determine if the blockhash `"+e+"`is valid");return u.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),n=create(e,cs(Qhe));if("error"in n)throw new _i(n.error,"failed to get version");return n.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),n=create(e,cs(string()));if("error"in n)throw new _i(n.error,"failed to get genesis hash");return n.result}async getBlock(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgsAtLeastConfirmed([e],i,void 0,s),a=await this._rpcRequest("getBlock",o);try{switch(s?.transactionDetails){case"accounts":{const u=create(a,$0e);if("error"in u)throw u.error;return u.result}case"none":{const u=create(a,z0e);if("error"in u)throw u.error;return u.result}default:{const u=create(a,H0e);if("error"in u)throw u.error;const{result:l}=u;return l?{...l,transactions:l.transactions.map(({transaction:g,meta:y,version:A})=>({meta:y,transaction:{...g,message:zB(A,g.message)},version:A}))}:null}}}catch(u){throw new _i(u,"failed to get confirmed block")}}async getParsedBlock(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgsAtLeastConfirmed([e],i,"jsonParsed",s),a=await this._rpcRequest("getBlock",o);try{switch(s?.transactionDetails){case"accounts":{const u=create(a,j0e);if("error"in u)throw u.error;return u.result}case"none":{const u=create(a,K0e);if("error"in u)throw u.error;return u.result}default:{const u=create(a,V0e);if("error"in u)throw u.error;return u.result}}}catch(u){throw new _i(u,"failed to get block")}}async getBlockProduction(e){let n,i;if(typeof e=="string")i=e;else if(e){const{commitment:u,...l}=e;i=u,n=l}const s=this._buildArgs([],i,"base64",n),o=await this._rpcRequest("getBlockProduction",s),a=create(o,r0e);if("error"in a)throw new _i(a.error,"failed to get block production information");return a.result}async getTransaction(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgsAtLeastConfirmed([e],i,void 0,s),a=await this._rpcRequest("getTransaction",o),u=create(a,qB);if("error"in u)throw new _i(u.error,"failed to get transaction");const l=u.result;return l&&{...l,transaction:{...l.transaction,message:zB(l.version,l.transaction.message)}}}async getParsedTransaction(e,n){const{commitment:i,config:s}=Do(n),o=this._buildArgsAtLeastConfirmed([e],i,"jsonParsed",s),a=await this._rpcRequest("getTransaction",o),u=create(a,W3);if("error"in u)throw new _i(u.error,"failed to get transaction");return u.result}async getParsedTransactions(e,n){const{commitment:i,config:s}=Do(n),o=e.map(l=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([l],i,"jsonParsed",s)}));return(await this._rpcBatchRequest(o)).map(l=>{const g=create(l,W3);if("error"in g)throw new _i(g.error,"failed to get transactions");return g.result})}async getTransactions(e,n){const{commitment:i,config:s}=Do(n),o=e.map(l=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([l],i,void 0,s)}));return(await this._rpcBatchRequest(o)).map(l=>{const g=create(l,qB);if("error"in g)throw new _i(g.error,"failed to get transactions");const y=g.result;return y&&{...y,transaction:{...y.transaction,message:zB(y.version,y.transaction.message)}}})}async getConfirmedBlock(e,n){const i=this._buildArgsAtLeastConfirmed([e],n),s=await this._rpcRequest("getBlock",i),o=create(s,G0e);if("error"in o)throw new _i(o.error,"failed to get confirmed block");const a=o.result;if(!a)throw new Error("Confirmed block "+e+" not found");const u={...a,transactions:a.transactions.map(({transaction:l,meta:g})=>{const y=new bp(l.message);return{meta:g,transaction:{...l,message:y}}})};return{...u,transactions:u.transactions.map(({transaction:l,meta:g})=>({meta:g,transaction:so.populate(l.message,l.signatures)}))}}async getBlocks(e,n,i){const s=this._buildArgsAtLeastConfirmed(n!==void 0?[e,n]:[e],i),o=await this._rpcRequest("getBlocks",s),a=create(o,cs(array(number())));if("error"in a)throw new _i(a.error,"failed to get blocks");return a.result}async getBlockSignatures(e,n){const i=this._buildArgsAtLeastConfirmed([e],n,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",i),o=create(s,ej);if("error"in o)throw new _i(o.error,"failed to get block");const a=o.result;if(!a)throw new Error("Block "+e+" not found");return a}async getConfirmedBlockSignatures(e,n){const i=this._buildArgsAtLeastConfirmed([e],n,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",i),o=create(s,ej);if("error"in o)throw new _i(o.error,"failed to get confirmed block");const a=o.result;if(!a)throw new Error("Confirmed block "+e+" not found");return a}async getConfirmedTransaction(e,n){const i=this._buildArgsAtLeastConfirmed([e],n),s=await this._rpcRequest("getTransaction",i),o=create(s,qB);if("error"in o)throw new _i(o.error,"failed to get transaction");const a=o.result;if(!a)return a;const u=new bp(a.transaction.message),l=a.transaction.signatures;return{...a,transaction:so.populate(u,l)}}async getParsedConfirmedTransaction(e,n){const i=this._buildArgsAtLeastConfirmed([e],n,"jsonParsed"),s=await this._rpcRequest("getTransaction",i),o=create(s,W3);if("error"in o)throw new _i(o.error,"failed to get confirmed transaction");return o.result}async getParsedConfirmedTransactions(e,n){const i=e.map(a=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([a],n,"jsonParsed")}));return(await this._rpcBatchRequest(i)).map(a=>{const u=create(a,W3);if("error"in u)throw new _i(u.error,"failed to get confirmed transactions");return u.result})}async getConfirmedSignaturesForAddress(e,n,i){let s={},o=await this.getFirstAvailableBlock();for(;!("until"in s)&&(n--,!(n<=0||n<o));)try{const l=await this.getConfirmedBlockSignatures(n,"finalized");l.signatures.length>0&&(s.until=l.signatures[l.signatures.length-1].toString())}catch(l){if(l instanceof Error&&l.message.includes("skipped"))continue;throw l}let a=await this.getSlot("finalized");for(;!("before"in s)&&(i++,!(i>a));)try{const l=await this.getConfirmedBlockSignatures(i);l.signatures.length>0&&(s.before=l.signatures[l.signatures.length-1].toString())}catch(l){if(l instanceof Error&&l.message.includes("skipped"))continue;throw l}return(await this.getConfirmedSignaturesForAddress2(e,s)).map(l=>l.signature)}async getConfirmedSignaturesForAddress2(e,n,i){const s=this._buildArgsAtLeastConfirmed([e.toBase58()],i,void 0,n),o=await this._rpcRequest("getConfirmedSignaturesForAddress2",s),a=create(o,_0e);if("error"in a)throw new _i(a.error,"failed to get confirmed signatures for address");return a.result}async getSignaturesForAddress(e,n,i){const s=this._buildArgsAtLeastConfirmed([e.toBase58()],i,void 0,n),o=await this._rpcRequest("getSignaturesForAddress",s),a=create(o,E0e);if("error"in a)throw new _i(a.error,"failed to get signatures for address");return a.result}async getAddressLookupTable(e,n){const{context:i,value:s}=await this.getAccountInfoAndContext(e,n);let o=null;return s!==null&&(o=new WV({key:e,state:WV.deserialize(s.data)})),{context:i,value:o}}async getNonceAndContext(e,n){const{context:i,value:s}=await this.getAccountInfoAndContext(e,n);let o=null;return s!==null&&(o=UB.fromAccountData(s.data)),{context:i,value:o}}async getNonce(e,n){return await this.getNonceAndContext(e,n).then(i=>i.value).catch(i=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+i)})}async requestAirdrop(e,n){const i=await this._rpcRequest("requestAirdrop",[e.toBase58(),n]),s=create(i,Q0e);if("error"in s)throw new _i(s.error,`airdrop to ${e.toBase58()} failed`);return s.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await kb(100);const i=Date.now()-this._blockhashInfo.lastFetch>=Hhe;if(this._blockhashInfo.latestBlockhash!==null&&!i)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),n=this._blockhashInfo.latestBlockhash,i=n?n.blockhash:null;for(let s=0;s<50;s++){const o=await this.getLatestBlockhash("finalized");if(i!==o.blockhash)return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},o;await kb(PV/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:n,config:i}=Do(e),s=this._buildArgs([],n,"base64",i),o=await this._rpcRequest("getStakeMinimumDelegation",s),a=create(o,Oa(number()));if("error"in a)throw new _i(a.error,"failed to get stake minimum delegation");return a.result}async simulateTransaction(e,n,i){if("message"in e){const U=e.serialize(),V=Buffer.from(U).toString("base64");if(Array.isArray(n)||i!==void 0)throw new Error("Invalid arguments");const J=n||{};J.encoding="base64","commitment"in J||(J.commitment=this.commitment),n&&typeof n=="object"&&"innerInstructions"in n&&(J.innerInstructions=n.innerInstructions);const re=[V,J],ce=await this._rpcRequest("simulateTransaction",re),Re=create(ce,VV);if("error"in Re)throw new Error("failed to simulate transaction: "+Re.error.message);return Re.result}let s;if(e instanceof so){let D=e;s=new so,s.feePayer=D.feePayer,s.instructions=e.instructions,s.nonceInfo=D.nonceInfo,s.signatures=D.signatures}else s=so.populate(e),s._message=s._json=void 0;if(n!==void 0&&!Array.isArray(n))throw new Error("Invalid arguments");const o=n;if(s.nonceInfo&&o)s.sign(...o);else{let D=this._disableBlockhashCaching;for(;;){const U=await this._blockhashWithExpiryBlockHeight(D);if(s.lastValidBlockHeight=U.lastValidBlockHeight,s.recentBlockhash=U.blockhash,!o)break;if(s.sign(...o),!s.signature)throw new Error("!signature");const V=s.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(V)&&!this._blockhashInfo.transactionSignatures.includes(V)){this._blockhashInfo.simulatedSignatures.push(V);break}else D=!0}}const a=s._compile(),u=a.serialize(),g=s._serialize(u).toString("base64"),y={encoding:"base64",commitment:this.commitment};if(i){const D=(Array.isArray(i)?i:a.nonProgramIds()).map(U=>U.toBase58());y.accounts={encoding:"base64",addresses:D}}o&&(y.sigVerify=!0),n&&typeof n=="object"&&"innerInstructions"in n&&(y.innerInstructions=n.innerInstructions);const A=[g,y],I=await this._rpcRequest("simulateTransaction",A),P=create(I,VV);if("error"in P){let D;if("data"in P.error&&(D=P.error.data.logs,D&&Array.isArray(D))){const U=`
|
||
`,V=U+D.join(U);console.error(P.error.message,V)}throw new L3({action:"simulate",signature:"",transactionMessage:P.error.message,logs:D})}return P.result}async sendTransaction(e,n,i){if("version"in e){if(n&&Array.isArray(n))throw new Error("Invalid arguments");const a=e.serialize();return await this.sendRawTransaction(a,n)}if(n===void 0||!Array.isArray(n))throw new Error("Invalid arguments");const s=n;if(e.nonceInfo)e.sign(...s);else{let a=this._disableBlockhashCaching;for(;;){const u=await this._blockhashWithExpiryBlockHeight(a);if(e.lastValidBlockHeight=u.lastValidBlockHeight,e.recentBlockhash=u.blockhash,e.sign(...s),!e.signature)throw new Error("!signature");const l=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(l))a=!0;else{this._blockhashInfo.transactionSignatures.push(l);break}}}const o=e.serialize();return await this.sendRawTransaction(o,i)}async sendRawTransaction(e,n){const i=us(e).toString("base64");return await this.sendEncodedTransaction(i,n)}async sendEncodedTransaction(e,n){const i={encoding:"base64"},s=n&&n.skipPreflight,o=s===!0?"processed":n&&n.preflightCommitment||this.commitment;n&&n.maxRetries!=null&&(i.maxRetries=n.maxRetries),n&&n.minContextSlot!=null&&(i.minContextSlot=n.minContextSlot),s&&(i.skipPreflight=s),o&&(i.preflightCommitment=o);const a=[e,i],u=await this._rpcRequest("sendTransaction",a),l=create(u,epe);if("error"in l){let g;throw"data"in l.error&&(g=l.error.data.logs),new L3({action:s?"send":"simulate",signature:"",transactionMessage:l.error.message,logs:g})}return l.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([n,i])=>{this._setSubscription(n,{...i,state:"pending"})})}_setSubscription(e,n){const i=this._subscriptionsByHash[e]?.state;if(this._subscriptionsByHash[e]=n,i!==n.state){const s=this._subscriptionStateChangeCallbacksByHash[e];s&&s.forEach(o=>{try{o(n.state)}catch{}})}}_onSubscriptionStateChange(e,n){const i=this._subscriptionHashByClientSubscriptionId[e];if(i==null)return()=>{};const s=this._subscriptionStateChangeCallbacksByHash[i]||=new Set;return s.add(n),()=>{s.delete(n),s.size===0&&delete this._subscriptionStateChangeCallbacksByHash[i]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(i){i instanceof Error&&console.log(`Error when closing socket connection: ${i.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,n=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async i=>{const s=this._subscriptionsByHash[i];if(s!==void 0)switch(s.state){case"pending":case"unsubscribed":if(s.callbacks.size===0){delete this._subscriptionsByHash[i],s.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[s.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:o,method:a}=s;try{this._setSubscription(i,{...s,state:"subscribing"});const u=await this._rpcWebSocket.call(a,o);this._setSubscription(i,{...s,serverSubscriptionId:u,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[u]=s.callbacks,await this._updateSubscriptions()}catch(u){if(console.error(`Received ${u instanceof Error?"":"JSON-RPC "}error calling \`${a}\``,{args:o,error:u}),!n())return;this._setSubscription(i,{...s,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":s.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:o,unsubscribeMethod:a}=s;if(this._subscriptionsAutoDisposedByRpc.has(o))this._subscriptionsAutoDisposedByRpc.delete(o);else{this._setSubscription(i,{...s,state:"unsubscribing"}),this._setSubscription(i,{...s,state:"unsubscribing"});try{await this._rpcWebSocket.call(a,[o])}catch(u){if(u instanceof Error&&console.error(`${a} error:`,u.message),!n())return;this._setSubscription(i,{...s,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(i,{...s,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,n){const i=this._subscriptionCallbacksByServerSubscriptionId[e];i!==void 0&&i.forEach(s=>{try{s(...n)}catch(o){console.error(o)}})}_wsOnAccountNotification(e){const{result:n,subscription:i}=create(e,T0e);this._handleServerNotification(i,[n.value,n.context])}_makeSubscription(e,n){const i=this._nextClientSubscriptionId++,s=UV([e.method,n]),o=this._subscriptionsByHash[s];return o===void 0?this._subscriptionsByHash[s]={...e,args:n,callbacks:new Set([e.callback]),state:"pending"}:o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[i]=s,this._subscriptionDisposeFunctionsByClientSubscriptionId[i]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[i],delete this._subscriptionHashByClientSubscriptionId[i];const a=this._subscriptionsByHash[s];Ys(a!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${i}`),a.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),i}onAccountChange(e,n,i){const{commitment:s,config:o}=Do(i),a=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",o);return this._makeSubscription({callback:n,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},a)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:n,subscription:i}=create(e,I0e);this._handleServerNotification(i,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}onProgramAccountChange(e,n,i,s){const{commitment:o,config:a}=Do(i),u=this._buildArgs([e.toBase58()],o||this._commitment||"finalized","base64",a||(s?{filters:zV(s)}:void 0));return this._makeSubscription({callback:n,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},u)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,n,i){const s=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],i||this._commitment||"finalized");return this._makeSubscription({callback:n,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},s)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:n,subscription:i}=create(e,rpe);this._handleServerNotification(i,[n.value,n.context])}_wsOnSlotNotification(e){const{result:n,subscription:i}=create(e,R0e);this._handleServerNotification(i,[n])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:n,subscription:i}=create(e,x0e);this._handleServerNotification(i,[n])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,n){const i=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];i?await i():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${n}' events could not be found.`)}_buildArgs(e,n,i,s){const o=n||this._commitment;if(o||i||s){let a={};i&&(a.encoding=i),o&&(a.commitment=o),s&&(a=Object.assign(a,s)),e.push(a)}return e}_buildArgsAtLeastConfirmed(e,n,i,s){const o=n||this._commitment;if(o&&!["confirmed","finalized"].includes(o))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,n,i,s)}_wsOnSignatureNotification(e){const{result:n,subscription:i}=create(e,B0e);n.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(i),this._handleServerNotification(i,n.value==="receivedSignature"?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}onSignature(e,n,i){const s=this._buildArgs([e],i||this._commitment||"finalized"),o=this._makeSubscription({callback:(a,u)=>{if(a.type==="status"){n(a.result,u);try{this.removeSignatureListener(o)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return o}onSignatureWithOptions(e,n,i){const{commitment:s,...o}={...i,commitment:i&&i.commitment||this._commitment||"finalized"},a=this._buildArgs([e],s,void 0,o),u=this._makeSubscription({callback:(l,g)=>{n(l,g);try{this.removeSignatureListener(u)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},a);return u}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:n,subscription:i}=create(e,O0e);this._handleServerNotification(i,[n])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class ny{constructor(e){this._keypair=void 0,this._keypair=e??AV()}static generate(){return new ny(AV())}static fromSecretKey(e,n){if(e.byteLength!==64)throw new Error("bad secret key size");const i=e.slice(32,64);if(!n||!n.skipValidation){const s=e.slice(0,32),o=B3(s);for(let a=0;a<32;a++)if(i[a]!==o[a])throw new Error("provided secretKey is invalid")}return new ny({publicKey:i,secretKey:e})}static fromSeed(e){const n=B3(e),i=new Uint8Array(64);return i.set(e),i.set(n,32),new ny({publicKey:n,secretKey:i})}get publicKey(){return new Vn(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const iy=Object.freeze({CreateLookupTable:{index:0,layout:Br.struct([Br.u32("instruction"),bw("recentSlot"),Br.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:Br.struct([Br.u32("instruction")])},ExtendLookupTable:{index:2,layout:Br.struct([Br.u32("instruction"),bw(),Br.seq(vs(),Br.offset(Br.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Br.struct([Br.u32("instruction")])},CloseLookupTable:{index:4,layout:Br.struct([Br.u32("instruction")])}});class eqe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const i=BufferLayout.u32("instruction").decode(e.data);let s;for(const[o,a]of Object.entries(iy))if(a.index==i){s=o;break}if(!s)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return s}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:n}=oo(iy.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(n)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error(`invalid instruction; found ${e.keys.length} keys, expected at least 2`);const{addresses:n}=oo(iy.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:n.map(i=>new Vn(i))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(tj.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}class tj{constructor(){}static createLookupTable(e){const[n,i]=Vn.findProgramAddressSync([e.authority.toBuffer(),(0,EB.toBufferLE)(BigInt(e.recentSlot),8)],this.programId),s=iy.CreateLookupTable,o=Fs(s,{recentSlot:BigInt(e.recentSlot),bumpSeed:i}),a=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Uu.programId,isSigner:!1,isWritable:!1}];return[new Lo({programId:this.programId,keys:a,data:o}),n]}static freezeLookupTable(e){const n=iy.FreezeLookupTable,i=Fs(n),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Lo({programId:this.programId,keys:s,data:i})}static extendLookupTable(e){const n=iy.ExtendLookupTable,i=Fs(n,{addresses:e.addresses.map(o=>o.toBytes())}),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&s.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Uu.programId,isSigner:!1,isWritable:!1}),new Lo({programId:this.programId,keys:s,data:i})}static deactivateLookupTable(e){const n=iy.DeactivateLookupTable,i=Fs(n),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Lo({programId:this.programId,keys:s,data:i})}static closeLookupTable(e){const n=iy.CloseLookupTable,i=Fs(n),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Lo({programId:this.programId,keys:s,data:i})}}tj.programId=new Vn("AddressLookupTab1e1111111111111111111111111");class tqe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const i=BufferLayout.u8("instruction").decode(e.data);let s;for(const[o,a]of Object.entries(wp))if(a.index==i){s=o;break}if(!s)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return s}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:n,additionalFee:i}=oo(wp.RequestUnits,e.data);return{units:n,additionalFee:i}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:n}=oo(wp.RequestHeapFrame,e.data);return{bytes:n}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:n}=oo(wp.SetComputeUnitLimit,e.data);return{units:n}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:n}=oo(wp.SetComputeUnitPrice,e.data);return{microLamports:n}}static checkProgramId(e){if(!e.equals(rj.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const wp=Object.freeze({RequestUnits:{index:0,layout:Br.struct([Br.u8("instruction"),Br.u32("units"),Br.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:Br.struct([Br.u8("instruction"),Br.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:Br.struct([Br.u8("instruction"),Br.u32("units")])},SetComputeUnitPrice:{index:3,layout:Br.struct([Br.u8("instruction"),bw("microLamports")])}});class rj{constructor(){}static requestUnits(e){const n=wp.RequestUnits,i=Fs(n,e);return new Lo({keys:[],programId:this.programId,data:i})}static requestHeapFrame(e){const n=wp.RequestHeapFrame,i=Fs(n,e);return new Lo({keys:[],programId:this.programId,data:i})}static setComputeUnitLimit(e){const n=wp.SetComputeUnitLimit,i=Fs(n,e);return new Lo({keys:[],programId:this.programId,data:i})}static setComputeUnitPrice(e){const n=wp.SetComputeUnitPrice,i=Fs(n,{microLamports:BigInt(e.microLamports)});return new Lo({keys:[],programId:this.programId,data:i})}}rj.programId=new Vn("ComputeBudget111111111111111111111111111111");const nj=64,ij=32,sj=64,oj=Br.struct([Br.u8("numSignatures"),Br.u8("padding"),Br.u16("signatureOffset"),Br.u16("signatureInstructionIndex"),Br.u16("publicKeyOffset"),Br.u16("publicKeyInstructionIndex"),Br.u16("messageDataOffset"),Br.u16("messageDataSize"),Br.u16("messageInstructionIndex")]);class ZB{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:n,message:i,signature:s,instructionIndex:o}=e;Ys(n.length===ij,`Public Key must be ${ij} bytes but received ${n.length} bytes`),Ys(s.length===sj,`Signature must be ${sj} bytes but received ${s.length} bytes`);const a=oj.span,u=a+n.length,l=u+s.length,g=1,y=Ui.Buffer.alloc(l+i.length),A=o??65535;return oj.encode({numSignatures:g,padding:0,signatureOffset:u,signatureInstructionIndex:A,publicKeyOffset:a,publicKeyInstructionIndex:A,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:A},y),y.fill(n,a),y.fill(s,u),y.fill(i,l),new Lo({keys:[],programId:ZB.programId,data:y})}static createInstructionWithPrivateKey(e){const{privateKey:n,message:i,instructionIndex:s}=e;Ys(n.length===nj,`Private key must be ${nj} bytes but received ${n.length} bytes`);try{const o=ny.fromSecretKey(n),a=o.publicKey.toBytes(),u=MB(i,o.secretKey);return this.createInstructionWithPublicKey({publicKey:a,message:i,signature:u,instructionIndex:s})}catch(o){throw new Error(`Error creating instruction; ${o}`)}}}ZB.programId=new Vn("Ed25519SigVerify111111111111111111111111111");const ipe=(r,e)=>{const n=U_.sign(r,e);return[n.toCompactRawBytes(),n.recovery]};U_.utils.isValidPrivateKey;const spe=U_.getPublicKey,aj=32,YB=20,uj=64,ope=11,XB=Br.struct([Br.u8("numSignatures"),Br.u16("signatureOffset"),Br.u8("signatureInstructionIndex"),Br.u16("ethAddressOffset"),Br.u8("ethAddressInstructionIndex"),Br.u16("messageDataOffset"),Br.u16("messageDataSize"),Br.u8("messageInstructionIndex"),Br.blob(20,"ethAddress"),Br.blob(64,"signature"),Br.u8("recoveryId")]);class j_{constructor(){}static publicKeyToEthAddress(e){Ys(e.length===uj,`Public key must be ${uj} bytes but received ${e.length} bytes`);try{return Ui.Buffer.from(dV(us(e))).slice(-YB)}catch(n){throw new Error(`Error constructing Ethereum address: ${n}`)}}static createInstructionWithPublicKey(e){const{publicKey:n,message:i,signature:s,recoveryId:o,instructionIndex:a}=e;return j_.createInstructionWithEthAddress({ethAddress:j_.publicKeyToEthAddress(n),message:i,signature:s,recoveryId:o,instructionIndex:a})}static createInstructionWithEthAddress(e){const{ethAddress:n,message:i,signature:s,recoveryId:o,instructionIndex:a=0}=e;let u;typeof n=="string"?n.startsWith("0x")?u=Ui.Buffer.from(n.substr(2),"hex"):u=Ui.Buffer.from(n,"hex"):u=n,Ys(u.length===YB,`Address must be ${YB} bytes but received ${u.length} bytes`);const l=1+ope,g=l,y=l+u.length,A=y+s.length+1,I=1,P=Ui.Buffer.alloc(XB.span+i.length);return XB.encode({numSignatures:I,signatureOffset:y,signatureInstructionIndex:a,ethAddressOffset:g,ethAddressInstructionIndex:a,messageDataOffset:A,messageDataSize:i.length,messageInstructionIndex:a,signature:us(s),ethAddress:us(u),recoveryId:o},P),P.fill(us(i),XB.span),new Lo({keys:[],programId:j_.programId,data:P})}static createInstructionWithPrivateKey(e){const{privateKey:n,message:i,instructionIndex:s}=e;Ys(n.length===aj,`Private key must be ${aj} bytes but received ${n.length} bytes`);try{const o=us(n),a=spe(o,!1).slice(1),u=Ui.Buffer.from(dV(us(i))),[l,g]=ipe(u,o);return this.createInstructionWithPublicKey({publicKey:a,message:i,signature:l,recoveryId:g,instructionIndex:s})}catch(o){throw new Error(`Error creating instruction; ${o}`)}}}j_.programId=new Vn("KeccakSecp256k11111111111111111111111111111");var cj;const ape=new Vn("StakeConfig11111111111111111111111111111111");class upe{constructor(e,n){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=n}}class H3{constructor(e,n,i){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=n,this.custodian=i}}cj=H3,H3.default=new cj(0,0,Vn.default);class rqe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const i=BufferLayout.u32("instruction").decode(e.data);let s;for(const[o,a]of Object.entries(Fu))if(a.index==i){s=o;break}if(!s)throw new Error("Instruction type incorrect; not a StakeInstruction");return s}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:n,lockup:i}=oo(Fu.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new upe(new Vn(n.staker),new Vn(n.withdrawer)),lockup:new H3(i.unixTimestamp,i.epoch,new Vn(i.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),oo(Fu.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:n,stakeAuthorizationType:i}=oo(Fu.Authorize,e.data),s={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Vn(n),stakeAuthorizationType:{index:i}};return e.keys.length>3&&(s.custodianPubkey=e.keys[3].pubkey),s}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:n,stakeAuthorizationType:i,authoritySeed:s,authorityOwner:o}=oo(Fu.AuthorizeWithSeed,e.data),a={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:s,authorityOwner:new Vn(o),newAuthorizedPubkey:new Vn(n),stakeAuthorizationType:{index:i}};return e.keys.length>3&&(a.custodianPubkey=e.keys[3].pubkey),a}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:n}=oo(Fu.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:n}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),oo(Fu.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:n}=oo(Fu.Withdraw,e.data),i={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:n};return e.keys.length>5&&(i.custodianPubkey=e.keys[5].pubkey),i}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),oo(Fu.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(JB.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}const Fu=Object.freeze({Initialize:{index:0,layout:Br.struct([Br.u32("instruction"),The(),She()])},Authorize:{index:1,layout:Br.struct([Br.u32("instruction"),vs("newAuthorized"),Br.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:Br.struct([Br.u32("instruction")])},Split:{index:3,layout:Br.struct([Br.u32("instruction"),Br.ns64("lamports")])},Withdraw:{index:4,layout:Br.struct([Br.u32("instruction"),Br.ns64("lamports")])},Deactivate:{index:5,layout:Br.struct([Br.u32("instruction")])},Merge:{index:7,layout:Br.struct([Br.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:Br.struct([Br.u32("instruction"),vs("newAuthorized"),Br.u32("stakeAuthorizationType"),Ib("authoritySeed"),vs("authorityOwner")])}}),nqe=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class JB{constructor(){}static initialize(e){const{stakePubkey:n,authorized:i,lockup:s}=e,o=s||H3.default,a=Fu.Initialize,u=Fs(a,{authorized:{staker:us(i.staker.toBuffer()),withdrawer:us(i.withdrawer.toBuffer())},lockup:{unixTimestamp:o.unixTimestamp,epoch:o.epoch,custodian:us(o.custodian.toBuffer())}}),l={keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:z_,isSigner:!1,isWritable:!1}],programId:this.programId,data:u};return new Lo(l)}static createAccountWithSeed(e){const n=new so;n.add(Uu.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:i,authorized:s,lockup:o}=e;return n.add(this.initialize({stakePubkey:i,authorized:s,lockup:o}))}static createAccount(e){const n=new so;n.add(Uu.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:i,authorized:s,lockup:o}=e;return n.add(this.initialize({stakePubkey:i,authorized:s,lockup:o}))}static delegate(e){const{stakePubkey:n,authorizedPubkey:i,votePubkey:s}=e,o=Fu.Delegate,a=Fs(o);return new so().add({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!1},{pubkey:vp,isSigner:!1,isWritable:!1},{pubkey:DB,isSigner:!1,isWritable:!1},{pubkey:ape,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static authorize(e){const{stakePubkey:n,authorizedPubkey:i,newAuthorizedPubkey:s,stakeAuthorizationType:o,custodianPubkey:a}=e,u=Fu.Authorize,l=Fs(u,{newAuthorized:us(s.toBuffer()),stakeAuthorizationType:o.index}),g=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:vp,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return a&&g.push({pubkey:a,isSigner:!0,isWritable:!1}),new so().add({keys:g,programId:this.programId,data:l})}static authorizeWithSeed(e){const{stakePubkey:n,authorityBase:i,authoritySeed:s,authorityOwner:o,newAuthorizedPubkey:a,stakeAuthorizationType:u,custodianPubkey:l}=e,g=Fu.AuthorizeWithSeed,y=Fs(g,{newAuthorized:us(a.toBuffer()),stakeAuthorizationType:u.index,authoritySeed:s,authorityOwner:us(o.toBuffer())}),A=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:vp,isSigner:!1,isWritable:!1}];return l&&A.push({pubkey:l,isSigner:!0,isWritable:!1}),new so().add({keys:A,programId:this.programId,data:y})}static splitInstruction(e){const{stakePubkey:n,authorizedPubkey:i,splitStakePubkey:s,lamports:o}=e,a=Fu.Split,u=Fs(a,{lamports:o});return new Lo({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:u})}static split(e,n){const i=new so;return i.add(Uu.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:n,space:this.space,programId:this.programId})),i.add(this.splitInstruction(e))}static splitWithSeed(e,n){const{stakePubkey:i,authorizedPubkey:s,splitStakePubkey:o,basePubkey:a,seed:u,lamports:l}=e,g=new so;return g.add(Uu.allocate({accountPubkey:o,basePubkey:a,seed:u,space:this.space,programId:this.programId})),n&&n>0&&g.add(Uu.transfer({fromPubkey:e.authorizedPubkey,toPubkey:o,lamports:n})),g.add(this.splitInstruction({stakePubkey:i,authorizedPubkey:s,splitStakePubkey:o,lamports:l}))}static merge(e){const{stakePubkey:n,sourceStakePubKey:i,authorizedPubkey:s}=e,o=Fu.Merge,a=Fs(o);return new so().add({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:vp,isSigner:!1,isWritable:!1},{pubkey:DB,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(e){const{stakePubkey:n,authorizedPubkey:i,toPubkey:s,lamports:o,custodianPubkey:a}=e,u=Fu.Withdraw,l=Fs(u,{lamports:o}),g=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:vp,isSigner:!1,isWritable:!1},{pubkey:DB,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return a&&g.push({pubkey:a,isSigner:!0,isWritable:!1}),new so().add({keys:g,programId:this.programId,data:l})}static deactivate(e){const{stakePubkey:n,authorizedPubkey:i}=e,s=Fu.Deactivate,o=Fs(s);return new so().add({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:vp,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}}JB.programId=new Vn("Stake11111111111111111111111111111111111111"),JB.space=200;class cpe{constructor(e,n,i,s){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=n,this.authorizedWithdrawer=i,this.commission=s}}class iqe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const i=BufferLayout.u32("instruction").decode(e.data);let s;for(const[o,a]of Object.entries(Jh))if(a.index==i){s=o;break}if(!s)throw new Error("Instruction type incorrect; not a VoteInstruction");return s}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:n}=oo(Jh.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new cpe(new Vn(n.nodePubkey),new Vn(n.authorizedVoter),new Vn(n.authorizedWithdrawer),n.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:n,voteAuthorizationType:i}=oo(Jh.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Vn(n),voteAuthorizationType:{index:i}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:i,newAuthorized:s,voteAuthorizationType:o}}=oo(Jh.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new Vn(n),currentAuthorityDerivedKeySeed:i,newAuthorizedPubkey:new Vn(s),voteAuthorizationType:{index:o},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:n}=oo(Jh.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:n,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(K_.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}const Jh=Object.freeze({InitializeAccount:{index:0,layout:Br.struct([Br.u32("instruction"),Ihe()])},Authorize:{index:1,layout:Br.struct([Br.u32("instruction"),vs("newAuthorized"),Br.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:Br.struct([Br.u32("instruction"),Br.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:Br.struct([Br.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:Br.struct([Br.u32("instruction"),khe()])}}),sqe=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class K_{constructor(){}static initializeAccount(e){const{votePubkey:n,nodePubkey:i,voteInit:s}=e,o=Jh.InitializeAccount,a=Fs(o,{voteInit:{nodePubkey:us(s.nodePubkey.toBuffer()),authorizedVoter:us(s.authorizedVoter.toBuffer()),authorizedWithdrawer:us(s.authorizedWithdrawer.toBuffer()),commission:s.commission}}),u={keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:z_,isSigner:!1,isWritable:!1},{pubkey:vp,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:a};return new Lo(u)}static createAccount(e){const n=new so;return n.add(Uu.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),n.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:n,authorizedPubkey:i,newAuthorizedPubkey:s,voteAuthorizationType:o}=e,a=Jh.Authorize,u=Fs(a,{newAuthorized:us(s.toBuffer()),voteAuthorizationType:o.index}),l=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:vp,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return new so().add({keys:l,programId:this.programId,data:u})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:n,currentAuthorityDerivedKeyOwnerPubkey:i,currentAuthorityDerivedKeySeed:s,newAuthorizedPubkey:o,voteAuthorizationType:a,votePubkey:u}=e,l=Jh.AuthorizeWithSeed,g=Fs(l,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:us(i.toBuffer()),currentAuthorityDerivedKeySeed:s,newAuthorized:us(o.toBuffer()),voteAuthorizationType:a.index}}),y=[{pubkey:u,isSigner:!1,isWritable:!0},{pubkey:vp,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new so().add({keys:y,programId:this.programId,data:g})}static withdraw(e){const{votePubkey:n,authorizedWithdrawerPubkey:i,lamports:s,toPubkey:o}=e,a=Jh.Withdraw,u=Fs(a,{lamports:s}),l=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return new so().add({keys:l,programId:this.programId,data:u})}static safeWithdraw(e,n,i){if(e.lamports>n-i)throw new Error("Withdraw will leave vote account with insufficient funds.");return K_.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:n,authorizedWithdrawerPubkey:i,nodePubkey:s}=e,o=Jh.UpdateValidatorIdentity,a=Fs(o),u=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!0,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return new so().add({keys:u,programId:this.programId,data:a})}}K_.programId=new Vn("Vote111111111111111111111111111111111111111"),K_.space=3762;const lpe=new Vn("Va1idator1nfo111111111111111111111111111111"),fpe=kn({name:zn(),website:Oi(zn()),details:Oi(zn()),iconUrl:Oi(zn()),keybaseUsername:Oi(zn())});class lj{constructor(e,n){this.key=void 0,this.info=void 0,this.key=e,this.info=n}static fromConfigData(e){let n=[...e];if(Tl(n)!==2)return null;const s=[];for(let o=0;o<2;o++){const a=new Vn(Sl(n,0,mp)),u=Xh(n)===1;s.push({publicKey:a,isSigner:u})}if(s[0].publicKey.equals(lpe)&&s[1].isSigner){const o=Ib().decode(Buffer.from(n)),a=JSON.parse(o);return assert$1(a,fpe),new lj(s[1].publicKey,a)}return null}}const oqe=new Vn("Vote111111111111111111111111111111111111111"),dpe=Br.struct([vs("nodePubkey"),vs("authorizedWithdrawer"),Br.u8("commission"),Br.nu64(),Br.seq(Br.struct([Br.nu64("slot"),Br.u32("confirmationCount")]),Br.offset(Br.u32(),-8),"votes"),Br.u8("rootSlotValid"),Br.nu64("rootSlot"),Br.nu64(),Br.seq(Br.struct([Br.nu64("epoch"),vs("authorizedVoter")]),Br.offset(Br.u32(),-8),"authorizedVoters"),Br.struct([Br.seq(Br.struct([vs("authorizedPubkey"),Br.nu64("epochOfLastAuthorizedSwitch"),Br.nu64("targetEpoch")]),32,"buf"),Br.nu64("idx"),Br.u8("isEmpty")],"priorVoters"),Br.nu64(),Br.seq(Br.struct([Br.nu64("epoch"),Br.nu64("credits"),Br.nu64("prevCredits")]),Br.offset(Br.u32(),-8),"epochCredits"),Br.struct([Br.nu64("slot"),Br.nu64("timestamp")],"lastTimestamp")]);class fj{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const i=dpe.decode(us(e),4);let s=i.rootSlot;return i.rootSlotValid||(s=null),new fj({nodePubkey:new Vn(i.nodePubkey),authorizedWithdrawer:new Vn(i.authorizedWithdrawer),commission:i.commission,votes:i.votes,rootSlot:s,authorizedVoters:i.authorizedVoters.map(hpe),priorVoters:ppe(i.priorVoters),epochCredits:i.epochCredits,lastTimestamp:i.lastTimestamp})}}function hpe({authorizedVoter:r,epoch:e}){return{epoch:e,authorizedVoter:new Vn(r)}}function dj({authorizedPubkey:r,epochOfLastAuthorizedSwitch:e,targetEpoch:n}){return{authorizedPubkey:new Vn(r),epochOfLastAuthorizedSwitch:e,targetEpoch:n}}function ppe({buf:r,idx:e,isEmpty:n}){return n?[]:[...r.slice(e+1).map(dj),...r.slice(0,e).map(dj)]}const hj=null;function aqe(r,e){const n=e===!1?"http":"https";if(!r)return hj[n].devnet;const i=hj[n][r];if(!i)throw new Error(`Unknown ${n} cluster: ${r}`);return i}async function uqe(r,e,n,i){let s,o;n&&Object.prototype.hasOwnProperty.call(n,"lastValidBlockHeight")||n&&Object.prototype.hasOwnProperty.call(n,"nonceValue")?(s=n,o=i):o=n;const a=o&&{skipPreflight:o.skipPreflight,preflightCommitment:o.preflightCommitment||o.commitment,minContextSlot:o.minContextSlot},u=await r.sendRawTransaction(e,a),l=o&&o.commitment,y=(await(s?r.confirmTransaction(s,l):r.confirmTransaction(u,l))).value;if(y.err)throw u!=null?new L3({action:a?.skipPreflight?"send":"simulate",signature:u,transactionMessage:`Status: (${JSON.stringify(y)})`}):new Error(`Raw transaction ${u} failed (${JSON.stringify(y)})`);return u}const cqe=1e9;function gpe(r){if(r.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let g=0;g<e.length;g++)e[g]=255;for(let g=0;g<r.length;g++){const y=r.charAt(g),A=y.charCodeAt(0);if(e[A]!==255)throw new TypeError(y+" is ambiguous");e[A]=g}const n=r.length,i=r.charAt(0),s=Math.log(n)/Math.log(256),o=Math.log(256)/Math.log(n);function a(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";let y=0,A=0,I=0;const P=g.length;for(;I!==P&&g[I]===0;)I++,y++;const D=(P-I)*o+1>>>0,U=new Uint8Array(D);for(;I!==P;){let re=g[I],ce=0;for(let Re=D-1;(re!==0||ce<A)&&Re!==-1;Re--,ce++)re+=256*U[Re]>>>0,U[Re]=re%n>>>0,re=re/n>>>0;if(re!==0)throw new Error("Non-zero carry");A=ce,I++}let V=D-A;for(;V!==D&&U[V]===0;)V++;let J=i.repeat(y);for(;V<D;++V)J+=r.charAt(U[V]);return J}function u(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;let y=0,A=0,I=0;for(;g[y]===i;)A++,y++;const P=(g.length-y)*s+1>>>0,D=new Uint8Array(P);for(;y<g.length;){const re=g.charCodeAt(y);if(re>255)return;let ce=e[re];if(ce===255)return;let Re=0;for(let De=P-1;(ce!==0||Re<I)&&De!==-1;De--,Re++)ce+=n*D[De]>>>0,D[De]=ce%256>>>0,ce=ce/256>>>0;if(ce!==0)throw new Error("Non-zero carry");I=Re,y++}let U=P-I;for(;U!==P&&D[U]===0;)U++;const V=new Uint8Array(A+(P-U));let J=A;for(;U!==P;)V[J++]=D[U++];return V}function l(g){const y=u(g);if(y)return y;throw new Error("Non-base"+n+" character")}return{encode:a,decodeUnsafe:u,decode:l}}const ype=gpe;var mpe="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Aw=ype(mpe);var bpe=tn(18861),pj=tn.n(bpe),sy=new WeakMap,z3=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,sy,{writable:!0,value:void 0});var i;if((0,H.isString)(n)?i=r.decodePK(n):i=n,i.byteLength===64)he(this,sy,ny.fromSecretKey(i));else if(i.byteLength===32)he(this,sy,ny.fromSeed(i));else throw new Error("Invalid Solana private key length: ".concat(i.byteLength))}var e=r.prototype;return e.signTransaction=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a=bl(du(i)),u=pj().sign.detached(a,X(s,sy).secretKey),g.abrupt("return",Ca(u));case 3:case"end":return g.stop()}},o)}))()},e.signMessage=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a=bl(du(i)),u=pj().sign.detached(a,X(s,sy).secretKey),g.abrupt("return",Aw.encode(u));case 3:case"end":return g.stop()}},o)}))()},e.exportPrivateKey=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",Aw.encode(X(i,sy).secretKey));case 1:case"end":return a.stop()}},s)}))()},e.getAddress=function(){return X(this,sy).publicKey.toBase58()},e.getPublicKeyHex=function(){var i=X(this,sy).publicKey.toBytes();return ys(Ca(i))},r.isValidPk=function(i){try{var s=ny.fromSecretKey(Aw.decode(i));return!!s}catch{return!1}},r.decodePK=function(i){return Aw.decode(i)},r}(),gj=tn(36533).Buffer;const yj=48,mj=58,bj=87;function vpe(){const r=[];return()=>{if(r.length===0)for(let e=0;e<256;e++)r.push(e.toString(16).padStart(2,"0"));return r}}const wpe=vpe();function QB(r){return r instanceof Uint8Array}function _w(r){K5(QB(r),"Value must be a Uint8Array.")}function Jo(r){if(_w(r),r.length===0)return"0x";const e=wpe(),n=new Array(r.length);for(let i=0;i<r.length;i++)n[i]=e[r[i]];return du(n.join(""))}function Ape(r){_w(r);const e=Jo(r);return BigInt(e)}function lqe(r){_w(r);let e=BigInt(0);for(const n of r)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(r.length*8,e)}function fqe(r){_w(r);const e=Ape(r);return assert(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}function dqe(r){return _w(r),new TextDecoder().decode(r)}function xb(r){return _w(r),fI.encode(r)}function mo(r){if(r?.toLowerCase?.()==="0x")return new Uint8Array;mfe(r);const e=ys(r).toLowerCase(),n=e.length%2===0?e:`0${e}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const o=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),u=o-(o<mj?yj:bj),l=a-(a<mj?yj:bj);i[s]=u*16+l}return i}function _pe(r){assert(typeof r=="bigint","Value must be a bigint."),assert(r>=BigInt(0),"Value must be a non-negative bigint.");const e=r.toString(16);return mo(e)}function Epe(r,e){assert(e>0);const n=r>>BigInt(31);return!((~r&n)+(r&~n)>>BigInt(e*8+-1))}function hqe(r,e){assert(typeof r=="bigint","Value must be a bigint."),assert(typeof e=="number","Byte length must be a number."),assert(e>0,"Byte length must be greater than 0."),assert(Epe(r,e),"Byte length is too small to represent the given value.");let n=r;const i=new Uint8Array(e);for(let s=0;s<i.length;s++)i[s]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return i.reverse()}function Tpe(r){assert(typeof r=="number","Value must be a number."),assert(r>=0,"Value must be a non-negative number."),assert(Number.isSafeInteger(r),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=r.toString(16);return mo(e)}function Spe(r){return assert(typeof r=="string","Value must be a string."),new TextEncoder().encode(r)}function yf(r){return K5(typeof r=="string","Value must be a string."),fI.decode(r)}function Ipe(r){if(typeof r=="bigint")return _pe(r);if(typeof r=="number")return Tpe(r);if(typeof r=="string")return r.startsWith("0x")?mo(r):Spe(r);if(QB(r))return r;throw new TypeError(`Unsupported value type: "${typeof r}".`)}function pqe(r){const e=new Array(r.length);let n=0;for(let s=0;s<r.length;s++){const o=Ipe(r[s]);e[s]=o,n+=o.length}const i=new Uint8Array(n);for(let s=0,o=0;s<e.length;s++)i.set(e[s],o),o+=e[s].length;return i}function gqe(r){if(typeof gj<"u"&&r instanceof gj){const e=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);return new DataView(e)}return new DataView(r.buffer,r.byteOffset,r.byteLength)}function eO(r){const e=r.startsWith("0x")?r.slice(2):r,n=e.length%2===0?e:`0${e}`,i=n.match(/[0-9a-fA-F]{2}/g)?.map(s=>parseInt(s,16))??[];if(i.length!==n.length/2)throw new Error(`Invalid hex string ${r}`);return Uint8Array.from(i)}function Ew(r){return r.reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function vj(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function Gd(r,e=""){if(!Number.isSafeInteger(r)||r<0){const n=e&&`"${e}" `;throw new Error(`${n}expected integer >= 0, got ${r}`)}}function uo(r,e,n=""){const i=vj(r),s=r?.length,o=e!==void 0;if(!i||o&&s!==e){const a=n&&`"${n}" `,u=o?` of length ${e}`:"",l=i?`length=${s}`:`type=${typeof r}`;throw new Error(a+"expected Uint8Array"+u+", got "+l)}return r}function wj(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash must wrapped by utils.createHasher");Gd(r.outputLen),Gd(r.blockLen)}function Tw(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function Aj(r,e){uo(r,void 0,"digestInto() output");const n=e.outputLen;if(r.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function yqe(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function Sw(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function qd(...r){for(let e=0;e<r.length;e++)r[e].fill(0)}function $3(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function Il(r,e){return r<<32-e|r>>>e}function mqe(r,e){return r<<e|r>>>32-e>>>0}const _j=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ej(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}const mf=_j?r=>r:r=>Ej(r);function kpe(r){for(let e=0;e<r.length;e++)r[e]=Ej(r[e]);return r}const Iw=_j?r=>r:kpe,Tj=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Rpe=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function G_(r){if(uo(r),Tj)return r.toHex();let e="";for(let n=0;n<r.length;n++)e+=Rpe[r[n]];return e}const Ap={_0:48,_9:57,A:65,F:70,a:97,f:102};function Sj(r){if(r>=Ap._0&&r<=Ap._9)return r-Ap._0;if(r>=Ap.A&&r<=Ap.F)return r-(Ap.A-10);if(r>=Ap.a&&r<=Ap.f)return r-(Ap.a-10)}function tO(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);if(Tj)return Uint8Array.fromHex(r);const e=r.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=Sj(r.charCodeAt(o)),u=Sj(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}const Cpe=async()=>{};async function bqe(r,e,n){let i=Date.now();for(let s=0;s<r;s++){n(s);const o=Date.now()-i;o>=0&&o<e||(await Cpe(),i+=o)}}function xpe(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}function Ij(r,e=""){return typeof r=="string"?xpe(r):uo(r,void 0,e)}function kj(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];uo(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}function Bpe(r,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("options must be object or undefined");return Object.assign(r,e)}function Rj(r,e={}){const n=(s,o)=>r(o).update(s).digest(),i=r(void 0);return n.outputLen=i.outputLen,n.blockLen=i.blockLen,n.create=s=>r(s),Object.assign(n,e),Object.freeze(n)}function Ope(r=32){const e=typeof globalThis=="object"?globalThis.crypto:null;if(typeof e?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");return e.getRandomValues(new Uint8Array(r))}const Ppe=r=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,r])});class Cj{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,n){if(wj(e),uo(n,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),qd(s)}update(e){return Tw(this),this.iHash.update(e),this}digestInto(e){Tw(this),uo(e,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:n,iHash:i,finished:s,destroyed:o,blockLen:a,outputLen:u}=this;return e=e,e.finished=s,e.destroyed=o,e.blockLen=a,e.outputLen=u,e.oHash=n._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const V3=(r,e,n)=>new Cj(r,e).update(n).digest();V3.create=(r,e)=>new Cj(r,e);function xj(r,e,n,i){wj(r);const s=Bpe({dkLen:32,asyncTick:10},i),{c:o,dkLen:a,asyncTick:u}=s;if(Gd(o,"c"),Gd(a,"dkLen"),Gd(u,"asyncTick"),o<1)throw new Error("iterations (c) must be >= 1");const l=Ij(e,"password"),g=Ij(n,"salt"),y=new Uint8Array(a),A=V3.create(r,l),I=A._cloneInto().update(g);return{c:o,dkLen:a,asyncTick:u,DK:y,PRF:A,PRFSalt:I}}function Bj(r,e,n,i,s){return r.destroy(),e.destroy(),i&&i.destroy(),qd(s),n}function Npe(r,e,n,i){const{c:s,dkLen:o,DK:a,PRF:u,PRFSalt:l}=xj(r,e,n,i);let g;const y=new Uint8Array(4),A=$3(y),I=new Uint8Array(u.outputLen);for(let P=1,D=0;D<o;P++,D+=u.outputLen){const U=a.subarray(D,D+u.outputLen);A.setInt32(0,P,!1),(g=l._cloneInto(g)).update(y).digestInto(I),U.set(I.subarray(0,U.length));for(let V=1;V<s;V++){u._cloneInto(g).update(I).digestInto(I);for(let J=0;J<U.length;J++)U[J]^=I[J]}}return Bj(u,l,a,g,I)}async function vqe(r,e,n,i){const{c:s,dkLen:o,asyncTick:a,DK:u,PRF:l,PRFSalt:g}=xj(r,e,n,i);let y;const A=new Uint8Array(4),I=createView(A),P=new Uint8Array(l.outputLen);for(let D=1,U=0;U<o;D++,U+=l.outputLen){const V=u.subarray(U,U+l.outputLen);I.setInt32(0,D,!1),(y=g._cloneInto(y)).update(A).digestInto(P),V.set(P.subarray(0,V.length)),await asyncLoop(s-1,a,()=>{l._cloneInto(y).update(P).digestInto(P);for(let J=0;J<V.length;J++)V[J]^=P[J]})}return Bj(l,g,u,y,P)}function Mpe(r,e,n){return r&e^~r&n}function Lpe(r,e,n){return r&e^r&n^e&n}class Oj{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,n,i,s){this.blockLen=e,this.outputLen=n,this.padOffset=i,this.isLE=s,this.buffer=new Uint8Array(e),this.view=$3(this.buffer)}update(e){Tw(this),uo(e);const{view:n,buffer:i,blockLen:s}=this,o=e.length;for(let a=0;a<o;){const u=Math.min(s-this.pos,o-a);if(u===s){const l=$3(e);for(;s<=o-a;a+=s)this.process(l,a);continue}i.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Tw(this),Aj(e,this),this.finished=!0;const{buffer:n,view:i,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,qd(this.buffer.subarray(a)),this.padOffset>s-a&&(this.process(i,0),a=0);for(let A=a;A<s;A++)n[A]=0;i.setBigUint64(s-8,BigInt(this.length*8),o),this.process(i,0);const u=$3(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const g=l/4,y=this.get();if(g>y.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<g;A++)u.setUint32(4*A,y[A],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:n,buffer:i,length:s,finished:o,destroyed:a,pos:u}=this;return e.destroyed=a,e.finished=o,e.length=s,e.pos=u,s%n&&e.buffer.set(i),e}clone(){return this._cloneInto()}}const _p=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),oy=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),ac=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),uc=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),j3=BigInt(2**32-1),rO=BigInt(32);function nO(r,e=!1){return e?{h:Number(r&j3),l:Number(r>>rO&j3)}:{h:Number(r>>rO&j3)|0,l:Number(r&j3)|0}}function Dpe(r,e=!1){const n=r.length;let i=new Uint32Array(n),s=new Uint32Array(n);for(let o=0;o<n;o++){const{h:a,l:u}=nO(r[o],e);[i[o],s[o]]=[a,u]}return[i,s]}const wqe=(r,e)=>BigInt(r>>>0)<<rO|BigInt(e>>>0),Pj=(r,e,n)=>r>>>n,Nj=(r,e,n)=>r<<32-n|e>>>n,ay=(r,e,n)=>r>>>n|e<<32-n,uy=(r,e,n)=>r<<32-n|e>>>n,q_=(r,e,n)=>r<<64-n|e>>>n-32,Z_=(r,e,n)=>r>>>n-32|e<<64-n,Upe=(r,e)=>e,Fpe=(r,e)=>r,Aqe=(r,e,n)=>r<<n|e>>>32-n,_qe=(r,e,n)=>e<<n|r>>>32-n,Eqe=(r,e,n)=>e<<n-32|r>>>64-n,Tqe=(r,e,n)=>r<<n-32|e>>>64-n;function Zd(r,e,n,i){const s=(e>>>0)+(i>>>0);return{h:r+n+(s/2**32|0)|0,l:s|0}}const iO=(r,e,n)=>(r>>>0)+(e>>>0)+(n>>>0),sO=(r,e,n,i)=>e+n+i+(r/2**32|0)|0,Wpe=(r,e,n,i)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0),Hpe=(r,e,n,i,s)=>e+n+i+s+(r/2**32|0)|0,zpe=(r,e,n,i,s)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0)+(s>>>0),$pe=(r,e,n,i,s,o)=>e+n+i+s+o+(r/2**32|0)|0,Sqe=null,Iqe=null,Vpe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),cy=new Uint32Array(64);class Mj extends Oj{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:n,C:i,D:s,E:o,F:a,G:u,H:l}=this;return[e,n,i,s,o,a,u,l]}set(e,n,i,s,o,a,u,l){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,n){for(let A=0;A<16;A++,n+=4)cy[A]=e.getUint32(n,!1);for(let A=16;A<64;A++){const I=cy[A-15],P=cy[A-2],D=Il(I,7)^Il(I,18)^I>>>3,U=Il(P,17)^Il(P,19)^P>>>10;cy[A]=U+cy[A-7]+D+cy[A-16]|0}let{A:i,B:s,C:o,D:a,E:u,F:l,G:g,H:y}=this;for(let A=0;A<64;A++){const I=Il(u,6)^Il(u,11)^Il(u,25),P=y+I+Mpe(u,l,g)+Vpe[A]+cy[A]|0,U=(Il(i,2)^Il(i,13)^Il(i,22))+Lpe(i,s,o)|0;y=g,g=l,l=u,u=a+P|0,a=o,o=s,s=i,i=P+U|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,g=g+this.G|0,y=y+this.H|0,this.set(i,s,o,a,u,l,g,y)}roundClean(){qd(cy)}destroy(){this.set(0,0,0,0,0,0,0,0),qd(this.buffer)}}class kqe extends Mj{A=_p[0]|0;B=_p[1]|0;C=_p[2]|0;D=_p[3]|0;E=_p[4]|0;F=_p[5]|0;G=_p[6]|0;H=_p[7]|0;constructor(){super(32)}}class Rqe extends Mj{A=oy[0]|0;B=oy[1]|0;C=oy[2]|0;D=oy[3]|0;E=oy[4]|0;F=oy[5]|0;G=oy[6]|0;H=oy[7]|0;constructor(){super(28)}}const Lj=Dpe(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),jpe=Lj[0],Kpe=Lj[1],ly=new Uint32Array(80),fy=new Uint32Array(80);class K3 extends Oj{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:n,Bh:i,Bl:s,Ch:o,Cl:a,Dh:u,Dl:l,Eh:g,El:y,Fh:A,Fl:I,Gh:P,Gl:D,Hh:U,Hl:V}=this;return[e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V]}set(e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V){this.Ah=e|0,this.Al=n|0,this.Bh=i|0,this.Bl=s|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=g|0,this.El=y|0,this.Fh=A|0,this.Fl=I|0,this.Gh=P|0,this.Gl=D|0,this.Hh=U|0,this.Hl=V|0}process(e,n){for(let ce=0;ce<16;ce++,n+=4)ly[ce]=e.getUint32(n),fy[ce]=e.getUint32(n+=4);for(let ce=16;ce<80;ce++){const Re=ly[ce-15]|0,De=fy[ce-15]|0,Ue=ay(Re,De,1)^ay(Re,De,8)^Pj(Re,De,7),Ve=uy(Re,De,1)^uy(Re,De,8)^Nj(Re,De,7),pe=ly[ce-2]|0,Se=fy[ce-2]|0,Ce=ay(pe,Se,19)^q_(pe,Se,61)^Pj(pe,Se,6),je=uy(pe,Se,19)^Z_(pe,Se,61)^Nj(pe,Se,6),$e=Wpe(Ve,je,fy[ce-7],fy[ce-16]),Qe=Hpe($e,Ue,Ce,ly[ce-7],ly[ce-16]);ly[ce]=Qe|0,fy[ce]=$e|0}let{Ah:i,Al:s,Bh:o,Bl:a,Ch:u,Cl:l,Dh:g,Dl:y,Eh:A,El:I,Fh:P,Fl:D,Gh:U,Gl:V,Hh:J,Hl:re}=this;for(let ce=0;ce<80;ce++){const Re=ay(A,I,14)^ay(A,I,18)^q_(A,I,41),De=uy(A,I,14)^uy(A,I,18)^Z_(A,I,41),Ue=A&P^~A&U,Ve=I&D^~I&V,pe=zpe(re,De,Ve,Kpe[ce],fy[ce]),Se=$pe(pe,J,Re,Ue,jpe[ce],ly[ce]),Ce=pe|0,je=ay(i,s,28)^q_(i,s,34)^q_(i,s,39),$e=uy(i,s,28)^Z_(i,s,34)^Z_(i,s,39),Qe=i&o^i&u^o&u,nt=s&a^s&l^a&l;J=U|0,re=V|0,U=P|0,V=D|0,P=A|0,D=I|0,{h:A,l:I}=Zd(g|0,y|0,Se|0,Ce|0),g=u|0,y=l|0,u=o|0,l=a|0,o=i|0,a=s|0;const Ne=iO(Ce,$e,nt);i=sO(Ne,Se,je,Qe),s=Ne|0}({h:i,l:s}=Zd(this.Ah|0,this.Al|0,i|0,s|0)),{h:o,l:a}=Zd(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=Zd(this.Ch|0,this.Cl|0,u|0,l|0),{h:g,l:y}=Zd(this.Dh|0,this.Dl|0,g|0,y|0),{h:A,l:I}=Zd(this.Eh|0,this.El|0,A|0,I|0),{h:P,l:D}=Zd(this.Fh|0,this.Fl|0,P|0,D|0),{h:U,l:V}=Zd(this.Gh|0,this.Gl|0,U|0,V|0),{h:J,l:re}=Zd(this.Hh|0,this.Hl|0,J|0,re|0),this.set(i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re)}roundClean(){qd(ly,fy)}destroy(){qd(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Gpe extends K3{Ah=uc[0]|0;Al=uc[1]|0;Bh=uc[2]|0;Bl=uc[3]|0;Ch=uc[4]|0;Cl=uc[5]|0;Dh=uc[6]|0;Dl=uc[7]|0;Eh=uc[8]|0;El=uc[9]|0;Fh=uc[10]|0;Fl=uc[11]|0;Gh=uc[12]|0;Gl=uc[13]|0;Hh=uc[14]|0;Hl=uc[15]|0;constructor(){super(64)}}class Cqe extends K3{Ah=ac[0]|0;Al=ac[1]|0;Bh=ac[2]|0;Bl=ac[3]|0;Ch=ac[4]|0;Cl=ac[5]|0;Dh=ac[6]|0;Dl=ac[7]|0;Eh=ac[8]|0;El=ac[9]|0;Fh=ac[10]|0;Fl=ac[11]|0;Gh=ac[12]|0;Gl=ac[13]|0;Hh=ac[14]|0;Hl=ac[15]|0;constructor(){super(48)}}const cc=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),lc=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class xqe extends K3{Ah=cc[0]|0;Al=cc[1]|0;Bh=cc[2]|0;Bl=cc[3]|0;Ch=cc[4]|0;Cl=cc[5]|0;Dh=cc[6]|0;Dl=cc[7]|0;Eh=cc[8]|0;El=cc[9]|0;Fh=cc[10]|0;Fl=cc[11]|0;Gh=cc[12]|0;Gl=cc[13]|0;Hh=cc[14]|0;Hl=cc[15]|0;constructor(){super(28)}}class Bqe extends K3{Ah=lc[0]|0;Al=lc[1]|0;Bh=lc[2]|0;Bl=lc[3]|0;Ch=lc[4]|0;Cl=lc[5]|0;Dh=lc[6]|0;Dl=lc[7]|0;Eh=lc[8]|0;El=lc[9]|0;Fh=lc[10]|0;Fl=lc[11]|0;Gh=lc[12]|0;Gl=lc[13]|0;Hh=lc[14]|0;Hl=lc[15]|0;constructor(){super(32)}}const Oqe=null,Pqe=null,Y_=Rj(()=>new Gpe,Ppe(3)),Nqe=null,Mqe=null,Lqe=null;/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const qpe=r=>r[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function Dj(r){if(typeof r!="string")throw new TypeError("invalid mnemonic type: "+typeof r);return r.normalize("NFKD")}function G3(r){const e=Dj(r),n=e.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:n}}function Uj(r){if(abytes(r),![16,20,24,28,32].includes(r.length))throw new Error("invalid entropy length")}function Dqe(r,e=128){if(anumber(e),e%32!==0||e>256)throw new TypeError("Invalid entropy");return Xpe(randomBytes(e/8),r)}const Zpe=r=>{const e=8-r.length/4;return new Uint8Array([sha256(r)[0]>>e<<e])};function Fj(r){if(!Array.isArray(r)||r.length!==2048||typeof r[0]!="string")throw new Error("Wordlist: expected array of 2048 strings");return r.forEach(e=>{if(typeof e!="string")throw new Error("wordlist: non-string element: "+e)}),baseUtils.chain(baseUtils.checksum(1,Zpe),baseUtils.radix2(11,!0),baseUtils.alphabet(r))}function Ype(r,e){const{words:n}=G3(r),i=Fj(e).decode(n);return Uj(i),i}function Xpe(r,e){return Uj(r),Fj(e).encode(r).join(qpe(e)?"\u3000":" ")}function Uqe(r,e){try{Ype(r,e)}catch{return!1}return!0}const oO=r=>Dj("mnemonic"+r);function Fqe(r,e=""){return pbkdf2Async(sha512,G3(r).nfkd,oO(e),{c:2048,dkLen:64})}function Jpe(r,e=""){return Npe(Y_,G3(r).nfkd,oO(e),{c:2048,dkLen:64})}function Wqe(r,e=""){return pbkdf2web(sha512web,G3(r).nfkd,oO(e),{c:2048,dkLen:64})}function Wj(r){return!!new RegExp("^m\\/44'\\/784'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(r)}function Hqe(r){return!!new RegExp("^m\\/(54|74)'\\/784'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$").test(r)}function Qpe(r){return Jpe(r,"")}function ege(r){return Ew(Qpe(r))}const tge=32;function zqe(r){try{return fromBase58(r).length===tge}catch{return!1}}const q3=32;function aO(r){return oge(r)&&age(r)===q3}function $qe(r){return aO(r)}const rge=/^[a-zA-Z][a-zA-Z0-9_]*$/;function Hj(r){return rge.test(r)}const nge=null,ige=/^vector<(.+)>$/;function zj(r){if(nge.includes(r))return!0;const e=r.match(ige);return e?zj(e[1]):r.includes("::")?sge(r):!1}function $j(r){return!aO(r.address)&&!isValidNamedPackage(r.address)||!Hj(r.module)||!Hj(r.name)?!1:r.typeParams.every(e=>typeof e=="string"?zj(e):$j(e))}function sge(r){try{return $j(uO(r))}catch{return!1}}function Vj(r){if(r.startsWith("vector<")){if(!r.endsWith(">"))throw new Error(`Invalid type tag: ${r}`);const e=r.slice(7,-1);if(!e)throw new Error(`Invalid type tag: ${r}`);const n=Vj(e);return typeof n=="string"?`vector<${n}>`:`vector<${jj(n)}>`}return r.includes("::")?uO(r):r}function uO(r){const e=r.split("::");if(e.length<3)throw new Error(`Invalid struct tag: ${r}`);const[n,i]=e,s=isValidNamedPackage(n),o=r.slice(n.length+i.length+4),a=o.includes("<")?o.slice(0,o.indexOf("<")):o,u=o.includes("<")?splitGenericParameters(o.slice(o.indexOf("<")+1,o.lastIndexOf(">"))).map(l=>Vj(l.trim())):[];return{address:s?n:Bb(n),module:i,name:a,typeParams:u}}function jj(r){const{address:e,module:n,name:i,typeParams:s}=typeof r=="string"?uO(r):r;return`${e}::${n}::${i}${s?.length>0?`<${s.map(o=>typeof o=="string"?o:jj(o)).join(",")}>`:""}`}function Bb(r,e=!1){let n=r.toLowerCase();return!e&&n.startsWith("0x")&&(n=n.slice(2)),`0x${n.padStart(q3*2,"0")}`}function Vqe(r,e=!1){return Bb(r,e)}function oge(r){return/^(0x|0X)?[a-fA-F0-9]+$/.test(r)&&r.length%2===0}function age(r){return/^(0x|0X)/.test(r)?(r.length-2)/2:r.length/2}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ob(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function cO(r){if(!Ob(r))throw new Error("Uint8Array expected")}function Kj(r,e){return Array.isArray(e)?e.length===0?!0:r?e.every(n=>typeof n=="string"):e.every(n=>Number.isSafeInteger(n)):!1}function lO(r){if(typeof r!="function")throw new Error("function expected");return!0}function dy(r,e){if(typeof e!="string")throw new Error(`${r}: string expected`);return!0}function kw(r){if(!Number.isSafeInteger(r))throw new Error(`invalid integer: ${r}`)}function Z3(r){if(!Array.isArray(r))throw new Error("array expected")}function Y3(r,e){if(!Kj(!0,e))throw new Error(`${r}: array of strings expected`)}function fO(r,e){if(!Kj(!1,e))throw new Error(`${r}: array of numbers expected`)}function kl(...r){const e=o=>o,n=(o,a)=>u=>o(a(u)),i=r.map(o=>o.encode).reduceRight(n,e),s=r.map(o=>o.decode).reduce(n,e);return{encode:i,decode:s}}function bf(r){const e=typeof r=="string"?r.split(""):r,n=e.length;Y3("alphabet",e);const i=new Map(e.map((s,o)=>[s,o]));return{encode:s=>(Z3(s),s.map(o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${r}`);return e[o]})),decode:s=>(Z3(s),s.map(o=>{dy("alphabet.decode",o);const a=i.get(o);if(a===void 0)throw new Error(`Unknown letter: "${o}". Allowed: ${r}`);return a}))}}function vf(r=""){return dy("join",r),{encode:e=>(Y3("join.decode",e),e.join(r)),decode:e=>(dy("join.decode",e),e.split(r))}}function X3(r,e="="){return kw(r),dy("padding",e),{encode(n){for(Y3("padding.encode",n);n.length*r%8;)n.push(e);return n},decode(n){Y3("padding.decode",n);let i=n.length;if(i*r%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;i>0&&n[i-1]===e;i--)if((i-1)*r%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,i)}}}function Gj(r){return lO(r),{encode:e=>e,decode:e=>r(e)}}function qj(r,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(Z3(r),!r.length)return[];let i=0;const s=[],o=Array.from(r,u=>{if(kw(u),u<0||u>=e)throw new Error(`invalid integer: ${u}`);return u}),a=o.length;for(;;){let u=0,l=!0;for(let g=i;g<a;g++){const y=o[g],A=e*u,I=A+y;if(!Number.isSafeInteger(I)||A/e!==u||I-y!==A)throw new Error("convertRadix: carry overflow");const P=I/n;u=I%n;const D=Math.floor(P);if(o[g]=D,!Number.isSafeInteger(D)||D*n+u!==I)throw new Error("convertRadix: carry overflow");if(l)D?l=!1:i=g;else continue}if(s.push(u),l)break}for(let u=0;u<r.length-1&&r[u]===0;u++)s.push(0);return s.reverse()}const Zj=(r,e)=>e===0?r:Zj(e,r%e),J3=(r,e)=>r+(e-Zj(r,e)),Q3=(()=>{let r=[];for(let e=0;e<40;e++)r.push(2**e);return r})();function dO(r,e,n,i){if(Z3(r),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(J3(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${J3(e,n)}`);let s=0,o=0;const a=Q3[e],u=Q3[n]-1,l=[];for(const g of r){if(kw(g),g>=a)throw new Error(`convertRadix2: invalid data word=${g} from=${e}`);if(s=s<<e|g,o+e>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)l.push((s>>o-n&u)>>>0);const y=Q3[o];if(y===void 0)throw new Error("invalid carry");s&=y-1}if(s=s<<n-o&u,!i&&o>=e)throw new Error("Excess padding");if(!i&&s>0)throw new Error(`Non-zero padding: ${s}`);return i&&o>0&&l.push(s>>>0),l}function uge(r){kw(r);const e=2**8;return{encode:n=>{if(!Ob(n))throw new Error("radix.encode input should be Uint8Array");return qj(Array.from(n),e,r)},decode:n=>(fO("radix.decode",n),Uint8Array.from(qj(n,r,e)))}}function Kf(r,e=!1){if(kw(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(J3(8,r)>32||J3(r,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!Ob(n))throw new Error("radix2.encode input should be Uint8Array");return dO(Array.from(n),8,r,!e)},decode:n=>(fO("radix2.decode",n),Uint8Array.from(dO(n,r,8,e)))}}function Yj(r){return lO(r),function(...e){try{return r.apply(null,e)}catch{}}}function cge(r,e){return kw(r),lO(e),{encode(n){if(!Ob(n))throw new Error("checksum.encode: input should be Uint8Array");const i=e(n).slice(0,r),s=new Uint8Array(n.length+r);return s.set(n),s.set(i,n.length),s},decode(n){if(!Ob(n))throw new Error("checksum.decode: input should be Uint8Array");const i=n.slice(0,-r),s=n.slice(-r),o=e(i).slice(0,r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return i}}}const jqe=null,Kqe=kl(Kf(4),bf("0123456789ABCDEF"),vf("")),Gqe=kl(Kf(5),bf("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),X3(5),vf("")),qqe=kl(Kf(5),bf("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),vf("")),Zqe=kl(Kf(5),bf("0123456789ABCDEFGHIJKLMNOPQRSTUV"),X3(5),vf("")),Yqe=kl(Kf(5),bf("0123456789ABCDEFGHIJKLMNOPQRSTUV"),vf("")),Xqe=kl(Kf(5),bf("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),vf(""),Gj(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),Xj=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",Jj=(r,e)=>{dy("base64",r);const n=e?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,i=e?"base64url":"base64";if(r.length>0&&!n.test(r))throw new Error("invalid base64");return Uint8Array.fromBase64(r,{alphabet:i,lastChunkHandling:"strict"})},Jqe=Xj?{encode(r){return cO(r),r.toBase64()},decode(r){return Jj(r,!1)}}:kl(Kf(6),bf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),X3(6),vf("")),Qqe=kl(Kf(6),bf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),vf("")),eZe=Xj?{encode(r){return cO(r),r.toBase64({alphabet:"base64url"})},decode(r){return Jj(r,!0)}}:kl(Kf(6),bf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),X3(6),vf("")),tZe=kl(Kf(6),bf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),vf("")),hO=r=>kl(uge(58),bf(r),vf("")),pO=hO("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),rZe=hO("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),nZe=hO("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),iZe=null,sZe=null,oZe=r=>kl(cge(4,e=>r(r(e))),pO),aZe=null,gO=kl(bf("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),vf("")),Qj=[996825010,642813549,513874426,1027748829,705979059];function X_(r){const e=r>>25;let n=(r&33554431)<<5;for(let i=0;i<Qj.length;i++)(e>>i&1)===1&&(n^=Qj[i]);return n}function eK(r,e,n=1){const i=r.length;let s=1;for(let o=0;o<i;o++){const a=r.charCodeAt(o);if(a<33||a>126)throw new Error(`Invalid prefix (${r})`);s=X_(s)^a>>5}s=X_(s);for(let o=0;o<i;o++)s=X_(s)^r.charCodeAt(o)&31;for(let o of e)s=X_(s)^o;for(let o=0;o<6;o++)s=X_(s);return s^=n,gO.encode(dO([s%Q3[30]],30,5,!1))}function tK(r){const e=r==="bech32"?1:734539939,n=Kf(5),i=n.decode,s=n.encode,o=Yj(i);function a(A,I,P=90){dy("bech32.encode prefix",A),Ob(I)&&(I=Array.from(I)),fO("bech32.encode",I);const D=A.length;if(D===0)throw new TypeError(`Invalid prefix length ${D}`);const U=D+7+I.length;if(P!==!1&&U>P)throw new TypeError(`Length ${U} exceeds limit ${P}`);const V=A.toLowerCase(),J=eK(V,I,e);return`${V}1${gO.encode(I)}${J}`}function u(A,I=90){dy("bech32.decode input",A);const P=A.length;if(P<8||I!==!1&&P>I)throw new TypeError(`invalid string length: ${P} (${A}). Expected (8..${I})`);const D=A.toLowerCase();if(A!==D&&A!==A.toUpperCase())throw new Error("String must be lowercase or uppercase");const U=D.lastIndexOf("1");if(U===0||U===-1)throw new Error('Letter "1" must be present between prefix and data only');const V=D.slice(0,U),J=D.slice(U+1);if(J.length<6)throw new Error("Data must be at least 6 characters long");const re=gO.decode(J).slice(0,-6),ce=eK(V,re,e);if(!J.endsWith(ce))throw new Error(`Invalid checksum in ${A}: expected "${ce}"`);return{prefix:V,words:re}}const l=Yj(u);function g(A){const{prefix:I,words:P}=u(A,!1);return{prefix:I,words:P,bytes:i(P)}}function y(A,I){return a(A,s(I))}return{encode:a,decode:u,encodeFromBytes:y,decodeToBytes:g,decodeUnsafe:l,fromWords:i,fromWordsUnsafe:o,toWords:s}}const ek=tK("bech32"),uZe=tK("bech32m"),cZe=null,dZe=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function"?{encode(r){return cO(r),r.toHex()},decode(r){return dy("hex",r),Uint8Array.fromHex(r)}}:kl(Kf(4),bf("0123456789abcdef"),vf(""),Gj(r=>{if(typeof r!="string"||r.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()})),tk=null,rK="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",hZe=(r,e)=>{if(typeof r!="string"||!tk.hasOwnProperty(r))throw new TypeError(rK);if(!Ob(e))throw new TypeError("bytesToString() expects Uint8Array");return tk[r].encode(e)},pZe=null,gZe=(r,e)=>{if(!tk.hasOwnProperty(r))throw new TypeError(rK);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return tk[r].decode(e)},yZe=null,yO=r=>pO.encode(r),mO=r=>pO.decode(r);function Pb(r){return Uint8Array.from(atob(r),e=>e.charCodeAt(0))}const bO=8192;function Yd(r){if(r.length<bO)return btoa(String.fromCharCode(...r));let e="";for(var n=0;n<r.length;n+=bO){const i=r.slice(n,n+bO);e+=String.fromCharCode(...i)}return btoa(e)}function lge(r,e){switch(e){case"base58":return yO(r);case"base64":return Yd(r);case"hex":return Ew(r);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function mZe(r,e){switch(e){case"base58":return fromBase58(r);case"base64":return fromBase64(r);case"hex":return fromHex(r);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function fge(r,e=["<",">"]){const[n,i]=e,s=[];let o="",a=0;for(let u=0;u<r.length;u++){const l=r[u];if(l===n&&a++,l===i&&a--,a===0&&l===","){s.push(o.trim()),o="";continue}o+=l}return s.push(o.trim()),s}const dge=/^vector<(.+)>$/,hge=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;var rk=class cA{static parseFromStr(e,n=!1){if(e==="address")return{address:null};if(e==="bool")return{bool:null};if(e==="u8")return{u8:null};if(e==="u16")return{u16:null};if(e==="u32")return{u32:null};if(e==="u64")return{u64:null};if(e==="u128")return{u128:null};if(e==="u256")return{u256:null};if(e==="signer")return{signer:null};const i=e.match(dge);if(i)return{vector:cA.parseFromStr(i[1],n)};const s=e.match(hge);if(s)return{struct:{address:n?Bb(s[1]):s[1],module:s[2],name:s[3],typeParams:s[5]===void 0?[]:cA.parseStructTypeArgs(s[5],n)}};throw new Error(`Encountered unexpected token when parsing type args for ${e}`)}static parseStructTypeArgs(e,n=!1){return fge(e).map(i=>cA.parseFromStr(i,n))}static tagToString(e){if("bool"in e)return"bool";if("u8"in e)return"u8";if("u16"in e)return"u16";if("u32"in e)return"u32";if("u64"in e)return"u64";if("u128"in e)return"u128";if("u256"in e)return"u256";if("address"in e)return"address";if("signer"in e)return"signer";if("vector"in e)return`vector<${cA.tagToString(e.vector)}>`;if("struct"in e){const n=e.struct,i=n.typeParams.map(cA.tagToString).join(", ");return`${n.address}::${n.module}::${n.name}${i?`<${i}>`:""}`}throw new Error("Invalid TypeTag")}};function bZe(r){return rk.tagToString(rk.parseFromStr(r))}function nk(r){let e=BigInt(r);const n=[];let i=0;if(e===0n)return[0];for(;e>0;)n[i]=Number(e&127n),e>>=7n,e>0n&&(n[i]|=128),i+=1;return n}function pge(r){let e=0n,n=0n,i=0;for(;;){if(i>=r.length)throw new Error("ULEB decode error: buffer overflow");const s=r[i];if(i+=1,e+=BigInt(s&127)<<n,!(s&128))break;n+=7n}if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("ULEB decode error: value exceeds MAX_SAFE_INTEGER");return{value:Number(e),length:i}}var gge=class{constructor(r){this.bytePosition=0,this.dataView=new DataView(r.buffer,r.byteOffset,r.byteLength)}shift(r){return this.bytePosition+=r,this}read8(){const r=this.dataView.getUint8(this.bytePosition);return this.shift(1),r}read16(){const r=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),r}read32(){const r=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),r}read64(){const r=this.read32(),e=this.read32().toString(16)+r.toString(16).padStart(8,"0");return BigInt("0x"+e).toString(10)}read128(){const r=BigInt(this.read64()),e=BigInt(this.read64()).toString(16)+r.toString(16).padStart(16,"0");return BigInt("0x"+e).toString(10)}read256(){const r=BigInt(this.read128()),e=BigInt(this.read128()).toString(16)+r.toString(16).padStart(32,"0");return BigInt("0x"+e).toString(10)}readBytes(r){const e=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,e,r);return this.shift(r),n}readULEB(){const r=this.bytePosition+this.dataView.byteOffset,{value:e,length:n}=pge(new Uint8Array(this.dataView.buffer,r));return this.shift(n),e}readVec(r){const e=this.readULEB(),n=[];for(let i=0;i<e;i++)n.push(r(this,i,e));return n}},yge=class{constructor({initialSize:r=1024,maxSize:e=1/0,allocateSize:n=1024}={}){this.bytePosition=0,this.size=r,this.maxSize=e,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(r))}ensureSizeOrGrow(r){const e=this.bytePosition+r;if(e>this.size){const n=Math.min(this.maxSize,Math.max(this.size+e,this.size+this.allocateSize));if(e>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${e}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(r){return this.bytePosition+=r,this}write8(r){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(r)),this.shift(1)}writeBytes(r){this.ensureSizeOrGrow(r.length);for(let e=0;e<r.length;e++)this.dataView.setUint8(this.bytePosition+e,r[e]);return this.shift(r.length)}write16(r){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(r),!0),this.shift(2)}write32(r){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(r),!0),this.shift(4)}write64(r){return vO(BigInt(r),8).forEach(e=>this.write8(e)),this}write128(r){return vO(BigInt(r),16).forEach(e=>this.write8(e)),this}write256(r){return vO(BigInt(r),32).forEach(e=>this.write8(e)),this}writeULEB(r){return nk(r).forEach(e=>this.write8(e)),this}writeVec(r,e){return this.writeULEB(r.length),Array.from(r).forEach((n,i)=>e(this,n,i,r.length)),this}*[Symbol.iterator](){for(let r=0;r<this.bytePosition;r++)yield this.dataView.getUint8(r);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(r){return lge(this.toBytes(),r)}};function vO(r,e){const n=new Uint8Array(e);let i=0;for(;r>0;)n[i]=Number(r%BigInt(256)),r=r/BigInt(256),i+=1;return n}var Xd=class fle{#e;#t;constructor(e){this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),this.#e=e.write,this.#t=e.serialize??((n,i)=>{const s=new yge({initialSize:this.serializedSize(n)??void 0,...i});return this.#e(n,s),s.toBytes()}),this.validate=e.validate??(()=>{})}write(e,n){this.validate(e),this.#e(e,n)}serialize(e,n){return this.validate(e),new mge(this,this.#t(e,n))}parse(e){const n=new gge(e);return this.read(n)}fromHex(e){return this.parse(eO(e))}fromBase58(e){return this.parse(mO(e))}fromBase64(e){return this.parse(Pb(e))}transform({name:e,input:n,output:i,validate:s}){return new fle({name:e??this.name,read:o=>i?i(this.read(o)):this.read(o),write:(o,a)=>this.#e(n?n(o):o,a),serializedSize:o=>this.serializedSize(n?n(o):o),serialize:(o,a)=>this.#t(n?n(o):o,a),validate:o=>{s?.(o),this.validate(n?n(o):o)}})}};const nK=Symbol.for("@mysten/serialized-bcs");function vZe(r){return!!r&&typeof r=="object"&&r[nK]===!0}var mge=class{#e;#t;get[nK](){return!0}constructor(r,e){this.#e=r,this.#t=e}toBytes(){return this.#t}toHex(){return Ew(this.#t)}toBase64(){return Yd(this.#t)}toBase58(){return yO(this.#t)}parse(){return this.#e.parse(this.#t)}};function ik({size:r,...e}){return new Xd({...e,serializedSize:()=>r})}function wO({readMethod:r,writeMethod:e,...n}){return ik({...n,read:i=>i[r](),write:(i,s)=>s[e](i),validate:i=>{if(i<0||i>n.maxValue)throw new TypeError(`Invalid ${n.name} value: ${i}. Expected value in range 0-${n.maxValue}`);n.validate?.(i)}})}function AO({readMethod:r,writeMethod:e,...n}){return ik({...n,read:i=>i[r](),write:(i,s)=>s[e](BigInt(i)),validate:i=>{const s=BigInt(i);if(s<0||s>n.maxValue)throw new TypeError(`Invalid ${n.name} value: ${s}. Expected value in range 0-${n.maxValue}`);n.validate?.(s)}})}function bge({serialize:r,...e}){const n=new Xd({...e,serialize:r,write:(i,s)=>{for(const o of n.serialize(i).toBytes())s.write8(o)}});return n}function vge({toBytes:r,fromBytes:e,...n}){return new Xd({...n,read:i=>{const s=i.readULEB();return e(i.readBytes(s))},write:(i,s)=>{const o=r(i);s.writeULEB(o.length);for(let a=0;a<o.length;a++)s.write8(o[a])},serialize:i=>{const s=r(i),o=nk(s.length),a=new Uint8Array(o.length+s.length);return a.set(o,0),a.set(s,o.length),a},validate:i=>{if(typeof i!="string")throw new TypeError(`Invalid ${n.name} value: ${i}. Expected string`);n.validate?.(i)}})}function wge(r){let e=null;function n(){return e||(e=r()),e}return new Xd({name:"lazy",read:i=>n().read(i),serializedSize:i=>n().serializedSize(i),write:(i,s)=>n().write(i,s),serialize:(i,s)=>n().serialize(i,s).toBytes()})}var Age=class extends Xd{constructor({name:r,fields:e,...n}){const i=Object.entries(e);super({name:r,serializedSize:s=>{let o=0;for(const[a,u]of i){const l=u.serializedSize(s[a]);if(l==null)return null;o+=l}return o},read:s=>{const o={};for(const[a,u]of i)o[a]=u.read(s);return o},write:(s,o)=>{for(const[a,u]of i)u.write(s[a],o)},...n,validate:s=>{if(n?.validate?.(s),typeof s!="object"||s==null)throw new TypeError(`Expected object, found ${typeof s}`)}})}},_ge=class extends Xd{constructor({fields:r,...e}){const n=Object.entries(r);super({read:i=>{const s=i.readULEB(),o=n[s];if(!o)throw new TypeError(`Unknown value ${s} for enum ${e.name}`);const[a,u]=o;return{[a]:u?.read(i)??!0,$kind:a}},write:(i,s)=>{const[o,a]=Object.entries(i).filter(([u])=>Object.hasOwnProperty.call(r,u))[0];for(let u=0;u<n.length;u++){const[l,g]=n[u];if(l===o){s.writeULEB(u),g?.write(a,s);return}}},...e,validate:i=>{if(e?.validate?.(i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i).filter(a=>i[a]!==void 0&&Object.hasOwnProperty.call(r,a));if(s.length!==1)throw new TypeError(`Expected object with one key, but found ${s.length} for type ${e.name}}`);const[o]=s;if(!Object.hasOwnProperty.call(r,o))throw new TypeError(`Invalid enum variant ${o}`)}})}},Ege=class extends Xd{constructor({fields:r,name:e,...n}){super({name:e??`(${r.map(i=>i.name).join(", ")})`,serializedSize:i=>{let s=0;for(let o=0;o<r.length;o++){const a=r[o].serializedSize(i[o]);if(a==null)return null;s+=a}return s},read:i=>{const s=[];for(const o of r)s.push(o.read(i));return s},write:(i,s)=>{for(let o=0;o<r.length;o++)r[o].write(i[o],s)},...n,validate:i=>{if(n?.validate?.(i),!Array.isArray(i))throw new TypeError(`Expected array, found ${typeof i}`);if(i.length!==r.length)throw new TypeError(`Expected array of length ${r.length}, found ${i.length}`)}})}};function Tge(r,e,n){return new Xd({read:i=>{const s=new Array(r);for(let o=0;o<r;o++)s[o]=e.read(i);return s},write:(i,s)=>{for(const o of i)e.write(o,s)},...n,name:n?.name??`${e.name}[${r}]`,validate:i=>{if(n?.validate?.(i),!i||typeof i!="object"||!("length"in i))throw new TypeError(`Expected array, found ${typeof i}`);if(i.length!==r)throw new TypeError(`Expected array of length ${r}, found ${i.length}`)}})}function Sge(r){return fr.enum(`Option<${r.name}>`,{None:null,Some:r}).transform({input:e=>e==null?{None:!0}:{Some:e},output:e=>e.$kind==="Some"?e.Some:null})}function Ige(r,e){return new Xd({read:n=>{const i=n.readULEB(),s=new Array(i);for(let o=0;o<i;o++)s[o]=r.read(n);return s},write:(n,i)=>{i.writeULEB(n.length);for(const s of n)r.write(s,i)},...e,name:e?.name??`vector<${r.name}>`,validate:n=>{if(e?.validate?.(n),!n||typeof n!="object"||!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`)}})}function kge(r,e){for(let n=0;n<Math.min(r.length,e.length);n++)if(r[n]!==e[n])return r[n]-e[n];return r.length-e.length}function Rge(r,e){return new Xd({name:`Map<${r.name}, ${e.name}>`,read:n=>{const i=n.readULEB(),s=new Map;for(let o=0;o<i;o++)s.set(r.read(n),e.read(n));return s},write:(n,i)=>{const s=[...n.entries()].map(([o,a])=>[r.serialize(o).toBytes(),a]);s.sort(([o],[a])=>kge(o,a)),i.writeULEB(s.length);for(const[o,a]of s)i.writeBytes(o),e.write(a,i)}})}const fr={u8(r){return wO({readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...r,name:r?.name??"u8"})},u16(r){return wO({readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...r,name:r?.name??"u16"})},u32(r){return wO({readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...r,name:r?.name??"u32"})},u64(r){return AO({readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...r,name:r?.name??"u64"})},u128(r){return AO({readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...r,name:r?.name??"u128"})},u256(r){return AO({readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...r,name:r?.name??"u256"})},bool(r){return ik({size:1,read:e=>e.read8()===1,write:(e,n)=>n.write8(e?1:0),...r,name:r?.name??"bool",validate:e=>{if(r?.validate?.(e),typeof e!="boolean")throw new TypeError(`Expected boolean, found ${typeof e}`)}})},uleb128(r){return bge({read:e=>e.readULEB(),serialize:e=>Uint8Array.from(nk(e)),...r,name:r?.name??"uleb128"})},bytes(r,e){return ik({size:r,read:n=>n.readBytes(r),write:(n,i)=>{i.writeBytes(new Uint8Array(n))},...e,name:e?.name??`bytes[${r}]`,validate:n=>{if(e?.validate?.(n),!n||typeof n!="object"||!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==r)throw new TypeError(`Expected array of length ${r}, found ${n.length}`)}})},byteVector(r){return new Xd({read:e=>{const n=e.readULEB();return e.readBytes(n)},write:(e,n)=>{const i=new Uint8Array(e);n.writeULEB(i.length),n.writeBytes(i)},...r,name:r?.name??"vector<u8>",serializedSize:e=>{const n="length"in e?e.length:null;return n==null?null:nk(n).length+n},validate:e=>{if(r?.validate?.(e),!e||typeof e!="object"||!("length"in e))throw new TypeError(`Expected array, found ${typeof e}`)}})},string(r){return vge({toBytes:e=>new TextEncoder().encode(e),fromBytes:e=>new TextDecoder().decode(e),...r,name:r?.name??"string"})},fixedArray:Tge,option:Sge,vector:Ige,tuple(r,e){return new Ege({fields:r,...e})},struct(r,e,n){return new Age({name:r,fields:e,...n})},enum(r,e,n){return new _ge({name:r,fields:e,...n})},map:Rge,lazy(r){return wge(r)}};function Cge(r){return fr.u64({name:"unsafe_u64",...r}).transform({input:e=>e,output:e=>Number(e)})}function xge(r){return fr.enum("Option",{None:null,Some:r})}const co=fr.bytes(q3).transform({validate:r=>{const e=typeof r=="string"?r:Ew(r);if(!e||!aO(Bb(e)))throw new Error(`Invalid Sui address ${e}`)},input:r=>typeof r=="string"?eO(Bb(r)):r,output:r=>Bb(Ew(r))}),Rl=fr.byteVector().transform({name:"ObjectDigest",input:r=>mO(r),output:r=>yO(new Uint8Array(r)),validate:r=>{if(mO(r).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Gf=fr.struct("SuiObjectRef",{objectId:co,version:fr.u64(),digest:Rl}),iK=fr.struct("SharedObjectRef",{objectId:co,initialSharedVersion:fr.u64(),mutable:fr.bool()}),sK=fr.enum("ObjectArg",{ImmOrOwnedObject:Gf,SharedObject:iK,Receiving:Gf}),hy=fr.enum("Owner",{AddressOwner:co,ObjectOwner:co,Shared:fr.struct("Shared",{initialSharedVersion:fr.u64()}),Immutable:null,ConsensusAddressOwner:fr.struct("ConsensusAddressOwner",{startVersion:fr.u64(),owner:co})}),Bge=fr.enum("Reservation",{MaxAmountU64:fr.u64()}),Oge=fr.enum("WithdrawalType",{Balance:fr.lazy(()=>Rw)}),Pge=fr.enum("WithdrawFrom",{Sender:null,Sponsor:null}),Nge=fr.struct("FundsWithdrawal",{reservation:Bge,typeArg:Oge,withdrawFrom:Pge}),oK=fr.enum("CallArg",{Pure:fr.struct("Pure",{bytes:fr.byteVector().transform({input:r=>typeof r=="string"?Pb(r):r,output:r=>Yd(new Uint8Array(r))})}),Object:sK,FundsWithdrawal:Nge}),_O=fr.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:fr.lazy(()=>_O),struct:fr.lazy(()=>EO),u16:null,u32:null,u256:null}),Rw=_O.transform({input:r=>typeof r=="string"?rk.parseFromStr(r,!0):r,output:r=>rk.tagToString(r)}),Qh=fr.enum("Argument",{GasCoin:null,Input:fr.u16(),Result:fr.u16(),NestedResult:fr.tuple([fr.u16(),fr.u16()])}),aK=fr.struct("ProgrammableMoveCall",{package:co,module:fr.string(),function:fr.string(),typeArguments:fr.vector(Rw),arguments:fr.vector(Qh)}),uK=fr.enum("Command",{MoveCall:aK,TransferObjects:fr.struct("TransferObjects",{objects:fr.vector(Qh),address:Qh}),SplitCoins:fr.struct("SplitCoins",{coin:Qh,amounts:fr.vector(Qh)}),MergeCoins:fr.struct("MergeCoins",{destination:Qh,sources:fr.vector(Qh)}),Publish:fr.struct("Publish",{modules:fr.vector(fr.byteVector().transform({input:r=>typeof r=="string"?Pb(r):r,output:r=>Yd(new Uint8Array(r))})),dependencies:fr.vector(co)}),MakeMoveVec:fr.struct("MakeMoveVec",{type:xge(Rw).transform({input:r=>r===null?{None:!0}:{Some:r},output:r=>r.Some??null}),elements:fr.vector(Qh)}),Upgrade:fr.struct("Upgrade",{modules:fr.vector(fr.byteVector().transform({input:r=>typeof r=="string"?Pb(r):r,output:r=>Yd(new Uint8Array(r))})),dependencies:fr.vector(co),package:co,ticket:Qh})}),cK=fr.struct("ProgrammableTransaction",{inputs:fr.vector(oK),commands:fr.vector(uK)}),lK=fr.enum("TransactionKind",{ProgrammableTransaction:cK,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),Mge=fr.struct("ValidDuring",{minEpoch:fr.option(fr.u64()),maxEpoch:fr.option(fr.u64()),minTimestamp:fr.option(fr.u64()),maxTimestamp:fr.option(fr.u64()),chain:Rl,nonce:fr.u32()}),fK=fr.enum("TransactionExpiration",{None:null,Epoch:Cge(),ValidDuring:Mge}),EO=fr.struct("StructTag",{address:co,module:fr.string(),name:fr.string(),typeParams:fr.vector(_O)}),dK=fr.struct("GasData",{payment:fr.vector(Gf),owner:co,price:fr.u64(),budget:fr.u64()}),hK=fr.struct("TransactionDataV1",{kind:lK,sender:co,gasData:dK,expiration:fK}),pK=fr.enum("TransactionData",{V1:hK}),gK=fr.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),yK=fr.enum("IntentVersion",{V0:null}),mK=fr.enum("AppId",{Sui:null}),bK=fr.struct("Intent",{scope:gK,version:yK,appId:mK});function vK(r){return fr.struct(`IntentMessage<${r.name}>`,{intent:bK,value:r})}const wK=fr.enum("CompressedSignature",{ED25519:fr.bytes(64),Secp256k1:fr.bytes(64),Secp256r1:fr.bytes(64),ZkLogin:fr.byteVector(),Passkey:fr.byteVector()}),AK=fr.enum("PublicKey",{ED25519:fr.bytes(32),Secp256k1:fr.bytes(33),Secp256r1:fr.bytes(33),ZkLogin:fr.byteVector(),Passkey:fr.bytes(33)}),_K=fr.struct("MultiSigPkMap",{pubKey:AK,weight:fr.u8()}),EK=fr.struct("MultiSigPublicKey",{pk_map:fr.vector(_K),threshold:fr.u16()}),Lge=fr.struct("MultiSig",{sigs:fr.vector(wK),bitmap:fr.u16(),multisig_pk:EK}),Dge=fr.byteVector().transform({input:r=>typeof r=="string"?Pb(r):r,output:r=>Yd(new Uint8Array(r))}),TK=fr.struct("SenderSignedTransaction",{intentMessage:vK(pK),txSignatures:fr.vector(Dge)}),Uge=fr.vector(TK,{name:"SenderSignedData"}),Fge=fr.struct("PasskeyAuthenticator",{authenticatorData:fr.byteVector(),clientDataJson:fr.string(),userSignature:fr.byteVector()}),SK=fr.enum("MoveObjectType",{Other:EO,GasCoin:null,StakedSui:null,Coin:Rw,AccumulatorBalanceWrapper:null}),IK=fr.struct("TypeOrigin",{moduleName:fr.string(),datatypeName:fr.string(),package:co}),kK=fr.struct("UpgradeInfo",{upgradedId:co,upgradedVersion:fr.u64()}),RK=fr.struct("MovePackage",{id:co,version:fr.u64(),moduleMap:fr.map(fr.string(),fr.byteVector()),typeOriginTable:fr.vector(IK),linkageTable:fr.map(co,kK)}),CK=fr.struct("MoveObject",{type:SK,hasPublicTransfer:fr.bool(),version:fr.u64(),contents:fr.byteVector()}),xK=fr.enum("Data",{Move:CK,Package:RK}),Wge=fr.struct("ObjectInner",{data:xK,owner:hy,previousTransaction:Rl,storageRebate:fr.u64()}),Hge=fr.enum("PackageUpgradeError",{UnableToFetchPackage:fr.struct("UnableToFetchPackage",{packageId:co}),NotAPackage:fr.struct("NotAPackage",{objectId:co}),IncompatibleUpgrade:null,DigestDoesNotMatch:fr.struct("DigestDoesNotMatch",{digest:fr.byteVector()}),UnknownUpgradePolicy:fr.struct("UnknownUpgradePolicy",{policy:fr.u8()}),PackageIDDoesNotMatch:fr.struct("PackageIDDoesNotMatch",{packageId:co,ticketId:co})}),zge=fr.struct("ModuleId",{address:co,name:fr.string()}),BK=fr.struct("MoveLocation",{module:zge,function:fr.u16(),instruction:fr.u16(),functionName:fr.option(fr.string())}),$ge=fr.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:fr.struct("IndexOutOfBounds",{idx:fr.u16()}),SecondaryIndexOutOfBounds:fr.struct("SecondaryIndexOutOfBounds",{resultIdx:fr.u16(),secondaryIdx:fr.u16()}),InvalidResultArity:fr.struct("InvalidResultArity",{resultIdx:fr.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null,InvalidArgumentArity:null,InvalidTransferObject:null,InvalidMakeMoveVecNonObjectArgument:null,ArgumentWithoutValue:null,CannotMoveBorrowedValue:null,CannotWriteToExtendedReference:null,InvalidReferenceArgument:null}),Vge=fr.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),jge=fr.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:fr.struct("MoveObjectTooBig",{objectSize:fr.u64(),maxObjectSize:fr.u64()}),MovePackageTooBig:fr.struct("MovePackageTooBig",{objectSize:fr.u64(),maxObjectSize:fr.u64()}),CircularObjectOwnership:fr.struct("CircularObjectOwnership",{object:co}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:fr.option(BK),MoveAbort:fr.tuple([BK,fr.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:fr.struct("CommandArgumentError",{argIdx:fr.u16(),kind:$ge}),TypeArgumentError:fr.struct("TypeArgumentError",{argumentIdx:fr.u16(),kind:Vge}),UnusedValueWithoutDrop:fr.struct("UnusedValueWithoutDrop",{resultIdx:fr.u16(),secondaryIdx:fr.u16()}),InvalidPublicFunctionReturnType:fr.struct("InvalidPublicFunctionReturnType",{idx:fr.u16()}),InvalidTransferObject:null,EffectsTooLarge:fr.struct("EffectsTooLarge",{currentSize:fr.u64(),maxSize:fr.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:fr.struct("PackageUpgradeError",{upgradeError:Hge}),WrittenObjectsTooLarge:fr.struct("WrittenObjectsTooLarge",{currentSize:fr.u64(),maxSize:fr.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:fr.struct("ExecutionCancelledDueToSharedObjectCongestion",{congested_objects:fr.vector(co)}),AddressDeniedForCoin:fr.struct("AddressDeniedForCoin",{address:co,coinType:fr.string()}),CoinTypeGlobalPause:fr.struct("CoinTypeGlobalPause",{coinType:fr.string()}),ExecutionCancelledDueToRandomnessUnavailable:null,MoveVectorElemTooBig:fr.struct("MoveVectorElemTooBig",{valueSize:fr.u64(),maxScaledSize:fr.u64()}),MoveRawValueTooBig:fr.struct("MoveRawValueTooBig",{valueSize:fr.u64(),maxScaledSize:fr.u64()}),InvalidLinkage:null,InsufficientBalanceForWithdraw:null,NonExclusiveWriteInputObjectModified:fr.struct("NonExclusiveWriteInputObjectModified",{id:co})}),OK=fr.enum("ExecutionStatus",{Success:null,Failure:fr.struct("Failure",{error:jge,command:fr.option(fr.u64())})}),PK=fr.struct("GasCostSummary",{computationCost:fr.u64(),storageCost:fr.u64(),storageRebate:fr.u64(),nonRefundableStorageFee:fr.u64()}),Kge=fr.struct("TransactionEffectsV1",{status:OK,executedEpoch:fr.u64(),gasUsed:PK,modifiedAtVersions:fr.vector(fr.tuple([co,fr.u64()])),sharedObjects:fr.vector(Gf),transactionDigest:Rl,created:fr.vector(fr.tuple([Gf,hy])),mutated:fr.vector(fr.tuple([Gf,hy])),unwrapped:fr.vector(fr.tuple([Gf,hy])),deleted:fr.vector(Gf),unwrappedThenDeleted:fr.vector(Gf),wrapped:fr.vector(Gf),gasObject:fr.tuple([Gf,hy]),eventsDigest:fr.option(Rl),dependencies:fr.vector(Rl)}),TO=fr.tuple([fr.u64(),Rl]),Gge=fr.enum("ObjectIn",{NotExist:null,Exist:fr.tuple([TO,hy])}),qge=fr.struct("AccumulatorAddress",{address:co,ty:Rw}),Zge=fr.enum("AccumulatorOperation",{Merge:null,Split:null}),Yge=fr.enum("AccumulatorValue",{Integer:fr.u64(),IntegerTuple:fr.tuple([fr.u64(),fr.u64()]),EventDigest:fr.vector(fr.tuple([fr.u64(),Rl]))}),Xge=fr.struct("AccumulatorWriteV1",{address:qge,operation:Zge,value:Yge}),Jge=fr.enum("ObjectOut",{NotExist:null,ObjectWrite:fr.tuple([Rl,hy]),PackageWrite:TO,AccumulatorWriteV1:Xge}),Qge=fr.enum("IDOperation",{None:null,Created:null,Deleted:null}),eye=fr.struct("EffectsObjectChange",{inputState:Gge,outputState:Jge,idOperation:Qge}),tye=fr.enum("UnchangedConsensusKind",{ReadOnlyRoot:TO,MutateConsensusStreamEnded:fr.u64(),ReadConsensusStreamEnded:fr.u64(),Cancelled:fr.u64(),PerEpochConfig:null}),rye=fr.struct("TransactionEffectsV2",{status:OK,executedEpoch:fr.u64(),gasUsed:PK,transactionDigest:Rl,gasObjectIndex:fr.option(fr.u32()),eventsDigest:fr.option(Rl),dependencies:fr.vector(Rl),lamportVersion:fr.u64(),changedObjects:fr.vector(fr.tuple([co,eye])),unchangedConsensusObjects:fr.vector(fr.tuple([co,tye])),auxDataDigest:fr.option(Rl)}),nye=fr.enum("TransactionEffects",{V1:Kge,V2:rye}),SO={...fr,U8:fr.u8(),U16:fr.u16(),U32:fr.u32(),U64:fr.u64(),U128:fr.u128(),U256:fr.u256(),ULEB128:fr.uleb128(),Bool:fr.bool(),String:fr.string(),Address:co,AppId:mK,Argument:Qh,CallArg:oK,Command:uK,CompressedSignature:wK,Data:xK,GasData:dK,Intent:bK,IntentMessage:vK,IntentScope:gK,IntentVersion:yK,MoveObject:CK,MoveObjectType:SK,MovePackage:RK,MultiSig:Lge,MultiSigPkMap:_K,MultiSigPublicKey:EK,Object:Wge,ObjectArg:sK,ObjectDigest:Rl,Owner:hy,PasskeyAuthenticator:Fge,ProgrammableMoveCall:aK,ProgrammableTransaction:cK,PublicKey:AK,SenderSignedData:Uge,SenderSignedTransaction:TK,SharedObjectRef:iK,StructTag:EO,SuiObjectRef:Gf,TransactionData:pK,TransactionDataV1:hK,TransactionEffects:nye,TransactionExpiration:fK,TransactionKind:lK,TypeOrigin:IK,TypeTag:Rw,UpgradeInfo:kK};function NK(r,e){return SO.IntentMessage(SO.bytes(e.length)).serialize({intent:{scope:{[r]:!0},version:{V0:!0},appId:{Sui:!0}},value:e}).toBytes()}const IO={ED25519:0,Secp256k1:1,Secp256r1:2,MultiSig:3,ZkLogin:5,Passkey:6},iye={ED25519:32,Secp256k1:33,Secp256r1:33,Passkey:33},MK={0:"ED25519",1:"Secp256k1",2:"Secp256r1",3:"MultiSig",5:"ZkLogin",6:"Passkey"};function sye({signature:r,signatureScheme:e,publicKey:n}){if(!n)throw new Error("`publicKey` is required");const i=n.toRawBytes(),s=new Uint8Array(1+r.length+i.length);return s.set([IO[e]]),s.set(r,1),s.set(i,1+r.length),Yd(s)}function wZe(r){const e=fromBase64(r),n=SIGNATURE_FLAG_TO_SCHEME[e[0]];switch(n){case"Passkey":return parseSerializedPasskeySignature(r);case"MultiSig":return{serializedSignature:r,signatureScheme:n,multisig:suiBcs.MultiSig.parse(e.slice(1)),bytes:e,signature:void 0};case"ZkLogin":return parseSerializedZkLoginSignature(r);case"ED25519":case"Secp256k1":case"Secp256r1":return parseSerializedKeypairSignature(r);default:throw new Error("Unsupported signature scheme")}}const LK=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function py(r,e,n,i,s){return r=r+e+s|0,i=Il(i^r,16),n=n+i|0,e=Il(e^n,12),{a:r,b:e,c:n,d:i}}function gy(r,e,n,i,s){return r=r+e+s|0,i=Il(i^r,8),n=n+i|0,e=Il(e^n,7),{a:r,b:e,c:n,d:i}}const ru=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),ri=new Uint32Array(32);function yy(r,e,n,i,s,o){const a=s[o],u=s[o+1];let l=ri[2*r],g=ri[2*r+1],y=ri[2*e],A=ri[2*e+1],I=ri[2*n],P=ri[2*n+1],D=ri[2*i],U=ri[2*i+1],V=iO(l,y,a);g=sO(V,g,A,u),l=V|0,{Dh:U,Dl:D}={Dh:U^g,Dl:D^l},{Dh:U,Dl:D}={Dh:Upe(U,D),Dl:Fpe(U,D)},{h:P,l:I}=Zd(P,I,U,D),{Bh:A,Bl:y}={Bh:A^P,Bl:y^I},{Bh:A,Bl:y}={Bh:ay(A,y,24),Bl:uy(A,y,24)},ri[2*r]=l,ri[2*r+1]=g,ri[2*e]=y,ri[2*e+1]=A,ri[2*n]=I,ri[2*n+1]=P,ri[2*i]=D,ri[2*i+1]=U}function my(r,e,n,i,s,o){const a=s[o],u=s[o+1];let l=ri[2*r],g=ri[2*r+1],y=ri[2*e],A=ri[2*e+1],I=ri[2*n],P=ri[2*n+1],D=ri[2*i],U=ri[2*i+1],V=iO(l,y,a);g=sO(V,g,A,u),l=V|0,{Dh:U,Dl:D}={Dh:U^g,Dl:D^l},{Dh:U,Dl:D}={Dh:ay(U,D,16),Dl:uy(U,D,16)},{h:P,l:I}=Zd(P,I,U,D),{Bh:A,Bl:y}={Bh:A^P,Bl:y^I},{Bh:A,Bl:y}={Bh:q_(A,y,63),Bl:Z_(A,y,63)},ri[2*r]=l,ri[2*r+1]=g,ri[2*e]=y,ri[2*e+1]=A,ri[2*n]=I,ri[2*n+1]=P,ri[2*i]=D,ri[2*i+1]=U}function DK(r,e={},n,i,s){if(Gd(n),r<0||r>n)throw new Error("outputLen bigger than keyLen");const{key:o,salt:a,personalization:u}=e;if(o!==void 0&&(o.length<1||o.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);a!==void 0&&uo(a,i,"salt"),u!==void 0&&uo(u,s,"personalization")}class UK{buffer;buffer32;finished=!1;destroyed=!1;length=0;pos=0;blockLen;outputLen;constructor(e,n){Gd(e),Gd(n),this.blockLen=e,this.outputLen=n,this.buffer=new Uint8Array(e),this.buffer32=Sw(this.buffer)}update(e){Tw(this),uo(e);const{blockLen:n,buffer:i,buffer32:s}=this,o=e.length,a=e.byteOffset,u=e.buffer;for(let l=0;l<o;){this.pos===n&&(Iw(s),this.compress(s,0,!1),Iw(s),this.pos=0);const g=Math.min(n-this.pos,o-l),y=a+l;if(g===n&&!(y%4)&&l+g<o){const A=new Uint32Array(u,y,Math.floor((o-l)/4));Iw(A);for(let I=0;l+n<o;I+=s.length,l+=n)this.length+=n,this.compress(A,I,!1);Iw(A);continue}i.set(e.subarray(l,l+g),this.pos),this.pos+=g,this.length+=g,l+=g}return this}digestInto(e){Tw(this),Aj(e,this);const{pos:n,buffer32:i}=this;this.finished=!0,qd(this.buffer.subarray(n)),Iw(i),this.compress(i,0,!0),Iw(i);const s=Sw(e);this.get().forEach((o,a)=>s[a]=mf(o))}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){const{buffer:n,length:i,finished:s,destroyed:o,outputLen:a,pos:u}=this;return e||=new this.constructor({dkLen:a}),e.set(...this.get()),e.buffer.set(n),e.destroyed=o,e.finished=s,e.length=i,e.pos=u,e.outputLen=a,e}clone(){return this._cloneInto()}}class oye extends UK{v0l=ru[0]|0;v0h=ru[1]|0;v1l=ru[2]|0;v1h=ru[3]|0;v2l=ru[4]|0;v2h=ru[5]|0;v3l=ru[6]|0;v3h=ru[7]|0;v4l=ru[8]|0;v4h=ru[9]|0;v5l=ru[10]|0;v5h=ru[11]|0;v6l=ru[12]|0;v6h=ru[13]|0;v7l=ru[14]|0;v7h=ru[15]|0;constructor(e={}){const n=e.dkLen===void 0?64:e.dkLen;super(128,n),DK(n,e,64,16,16);let{key:i,personalization:s,salt:o}=e,a=0;if(i!==void 0&&(uo(i,void 0,"key"),a=i.length),this.v0l^=this.outputLen|a<<8|65536|1<<24,o!==void 0){uo(o,void 0,"salt");const u=Sw(o);this.v4l^=mf(u[0]),this.v4h^=mf(u[1]),this.v5l^=mf(u[2]),this.v5h^=mf(u[3])}if(s!==void 0){uo(s,void 0,"personalization");const u=Sw(s);this.v6l^=mf(u[0]),this.v6h^=mf(u[1]),this.v7l^=mf(u[2]),this.v7h^=mf(u[3])}if(i!==void 0){const u=new Uint8Array(this.blockLen);u.set(i),this.update(u)}}get(){let{v0l:e,v0h:n,v1l:i,v1h:s,v2l:o,v2h:a,v3l:u,v3h:l,v4l:g,v4h:y,v5l:A,v5h:I,v6l:P,v6h:D,v7l:U,v7h:V}=this;return[e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V]}set(e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V){this.v0l=e|0,this.v0h=n|0,this.v1l=i|0,this.v1h=s|0,this.v2l=o|0,this.v2h=a|0,this.v3l=u|0,this.v3h=l|0,this.v4l=g|0,this.v4h=y|0,this.v5l=A|0,this.v5h=I|0,this.v6l=P|0,this.v6h=D|0,this.v7l=U|0,this.v7h=V|0}compress(e,n,i){this.get().forEach((l,g)=>ri[g]=l),ri.set(ru,16);let{h:s,l:o}=nO(BigInt(this.length));ri[24]=ru[8]^o,ri[25]=ru[9]^s,i&&(ri[28]=~ri[28],ri[29]=~ri[29]);let a=0;const u=LK;for(let l=0;l<12;l++)yy(0,4,8,12,e,n+2*u[a++]),my(0,4,8,12,e,n+2*u[a++]),yy(1,5,9,13,e,n+2*u[a++]),my(1,5,9,13,e,n+2*u[a++]),yy(2,6,10,14,e,n+2*u[a++]),my(2,6,10,14,e,n+2*u[a++]),yy(3,7,11,15,e,n+2*u[a++]),my(3,7,11,15,e,n+2*u[a++]),yy(0,5,10,15,e,n+2*u[a++]),my(0,5,10,15,e,n+2*u[a++]),yy(1,6,11,12,e,n+2*u[a++]),my(1,6,11,12,e,n+2*u[a++]),yy(2,7,8,13,e,n+2*u[a++]),my(2,7,8,13,e,n+2*u[a++]),yy(3,4,9,14,e,n+2*u[a++]),my(3,4,9,14,e,n+2*u[a++]);this.v0l^=ri[0]^ri[16],this.v0h^=ri[1]^ri[17],this.v1l^=ri[2]^ri[18],this.v1h^=ri[3]^ri[19],this.v2l^=ri[4]^ri[20],this.v2h^=ri[5]^ri[21],this.v3l^=ri[6]^ri[22],this.v3h^=ri[7]^ri[23],this.v4l^=ri[8]^ri[24],this.v4h^=ri[9]^ri[25],this.v5l^=ri[10]^ri[26],this.v5h^=ri[11]^ri[27],this.v6l^=ri[12]^ri[28],this.v6h^=ri[13]^ri[29],this.v7l^=ri[14]^ri[30],this.v7h^=ri[15]^ri[31],qd(ri)}destroy(){this.destroyed=!0,qd(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const kO=Rj(r=>new oye(r));function aye(r,e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce){let Re=0;for(let De=0;De<i;De++)({a:s,b:l,c:I,d:V}=py(s,l,I,V,n[e+r[Re++]])),{a:s,b:l,c:I,d:V}=gy(s,l,I,V,n[e+r[Re++]]),{a:o,b:g,c:P,d:J}=py(o,g,P,J,n[e+r[Re++]]),{a:o,b:g,c:P,d:J}=gy(o,g,P,J,n[e+r[Re++]]),{a,b:y,c:D,d:re}=py(a,y,D,re,n[e+r[Re++]]),{a,b:y,c:D,d:re}=gy(a,y,D,re,n[e+r[Re++]]),{a:u,b:A,c:U,d:ce}=py(u,A,U,ce,n[e+r[Re++]]),{a:u,b:A,c:U,d:ce}=gy(u,A,U,ce,n[e+r[Re++]]),{a:s,b:g,c:D,d:ce}=py(s,g,D,ce,n[e+r[Re++]]),{a:s,b:g,c:D,d:ce}=gy(s,g,D,ce,n[e+r[Re++]]),{a:o,b:y,c:U,d:V}=py(o,y,U,V,n[e+r[Re++]]),{a:o,b:y,c:U,d:V}=gy(o,y,U,V,n[e+r[Re++]]),{a,b:A,c:I,d:J}=py(a,A,I,J,n[e+r[Re++]]),{a,b:A,c:I,d:J}=gy(a,A,I,J,n[e+r[Re++]]),{a:u,b:l,c:P,d:re}=py(u,l,P,re,n[e+r[Re++]]),{a:u,b:l,c:P,d:re}=gy(u,l,P,re,n[e+r[Re++]]);return{v0:s,v1:o,v2:a,v3:u,v4:l,v5:g,v6:y,v7:A,v8:I,v9:P,v10:D,v11:U,v12:V,v13:J,v14:re,v15:ce}}const Wu=_p.slice();class AZe extends UK{v0=Wu[0]|0;v1=Wu[1]|0;v2=Wu[2]|0;v3=Wu[3]|0;v4=Wu[4]|0;v5=Wu[5]|0;v6=Wu[6]|0;v7=Wu[7]|0;constructor(e={}){const n=e.dkLen===void 0?32:e.dkLen;super(64,n),DK(n,e,32,8,8);let{key:i,personalization:s,salt:o}=e,a=0;if(i!==void 0&&(uo(i,void 0,"key"),a=i.length),this.v0^=this.outputLen|a<<8|65536|1<<24,o!==void 0){uo(o,void 0,"salt");const u=Sw(o);this.v4^=mf(u[0]),this.v5^=mf(u[1])}if(s!==void 0){uo(s,void 0,"personalization");const u=Sw(s);this.v6^=mf(u[0]),this.v7^=mf(u[1])}if(i!==void 0){const u=new Uint8Array(this.blockLen);u.set(i),this.update(u)}}get(){const{v0:e,v1:n,v2:i,v3:s,v4:o,v5:a,v6:u,v7:l}=this;return[e,n,i,s,o,a,u,l]}set(e,n,i,s,o,a,u,l){this.v0=e|0,this.v1=n|0,this.v2=i|0,this.v3=s|0,this.v4=o|0,this.v5=a|0,this.v6=u|0,this.v7=l|0}compress(e,n,i){const{h:s,l:o}=nO(BigInt(this.length)),{v0:a,v1:u,v2:l,v3:g,v4:y,v5:A,v6:I,v7:P,v8:D,v9:U,v10:V,v11:J,v12:re,v13:ce,v14:Re,v15:De}=aye(LK,n,e,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,Wu[0],Wu[1],Wu[2],Wu[3],o^Wu[4],s^Wu[5],i?~Wu[6]:Wu[6],Wu[7]);this.v0^=a^D,this.v1^=u^U,this.v2^=l^V,this.v3^=g^J,this.v4^=y^re,this.v5^=A^ce,this.v6^=I^Re,this.v7^=P^De}destroy(){this.destroyed=!0,qd(this.buffer32),this.set(0,0,0,0,0,0,0,0)}}const _Ze=null,sk=32,EZe=64,FK="suiprivkey";var uye=class{async signWithIntent(r,e){const n=kO(NK(e,r),{dkLen:32});return{signature:sye({signature:await this.sign(n),signatureScheme:this.getKeyScheme(),publicKey:this.getPublicKey()}),bytes:Yd(r)}}async signTransaction(r){return this.signWithIntent(r,"TransactionData")}async signPersonalMessage(r){const{signature:e}=await this.signWithIntent(fr.byteVector().serialize(r).toBytes(),"PersonalMessage");return{bytes:Yd(r),signature:e}}async signAndExecuteTransaction({transaction:r,client:e}){r.setSenderIfNotSet(this.toSuiAddress());const n=await r.build({client:e}),{signature:i}=await this.signTransaction(n);return e.core.executeTransaction({transaction:n,signatures:[i],include:{transaction:!0,effects:!0}})}toSuiAddress(){return this.getPublicKey().toSuiAddress()}},cye=class extends uye{};function lye(r){const{prefix:e,words:n}=ek.decode(r);if(e!==FK)throw new Error("invalid private key prefix");const i=new Uint8Array(ek.fromWords(n)),s=i.slice(1);return{scheme:MK[i[0]],secretKey:s}}function fye(r,e){if(r.length!==sk)throw new Error("Invalid bytes length");const n=IO[e],i=new Uint8Array(r.length+1);return i.set([n]),i.set(r,1),ek.encode(FK,ek.toWords(i))}const dye="ed25519 seed",hye=2147483648,pye=new RegExp("^m(\\/[0-9]+')+$"),WK=r=>r.replace("'",""),gye=r=>{const e=V3.create(Y_,new TextEncoder().encode(dye)).update(eO(r)).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},yye=({key:r,chainCode:e},n)=>{const i=new ArrayBuffer(4);new DataView(i).setUint32(0,n);const s=new Uint8Array(1+r.length+i.byteLength);s.set(new Uint8Array(1).fill(0)),s.set(r,1),s.set(new Uint8Array(i,0,i.byteLength),r.length+1);const o=V3.create(Y_,e).update(s).digest();return{key:o.slice(0,32),chainCode:o.slice(32)}},mye=r=>pye.test(r)?!r.split("/").slice(1).map(WK).some(isNaN):!1,HK=(r,e,n=hye)=>{if(!mye(r))throw new Error("Invalid derivation path");const{key:i,chainCode:s}=gye(e);return r.split("/").slice(1).map(WK).map(o=>parseInt(o,10)).reduce((o,a)=>yye(o,a+n),{key:i,chainCode:s})};function zK(r,e){if(r===e)return!0;if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}var bye=class{equals(r){return zK(this.toRawBytes(),r.toRawBytes())}toBase64(){return Yd(this.toRawBytes())}toString(){throw new Error("`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead.")}toSuiPublicKey(){return Yd(this.toSuiBytes())}verifyWithIntent(r,e,n){const i=kO(NK(n,r),{dkLen:32});return this.verify(i,e)}verifyPersonalMessage(r,e){return this.verifyWithIntent(SO.byteVector().serialize(r).toBytes(),e,"PersonalMessage")}verifyTransaction(r,e){return this.verifyWithIntent(r,e,"TransactionData")}verifyAddress(r){return this.toSuiAddress()===r}toSuiBytes(){const r=this.toRawBytes(),e=new Uint8Array(r.length+1);return e.set([this.flag()]),e.set(r,1),e}toSuiAddress(){return Bb(G_(kO(this.toSuiBytes(),{dkLen:32})).slice(0,q3*2))}};function vye(r){const e=Pb(r),n=MK[e[0]];switch(n){case"ED25519":case"Secp256k1":case"Secp256r1":const i=iye[n],s=e.slice(1,e.length-i);return{serializedSignature:r,signatureScheme:n,signature:s,publicKey:e.slice(1+s.length),bytes:e};default:throw new Error("Unsupported signature scheme")}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ok=BigInt(0),J_=BigInt(1);function RO(r,e=""){if(typeof r!="boolean"){const n=e&&`"${e}" `;throw new Error(n+"expected boolean, got type="+typeof r)}return r}function CO(r){if(typeof r=="bigint"){if(!ak(r))throw new Error("positive bigint expected, got "+r)}else Gd(r);return r}function TZe(r,e=""){if(!Number.isSafeInteger(r)){const n=e&&`"${e}" `;throw new Error(n+"expected safe integer, got type="+typeof r)}}function wye(r){const e=CO(r).toString(16);return e.length&1?"0"+e:e}function $K(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return r===""?ok:BigInt("0x"+r)}function Aye(r){return $K(G_(r))}function Q_(r){return $K(G_(xO(uo(r)).reverse()))}function VK(r,e){Gd(e),r=CO(r);const n=tO(r.toString(16).padStart(e*2,"0"));if(n.length!==e)throw new Error("number too large");return n}function _ye(r,e){return VK(r,e).reverse()}function SZe(r){return hexToBytes_(wye(CO(r)))}function Eye(r,e){if(r.length!==e.length)return!1;let n=0;for(let i=0;i<r.length;i++)n|=r[i]^e[i];return n===0}function xO(r){return Uint8Array.from(r)}function IZe(r){return Uint8Array.from(r,(e,n)=>{const i=e.charCodeAt(0);if(e.length!==1||i>127)throw new Error(`string contains non-ASCII character "${r[n]}" with code ${i} at position ${n}`);return i})}const ak=r=>typeof r=="bigint"&&ok<=r;function Tye(r,e,n){return ak(r)&&ak(e)&&ak(n)&&e<=r&&r<n}function jK(r,e,n,i){if(!Tye(e,n,i))throw new Error("expected valid "+r+": "+n+" <= n < "+i+", got "+e)}function kZe(r){let e;for(e=0;r>ok;r>>=J_,e+=1);return e}function RZe(r,e){return r>>BigInt(e)&J_}function CZe(r,e,n){return r|(n?J_:ok)<<BigInt(e)}const Sye=r=>(J_<<BigInt(r))-J_;function xZe(r,e,n){if(anumber(r,"hashLen"),anumber(e,"qByteLen"),typeof n!="function")throw new Error("hmacFn must be a function");const i=V=>new Uint8Array(V),s=Uint8Array.of(),o=Uint8Array.of(0),a=Uint8Array.of(1),u=1e3;let l=i(r),g=i(r),y=0;const A=()=>{l.fill(1),g.fill(0),y=0},I=(...V)=>n(g,concatBytes_(l,...V)),P=(V=s)=>{g=I(o,V),l=I(),V.length!==0&&(g=I(a,V),l=I())},D=()=>{if(y++>=u)throw new Error("drbg: tried max amount of iterations");let V=0;const J=[];for(;V<e;){l=I();const re=l.slice();J.push(re),V+=l.length}return concatBytes_(...J)};return(V,J)=>{A(),P(V);let re;for(;!(re=J(D()));)P();return A(),re}}function BO(r,e={},n={}){if(!r||typeof r!="object")throw new Error("expected valid options object");function i(o,a,u){const l=r[o];if(u&&l===void 0)return;const g=typeof l;if(g!==a||l===null)throw new Error(`param "${o}" is invalid: expected ${a}, got ${g}`)}const s=(o,a)=>Object.entries(o).forEach(([u,l])=>i(u,l,a));s(e,!1),s(n,!0)}const KK=()=>{throw new Error("not implemented")};function GK(r){const e=new WeakMap;return(n,...i)=>{const s=e.get(n);if(s!==void 0)return s;const o=r(n,...i);return e.set(n,o),o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Hc=BigInt(0),pu=BigInt(1),Nb=BigInt(2),qK=BigInt(3),ZK=BigInt(4),YK=BigInt(5),Iye=BigInt(7),XK=BigInt(8),kye=BigInt(9),JK=BigInt(16);function Va(r,e){const n=r%e;return n>=Hc?n:e+n}function BZe(r,e,n){return tG(uk(n),r,e)}function e0(r,e,n){let i=r;for(;e-- >Hc;)i*=i,i%=n;return i}function OO(r,e){if(r===Hc)throw new Error("invert: expected non-zero number");if(e<=Hc)throw new Error("invert: expected positive modulus, got "+e);let n=Va(r,e),i=e,s=Hc,o=pu,a=pu,u=Hc;for(;n!==Hc;){const g=i/n,y=i%n,A=s-a*g,I=o-u*g;i=n,n=y,s=a,o=u,a=A,u=I}if(i!==pu)throw new Error("invert: does not exist");return Va(s,e)}function PO(r,e,n){if(!r.eql(r.sqr(e),n))throw new Error("Cannot find square root")}function QK(r,e){const n=(r.ORDER+pu)/ZK,i=r.pow(e,n);return PO(r,i,e),i}function Rye(r,e){const n=(r.ORDER-YK)/XK,i=r.mul(e,Nb),s=r.pow(i,n),o=r.mul(e,s),a=r.mul(r.mul(o,Nb),s),u=r.mul(o,r.sub(a,r.ONE));return PO(r,u,e),u}function Cye(r){const e=uk(r),n=eG(r),i=n(e,e.neg(e.ONE)),s=n(e,i),o=n(e,e.neg(i)),a=(r+Iye)/JK;return(u,l)=>{let g=u.pow(l,a),y=u.mul(g,i);const A=u.mul(g,s),I=u.mul(g,o),P=u.eql(u.sqr(y),l),D=u.eql(u.sqr(A),l);g=u.cmov(g,y,P),y=u.cmov(I,A,D);const U=u.eql(u.sqr(y),l),V=u.cmov(g,y,U);return PO(u,V,l),V}}function eG(r){if(r<qK)throw new Error("sqrt is not defined for small field");let e=r-pu,n=0;for(;e%Nb===Hc;)e/=Nb,n++;let i=Nb;const s=uk(r);for(;NO(s,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return QK;let o=s.pow(i,e);const a=(e+pu)/Nb;return function(l,g){if(l.is0(g))return g;if(NO(l,g)!==1)throw new Error("Cannot find square root");let y=n,A=l.mul(l.ONE,o),I=l.pow(g,e),P=l.pow(g,a);for(;!l.eql(I,l.ONE);){if(l.is0(I))return l.ZERO;let D=1,U=l.sqr(I);for(;!l.eql(U,l.ONE);)if(D++,U=l.sqr(U),D===y)throw new Error("Cannot find square root");const V=pu<<BigInt(y-D-1),J=l.pow(A,V);y=D,A=l.sqr(J),I=l.mul(I,A),P=l.mul(P,J)}return P}}function xye(r){return r%ZK===qK?QK:r%XK===YK?Rye:r%JK===kye?Cye(r):eG(r)}const Mb=(r,e)=>(Va(r,e)&pu)===pu,Bye=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Oye(r){const e={ORDER:"bigint",BYTES:"number",BITS:"number"},n=Bye.reduce((i,s)=>(i[s]="function",i),e);return BO(r,n),r}function tG(r,e,n){if(n<Hc)throw new Error("invalid exponent, negatives unsupported");if(n===Hc)return r.ONE;if(n===pu)return e;let i=r.ONE,s=e;for(;n>Hc;)n&pu&&(i=r.mul(i,s)),s=r.sqr(s),n>>=pu;return i}function rG(r,e,n=!1){const i=new Array(e.length).fill(n?r.ZERO:void 0),s=e.reduce((a,u,l)=>r.is0(u)?a:(i[l]=a,r.mul(a,u)),r.ONE),o=r.inv(s);return e.reduceRight((a,u,l)=>r.is0(u)?a:(i[l]=r.mul(a,i[l]),r.mul(a,u)),o),i}function OZe(r,e,n){return r.mul(e,typeof n=="bigint"?OO(n,r.ORDER):r.inv(n))}function NO(r,e){const n=(r.ORDER-pu)/Nb,i=r.pow(e,n),s=r.eql(i,r.ONE),o=r.eql(i,r.ZERO),a=r.eql(i,r.neg(r.ONE));if(!s&&!o&&!a)throw new Error("invalid Legendre symbol result");return s?1:o?0:-1}function PZe(r,e){return NO(r,e)===1}function Pye(r,e){e!==void 0&&Gd(e);const n=e!==void 0?e:r.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}class Nye{ORDER;BITS;BYTES;isLE;ZERO=Hc;ONE=pu;_lengths;_sqrt;_mod;constructor(e,n={}){if(e<=Hc)throw new Error("invalid field: expected ORDER > 0, got "+e);let i;this.isLE=!1,n!=null&&typeof n=="object"&&(typeof n.BITS=="number"&&(i=n.BITS),typeof n.sqrt=="function"&&(this.sqrt=n.sqrt),typeof n.isLE=="boolean"&&(this.isLE=n.isLE),n.allowedLengths&&(this._lengths=n.allowedLengths?.slice()),typeof n.modFromBytes=="boolean"&&(this._mod=n.modFromBytes));const{nBitLength:s,nByteLength:o}=Pye(e,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=s,this.BYTES=o,this._sqrt=void 0,Object.preventExtensions(this)}create(e){return Va(e,this.ORDER)}isValid(e){if(typeof e!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof e);return Hc<=e&&e<this.ORDER}is0(e){return e===Hc}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&pu)===pu}neg(e){return Va(-e,this.ORDER)}eql(e,n){return e===n}sqr(e){return Va(e*e,this.ORDER)}add(e,n){return Va(e+n,this.ORDER)}sub(e,n){return Va(e-n,this.ORDER)}mul(e,n){return Va(e*n,this.ORDER)}pow(e,n){return tG(this,e,n)}div(e,n){return Va(e*OO(n,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,n){return e+n}subN(e,n){return e-n}mulN(e,n){return e*n}inv(e){return OO(e,this.ORDER)}sqrt(e){return this._sqrt||(this._sqrt=xye(this.ORDER)),this._sqrt(this,e)}toBytes(e){return this.isLE?_ye(e,this.BYTES):VK(e,this.BYTES)}fromBytes(e,n=!1){uo(e);const{_lengths:i,BYTES:s,isLE:o,ORDER:a,_mod:u}=this;if(i){if(!i.includes(e.length)||e.length>s)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);const g=new Uint8Array(s);g.set(e,o?0:g.length-e.length),e=g}if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);let l=o?Q_(e):Aye(e);if(u&&(l=Va(l,a)),!n&&!this.isValid(l))throw new Error("invalid field element: outside of range 0..ORDER");return l}invertBatch(e){return rG(this,e)}cmov(e,n,i){return i?n:e}}function uk(r,e={}){return new Nye(r,e)}function NZe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?n:r.neg(n)}function MZe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?r.neg(n):n}function nG(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function Mye(r){const e=nG(r);return e+Math.ceil(e/2)}function LZe(r,e,n=!1){abytes(r);const i=r.length,s=nG(e),o=Mye(e);if(i<16||i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);const a=n?bytesToNumberLE(r):bytesToNumberBE(r),u=Va(a,e-pu)+pu;return n?numberToBytesLE(u,s):numberToBytesBE(u,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Cw=BigInt(0),Lb=BigInt(1);function iG(r,e){const n=e.negate();return r?n:e}function MO(r,e){const n=rG(r.Fp,e.map(i=>i.Z));return e.map((i,s)=>r.fromAffine(i.toAffine(n[s])))}function LO(r,e){if(!Number.isSafeInteger(r)||r<=0||r>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+r)}function DO(r,e){LO(r,e);const n=Math.ceil(e/r)+1,i=2**(r-1),s=2**r,o=Sye(r),a=BigInt(r);return{windows:n,windowSize:i,mask:o,maxNumber:s,shiftBy:a}}function sG(r,e,n){const{windowSize:i,mask:s,maxNumber:o,shiftBy:a}=n;let u=Number(r&s),l=r>>a;u>i&&(u-=o,l+=Lb);const g=e*i,y=g+Math.abs(u)-1,A=u===0,I=u<0,P=e%2!==0;return{nextN:l,offset:y,isZero:A,isNeg:I,isNegF:P,offsetF:g}}function oG(r,e){if(!Array.isArray(r))throw new Error("array expected");r.forEach((n,i)=>{if(!(n instanceof e))throw new Error("invalid point at index "+i)})}function aG(r,e){if(!Array.isArray(r))throw new Error("array of scalars expected");r.forEach((n,i)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+i)})}const UO=new WeakMap,uG=new WeakMap;function FO(r){return uG.get(r)||1}function cG(r){if(r!==Cw)throw new Error("invalid wNAF")}class Lye{BASE;ZERO;Fn;bits;constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,i=this.ZERO){let s=e;for(;n>Cw;)n&Lb&&(i=i.add(s)),s=s.double(),n>>=Lb;return i}precomputeWindow(e,n){const{windows:i,windowSize:s}=DO(n,this.bits),o=[];let a=e,u=a;for(let l=0;l<i;l++){u=a,o.push(u);for(let g=1;g<s;g++)u=u.add(a),o.push(u);a=u.double()}return o}wNAF(e,n,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let s=this.ZERO,o=this.BASE;const a=DO(e,this.bits);for(let u=0;u<a.windows;u++){const{nextN:l,offset:g,isZero:y,isNeg:A,isNegF:I,offsetF:P}=sG(i,u,a);i=l,y?o=o.add(iG(I,n[P])):s=s.add(iG(A,n[g]))}return cG(i),{p:s,f:o}}wNAFUnsafe(e,n,i,s=this.ZERO){const o=DO(e,this.bits);for(let a=0;a<o.windows&&i!==Cw;a++){const{nextN:u,offset:l,isZero:g,isNeg:y}=sG(i,a,o);if(i=u,!g){const A=n[l];s=s.add(y?A.negate():A)}}return cG(i),s}getPrecomputes(e,n,i){let s=UO.get(n);return s||(s=this.precomputeWindow(n,e),e!==1&&(typeof i=="function"&&(s=i(s)),UO.set(n,s))),s}cached(e,n,i){const s=FO(e);return this.wNAF(s,this.getPrecomputes(s,e,i),n)}unsafe(e,n,i,s){const o=FO(e);return o===1?this._unsafeLadder(e,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,e,i),n,s)}createCache(e,n){LO(n,this.bits),uG.set(e,n),UO.delete(e)}hasCache(e){return FO(e)!==1}}function DZe(r,e,n,i){let s=e,o=r.ZERO,a=r.ZERO;for(;n>Cw||i>Cw;)n&Lb&&(o=o.add(s)),i&Lb&&(a=a.add(s)),s=s.double(),n>>=Lb,i>>=Lb;return{p1:o,p2:a}}function UZe(r,e,n){const i=r.Fn;oG(e,r),aG(n,i);const s=e.length,o=n.length;if(s!==o)throw new Error("arrays of points and scalars must have equal length");const a=r.ZERO,u=bitLen(BigInt(s));let l=1;u>12?l=u-3:u>4?l=u-2:u>0&&(l=2);const g=bitMask(l),y=new Array(Number(g)+1).fill(a),A=Math.floor((i.BITS-1)/l)*l;let I=a;for(let P=A;P>=0;P-=l){y.fill(a);for(let U=0;U<o;U++){const V=n[U],J=Number(V>>BigInt(P)&g);y[J]=y[J].add(e[U])}let D=a;for(let U=y.length-1,V=a;U>0;U--)V=V.add(y[U]),D=D.add(V);if(I=I.add(D),P!==0)for(let U=0;U<l;U++)I=I.double()}return I}function FZe(r,e,n){const i=r.Fn;LO(n,i.BITS),oG(e,r);const s=r.ZERO,o=2**n-1,a=Math.ceil(i.BITS/n),u=bitMask(n),l=e.map(g=>{const y=[];for(let A=0,I=g;A<o;A++)y.push(I),I=I.add(g);return y});return g=>{if(aG(g,i),g.length>e.length)throw new Error("array of scalars must be smaller than array of points");let y=s;for(let A=0;A<a;A++){if(y!==s)for(let P=0;P<n;P++)y=y.double();const I=BigInt(a*n-(A+1)*n);for(let P=0;P<g.length;P++){const D=g[P],U=Number(D>>I&u);U&&(y=y.add(l[P][U-1]))}}return y}}function lG(r,e,n){if(e){if(e.ORDER!==r)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Oye(e),e}else return uk(r,{isLE:n})}function Dye(r,e,n={},i){if(i===void 0&&(i=r==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${r} CURVE object`);for(const l of["p","n","h"]){const g=e[l];if(!(typeof g=="bigint"&&g>Cw))throw new Error(`CURVE.${l} must be positive bigint`)}const s=lG(e.p,n.Fp,i),o=lG(e.n,n.Fn,i),u=["Gx","Gy","a",r==="weierstrass"?"b":"d"];for(const l of u)if(!s.isValid(e[l]))throw new Error(`CURVE.${l} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:s,Fn:o}}function Uye(r,e){return function(i){const s=r(i);return{secretKey:s,publicKey:e(s)}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const by=BigInt(0),gu=BigInt(1),WO=BigInt(2),Fye=BigInt(8);function Wye(r,e,n,i){const s=r.sqr(n),o=r.sqr(i),a=r.add(r.mul(e.a,s),o),u=r.add(r.ONE,r.mul(e.d,r.mul(s,o)));return r.eql(a,u)}function Hye(r,e={}){const n=Dye("edwards",r,e,e.FpFnLE),{Fp:i,Fn:s}=n;let o=n.CURVE;const{h:a}=o;BO(e,{},{uvRatio:"function"});const u=WO<<BigInt(s.BYTES*8)-gu,l=V=>i.create(V),g=e.uvRatio||((V,J)=>{try{return{isValid:!0,value:i.sqrt(i.div(V,J))}}catch{return{isValid:!1,value:by}}});if(!Wye(i,o,o.Gx,o.Gy))throw new Error("bad curve params: generator point");function y(V,J,re=!1){const ce=re?gu:by;return jK("coordinate "+V,J,ce,u),J}function A(V){if(!(V instanceof D))throw new Error("EdwardsPoint expected")}const I=GK((V,J)=>{const{X:re,Y:ce,Z:Re}=V,De=V.is0();J==null&&(J=De?Fye:i.inv(Re));const Ue=l(re*J),Ve=l(ce*J),pe=i.mul(Re,J);if(De)return{x:by,y:gu};if(pe!==gu)throw new Error("invZ was invalid");return{x:Ue,y:Ve}}),P=GK(V=>{const{a:J,d:re}=o;if(V.is0())throw new Error("bad point: ZERO");const{X:ce,Y:Re,Z:De,T:Ue}=V,Ve=l(ce*ce),pe=l(Re*Re),Se=l(De*De),Ce=l(Se*Se),je=l(Ve*J),$e=l(Se*l(je+pe)),Qe=l(Ce+l(re*l(Ve*pe)));if($e!==Qe)throw new Error("bad point: equation left != right (1)");const nt=l(ce*Re),Ne=l(De*Ue);if(nt!==Ne)throw new Error("bad point: equation left != right (2)");return!0});class D{static BASE=new D(o.Gx,o.Gy,gu,l(o.Gx*o.Gy));static ZERO=new D(by,gu,gu,by);static Fp=i;static Fn=s;X;Y;Z;T;constructor(J,re,ce,Re){this.X=y("x",J),this.Y=y("y",re),this.Z=y("z",ce,!0),this.T=y("t",Re),Object.freeze(this)}static CURVE(){return o}static fromAffine(J){if(J instanceof D)throw new Error("extended point not allowed");const{x:re,y:ce}=J||{};return y("x",re),y("y",ce),new D(re,ce,gu,l(re*ce))}static fromBytes(J,re=!1){const ce=i.BYTES,{a:Re,d:De}=o;J=xO(uo(J,ce,"point")),RO(re,"zip215");const Ue=xO(J),Ve=J[ce-1];Ue[ce-1]=Ve&-129;const pe=Q_(Ue),Se=re?u:i.ORDER;jK("point.y",pe,by,Se);const Ce=l(pe*pe),je=l(Ce-gu),$e=l(De*Ce-Re);let{isValid:Qe,value:nt}=g(je,$e);if(!Qe)throw new Error("bad point: invalid y coordinate");const Ne=(nt&gu)===gu,Me=(Ve&128)!==0;if(!re&&nt===by&&Me)throw new Error("bad point: x=0 and x_0=1");return Me!==Ne&&(nt=l(-nt)),D.fromAffine({x:nt,y:pe})}static fromHex(J,re=!1){return D.fromBytes(tO(J),re)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(J=8,re=!0){return U.createCache(this,J),re||this.multiply(WO),this}assertValidity(){P(this)}equals(J){A(J);const{X:re,Y:ce,Z:Re}=this,{X:De,Y:Ue,Z:Ve}=J,pe=l(re*Ve),Se=l(De*Re),Ce=l(ce*Ve),je=l(Ue*Re);return pe===Se&&Ce===je}is0(){return this.equals(D.ZERO)}negate(){return new D(l(-this.X),this.Y,this.Z,l(-this.T))}double(){const{a:J}=o,{X:re,Y:ce,Z:Re}=this,De=l(re*re),Ue=l(ce*ce),Ve=l(WO*l(Re*Re)),pe=l(J*De),Se=re+ce,Ce=l(l(Se*Se)-De-Ue),je=pe+Ue,$e=je-Ve,Qe=pe-Ue,nt=l(Ce*$e),Ne=l(je*Qe),Me=l(Ce*Qe),ct=l($e*je);return new D(nt,Ne,ct,Me)}add(J){A(J);const{a:re,d:ce}=o,{X:Re,Y:De,Z:Ue,T:Ve}=this,{X:pe,Y:Se,Z:Ce,T:je}=J,$e=l(Re*pe),Qe=l(De*Se),nt=l(Ve*ce*je),Ne=l(Ue*Ce),Me=l((Re+De)*(pe+Se)-$e-Qe),ct=Ne-nt,mt=Ne+nt,Bt=l(Qe-re*$e),er=l(Me*ct),cr=l(mt*Bt),pr=l(Me*Bt),Dr=l(ct*mt);return new D(er,cr,Dr,pr)}subtract(J){return this.add(J.negate())}multiply(J){if(!s.isValidNot0(J))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:re,f:ce}=U.cached(this,J,Re=>MO(D,Re));return MO(D,[re,ce])[0]}multiplyUnsafe(J,re=D.ZERO){if(!s.isValid(J))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return J===by?D.ZERO:this.is0()||J===gu?this:U.unsafe(this,J,ce=>MO(D,ce),re)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return U.unsafe(this,o.n).is0()}toAffine(J){return I(this,J)}clearCofactor(){return a===gu?this:this.multiplyUnsafe(a)}toBytes(){const{x:J,y:re}=this.toAffine(),ce=i.toBytes(re);return ce[ce.length-1]|=J&gu?128:0,ce}toHex(){return G_(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const U=new Lye(D,s.BITS);return D.BASE.precompute(8),D}class zye{static BASE;static ZERO;static Fp;static Fn;ep;constructor(e){this.ep=e}static fromBytes(e){KK()}static fromHex(e){KK()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return G_(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,n){return this.init(this.ep.precompute(e,n))}}function $ye(r,e,n={}){if(typeof e!="function")throw new Error('"hash" function param is required');BO(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:i}=n,{BASE:s,Fp:o,Fn:a}=r,u=n.randomBytes||Ope,l=n.adjustScalarBytes||(pe=>pe),g=n.domain||((pe,Se,Ce)=>{if(RO(Ce,"phflag"),Se.length||Ce)throw new Error("Contexts/pre-hash are not supported");return pe});function y(pe){return a.create(Q_(pe))}function A(pe){const Se=ce.secretKey;uo(pe,ce.secretKey,"secretKey");const Ce=uo(e(pe),2*Se,"hashedSecretKey"),je=l(Ce.slice(0,Se)),$e=Ce.slice(Se,2*Se),Qe=y(je);return{head:je,prefix:$e,scalar:Qe}}function I(pe){const{head:Se,prefix:Ce,scalar:je}=A(pe),$e=s.multiply(je),Qe=$e.toBytes();return{head:Se,prefix:Ce,scalar:je,point:$e,pointBytes:Qe}}function P(pe){return I(pe).pointBytes}function D(pe=Uint8Array.of(),...Se){const Ce=kj(...Se);return y(e(g(Ce,uo(pe,void 0,"context"),!!i)))}function U(pe,Se,Ce={}){pe=uo(pe,void 0,"message"),i&&(pe=i(pe));const{prefix:je,scalar:$e,pointBytes:Qe}=I(Se),nt=D(Ce.context,je,pe),Ne=s.multiply(nt).toBytes(),Me=D(Ce.context,Ne,Qe,pe),ct=a.create(nt+Me*$e);if(!a.isValid(ct))throw new Error("sign failed: invalid s");const mt=kj(Ne,a.toBytes(ct));return uo(mt,ce.signature,"result")}const V={zip215:!0};function J(pe,Se,Ce,je=V){const{context:$e,zip215:Qe}=je,nt=ce.signature;pe=uo(pe,nt,"signature"),Se=uo(Se,void 0,"message"),Ce=uo(Ce,ce.publicKey,"publicKey"),Qe!==void 0&&RO(Qe,"zip215"),i&&(Se=i(Se));const Ne=nt/2,Me=pe.subarray(0,Ne),ct=Q_(pe.subarray(Ne,nt));let mt,Bt,er;try{mt=r.fromBytes(Ce,Qe),Bt=r.fromBytes(Me,Qe),er=s.multiplyUnsafe(ct)}catch{return!1}if(!Qe&&mt.isSmallOrder())return!1;const cr=D($e,Bt.toBytes(),mt.toBytes(),Se);return Bt.add(mt.multiplyUnsafe(cr)).subtract(er).clearCofactor().is0()}const re=o.BYTES,ce={secretKey:re,publicKey:re,signature:2*re,seed:re};function Re(pe=u(ce.seed)){return uo(pe,ce.seed,"seed")}function De(pe){return vj(pe)&&pe.length===a.BYTES}function Ue(pe,Se){try{return!!r.fromBytes(pe,Se)}catch{return!1}}const Ve={getExtendedPublicKey:I,randomSecretKey:Re,isValidSecretKey:De,isValidPublicKey:Ue,toMontgomery(pe){const{y:Se}=r.fromBytes(pe),Ce=ce.publicKey,je=Ce===32;if(!je&&Ce!==57)throw new Error("only defined for 25519 and 448");const $e=je?o.div(gu+Se,gu-Se):o.div(Se-gu,Se+gu);return o.toBytes($e)},toMontgomerySecret(pe){const Se=ce.secretKey;uo(pe,Se);const Ce=e(pe.subarray(0,Se));return l(Ce).subarray(0,Se)}};return Object.freeze({keygen:Uye(Re,P),getPublicKey:P,sign:U,verify:J,utils:Ve,Point:r,lengths:ce})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Vye=BigInt(0),t0=BigInt(1),HO=BigInt(2),WZe=null,fG=BigInt(5),dG=BigInt(8),Db=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),zO={p:Db,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:dG,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function jye(r){const e=BigInt(10),n=BigInt(20),i=BigInt(40),s=BigInt(80),o=Db,u=r*r%o*r%o,l=e0(u,HO,o)*u%o,g=e0(l,t0,o)*r%o,y=e0(g,fG,o)*g%o,A=e0(y,e,o)*y%o,I=e0(A,n,o)*A%o,P=e0(I,i,o)*I%o,D=e0(P,s,o)*P%o,U=e0(D,s,o)*P%o,V=e0(U,e,o)*y%o;return{pow_p_5_8:e0(V,HO,o)*r%o,b2:u}}function Kye(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}const $O=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function VO(r,e){const n=Db,i=Va(e*e*e,n),s=Va(i*i*e,n),o=jye(r*s).pow_p_5_8;let a=Va(r*i*o,n);const u=Va(e*a*a,n),l=a,g=Va(a*$O,n),y=u===r,A=u===Va(-r,n),I=u===Va(-r*$O,n);return y&&(a=l),(A||I)&&(a=g),Mb(a,n)&&(a=Va(-a,n)),{isValid:y||A,value:a}}const vy=Hye(zO,{uvRatio:VO}),ui=vy.Fp,Gye=vy.Fn;function HZe(r,e,n){if(e.length>255)throw new Error("Context is too big");return concatBytes(asciiToBytes("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,e.length]),e,r)}function qye(r){return $ye(vy,Y_,Object.assign({adjustScalarBytes:Kye},r))}const Ep=qye({}),zZe=null,$Ze=null,VZe=null,jZe=null,Zye=null,hG=null;function Yye(r){const e=(Db-fG)/dG,n=BigInt(486662);let i=ui.sqr(r);i=ui.mul(i,HO);let s=ui.add(i,ui.ONE),o=ui.neg(n),a=ui.sqr(s),u=ui.mul(a,s),l=ui.mul(i,n);l=ui.mul(l,o),l=ui.add(l,a),l=ui.mul(l,o);let g=ui.sqr(u);a=ui.sqr(g),g=ui.mul(g,u),g=ui.mul(g,l),a=ui.mul(a,g);let y=ui.pow(a,e);y=ui.mul(y,g);let A=ui.mul(y,hG);a=ui.sqr(y),a=ui.mul(a,u);let I=ui.eql(a,l),P=ui.cmov(A,y,I),D=ui.mul(o,i),U=ui.mul(y,r);U=ui.mul(U,Zye);let V=ui.mul(U,hG),J=ui.mul(l,i);a=ui.sqr(U),a=ui.mul(a,u);let re=ui.eql(a,J),ce=ui.cmov(V,U,re);a=ui.sqr(P),a=ui.mul(a,u);let Re=ui.eql(a,l),De=ui.cmov(D,o,Re),Ue=ui.cmov(ce,P,Re),Ve=ui.isOdd(Ue);return Ue=ui.cmov(Ue,ui.neg(Ue),Re!==Ve),{xMn:De,xMd:s,yMn:Ue,yMd:t0}}const Xye=null;function KZe(r){const{xMn:e,xMd:n,yMn:i,yMd:s}=Yye(r);let o=ui.mul(e,s);o=ui.mul(o,Xye);let a=ui.mul(n,i),u=ui.sub(e,n),l=ui.add(e,n),g=ui.mul(a,l),y=ui.eql(g,ui.ZERO);o=ui.cmov(o,ui.ZERO,y),a=ui.cmov(a,ui.ONE,y),u=ui.cmov(u,ui.ONE,y),l=ui.cmov(l,ui.ONE,y);const[A,I]=FpInvertBatch(ui,[a,l],!0);return{x:ui.mul(o,A),y:ui.mul(u,I)}}const GZe=null,jO=$O,Jye=null,Qye=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),eme=null,tme=null,pG=r=>VO(t0,r),rme=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),nme=r=>ui.create(Q_(r)&rme);function qZe(r){const{d:e}=zO,n=Db,i=J=>ui.create(J),s=i(jO*r*r),o=i((s+t0)*eme);let a=BigInt(-1);const u=i((a-e*s)*i(s+e));let{isValid:l,value:g}=VO(o,u),y=i(g*r);isNegativeLE(y,n)||(y=i(-y)),l||(g=y),l||(a=s);const A=i(a*(s-t0)*tme-u),I=g*g,P=i((g+g)*u),D=i(A*Jye),U=i(t0-I),V=i(t0+I);return new vy(i(P*V),i(U*D),i(D*V),i(P*U))}class Tp extends zye{static BASE=new Tp(vy.BASE);static ZERO=new Tp(vy.ZERO);static Fp=ui;static Fn=Gye;constructor(e){super(e)}static fromAffine(e){return new Tp(vy.fromAffine(e))}assertSame(e){if(!(e instanceof Tp))throw new Error("RistrettoPoint expected")}init(e){return new Tp(e)}static fromBytes(e){uo(e,32);const{a:n,d:i}=zO,s=Db,o=Re=>ui.create(Re),a=nme(e);if(!Eye(ui.toBytes(a),e)||Mb(a,s))throw new Error("invalid ristretto255 encoding 1");const u=o(a*a),l=o(t0+n*u),g=o(t0-n*u),y=o(l*l),A=o(g*g),I=o(n*i*y-A),{isValid:P,value:D}=pG(o(I*A)),U=o(D*g),V=o(D*U*I);let J=o((a+a)*U);Mb(J,s)&&(J=o(-J));const re=o(l*V),ce=o(J*re);if(!P||Mb(ce,s)||re===Vye)throw new Error("invalid ristretto255 encoding 2");return new Tp(new vy(J,re,t0,ce))}static fromHex(e){return Tp.fromBytes(tO(e))}toBytes(){let{X:e,Y:n,Z:i,T:s}=this.ep;const o=Db,a=V=>ui.create(V),u=a(a(i+n)*a(i-n)),l=a(e*n),g=a(l*l),{value:y}=pG(a(u*g)),A=a(y*u),I=a(y*l),P=a(A*I*s);let D;if(Mb(s*P,o)){let V=a(n*jO),J=a(e*jO);e=V,n=J,D=a(A*Qye)}else D=I;Mb(e*P,o)&&(n=a(-n));let U=a((i-n)*D);return Mb(U,o)&&(U=a(-U)),ui.toBytes(U)}equals(e){this.assertSame(e);const{X:n,Y:i}=this.ep,{X:s,Y:o}=e.ep,a=g=>ui.create(g),u=a(n*o)===a(i*s),l=a(i*o)===a(n*s);return u||l}is0(){return this.equals(Tp.ZERO)}}const ZZe=null,YZe=null,XZe=null,JZe=null,KO=32;var ime=class extends bye{static{this.SIZE=KO}constructor(r){if(super(),typeof r=="string"?this.data=Pb(r):r instanceof Uint8Array?this.data=r:this.data=Uint8Array.from(r),this.data.length!==KO)throw new Error(`Invalid public key input. Expected ${KO} bytes, got ${this.data.length}`)}equals(r){return super.equals(r)}toRawBytes(){return this.data}flag(){return IO.ED25519}async verify(r,e){let n;if(typeof e=="string"){const i=vye(e);if(i.signatureScheme!=="ED25519")throw new Error("Invalid signature scheme");if(!zK(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");n=i.signature}else n=e;return Ep.verify(n,r,this.toRawBytes())}};const gG="m/44'/784'/0'/0'/0'";var GO=class AS extends cye{constructor(e){if(super(),e)this.keypair={publicKey:e.publicKey,secretKey:e.secretKey.slice(0,32)};else{const n=Ep.utils.randomSecretKey();this.keypair={publicKey:Ep.getPublicKey(n),secretKey:n}}}getKeyScheme(){return"ED25519"}static generate(){const e=Ep.utils.randomSecretKey();return new AS({publicKey:Ep.getPublicKey(e),secretKey:e})}static fromSecretKey(e,n){if(typeof e=="string"){const o=lye(e);if(o.scheme!=="ED25519")throw new Error(`Expected a ED25519 keypair, got ${o.scheme}`);return this.fromSecretKey(o.secretKey,n)}const i=e.length;if(i!==sk)throw new Error(`Wrong secretKey size. Expected ${sk} bytes, got ${i}.`);const s={publicKey:Ep.getPublicKey(e),secretKey:e};if(!n||!n.skipValidation){const o=new TextEncoder().encode("sui validation"),a=Ep.sign(o,e);if(!Ep.verify(a,o,s.publicKey))throw new Error("provided secretKey is invalid")}return new AS(s)}getPublicKey(){return new ime(this.keypair.publicKey)}getSecretKey(){return fye(this.keypair.secretKey.slice(0,sk),this.getKeyScheme())}async sign(e){return Ep.sign(e,this.keypair.secretKey)}static deriveKeypair(e,n){if(n==null&&(n=gG),!Wj(n))throw new Error("Invalid derivation path");const{key:i}=HK(n,ege(e));return AS.fromSecretKey(i)}static deriveKeypairFromSeed(e,n){if(n==null&&(n=gG),!Wj(n))throw new Error("Invalid derivation path");const i=typeof e=="string"?e:Ew(e),{key:s}=HK(n,i);return AS.fromSecretKey(s)}};function yG(r,e){var n=new Uint8Array(1+r.length+e.length);return n.set([0]),n.set(r,1),n.set(e,1+r.length),xb(n)}var qO=new WeakMap,ck=new WeakMap,ZO=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,ck,{get:ome,set:sme}),de(this,qO,{writable:!0,value:""}),he(this,ck,n)}var e=r.prototype;return e.getAddress=function(){return this.kp.getPublicKey().toSuiAddress()},e.getPublicKeyHex=function(){var i=this.kp.getPublicKey().toRawBytes();return ys(Ca(i))},e.exportPrivateKey=function(){return X(this,ck)},e.signMessage=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a=s.kp,g.next=3,a.sign(mo(i));case 3:return u=g.sent,g.abrupt("return",yG(u,a.getPublicKey().toRawBytes()));case 5:case"end":return g.stop()}},o)}))()},e.signTransaction=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a=s.kp,g.next=3,a.sign(mo(i));case 3:return u=g.sent,g.abrupt("return",Ca(u));case 5:case"end":return g.stop()}},o)}))()},r.isValidPk=function(i){try{return GO.fromSecretKey(i),!0}catch{return!1}},(0,L.A)(r,[{key:"kp",get:function(){var i=GO.fromSecretKey(X(this,ck));return i}}]),r}();function sme(r){he(this,qO,Mg(r))}function ome(){return Lg(X(this,qO))}/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const Hu=2n**255n-19n,xw=2n**252n+27742317777372353535851937790883648493n,YO=0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,XO=0x6666666666666666666666666666666666666666666666666666666666666658n,lk={a:-1n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,p:Hu,n:xw,h:8,Gx:YO,Gy:XO},fc=(r="")=>{throw new Error(r)},mG=r=>typeof r=="string",ame=r=>r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array",eE=(r,e)=>!ame(r)||typeof e=="number"&&e>0&&r.length!==e?fc("Uint8Array of valid length expected"):r,Bw=r=>new Uint8Array(r),Ub=(r,e)=>eE(mG(r)?QO(r):Bw(eE(r)),e),Pi=(r,e=Hu)=>{let n=r%e;return n>=0n?n:e+n},bG=r=>r instanceof Cl?r:fc("Point expected");class Cl{constructor(e,n,i,s){this.ex=e,this.ey=n,this.ez=i,this.et=s}static fromAffine(e){return new Cl(e.x,e.y,1n,Pi(e.x*e.y))}static fromHex(e,n=!1){const{d:i}=lk;e=Ub(e,32);const s=e.slice(),o=e[31];s[31]=o&-129;const a=e8(s);n&&!(0n<=a&&a<2n**256n)&&fc("bad y coord 1"),!n&&!(0n<=a&&a<Hu)&&fc("bad y coord 2");const u=Pi(a*a),l=Pi(u-1n),g=Pi(i*u+1n);let{isValid:y,value:A}=cme(l,g);y||fc("bad y coordinate 3");const I=(A&1n)===1n,P=(o&128)!==0;return!n&&A===0n&&P&&fc("bad y coord 3"),P!==I&&(A=Pi(-A)),new Cl(A,a,1n,Pi(A*a))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(e){const{ex:n,ey:i,ez:s}=this,{ex:o,ey:a,ez:u}=bG(e),l=Pi(n*u),g=Pi(o*s),y=Pi(i*u),A=Pi(a*s);return l===g&&y===A}is0(){return this.equals(tE)}negate(){return new Cl(Pi(-this.ex),this.ey,this.ez,Pi(-this.et))}double(){const{ex:e,ey:n,ez:i}=this,{a:s}=lk,o=Pi(e*e),a=Pi(n*n),u=Pi(2n*Pi(i*i)),l=Pi(s*o),g=e+n,y=Pi(Pi(g*g)-o-a),A=l+a,I=A-u,P=l-a,D=Pi(y*I),U=Pi(A*P),V=Pi(y*P),J=Pi(I*A);return new Cl(D,U,J,V)}add(e){const{ex:n,ey:i,ez:s,et:o}=this,{ex:a,ey:u,ez:l,et:g}=bG(e),{a:y,d:A}=lk,I=Pi(n*a),P=Pi(i*u),D=Pi(o*A*g),U=Pi(s*l),V=Pi((n+i)*(a+u)-I-P),J=Pi(U-D),re=Pi(U+D),ce=Pi(P-y*I),Re=Pi(V*J),De=Pi(re*ce),Ue=Pi(V*ce),Ve=Pi(J*re);return new Cl(Re,De,Ve,Ue)}mul(e,n=!0){if(e===0n)return n===!0?fc("cannot multiply by 0"):tE;if(typeof e=="bigint"&&0n<e&&e<xw||fc("invalid scalar, must be < L"),!n&&this.is0()||e===1n)return this;if(this.equals(wy))return dme(e).p;let i=tE,s=wy;for(let o=this;e>0n;o=o.double(),e>>=1n)e&1n?i=i.add(o):n&&(s=s.add(o));return i}multiply(e){return this.mul(e)}clearCofactor(){return this.mul(BigInt(lk.h),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.mul(xw/2n,!1).double();return xw%2n&&(e=e.add(this)),e.is0()}toAffine(){const{ex:e,ey:n,ez:i}=this;if(this.equals(tE))return{x:0n,y:1n};const s=AG(i);return Pi(i*s)!==1n&&fc("invalid inverse"),{x:Pi(e*s),y:Pi(n*s)}}toRawBytes(){const{x:e,y:n}=this.toAffine(),i=wG(n);return i[31]|=e&1n?128:0,i}toHex(){return JO(this.toRawBytes())}}Cl.BASE=new Cl(YO,XO,1n,Pi(YO*XO)),Cl.ZERO=new Cl(0n,1n,1n,0n);const{BASE:wy,ZERO:tE}=Cl,vG=(r,e)=>r.toString(16).padStart(e,"0"),JO=r=>Array.from(r).map(e=>vG(e,2)).join(""),QO=r=>{const e=r.length;(!mG(r)||e%2)&&fc("hex invalid 1");const n=Bw(e/2);for(let i=0;i<n.length;i++){const s=i*2,o=r.slice(s,s+2),a=Number.parseInt(o,16);(Number.isNaN(a)||a<0)&&fc("hex invalid 2"),n[i]=a}return n},wG=r=>QO(vG(r,32*2)).reverse(),e8=r=>BigInt("0x"+JO(Bw(eE(r)).reverse())),rE=(...r)=>{const e=Bw(r.reduce((i,s)=>i+eE(s).length,0));let n=0;return r.forEach(i=>{e.set(i,n),n+=i.length}),e},AG=(r,e=Hu)=>{(r===0n||e<=0n)&&fc("no inverse n="+r+" mod="+e);let n=Pi(r,e),i=e,s=0n,o=1n,a=1n,u=0n;for(;n!==0n;){const l=i/n,g=i%n,y=s-a*l,A=o-u*l;i=n,n=g,s=a,o=u,a=y,u=A}return i===1n?Pi(s,e):fc("no inverse")},r0=(r,e)=>{let n=r;for(;e-- >0n;)n*=n,n%=Hu;return n},ume=r=>{const n=r*r%Hu*r%Hu,i=r0(n,2n)*n%Hu,s=r0(i,1n)*r%Hu,o=r0(s,5n)*s%Hu,a=r0(o,10n)*o%Hu,u=r0(a,20n)*a%Hu,l=r0(u,40n)*u%Hu,g=r0(l,80n)*l%Hu,y=r0(g,80n)*l%Hu,A=r0(y,10n)*o%Hu;return{pow_p_5_8:r0(A,2n)*r%Hu,b2:n}},_G=19681161376707505956807079304988542015446066515923890162744021073123829784752n,cme=(r,e)=>{const n=Pi(e*e*e),i=Pi(n*n*e),s=ume(r*i).pow_p_5_8;let o=Pi(r*n*s);const a=Pi(e*o*o),u=o,l=Pi(o*_G),g=a===r,y=a===Pi(-r),A=a===Pi(-r*_G);return g&&(o=u),(y||A)&&(o=l),(Pi(o)&1n)===1n&&(o=Pi(-o)),{isValid:g||y,value:o}},fk=r=>Pi(e8(r),xw);let nE;const t8=(...r)=>gk.sha512Async(...r),r8=(...r)=>typeof nE=="function"?nE(...r):fc("etc.sha512Sync not set"),EG=r=>{const e=r.slice(0,32);e[0]&=248,e[31]&=127,e[31]|=64;const n=r.slice(32,64),i=fk(e),s=wy.mul(i),o=s.toRawBytes();return{head:e,prefix:n,scalar:i,point:s,pointBytes:o}},n8=r=>t8(Ub(r,32)).then(EG),i8=r=>EG(r8(Ub(r,32))),dk=r=>n8(r).then(e=>e.pointBytes),TG=r=>i8(r).pointBytes;function hk(r,e){return r?t8(e.hashable).then(e.finish):e.finish(r8(e.hashable))}const SG=(r,e,n)=>{const{pointBytes:i,scalar:s}=r,o=fk(e),a=wy.mul(o).toRawBytes();return{hashable:rE(a,i,n),finish:g=>{const y=Pi(o+fk(g)*s,xw);return eE(rE(a,wG(y)),64)}}},pk=async(r,e)=>{const n=Ub(r),i=await n8(e),s=await t8(i.prefix,n);return hk(!0,SG(i,s,n))},QZe=(r,e)=>{const n=Ub(r),i=i8(e),s=r8(i.prefix,n);return hk(!1,SG(i,s,n))},s8=null,IG=(r,e,n,i=s8)=>{e=Ub(e),r=Ub(r,64);const{zip215:s}=i;let o,a,u,l,g=new Uint8Array;try{o=Cl.fromHex(n,s),a=Cl.fromHex(r.slice(0,32),s),u=e8(r.slice(32,64)),l=wy.mul(u,!1),g=rE(a.toRawBytes(),o.toRawBytes(),e)}catch{}return{hashable:g,finish:A=>{if(l==null||!s&&o.isSmallOrder())return!1;const I=fk(A);return a.add(o.mul(I,!1)).add(l.negate()).clearCofactor().is0()}}},eYe=async(r,e,n,i=s8)=>hk(!0,IG(r,e,n,i)),tYe=(r,e,n,i=s8)=>hk(!1,IG(r,e,n,i)),kG=()=>typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,gk={bytesToHex:JO,hexToBytes:QO,concatBytes:rE,mod:Pi,invert:AG,randomBytes:(r=32)=>{const e=kG();return(!e||!e.getRandomValues)&&fc("crypto.getRandomValues must be defined"),e.getRandomValues(Bw(r))},sha512Async:async(...r)=>{const e=kG();(!e||!e.subtle)&&fc("crypto.subtle or etc.sha512Async must be defined");const n=rE(...r);return Bw(await e.subtle.digest("SHA-512",n.buffer))},sha512Sync:void 0};Object.defineProperties(gk,{sha512Sync:{configurable:!1,get(){return nE},set(r){nE||(nE=r)}}});const lme={getExtendedPublicKeyAsync:n8,getExtendedPublicKey:i8,randomPrivateKey:()=>gk.randomBytes(32),precompute(r=8,e=wy){return e.multiply(3n),e}},Fb=8,fme=()=>{const r=[],e=256/Fb+1;let n=wy,i=n;for(let s=0;s<e;s++){i=n,r.push(i);for(let o=1;o<2**(Fb-1);o++)i=i.add(n),r.push(i);n=i.double()}return r};let RG;const dme=r=>{const e=RG||(RG=fme()),n=(y,A)=>{let I=A.negate();return y?I:A};let i=tE,s=wy;const o=1+256/Fb,a=2**(Fb-1),u=BigInt(2**Fb-1),l=2**Fb,g=BigInt(Fb);for(let y=0;y<o;y++){const A=y*a;let I=Number(r&u);r>>=g,I>a&&(I-=l,r+=1n);const P=A,D=A+Math.abs(I)-1,U=y%2!==0,V=I<0;I===0?s=s.add(n(U,e[P])):i=i.add(n(V,e[D]))}return{p:i,f:s}};var hme=tn(58872),pme=tn(36533).Buffer;gk.sha512Sync=Y_;var Wb=new WeakMap,o8=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,Wb,{writable:!0,value:void 0}),this.publicKey="",this.address="",QB(n)?he(this,Wb,ys(Jo(n))):he(this,Wb,ys(n)),this.generateAddress()}var e=r.prototype;return e.getAddress=function(){return this.address},e.signTransaction=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,pk(ys(i),X(s,Wb));case 2:return a=l.sent,l.abrupt("return",Jo(a));case 4:case"end":return l.stop()}},o)}))()},e.signMessage=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,pk(ys(i),X(s,Wb));case 2:return a=l.sent,l.abrupt("return",Jo(a));case 4:case"end":return l.stop()}},o)}))()},e.getPublicKeyHex=function(){return this.publicKey},e.exportPrivateKey=function(){return X(this,Wb)},e.generateAddress=function(){var i=TG(mo(X(this,Wb))),s=hme.WalletContractV4.create({workchain:0,publicKey:pme.from(i)});this.publicKey=Jo(i),this.address=s.address.toString({bounceable:!1})},r.isValidPk=function(i){var s=ys(i);if(s.length!==64)return!1;try{var o=TG(mo(s));return!!o}catch(a){return console.error(a),!1}},r}();const dc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";class CG{encode(e){let n="",i,s,o,a,u,l,g,y=0;for(;y<e.length;)i=e.charCodeAt(y++),s=e.charCodeAt(y++),o=e.charCodeAt(y++),a=i>>2,u=(i&3)<<4|s>>4,l=(s&15)<<2|o>>6,g=o&63,isNaN(s)?l=g=64:isNaN(o)&&(g=64),n=n+dc.charAt(a)+dc.charAt(u)+dc.charAt(l)+dc.charAt(g);return n}encodeIgnoreUtf8(e){let n="",i,s,o,a,u,l,g,y=0;for(;y<e.length;)i=e[y++],s=e[y++],o=e[y++],a=i>>2,u=(i&3)<<4|s>>4,l=(s&15)<<2|o>>6,g=o&63,isNaN(s)?l=g=64:isNaN(o)&&(g=64),n=n+dc.charAt(a)+dc.charAt(u)+dc.charAt(l)+dc.charAt(g);return n}decode(e){let n="",i,s,o,a,u,l,g,y=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");y<e.length;)a=dc.indexOf(e.charAt(y++)),u=dc.indexOf(e.charAt(y++)),l=dc.indexOf(e.charAt(y++)),g=dc.indexOf(e.charAt(y++)),i=a<<2|u>>4,s=(u&15)<<4|l>>2,o=(l&3)<<6|g,n=n+String.fromCharCode(i),l!=64&&(n=n+String.fromCharCode(s)),g!=64&&(n=n+String.fromCharCode(o));return this._utf8_decode(n)}decodeToByteArray(e){let n="",i,s,o,a,u,l,g,y=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");y<e.length;)a=dc.indexOf(e.charAt(y++)),u=dc.indexOf(e.charAt(y++)),l=dc.indexOf(e.charAt(y++)),g=dc.indexOf(e.charAt(y++)),i=a<<2|u>>4,s=(u&15)<<4|l>>2,o=(l&3)<<6|g,n=n+String.fromCharCode(i),l!=64&&(n=n+String.fromCharCode(s)),g!=64&&(n=n+String.fromCharCode(o));return this._out2ByteArray(n)}_out2ByteArray(e){const n=new Array(e.length);let i=0,s=0;for(;i<e.length;)s=e.charCodeAt(i),n[i]=s,i++;return n}_utf8_encode(e){e=e.replace(/\r\n/g,`
|
||
`);let n="";for(let i=0;i<e.length;i++){const s=e.charCodeAt(i);s<128?n+=String.fromCharCode(s):s>127&&s<2048?(n+=String.fromCharCode(s>>6|192),n+=String.fromCharCode(s&63|128)):(n+=String.fromCharCode(s>>12|224),n+=String.fromCharCode(s>>6&63|128),n+=String.fromCharCode(s&63|128))}return n}_utf8_decode(e){let n="",i=0,s=0,o=0,a=0;for(;i<e.length;)s=e.charCodeAt(i),s<128?(n+=String.fromCharCode(s),i++):s>191&&s<224?(o=e.charCodeAt(i+1),n+=String.fromCharCode((s&31)<<6|o&63),i+=2):(o=e.charCodeAt(i+1),a=e.charCodeAt(i+2),n+=String.fromCharCode((s&15)<<12|(o&63)<<6|a&63),i+=3);return n}}function yk(r){if(r<0||r>255)throw new Error("Input must be a byte");const e="0123456789ABCDEF";let n="";return n+=e.charAt(r>>4),n+=e.charAt(r&15),n}function a8(r){let e="";for(let n=0;n<r.length;n++){const i=r[n].toString(2),s=i.match(/^1+?(?=0)/);if(s&&i.length===8){const o=s[0].length;let a=r[n].toString(2).slice(7-o);for(let u=1;u<o;u++)a+=r[u+n].toString(2).slice(2);e+=String.fromCharCode(parseInt(a,2)),n+=o-1}else e+=String.fromCharCode(r[n])}return e}function xG(r){const e=r.replace(/^0x/,"").split("");let n="";for(let i=0;i<e.length/2;i++){const s=`0x${e[i*2]}${e[i*2+1]}`;n+=String.fromCharCode(parseInt(s))}return n}function Xs(r){let e="";for(let n=0;n<r.length;n++)e+=yk(r[n]);return e}function Hb(r){return new CG().decodeToByteArray(r)}function u8(r){return new CG().encodeIgnoreUtf8(r)}function gme(r){return a8(r)}function yme(r,e,n=!1){if(r.length!=e.length)return!1;for(let i=0;i<r.length;i++)if(n){if(r[i]!=e[i])return!1}else if(JSON.stringify(r[i])!=JSON.stringify(e[i]))return!1;return!0}function mme(r){const e=[],n=r.length;let i;for(let s=0;s<n;s++)i=r.charCodeAt(s),i>=65536&&i<=1114111?(e.push(i>>18&7|240),e.push(i>>12&63|128),e.push(i>>6&63|128),e.push(i&63|128)):i>=2048&&i<=65535?(e.push(i>>12&15|224),e.push(i>>6&63|128),e.push(i&63|128)):i>=128&&i<=2047?(e.push(i>>6&31|192),e.push(i&63|128)):e.push(i&255);return e}function BG(r){let e;if(r>="A"&&r<="F"?e=r.charCodeAt(0)-65+10:r>="a"&&r<="f"?e=r.charCodeAt(0)-97+10:r>="0"&&r<="9"&&(e=r.charCodeAt(0)-48),typeof e=="number")return e;throw new Error("The passed hex char is not a valid hex char")}function c8(r){return r>="A"&&r<="F"||r>="a"&&r<="f"||r>="0"&&r<="9"?1:0}function zc(r,e=!1){let n=r.length;e&&n%2&&(r=`0${r}`,n++);const i=[];let s=0,o=0,a=0;for(let u=0;u<n;u++){const l=r.charAt(u);if(c8(l))s<<=4,s+=BG(l),o++,o%2===0&&(i[a++]=s,s=0);else throw new Error("The passed hex char is not a valid hex string")}return i}function bme(r){if(!/^\d{4}-\d{2}-\d{2}( \d{2}-\d{2}-\d{2}|)/.test(r))throw new Error("The passed date string is not valid");const e=r.split(" "),n=e[0].split("-"),i=parseInt(n[0],10),s=parseInt(n[1],10)-1,o=parseInt(n[2],10);if(e.length>1){const a=e[1].split("-"),u=parseInt(a[0],10),l=parseInt(a[1],10),g=parseInt(a[2],10);return new Date(i,s,o,u,l,g)}return new Date(i,s,o)}function OG(r){return r>="0"&&r<="9"?1:0}function vme(r){if(r==null||r.length==0||r=="")return-1;let e=0;if(r.length==40)for(;e<40;e++){const n=r.charAt(e);if(!c8(n))break}if(e==40)return 1;for(e=0;e<r.length;e++){const n=r.charAt(e);if(!OG(n))break}if(e==r.length)return 2;for(e=0;e<r.length;e++)if(r.charAt(e)>" ")return 3;return-1}var wme=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,l8=Math.ceil,qf=Math.floor,xl="[BigNumber Error] ",PG=xl+"Number primitive has more than 15 significant digits: ",Jd=1e14,Qi=14,f8=9007199254740991,d8=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ay=1e7,yu=1e9;function NG(r){var e,n,i,s=re.prototype={constructor:re,toString:null,valueOf:null},o=new re(1),a=20,u=4,l=-7,g=21,y=-1e7,A=1e7,I=!1,P=1,D=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},V="0123456789abcdefghijklmnopqrstuvwxyz",J=!0;function re(pe,Se){var Ce,je,$e,Qe,nt,Ne,Me,ct,mt=this;if(!(mt instanceof re))return new re(pe,Se);if(Se==null){if(pe&&pe._isBigNumber===!0){mt.s=pe.s,!pe.c||pe.e>A?mt.c=mt.e=null:pe.e<y?mt.c=[mt.e=0]:(mt.e=pe.e,mt.c=pe.c.slice());return}if((Ne=typeof pe=="number")&&pe*0==0){if(mt.s=1/pe<0?(pe=-pe,-1):1,pe===~~pe){for(Qe=0,nt=pe;nt>=10;nt/=10,Qe++);Qe>A?mt.c=mt.e=null:(mt.e=Qe,mt.c=[pe]);return}ct=String(pe)}else{if(!wme.test(ct=String(pe)))return i(mt,ct,Ne);mt.s=ct.charCodeAt(0)==45?(ct=ct.slice(1),-1):1}(Qe=ct.indexOf("."))>-1&&(ct=ct.replace(".","")),(nt=ct.search(/e/i))>0?(Qe<0&&(Qe=nt),Qe+=+ct.slice(nt+1),ct=ct.substring(0,nt)):Qe<0&&(Qe=ct.length)}else{if(ua(Se,2,V.length,"Base"),Se==10&&J)return mt=new re(pe),Ue(mt,a+mt.e+1,u);if(ct=String(pe),Ne=typeof pe=="number"){if(pe*0!=0)return i(mt,ct,Ne,Se);if(mt.s=1/pe<0?(ct=ct.slice(1),-1):1,re.DEBUG&&ct.replace(/^0\.0*|\./,"").length>15)throw Error(PG+pe)}else mt.s=ct.charCodeAt(0)===45?(ct=ct.slice(1),-1):1;for(Ce=V.slice(0,Se),Qe=nt=0,Me=ct.length;nt<Me;nt++)if(Ce.indexOf(je=ct.charAt(nt))<0){if(je=="."){if(nt>Qe){Qe=Me;continue}}else if(!$e&&(ct==ct.toUpperCase()&&(ct=ct.toLowerCase())||ct==ct.toLowerCase()&&(ct=ct.toUpperCase()))){$e=!0,nt=-1,Qe=0;continue}return i(mt,String(pe),Ne,Se)}Ne=!1,ct=n(ct,Se,10,mt.s),(Qe=ct.indexOf("."))>-1?ct=ct.replace(".",""):Qe=ct.length}for(nt=0;ct.charCodeAt(nt)===48;nt++);for(Me=ct.length;ct.charCodeAt(--Me)===48;);if(ct=ct.slice(nt,++Me)){if(Me-=nt,Ne&&re.DEBUG&&Me>15&&(pe>f8||pe!==qf(pe)))throw Error(PG+mt.s*pe);if((Qe=Qe-nt-1)>A)mt.c=mt.e=null;else if(Qe<y)mt.c=[mt.e=0];else{if(mt.e=Qe,mt.c=[],nt=(Qe+1)%Qi,Qe<0&&(nt+=Qi),nt<Me){for(nt&&mt.c.push(+ct.slice(0,nt)),Me-=Qi;nt<Me;)mt.c.push(+ct.slice(nt,nt+=Qi));nt=Qi-(ct=ct.slice(nt)).length}else nt-=Me;for(;nt--;ct+="0");mt.c.push(+ct)}}else mt.c=[mt.e=0]}re.clone=NG,re.ROUND_UP=0,re.ROUND_DOWN=1,re.ROUND_CEIL=2,re.ROUND_FLOOR=3,re.ROUND_HALF_UP=4,re.ROUND_HALF_DOWN=5,re.ROUND_HALF_EVEN=6,re.ROUND_HALF_CEIL=7,re.ROUND_HALF_FLOOR=8,re.EUCLID=9,re.config=re.set=function(pe){var Se,Ce;if(pe!=null)if(typeof pe=="object"){if(pe.hasOwnProperty(Se="DECIMAL_PLACES")&&(Ce=pe[Se],ua(Ce,0,yu,Se),a=Ce),pe.hasOwnProperty(Se="ROUNDING_MODE")&&(Ce=pe[Se],ua(Ce,0,8,Se),u=Ce),pe.hasOwnProperty(Se="EXPONENTIAL_AT")&&(Ce=pe[Se],Ce&&Ce.pop?(ua(Ce[0],-yu,0,Se),ua(Ce[1],0,yu,Se),l=Ce[0],g=Ce[1]):(ua(Ce,-yu,yu,Se),l=-(g=Ce<0?-Ce:Ce))),pe.hasOwnProperty(Se="RANGE"))if(Ce=pe[Se],Ce&&Ce.pop)ua(Ce[0],-yu,-1,Se),ua(Ce[1],1,yu,Se),y=Ce[0],A=Ce[1];else if(ua(Ce,-yu,yu,Se),Ce)y=-(A=Ce<0?-Ce:Ce);else throw Error(xl+Se+" cannot be zero: "+Ce);if(pe.hasOwnProperty(Se="CRYPTO"))if(Ce=pe[Se],Ce===!!Ce)if(Ce)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))I=Ce;else throw I=!Ce,Error(xl+"crypto unavailable");else I=Ce;else throw Error(xl+Se+" not true or false: "+Ce);if(pe.hasOwnProperty(Se="MODULO_MODE")&&(Ce=pe[Se],ua(Ce,0,9,Se),P=Ce),pe.hasOwnProperty(Se="POW_PRECISION")&&(Ce=pe[Se],ua(Ce,0,yu,Se),D=Ce),pe.hasOwnProperty(Se="FORMAT"))if(Ce=pe[Se],typeof Ce=="object")U=Ce;else throw Error(xl+Se+" not an object: "+Ce);if(pe.hasOwnProperty(Se="ALPHABET"))if(Ce=pe[Se],typeof Ce=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(Ce))J=Ce.slice(0,10)=="0123456789",V=Ce;else throw Error(xl+Se+" invalid: "+Ce)}else throw Error(xl+"Object expected: "+pe);return{DECIMAL_PLACES:a,ROUNDING_MODE:u,EXPONENTIAL_AT:[l,g],RANGE:[y,A],CRYPTO:I,MODULO_MODE:P,POW_PRECISION:D,FORMAT:U,ALPHABET:V}},re.isBigNumber=function(pe){if(!pe||pe._isBigNumber!==!0)return!1;if(!re.DEBUG)return!0;var Se,Ce,je=pe.c,$e=pe.e,Qe=pe.s;e:if({}.toString.call(je)=="[object Array]"){if((Qe===1||Qe===-1)&&$e>=-yu&&$e<=yu&&$e===qf($e)){if(je[0]===0){if($e===0&&je.length===1)return!0;break e}if(Se=($e+1)%Qi,Se<1&&(Se+=Qi),String(je[0]).length==Se){for(Se=0;Se<je.length;Se++)if(Ce=je[Se],Ce<0||Ce>=Jd||Ce!==qf(Ce))break e;if(Ce!==0)return!0}}}else if(je===null&&$e===null&&(Qe===null||Qe===1||Qe===-1))return!0;throw Error(xl+"Invalid BigNumber: "+pe)},re.maximum=re.max=function(){return Re(arguments,-1)},re.minimum=re.min=function(){return Re(arguments,1)},re.random=function(){var pe=9007199254740992,Se=Math.random()*pe&2097151?function(){return qf(Math.random()*pe)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Ce){var je,$e,Qe,nt,Ne,Me=0,ct=[],mt=new re(o);if(Ce==null?Ce=a:ua(Ce,0,yu),nt=l8(Ce/Qi),I)if(crypto.getRandomValues){for(je=crypto.getRandomValues(new Uint32Array(nt*=2));Me<nt;)Ne=je[Me]*131072+(je[Me+1]>>>11),Ne>=9e15?($e=crypto.getRandomValues(new Uint32Array(2)),je[Me]=$e[0],je[Me+1]=$e[1]):(ct.push(Ne%1e14),Me+=2);Me=nt/2}else if(crypto.randomBytes){for(je=crypto.randomBytes(nt*=7);Me<nt;)Ne=(je[Me]&31)*281474976710656+je[Me+1]*1099511627776+je[Me+2]*4294967296+je[Me+3]*16777216+(je[Me+4]<<16)+(je[Me+5]<<8)+je[Me+6],Ne>=9e15?crypto.randomBytes(7).copy(je,Me):(ct.push(Ne%1e14),Me+=7);Me=nt/7}else throw I=!1,Error(xl+"crypto unavailable");if(!I)for(;Me<nt;)Ne=Se(),Ne<9e15&&(ct[Me++]=Ne%1e14);for(nt=ct[--Me],Ce%=Qi,nt&&Ce&&(Ne=d8[Qi-Ce],ct[Me]=qf(nt/Ne)*Ne);ct[Me]===0;ct.pop(),Me--);if(Me<0)ct=[Qe=0];else{for(Qe=-1;ct[0]===0;ct.splice(0,1),Qe-=Qi);for(Me=1,Ne=ct[0];Ne>=10;Ne/=10,Me++);Me<Qi&&(Qe-=Qi-Me)}return mt.e=Qe,mt.c=ct,mt}}(),re.sum=function(){for(var pe=1,Se=arguments,Ce=new re(Se[0]);pe<Se.length;)Ce=Ce.plus(Se[pe++]);return Ce},n=function(){var pe="0123456789";function Se(Ce,je,$e,Qe){for(var nt,Ne=[0],Me,ct=0,mt=Ce.length;ct<mt;){for(Me=Ne.length;Me--;Ne[Me]*=je);for(Ne[0]+=Qe.indexOf(Ce.charAt(ct++)),nt=0;nt<Ne.length;nt++)Ne[nt]>$e-1&&(Ne[nt+1]==null&&(Ne[nt+1]=0),Ne[nt+1]+=Ne[nt]/$e|0,Ne[nt]%=$e)}return Ne.reverse()}return function(Ce,je,$e,Qe,nt){var Ne,Me,ct,mt,Bt,er,cr,pr,Dr=Ce.indexOf("."),Rr=a,Pr=u;for(Dr>=0&&(mt=D,D=0,Ce=Ce.replace(".",""),pr=new re(je),er=pr.pow(Ce.length-Dr),D=mt,pr.c=Se(Sp(Yf(er.c),er.e,"0"),10,$e,pe),pr.e=pr.c.length),cr=Se(Ce,je,$e,nt?(Ne=V,pe):(Ne=pe,V)),ct=mt=cr.length;cr[--mt]==0;cr.pop());if(!cr[0])return Ne.charAt(0);if(Dr<0?--ct:(er.c=cr,er.e=ct,er.s=Qe,er=e(er,pr,Rr,Pr,$e),cr=er.c,Bt=er.r,ct=er.e),Me=ct+Rr+1,Dr=cr[Me],mt=$e/2,Bt=Bt||Me<0||cr[Me+1]!=null,Bt=Pr<4?(Dr!=null||Bt)&&(Pr==0||Pr==(er.s<0?3:2)):Dr>mt||Dr==mt&&(Pr==4||Bt||Pr==6&&cr[Me-1]&1||Pr==(er.s<0?8:7)),Me<1||!cr[0])Ce=Bt?Sp(Ne.charAt(1),-Rr,Ne.charAt(0)):Ne.charAt(0);else{if(cr.length=Me,Bt)for(--$e;++cr[--Me]>$e;)cr[Me]=0,Me||(++ct,cr=[1].concat(cr));for(mt=cr.length;!cr[--mt];);for(Dr=0,Ce="";Dr<=mt;Ce+=Ne.charAt(cr[Dr++]));Ce=Sp(Ce,ct,Ne.charAt(0))}return Ce}}(),e=function(){function pe(je,$e,Qe){var nt,Ne,Me,ct,mt=0,Bt=je.length,er=$e%Ay,cr=$e/Ay|0;for(je=je.slice();Bt--;)Me=je[Bt]%Ay,ct=je[Bt]/Ay|0,nt=cr*Me+ct*er,Ne=er*Me+nt%Ay*Ay+mt,mt=(Ne/Qe|0)+(nt/Ay|0)+cr*ct,je[Bt]=Ne%Qe;return mt&&(je=[mt].concat(je)),je}function Se(je,$e,Qe,nt){var Ne,Me;if(Qe!=nt)Me=Qe>nt?1:-1;else for(Ne=Me=0;Ne<Qe;Ne++)if(je[Ne]!=$e[Ne]){Me=je[Ne]>$e[Ne]?1:-1;break}return Me}function Ce(je,$e,Qe,nt){for(var Ne=0;Qe--;)je[Qe]-=Ne,Ne=je[Qe]<$e[Qe]?1:0,je[Qe]=Ne*nt+je[Qe]-$e[Qe];for(;!je[0]&&je.length>1;je.splice(0,1));}return function(je,$e,Qe,nt,Ne){var Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn,Ar,Xr,Tn,Bn,ni,en=je.s==$e.s?1:-1,si=je.c,ei=$e.c;if(!si||!si[0]||!ei||!ei[0])return new re(!je.s||!$e.s||(si?ei&&si[0]==ei[0]:!ei)?NaN:si&&si[0]==0||!ei?en*0:en/0);for(Dr=new re(en),Rr=Dr.c=[],ct=je.e-$e.e,en=Qe+ct+1,Ne||(Ne=Jd,ct=Zf(je.e/Qi)-Zf($e.e/Qi),en=en/Qi|0),mt=0;ei[mt]==(si[mt]||0);mt++);if(ei[mt]>(si[mt]||0)&&ct--,en<0)Rr.push(1),Bt=!0;else{for(Xr=si.length,Bn=ei.length,mt=0,en+=2,er=qf(Ne/(ei[0]+1)),er>1&&(ei=pe(ei,er,Ne),si=pe(si,er,Ne),Bn=ei.length,Xr=si.length),Ar=Bn,Pr=si.slice(0,Bn),on=Pr.length;on<Bn;Pr[on++]=0);ni=ei.slice(),ni=[0].concat(ni),Tn=ei[0],ei[1]>=Ne/2&&Tn++;do{if(er=0,Me=Se(ei,Pr,Bn,on),Me<0){if(xn=Pr[0],Bn!=on&&(xn=xn*Ne+(Pr[1]||0)),er=qf(xn/Tn),er>1)for(er>=Ne&&(er=Ne-1),cr=pe(ei,er,Ne),pr=cr.length,on=Pr.length;Se(cr,Pr,pr,on)==1;)er--,Ce(cr,Bn<pr?ni:ei,pr,Ne),pr=cr.length,Me=1;else er==0&&(Me=er=1),cr=ei.slice(),pr=cr.length;if(pr<on&&(cr=[0].concat(cr)),Ce(Pr,cr,on,Ne),on=Pr.length,Me==-1)for(;Se(ei,Pr,Bn,on)<1;)er++,Ce(Pr,Bn<on?ni:ei,on,Ne),on=Pr.length}else Me===0&&(er++,Pr=[0]);Rr[mt++]=er,Pr[0]?Pr[on++]=si[Ar]||0:(Pr=[si[Ar]],on=1)}while((Ar++<Xr||Pr[0]!=null)&&en--);Bt=Pr[0]!=null,Rr[0]||Rr.splice(0,1)}if(Ne==Jd){for(mt=1,en=Rr[0];en>=10;en/=10,mt++);Ue(Dr,Qe+(Dr.e=mt+ct*Qi-1)+1,nt,Bt)}else Dr.e=ct,Dr.r=+Bt;return Dr}}();function ce(pe,Se,Ce,je){var $e,Qe,nt,Ne,Me;if(Ce==null?Ce=u:ua(Ce,0,8),!pe.c)return pe.toString();if($e=pe.c[0],nt=pe.e,Se==null)Me=Yf(pe.c),Me=je==1||je==2&&(nt<=l||nt>=g)?bk(Me,nt):Sp(Me,nt,"0");else if(pe=Ue(new re(pe),Se,Ce),Qe=pe.e,Me=Yf(pe.c),Ne=Me.length,je==1||je==2&&(Se<=Qe||Qe<=l)){for(;Ne<Se;Me+="0",Ne++);Me=bk(Me,Qe)}else if(Se-=nt,Me=Sp(Me,Qe,"0"),Qe+1>Ne){if(--Se>0)for(Me+=".";Se--;Me+="0");}else if(Se+=Qe-Ne,Se>0)for(Qe+1==Ne&&(Me+=".");Se--;Me+="0");return pe.s<0&&$e?"-"+Me:Me}function Re(pe,Se){for(var Ce,je,$e=1,Qe=new re(pe[0]);$e<pe.length;$e++)je=new re(pe[$e]),(!je.s||(Ce=zb(Qe,je))===Se||Ce===0&&Qe.s===Se)&&(Qe=je);return Qe}function De(pe,Se,Ce){for(var je=1,$e=Se.length;!Se[--$e];Se.pop());for($e=Se[0];$e>=10;$e/=10,je++);return(Ce=je+Ce*Qi-1)>A?pe.c=pe.e=null:Ce<y?pe.c=[pe.e=0]:(pe.e=Ce,pe.c=Se),pe}i=function(){var pe=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Se=/^([^.]+)\.$/,Ce=/^\.([^.]+)$/,je=/^-?(Infinity|NaN)$/,$e=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Qe,nt,Ne,Me){var ct,mt=Ne?nt:nt.replace($e,"");if(je.test(mt))Qe.s=isNaN(mt)?null:mt<0?-1:1;else{if(!Ne&&(mt=mt.replace(pe,function(Bt,er,cr){return ct=(cr=cr.toLowerCase())=="x"?16:cr=="b"?2:8,!Me||Me==ct?er:Bt}),Me&&(ct=Me,mt=mt.replace(Se,"$1").replace(Ce,"0.$1")),nt!=mt))return new re(mt,ct);if(re.DEBUG)throw Error(xl+"Not a"+(Me?" base "+Me:"")+" number: "+nt);Qe.s=null}Qe.c=Qe.e=null}}();function Ue(pe,Se,Ce,je){var $e,Qe,nt,Ne,Me,ct,mt,Bt=pe.c,er=d8;if(Bt){e:{for($e=1,Ne=Bt[0];Ne>=10;Ne/=10,$e++);if(Qe=Se-$e,Qe<0)Qe+=Qi,nt=Se,Me=Bt[ct=0],mt=qf(Me/er[$e-nt-1]%10);else if(ct=l8((Qe+1)/Qi),ct>=Bt.length)if(je){for(;Bt.length<=ct;Bt.push(0));Me=mt=0,$e=1,Qe%=Qi,nt=Qe-Qi+1}else break e;else{for(Me=Ne=Bt[ct],$e=1;Ne>=10;Ne/=10,$e++);Qe%=Qi,nt=Qe-Qi+$e,mt=nt<0?0:qf(Me/er[$e-nt-1]%10)}if(je=je||Se<0||Bt[ct+1]!=null||(nt<0?Me:Me%er[$e-nt-1]),je=Ce<4?(mt||je)&&(Ce==0||Ce==(pe.s<0?3:2)):mt>5||mt==5&&(Ce==4||je||Ce==6&&(Qe>0?nt>0?Me/er[$e-nt]:0:Bt[ct-1])%10&1||Ce==(pe.s<0?8:7)),Se<1||!Bt[0])return Bt.length=0,je?(Se-=pe.e+1,Bt[0]=er[(Qi-Se%Qi)%Qi],pe.e=-Se||0):Bt[0]=pe.e=0,pe;if(Qe==0?(Bt.length=ct,Ne=1,ct--):(Bt.length=ct+1,Ne=er[Qi-Qe],Bt[ct]=nt>0?qf(Me/er[$e-nt]%er[nt])*Ne:0),je)for(;;)if(ct==0){for(Qe=1,nt=Bt[0];nt>=10;nt/=10,Qe++);for(nt=Bt[0]+=Ne,Ne=1;nt>=10;nt/=10,Ne++);Qe!=Ne&&(pe.e++,Bt[0]==Jd&&(Bt[0]=1));break}else{if(Bt[ct]+=Ne,Bt[ct]!=Jd)break;Bt[ct--]=0,Ne=1}for(Qe=Bt.length;Bt[--Qe]===0;Bt.pop());}pe.e>A?pe.c=pe.e=null:pe.e<y&&(pe.c=[pe.e=0])}return pe}function Ve(pe){var Se,Ce=pe.e;return Ce===null?pe.toString():(Se=Yf(pe.c),Se=Ce<=l||Ce>=g?bk(Se,Ce):Sp(Se,Ce,"0"),pe.s<0?"-"+Se:Se)}return s.absoluteValue=s.abs=function(){var pe=new re(this);return pe.s<0&&(pe.s=1),pe},s.comparedTo=function(pe,Se){return zb(this,new re(pe,Se))},s.decimalPlaces=s.dp=function(pe,Se){var Ce,je,$e,Qe=this;if(pe!=null)return ua(pe,0,yu),Se==null?Se=u:ua(Se,0,8),Ue(new re(Qe),pe+Qe.e+1,Se);if(!(Ce=Qe.c))return null;if(je=(($e=Ce.length-1)-Zf(this.e/Qi))*Qi,$e=Ce[$e])for(;$e%10==0;$e/=10,je--);return je<0&&(je=0),je},s.dividedBy=s.div=function(pe,Se){return e(this,new re(pe,Se),a,u)},s.dividedToIntegerBy=s.idiv=function(pe,Se){return e(this,new re(pe,Se),0,1)},s.exponentiatedBy=s.pow=function(pe,Se){var Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt=this;if(pe=new re(pe),pe.c&&!pe.isInteger())throw Error(xl+"Exponent not an integer: "+Ve(pe));if(Se!=null&&(Se=new re(Se)),Ne=pe.e>14,!Bt.c||!Bt.c[0]||Bt.c[0]==1&&!Bt.e&&Bt.c.length==1||!pe.c||!pe.c[0])return mt=new re(Math.pow(+Ve(Bt),Ne?pe.s*(2-mk(pe)):+Ve(pe))),Se?mt.mod(Se):mt;if(Me=pe.s<0,Se){if(Se.c?!Se.c[0]:!Se.s)return new re(NaN);je=!Me&&Bt.isInteger()&&Se.isInteger(),je&&(Bt=Bt.mod(Se))}else{if(pe.e>9&&(Bt.e>0||Bt.e<-1||(Bt.e==0?Bt.c[0]>1||Ne&&Bt.c[1]>=24e7:Bt.c[0]<8e13||Ne&&Bt.c[0]<=9999975e7)))return Qe=Bt.s<0&&mk(pe)?-0:0,Bt.e>-1&&(Qe=1/Qe),new re(Me?1/Qe:Qe);D&&(Qe=l8(D/Qi+2))}for(Ne?(Ce=new re(.5),Me&&(pe.s=1),ct=mk(pe)):($e=Math.abs(+Ve(pe)),ct=$e%2),mt=new re(o);;){if(ct){if(mt=mt.times(Bt),!mt.c)break;Qe?mt.c.length>Qe&&(mt.c.length=Qe):je&&(mt=mt.mod(Se))}if($e){if($e=qf($e/2),$e===0)break;ct=$e%2}else if(pe=pe.times(Ce),Ue(pe,pe.e+1,1),pe.e>14)ct=mk(pe);else{if($e=+Ve(pe),$e===0)break;ct=$e%2}Bt=Bt.times(Bt),Qe?Bt.c&&Bt.c.length>Qe&&(Bt.c.length=Qe):je&&(Bt=Bt.mod(Se))}return je?mt:(Me&&(mt=o.div(mt)),Se?mt.mod(Se):Qe?Ue(mt,D,u,nt):mt)},s.integerValue=function(pe){var Se=new re(this);return pe==null?pe=u:ua(pe,0,8),Ue(Se,Se.e+1,pe)},s.isEqualTo=s.eq=function(pe,Se){return zb(this,new re(pe,Se))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(pe,Se){return zb(this,new re(pe,Se))>0},s.isGreaterThanOrEqualTo=s.gte=function(pe,Se){return(Se=zb(this,new re(pe,Se)))===1||Se===0},s.isInteger=function(){return!!this.c&&Zf(this.e/Qi)>this.c.length-2},s.isLessThan=s.lt=function(pe,Se){return zb(this,new re(pe,Se))<0},s.isLessThanOrEqualTo=s.lte=function(pe,Se){return(Se=zb(this,new re(pe,Se)))===-1||Se===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(pe,Se){var Ce,je,$e,Qe,nt=this,Ne=nt.s;if(pe=new re(pe,Se),Se=pe.s,!Ne||!Se)return new re(NaN);if(Ne!=Se)return pe.s=-Se,nt.plus(pe);var Me=nt.e/Qi,ct=pe.e/Qi,mt=nt.c,Bt=pe.c;if(!Me||!ct){if(!mt||!Bt)return mt?(pe.s=-Se,pe):new re(Bt?nt:NaN);if(!mt[0]||!Bt[0])return Bt[0]?(pe.s=-Se,pe):new re(mt[0]?nt:u==3?-0:0)}if(Me=Zf(Me),ct=Zf(ct),mt=mt.slice(),Ne=Me-ct){for((Qe=Ne<0)?(Ne=-Ne,$e=mt):(ct=Me,$e=Bt),$e.reverse(),Se=Ne;Se--;$e.push(0));$e.reverse()}else for(je=(Qe=(Ne=mt.length)<(Se=Bt.length))?Ne:Se,Ne=Se=0;Se<je;Se++)if(mt[Se]!=Bt[Se]){Qe=mt[Se]<Bt[Se];break}if(Qe&&($e=mt,mt=Bt,Bt=$e,pe.s=-pe.s),Se=(je=Bt.length)-(Ce=mt.length),Se>0)for(;Se--;mt[Ce++]=0);for(Se=Jd-1;je>Ne;){if(mt[--je]<Bt[je]){for(Ce=je;Ce&&!mt[--Ce];mt[Ce]=Se);--mt[Ce],mt[je]+=Jd}mt[je]-=Bt[je]}for(;mt[0]==0;mt.splice(0,1),--ct);return mt[0]?De(pe,mt,ct):(pe.s=u==3?-1:1,pe.c=[pe.e=0],pe)},s.modulo=s.mod=function(pe,Se){var Ce,je,$e=this;return pe=new re(pe,Se),!$e.c||!pe.s||pe.c&&!pe.c[0]?new re(NaN):!pe.c||$e.c&&!$e.c[0]?new re($e):(P==9?(je=pe.s,pe.s=1,Ce=e($e,pe,0,3),pe.s=je,Ce.s*=je):Ce=e($e,pe,0,P),pe=$e.minus(Ce.times(pe)),!pe.c[0]&&P==1&&(pe.s=$e.s),pe)},s.multipliedBy=s.times=function(pe,Se){var Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr=this,on=Pr.c,xn=(pe=new re(pe,Se)).c;if(!on||!xn||!on[0]||!xn[0])return!Pr.s||!pe.s||on&&!on[0]&&!xn||xn&&!xn[0]&&!on?pe.c=pe.e=pe.s=null:(pe.s*=Pr.s,!on||!xn?pe.c=pe.e=null:(pe.c=[0],pe.e=0)),pe;for(je=Zf(Pr.e/Qi)+Zf(pe.e/Qi),pe.s*=Pr.s,Me=on.length,Bt=xn.length,Me<Bt&&(pr=on,on=xn,xn=pr,$e=Me,Me=Bt,Bt=$e),$e=Me+Bt,pr=[];$e--;pr.push(0));for(Dr=Jd,Rr=Ay,$e=Bt;--$e>=0;){for(Ce=0,er=xn[$e]%Rr,cr=xn[$e]/Rr|0,nt=Me,Qe=$e+nt;Qe>$e;)ct=on[--nt]%Rr,mt=on[nt]/Rr|0,Ne=cr*ct+mt*er,ct=er*ct+Ne%Rr*Rr+pr[Qe]+Ce,Ce=(ct/Dr|0)+(Ne/Rr|0)+cr*mt,pr[Qe--]=ct%Dr;pr[Qe]=Ce}return Ce?++je:pr.splice(0,1),De(pe,pr,je)},s.negated=function(){var pe=new re(this);return pe.s=-pe.s||null,pe},s.plus=function(pe,Se){var Ce,je=this,$e=je.s;if(pe=new re(pe,Se),Se=pe.s,!$e||!Se)return new re(NaN);if($e!=Se)return pe.s=-Se,je.minus(pe);var Qe=je.e/Qi,nt=pe.e/Qi,Ne=je.c,Me=pe.c;if(!Qe||!nt){if(!Ne||!Me)return new re($e/0);if(!Ne[0]||!Me[0])return Me[0]?pe:new re(Ne[0]?je:$e*0)}if(Qe=Zf(Qe),nt=Zf(nt),Ne=Ne.slice(),$e=Qe-nt){for($e>0?(nt=Qe,Ce=Me):($e=-$e,Ce=Ne),Ce.reverse();$e--;Ce.push(0));Ce.reverse()}for($e=Ne.length,Se=Me.length,$e-Se<0&&(Ce=Me,Me=Ne,Ne=Ce,Se=$e),$e=0;Se;)$e=(Ne[--Se]=Ne[Se]+Me[Se]+$e)/Jd|0,Ne[Se]=Jd===Ne[Se]?0:Ne[Se]%Jd;return $e&&(Ne=[$e].concat(Ne),++nt),De(pe,Ne,nt)},s.precision=s.sd=function(pe,Se){var Ce,je,$e,Qe=this;if(pe!=null&&pe!==!!pe)return ua(pe,1,yu),Se==null?Se=u:ua(Se,0,8),Ue(new re(Qe),pe,Se);if(!(Ce=Qe.c))return null;if($e=Ce.length-1,je=$e*Qi+1,$e=Ce[$e]){for(;$e%10==0;$e/=10,je--);for($e=Ce[0];$e>=10;$e/=10,je++);}return pe&&Qe.e+1>je&&(je=Qe.e+1),je},s.shiftedBy=function(pe){return ua(pe,-f8,f8),this.times("1e"+pe)},s.squareRoot=s.sqrt=function(){var pe,Se,Ce,je,$e,Qe=this,nt=Qe.c,Ne=Qe.s,Me=Qe.e,ct=a+4,mt=new re("0.5");if(Ne!==1||!nt||!nt[0])return new re(!Ne||Ne<0&&(!nt||nt[0])?NaN:nt?Qe:1/0);if(Ne=Math.sqrt(+Ve(Qe)),Ne==0||Ne==1/0?(Se=Yf(nt),(Se.length+Me)%2==0&&(Se+="0"),Ne=Math.sqrt(+Se),Me=Zf((Me+1)/2)-(Me<0||Me%2),Ne==1/0?Se="5e"+Me:(Se=Ne.toExponential(),Se=Se.slice(0,Se.indexOf("e")+1)+Me),Ce=new re(Se)):Ce=new re(Ne+""),Ce.c[0]){for(Me=Ce.e,Ne=Me+ct,Ne<3&&(Ne=0);;)if($e=Ce,Ce=mt.times($e.plus(e(Qe,$e,ct,1))),Yf($e.c).slice(0,Ne)===(Se=Yf(Ce.c)).slice(0,Ne))if(Ce.e<Me&&--Ne,Se=Se.slice(Ne-3,Ne+1),Se=="9999"||!je&&Se=="4999"){if(!je&&(Ue($e,$e.e+a+2,0),$e.times($e).eq(Qe))){Ce=$e;break}ct+=4,Ne+=4,je=1}else{(!+Se||!+Se.slice(1)&&Se.charAt(0)=="5")&&(Ue(Ce,Ce.e+a+2,1),pe=!Ce.times(Ce).eq(Qe));break}}return Ue(Ce,Ce.e+a+1,u,pe)},s.toExponential=function(pe,Se){return pe!=null&&(ua(pe,0,yu),pe++),ce(this,pe,Se,1)},s.toFixed=function(pe,Se){return pe!=null&&(ua(pe,0,yu),pe=pe+this.e+1),ce(this,pe,Se)},s.toFormat=function(pe,Se,Ce){var je,$e=this;if(Ce==null)pe!=null&&Se&&typeof Se=="object"?(Ce=Se,Se=null):pe&&typeof pe=="object"?(Ce=pe,pe=Se=null):Ce=U;else if(typeof Ce!="object")throw Error(xl+"Argument not an object: "+Ce);if(je=$e.toFixed(pe,Se),$e.c){var Qe,nt=je.split("."),Ne=+Ce.groupSize,Me=+Ce.secondaryGroupSize,ct=Ce.groupSeparator||"",mt=nt[0],Bt=nt[1],er=$e.s<0,cr=er?mt.slice(1):mt,pr=cr.length;if(Me&&(Qe=Ne,Ne=Me,Me=Qe,pr-=Qe),Ne>0&&pr>0){for(Qe=pr%Ne||Ne,mt=cr.substr(0,Qe);Qe<pr;Qe+=Ne)mt+=ct+cr.substr(Qe,Ne);Me>0&&(mt+=ct+cr.slice(Qe)),er&&(mt="-"+mt)}je=Bt?mt+(Ce.decimalSeparator||"")+((Me=+Ce.fractionGroupSize)?Bt.replace(new RegExp("\\d{"+Me+"}\\B","g"),"$&"+(Ce.fractionGroupSeparator||"")):Bt):mt}return(Ce.prefix||"")+je+(Ce.suffix||"")},s.toFraction=function(pe){var Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr=this,pr=cr.c;if(pe!=null&&(Ne=new re(pe),!Ne.isInteger()&&(Ne.c||Ne.s!==1)||Ne.lt(o)))throw Error(xl+"Argument "+(Ne.isInteger()?"out of range: ":"not an integer: ")+Ve(Ne));if(!pr)return new re(cr);for(Se=new re(o),ct=Ce=new re(o),je=Me=new re(o),er=Yf(pr),Qe=Se.e=er.length-cr.e-1,Se.c[0]=d8[(nt=Qe%Qi)<0?Qi+nt:nt],pe=!pe||Ne.comparedTo(Se)>0?Qe>0?Se:ct:Ne,nt=A,A=1/0,Ne=new re(er),Me.c[0]=0;mt=e(Ne,Se,0,1),$e=Ce.plus(mt.times(je)),$e.comparedTo(pe)!=1;)Ce=je,je=$e,ct=Me.plus(mt.times($e=ct)),Me=$e,Se=Ne.minus(mt.times($e=Se)),Ne=$e;return $e=e(pe.minus(Ce),je,0,1),Me=Me.plus($e.times(ct)),Ce=Ce.plus($e.times(je)),Me.s=ct.s=cr.s,Qe=Qe*2,Bt=e(ct,je,Qe,u).minus(cr).abs().comparedTo(e(Me,Ce,Qe,u).minus(cr).abs())<1?[ct,je]:[Me,Ce],A=nt,Bt},s.toNumber=function(){return+Ve(this)},s.toPrecision=function(pe,Se){return pe!=null&&ua(pe,1,yu),ce(this,pe,Se,2)},s.toString=function(pe){var Se,Ce=this,je=Ce.s,$e=Ce.e;return $e===null?je?(Se="Infinity",je<0&&(Se="-"+Se)):Se="NaN":(pe==null?Se=$e<=l||$e>=g?bk(Yf(Ce.c),$e):Sp(Yf(Ce.c),$e,"0"):pe===10&&J?(Ce=Ue(new re(Ce),a+$e+1,u),Se=Sp(Yf(Ce.c),Ce.e,"0")):(ua(pe,2,V.length,"Base"),Se=n(Sp(Yf(Ce.c),$e,"0"),10,pe,je,!0)),je<0&&Ce.c[0]&&(Se="-"+Se)),Se},s.valueOf=s.toJSON=function(){return Ve(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,r!=null&&re.set(r),re}function Zf(r){var e=r|0;return r>0||r===e?e:e-1}function Yf(r){for(var e,n,i=1,s=r.length,o=r[0]+"";i<s;){for(e=r[i++]+"",n=Qi-e.length;n--;e="0"+e);o+=e}for(s=o.length;o.charCodeAt(--s)===48;);return o.slice(0,s+1||1)}function zb(r,e){var n,i,s=r.c,o=e.c,a=r.s,u=e.s,l=r.e,g=e.e;if(!a||!u)return null;if(n=s&&!s[0],i=o&&!o[0],n||i)return n?i?0:-u:a;if(a!=u)return a;if(n=a<0,i=l==g,!s||!o)return i?0:!s^n?1:-1;if(!i)return l>g^n?1:-1;for(u=(l=s.length)<(g=o.length)?l:g,a=0;a<u;a++)if(s[a]!=o[a])return s[a]>o[a]^n?1:-1;return l==g?0:l>g^n?1:-1}function ua(r,e,n,i){if(r<e||r>n||r!==qf(r))throw Error(xl+(i||"Argument")+(typeof r=="number"?r<e||r>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function mk(r){var e=r.c.length-1;return Zf(r.e/Qi)==e&&r.c[e]%2!=0}function bk(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function Sp(r,e,n){var i,s;if(e<0){for(s=n+".";++e;s+=n);r=s+r}else if(i=r.length,++e>i){for(s=n,e-=i;--e;s+=n);r+=s}else e<i&&(r=r.slice(0,e)+"."+r.slice(e));return r}var iE=NG();const ti=iE;var Ame=tn(1275);function h8(r){return typeof r!="string"?!1:Ame.isURL(r.toString(),{protocols:["http","https"],require_tld:!1})}function sE(r){return r===Object(r)&&Object.prototype.toString.call(r)!=="[object Array]"}function Ow(r){return Array.isArray(r)}function _me(r){try{return!!JSON.parse(r)}catch{return!1}}function MG(r){return typeof r=="boolean"}function Eme(r){return!!r&&(r instanceof iE||r.constructor&&r.constructor.name==="BigNumber")}function $c(r){return typeof r=="string"||!!r&&r.constructor&&r.constructor.name==="String"}function Tme(r){return typeof r=="function"}function $b(r){return typeof r=="string"&&!isNaN(parseInt(r,16))&&/^(0x|)[a-fA-F0-9]+$/.test(r)}function _y(r){return r===null?!1:Number.isInteger(Number(r))}function LG(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function DG(r,...e){return e.length&&!e.map(n=>LG(r,n)).includes(!1)}function Sme(r){const e={block:r.block_number,timestamp:r.block_timestamp,contract:r.contract_address,name:r.event_name,transaction:r.transaction_id,result:r.result,resourceNode:r.resource_Node||(r._unconfirmed?"fullNode":"solidityNode")};return r._unconfirmed&&(e.unconfirmed=r._unconfirmed),r._fingerprint&&(e.fingerprint=r._fingerprint),e}function Ime(r,{inputs:e}){if(!r.result)return r;if(sE(r.result))for(let n=0;n<e.length;n++){const i=e[n];i.type=="address"&&i.name in r.result&&(r.result[i.name]=id+r.result[i.name].substr(2).toLowerCase())}else Ow(r.result)&&(r.result=r.result.reduce((n,i,s)=>{const{name:o,type:a}=e[s];return a=="address"&&(i=id+i.substr(2).toLowerCase()),n[o]=i,n},{}));return r}function kme(r,e,n){let i=r.toString();for(;i.length<n;)i=e+i;return i}function Vc(r){return r!==null&&typeof r<"u"}async function Rme(r=1e3){return new Promise(e=>setTimeout(e,r))}const UG="0x0000000000000000000000000000000000000000000000000000000000000000",FG="6.13.5";function Cme(r,e,n){const i=e.split("|").map(o=>o.trim());for(let o=0;o<i.length;o++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=r,s}async function oE(r){const e=Object.keys(r);return(await Promise.all(e.map(i=>Promise.resolve(r[i])))).reduce((i,s,o)=>(i[e[o]]=s,i),{})}function Ki(r,e,n){for(let i in e){let s=e[i];const o=n?n[i]:null;o&&Cme(s,o,i),Object.defineProperty(r,i,{enumerable:!0,value:s,writable:!1})}}function Pw(r){if(r==null)return"null";if(Array.isArray(r))return"[ "+r.map(Pw).join(", ")+" ]";if(r instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let i=0;i<r.length;i++)n+=e[r[i]>>4],n+=e[r[i]&15];return n}if(typeof r=="object"&&typeof r.toJSON=="function")return Pw(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"number":return r.toString();case"string":return JSON.stringify(r);case"object":{const e=Object.keys(r);return e.sort(),"{ "+e.map(n=>`${Pw(n)}: ${Pw(r[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function vk(r,e){return r&&r.code===e}function rYe(r){return vk(r,"CALL_EXCEPTION")}function p8(r,e,n){let i=r;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${Pw(n)}`);for(const a in n){if(a==="shortMessage")continue;const u=n[a];o.push(a+"="+Pw(u))}}o.push(`code=${e}`),o.push(`version=${FG}`),o.length&&(r+=" ("+o.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(r);break;default:s=new Error(r)}return Ki(s,{code:e}),n&&Object.assign(s,n),s.shortMessage==null&&Ki(s,{shortMessage:i}),s}function Ei(r,e,n,i){if(!r)throw p8(e,n,i)}function xr(r,e,n,i){Ei(r,e,"INVALID_ARGUMENT",{argument:n,value:i})}function WG(r,e,n){n==null&&(n=""),n&&(n=": "+n),Ei(r>=e,"missing argument"+n,"MISSING_ARGUMENT",{count:r,expectedCount:e}),Ei(r<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}const xme=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken");r.push(e)}catch{}return r},[]);function HG(r){Ei(xme.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}function Ip(r,e,n){if(n==null&&(n=""),r!==e){let i=n,s="new";n&&(i+=".",s+=" "+n),Ei(!1,`private constructor; use ${i}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function zG(r,e,n){if(r instanceof Uint8Array)return n?new Uint8Array(r):r;if(typeof r=="string"&&r.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const i=new Uint8Array((r.length-2)/2);let s=2;for(let o=0;o<i.length;o++)i[o]=parseInt(r.substring(s,s+2),16),s+=2;return i}xr(!1,"invalid BytesLike value",e||"value",r)}function hi(r,e){return zG(r,e,!1)}function hc(r,e){return zG(r,e,!0)}function pc(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}function wk(r){return pc(r,!0)||r instanceof Uint8Array}const $G="0123456789abcdef";function jn(r){const e=hi(r);let n="0x";for(let i=0;i<e.length;i++){const s=e[i];n+=$G[(s&240)>>4]+$G[s&15]}return n}function bo(r){return"0x"+r.map(e=>jn(e).substring(2)).join("")}function aE(r){return pc(r,!0)?(r.length-2)/2:hi(r).length}function kp(r,e,n){const i=hi(r);return n!=null&&n>i.length&&Ei(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:i,length:i.length,offset:n}),jn(i.slice(e??0,n??i.length))}function nYe(r){let e=jn(r).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}function VG(r,e,n){const i=hi(r);Ei(e>=i.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(i),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),n?s.set(i,e-i.length):s.set(i,0),jn(s)}function Ey(r,e){return VG(r,e,!0)}function iYe(r,e){return VG(r,e,!1)}const Ak=BigInt(0),Qd=BigInt(1),Nw=9007199254740991;function Bme(r,e){const n=_k(r,"value"),i=BigInt(zu(e,"width"));if(Ei(n>>i===Ak,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),n>>i-Qd){const s=(Qd<<i)-Qd;return-((~n&s)+Qd)}return n}function g8(r,e){let n=lo(r,"value");const i=BigInt(zu(e,"width")),s=Qd<<i-Qd;if(n<Ak){n=-n,Ei(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});const o=(Qd<<i)-Qd;return(~n&o)+Qd}else Ei(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return n}function Mw(r,e){const n=_k(r,"value"),i=BigInt(zu(e,"bits"));return n&(Qd<<i)-Qd}function lo(r,e){switch(typeof r){case"bigint":return r;case"number":return xr(Number.isInteger(r),"underflow",e||"value",r),xr(r>=-Nw&&r<=Nw,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(n){xr(!1,`invalid BigNumberish string: ${n.message}`,e||"value",r)}}xr(!1,"invalid BigNumberish value",e||"value",r)}function _k(r,e){const n=lo(r,e);return Ei(n>=Ak,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),n}const jG="0123456789abcdef";function Ek(r){if(r instanceof Uint8Array){let e="0x0";for(const n of r)e+=jG[n>>4],e+=jG[n&15];return BigInt(e)}return lo(r)}function zu(r,e){switch(typeof r){case"bigint":return xr(r>=-Nw&&r<=Nw,"overflow",e||"value",r),Number(r);case"number":return xr(Number.isInteger(r),"underflow",e||"value",r),xr(r>=-Nw&&r<=Nw,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return zu(BigInt(r),e)}catch(n){xr(!1,`invalid numeric string: ${n.message}`,e||"value",r)}}xr(!1,"invalid numeric value",e||"value",r)}function Ome(r){return zu(Ek(r))}function eh(r,e){let i=_k(r,"value").toString(16);if(e==null)i.length%2&&(i="0"+i);else{const s=zu(e,"width");for(Ei(s*2>=i.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});i.length<s*2;)i="0"+i}return"0x"+i}function jc(r){const e=_k(r,"value");if(e===Ak)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const o=s*2;i[s]=parseInt(n.substring(o,o+2),16)}return i}function KG(r){let e=jn(wk(r)?r:jc(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const GG=BigInt(0),qG=BigInt(1),ZG=BigInt(2),YG=BigInt(27),XG=BigInt(28),Tk=BigInt(35),Lw={};function JG(r){return Ey(jc(r),32)}class ca{#e;#t;#r;#n;get r(){return this.#e}set r(e){xr(aE(e)===32,"invalid r","value",e),this.#e=jn(e)}get s(){return this.#t}set s(e){xr(aE(e)===32,"invalid s","value",e);const n=jn(e);xr(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),this.#t=n}get v(){return this.#r}set v(e){const n=zu(e,"value");xr(n===27||n===28,"invalid v","v",e),this.#r=n}get networkV(){return this.#n}get legacyChainId(){const e=this.networkV;return e==null?null:ca.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=hi(this.s);return this.yParity&&(e[0]|=128),jn(e)}get compactSerialized(){return bo([this.r,this.yParityAndS])}get serialized(){return bo([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,n,i,s){Ip(e,Lw,"Signature"),this.#e=n,this.#t=i,this.#r=s,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new ca(Lw,this.r,this.s,this.v);return this.networkV&&(e.#n=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=lo(e,"v");return n==YG||n==XG?GG:(xr(n>=Tk,"invalid EIP-155 v","v",e),(n-Tk)/ZG)}static getChainIdV(e,n){return lo(e)*ZG+BigInt(35+n-27)}static getNormalizedV(e){const n=lo(e);return n===GG||n===YG?27:n===qG||n===XG?28:(xr(n>=Tk,"invalid v","v",e),n&qG?27:28)}static from(e){function n(g,y){xr(g,y,"signature",e)}if(e==null)return new ca(Lw,UG,UG,27);if(typeof e=="string"){const g=hi(e,"signature");if(g.length===64){const y=jn(g.slice(0,32)),A=g.slice(32,64),I=A[0]&128?28:27;return A[0]&=127,new ca(Lw,y,jn(A),I)}if(g.length===65){const y=jn(g.slice(0,32)),A=g.slice(32,64);n((A[0]&128)===0,"non-canonical s");const I=ca.getNormalizedV(g[64]);return new ca(Lw,y,jn(A),I)}n(!1,"invalid raw signature length")}if(e instanceof ca)return e.clone();const i=e.r;n(i!=null,"missing r");const s=JG(i),o=function(g,y){if(g!=null)return JG(g);if(y!=null){n(pc(y,32),"invalid yParityAndS");const A=hi(y);return A[0]&=127,jn(A)}n(!1,"missing s")}(e.s,e.yParityAndS);n((hi(o)[0]&128)==0,"non-canonical s");const{networkV:a,v:u}=function(g,y,A){if(g!=null){const I=lo(g);return{networkV:I>=Tk?I:void 0,v:ca.getNormalizedV(I)}}if(y!=null)return n(pc(y,32),"invalid yParityAndS"),{v:hi(y)[0]&128?28:27};if(A!=null){switch(zu(A,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new ca(Lw,s,o,u);return a&&(l.#n=a),n(e.yParity==null||zu(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}}function wf(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function sYe(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function y8(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function QG(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");wf(r.outputLen),wf(r.blockLen)}function Dw(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function eq(r,e){y8(r);const n=e.outputLen;if(r.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const oYe=null,aYe=null,m8=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const b8=r=>r instanceof Uint8Array,uYe=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength),Sk=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Ik=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),n0=(r,e)=>r<<32-e|r>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const Pme=null;function lYe(r){if(!b8(r))throw new Error("Uint8Array expected");let e="";for(let n=0;n<r.length;n++)e+=Pme[r[n]];return e}function fYe(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let i=0;i<n.length;i++){const s=i*2,o=r.slice(s,s+2),a=Number.parseInt(o,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");n[i]=a}return n}const Nme=async()=>{};async function tq(r,e,n){let i=Date.now();for(let s=0;s<r;s++){n(s);const o=Date.now()-i;o>=0&&o<e||(await Nme(),i+=o)}}function Mme(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Ty(r){if(typeof r=="string"&&(r=Mme(r)),!b8(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function Lme(...r){const e=new Uint8Array(r.reduce((i,s)=>i+s.length,0));let n=0;return r.forEach(i=>{if(!b8(i))throw new Error("Uint8Array expected");e.set(i,n),n+=i.length}),e}class v8{clone(){return this._cloneInto()}}const Dme={}.toString;function rq(r,e){if(e!==void 0&&Dme.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function kk(r){const e=i=>r().update(Ty(i)).digest(),n=r();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>r(),e}function dYe(r){const e=(i,s)=>r(s).update(Ty(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function hYe(r){const e=(i,s)=>r(s).update(Ty(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function Ume(r=32){if(m8&&typeof m8.getRandomValues=="function")return m8.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}class nq extends v8{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,QG(e);const i=Ty(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?e.create().update(i).digest():i);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),o.fill(0)}update(e){return Dw(this),this.iHash.update(e),this}digestInto(e){Dw(this),y8(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:i,finished:s,destroyed:o,blockLen:a,outputLen:u}=this;return e=e,e.finished=s,e.destroyed=o,e.blockLen=a,e.outputLen=u,e.oHash=n._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Rk=(r,e,n)=>new nq(r,e).update(n).digest();Rk.create=(r,e)=>new nq(r,e);function iq(r,e,n,i){QG(r);const s=rq({dkLen:32,asyncTick:10},i),{c:o,dkLen:a,asyncTick:u}=s;if(wf(o),wf(a),wf(u),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=Ty(e),g=Ty(n),y=new Uint8Array(a),A=Rk.create(r,l),I=A._cloneInto().update(g);return{c:o,dkLen:a,asyncTick:u,DK:y,PRF:A,PRFSalt:I}}function sq(r,e,n,i,s){return r.destroy(),e.destroy(),i&&i.destroy(),s.fill(0),n}function w8(r,e,n,i){const{c:s,dkLen:o,DK:a,PRF:u,PRFSalt:l}=iq(r,e,n,i);let g;const y=new Uint8Array(4),A=Ik(y),I=new Uint8Array(u.outputLen);for(let P=1,D=0;D<o;P++,D+=u.outputLen){const U=a.subarray(D,D+u.outputLen);A.setInt32(0,P,!1),(g=l._cloneInto(g)).update(y).digestInto(I),U.set(I.subarray(0,U.length));for(let V=1;V<s;V++){u._cloneInto(g).update(I).digestInto(I);for(let J=0;J<U.length;J++)U[J]^=I[J]}}return sq(u,l,a,g,I)}async function pYe(r,e,n,i){const{c:s,dkLen:o,asyncTick:a,DK:u,PRF:l,PRFSalt:g}=iq(r,e,n,i);let y;const A=new Uint8Array(4),I=createView(A),P=new Uint8Array(l.outputLen);for(let D=1,U=0;U<o;D++,U+=l.outputLen){const V=u.subarray(U,U+l.outputLen);I.setInt32(0,D,!1),(y=g._cloneInto(y)).update(A).digestInto(P),V.set(P.subarray(0,V.length)),await asyncLoop(s-1,a,()=>{l._cloneInto(y).update(P).digestInto(P);for(let J=0;J<V.length;J++)V[J]^=P[J]})}return sq(l,g,u,y,P)}function Fme(r,e,n,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,n,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(n>>s&o),u=Number(n&o),l=i?4:0,g=i?0:4;r.setUint32(e+l,a,i),r.setUint32(e+g,u,i)}class A8 extends v8{constructor(e,n,i,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ik(this.buffer)}update(e){Dw(this);const{view:n,buffer:i,blockLen:s}=this;e=Ty(e);const o=e.length;for(let a=0;a<o;){const u=Math.min(s-this.pos,o-a);if(u===s){const l=Ik(e);for(;s<=o-a;a+=s)this.process(l,a);continue}i.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Dw(this),eq(e,this),this.finished=!0;const{buffer:n,view:i,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(i,0),a=0);for(let A=a;A<s;A++)n[A]=0;Fme(i,s-8,BigInt(this.length*8),o),this.process(i,0);const u=Ik(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const g=l/4,y=this.get();if(g>y.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<g;A++)u.setUint32(4*A,y[A],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:i,length:s,finished:o,destroyed:a,pos:u}=this;return e.length=s,e.pos=u,e.finished=o,e.destroyed=a,s%n&&e.buffer.set(i),e}}const Wme=(r,e,n)=>r&e^~r&n,Hme=(r,e,n)=>r&e^r&n^e&n,zme=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Sy=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Iy=new Uint32Array(64);class oq extends A8{constructor(){super(64,32,8,!1),this.A=Sy[0]|0,this.B=Sy[1]|0,this.C=Sy[2]|0,this.D=Sy[3]|0,this.E=Sy[4]|0,this.F=Sy[5]|0,this.G=Sy[6]|0,this.H=Sy[7]|0}get(){const{A:e,B:n,C:i,D:s,E:o,F:a,G:u,H:l}=this;return[e,n,i,s,o,a,u,l]}set(e,n,i,s,o,a,u,l){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,n){for(let A=0;A<16;A++,n+=4)Iy[A]=e.getUint32(n,!1);for(let A=16;A<64;A++){const I=Iy[A-15],P=Iy[A-2],D=n0(I,7)^n0(I,18)^I>>>3,U=n0(P,17)^n0(P,19)^P>>>10;Iy[A]=U+Iy[A-7]+D+Iy[A-16]|0}let{A:i,B:s,C:o,D:a,E:u,F:l,G:g,H:y}=this;for(let A=0;A<64;A++){const I=n0(u,6)^n0(u,11)^n0(u,25),P=y+I+Wme(u,l,g)+zme[A]+Iy[A]|0,U=(n0(i,2)^n0(i,13)^n0(i,22))+Hme(i,s,o)|0;y=g,g=l,l=u,u=a+P|0,a=o,o=s,s=i,i=P+U|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,g=g+this.G|0,y=y+this.H|0,this.set(i,s,o,a,u,l,g,y)}roundClean(){Iy.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class gYe extends oq{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const Uw=kk(()=>new oq),yYe=null,Ck=BigInt(2**32-1),_8=BigInt(32);function aq(r,e=!1){return e?{h:Number(r&Ck),l:Number(r>>_8&Ck)}:{h:Number(r>>_8&Ck)|0,l:Number(r&Ck)|0}}function uq(r,e=!1){let n=new Uint32Array(r.length),i=new Uint32Array(r.length);for(let s=0;s<r.length;s++){const{h:o,l:a}=aq(r[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const $me=(r,e)=>BigInt(r>>>0)<<_8|BigInt(e>>>0),Vme=(r,e,n)=>r>>>n,jme=(r,e,n)=>r<<32-n|e>>>n,Kme=(r,e,n)=>r>>>n|e<<32-n,Gme=(r,e,n)=>r<<32-n|e>>>n,qme=(r,e,n)=>r<<64-n|e>>>n-32,Zme=(r,e,n)=>r>>>n-32|e<<64-n,Yme=(r,e)=>e,Xme=(r,e)=>r,cq=(r,e,n)=>r<<n|e>>>32-n,lq=(r,e,n)=>e<<n|r>>>32-n,fq=(r,e,n)=>e<<n-32|r>>>64-n,dq=(r,e,n)=>r<<n-32|e>>>64-n;function Jme(r,e,n,i){const s=(e>>>0)+(i>>>0);return{h:r+n+(s/2**32|0)|0,l:s|0}}const ls={fromBig:aq,split:uq,toBig:$me,shrSH:Vme,shrSL:jme,rotrSH:Kme,rotrSL:Gme,rotrBH:qme,rotrBL:Zme,rotr32H:Yme,rotr32L:Xme,rotlSH:cq,rotlSL:lq,rotlBH:fq,rotlBL:dq,add:Jme,add3L:(r,e,n)=>(r>>>0)+(e>>>0)+(n>>>0),add3H:(r,e,n,i)=>e+n+i+(r/2**32|0)|0,add4L:(r,e,n,i)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0),add4H:(r,e,n,i,s)=>e+n+i+s+(r/2**32|0)|0,add5H:(r,e,n,i,s,o)=>e+n+i+s+o+(r/2**32|0)|0,add5L:(r,e,n,i,s)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0)+(s>>>0)},[Qme,ebe]=ls.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),ky=new Uint32Array(80),Ry=new Uint32Array(80);class xk extends A8{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:i,Bl:s,Ch:o,Cl:a,Dh:u,Dl:l,Eh:g,El:y,Fh:A,Fl:I,Gh:P,Gl:D,Hh:U,Hl:V}=this;return[e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V]}set(e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V){this.Ah=e|0,this.Al=n|0,this.Bh=i|0,this.Bl=s|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=g|0,this.El=y|0,this.Fh=A|0,this.Fl=I|0,this.Gh=P|0,this.Gl=D|0,this.Hh=U|0,this.Hl=V|0}process(e,n){for(let ce=0;ce<16;ce++,n+=4)ky[ce]=e.getUint32(n),Ry[ce]=e.getUint32(n+=4);for(let ce=16;ce<80;ce++){const Re=ky[ce-15]|0,De=Ry[ce-15]|0,Ue=ls.rotrSH(Re,De,1)^ls.rotrSH(Re,De,8)^ls.shrSH(Re,De,7),Ve=ls.rotrSL(Re,De,1)^ls.rotrSL(Re,De,8)^ls.shrSL(Re,De,7),pe=ky[ce-2]|0,Se=Ry[ce-2]|0,Ce=ls.rotrSH(pe,Se,19)^ls.rotrBH(pe,Se,61)^ls.shrSH(pe,Se,6),je=ls.rotrSL(pe,Se,19)^ls.rotrBL(pe,Se,61)^ls.shrSL(pe,Se,6),$e=ls.add4L(Ve,je,Ry[ce-7],Ry[ce-16]),Qe=ls.add4H($e,Ue,Ce,ky[ce-7],ky[ce-16]);ky[ce]=Qe|0,Ry[ce]=$e|0}let{Ah:i,Al:s,Bh:o,Bl:a,Ch:u,Cl:l,Dh:g,Dl:y,Eh:A,El:I,Fh:P,Fl:D,Gh:U,Gl:V,Hh:J,Hl:re}=this;for(let ce=0;ce<80;ce++){const Re=ls.rotrSH(A,I,14)^ls.rotrSH(A,I,18)^ls.rotrBH(A,I,41),De=ls.rotrSL(A,I,14)^ls.rotrSL(A,I,18)^ls.rotrBL(A,I,41),Ue=A&P^~A&U,Ve=I&D^~I&V,pe=ls.add5L(re,De,Ve,ebe[ce],Ry[ce]),Se=ls.add5H(pe,J,Re,Ue,Qme[ce],ky[ce]),Ce=pe|0,je=ls.rotrSH(i,s,28)^ls.rotrBH(i,s,34)^ls.rotrBH(i,s,39),$e=ls.rotrSL(i,s,28)^ls.rotrBL(i,s,34)^ls.rotrBL(i,s,39),Qe=i&o^i&u^o&u,nt=s&a^s&l^a&l;J=U|0,re=V|0,U=P|0,V=D|0,P=A|0,D=I|0,{h:A,l:I}=ls.add(g|0,y|0,Se|0,Ce|0),g=u|0,y=l|0,u=o|0,l=a|0,o=i|0,a=s|0;const Ne=ls.add3L(Ce,$e,nt);i=ls.add3H(Ne,Se,je,Qe),s=Ne|0}({h:i,l:s}=ls.add(this.Ah|0,this.Al|0,i|0,s|0)),{h:o,l:a}=ls.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=ls.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:g,l:y}=ls.add(this.Dh|0,this.Dl|0,g|0,y|0),{h:A,l:I}=ls.add(this.Eh|0,this.El|0,A|0,I|0),{h:P,l:D}=ls.add(this.Fh|0,this.Fl|0,P|0,D|0),{h:U,l:V}=ls.add(this.Gh|0,this.Gl|0,U|0,V|0),{h:J,l:re}=ls.add(this.Hh|0,this.Hl|0,J|0,re|0),this.set(i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re)}roundClean(){ky.fill(0),Ry.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class TYe extends xk{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class SYe extends xk{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class IYe extends xk{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const E8=kk(()=>new xk),kYe=null,RYe=null,CYe=null;function tbe(){if(typeof self<"u")return self;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const hq=tbe(),pq=hq.crypto||hq.msCrypto;function gq(r){switch(r){case"sha256":return Uw.create();case"sha512":return E8.create()}xr(!1,"invalid hashing algorithm name","algorithm",r)}function rbe(r,e){const n={sha256:Uw,sha512:E8}[r];return xr(n!=null,"invalid hmac algorithm","algorithm",r),Rk.create(n,e)}function nbe(r,e,n,i,s){const o={sha256:Uw,sha512:E8}[s];return xr(o!=null,"invalid pbkdf2 algorithm","algorithm",s),w8(o,r,e,{c:n,dkLen:i})}function ibe(r){Ei(pq!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),xr(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);const e=new Uint8Array(r);return pq.getRandomValues(e),e}const yq=function(r){return gq("sha256").update(r).digest()},mq=function(r){return gq("sha512").update(r).digest()};let bq=yq,vq=mq,wq=!1,Aq=!1;function gc(r){const e=hi(r,"data");return jn(bq(e))}gc._=yq,gc.lock=function(){wq=!0},gc.register=function(r){if(wq)throw new Error("sha256 is locked");bq=r},Object.freeze(gc);function T8(r){const e=hi(r,"data");return jn(vq(e))}T8._=mq,T8.lock=function(){Aq=!0},T8.register=function(r){if(Aq)throw new Error("sha512 is locked");vq=r},Object.freeze(gc);let _q=!1;const Eq=function(r,e,n,i,s){return nbe(r,e,n,i,s)};let Tq=Eq;function uE(r,e,n,i,s){const o=hi(r,"password"),a=hi(e,"salt");return jn(Tq(o,a,n,i,s))}uE._=Eq,uE.lock=function(){_q=!0},uE.register=function(r){if(_q)throw new Error("pbkdf2 is locked");Tq=r},Object.freeze(uE);function sbe(r,e,n,i,s){xr(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",n)}function Sq(r,e,n,i,s){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let o=0;for(let a=e+1;a<n.length&&n[a]>>6===2;a++)o++;return o}return r==="OVERRUN"?n.length-e-1:0}function obe(r,e,n,i,s){return r==="OVERLONG"?(xr(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),i.push(s),0):(i.push(65533),Sq(r,e,n,i,s))}const abe=Object.freeze({error:sbe,ignore:Sq,replace:obe});function Iq(r,e){e==null&&(e=abe.error);const n=hi(r,"bytes"),i=[];let s=0;for(;s<n.length;){const o=n[s++];if(!(o>>7)){i.push(o);continue}let a=null,u=null;if((o&224)===192)a=1,u=127;else if((o&240)===224)a=2,u=2047;else if((o&248)===240)a=3,u=65535;else{(o&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,n,i):s+=e("BAD_PREFIX",s-1,n,i);continue}if(s-1+a>=n.length){s+=e("OVERRUN",s-1,n,i);continue}let l=o&(1<<8-a-1)-1;for(let g=0;g<a;g++){let y=n[s];if((y&192)!=128){s+=e("MISSING_CONTINUE",s,n,i),l=null;break}l=l<<6|y&63,s++}if(l!==null){if(l>1114111){s+=e("OUT_OF_RANGE",s-1-a,n,i,l);continue}if(l>=55296&&l<=57343){s+=e("UTF16_SURROGATE",s-1-a,n,i,l);continue}if(l<=u){s+=e("OVERLONG",s-1-a,n,i,l);continue}i.push(l)}}return i}function Kc(r,e){xr(typeof r=="string","invalid string value","str",r),e!=null&&(HG(e),r=r.normalize(e));let n=[];for(let i=0;i<r.length;i++){const s=r.charCodeAt(i);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){i++;const o=r.charCodeAt(i);xr(i<r.length&&(o&64512)===56320,"invalid surrogate pair","str",r);const a=65536+((s&1023)<<10)+(o&1023);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(a&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function ube(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function kq(r,e){return ube(Iq(r,e))}function xYe(r,e){return Iq(Kc(r,e))}const[Rq,Cq,xq]=[[],[],[]],cbe=BigInt(0),cE=BigInt(1),lbe=BigInt(2),fbe=BigInt(7),dbe=BigInt(256),hbe=BigInt(113);for(let r=0,e=cE,n=1,i=0;r<24;r++){[n,i]=[i,(2*n+3*i)%5],Rq.push(2*(5*i+n)),Cq.push((r+1)*(r+2)/2%64);let s=cbe;for(let o=0;o<7;o++)e=(e<<cE^(e>>fbe)*hbe)%dbe,e&lbe&&(s^=cE<<(cE<<BigInt(o))-cE);xq.push(s)}const[pbe,gbe]=uq(xq,!0),Bq=(r,e,n)=>n>32?fq(r,e,n):cq(r,e,n),Oq=(r,e,n)=>n>32?dq(r,e,n):lq(r,e,n);function ybe(r,e=24){const n=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let a=0;a<10;a++)n[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){const u=(a+8)%10,l=(a+2)%10,g=n[l],y=n[l+1],A=Bq(g,y,1)^n[u],I=Oq(g,y,1)^n[u+1];for(let P=0;P<50;P+=10)r[a+P]^=A,r[a+P+1]^=I}let s=r[2],o=r[3];for(let a=0;a<24;a++){const u=Cq[a],l=Bq(s,o,u),g=Oq(s,o,u),y=Rq[a];s=r[y],o=r[y+1],r[y]=l,r[y+1]=g}for(let a=0;a<50;a+=10){for(let u=0;u<10;u++)n[u]=r[a+u];for(let u=0;u<10;u++)r[a+u]^=~n[(u+2)%10]&n[(u+4)%10]}r[0]^=pbe[i],r[1]^=gbe[i]}n.fill(0)}class Bk extends v8{constructor(e,n,i,s=!1,o=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=i,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,wf(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Sk(this.state)}keccak(){ybe(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Dw(this);const{blockLen:n,state:i}=this;e=Ty(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(n-this.pos,s-o);for(let u=0;u<a;u++)i[this.pos++]^=e[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:i,blockLen:s}=this;e[i]^=n,n&128&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Dw(this,!1),y8(e),this.finish();const n=this.state,{blockLen:i}=this;for(let s=0,o=e.length;s<o;){this.posOut>=i&&this.keccak();const a=Math.min(i-this.posOut,o-s);e.set(n.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return wf(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(eq(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:i,outputLen:s,rounds:o,enableXOF:a}=this;return e||(e=new Bk(n,i,s,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=i,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}}const mbe=(r,e,n)=>kk(()=>new Bk(e,r,n)),BYe=null,OYe=null,PYe=null,NYe=null,MYe=null,bbe=mbe(1,136,256/8),LYe=null,DYe=null,UYe=(r,e,n)=>wrapXOFConstructorWithOpts((i={})=>new Bk(e,r,i.dkLen===void 0?n:i.dkLen,!0)),FYe=null,WYe=null;let Pq=!1;const Nq=function(r){return bbe(r)};let Mq=Nq;function Ss(r){const e=hi(r,"data");return jn(Mq(e))}Ss._=Nq,Ss.lock=function(){Pq=!0},Ss.register=function(r){if(Pq)throw new TypeError("keccak256 is locked");Mq=r},Object.freeze(Ss);function Bl(r){return Ss(Kc(r))}const Ok=" !#$%&'()*+,-./<=>?@[]^_`{|}~",vbe=/^[a-z]*$/i;function Lq(r,e){let n=97;return r.reduce((i,s)=>(s===e?n++:s.match(vbe)?i.push(String.fromCharCode(n)+s):(n=97,i.push(s)),i),[])}function wbe(r,e){for(let s=Ok.length-1;s>=0;s--)r=r.split(Ok[s]).join(e.substring(2*s,2*s+2));const n=[],i=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,o,a,u)=>{if(a)for(let l=parseInt(a);l>=0;l--)n.push(";");else n.push(o.toLowerCase());return""});if(i)throw new Error(`leftovers: ${JSON.stringify(i)}`);return Lq(Lq(n,";"),":")}function Abe(r){return xr(r[0]==="0","unsupported auwl data","data",r),wbe(r.substring(1+2*Ok.length),r.substring(1,1+2*Ok.length))}class Dq{locale;constructor(e){Ki(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class _be extends Dq{#e;#t;constructor(e,n,i){super(e),this.#e=n,this.#t=i,this.#r=null}get _data(){return this.#e}_decodeWords(){return Abe(this.#e)}#r;#n(){if(this.#r==null){const e=this._decodeWords();if(Bl(e.join(`
|
||
`)+`
|
||
`)!==this.#t)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#r=e}return this.#r}getWord(e){const n=this.#n();return xr(e>=0&&e<n.length,`invalid word index: ${e}`,"index",e),n[e]}getWordIndex(e){return this.#n().indexOf(e)}}const Ebe="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",Tbe="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let S8=null;class Cy extends _be{constructor(){super("en",Ebe,Tbe)}static wordlist(){return S8==null&&(S8=new Cy),S8}}function Uq(r){return(1<<r)-1<<8-r&255}function Sbe(r){return(1<<r)-1&255}function I8(r,e){HG("NFKD"),e==null&&(e=Cy.wordlist());const n=e.split(r);xr(n.length%3===0&&n.length>=12&&n.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const i=new Uint8Array(Math.ceil(11*n.length/8));let s=0;for(let g=0;g<n.length;g++){let y=e.getWordIndex(n[g].normalize("NFKD"));xr(y>=0,`invalid mnemonic word at index ${g}`,"mnemonic","[ REDACTED ]");for(let A=0;A<11;A++)y&1<<10-A&&(i[s>>3]|=1<<7-s%8),s++}const o=32*n.length/3,a=n.length/3,u=Uq(a),l=hi(gc(i.slice(0,o/8)))[0]&u;return xr(l===(i[i.length-1]&u),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),jn(i.slice(0,o/8))}function k8(r,e){xr(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Cy.wordlist());const n=[0];let i=11;for(let a=0;a<r.length;a++)i>8?(n[n.length-1]<<=8,n[n.length-1]|=r[a],i-=8):(n[n.length-1]<<=i,n[n.length-1]|=r[a]>>8-i,n.push(r[a]&Sbe(8-i)),i+=3);const s=r.length/4,o=parseInt(gc(r).substring(2,4),16)&Uq(s);return n[n.length-1]<<=s,n[n.length-1]|=o>>8-s,e.join(n.map(a=>e.getWord(a)))}const R8={};class xy{phrase;password;wordlist;entropy;constructor(e,n,i,s,o){s==null&&(s=""),o==null&&(o=Cy.wordlist()),Ip(e,R8,"Mnemonic"),Ki(this,{phrase:i,password:s,wordlist:o,entropy:n})}computeSeed(){const e=Kc("mnemonic"+this.password,"NFKD");return uE(Kc(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,n,i){const s=I8(e,i);return e=k8(hi(s),i),new xy(R8,s,e,n,i)}static fromEntropy(e,n,i){const s=hi(e,"entropy"),o=k8(s,i);return new xy(R8,jn(s),o,n,i)}static entropyToPhrase(e,n){const i=hi(e,"entropy");return k8(i,n)}static phraseToEntropy(e,n){return I8(e,n)}static isValidMnemonic(e,n){try{return I8(e,n),!0}catch{}return!1}}let Fq=!1;const Wq=function(r,e,n){return rbe(r,e).update(n).digest()};let Hq=Wq;function By(r,e,n){const i=hi(e,"key"),s=hi(n,"data");return jn(Hq(r,i,s))}By._=Wq,By.lock=function(){Fq=!0},By.register=function(r){if(Fq)throw new Error("computeHmac is locked");Hq=r},Object.freeze(By);const Ibe=BigInt(0),kbe=BigInt(36);function zq(r){r=r.toLowerCase();const e=r.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=e[s].charCodeAt(0);const i=hi(Ss(n));for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(i[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const C8={};for(let r=0;r<10;r++)C8[String(r)]=String(r);for(let r=0;r<26;r++)C8[String.fromCharCode(65+r)]=String(10+r);const $q=15;function Vq(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(i=>C8[i]).join("");for(;e.length>=$q;){let i=e.substring(0,$q);e=parseInt(i,10)%97+e.substring(i.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const Rbe=function(){const r={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[n]=BigInt(e)}return r}();function Cbe(r){r=r.toLowerCase();let e=Ibe;for(let n=0;n<r.length;n++)e=e*kbe+Rbe[r[n]];return e}function Ol(r){if(xr(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);const e=zq(r);return xr(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){xr(r.substring(2,4)===Vq(r),"bad icap checksum","address",r);let e=Cbe(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return zq("0x"+e)}xr(!1,"invalid address","address",r)}function HYe(r){let e=BigInt(Ol(r)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+Vq("XE00"+e)+e}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jq=BigInt(0),Pk=BigInt(1),xbe=BigInt(2),Nk=r=>r instanceof Uint8Array,Bbe=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Fw(r){if(!Nk(r))throw new Error("Uint8Array expected");let e="";for(let n=0;n<r.length;n++)e+=Bbe[r[n]];return e}function Obe(r){const e=r.toString(16);return e.length&1?`0${e}`:e}function Kq(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function Ww(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let i=0;i<n.length;i++){const s=i*2,o=r.slice(s,s+2),a=Number.parseInt(o,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");n[i]=a}return n}function Vb(r){return Kq(Fw(r))}function x8(r){if(!Nk(r))throw new Error("Uint8Array expected");return Kq(Fw(Uint8Array.from(r).reverse()))}function Hw(r,e){return Ww(r.toString(16).padStart(e*2,"0"))}function B8(r,e){return Hw(r,e).reverse()}function zYe(r){return Ww(Obe(r))}function th(r,e,n){let i;if(typeof e=="string")try{i=Ww(e)}catch(o){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${o}`)}else if(Nk(e))i=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);const s=i.length;if(typeof n=="number"&&s!==n)throw new Error(`${r} expected ${n} bytes, got ${s}`);return i}function lE(...r){const e=new Uint8Array(r.reduce((i,s)=>i+s.length,0));let n=0;return r.forEach(i=>{if(!Nk(i))throw new Error("Uint8Array expected");e.set(i,n),n+=i.length}),e}function $Ye(r,e){if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}function VYe(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function jYe(r){let e;for(e=0;r>jq;r>>=Pk,e+=1);return e}function KYe(r,e){return r>>BigInt(e)&Pk}const GYe=(r,e,n)=>r|(n?Pk:jq)<<BigInt(e),O8=r=>(xbe<<BigInt(r-1))-Pk,P8=r=>new Uint8Array(r),Gq=r=>Uint8Array.from(r);function qq(r,e,n){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let i=P8(r),s=P8(r),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},u=(...A)=>n(s,i,...A),l=(A=P8())=>{s=u(Gq([0]),A),i=u(),A.length!==0&&(s=u(Gq([1]),A),i=u())},g=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let A=0;const I=[];for(;A<e;){i=u();const P=i.slice();I.push(P),A+=i.length}return lE(...I)};return(A,I)=>{a(),l(A);let P;for(;!(P=I(g()));)l();return a(),P}}const Pbe={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function fE(r,e,n={}){const i=(s,o,a)=>{const u=Pbe[o];if(typeof u!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=r[s];if(!(a&&l===void 0)&&!u(l,r))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(e))i(s,o,!1);for(const[s,o]of Object.entries(n))i(s,o,!0);return r}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nu=BigInt(0),Bo=BigInt(1),Oy=BigInt(2),Nbe=BigInt(3),N8=BigInt(4),Zq=BigInt(5),Yq=BigInt(8),Mbe=BigInt(9),Lbe=BigInt(16);function yc(r,e){const n=r%e;return n>=nu?n:e+n}function Dbe(r,e,n){if(n<=nu||e<nu)throw new Error("Expected power/modulo > 0");if(n===Bo)return nu;let i=Bo;for(;e>nu;)e&Bo&&(i=i*r%n),r=r*r%n,e>>=Bo;return i}function Xf(r,e,n){let i=r;for(;e-- >nu;)i*=i,i%=n;return i}function Mk(r,e){if(r===nu||e<=nu)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let n=yc(r,e),i=e,s=nu,o=Bo,a=Bo,u=nu;for(;n!==nu;){const g=i/n,y=i%n,A=s-a*g,I=o-u*g;i=n,n=y,s=a,o=u,a=A,u=I}if(i!==Bo)throw new Error("invert: does not exist");return yc(s,e)}function Ube(r){const e=(r-Bo)/Oy;let n,i,s;for(n=r-Bo,i=0;n%Oy===nu;n/=Oy,i++);for(s=Oy;s<r&&Dbe(s,e,r)!==r-Bo;s++);if(i===1){const a=(r+Bo)/N8;return function(l,g){const y=l.pow(g,a);if(!l.eql(l.sqr(y),g))throw new Error("Cannot find square root");return y}}const o=(n+Bo)/Oy;return function(u,l){if(u.pow(l,e)===u.neg(u.ONE))throw new Error("Cannot find square root");let g=i,y=u.pow(u.mul(u.ONE,s),n),A=u.pow(l,o),I=u.pow(l,n);for(;!u.eql(I,u.ONE);){if(u.eql(I,u.ZERO))return u.ZERO;let P=1;for(let U=u.sqr(I);P<g&&!u.eql(U,u.ONE);P++)U=u.sqr(U);const D=u.pow(y,Bo<<BigInt(g-P-1));y=u.sqr(D),A=u.mul(A,D),I=u.mul(I,y),g=P}return A}}function Fbe(r){if(r%N8===Nbe){const e=(r+Bo)/N8;return function(i,s){const o=i.pow(s,e);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(r%Yq===Zq){const e=(r-Zq)/Yq;return function(i,s){const o=i.mul(s,Oy),a=i.pow(o,e),u=i.mul(s,a),l=i.mul(i.mul(u,Oy),a),g=i.mul(u,i.sub(l,i.ONE));if(!i.eql(i.sqr(g),s))throw new Error("Cannot find square root");return g}}return r%Lbe,Ube(r)}const qYe=(r,e)=>(yc(r,e)&Bo)===Bo,Wbe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Hbe(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Wbe.reduce((i,s)=>(i[s]="function",i),e);return fE(r,n)}function zbe(r,e,n){if(n<nu)throw new Error("Expected power > 0");if(n===nu)return r.ONE;if(n===Bo)return e;let i=r.ONE,s=e;for(;n>nu;)n&Bo&&(i=r.mul(i,s)),s=r.sqr(s),n>>=Bo;return i}function $be(r,e){const n=new Array(e.length),i=e.reduce((o,a,u)=>r.is0(a)?o:(n[u]=o,r.mul(o,a)),r.ONE),s=r.inv(i);return e.reduceRight((o,a,u)=>r.is0(a)?o:(n[u]=r.mul(o,n[u]),r.mul(o,a)),s),n}function ZYe(r,e,n){return r.mul(e,typeof n=="bigint"?Mk(n,r.ORDER):r.inv(n))}function YYe(r){const e=(r.ORDER-Bo)/Oy;return n=>{const i=r.pow(n,e);return r.eql(i,r.ZERO)||r.eql(i,r.ONE)}}function M8(r,e){const n=e!==void 0?e:r.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function Vbe(r,e,n=!1,i={}){if(r<=nu)throw new Error(`Expected Field ORDER > 0, got ${r}`);const{nBitLength:s,nByteLength:o}=M8(r,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=Fbe(r),u=Object.freeze({ORDER:r,BITS:s,BYTES:o,MASK:O8(s),ZERO:nu,ONE:Bo,create:l=>yc(l,r),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return nu<=l&&l<r},is0:l=>l===nu,isOdd:l=>(l&Bo)===Bo,neg:l=>yc(-l,r),eql:(l,g)=>l===g,sqr:l=>yc(l*l,r),add:(l,g)=>yc(l+g,r),sub:(l,g)=>yc(l-g,r),mul:(l,g)=>yc(l*g,r),pow:(l,g)=>zbe(u,l,g),div:(l,g)=>yc(l*Mk(g,r),r),sqrN:l=>l*l,addN:(l,g)=>l+g,subN:(l,g)=>l-g,mulN:(l,g)=>l*g,inv:l=>Mk(l,r),sqrt:i.sqrt||(l=>a(u,l)),invertBatch:l=>$be(u,l),cmov:(l,g,y)=>y?g:l,toBytes:l=>n?B8(l,o):Hw(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?x8(l):Vb(l)}});return Object.freeze(u)}function XYe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?n:r.neg(n)}function JYe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?r.neg(n):n}function QYe(r,e,n=!1){r=ensureBytes("privateHash",r);const i=r.length,s=M8(e).nByteLength+8;if(s<24||i<s||i>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${i}`);const o=n?bytesToNumberLE(r):bytesToNumberBE(r);return yc(o,e-Bo)+Bo}function Xq(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function Jq(r){const e=Xq(r);return e+Math.ceil(e/2)}function jbe(r,e,n=!1){const i=r.length,s=Xq(e),o=Jq(e);if(i<16||i<o||i>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const a=n?Vb(r):x8(r),u=yc(a,e-Bo)+Bo;return n?B8(u,s):Hw(u,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Kbe=BigInt(0),L8=BigInt(1);function Gbe(r,e){const n=(s,o)=>{const a=o.negate();return s?a:o},i=s=>{const o=Math.ceil(e/s)+1,a=2**(s-1);return{windows:o,windowSize:a}};return{constTimeNegate:n,unsafeLadder(s,o){let a=r.ZERO,u=s;for(;o>Kbe;)o&L8&&(a=a.add(u)),u=u.double(),o>>=L8;return a},precomputeWindow(s,o){const{windows:a,windowSize:u}=i(o),l=[];let g=s,y=g;for(let A=0;A<a;A++){y=g,l.push(y);for(let I=1;I<u;I++)y=y.add(g),l.push(y);g=y.double()}return l},wNAF(s,o,a){const{windows:u,windowSize:l}=i(s);let g=r.ZERO,y=r.BASE;const A=BigInt(2**s-1),I=2**s,P=BigInt(s);for(let D=0;D<u;D++){const U=D*l;let V=Number(a&A);a>>=P,V>l&&(V-=I,a+=L8);const J=U,re=U+Math.abs(V)-1,ce=D%2!==0,Re=V<0;V===0?y=y.add(n(ce,o[J])):g=g.add(n(Re,o[re]))}return{p:g,f:y}},wNAFCached(s,o,a,u){const l=s._WINDOW_SIZE||1;let g=o.get(s);return g||(g=this.precomputeWindow(s,l),l!==1&&o.set(s,u(g))),this.wNAF(l,g,a)}}}function Qq(r){return Hbe(r.Fp),fE(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...M8(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qbe(r){const e=Qq(r);fE(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:i,a:s}=e;if(n){if(!i.eql(s,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{Ph:Zbe,aT:Ybe}=E,jb={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){const{Err:e}=jb;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");const n=r[1],i=r.subarray(2,n+2);if(!n||i.length!==n)throw new e("Invalid signature integer: wrong length");if(i[0]&128)throw new e("Invalid signature integer: negative");if(i[0]===0&&!(i[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Zbe(i),l:r.subarray(n+2)}},toSig(r){const{Err:e}=jb,n=typeof r=="string"?Ybe(r):r;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let i=n.length;if(i<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==i-2)throw new e("Invalid signature: incorrect length");const{d:s,l:o}=jb._parseInt(n.subarray(2)),{d:a,l:u}=jb._parseInt(o);if(u.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(r){const e=g=>Number.parseInt(g[0],16)&8?"00"+g:g,n=g=>{const y=g.toString(16);return y.length&1?`0${y}`:y},i=e(n(r.s)),s=e(n(r.r)),o=i.length/2,a=s.length/2,u=n(o),l=n(a);return`30${n(a+o+4)}02${l}${s}02${u}${i}`}},rh=BigInt(0),_a=BigInt(1),Py=BigInt(2),Lk=BigInt(3),eZ=BigInt(4);function Xbe(r){const e=qbe(r),{Fp:n}=e,i=e.toBytes||((D,U,V)=>{const J=U.toAffine();return lE(Uint8Array.from([4]),n.toBytes(J.x),n.toBytes(J.y))}),s=e.fromBytes||(D=>{const U=D.subarray(1),V=n.fromBytes(U.subarray(0,n.BYTES)),J=n.fromBytes(U.subarray(n.BYTES,2*n.BYTES));return{x:V,y:J}});function o(D){const{a:U,b:V}=e,J=n.sqr(D),re=n.mul(J,D);return n.add(n.add(re,n.mul(D,U)),V)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(D){return typeof D=="bigint"&&rh<D&&D<e.n}function u(D){if(!a(D))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(D){const{allowedPrivateKeyLengths:U,nByteLength:V,wrapPrivateKey:J,n:re}=e;if(U&&typeof D!="bigint"){if(D instanceof Uint8Array&&(D=Fw(D)),typeof D!="string"||!U.includes(D.length))throw new Error("Invalid key");D=D.padStart(V*2,"0")}let ce;try{ce=typeof D=="bigint"?D:Vb(th("private key",D,V))}catch{throw new Error(`private key must be ${V} bytes, hex or bigint, not ${typeof D}`)}return J&&(ce=yc(ce,re)),u(ce),ce}const g=new Map;function y(D){if(!(D instanceof A))throw new Error("ProjectivePoint expected")}class A{constructor(U,V,J){if(this.px=U,this.py=V,this.pz=J,U==null||!n.isValid(U))throw new Error("x required");if(V==null||!n.isValid(V))throw new Error("y required");if(J==null||!n.isValid(J))throw new Error("z required")}static fromAffine(U){const{x:V,y:J}=U||{};if(!U||!n.isValid(V)||!n.isValid(J))throw new Error("invalid affine point");if(U instanceof A)throw new Error("projective point not allowed");const re=ce=>n.eql(ce,n.ZERO);return re(V)&&re(J)?A.ZERO:new A(V,J,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(U){const V=n.invertBatch(U.map(J=>J.pz));return U.map((J,re)=>J.toAffine(V[re])).map(A.fromAffine)}static fromHex(U){const V=A.fromAffine(s(th("pointHex",U)));return V.assertValidity(),V}static fromPrivateKey(U){return A.BASE.multiply(l(U))}_setWindowSize(U){this._WINDOW_SIZE=U,g.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:U,y:V}=this.toAffine();if(!n.isValid(U)||!n.isValid(V))throw new Error("bad point: x or y not FE");const J=n.sqr(V),re=o(U);if(!n.eql(J,re))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:U}=this.toAffine();if(n.isOdd)return!n.isOdd(U);throw new Error("Field doesn't support isOdd")}equals(U){y(U);const{px:V,py:J,pz:re}=this,{px:ce,py:Re,pz:De}=U,Ue=n.eql(n.mul(V,De),n.mul(ce,re)),Ve=n.eql(n.mul(J,De),n.mul(Re,re));return Ue&&Ve}negate(){return new A(this.px,n.neg(this.py),this.pz)}double(){const{a:U,b:V}=e,J=n.mul(V,Lk),{px:re,py:ce,pz:Re}=this;let De=n.ZERO,Ue=n.ZERO,Ve=n.ZERO,pe=n.mul(re,re),Se=n.mul(ce,ce),Ce=n.mul(Re,Re),je=n.mul(re,ce);return je=n.add(je,je),Ve=n.mul(re,Re),Ve=n.add(Ve,Ve),De=n.mul(U,Ve),Ue=n.mul(J,Ce),Ue=n.add(De,Ue),De=n.sub(Se,Ue),Ue=n.add(Se,Ue),Ue=n.mul(De,Ue),De=n.mul(je,De),Ve=n.mul(J,Ve),Ce=n.mul(U,Ce),je=n.sub(pe,Ce),je=n.mul(U,je),je=n.add(je,Ve),Ve=n.add(pe,pe),pe=n.add(Ve,pe),pe=n.add(pe,Ce),pe=n.mul(pe,je),Ue=n.add(Ue,pe),Ce=n.mul(ce,Re),Ce=n.add(Ce,Ce),pe=n.mul(Ce,je),De=n.sub(De,pe),Ve=n.mul(Ce,Se),Ve=n.add(Ve,Ve),Ve=n.add(Ve,Ve),new A(De,Ue,Ve)}add(U){y(U);const{px:V,py:J,pz:re}=this,{px:ce,py:Re,pz:De}=U;let Ue=n.ZERO,Ve=n.ZERO,pe=n.ZERO;const Se=e.a,Ce=n.mul(e.b,Lk);let je=n.mul(V,ce),$e=n.mul(J,Re),Qe=n.mul(re,De),nt=n.add(V,J),Ne=n.add(ce,Re);nt=n.mul(nt,Ne),Ne=n.add(je,$e),nt=n.sub(nt,Ne),Ne=n.add(V,re);let Me=n.add(ce,De);return Ne=n.mul(Ne,Me),Me=n.add(je,Qe),Ne=n.sub(Ne,Me),Me=n.add(J,re),Ue=n.add(Re,De),Me=n.mul(Me,Ue),Ue=n.add($e,Qe),Me=n.sub(Me,Ue),pe=n.mul(Se,Ne),Ue=n.mul(Ce,Qe),pe=n.add(Ue,pe),Ue=n.sub($e,pe),pe=n.add($e,pe),Ve=n.mul(Ue,pe),$e=n.add(je,je),$e=n.add($e,je),Qe=n.mul(Se,Qe),Ne=n.mul(Ce,Ne),$e=n.add($e,Qe),Qe=n.sub(je,Qe),Qe=n.mul(Se,Qe),Ne=n.add(Ne,Qe),je=n.mul($e,Ne),Ve=n.add(Ve,je),je=n.mul(Me,Ne),Ue=n.mul(nt,Ue),Ue=n.sub(Ue,je),je=n.mul(nt,$e),pe=n.mul(Me,pe),pe=n.add(pe,je),new A(Ue,Ve,pe)}subtract(U){return this.add(U.negate())}is0(){return this.equals(A.ZERO)}wNAF(U){return P.wNAFCached(this,g,U,V=>{const J=n.invertBatch(V.map(re=>re.pz));return V.map((re,ce)=>re.toAffine(J[ce])).map(A.fromAffine)})}multiplyUnsafe(U){const V=A.ZERO;if(U===rh)return V;if(u(U),U===_a)return this;const{endo:J}=e;if(!J)return P.unsafeLadder(this,U);let{k1neg:re,k1:ce,k2neg:Re,k2:De}=J.splitScalar(U),Ue=V,Ve=V,pe=this;for(;ce>rh||De>rh;)ce&_a&&(Ue=Ue.add(pe)),De&_a&&(Ve=Ve.add(pe)),pe=pe.double(),ce>>=_a,De>>=_a;return re&&(Ue=Ue.negate()),Re&&(Ve=Ve.negate()),Ve=new A(n.mul(Ve.px,J.beta),Ve.py,Ve.pz),Ue.add(Ve)}multiply(U){u(U);let V=U,J,re;const{endo:ce}=e;if(ce){const{k1neg:Re,k1:De,k2neg:Ue,k2:Ve}=ce.splitScalar(V);let{p:pe,f:Se}=this.wNAF(De),{p:Ce,f:je}=this.wNAF(Ve);pe=P.constTimeNegate(Re,pe),Ce=P.constTimeNegate(Ue,Ce),Ce=new A(n.mul(Ce.px,ce.beta),Ce.py,Ce.pz),J=pe.add(Ce),re=Se.add(je)}else{const{p:Re,f:De}=this.wNAF(V);J=Re,re=De}return A.normalizeZ([J,re])[0]}multiplyAndAddUnsafe(U,V,J){const re=A.BASE,ce=(De,Ue)=>Ue===rh||Ue===_a||!De.equals(re)?De.multiplyUnsafe(Ue):De.multiply(Ue),Re=ce(this,V).add(ce(U,J));return Re.is0()?void 0:Re}toAffine(U){const{px:V,py:J,pz:re}=this,ce=this.is0();U==null&&(U=ce?n.ONE:n.inv(re));const Re=n.mul(V,U),De=n.mul(J,U),Ue=n.mul(re,U);if(ce)return{x:n.ZERO,y:n.ZERO};if(!n.eql(Ue,n.ONE))throw new Error("invZ was invalid");return{x:Re,y:De}}isTorsionFree(){const{h:U,isTorsionFree:V}=e;if(U===_a)return!0;if(V)return V(A,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:U,clearCofactor:V}=e;return U===_a?this:V?V(A,this):this.multiplyUnsafe(e.h)}toRawBytes(U=!0){return this.assertValidity(),i(A,this,U)}toHex(U=!0){return Fw(this.toRawBytes(U))}}A.BASE=new A(e.Gx,e.Gy,n.ONE),A.ZERO=new A(n.ZERO,n.ONE,n.ZERO);const I=e.nBitLength,P=Gbe(A,e.endo?Math.ceil(I/2):I);return{CURVE:e,ProjectivePoint:A,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}function Jbe(r){const e=Qq(r);return fE(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Qbe(r){const e=Jbe(r),{Fp:n,n:i}=e,s=n.BYTES+1,o=2*n.BYTES+1;function a(Ne){return rh<Ne&&Ne<n.ORDER}function u(Ne){return yc(Ne,i)}function l(Ne){return Mk(Ne,i)}const{ProjectivePoint:g,normPrivateKeyToScalar:y,weierstrassEquation:A,isWithinCurveOrder:I}=Xbe({...e,toBytes(Ne,Me,ct){const mt=Me.toAffine(),Bt=n.toBytes(mt.x),er=lE;return ct?er(Uint8Array.from([Me.hasEvenY()?2:3]),Bt):er(Uint8Array.from([4]),Bt,n.toBytes(mt.y))},fromBytes(Ne){const Me=Ne.length,ct=Ne[0],mt=Ne.subarray(1);if(Me===s&&(ct===2||ct===3)){const Bt=Vb(mt);if(!a(Bt))throw new Error("Point is not on curve");const er=A(Bt);let cr=n.sqrt(er);const pr=(cr&_a)===_a;return(ct&1)===1!==pr&&(cr=n.neg(cr)),{x:Bt,y:cr}}else if(Me===o&&ct===4){const Bt=n.fromBytes(mt.subarray(0,n.BYTES)),er=n.fromBytes(mt.subarray(n.BYTES,2*n.BYTES));return{x:Bt,y:er}}else throw new Error(`Point of length ${Me} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}}),P=Ne=>Fw(Hw(Ne,e.nByteLength));function D(Ne){const Me=i>>_a;return Ne>Me}function U(Ne){return D(Ne)?u(-Ne):Ne}const V=(Ne,Me,ct)=>Vb(Ne.slice(Me,ct));class J{constructor(Me,ct,mt){this.r=Me,this.s=ct,this.recovery=mt,this.assertValidity()}static fromCompact(Me){const ct=e.nByteLength;return Me=th("compactSignature",Me,ct*2),new J(V(Me,0,ct),V(Me,ct,2*ct))}static fromDER(Me){const{r:ct,s:mt}=jb.toSig(th("DER",Me));return new J(ct,mt)}assertValidity(){if(!I(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!I(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Me){return new J(this.r,this.s,Me)}recoverPublicKey(Me){const{r:ct,s:mt,recovery:Bt}=this,er=Ve(th("msgHash",Me));if(Bt==null||![0,1,2,3].includes(Bt))throw new Error("recovery id invalid");const cr=Bt===2||Bt===3?ct+e.n:ct;if(cr>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const pr=Bt&1?"03":"02",Dr=g.fromHex(pr+P(cr)),Rr=l(cr),Pr=u(-er*Rr),on=u(mt*Rr),xn=g.BASE.multiplyAndAddUnsafe(Dr,Pr,on);if(!xn)throw new Error("point at infinify");return xn.assertValidity(),xn}hasHighS(){return D(this.s)}normalizeS(){return this.hasHighS()?new J(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return Ww(this.toDERHex())}toDERHex(){return jb.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ww(this.toCompactHex())}toCompactHex(){return P(this.r)+P(this.s)}}const re={isValidPrivateKey(Ne){try{return y(Ne),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const Ne=Jq(e.n);return jbe(e.randomBytes(Ne),e.n)},precompute(Ne=8,Me=g.BASE){return Me._setWindowSize(Ne),Me.multiply(BigInt(3)),Me}};function ce(Ne,Me=!0){return g.fromPrivateKey(Ne).toRawBytes(Me)}function Re(Ne){const Me=Ne instanceof Uint8Array,ct=typeof Ne=="string",mt=(Me||ct)&&Ne.length;return Me?mt===s||mt===o:ct?mt===2*s||mt===2*o:Ne instanceof g}function De(Ne,Me,ct=!0){if(Re(Ne))throw new Error("first arg must be private key");if(!Re(Me))throw new Error("second arg must be public key");return g.fromHex(Me).multiply(y(Ne)).toRawBytes(ct)}const Ue=e.bits2int||function(Ne){const Me=Vb(Ne),ct=Ne.length*8-e.nBitLength;return ct>0?Me>>BigInt(ct):Me},Ve=e.bits2int_modN||function(Ne){return u(Ue(Ne))},pe=O8(e.nBitLength);function Se(Ne){if(typeof Ne!="bigint")throw new Error("bigint expected");if(!(rh<=Ne&&Ne<pe))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Hw(Ne,e.nByteLength)}function Ce(Ne,Me,ct=je){if(["recovered","canonical"].some(Xr=>Xr in ct))throw new Error("sign() legacy options not supported");const{hash:mt,randomBytes:Bt}=e;let{lowS:er,prehash:cr,extraEntropy:pr}=ct;er==null&&(er=!0),Ne=th("msgHash",Ne),cr&&(Ne=th("prehashed msgHash",mt(Ne)));const Dr=Ve(Ne),Rr=y(Me),Pr=[Se(Rr),Se(Dr)];if(pr!=null){const Xr=pr===!0?Bt(n.BYTES):pr;Pr.push(th("extraEntropy",Xr))}const on=lE(...Pr),xn=Dr;function Ar(Xr){const Tn=Ue(Xr);if(!I(Tn))return;const Bn=l(Tn),ni=g.BASE.multiply(Tn).toAffine(),en=u(ni.x);if(en===rh)return;const si=u(Bn*u(xn+en*Rr));if(si===rh)return;let ei=(ni.x===en?0:2)|Number(ni.y&_a),Ia=si;return er&&D(si)&&(Ia=U(si),ei^=1),new J(en,Ia,ei)}return{seed:on,k2sig:Ar}}const je={lowS:e.lowS,prehash:!1},$e={lowS:e.lowS,prehash:!1};function Qe(Ne,Me,ct=je){const{seed:mt,k2sig:Bt}=Ce(Ne,Me,ct),er=e;return qq(er.hash.outputLen,er.nByteLength,er.hmac)(mt,Bt)}g.BASE._setWindowSize(8);function nt(Ne,Me,ct,mt=$e){const Bt=Ne;if(Me=th("msgHash",Me),ct=th("publicKey",ct),"strict"in mt)throw new Error("options.strict was renamed to lowS");const{lowS:er,prehash:cr}=mt;let pr,Dr;try{if(typeof Bt=="string"||Bt instanceof Uint8Array)try{pr=J.fromDER(Bt)}catch(ni){if(!(ni instanceof jb.Err))throw ni;pr=J.fromCompact(Bt)}else if(typeof Bt=="object"&&typeof Bt.r=="bigint"&&typeof Bt.s=="bigint"){const{r:ni,s:en}=Bt;pr=new J(ni,en)}else throw new Error("PARSE");Dr=g.fromHex(ct)}catch(ni){if(ni.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(er&&pr.hasHighS())return!1;cr&&(Me=e.hash(Me));const{r:Rr,s:Pr}=pr,on=Ve(Me),xn=l(Pr),Ar=u(on*xn),Xr=u(Rr*xn),Tn=g.BASE.multiplyAndAddUnsafe(Dr,Ar,Xr)?.toAffine();return Tn?u(Tn.x)===Rr:!1}return{CURVE:e,getPublicKey:ce,getSharedSecret:De,sign:Qe,verify:nt,ProjectivePoint:g,Signature:J,utils:re}}function e1e(r,e){const n=r.ORDER;let i=rh;for(let D=n-_a;D%Py===rh;D/=Py)i+=_a;const s=i,o=Py<<s-_a-_a,a=o*Py,u=(n-_a)/a,l=(u-_a)/Py,g=a-_a,y=o,A=r.pow(e,u),I=r.pow(e,(u+_a)/Py);let P=(D,U)=>{let V=A,J=r.pow(U,g),re=r.sqr(J);re=r.mul(re,U);let ce=r.mul(D,re);ce=r.pow(ce,l),ce=r.mul(ce,J),J=r.mul(ce,U),re=r.mul(ce,D);let Re=r.mul(re,J);ce=r.pow(Re,y);let De=r.eql(ce,r.ONE);J=r.mul(re,I),ce=r.mul(Re,V),re=r.cmov(J,re,De),Re=r.cmov(ce,Re,De);for(let Ue=s;Ue>_a;Ue--){let Ve=Ue-Py;Ve=Py<<Ve-_a;let pe=r.pow(Re,Ve);const Se=r.eql(pe,r.ONE);J=r.mul(re,V),V=r.mul(V,V),pe=r.mul(Re,V),re=r.cmov(J,re,Se),Re=r.cmov(pe,Re,Se)}return{isValid:De,value:re}};if(r.ORDER%eZ===Lk){const D=(r.ORDER-Lk)/eZ,U=r.sqrt(r.neg(e));P=(V,J)=>{let re=r.sqr(J);const ce=r.mul(V,J);re=r.mul(re,ce);let Re=r.pow(re,D);Re=r.mul(Re,ce);const De=r.mul(Re,U),Ue=r.mul(r.sqr(Re),J),Ve=r.eql(Ue,V);let pe=r.cmov(De,Re,Ve);return{isValid:Ve,value:pe}}}return P}function eXe(r,e){if(mod.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=e1e(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return i=>{let s,o,a,u,l,g,y,A;s=r.sqr(i),s=r.mul(s,e.Z),o=r.sqr(s),o=r.add(o,s),a=r.add(o,r.ONE),a=r.mul(a,e.B),u=r.cmov(e.Z,r.neg(o),!r.eql(o,r.ZERO)),u=r.mul(u,e.A),o=r.sqr(a),g=r.sqr(u),l=r.mul(g,e.A),o=r.add(o,l),o=r.mul(o,a),g=r.mul(g,u),l=r.mul(g,e.B),o=r.add(o,l),y=r.mul(s,a);const{isValid:I,value:P}=n(o,g);A=r.mul(s,i),A=r.mul(A,P),y=r.cmov(y,a,I),A=r.cmov(A,P,I);const D=r.isOdd(i)===r.isOdd(A);return A=r.cmov(r.neg(A),A,D),y=r.div(y,u),{x:y,y:A}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function t1e(r){return{hash:r,hmac:(e,...n)=>Rk(r,e,Lme(...n)),randomBytes:Ume}}function r1e(r,e){const n=i=>Qbe({...r,...t1e(i)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Dk=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uk=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tZ=BigInt(1),Fk=BigInt(2),rZ=(r,e)=>(r+e/Fk)/e;function nZ(r){const e=Dk,n=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),u=BigInt(44),l=BigInt(88),g=r*r*r%e,y=g*g*r%e,A=Xf(y,n,e)*y%e,I=Xf(A,n,e)*y%e,P=Xf(I,Fk,e)*g%e,D=Xf(P,s,e)*P%e,U=Xf(D,o,e)*D%e,V=Xf(U,u,e)*U%e,J=Xf(V,l,e)*V%e,re=Xf(J,u,e)*U%e,ce=Xf(re,n,e)*y%e,Re=Xf(ce,a,e)*D%e,De=Xf(Re,i,e)*g%e,Ue=Xf(De,Fk,e);if(!D8.eql(D8.sqr(Ue),r))throw new Error("Cannot find square root");return Ue}const D8=Vbe(Dk,void 0,void 0,{sqrt:nZ}),Rp=r1e({a:BigInt(0),b:BigInt(7),Fp:D8,n:Uk,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=Uk,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-tZ*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),u=rZ(o*r,e),l=rZ(-i*r,e);let g=yc(r-u*n-l*s,e),y=yc(-u*i-l*o,e);const A=g>a,I=y>a;if(A&&(g=e-g),I&&(y=e-y),g>a||y>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:A,k1:g,k2neg:I,k2:y}}}},Uw),Wk=BigInt(0),iZ=r=>typeof r=="bigint"&&Wk<r&&r<Dk,n1e=r=>typeof r=="bigint"&&Wk<r&&r<Uk,sZ=null;function U8(r,...e){let n=sZ[r];if(n===void 0){const i=sha256(Uint8Array.from(r,s=>s.charCodeAt(0)));n=concatBytes(i,i),sZ[r]=n}return sha256(concatBytes(n,...e))}const oZ=r=>r.toRawBytes(!0).slice(1),F8=r=>numberToBytesBE(r,32),W8=r=>mod(r,Dk),dE=r=>mod(r,Uk),H8=Rp.ProjectivePoint,i1e=(r,e,n)=>H8.BASE.multiplyAndAddUnsafe(r,e,n);function z8(r){let e=Rp.utils.normPrivateKeyToScalar(r),n=H8.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:dE(-e),bytes:oZ(n)}}function s1e(r){if(!iZ(r))throw new Error("bad x: need 0 < x < p");const e=W8(r*r),n=W8(e*r+BigInt(7));let i=nZ(n);i%Fk!==Wk&&(i=W8(-i));const s=new H8(r,i,tZ);return s.assertValidity(),s}function aZ(...r){return dE(bytesToNumberBE(U8("BIP0340/challenge",...r)))}function tXe(r){return z8(r).bytes}function rXe(r,e,n=randomBytes(32)){const i=ensureBytes("message",r),{bytes:s,scalar:o}=z8(e),a=ensureBytes("auxRand",n,32),u=F8(o^bytesToNumberBE(U8("BIP0340/aux",a))),l=U8("BIP0340/nonce",u,s,i),g=dE(bytesToNumberBE(l));if(g===Wk)throw new Error("sign failed: k is zero");const{bytes:y,scalar:A}=z8(g),I=aZ(y,s,i),P=new Uint8Array(64);if(P.set(y,0),P.set(F8(dE(A+I*o)),32),!o1e(P,i,s))throw new Error("sign: Invalid signature produced");return P}function o1e(r,e,n){const i=ensureBytes("signature",r,64),s=ensureBytes("message",e),o=ensureBytes("publicKey",n,32);try{const a=s1e(bytesToNumberBE(o)),u=bytesToNumberBE(i.subarray(0,32));if(!iZ(u))return!1;const l=bytesToNumberBE(i.subarray(32,64));if(!n1e(l))return!1;const g=aZ(F8(u),oZ(a),s),y=i1e(a,l,dE(-g));return!(!y||!y.hasEvenY()||y.toAffine().x!==u)}catch{return!1}}const nXe=null,iXe=null,sXe=null,oXe=null,aXe=null,uXe=null;class $u{#e;constructor(e){xr(aE(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=jn(e)}get privateKey(){return this.#e}get publicKey(){return $u.computePublicKey(this.#e)}get compressedPublicKey(){return $u.computePublicKey(this.#e,!0)}sign(e){xr(aE(e)===32,"invalid digest length","digest",e);const n=Rp.sign(hc(e),hc(this.#e),{lowS:!0});return ca.from({r:eh(n.r,32),s:eh(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=$u.computePublicKey(e);return jn(Rp.getSharedSecret(hc(this.#e),hi(n),!1))}static computePublicKey(e,n){let i=hi(e,"key");if(i.length===32){const o=Rp.getPublicKey(i,!!n);return jn(o)}if(i.length===64){const o=new Uint8Array(65);o[0]=4,o.set(i,1),i=o}const s=Rp.ProjectivePoint.fromHex(i);return jn(s.toRawBytes(n))}static recoverPublicKey(e,n){xr(aE(e)===32,"invalid digest length","digest",e);const i=ca.from(n);let s=Rp.Signature.fromCompact(hc(bo([i.r,i.s])));s=s.addRecoveryBit(i.yParity);const o=s.recoverPublicKey(hc(e));return xr(o!=null,"invalid signautre for digest","signature",n),"0x"+o.toHex(!1)}static addPoints(e,n,i){const s=Rp.ProjectivePoint.fromHex($u.computePublicKey(e).substring(2)),o=Rp.ProjectivePoint.fromHex($u.computePublicKey(n).substring(2));return"0x"+s.add(o).toHex(!!i)}}function Hk(r){let e;return typeof r=="string"?e=$u.computePublicKey(r,!1):e=r.publicKey,Ol(Ss("0x"+e.substring(4)).substring(26))}function zw(r,e){return Hk($u.recoverPublicKey(r,e))}const Gc=32,$8=new Uint8Array(Gc),a1e=["then"],zk={},uZ=new WeakMap;function Kb(r){return uZ.get(r)}function cZ(r,e){uZ.set(r,e)}function hE(r,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw n.error=e,n}function V8(r,e,n){return r.indexOf(null)>=0?e.map((i,s)=>i instanceof Cp?V8(Kb(i),i,n):i):r.reduce((i,s,o)=>{let a=e.getValue(s);return s in i||(n&&a instanceof Cp&&(a=V8(Kb(a),a,n)),i[s]=a),i},{})}class Cp extends Array{#e;constructor(...e){const n=e[0];let i=e[1],s=(e[2]||[]).slice(),o=!0;n!==zk&&(i=e,s=[],o=!1),super(i.length),i.forEach((l,g)=>{this[g]=l});const a=s.reduce((l,g)=>(typeof g=="string"&&l.set(g,(l.get(g)||0)+1),l),new Map);if(cZ(this,Object.freeze(i.map((l,g)=>{const y=s[g];return y!=null&&a.get(y)===1?y:null}))),this.#e=[],this.#e==null&&this.#e,!o)return;Object.freeze(this);const u=new Proxy(this,{get:(l,g,y)=>{if(typeof g=="string"){if(g.match(/^[0-9]+$/)){const I=zu(g,"%index");if(I<0||I>=this.length)throw new RangeError("out of result range");const P=l[I];return P instanceof Error&&hE(`index ${I}`,P),P}if(a1e.indexOf(g)>=0)return Reflect.get(l,g,y);const A=l[g];if(A instanceof Function)return function(...I){return A.apply(this===y?l:this,I)};if(!(g in l))return l.getValue.apply(this===y?l:this,[g])}return Reflect.get(l,g,y)}});return cZ(u,Kb(this)),u}toArray(e){const n=[];return this.forEach((i,s)=>{i instanceof Error&&hE(`index ${s}`,i),e&&i instanceof Cp&&(i=i.toArray(e)),n.push(i)}),n}toObject(e){const n=Kb(this);return n.reduce((i,s,o)=>(Ei(s!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),V8(n,this,e)),{})}slice(e,n){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=Kb(this),s=[],o=[];for(let a=e;a<n;a++)s.push(this[a]),o.push(i[a]);return new Cp(zk,s,o)}filter(e,n){const i=Kb(this),s=[],o=[];for(let a=0;a<this.length;a++){const u=this[a];u instanceof Error&&hE(`index ${a}`,u),e.call(n,u,a,this)&&(s.push(u),o.push(i[a]))}return new Cp(zk,s,o)}map(e,n){const i=[];for(let s=0;s<this.length;s++){const o=this[s];o instanceof Error&&hE(`index ${s}`,o),i.push(e.call(n,o,s,this))}return i}getValue(e){const n=Kb(this).indexOf(e);if(n===-1)return;const i=this[n];return i instanceof Error&&hE(`property ${JSON.stringify(e)}`,i.error),i}static fromItems(e,n){return new Cp(zk,e,n)}}function cXe(r){const e=[],n=function(i,s){if(Array.isArray(s))for(let o in s){const a=i.slice();a.push(o);try{n(a,s[o])}catch(u){e.push({path:a,error:u})}}};return n([],r),e}function lZ(r){let e=jc(r);return Ei(e.length<=Gc,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Gc,offset:e.length}),e.length!==Gc&&(e=hc(bo([$8.slice(e.length%Gc),e]))),e}class xp{name;type;localName;dynamic;constructor(e,n,i,s){Ki(this,{name:e,type:n,localName:i,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){xr(!1,e,this.localName,n)}}class j8{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return bo(this.#e)}get length(){return this.#t}#r(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#r(hc(e.data))}writeBytes(e){let n=hc(e);const i=n.length%Gc;return i&&(n=hc(bo([n,$8.slice(i)]))),this.#r(n)}writeValue(e){return this.#r(lZ(e))}writeUpdatableValue(){const e=this.#e.length;return this.#e.push($8),this.#t+=Gc,n=>{this.#e[e]=lZ(n)}}}class K8{allowLoose;#e;#t;#r;#n;#i;constructor(e,n,i){Ki(this,{allowLoose:!!n}),this.#e=hc(e),this.#r=0,this.#n=null,this.#i=i??1024,this.#t=0}get data(){return jn(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#s(e){if(this.#n)return this.#n.#s(e);this.#r+=e,Ei(this.#i<1||this.#r<=this.#i*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#i} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:hc(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#a(e,n,i){let s=Math.ceil(n/Gc)*Gc;return this.#t+s>this.#e.length&&(this.allowLoose&&i&&this.#t+n<=this.#e.length?s=n:Ei(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:hc(this.#e),length:this.#e.length,offset:this.#t+s})),this.#e.slice(this.#t,this.#t+s)}subReader(e){const n=new K8(this.#e.slice(this.#t+e),this.allowLoose,this.#i);return n.#n=this,n}readBytes(e,n){let i=this.#a(0,e,!!n);return this.#s(e),this.#t+=i.length,i.slice(0,e)}readValue(){return Ek(this.readBytes(Gc))}readIndex(){return Ome(this.readBytes(Gc))}}const nh={};function fi(r,e){let n=!1;return e<0&&(n=!0,e*=-1),new Ea(nh,`${n?"":"u"}int${e}`,r,{signed:n,width:e})}function Js(r,e){return new Ea(nh,`bytes${e||""}`,r,{size:e})}const fZ=Symbol.for("_ethers_typed");class Ea{type;value;#e;_typedSymbol;constructor(e,n,i,s){s==null&&(s=null),Ip(nh,e,"Typed"),Ki(this,{_typedSymbol:fZ,type:n,value:i}),this.#e=s,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,n){return new Ea(nh,e,n)}static uint8(e){return fi(e,8)}static uint16(e){return fi(e,16)}static uint24(e){return fi(e,24)}static uint32(e){return fi(e,32)}static uint40(e){return fi(e,40)}static uint48(e){return fi(e,48)}static uint56(e){return fi(e,56)}static uint64(e){return fi(e,64)}static uint72(e){return fi(e,72)}static uint80(e){return fi(e,80)}static uint88(e){return fi(e,88)}static uint96(e){return fi(e,96)}static uint104(e){return fi(e,104)}static uint112(e){return fi(e,112)}static uint120(e){return fi(e,120)}static uint128(e){return fi(e,128)}static uint136(e){return fi(e,136)}static uint144(e){return fi(e,144)}static uint152(e){return fi(e,152)}static uint160(e){return fi(e,160)}static uint168(e){return fi(e,168)}static uint176(e){return fi(e,176)}static uint184(e){return fi(e,184)}static uint192(e){return fi(e,192)}static uint200(e){return fi(e,200)}static uint208(e){return fi(e,208)}static uint216(e){return fi(e,216)}static uint224(e){return fi(e,224)}static uint232(e){return fi(e,232)}static uint240(e){return fi(e,240)}static uint248(e){return fi(e,248)}static uint256(e){return fi(e,256)}static uint(e){return fi(e,256)}static int8(e){return fi(e,-8)}static int16(e){return fi(e,-16)}static int24(e){return fi(e,-24)}static int32(e){return fi(e,-32)}static int40(e){return fi(e,-40)}static int48(e){return fi(e,-48)}static int56(e){return fi(e,-56)}static int64(e){return fi(e,-64)}static int72(e){return fi(e,-72)}static int80(e){return fi(e,-80)}static int88(e){return fi(e,-88)}static int96(e){return fi(e,-96)}static int104(e){return fi(e,-104)}static int112(e){return fi(e,-112)}static int120(e){return fi(e,-120)}static int128(e){return fi(e,-128)}static int136(e){return fi(e,-136)}static int144(e){return fi(e,-144)}static int152(e){return fi(e,-152)}static int160(e){return fi(e,-160)}static int168(e){return fi(e,-168)}static int176(e){return fi(e,-176)}static int184(e){return fi(e,-184)}static int192(e){return fi(e,-192)}static int200(e){return fi(e,-200)}static int208(e){return fi(e,-208)}static int216(e){return fi(e,-216)}static int224(e){return fi(e,-224)}static int232(e){return fi(e,-232)}static int240(e){return fi(e,-240)}static int248(e){return fi(e,-248)}static int256(e){return fi(e,-256)}static int(e){return fi(e,-256)}static bytes1(e){return Js(e,1)}static bytes2(e){return Js(e,2)}static bytes3(e){return Js(e,3)}static bytes4(e){return Js(e,4)}static bytes5(e){return Js(e,5)}static bytes6(e){return Js(e,6)}static bytes7(e){return Js(e,7)}static bytes8(e){return Js(e,8)}static bytes9(e){return Js(e,9)}static bytes10(e){return Js(e,10)}static bytes11(e){return Js(e,11)}static bytes12(e){return Js(e,12)}static bytes13(e){return Js(e,13)}static bytes14(e){return Js(e,14)}static bytes15(e){return Js(e,15)}static bytes16(e){return Js(e,16)}static bytes17(e){return Js(e,17)}static bytes18(e){return Js(e,18)}static bytes19(e){return Js(e,19)}static bytes20(e){return Js(e,20)}static bytes21(e){return Js(e,21)}static bytes22(e){return Js(e,22)}static bytes23(e){return Js(e,23)}static bytes24(e){return Js(e,24)}static bytes25(e){return Js(e,25)}static bytes26(e){return Js(e,26)}static bytes27(e){return Js(e,27)}static bytes28(e){return Js(e,28)}static bytes29(e){return Js(e,29)}static bytes30(e){return Js(e,30)}static bytes31(e){return Js(e,31)}static bytes32(e){return Js(e,32)}static address(e){return new Ea(nh,"address",e)}static bool(e){return new Ea(nh,"bool",!!e)}static bytes(e){return new Ea(nh,"bytes",e)}static string(e){return new Ea(nh,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new Ea(nh,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===fZ}static dereference(e,n){if(Ea.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}}class u1e extends xp{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let i=Ea.dereference(n,"string");try{i=Ol(i)}catch(s){return this._throwError(s.message,n)}return e.writeValue(i)}decode(e){return Ol(eh(e.readValue(),20))}}class c1e extends xp{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,n){return this.coder.encode(e,n)}decode(e){return this.coder.decode(e)}}function dZ(r,e,n){let i=[];if(Array.isArray(n))i=n;else if(n&&typeof n=="object"){let l={};i=e.map(g=>{const y=g.localName;return Ei(y,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:g},value:n}),Ei(!l[y],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:g},value:n}),l[y]=!0,n[y]})}else xr(!1,"invalid tuple value","tuple",n);xr(e.length===i.length,"types/value length mismatch","tuple",n);let s=new j8,o=new j8,a=[];e.forEach((l,g)=>{let y=i[g];if(l.dynamic){let A=o.length;l.encode(o,y);let I=s.writeUpdatableValue();a.push(P=>{I(P+A)})}else l.encode(s,y)}),a.forEach(l=>{l(s.length)});let u=r.appendWriter(s);return u+=r.appendWriter(o),u}function hZ(r,e){let n=[],i=[],s=r.subReader(0);return e.forEach(o=>{let a=null;if(o.dynamic){let u=r.readIndex(),l=s.subReader(u);try{a=o.decode(l)}catch(g){if(vk(g,"BUFFER_OVERRUN"))throw g;a=g,a.baseType=o.name,a.name=o.localName,a.type=o.type}}else try{a=o.decode(r)}catch(u){if(vk(u,"BUFFER_OVERRUN"))throw u;a=u,a.baseType=o.name,a.name=o.localName,a.type=o.type}if(a==null)throw new Error("investigate");n.push(a),i.push(o.localName||null)}),Cp.fromItems(n,i)}class l1e extends xp{coder;length;constructor(e,n,i){const s=e.type+"["+(n>=0?n:"")+"]",o=n===-1||e.dynamic;super("array",s,i,o),Ki(this,{coder:e,length:n})}defaultValue(){const e=this.coder.defaultValue(),n=[];for(let i=0;i<this.length;i++)n.push(e);return n}encode(e,n){const i=Ea.dereference(n,"array");Array.isArray(i)||this._throwError("expected array value",i);let s=this.length;s===-1&&(s=i.length,e.writeValue(i.length)),WG(i.length,s,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<i.length;a++)o.push(this.coder);return dZ(e,o,i)}decode(e){let n=this.length;n===-1&&(n=e.readIndex(),Ei(n*Gc<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:n*Gc,length:e.dataLength}));let i=[];for(let s=0;s<n;s++)i.push(new c1e(this.coder));return hZ(e,i)}}class f1e extends xp{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,n){const i=Ea.dereference(n,"bool");return e.writeValue(i?1:0)}decode(e){return!!e.readValue()}}class pZ extends xp{constructor(e,n){super(e,e,n,!0)}defaultValue(){return"0x"}encode(e,n){n=hc(n);let i=e.writeValue(n.length);return i+=e.writeBytes(n),i}decode(e){return e.readBytes(e.readIndex(),!0)}}class d1e extends pZ{constructor(e){super("bytes",e)}decode(e){return jn(super.decode(e))}}class h1e extends xp{size;constructor(e,n){let i="bytes"+String(e);super(i,i,n,!1),Ki(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,n){let i=hc(Ea.dereference(n,this.type));return i.length!==this.size&&this._throwError("incorrect data length",n),e.writeBytes(i)}decode(e){return jn(e.readBytes(this.size))}}const p1e=new Uint8Array([]);class g1e extends xp{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(p1e)}decode(e){return e.readBytes(0),null}}const y1e=BigInt(0),m1e=BigInt(1),b1e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class v1e extends xp{size;signed;constructor(e,n,i){const s=(n?"int":"uint")+e*8;super(s,s,i,!1),Ki(this,{size:e,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,n){let i=lo(Ea.dereference(n,this.type)),s=Mw(b1e,Gc*8);if(this.signed){let o=Mw(s,this.size*8-1);(i>o||i<-(o+m1e))&&this._throwError("value out-of-bounds",n),i=g8(i,8*Gc)}else(i<y1e||i>Mw(s,this.size*8))&&this._throwError("value out-of-bounds",n);return e.writeValue(i)}decode(e){let n=Mw(e.readValue(),this.size*8);return this.signed&&(n=Bme(n,this.size*8)),n}}class w1e extends pZ{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,Kc(Ea.dereference(n,"string")))}decode(e){return kq(super.decode(e))}}class $k extends xp{coders;constructor(e,n){let i=!1;const s=[];e.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i),Ki(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(i=>{e.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),e[o]==null&&(e[o]=e[s]))}),Object.freeze(e)}encode(e,n){const i=Ea.dereference(n,"tuple");return dZ(e,this.coders,i)}decode(e){return hZ(e,this.coders)}}function qc(r){const e=new Set;return r.forEach(n=>e.add(n)),Object.freeze(e)}const A1e=qc("external public payable override".split(" ")),gZ="constant external internal payable private public pure view override",_1e=qc(gZ.split(" ")),yZ="constructor error event fallback function receive struct",mZ=qc(yZ.split(" ")),bZ="calldata memory storage payable indexed",E1e=qc(bZ.split(" ")),T1e=[yZ,bZ,"tuple returns",gZ].join(" "),S1e=qc(T1e.split(" ")),I1e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},k1e=new RegExp("^(\\s*)"),R1e=new RegExp("^([0-9]+)"),C1e=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),vZ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),wZ=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class Jf{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new Jf(this.#t)}reset(){this.#e=0}#r(e=0,n=0){return new Jf(this.#t.slice(e,n).map(i=>Object.freeze(Object.assign({},i,{match:i.match-e,linkBack:i.linkBack-e,linkNext:i.linkNext-e}))))}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;this.#e<e.match-1;){const i=this.peek().linkNext;n.push(this.#r(this.#e+1,i)),this.#e=i}return this.#e=e.match+1,n}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return this.#e++,e}toString(){const e=[];for(let n=this.#e;n<this.#t.length;n++){const i=this.#t[n];e.push(`${i.type}:${i.text}`)}return`<TokenString ${e.join(" ")}>`}}function Ny(r){const e=[],n=a=>{const u=o<r.length?JSON.stringify(r[o]):"$EOI";throw new Error(`invalid token ${u} at ${o}: ${a}`)};let i=[],s=[],o=0;for(;o<r.length;){let a=r.substring(o),u=a.match(k1e);u&&(o+=u[1].length,a=r.substring(o));const l={depth:i.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:o,value:-1};e.push(l);let g=I1e[a[0]]||"";if(g){if(l.type=g,l.text=a[0],o++,g==="OPEN_PAREN")i.push(e.length-1),s.push(e.length-1);else if(g=="CLOSE_PAREN")i.length===0&&n("no matching open bracket"),l.match=i.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1;else if(g==="COMMA")l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(g==="OPEN_BRACKET")l.type="BRACKET";else if(g==="CLOSE_BRACKET"){let y=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const A=e.pop().text;y=A+y,e[e.length-1].value=zu(A)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=y}continue}if(u=a.match(C1e),u){if(l.text=u[1],o+=l.text.length,S1e.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(wZ)){l.type="TYPE";continue}l.type="ID";continue}if(u=a.match(R1e),u){l.text=u[1],l.type="NUMBER",o+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${o}`)}return new Jf(e.map(a=>Object.freeze(a)))}function AZ(r,e){let n=[];for(const i in e.keys())r.has(i)&&n.push(i);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function Vk(r,e){if(e.peekKeyword(mZ)){const n=e.pop().text;if(n!==r)throw new Error(`expected ${r}, got ${n}`)}return e.popType("ID")}function Bp(r,e){const n=new Set;for(;;){const i=r.peekType("KEYWORD");if(i==null||e&&!e.has(i))break;if(r.pop(),n.has(i))throw new Error(`duplicate keywords: ${JSON.stringify(i)}`);n.add(i)}return Object.freeze(n)}function _Z(r){let e=Bp(r,_1e);return AZ(e,qc("constant payable nonpayable".split(" "))),AZ(e,qc("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Op(r,e){return r.popParams().map(n=>jo.from(n,e))}function EZ(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return lo(r.pop().text);throw new Error("invalid gas")}return null}function Gb(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}const x1e=new RegExp(/^(.*)\[([0-9]*)\]$/);function TZ(r){const e=r.match(wZ);if(xr(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){const n=parseInt(e[2]);xr(n!==0&&n<=32,"invalid bytes length","type",r)}else if(e[3]){const n=parseInt(e[3]);xr(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",r)}return r}const la={},Pl=Symbol.for("_ethers_internal"),SZ="_ParamTypeInternal",IZ="_ErrorInternal",kZ="_EventInternal",RZ="_ConstructorInternal",CZ="_FallbackInternal",xZ="_FunctionInternal",BZ="_StructInternal";class jo{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,n,i,s,o,a,u,l){if(Ip(e,la,"ParamType"),Object.defineProperty(this,Pl,{value:SZ}),a&&(a=Object.freeze(a.slice())),s==="array"){if(u==null||l==null)throw new Error("")}else if(u!=null||l!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Ki(this,{name:n,type:i,baseType:s,indexed:o,components:a,arrayLength:u,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const i=this.name||"";if(this.isArray()){const o=JSON.parse(this.arrayChildren.format("json"));return o.name=i,o.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(o)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:i};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(o=>JSON.parse(o.format(e)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(i=>i.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const i=this;return e.map(s=>i.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const i=this;return e.map((s,o)=>i.components[o].walk(s,n))}return n(this.type,e)}#e(e,n,i,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,u=n.slice();u.forEach((l,g)=>{a.#e(e,l,i,y=>{u[g]=y})}),s(u);return}if(this.isTuple()){const a=this.components;let u;if(Array.isArray(n))u=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");u=a.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(u.length!==this.components.length)throw new Error("array is wrong length");u.forEach((l,g)=>{a[g].#e(e,l,i,y=>{u[g]=y})}),s(u);return}const o=i(this.type,n);o.then?e.push(async function(){s(await o)}()):s(o)}async walkAsync(e,n){const i=[],s=[e];return this.#e(i,e,n,o=>{s[0]=o}),i.length&&await Promise.all(i),s[0]}static from(e,n){if(jo.isParamType(e))return e;if(typeof e=="string")try{return jo.from(Ny(e),n)}catch{xr(!1,"invalid param type","obj",e)}else if(e instanceof Jf){let u="",l="",g=null;Bp(e,qc(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",g=e.popParams().map(U=>jo.from(U)),u=`tuple(${g.map(U=>U.format()).join(",")})`):(u=TZ(e.popType("TYPE")),l=u);let y=null,A=null;for(;e.length&&e.peekType("BRACKET");){const U=e.pop();y=new jo(la,"",u,l,null,g,A,y),A=U.value,u+=U.text,l="array",g=null}let I=null;if(Bp(e,E1e).has("indexed")){if(!n)throw new Error("");I=!0}const D=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new jo(la,D,u,l,I,g,A,y)}const i=e.name;xr(!i||typeof i=="string"&&i.match(vZ),"invalid name","obj.name",i);let s=e.indexed;s!=null&&(xr(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let o=e.type,a=o.match(x1e);if(a){const u=parseInt(a[2]||"-1"),l=jo.from({type:a[1],components:e.components});return new jo(la,i||"",o,"array",s,null,u,l)}if(o==="tuple"||o.startsWith("tuple(")||o.startsWith("(")){const u=e.components!=null?e.components.map(g=>jo.from(g)):null;return new jo(la,i||"",o,"tuple",s,u,null,null)}return o=TZ(e.type),new jo(la,i||"",o,o,s,null,null,null)}static isParamType(e){return e&&e[Pl]===SZ}}class $w{type;inputs;constructor(e,n,i){Ip(e,la,"Fragment"),i=Object.freeze(i.slice()),Ki(this,{type:n,inputs:i})}static from(e){if(typeof e=="string"){try{$w.from(JSON.parse(e))}catch{}return $w.from(Ny(e))}if(e instanceof Jf)switch(e.peekKeyword(mZ)){case"constructor":return Ly.from(e);case"error":return My.from(e);case"event":return Pp.from(e);case"fallback":case"receive":return Np.from(e);case"function":return Mp.from(e);case"struct":return qb.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Ly.from(e);case"error":return My.from(e);case"event":return Pp.from(e);case"fallback":case"receive":return Np.from(e);case"function":return Mp.from(e);case"struct":return qb.from(e)}Ei(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}xr(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Ly.isFragment(e)}static isError(e){return My.isFragment(e)}static isEvent(e){return Pp.isFragment(e)}static isFunction(e){return Mp.isFragment(e)}static isStruct(e){return qb.isFragment(e)}}class jk extends $w{name;constructor(e,n,i,s){super(e,n,s),xr(typeof i=="string"&&i.match(vZ),"invalid identifier","name",i),s=Object.freeze(s.slice()),Ki(this,{name:i})}}function pE(r,e){return"("+e.map(n=>n.format(r)).join(r==="full"?", ":",")+")"}class My extends jk{constructor(e,n,i){super(e,"error",n,i),Object.defineProperty(this,Pl,{value:IZ})}get selector(){return Bl(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+pE(e,this.inputs)),n.join(" ")}static from(e){if(My.isFragment(e))return e;if(typeof e=="string")return My.from(Ny(e));if(e instanceof Jf){const n=Vk("error",e),i=Op(e);return Gb(e),new My(la,n,i)}return new My(la,e.name,e.inputs?e.inputs.map(jo.from):[])}static isFragment(e){return e&&e[Pl]===IZ}}class Pp extends jk{anonymous;constructor(e,n,i,s){super(e,"event",n,i),Object.defineProperty(this,Pl,{value:kZ}),Ki(this,{anonymous:s})}get topicHash(){return Bl(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});const n=[];return e!=="sighash"&&n.push("event"),n.push(this.name+pE(e,this.inputs)),e!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(e,n){return n=(n||[]).map(s=>jo.from(s)),new Pp(la,e,n,!1).topicHash}static from(e){if(Pp.isFragment(e))return e;if(typeof e=="string")try{return Pp.from(Ny(e))}catch{xr(!1,"invalid event fragment","obj",e)}else if(e instanceof Jf){const n=Vk("event",e),i=Op(e,!0),s=!!Bp(e,qc(["anonymous"])).has("anonymous");return Gb(e),new Pp(la,n,i,s)}return new Pp(la,e.name,e.inputs?e.inputs.map(n=>jo.from(n,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[Pl]===kZ}}class Ly extends $w{payable;gas;constructor(e,n,i,s,o){super(e,n,i),Object.defineProperty(this,Pl,{value:RZ}),Ki(this,{payable:s,gas:o})}format(e){if(Ei(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});const n=[`constructor${pE(e,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(e){if(Ly.isFragment(e))return e;if(typeof e=="string")try{return Ly.from(Ny(e))}catch{xr(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Jf){Bp(e,qc(["constructor"]));const n=Op(e),i=!!Bp(e,A1e).has("payable"),s=EZ(e);return Gb(e),new Ly(la,"constructor",n,i,s)}return new Ly(la,"constructor",e.inputs?e.inputs.map(jo.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Pl]===RZ}}class Np extends $w{payable;constructor(e,n,i){super(e,"fallback",n),Object.defineProperty(this,Pl,{value:CZ}),Ki(this,{payable:i})}format(e){const n=this.inputs.length===0?"receive":"fallback";if(e==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(e){if(Np.isFragment(e))return e;if(typeof e=="string")try{return Np.from(Ny(e))}catch{xr(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Jf){const n=e.toString(),i=e.peekKeyword(qc(["fallback","receive"]));if(xr(i,"type must be fallback or receive","obj",n),e.popKeyword(qc(["fallback","receive"]))==="receive"){const u=Op(e);return xr(u.length===0,"receive cannot have arguments","obj.inputs",u),Bp(e,qc(["payable"])),Gb(e),new Np(la,[],!0)}let o=Op(e);o.length?xr(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(u=>u.format("minimal")).join(", ")):o=[jo.from("bytes")];const a=_Z(e);if(xr(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Bp(e,qc(["returns"])).has("returns")){const u=Op(e);xr(u.length===1&&u[0].type==="bytes","invalid fallback outputs","obj.outputs",u.map(l=>l.format("minimal")).join(", "))}return Gb(e),new Np(la,o,a==="payable")}if(e.type==="receive")return new Np(la,[],!0);if(e.type==="fallback"){const n=[jo.from("bytes")],i=e.stateMutability==="payable";return new Np(la,n,i)}xr(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[Pl]===CZ}}class Mp extends jk{constant;outputs;stateMutability;payable;gas;constructor(e,n,i,s,o,a){super(e,"function",n,s),Object.defineProperty(this,Pl,{value:xZ}),o=Object.freeze(o.slice()),Ki(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Bl(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e))),outputs:this.outputs.map(i=>JSON.parse(i.format(e)))});const n=[];return e!=="sighash"&&n.push("function"),n.push(this.name+pE(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(pE(e,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(e,n){return n=(n||[]).map(s=>jo.from(s)),new Mp(la,e,"view",n,[],null).selector}static from(e){if(Mp.isFragment(e))return e;if(typeof e=="string")try{return Mp.from(Ny(e))}catch{xr(!1,"invalid function fragment","obj",e)}else if(e instanceof Jf){const i=Vk("function",e),s=Op(e),o=_Z(e);let a=[];Bp(e,qc(["returns"])).has("returns")&&(a=Op(e));const u=EZ(e);return Gb(e),new Mp(la,i,o,s,a,u)}let n=e.stateMutability;return n==null&&(n="payable",typeof e.constant=="boolean"?(n="view",e.constant||(n="payable",typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable")),new Mp(la,e.name,n,e.inputs?e.inputs.map(jo.from):[],e.outputs?e.outputs.map(jo.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Pl]===xZ}}class qb extends jk{constructor(e,n,i){super(e,"struct",n,i),Object.defineProperty(this,Pl,{value:BZ})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return qb.from(Ny(e))}catch{xr(!1,"invalid struct fragment","obj",e)}else if(e instanceof Jf){const n=Vk("struct",e),i=Op(e);return Gb(e),new qb(la,n,i)}return new qb(la,e.name,e.inputs?e.inputs.map(jo.from):[])}static isFragment(e){return e&&e[Pl]===BZ}}const ih=new Map;ih.set(0,"GENERIC_PANIC"),ih.set(1,"ASSERT_FALSE"),ih.set(17,"OVERFLOW"),ih.set(18,"DIVIDE_BY_ZERO"),ih.set(33,"ENUM_RANGE_ERROR"),ih.set(34,"BAD_STORAGE_DATA"),ih.set(49,"STACK_UNDERFLOW"),ih.set(50,"ARRAY_RANGE_ERROR"),ih.set(65,"OUT_OF_MEMORY"),ih.set(81,"UNINITIALIZED_FUNCTION_CALL");const B1e=new RegExp(/^bytes([0-9]*)$/),O1e=new RegExp(/^(u?int)([0-9]*)$/);let G8=null,OZ=1024;function P1e(r,e,n,i){let s="missing revert data",o=null;const a=null;let u=null;if(n){s="execution reverted";const g=hi(n);if(n=jn(n),g.length===0)s+=" (no data present; likely require(false) occurred",o="require(false)";else if(g.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(jn(g.slice(0,4))==="0x08c379a0")try{o=i.decode(["string"],g.slice(4))[0],u={signature:"Error(string)",name:"Error",args:[o]},s+=`: ${JSON.stringify(o)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(jn(g.slice(0,4))==="0x4e487b71")try{const y=Number(i.decode(["uint256"],g.slice(4))[0]);u={signature:"Panic(uint256)",name:"Panic",args:[y]},o=`Panic due to ${ih.get(y)||"UNKNOWN"}(${y})`,s+=`: ${o}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const l={to:e.to?Ol(e.to):null,data:e.data||"0x"};return e.from&&(l.from=Ol(e.from)),p8(s,"CALL_EXCEPTION",{action:r,data:n,reason:o,transaction:l,invocation:a,revert:u})}class Lp{#e(e){if(e.isArray())return new l1e(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new $k(e.components.map(i=>this.#e(i)),e.name);switch(e.baseType){case"address":return new u1e(e.name);case"bool":return new f1e(e.name);case"string":return new w1e(e.name);case"bytes":return new d1e(e.name);case"":return new g1e(e.name)}let n=e.type.match(O1e);if(n){let i=parseInt(n[2]||"256");return xr(i!==0&&i<=256&&i%8===0,"invalid "+n[1]+" bit length","param",e),new v1e(i/8,n[1]==="int",e.name)}if(n=e.type.match(B1e),n){let i=parseInt(n[1]);return xr(i!==0&&i<=32,"invalid bytes length","param",e),new h1e(i,e.name)}xr(!1,"invalid type","type",e.type)}getDefaultValue(e){const n=e.map(s=>this.#e(jo.from(s)));return new $k(n,"_").defaultValue()}encode(e,n){WG(n.length,e.length,"types/values length mismatch");const i=e.map(a=>this.#e(jo.from(a))),s=new $k(i,"_"),o=new j8;return s.encode(o,n),o.data}decode(e,n,i){const s=e.map(a=>this.#e(jo.from(a)));return new $k(s,"_").decode(new K8(n,i,OZ))}static _setDefaultMaxInflation(e){xr(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),OZ=e}static defaultAbiCoder(){return G8==null&&(G8=new Lp),G8}static getBuiltinCallException(e,n,i){return P1e(e,n,i,Lp.defaultAbiCoder())}}const N1e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),PZ=Uint8Array.from({length:16},(r,e)=>e),M1e=PZ.map(r=>(9*r+5)%16);let q8=[PZ],Z8=[M1e];for(let r=0;r<4;r++)for(let e of[q8,Z8])e.push(e[r].map(n=>N1e[n]));const NZ=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),L1e=q8.map((r,e)=>r.map(n=>NZ[e][n])),D1e=Z8.map((r,e)=>r.map(n=>NZ[e][n])),U1e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),F1e=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Kk=(r,e)=>r<<e|r>>>32-e;function MZ(r,e,n,i){return r===0?e^n^i:r===1?e&n|~e&i:r===2?(e|~n)^i:r===3?e&i|n&~i:e^(n|~i)}const Gk=new Uint32Array(16);class W1e extends A8{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:i,h3:s,h4:o}=this;return[e,n,i,s,o]}set(e,n,i,s,o){this.h0=e|0,this.h1=n|0,this.h2=i|0,this.h3=s|0,this.h4=o|0}process(e,n){for(let P=0;P<16;P++,n+=4)Gk[P]=e.getUint32(n,!0);let i=this.h0|0,s=i,o=this.h1|0,a=o,u=this.h2|0,l=u,g=this.h3|0,y=g,A=this.h4|0,I=A;for(let P=0;P<5;P++){const D=4-P,U=U1e[P],V=F1e[P],J=q8[P],re=Z8[P],ce=L1e[P],Re=D1e[P];for(let De=0;De<16;De++){const Ue=Kk(i+MZ(P,o,u,g)+Gk[J[De]]+U,ce[De])+A|0;i=A,A=g,g=Kk(u,10)|0,u=o,o=Ue}for(let De=0;De<16;De++){const Ue=Kk(s+MZ(D,a,l,y)+Gk[re[De]]+V,Re[De])+I|0;s=I,I=y,y=Kk(l,10)|0,l=a,a=Ue}}this.set(this.h1+u+y|0,this.h2+g+I|0,this.h3+A+s|0,this.h4+i+a|0,this.h0+o+l|0)}roundClean(){Gk.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const H1e=kk(()=>new W1e);let LZ=!1;const DZ=function(r){return H1e(r)};let UZ=DZ;function Vw(r){const e=hi(r,"data");return jn(UZ(e))}Vw._=DZ,Vw.lock=function(){LZ=!0},Vw.register=function(r){if(LZ)throw new TypeError("ripemd160 is locked");UZ=r},Object.freeze(Vw);let FZ=!1;const WZ=function(r){return new Uint8Array(ibe(r))};let HZ=WZ;function Dp(r){return HZ(r)}Dp._=WZ,Dp.lock=function(){FZ=!0},Dp.register=function(r){if(FZ)throw new Error("randomBytes is locked");HZ=r},Object.freeze(Dp);function z1e(r){return r&&typeof r.getAddress=="function"}function dXe(r){try{return getAddress(r),!0}catch{}return!1}async function Y8(r,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(Ei(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),xr(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),Ol(n)}function qk(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?Ol(r):(Ei(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Y8(r,e.resolveName(r)));if(z1e(r))return Y8(r,r.getAddress());if(r&&typeof r.then=="function")return Y8(r,r);xr(!1,"unsupported addressable value","target",r)}const zZ="0x0000000000000000000000000000000000000000";function $1e(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function $Z(r,e,n){let i=0;for(let s=0;s<n;s++)i=i*256+r[e+s];return i}function VZ(r,e,n,i){const s=[];for(;n<e+1+i;){const o=jZ(r,n);s.push(o.result),n+=o.consumed,Ei(n<=e+1+i,"child data too short","BUFFER_OVERRUN",{buffer:r,length:i,offset:e})}return{consumed:1+i,result:s}}function jZ(r,e){Ei(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});const n=i=>{Ei(i<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:i})};if(r[e]>=248){const i=r[e]-247;n(e+1+i);const s=$Z(r,e+1,i);return n(e+1+i+s),VZ(r,e,e+1+i,i+s)}else if(r[e]>=192){const i=r[e]-192;return n(e+1+i),VZ(r,e,e+1,i)}else if(r[e]>=184){const i=r[e]-183;n(e+1+i);const s=$Z(r,e+1,i);n(e+1+i+s);const o=jn(r.slice(e+1+i,e+1+i+s));return{consumed:1+i+s,result:o}}else if(r[e]>=128){const i=r[e]-128;n(e+1+i);const s=jn(r.slice(e+1,e+1+i));return{consumed:1+i,result:s}}return{consumed:1,result:$1e(r[e])}}function Zk(r){const e=hi(r,"data"),n=jZ(e,0);return xr(n.consumed===e.length,"unexpected junk after rlp payload","data",r),n.result}function KZ(r){const e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function GZ(r){if(Array.isArray(r)){let i=[];if(r.forEach(function(o){i=i.concat(GZ(o))}),i.length<=55)return i.unshift(192+i.length),i;const s=KZ(i.length);return s.unshift(247+s.length),s.concat(i)}const e=Array.prototype.slice.call(hi(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=KZ(e.length);return n.unshift(183+n.length),n.concat(e)}const qZ="0123456789abcdef";function jw(r){let e="0x";for(const n of GZ(r))e+=qZ[n>>4],e+=qZ[n&15];return e}function X8(r,e){return{address:Ol(r),storageKeys:e.map((n,i)=>(xr(pc(n,32),"invalid slot",`storageKeys[${i}]`,n),n.toLowerCase()))}}function Yk(r){if(Array.isArray(r))return r.map((n,i)=>Array.isArray(n)?(xr(n.length===2,"invalid slot set",`value[${i}]`,n),X8(n[0],n[1])):(xr(n!=null&&typeof n=="object","invalid address-slot set","value",r),X8(n.address,n.storageKeys)));xr(r!=null&&typeof r=="object","invalid access list","value",r);const e=Object.keys(r).map(n=>{const i=r[n].reduce((s,o)=>(s[o]=!0,s),{});return X8(n,Object.keys(i).sort())});return e.sort((n,i)=>n.address.localeCompare(i.address)),e}const mu=BigInt(0),V1e=BigInt(2),j1e=BigInt(27),K1e=BigInt(28),G1e=BigInt(35),q1e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),J8=4096*32;function ZZ(r,e){let n=r.toString(16);for(;n.length<2;)n="0"+n;return n+=gc(e).substring(4),"0x"+n}function Xk(r){return r==="0x"?null:Ol(r)}function Q8(r,e){try{return Yk(r)}catch(n){xr(!1,n.message,e,r)}}function gE(r,e){return r==="0x"?0:zu(r,e)}function Pa(r,e){if(r==="0x")return mu;const n=lo(r,e);return xr(n<=q1e,"value exceeds uint size",e,n),n}function Ko(r,e){const n=lo(r,"value"),i=jc(n);return xr(i.length<=32,"value too large",`tx.${e}`,n),i}function eP(r){return Yk(r).map(e=>[e.address,e.storageKeys])}function Z1e(r,e){xr(Array.isArray(r),`invalid ${e}`,"value",r);for(let n=0;n<r.length;n++)xr(pc(r[n],32),"invalid ${ param } hash",`value[${n}]`,r[n]);return r}function Y1e(r){const e=Zk(r);xr(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);const n={type:0,nonce:gE(e[0],"nonce"),gasPrice:Pa(e[1],"gasPrice"),gasLimit:Pa(e[2],"gasLimit"),to:Xk(e[3]),value:Pa(e[4],"value"),data:jn(e[5]),chainId:mu};if(e.length===6)return n;const i=Pa(e[6],"v"),s=Pa(e[7],"r"),o=Pa(e[8],"s");if(s===mu&&o===mu)n.chainId=i;else{let a=(i-G1e)/V1e;a<mu&&(a=mu),n.chainId=a,xr(a!==mu||i===j1e||i===K1e,"non-canonical legacy v","v",e[6]),n.signature=ca.from({r:Ey(e[7],32),s:Ey(e[8],32),v:i})}return n}function X1e(r,e){const n=[Ko(r.nonce,"nonce"),Ko(r.gasPrice||0,"gasPrice"),Ko(r.gasLimit,"gasLimit"),r.to||"0x",Ko(r.value,"value"),r.data];let i=mu;if(r.chainId!=mu)i=lo(r.chainId,"tx.chainId"),xr(!e||e.networkV==null||e.legacyChainId===i,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){const o=r.signature.legacyChainId;o!=null&&(i=o)}if(!e)return i!==mu&&(n.push(jc(i)),n.push("0x"),n.push("0x")),jw(n);let s=BigInt(27+e.yParity);return i!==mu?s=ca.getChainIdV(i,e.v):BigInt(e.v)!==s&&xr(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(jc(s)),n.push(jc(e.r)),n.push(jc(e.s)),jw(n)}function tP(r,e){let n;try{if(n=gE(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{xr(!1,"invalid yParity","yParity",e[0])}const i=Ey(e[1],32),s=Ey(e[2],32),o=ca.from({r:i,s,yParity:n});r.signature=o}function J1e(r){const e=Zk(hi(r).slice(1));xr(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",jn(r));const n={type:2,chainId:Pa(e[0],"chainId"),nonce:gE(e[1],"nonce"),maxPriorityFeePerGas:Pa(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Pa(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Pa(e[4],"gasLimit"),to:Xk(e[5]),value:Pa(e[6],"value"),data:jn(e[7]),accessList:Q8(e[8],"accessList")};return e.length===9||tP(n,e.slice(9)),n}function Q1e(r,e){const n=[Ko(r.chainId,"chainId"),Ko(r.nonce,"nonce"),Ko(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ko(r.maxFeePerGas||0,"maxFeePerGas"),Ko(r.gasLimit,"gasLimit"),r.to||"0x",Ko(r.value,"value"),r.data,eP(r.accessList||[])];return e&&(n.push(Ko(e.yParity,"yParity")),n.push(jc(e.r)),n.push(jc(e.s))),bo(["0x02",jw(n)])}function eve(r){const e=Zk(hi(r).slice(1));xr(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",jn(r));const n={type:1,chainId:Pa(e[0],"chainId"),nonce:gE(e[1],"nonce"),gasPrice:Pa(e[2],"gasPrice"),gasLimit:Pa(e[3],"gasLimit"),to:Xk(e[4]),value:Pa(e[5],"value"),data:jn(e[6]),accessList:Q8(e[7],"accessList")};return e.length===8||tP(n,e.slice(8)),n}function tve(r,e){const n=[Ko(r.chainId,"chainId"),Ko(r.nonce,"nonce"),Ko(r.gasPrice||0,"gasPrice"),Ko(r.gasLimit,"gasLimit"),r.to||"0x",Ko(r.value,"value"),r.data,eP(r.accessList||[])];return e&&(n.push(Ko(e.yParity,"recoveryParam")),n.push(jc(e.r)),n.push(jc(e.s))),bo(["0x01",jw(n)])}function rve(r){let e=Zk(hi(r).slice(1)),n="3",i=null;if(e.length===4&&Array.isArray(e[0])){n="3 (network format)";const o=e[1],a=e[2],u=e[3];xr(Array.isArray(o),"invalid network format: blobs not an array","fields[1]",o),xr(Array.isArray(a),"invalid network format: commitments not an array","fields[2]",a),xr(Array.isArray(u),"invalid network format: proofs not an array","fields[3]",u),xr(o.length===a.length,"invalid network format: blobs/commitments length mismatch","fields",e),xr(o.length===u.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let l=0;l<e[1].length;l++)i.push({data:o[l],commitment:a[l],proof:u[l]});e=e[0]}xr(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${n}`,"data",jn(r));const s={type:3,chainId:Pa(e[0],"chainId"),nonce:gE(e[1],"nonce"),maxPriorityFeePerGas:Pa(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Pa(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Pa(e[4],"gasLimit"),to:Xk(e[5]),value:Pa(e[6],"value"),data:jn(e[7]),accessList:Q8(e[8],"accessList"),maxFeePerBlobGas:Pa(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};i&&(s.blobs=i),xr(s.to!=null,`invalid address for transaction type: ${n}`,"data",r),xr(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let o=0;o<s.blobVersionedHashes.length;o++)xr(pc(s.blobVersionedHashes[o],32),`invalid blobVersionedHash at index ${o}: must be length 32`,"data",r);return e.length===11||tP(s,e.slice(11)),s}function nve(r,e,n){const i=[Ko(r.chainId,"chainId"),Ko(r.nonce,"nonce"),Ko(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ko(r.maxFeePerGas||0,"maxFeePerGas"),Ko(r.gasLimit,"gasLimit"),r.to||zZ,Ko(r.value,"value"),r.data,eP(r.accessList||[]),Ko(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Z1e(r.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(i.push(Ko(e.yParity,"yParity")),i.push(jc(e.r)),i.push(jc(e.s)),n)?bo(["0x03",jw([i,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):bo(["0x03",jw(i)])}class i0{#e;#t;#r;#n;#i;#s;#a;#f;#d;#h;#p;#g;#l;#u;#o;#c;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;default:xr(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=this.#t;return e==null&&this.type===3?zZ:e}set to(e){this.#t=e==null?null:Ol(e)}get nonce(){return this.#n}set nonce(e){this.#n=zu(e,"value")}get gasLimit(){return this.#i}set gasLimit(e){this.#i=lo(e)}get gasPrice(){const e=this.#s;return e==null&&(this.type===0||this.type===1)?mu:e}set gasPrice(e){this.#s=e==null?null:lo(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#a;return e??(this.type===2||this.type===3?mu:null)}set maxPriorityFeePerGas(e){this.#a=e==null?null:lo(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#f;return e??(this.type===2||this.type===3?mu:null)}set maxFeePerGas(e){this.#f=e==null?null:lo(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=jn(e)}get value(){return this.#d}set value(e){this.#d=lo(e,"value")}get chainId(){return this.#h}set chainId(e){this.#h=lo(e)}get signature(){return this.#p||null}set signature(e){this.#p=e==null?null:ca.from(e)}get accessList(){const e=this.#g||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#g=e==null?null:Yk(e)}get maxFeePerBlobGas(){const e=this.#l;return e==null&&this.type===3?mu:e}set maxFeePerBlobGas(e){this.#l=e==null?null:lo(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#u;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){xr(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)xr(pc(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}this.#u=e}get blobs(){return this.#c==null?null:this.#c.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#c=null;return}const n=[],i=[];for(let s=0;s<e.length;s++){const o=e[s];if(wk(o)){Ei(this.#o,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let a=hi(o);if(xr(a.length<=J8,"blob is too large",`blobs[${s}]`,o),a.length!==J8){const g=new Uint8Array(J8);g.set(a),a=g}const u=this.#o.blobToKzgCommitment(a),l=jn(this.#o.computeBlobKzgProof(a,u));n.push({data:jn(a),commitment:jn(u),proof:l}),i.push(ZZ(1,u))}else{const a=jn(o.commitment);n.push({data:jn(o.data),commitment:a,proof:jn(o.proof)}),i.push(ZZ(1,a))}}this.#c=n,this.#u=i}get kzg(){return this.#o}set kzg(e){this.#o=e}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#i=mu,this.#s=null,this.#a=null,this.#f=null,this.#r="0x",this.#d=mu,this.#h=mu,this.#p=null,this.#g=null,this.#l=null,this.#u=null,this.#c=null,this.#o=null}get hash(){return this.signature==null?null:Ss(this.#y(!0,!1))}get unsignedHash(){return Ss(this.unsignedSerialized)}get from(){return this.signature==null?null:zw(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:$u.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}#y(e,n){Ei(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const i=e?this.signature:null;switch(this.inferType()){case 0:return X1e(this,i);case 1:return tve(this,i);case 2:return Q1e(this,i);case 3:return nve(this,i,n?this.blobs:null)}Ei(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#y(!0,!0)}get unsignedSerialized(){return this.#y(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,i=this.accessList!=null,s=this.#l!=null||this.#u;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Ei(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Ei(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Ei(this.type!==0||!i,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const o=[];return this.type!=null?o.push(this.type):n?o.push(2):e?(o.push(1),i||o.push(0)):i?(o.push(1),o.push(2)):(s&&this.to||(o.push(0),o.push(1),o.push(2)),o.push(3)),o.sort(),o}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return i0.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new i0;if(typeof e=="string"){const i=hi(e);if(i[0]>=127)return i0.from(Y1e(i));switch(i[0]){case 1:return i0.from(eve(i));case 2:return i0.from(J1e(i));case 3:return i0.from(rve(i))}Ei(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new i0;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=ca.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(n.kzg=e.kzg),e.blobs!=null&&(n.blobs=e.blobs),e.hash!=null&&(xr(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),xr(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(xr(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),xr(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}}const YZ=BigInt(0);function Kw(r){return r??null}function Na(r){return r==null?null:r.toString()}class hXe{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,n,i){defineProperties(this,{gasPrice:Kw(e),maxFeePerGas:Kw(n),maxPriorityFeePerGas:Kw(i)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:i}=this;return{_type:"FeeData",gasPrice:Na(e),maxFeePerGas:Na(n),maxPriorityFeePerGas:Na(i)}}}function XZ(r){const e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=jn(r.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in r)||r[s]==null||(e[s]=lo(r[s],`request.${s}`));const i="type,nonce".split(/,/);for(const s of i)!(s in r)||r[s]==null||(e[s]=zu(r[s],`request.${s}`));return r.accessList&&(e.accessList=Yk(r.accessList)),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(s=>wk(s)?jn(s):Object.assign({},s))),e}class pXe{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,n){this.#e=e.transactions.map(i=>typeof i!="string"?new rP(i,n):i),Ki(this,{provider:n,hash:Kw(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Kw(e.prevRandao),extraData:e.extraData,baseFeePerGas:Kw(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=this.#e.slice();return e.length===0?[]:(Ei(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:i,gasLimit:s,gasUsed:o,hash:a,miner:u,prevRandao:l,nonce:g,number:y,parentHash:A,parentBeaconBlockRoot:I,stateRoot:P,receiptsRoot:D,timestamp:U,transactions:V}=this;return{_type:"Block",baseFeePerGas:Na(e),difficulty:Na(n),extraData:i,gasLimit:Na(s),gasUsed:Na(o),blobGasUsed:Na(this.blobGasUsed),excessBlobGas:Na(this.excessBlobGas),hash:a,miner:u,prevRandao:l,nonce:g,number:y,parentHash:A,timestamp:U,parentBeaconBlockRoot:I,stateRoot:P,receiptsRoot:D,transactions:V}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>e<this.length?{value:n[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let n;if(typeof e=="number")n=this.#e[e];else{const i=e.toLowerCase();for(const s of this.#e)if(typeof s=="string"){if(s!==i)continue;n=s;break}else{if(s.hash!==i)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(e){const n=this.prefetchedTransactions;if(typeof e=="number")return n[e];e=e.toLowerCase();for(const i of n)if(i.hash===e)return i;xr(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return sve(this)}}class ive{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,n){this.provider=n;const i=Object.freeze(e.topics.slice());Ki(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:i,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:n,blockNumber:i,data:s,index:o,removed:a,topics:u,transactionHash:l,transactionIndex:g}=this;return{_type:"log",address:e,blockHash:n,blockNumber:i,data:s,index:o,removed:a,topics:u,transactionHash:l,transactionIndex:g}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return Ei(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return Ei(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return Ei(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return ove(this)}}class gXe{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,n){this.#e=Object.freeze(e.logs.map(s=>new ive(s,n)));let i=YZ;e.effectiveGasPrice!=null?i=e.effectiveGasPrice:e.gasPrice!=null&&(i=e.gasPrice),Ki(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:i,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){const{to:e,from:n,contractAddress:i,hash:s,index:o,blockHash:a,blockNumber:u,logsBloom:l,logs:g,status:y,root:A}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:u,contractAddress:i,cumulativeGasUsed:Na(this.cumulativeGasUsed),from:n,gasPrice:Na(this.gasPrice),blobGasUsed:Na(this.blobGasUsed),blobGasPrice:Na(this.blobGasPrice),gasUsed:Na(this.gasUsed),hash:s,index:o,logs:g,logsBloom:l,root:A,status:y,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return QZ(this)}reorderedEvent(e){return Ei(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),JZ(this,e)}}class rP{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;#e;constructor(e,n){this.provider=n,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.#e=-1}toJSON(){const{blockNumber:e,blockHash:n,index:i,hash:s,type:o,to:a,from:u,nonce:l,data:g,signature:y,accessList:A,blobVersionedHashes:I}=this;return{_type:"TransactionResponse",accessList:A,blockNumber:e,blockHash:n,blobVersionedHashes:I,chainId:Na(this.chainId),data:g,from:u,gasLimit:Na(this.gasLimit),gasPrice:Na(this.gasPrice),hash:s,maxFeePerGas:Na(this.maxFeePerGas),maxPriorityFeePerGas:Na(this.maxPriorityFeePerGas),maxFeePerBlobGas:Na(this.maxFeePerBlobGas),nonce:l,signature:y,to:a,index:i,type:o,value:Na(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const i=await this.getTransaction();i&&(e=i.blockNumber)}if(e==null)return null;const n=this.provider.getBlock(e);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:i}=await oE({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:i-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,n){const i=e??1,s=n??0;let o=this.#e,a=-1,u=o===-1;const l=async()=>{if(u)return null;const{blockNumber:I,nonce:P}=await oE({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(P<this.nonce){o=I;return}if(u)return null;const D=await this.getTransaction();if(!(D&&D.blockNumber!=null))for(a===-1&&(a=o-3,a<this.#e&&(a=this.#e));a<=I;){if(u)return null;const U=await this.provider.getBlock(a,!0);if(U==null)return;for(const V of U)if(V===this.hash)return;for(let V=0;V<U.length;V++){const J=await U.getTransaction(V);if(J.from===this.from&&J.nonce===this.nonce){if(u)return null;const re=await this.provider.getTransactionReceipt(J.hash);if(re==null||I-re.blockNumber+1<i)return;let ce="replaced";J.data===this.data&&J.to===this.to&&J.value===this.value?ce="repriced":J.data==="0x"&&J.from===J.to&&J.value===YZ&&(ce="cancelled"),Ei(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:ce==="replaced"||ce==="cancelled",reason:ce,replacement:J.replaceableTransaction(o),hash:J.hash,receipt:re})}}a++}},g=I=>{if(I==null||I.status!==0)return I;Ei(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:I.to,from:I.from,data:""},receipt:I})},y=await this.provider.getTransactionReceipt(this.hash);if(i===0)return g(y);if(y){if(await y.confirmations()>=i)return g(y)}else if(await l(),i===0)return null;return await new Promise((I,P)=>{const D=[],U=()=>{D.forEach(J=>J())};if(D.push(()=>{u=!0}),s>0){const J=setTimeout(()=>{U(),P(p8("wait for transaction timeout","TIMEOUT"))},s);D.push(()=>{clearTimeout(J)})}const V=async J=>{if(await J.confirmations()>=i){U();try{I(g(J))}catch(re){P(re)}}};if(D.push(()=>{this.provider.off(this.hash,V)}),this.provider.on(this.hash,V),o>=0){const J=async()=>{try{await l()}catch(re){if(vk(re,"TRANSACTION_REPLACED")){U(),P(re);return}}u||this.provider.once("block",J)};D.push(()=>{this.provider.off("block",J)}),this.provider.once("block",J)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Ei(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),QZ(this)}reorderedEvent(e){return Ei(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ei(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),JZ(this,e)}replaceableTransaction(e){xr(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new rP(this,this.provider);return n.#e=e,n}}function sve(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function JZ(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function QZ(r){return{orphan:"drop-transaction",tx:r}}function ove(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}function Gw(r,e){if(r.provider)return r.provider;Ei(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function eY(r,e){let n=XZ(e);if(n.to!=null&&(n.to=qk(n.to,r)),n.from!=null){const i=n.from;n.from=Promise.all([r.getAddress(),qk(i,r)]).then(([s,o])=>(xr(s.toLowerCase()===o.toLowerCase(),"transaction from mismatch","tx.from",o),s))}else n.from=r.getAddress();return await oE(n)}class tY{provider;constructor(e){Ki(this,{provider:e||null})}async getNonce(e){return Gw(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await eY(this,e)}async populateTransaction(e){const n=Gw(this,"populateTransaction"),i=await eY(this,e);i.nonce==null&&(i.nonce=await this.getNonce("pending")),i.gasLimit==null&&(i.gasLimit=await this.estimateGas(i));const s=await this.provider.getNetwork();if(i.chainId!=null){const a=lo(i.chainId);xr(a===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else i.chainId=s.chainId;const o=i.maxFeePerGas!=null||i.maxPriorityFeePerGas!=null;if(i.gasPrice!=null&&(i.type===2||o)?xr(!1,"eip-1559 transaction do not support gasPrice","tx",e):(i.type===0||i.type===1)&&o&&xr(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(i.type===2||i.type==null)&&i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)i.type=2;else if(i.type===0||i.type===1){const a=await n.getFeeData();Ei(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),i.gasPrice==null&&(i.gasPrice=a.gasPrice)}else{const a=await n.getFeeData();if(i.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(i.type=2,i.gasPrice!=null){const u=i.gasPrice;delete i.gasPrice,i.maxFeePerGas=u,i.maxPriorityFeePerGas=u}else i.maxFeePerGas==null&&(i.maxFeePerGas=a.maxFeePerGas),i.maxPriorityFeePerGas==null&&(i.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(Ei(!o,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),i.gasPrice==null&&(i.gasPrice=a.gasPrice),i.type=0):Ei(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(i.type===2||i.type===3)&&(i.maxFeePerGas==null&&(i.maxFeePerGas=a.maxFeePerGas),i.maxPriorityFeePerGas==null&&(i.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await oE(i)}async estimateGas(e){return Gw(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Gw(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Gw(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Gw(this,"sendTransaction"),i=await this.populateTransaction(e);delete i.from;const s=i0.from(i);return await n.broadcastTransaction(await this.signTransaction(s))}}class nP extends tY{address;constructor(e,n){super(n),Ki(this,{address:e})}async getAddress(){return this.address}connect(e){return new nP(this.address,e)}#e(e,n){Ei(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:n})}async signTransaction(e){this.#e("transactions","signTransaction")}async signMessage(e){this.#e("messages","signMessage")}async signTypedData(e,n,i){this.#e("typed-data","signTypedData")}}const Jk="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let Qk=null;function ave(r){if(Qk==null){Qk={};for(let n=0;n<Jk.length;n++)Qk[Jk[n]]=BigInt(n)}const e=Qk[r];return xr(e!=null,"invalid base58 value","letter",r),e}const uve=BigInt(0),iP=BigInt(58);function cve(r){const e=hi(r);let n=Ek(e),i="";for(;n;)i=Jk[Number(n%iP)]+i,n/=iP;for(let s=0;s<e.length&&!e[s];s++)i=Jk[0]+i;return i}function lve(r){let e=uve;for(let n=0;n<r.length;n++)e*=iP,e+=ave(r[n]);return e}const yXe="\u039E",fve=`Ethereum Signed Message:
|
||
`;function rY(r){return typeof r=="string"&&(r=Kc(r)),Ss(bo([Kc(fve),Kc(String(r.length)),r]))}function mXe(r,e){const n=rY(r);return recoverAddress(n,e)}const nY=new Uint8Array(32);nY.fill(0);const dve=BigInt(-1),iY=BigInt(0),sY=BigInt(1),hve=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function pve(r){const e=hi(r),n=e.length%32;return n?bo([e,nY.slice(n)]):jn(e)}const gve=eh(sY,32),yve=eh(iY,32),oY={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},sP=["name","version","chainId","verifyingContract","salt"];function aY(r){return function(e){return xr(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}const mve={name:aY("name"),version:aY("version"),chainId:function(r){const e=lo(r,"domain.chainId");return xr(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):KG(e)},verifyingContract:function(r){try{return Ol(r).toLowerCase()}catch{}xr(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){const e=hi(r,"domain.salt");return xr(e.length===32,'invalid domain value "salt"',"domain.salt",r),jn(e)}};function oP(r){{const e=r.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",i=parseInt(e[2]);xr(i%8===0&&i!==0&&i<=256&&e[2]===String(i),"invalid numeric width","type",r);const s=Mw(hve,n?i-1:i),o=n?(s+sY)*dve:iY;return function(a){const u=lo(a,"value");return xr(u>=o&&u<=s,`value out-of-bounds for ${r}`,"value",u),eh(n?g8(u,256):u,32)}}}{const e=r.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return xr(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",r),function(i){const s=hi(i);return xr(s.length===n,`invalid length for ${r}`,"value",i),pve(i)}}}switch(r){case"address":return function(e){return Ey(Ol(e),32)};case"bool":return function(e){return e?gve:yve};case"bytes":return function(e){return Ss(e)};case"string":return function(e){return Bl(e)}}return null}function uY(r,e){return`${r}(${e.map(({name:n,type:i})=>i+" "+n).join(",")})`}function eR(r){const e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}class Nl{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#t=new Map,this.#r=new Map;const n=new Map,i=new Map,s=new Map,o={};Object.keys(e).forEach(l=>{o[l]=e[l].map(({name:g,type:y})=>{let{base:A,index:I}=eR(y);return A==="int"&&!e.int&&(A="int256"),A==="uint"&&!e.uint&&(A="uint256"),{name:g,type:A+(I||"")}}),n.set(l,new Set),i.set(l,[]),s.set(l,new Set)}),this.#e=JSON.stringify(o);for(const l in o){const g=new Set;for(const y of o[l]){xr(!g.has(y.name),`duplicate variable name ${JSON.stringify(y.name)} in ${JSON.stringify(l)}`,"types",e),g.add(y.name);const A=eR(y.type).base;xr(A!==l,`circular type reference to ${JSON.stringify(A)}`,"types",e),!oP(A)&&(xr(i.has(A),`unknown type ${JSON.stringify(A)}`,"types",e),i.get(A).push(l),n.get(l).add(A))}}const a=Array.from(i.keys()).filter(l=>i.get(l).length===0);xr(a.length!==0,"missing primary type","types",e),xr(a.length===1,`ambiguous primary types or unused types: ${a.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Ki(this,{primaryType:a[0]});function u(l,g){xr(!g.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),g.add(l);for(const y of n.get(l))if(i.has(y)){u(y,g);for(const A of g)s.get(A).add(y)}g.delete(l)}u(this.primaryType,new Set);for(const[l,g]of s){const y=Array.from(g);y.sort(),this.#t.set(l,uY(l,o[l])+y.map(A=>uY(A,o[A])).join(""))}}getEncoder(e){let n=this.#r.get(e);return n||(n=this.#n(e),this.#r.set(e,n)),n}#n(e){{const s=oP(e);if(s)return s}const n=eR(e).array;if(n){const s=n.prefix,o=this.getEncoder(s);return a=>{xr(n.count===-1||n.count===a.length,`array length mismatch; expected length ${n.count}`,"value",a);let u=a.map(o);return this.#t.has(s)&&(u=u.map(Ss)),Ss(bo(u))}}const i=this.types[e];if(i){const s=Bl(this.#t.get(e));return o=>{const a=i.map(({name:u,type:l})=>{const g=this.getEncoder(l)(o[u]);return this.#t.has(l)?Ss(g):g});return a.unshift(s),bo(a)}}xr(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const n=this.#t.get(e);return xr(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Ss(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,i){if(oP(e))return i(e,n);const s=eR(e).array;if(s)return xr(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(a=>this._visit(s.prefix,a,i));const o=this.types[e];if(o)return o.reduce((a,{name:u,type:l})=>(a[u]=this._visit(l,n[u],i),a),{});xr(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Nl(e)}static getPrimaryType(e){return Nl.from(e).primaryType}static hashStruct(e,n,i){return Nl.from(n).hashStruct(e,i)}static hashDomain(e){const n=[];for(const i in e){if(e[i]==null)continue;const s=oY[i];xr(s,`invalid typed-data domain key: ${JSON.stringify(i)}`,"domain",e),n.push({name:i,type:s})}return n.sort((i,s)=>sP.indexOf(i.name)-sP.indexOf(s.name)),Nl.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,i){return bo(["0x1901",Nl.hashDomain(e),Nl.from(n).hash(i)])}static hash(e,n,i){return Ss(Nl.encode(e,n,i))}static async resolveNames(e,n,i,s){e=Object.assign({},e);for(const u in e)e[u]==null&&delete e[u];const o={};e.verifyingContract&&!pc(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const a=Nl.from(n);a.visit(i,(u,l)=>(u==="address"&&!pc(l,20)&&(o[l]="0x"),l));for(const u in o)o[u]=await s(u);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),i=a.visit(i,(u,l)=>u==="address"&&o[l]?o[l]:l),{domain:e,value:i}}static getPayload(e,n,i){Nl.hashDomain(e);const s={},o=[];sP.forEach(l=>{const g=e[l];g!=null&&(s[l]=mve[l](g),o.push({name:l,type:oY[l]}))});const a=Nl.from(n);n=a.types;const u=Object.assign({},n);return xr(u.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),u.EIP712Domain=o,a.encode(i),{types:u,domain:s,primaryType:a.primaryType,message:a.visit(i,(l,g)=>{if(l.match(/^bytes(\d*)/))return jn(hi(g));if(l.match(/^u?int/))return lo(g).toString();switch(l){case"address":return g.toLowerCase();case"bool":return!!g;case"string":return xr(typeof g=="string","invalid string","value",g),g}xr(!1,"unsupported type","type",l)})}}}function bXe(r,e,n,i){return recoverAddress(Nl.hash(r,e,n),i)}class aP extends tY{address;#e;constructor(e,n){super(n),xr(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),this.#e=e;const i=Hk(this.signingKey.publicKey);Ki(this,{address:i})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new aP(this.#e,e)}async signTransaction(e){e=XZ(e);const{to:n,from:i}=await oE({to:e.to?qk(e.to,this.provider):void 0,from:e.from?qk(e.from,this.provider):void 0});n!=null&&(e.to=n),i!=null&&(e.from=i),e.from!=null&&(xr(Ol(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const s=i0.from(e);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(rY(e)).serialized}async signTypedData(e,n,i){const s=await Nl.resolveNames(e,n,i,async o=>{Ei(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const a=await this.provider.resolveName(o);return Ei(a!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),a});return this.signingKey.sign(Nl.hash(s.domain,n,s.value)).serialized}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var Vu=function(r,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:e.get(r)},uP=function(r,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,n):s?s.value=n:e.set(r,n),n},tR,Qf,s0;const bve={16:10,24:12,32:14},vve=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],ed=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],rR=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],wve=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Ave=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],_ve=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Eve=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Tve=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Sve=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Ive=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],kve=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Rve=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Cve=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],xve=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Bve=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function cP(r){const e=[];for(let n=0;n<r.length;n+=4)e.push(r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3]);return e}class lP{get key(){return Vu(this,tR,"f").slice()}constructor(e){if(tR.set(this,void 0),Qf.set(this,void 0),s0.set(this,void 0),!(this instanceof lP))throw Error("AES must be instanitated with `new`");uP(this,tR,new Uint8Array(e),"f");const n=bve[this.key.length];if(n==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");uP(this,s0,[],"f"),uP(this,Qf,[],"f");for(let y=0;y<=n;y++)Vu(this,s0,"f").push([0,0,0,0]),Vu(this,Qf,"f").push([0,0,0,0]);const i=(n+1)*4,s=this.key.length/4,o=cP(this.key);let a;for(let y=0;y<s;y++)a=y>>2,Vu(this,s0,"f")[a][y%4]=o[y],Vu(this,Qf,"f")[n-a][y%4]=o[y];let u=0,l=s,g;for(;l<i;){if(g=o[s-1],o[0]^=ed[g>>16&255]<<24^ed[g>>8&255]<<16^ed[g&255]<<8^ed[g>>24&255]^vve[u]<<24,u+=1,s!=8)for(let P=1;P<s;P++)o[P]^=o[P-1];else{for(let P=1;P<s/2;P++)o[P]^=o[P-1];g=o[s/2-1],o[s/2]^=ed[g&255]^ed[g>>8&255]<<8^ed[g>>16&255]<<16^ed[g>>24&255]<<24;for(let P=s/2+1;P<s;P++)o[P]^=o[P-1]}let y=0,A,I;for(;y<s&&l<i;)A=l>>2,I=l%4,Vu(this,s0,"f")[A][I]=o[y],Vu(this,Qf,"f")[n-A][I]=o[y++],l++}for(let y=1;y<n;y++)for(let A=0;A<4;A++)g=Vu(this,Qf,"f")[y][A],Vu(this,Qf,"f")[y][A]=Rve[g>>24&255]^Cve[g>>16&255]^xve[g>>8&255]^Bve[g&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const n=Vu(this,s0,"f").length-1,i=[0,0,0,0];let s=cP(e);for(let u=0;u<4;u++)s[u]^=Vu(this,s0,"f")[0][u];for(let u=1;u<n;u++){for(let l=0;l<4;l++)i[l]=wve[s[l]>>24&255]^Ave[s[(l+1)%4]>>16&255]^_ve[s[(l+2)%4]>>8&255]^Eve[s[(l+3)%4]&255]^Vu(this,s0,"f")[u][l];s=i.slice()}const o=new Uint8Array(16);let a=0;for(let u=0;u<4;u++)a=Vu(this,s0,"f")[n][u],o[4*u]=(ed[s[u]>>24&255]^a>>24)&255,o[4*u+1]=(ed[s[(u+1)%4]>>16&255]^a>>16)&255,o[4*u+2]=(ed[s[(u+2)%4]>>8&255]^a>>8)&255,o[4*u+3]=(ed[s[(u+3)%4]&255]^a)&255;return o}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const n=Vu(this,Qf,"f").length-1,i=[0,0,0,0];let s=cP(e);for(let u=0;u<4;u++)s[u]^=Vu(this,Qf,"f")[0][u];for(let u=1;u<n;u++){for(let l=0;l<4;l++)i[l]=Tve[s[l]>>24&255]^Sve[s[(l+3)%4]>>16&255]^Ive[s[(l+2)%4]>>8&255]^kve[s[(l+1)%4]&255]^Vu(this,Qf,"f")[u][l];s=i.slice()}const o=new Uint8Array(16);let a=0;for(let u=0;u<4;u++)a=Vu(this,Qf,"f")[n][u],o[4*u]=(rR[s[u]>>24&255]^a>>24)&255,o[4*u+1]=(rR[s[(u+3)%4]>>16&255]^a>>16)&255,o[4*u+2]=(rR[s[(u+2)%4]>>8&255]^a>>8)&255,o[4*u+3]=(rR[s[(u+1)%4]&255]^a)&255;return o}}tR=new WeakMap,Qf=new WeakMap,s0=new WeakMap;class yE{constructor(e,n,i){if(i&&!(this instanceof i))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new lP(n)},name:{enumerable:!0,value:e}})}}var nR=function(r,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,n):s?s.value=n:e.set(r,n),n},qw=function(r,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:e.get(r)},mE,Up;class cY extends yE{constructor(e,n){if(super("ECC",e,cY),mE.set(this,void 0),Up.set(this,void 0),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");nR(this,mE,new Uint8Array(n),"f")}else nR(this,mE,new Uint8Array(16),"f");nR(this,Up,this.iv,"f")}get iv(){return new Uint8Array(qw(this,mE,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(e.length);for(let i=0;i<e.length;i+=16){for(let s=0;s<16;s++)qw(this,Up,"f")[s]^=e[i+s];nR(this,Up,this.aes.encrypt(qw(this,Up,"f")),"f"),n.set(qw(this,Up,"f"),i)}return n}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const n=new Uint8Array(e.length);for(let i=0;i<e.length;i+=16){const s=this.aes.decrypt(e.subarray(i,i+16));for(let o=0;o<16;o++)n[i+o]=s[o]^qw(this,Up,"f")[o],qw(this,Up,"f")[o]=e[i+o]}return n}}mE=new WeakMap,Up=new WeakMap;var fP=function(r,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,n):s?s.value=n:e.set(r,n),n},Dy=function(r,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:e.get(r)},iR,bE,Uy,dP;class lY extends yE{constructor(e,n,i=8){if(super("CFB",e,lY),iR.add(this),bE.set(this,void 0),Uy.set(this,void 0),!Number.isInteger(i)||i%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:i}}),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");fP(this,bE,new Uint8Array(n),"f")}else fP(this,bE,new Uint8Array(16),"f");fP(this,Uy,this.iv,"f")}get iv(){return new Uint8Array(Dy(this,bE,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");const n=this.segmentSize/8,i=new Uint8Array(e);for(let s=0;s<i.length;s+=n){const o=this.aes.encrypt(Dy(this,Uy,"f"));for(let a=0;a<n;a++)i[s+a]^=o[a];Dy(this,iR,"m",dP).call(this,i.subarray(s))}return i}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");const n=this.segmentSize/8,i=new Uint8Array(e);for(let s=0;s<i.length;s+=n){const o=this.aes.encrypt(Dy(this,Uy,"f"));for(let a=0;a<n;a++)i[s+a]^=o[a];Dy(this,iR,"m",dP).call(this,e.subarray(s))}return i}}bE=new WeakMap,Uy=new WeakMap,iR=new WeakSet,dP=function(e){const n=this.segmentSize/8;Dy(this,Uy,"f").set(Dy(this,Uy,"f").subarray(n)),Dy(this,Uy,"f").set(e.subarray(0,n),16-n)};var Zw=function(r,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,n):s?s.value=n:e.set(r,n),n},td=function(r,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:e.get(r)},vE,Zb,rd;class sR extends yE{constructor(e,n){super("CTR",e,sR),vE.set(this,void 0),Zb.set(this,void 0),rd.set(this,void 0),Zw(this,rd,new Uint8Array(16),"f"),td(this,rd,"f").fill(0),Zw(this,vE,td(this,rd,"f"),"f"),Zw(this,Zb,16,"f"),n==null&&(n=1),typeof n=="number"?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(td(this,rd,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let n=15;n>=0;--n)td(this,rd,"f")[n]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");td(this,rd,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(td(this,rd,"f")[e]===255)td(this,rd,"f")[e]=0;else{td(this,rd,"f")[e]++;break}}encrypt(e){var n,i;const s=new Uint8Array(e);for(let o=0;o<s.length;o++)td(this,Zb,"f")===16&&(Zw(this,vE,this.aes.encrypt(td(this,rd,"f")),"f"),Zw(this,Zb,0,"f"),this.increment()),s[o]^=td(this,vE,"f")[Zw(this,Zb,(i=td(this,Zb,"f"),n=i++,i),"f"),n];return s}decrypt(e){return this.encrypt(e)}}vE=new WeakMap,Zb=new WeakMap,rd=new WeakMap;class fY extends yE{constructor(e){super("ECB",e,fY)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(e.length);for(let i=0;i<e.length;i+=16)n.set(this.aes.encrypt(e.subarray(i,i+16)),i);return n}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const n=new Uint8Array(e.length);for(let i=0;i<e.length;i+=16)n.set(this.aes.decrypt(e.subarray(i,i+16)),i);return n}}var Yb=function(r,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,n):s?s.value=n:e.set(r,n),n},wE=function(r,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:e.get(r)},AE,Yw,Xb;class dY extends yE{constructor(e,n){if(super("OFB",e,dY),AE.set(this,void 0),Yw.set(this,void 0),Xb.set(this,void 0),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Yb(this,AE,new Uint8Array(n),"f")}else Yb(this,AE,new Uint8Array(16),"f");Yb(this,Yw,this.iv,"f"),Yb(this,Xb,16,"f")}get iv(){return new Uint8Array(wE(this,AE,"f"))}encrypt(e){var n,i;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const s=new Uint8Array(e);for(let o=0;o<s.length;o++)wE(this,Xb,"f")===16&&(Yb(this,Yw,this.aes.encrypt(wE(this,Yw,"f")),"f"),Yb(this,Xb,0,"f")),s[o]^=wE(this,Yw,"f")[Yb(this,Xb,(i=wE(this,Xb,"f"),n=i++,i),"f"),n];return s}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}}AE=new WeakMap,Yw=new WeakMap,Xb=new WeakMap;const Qs=(r,e)=>r<<e|r>>>32-e;function hY(r,e,n,i,s,o){let a=r[e++]^n[i++],u=r[e++]^n[i++],l=r[e++]^n[i++],g=r[e++]^n[i++],y=r[e++]^n[i++],A=r[e++]^n[i++],I=r[e++]^n[i++],P=r[e++]^n[i++],D=r[e++]^n[i++],U=r[e++]^n[i++],V=r[e++]^n[i++],J=r[e++]^n[i++],re=r[e++]^n[i++],ce=r[e++]^n[i++],Re=r[e++]^n[i++],De=r[e++]^n[i++],Ue=a,Ve=u,pe=l,Se=g,Ce=y,je=A,$e=I,Qe=P,nt=D,Ne=U,Me=V,ct=J,mt=re,Bt=ce,er=Re,cr=De;for(let pr=0;pr<8;pr+=2)Ce^=Qs(Ue+mt|0,7),nt^=Qs(Ce+Ue|0,9),mt^=Qs(nt+Ce|0,13),Ue^=Qs(mt+nt|0,18),Ne^=Qs(je+Ve|0,7),Bt^=Qs(Ne+je|0,9),Ve^=Qs(Bt+Ne|0,13),je^=Qs(Ve+Bt|0,18),er^=Qs(Me+$e|0,7),pe^=Qs(er+Me|0,9),$e^=Qs(pe+er|0,13),Me^=Qs($e+pe|0,18),Se^=Qs(cr+ct|0,7),Qe^=Qs(Se+cr|0,9),ct^=Qs(Qe+Se|0,13),cr^=Qs(ct+Qe|0,18),Ve^=Qs(Ue+Se|0,7),pe^=Qs(Ve+Ue|0,9),Se^=Qs(pe+Ve|0,13),Ue^=Qs(Se+pe|0,18),$e^=Qs(je+Ce|0,7),Qe^=Qs($e+je|0,9),Ce^=Qs(Qe+$e|0,13),je^=Qs(Ce+Qe|0,18),ct^=Qs(Me+Ne|0,7),nt^=Qs(ct+Me|0,9),Ne^=Qs(nt+ct|0,13),Me^=Qs(Ne+nt|0,18),mt^=Qs(cr+er|0,7),Bt^=Qs(mt+cr|0,9),er^=Qs(Bt+mt|0,13),cr^=Qs(er+Bt|0,18);s[o++]=a+Ue|0,s[o++]=u+Ve|0,s[o++]=l+pe|0,s[o++]=g+Se|0,s[o++]=y+Ce|0,s[o++]=A+je|0,s[o++]=I+$e|0,s[o++]=P+Qe|0,s[o++]=D+nt|0,s[o++]=U+Ne|0,s[o++]=V+Me|0,s[o++]=J+ct|0,s[o++]=re+mt|0,s[o++]=ce+Bt|0,s[o++]=Re+er|0,s[o++]=De+cr|0}function Xw(r,e,n,i,s){let o=i+0,a=i+16*s;for(let u=0;u<16;u++)n[a+u]=r[e+(2*s-1)*16+u];for(let u=0;u<s;u++,o+=16,e+=16)hY(n,a,r,e,n,o),u>0&&(a+=16),hY(n,o,r,e+=16,n,a)}function pY(r,e,n){const i=rq({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:o,p:a,dkLen:u,asyncTick:l,maxmem:g,onProgress:y}=i;if(wf(s),wf(o),wf(a),wf(u),wf(l),wf(g),y!==void 0&&typeof y!="function")throw new Error("progressCb should be function");const A=128*o,I=A/4;if(s<=1||s&s-1||s>=2**(A/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/A)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(u<0||u>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const P=A*(s+a);if(P>g)throw new Error(`Scrypt: parameters too large, ${P} (128 * r * (N + p)) > ${g} (maxmem)`);const D=w8(Uw,r,e,{c:1,dkLen:A*a}),U=Sk(D),V=Sk(new Uint8Array(A*s)),J=Sk(new Uint8Array(A));let re=()=>{};if(y){const ce=2*s*a,Re=Math.max(Math.floor(ce/1e4),1);let De=0;re=()=>{De++,y&&(!(De%Re)||De===ce)&&y(De/ce)}}return{N:s,r:o,p:a,dkLen:u,blockSize32:I,V,B32:U,B:D,tmp:J,blockMixCb:re,asyncTick:l}}function gY(r,e,n,i,s){const o=w8(Uw,r,n,{c:1,dkLen:e});return n.fill(0),i.fill(0),s.fill(0),o}function Ove(r,e,n){const{N:i,r:s,p:o,dkLen:a,blockSize32:u,V:l,B32:g,B:y,tmp:A,blockMixCb:I}=pY(r,e,n);for(let P=0;P<o;P++){const D=u*P;for(let U=0;U<u;U++)l[U]=g[D+U];for(let U=0,V=0;U<i-1;U++)Xw(l,V,l,V+=u,s),I();Xw(l,(i-1)*u,g,D,s),I();for(let U=0;U<i;U++){const V=g[D+u-16]%i;for(let J=0;J<u;J++)A[J]=g[D+J]^l[V*u+J];Xw(A,0,g,D,s),I()}}return gY(r,a,y,l,A)}async function Pve(r,e,n){const{N:i,r:s,p:o,dkLen:a,blockSize32:u,V:l,B32:g,B:y,tmp:A,blockMixCb:I,asyncTick:P}=pY(r,e,n);for(let D=0;D<o;D++){const U=u*D;for(let J=0;J<u;J++)l[J]=g[U+J];let V=0;await tq(i-1,P,()=>{Xw(l,V,l,V+=u,s),I()}),Xw(l,(i-1)*u,g,U,s),I(),await tq(i,P,()=>{const J=g[U+u-16]%i;for(let re=0;re<u;re++)A[re]=g[U+re]^l[J*u+re];Xw(A,0,g,U,s),I()})}return gY(r,a,y,l,A)}let yY=!1,mY=!1;const bY=async function(r,e,n,i,s,o,a){return await Pve(r,e,{N:n,r:i,p:s,dkLen:o,onProgress:a})},vY=function(r,e,n,i,s,o){return Ove(r,e,{N:n,r:i,p:s,dkLen:o})};let wY=bY,AY=vY;async function _E(r,e,n,i,s,o,a){const u=hi(r,"passwd"),l=hi(e,"salt");return jn(await wY(u,l,n,i,s,o,a))}_E._=bY,_E.lock=function(){mY=!0},_E.register=function(r){if(mY)throw new Error("scrypt is locked");wY=r},Object.freeze(_E);function EE(r,e,n,i,s,o){const a=hi(r,"passwd"),u=hi(e,"salt");return jn(AY(a,u,n,i,s,o))}EE._=vY,EE.lock=function(){yY=!0},EE.register=function(r){if(yY)throw new Error("scryptSync is locked");AY=r},Object.freeze(EE);function Nve(r){const e=hi(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const n=jn(e);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join("-")}function Mve(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),getBytesCopy(r)}function TE(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}function _Y(r){return typeof r=="string"?Kc(r,"NFKC"):hc(r)}function vXe(r,e){const n=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);assertArgument(n!=null,"invalid path","path",e);const i=n[1],s=n[3],o=n[4]==="!";let a=r;for(const u of i.toLowerCase().split(".")){if(Array.isArray(a)){if(!u.match(/^[0-9]+$/))break;a=a[parseInt(u)]}else if(typeof a=="object"){let l=null;for(const g in a)if(g.toLowerCase()===u){l=a[g];break}a=l}else a=null;if(a==null)break}if(assertArgument(!o||a!=null,"missing required value","path",i),s&&a!=null){if(s==="int"){if(typeof a=="string"&&a.match(/^-?[0-9]+$/))return parseInt(a);if(Number.isSafeInteger(a))return a}if(s==="number"&&typeof a=="string"&&a.match(/^-?[0-9.]*$/))return parseFloat(a);if(s==="data"&&typeof a=="string")return Mve(a);if(s==="array"&&Array.isArray(a)||s===typeof a)return a;assertArgument(!1,`wrong type found for ${s} `,"path",i)}return a}const EY="m/44'/60'/0'/0/0";function wXe(r){try{const e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}function Lve(r,e,n){if(spelunk(r,"crypto.cipher:string")==="aes-128-ctr"){const s=spelunk(r,"crypto.cipherparams.iv:data!"),o=new CTR(e,s);return hexlify(o.decrypt(n))}assert(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function oR(r,e){const n=getBytes(e),i=spelunk(r,"crypto.ciphertext:data!"),s=hexlify(keccak256(concat([n.slice(16,32),i]))).substring(2);assertArgument(s===spelunk(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const o=Lve(r,n.slice(0,16),i),a=computeAddress(o);if(r.address){let g=r.address.toLowerCase();g.startsWith("0x")||(g="0x"+g),assertArgument(getAddress(g)===a,"keystore address/privateKey mismatch","address",r.address)}const u={address:a,privateKey:o};if(spelunk(r,"x-ethers.version:string")==="0.1"){const g=n.slice(32,64),y=spelunk(r,"x-ethers.mnemonicCiphertext:data!"),A=spelunk(r,"x-ethers.mnemonicCounter:data!"),I=new CTR(g,A);u.mnemonic={path:spelunk(r,"x-ethers.path:string")||EY,locale:spelunk(r,"x-ethers.locale:string")||"en",entropy:hexlify(getBytes(I.decrypt(y)))}}return u}function TY(r){const e=spelunk(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){const n=spelunk(r,"crypto.kdfparams.salt:data!"),i=spelunk(r,"crypto.kdfparams.n:int!"),s=spelunk(r,"crypto.kdfparams.r:int!"),o=spelunk(r,"crypto.kdfparams.p:int!");assertArgument(i>0&&(i&i-1)===0,"invalid kdf.N","kdf.N",i),assertArgument(s>0&&o>0,"invalid kdf","kdf",e);const a=spelunk(r,"crypto.kdfparams.dklen:int!");return assertArgument(a===32,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:n,N:i,r:s,p:o,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const n=spelunk(r,"crypto.kdfparams.salt:data!"),i=spelunk(r,"crypto.kdfparams.prf:string!"),s=i.split("-").pop();assertArgument(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",i);const o=spelunk(r,"crypto.kdfparams.c:int!"),a=spelunk(r,"crypto.kdfparams.dklen:int!");return assertArgument(a===32,"invalid kdf.dklen","kdf.dklen",a),{name:"pbkdf2",salt:n,count:o,dkLen:a,algorithm:s}}}assertArgument(!1,"unsupported key-derivation function","kdf",e)}function AXe(r,e){const n=JSON.parse(r),i=getPassword(e),s=TY(n);if(s.name==="pbkdf2"){const{salt:A,count:I,dkLen:P,algorithm:D}=s,U=pbkdf2(i,A,I,P,D);return oR(n,U)}assert(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:o,N:a,r:u,p:l,dkLen:g}=s,y=scryptSync(i,o,a,u,l,g);return oR(n,y)}function SY(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function _Xe(r,e,n){const i=JSON.parse(r),s=getPassword(e),o=TY(i);if(o.name==="pbkdf2"){n&&(n(0),await SY(0));const{salt:I,count:P,dkLen:D,algorithm:U}=o,V=pbkdf2(s,I,P,D,U);return n&&(n(1),await SY(0)),oR(i,V)}assert(o.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:a,N:u,r:l,p:g,dkLen:y}=o,A=await scrypt(s,a,u,l,g,y,n);return oR(i,A)}function IY(r){const e=r.salt!=null?hi(r.salt,"options.salt"):Dp(32);let n=1<<17,i=8,s=1;return r.scrypt&&(r.scrypt.N&&(n=r.scrypt.N),r.scrypt.r&&(i=r.scrypt.r),r.scrypt.p&&(s=r.scrypt.p)),xr(typeof n=="number"&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),"invalid scrypt N parameter","options.N",n),xr(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt r parameter","options.r",i),xr(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:e,N:n,r:i,p:s}}function kY(r,e,n,i){const s=hi(n.privateKey,"privateKey"),o=i.iv!=null?hi(i.iv,"options.iv"):Dp(16);xr(o.length===16,"invalid options.iv length","options.iv",i.iv);const a=i.uuid!=null?hi(i.uuid,"options.uuid"):Dp(16);xr(a.length===16,"invalid options.uuid length","options.uuid",i.iv);const u=r.slice(0,16),l=r.slice(16,32),g=new sR(u,o),y=hi(g.encrypt(s)),A=Ss(bo([l,y])),I={address:n.address.substring(2).toLowerCase(),id:Nve(a),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:jn(o).substring(2)},ciphertext:jn(y).substring(2),kdf:"scrypt",kdfparams:{salt:jn(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:A.substring(2)}};if(n.mnemonic){const P=i.client!=null?i.client:`ethers/${FG}`,D=n.mnemonic.path||EY,U=n.mnemonic.locale||"en",V=r.slice(32,64),J=hi(n.mnemonic.entropy,"account.mnemonic.entropy"),re=Dp(16),ce=new sR(V,re),Re=hi(ce.encrypt(J)),De=new Date,Ve="UTC--"+(De.getUTCFullYear()+"-"+TE(De.getUTCMonth()+1,2)+"-"+TE(De.getUTCDate(),2)+"T"+TE(De.getUTCHours(),2)+"-"+TE(De.getUTCMinutes(),2)+"-"+TE(De.getUTCSeconds(),2)+".0Z")+"--"+I.address;I["x-ethers"]={client:P,gethFilename:Ve,path:D,locale:U,mnemonicCounter:jn(re).substring(2),mnemonicCiphertext:jn(Re).substring(2),version:"0.1"}}return JSON.stringify(I)}function Dve(r,e,n){n==null&&(n={});const i=_Y(e),s=IY(n),o=EE(i,s.salt,s.N,s.r,s.p,64);return kY(hi(o),s,r,n)}async function Uve(r,e,n){n==null&&(n={});const i=_Y(e),s=IY(n),o=await _E(i,s.salt,s.N,s.r,s.p,64,n.progressCallback);return kY(hi(o),s,r,n)}const hP="m/44'/60'/0'/0/0",Fve=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),o0=2147483648,Wve=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Hve="0123456789abcdef";function aR(r,e){let n="";for(;r;)n=Hve[r%16]+n,r=Math.trunc(r/16);for(;n.length<e*2;)n="0"+n;return"0x"+n}function pP(r){const e=hi(r),n=kp(gc(gc(e)),0,4),i=bo([e,n]);return cve(i)}const a0={};function RY(r,e,n,i){const s=new Uint8Array(37);r&o0?(Ei(i!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set(hi(i),1)):s.set(hi(n));for(let a=24;a>=0;a-=8)s[33+(a>>3)]=r>>24-a&255;const o=hi(By("sha512",e,s));return{IL:o.slice(0,32),IR:o.slice(32)}}function CY(r,e){const n=e.split("/");xr(n.length>0,"invalid path","path",e),n[0]==="m"&&(xr(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),n.shift());let i=r;for(let s=0;s<n.length;s++){const o=n[s];if(o.match(/^[0-9]+'$/)){const a=parseInt(o.substring(0,o.length-1));xr(a<o0,"invalid path index",`path[${s}]`,o),i=i.deriveChild(o0+a)}else if(o.match(/^[0-9]+$/)){const a=parseInt(o);xr(a<o0,"invalid path index",`path[${s}]`,o),i=i.deriveChild(a)}else xr(!1,"invalid path component",`path[${s}]`,o)}return i}class nd extends aP{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,n,i,s,o,a,u,l,g){super(n,g),Ip(e,a0,"HDNodeWallet"),Ki(this,{publicKey:n.compressedPublicKey});const y=kp(Vw(gc(this.publicKey)),0,4);Ki(this,{parentFingerprint:i,fingerprint:y,chainCode:s,path:o,index:a,depth:u}),Ki(this,{mnemonic:l})}connect(e){return new nd(a0,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#e(){const e={address:this.address,privateKey:this.privateKey},n=this.mnemonic;return this.path&&n&&n.wordlist.locale==="en"&&n.password===""&&(e.mnemonic={path:this.path,locale:"en",entropy:n.entropy}),e}async encrypt(e,n){return await Uve(this.#e(),e,{progressCallback:n})}encryptSync(e){return Dve(this.#e(),e)}get extendedKey(){return Ei(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),pP(bo(["0x0488ADE4",aR(this.depth,1),this.parentFingerprint,aR(this.index,4),this.chainCode,bo(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new SE(a0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const n=zu(e,"index");xr(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~o0),n&o0&&(i+="'"));const{IR:s,IL:o}=RY(n,this.chainCode,this.publicKey,this.privateKey),a=new $u(eh((Ek(o)+BigInt(this.privateKey))%Wve,32));return new nd(a0,a,this.fingerprint,jn(s),i,n,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return CY(this,e)}static#t(e,n){xr(wk(e),"invalid seed","seed","[REDACTED]");const i=hi(e,"seed");xr(i.length>=16&&i.length<=64,"invalid seed","seed","[REDACTED]");const s=hi(By("sha512",Fve,i)),o=new $u(jn(s.slice(0,32)));return new nd(a0,o,"0x00000000",jn(s.slice(32)),"m",0,0,n,null)}static fromExtendedKey(e){const n=jc(lve(e));xr(n.length===82||pP(n.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const i=n[4],s=jn(n.slice(5,9)),o=parseInt(jn(n.slice(9,13)).substring(2),16),a=jn(n.slice(13,45)),u=n.slice(45,78);switch(jn(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const l=jn(u);return new SE(a0,Hk(l),l,s,a,null,o,i,null)}case"0x0488ade4":case"0x04358394 ":if(u[0]!==0)break;return new nd(a0,new $u(u.slice(1)),s,a,null,o,i,null,null)}xr(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,n,i){e==null&&(e=""),n==null&&(n=hP),i==null&&(i=Cy.wordlist());const s=xy.fromEntropy(Dp(16),e,i);return nd.#t(s.computeSeed(),s).derivePath(n)}static fromMnemonic(e,n){return n||(n=hP),nd.#t(e.computeSeed(),e).derivePath(n)}static fromPhrase(e,n,i,s){n==null&&(n=""),i==null&&(i=hP),s==null&&(s=Cy.wordlist());const o=xy.fromPhrase(e,n,s);return nd.#t(o.computeSeed(),o).derivePath(i)}static fromSeed(e){return nd.#t(e,null)}}class SE extends nP{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,n,i,s,o,a,u,l,g){super(n,g),Ip(e,a0,"HDNodeVoidWallet"),Ki(this,{publicKey:i});const y=kp(Vw(gc(i)),0,4);Ki(this,{publicKey:i,fingerprint:y,parentFingerprint:s,chainCode:o,path:a,index:u,depth:l})}connect(e){return new SE(a0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return Ei(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),pP(bo(["0x0488B21E",aR(this.depth,1),this.parentFingerprint,aR(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(e){const n=zu(e,"index");xr(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~o0),n&o0&&(i+="'"));const{IR:s,IL:o}=RY(n,this.chainCode,this.publicKey,null),a=$u.addPoints(o,this.publicKey,!0),u=Hk(a);return new SE(a0,u,a,this.fingerprint,jn(s),i,n,this.depth+1,this.provider)}derivePath(e){return CY(this,e)}}function EXe(r){const e=getNumber(r,"index");return assertArgument(e>=0&&e<o0,"invalid account index","index",e),`m/44'/60'/${e}'/0/0`}function TXe(r){const e=getNumber(r,"index");return assertArgument(e>=0&&e<o0,"invalid account index","index",e),`m/44'/60'/0'/0/${e}`}const zve={en:Cy.wordlist()};var gP;function Zc(r){const e=new Set;return r.forEach(n=>e.add(n)),Object.freeze(e)}const xY="constant external internal payable private public pure view",$ve=Zc(xY.split(" ")),BY="constructor error event fallback function receive struct",OY=Zc(BY.split(" ")),PY="calldata memory storage payable indexed",Vve=Zc(PY.split(" ")),jve=[BY,PY,"tuple returns",xY].join(" "),Kve=Zc(jve.split(" ")),Gve={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},qve=new RegExp("^(\\s*)"),Zve=new RegExp("^([0-9]+)"),Yve=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),NY=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),MY=new RegExp("^(trcToken|address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class u0{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new gP(this.#t)}reset(){this.#e=0}#r(e=0,n=0){return new gP(this.#t.slice(e,n).map(i=>Object.freeze(Object.assign({},i,{match:i.match-e,linkBack:i.linkBack-e,linkNext:i.linkNext-e}))))}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;this.#e<e.match-1;){const i=this.peek().linkNext;n.push(this.#r(this.#e+1,i)),this.#e=i}return this.#e=e.match+1,n}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return this.#e++,e}toString(){const e=[];for(let n=this.#e;n<this.#t.length;n++){const i=this.#t[n];e.push(`${i.type}:${i.text}`)}return`<TokenString ${e.join(" ")}>`}}gP=u0;function Fy(r){const e=[],n=a=>{const u=o<r.length?JSON.stringify(r[o]):"$EOI";throw new Error(`invalid token ${u} at ${o}: ${a}`)},i=[],s=[];let o=0;for(;o<r.length;){let a=r.substring(o),u=a.match(qve);u&&(o+=u[1].length,a=r.substring(o));const l={depth:i.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:o,value:-1};e.push(l);const g=Gve[a[0]]||"";if(g){if(l.type=g,l.text=a[0],o++,g==="OPEN_PAREN")i.push(e.length-1),s.push(e.length-1);else if(g=="CLOSE_PAREN")i.length===0&&n("no matching open bracket"),l.match=i.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1;else if(g==="COMMA")l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(g==="OPEN_BRACKET")l.type="BRACKET";else if(g==="CLOSE_BRACKET"){let y=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const A=e.pop().text;y=A+y,e[e.length-1].value=zu(A)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=y}continue}if(u=a.match(Yve),u){if(l.text=u[1],o+=l.text.length,Kve.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(MY)){l.type="TYPE";continue}l.type="ID";continue}if(u=a.match(Zve),u){l.text=u[1],l.type="NUMBER",o+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${o}`)}return new u0(e.map(a=>Object.freeze(a)))}function LY(r,e){const n=[];for(const i in e.keys())r.has(i)&&n.push(i);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function uR(r,e){if(e.peekKeyword(OY)){const n=e.pop().text;if(n!==r)throw new Error(`expected ${r}, got ${n}`)}return e.popType("ID")}function Fp(r,e){const n=new Set;for(;;){const i=r.peekType("KEYWORD");if(i==null||e&&!e.has(i))break;if(r.pop(),n.has(i))throw new Error(`duplicate keywords: ${JSON.stringify(i)}`);n.add(i)}return Object.freeze(n)}function DY(r){const e=Fp(r,$ve);return LY(e,Zc("constant payable nonpayable".split(" "))),LY(e,Zc("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Wp(r,e){return r.popParams().map(n=>da.from(n,e))}function UY(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return lo(r.pop().text);throw new Error("invalid gas")}return null}function Jb(r){if(r.length)throw new Error(`unexpected tokens: ${r.toString()}`)}const Xve=new RegExp(/^(.*)\[([0-9]*)\]$/);function FY(r){const e=r.match(MY);if(xr(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){const n=parseInt(e[2]);xr(n!==0&&n<=32,"invalid bytes length","type",r)}else if(e[3]){const n=parseInt(e[3]);xr(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",r)}return r}const fa={},Ml=Symbol.for("_ethers_internal"),WY="_ParamTypeInternal",HY="_ErrorInternal",zY="_EventInternal",$Y="_ConstructorInternal",VY="_FallbackInternal",jY="_FunctionInternal",KY="_StructInternal";class da{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,n,i,s,o,a,u,l){if(Ip(e,fa,"ParamType"),Object.defineProperty(this,Ml,{value:WY}),a&&(a=Object.freeze(a.slice())),s==="array"){if(u==null||l==null)throw new Error("")}else if(u!=null||l!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Ki(this,{name:n,type:i,baseType:s,indexed:o,components:a,arrayLength:u,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const i={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(n+=this.type),n+="("+this.components.map(i=>i.format(e)).join(e==="full"?", ":",")+")"):n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");return e.map(i=>this.arrayChildren?.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");return e.map((i,s)=>this.components?.[s].walk(i,n))}return n(this.type,e)}#e(e,n,i,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,u=n.slice();u.forEach((l,g)=>{a.#e(e,l,i,y=>{u[g]=y})}),s(u);return}if(this.isTuple()){const a=this.components;let u;if(Array.isArray(n))u=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");u=a.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(u.length!==this.components.length)throw new Error("array is wrong length");u.forEach((l,g)=>{a[g].#e(e,l,i,y=>{u[g]=y})}),s(u);return}const o=i(this.type,n);o.then?e.push(async function(){s(await o)}()):s(o)}async walkAsync(e,n){const i=[],s=[e];return this.#e(i,e,n,o=>{s[0]=o}),i.length&&await Promise.all(i),s[0]}static from(e,n){if(da.isParamType(e))return e;if(typeof e=="string")return da.from(Fy(e),n);if(e instanceof u0){let u="",l="",g=null;Fp(e,Zc(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",g=e.popParams().map(U=>da.from(U)),u=`tuple(${g.map(U=>U.format()).join(",")})`):(u=FY(e.popType("TYPE")),l=u);let y=null,A=null;for(;e.length&&e.peekType("BRACKET");){const U=e.pop();y=new da(fa,"",u,l,null,g,A,y),A=U.value,u+=U.text,l="array",g=null}let I=null;if(Fp(e,Vve).has("indexed")){if(!n)throw new Error("");I=!0}const D=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new da(fa,D,u,l,I,g,A,y)}const i=e.name;xr(!i||typeof i=="string"&&i.match(NY),"invalid name","obj.name",i);let s=e.indexed;s!=null&&(xr(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let o=e.type;const a=o.match(Xve);if(a){const u=parseInt(a[2]||"-1"),l=da.from({type:a[1],components:e.components});return new da(fa,i||"",o,"array",s,null,u,l)}if(o==="tuple"||o.startsWith("tuple(")||o.startsWith("(")){const u=e.components!=null?e.components.map(g=>da.from(g)):null;return new da(fa,i||"",o,"tuple",s,u,null,null)}return o=FY(e.type),new da(fa,i||"",o,o,s,null,null,null)}static isParamType(e){return e&&e[Ml]===WY}}class Qb{type;inputs;constructor(e,n,i){Ip(e,fa,"Fragment"),i=Object.freeze(i.slice()),Ki(this,{type:n,inputs:i})}static from(e){if(typeof e=="string"){try{Qb.from(JSON.parse(e))}catch{}return Qb.from(Fy(e))}if(e instanceof u0)switch(e.peekKeyword(OY)){case"constructor":return Hp.from(e);case"error":return Ll.from(e);case"event":return c0.from(e);case"fallback":case"receive":return zp.from(e);case"function":return l0.from(e);case"struct":return e1.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Hp.from(e);case"error":return Ll.from(e);case"event":return c0.from(e);case"fallback":case"receive":return zp.from(e);case"function":return l0.from(e);case"struct":return e1.from(e)}Ei(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}xr(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Hp.isFragment(e)}static isError(e){return Ll.isFragment(e)}static isEvent(e){return c0.isFragment(e)}static isFunction(e){return l0.isFragment(e)}static isStruct(e){return e1.isFragment(e)}}class cR extends Qb{name;constructor(e,n,i,s){super(e,n,s),xr(typeof i=="string"&&i.match(NY),"invalid identifier","name",i),s=Object.freeze(s.slice()),Ki(this,{name:i})}}function IE(r,e){return"("+e.map(n=>n.format(r)).join(r==="full"?", ":",")+")"}class Ll extends cR{constructor(e,n,i){super(e,"error",n,i),Object.defineProperty(this,Ml,{value:HY})}get selector(){return Bl(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+IE(e,this.inputs)),n.join(" ")}static from(e){if(Ll.isFragment(e))return e;if(typeof e=="string")return Ll.from(Fy(e));if(e instanceof u0){const n=uR("error",e),i=Wp(e);return Jb(e),new Ll(fa,n,i)}return new Ll(fa,e.name,e.inputs?e.inputs.map(da.from):[])}static isFragment(e){return e&&e[Ml]===HY}}class c0 extends cR{anonymous;constructor(e,n,i,s){super(e,"event",n,i),Object.defineProperty(this,Ml,{value:zY}),Ki(this,{anonymous:s})}get topicHash(){return Bl(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});const n=[];return e!=="sighash"&&n.push("event"),n.push(this.name+IE(e,this.inputs)),e!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(e,n){return n=(n||[]).map(s=>da.from(s)),new c0(fa,e,n,!1).topicHash}static from(e){if(c0.isFragment(e))return e;if(typeof e=="string")return c0.from(Fy(e));if(e instanceof u0){const n=uR("event",e),i=Wp(e,!0),s=!!Fp(e,Zc(["anonymous"])).has("anonymous");return Jb(e),new c0(fa,n,i,s)}return new c0(fa,e.name,e.inputs?e.inputs.map(n=>da.from(n,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[Ml]===zY}}class Hp extends Qb{payable;gas;constructor(e,n,i,s,o){super(e,n,i),Object.defineProperty(this,Ml,{value:$Y}),Ki(this,{payable:s,gas:o})}format(e){if(Ei(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});const n=[`constructor${IE(e,this.inputs)}`];return n.push(this.payable?"payable":"nonpayable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(e){if(Hp.isFragment(e))return e;if(typeof e=="string")return Hp.from(Fy(e));if(e instanceof u0){Fp(e,Zc(["constructor"]));const n=Wp(e),i=!!Fp(e,Zc(["payable"])).has("payable"),s=UY(e);return Jb(e),new Hp(fa,"constructor",n,i,s)}return new Hp(fa,"constructor",e.inputs?e.inputs.map(da.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Ml]===$Y}}class zp extends Qb{payable;constructor(e,n,i){super(e,"fallback",n),Object.defineProperty(this,Ml,{value:VY}),Ki(this,{payable:i})}format(e){const n=this.inputs.length===0?"receive":"fallback";if(e==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(e){if(zp.isFragment(e))return e;if(typeof e=="string")return zp.from(Fy(e));if(e instanceof u0){const n=e.toString(),i=e.peekKeyword(Zc(["fallback","receive"]));if(xr(i,"type must be fallback or receive","obj",n),e.popKeyword(Zc(["fallback","receive"]))==="receive"){const u=Wp(e);return xr(u.length===0,"receive cannot have arguments","obj.inputs",u),Fp(e,Zc(["payable"])),Jb(e),new zp(fa,[],!0)}let o=Wp(e);o.length?xr(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(u=>u.format("minimal")).join(", ")):o=[da.from("bytes")];const a=DY(e);if(xr(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Fp(e,Zc(["returns"])).has("returns")){const u=Wp(e);xr(u.length===1&&u[0].type==="bytes","invalid fallback outputs","obj.outputs",u.map(l=>l.format("minimal")).join(", "))}return Jb(e),new zp(fa,o,a==="payable")}if(e.type==="receive")return new zp(fa,[],!0);if(e.type==="fallback"){const n=[da.from("bytes")],i=e.stateMutability==="payable";return new zp(fa,n,i)}xr(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[Ml]===VY}}class l0 extends cR{constant;outputs;stateMutability;payable;gas;constructor(e,n,i,s,o,a){super(e,"function",n,s),Object.defineProperty(this,Ml,{value:jY}),o=Object.freeze(o.slice()),Ki(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Bl(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e))),outputs:this.outputs.map(i=>JSON.parse(i.format(e)))});const n=[];return e!=="sighash"&&n.push("function"),n.push(this.name+IE(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(IE(e,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(e,n){return n=(n||[]).map(s=>da.from(s)),new l0(fa,e,"view",n,[],null).selector}static from(e){if(l0.isFragment(e))return e;if(typeof e=="string")return l0.from(Fy(e));if(e instanceof u0){const i=uR("function",e),s=Wp(e),o=DY(e);let a=[];Fp(e,Zc(["returns"])).has("returns")&&(a=Wp(e));const u=UY(e);return Jb(e),new l0(fa,i,o,s,a,u)}let n=e.stateMutability;return n==null&&(n="payable",typeof e.constant=="boolean"?(n="view",e.constant||(n="payable",typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable")),new l0(fa,e.name,n,e.inputs?e.inputs.map(da.from):[],e.outputs?e.outputs.map(da.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Ml]===jY}}class e1 extends cR{constructor(e,n,i){super(e,"struct",n,i),Object.defineProperty(this,Ml,{value:KY})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")return e1.from(Fy(e));if(e instanceof u0){const n=uR("struct",e),i=Wp(e);return Jb(e),new e1(fa,n,i)}return new e1(fa,e.name,e.inputs?e.inputs.map(da.from):[])}static isFragment(e){return e&&e[Ml]===KY}}class Jve{fragment;name;signature;topic;args;constructor(e,n,i){const s=e.name,o=e.format();Ki(this,{fragment:e,name:s,signature:o,topic:n,args:i})}}class Qve{fragment;name;args;signature;selector;value;constructor(e,n,i,s){const o=e.name,a=e.format();Ki(this,{fragment:e,name:o,args:i,signature:a,selector:n,value:s})}}class ewe{fragment;name;args;signature;selector;constructor(e,n,i){const s=e.name,o=e.format();Ki(this,{fragment:e,name:s,args:i,signature:o,selector:n})}}class GY{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){Ki(this,{hash:e,_isIndexed:!0})}}const qY={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},ZY={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&qY[r.toString()]&&(e=qY[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}};class Jw{fragments;deploy;fallback;receive;#e;#t;#r;#n;constructor(e){let n=[];typeof e=="string"?n=JSON.parse(e):n=e,this.#r=new Map,this.#e=new Map,this.#t=new Map;const i=[];for(const a of n)try{i.push(Qb.from(a))}catch(u){console.log("EE",u)}Ki(this,{fragments:Object.freeze(i)});let s=null,o=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((a,u)=>{let l;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ki(this,{deploy:a});return;case"fallback":a.inputs.length===0?o=!0:(xr(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${u}]`,a),s=a,o=s.payable);return;case"function":l=this.#r;break;case"event":l=this.#t;break;case"error":l=this.#e;break;default:return}const g=a.format();l.has(g)||l.set(g,a)}),this.deploy||Ki(this,{deploy:Hp.from("constructor()")}),Ki(this,{fallback:s,receive:o})}format(e){const n=e?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return Lp.defaultAbiCoder()}#i(e,n,i){if(pc(e)){const o=e.toLowerCase();for(const a of this.#r.values())if(o===a.selector)return a;return null}if(e.indexOf("(")===-1){const o=[];for(const[a,u]of this.#r)a.split("(")[0]===e&&o.push(u);if(n){const a=n.length>0?n[n.length-1]:null;let u=n.length,l=!0;Ea.isTyped(a)&&a.type==="overrides"&&(l=!1,u--);for(let g=o.length-1;g>=0;g--){const y=o[g].inputs.length;y!==u&&(!l||y!==u-1)&&o.splice(g,1)}for(let g=o.length-1;g>=0;g--){const y=o[g].inputs;for(let A=0;A<n.length;A++)if(Ea.isTyped(n[A])){if(A>=y.length){if(n[A].type==="overrides")continue;o.splice(g,1);break}if(n[A].type!==y[A].baseType){o.splice(g,1);break}}}}if(o.length===1&&n&&n.length!==o[0].inputs.length){const a=n[n.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&o.splice(0,1)}if(o.length===0)return null;if(o.length>1&&i){const a=o.map(u=>JSON.stringify(u.format())).join(", ");xr(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return o[0]}const s=this.#r.get(l0.from(e).format());return s||null}getFunctionName(e){const n=this.#i(e,null,!1);return xr(n,"no matching function","key",e),n.name}hasFunction(e){return!!this.#i(e,null,!1)}getFunction(e,n){return this.#i(e,n||null,!0)}forEachFunction(e){const n=Array.from(this.#r.keys());n.sort((i,s)=>i.localeCompare(s));for(let i=0;i<n.length;i++){const s=n[i];e(this.#r.get(s),i)}}#s(e,n,i){if(pc(e)){const o=e.toLowerCase();for(const a of this.#t.values())if(o===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const o=[];for(const[a,u]of this.#t)a.split("(")[0]===e&&o.push(u);if(n){for(let a=o.length-1;a>=0;a--)o[a].inputs.length<n.length&&o.splice(a,1);for(let a=o.length-1;a>=0;a--){const u=o[a].inputs;for(let l=0;l<n.length;l++)if(Ea.isTyped(n[l])&&n[l].type!==u[l].baseType){o.splice(a,1);break}}}if(o.length===0)return null;if(o.length>1&&i){const a=o.map(u=>JSON.stringify(u.format())).join(", ");xr(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return o[0]}const s=this.#t.get(c0.from(e).format());return s||null}getEventName(e){const n=this.#s(e,null,!1);return xr(n,"no matching event","key",e),n.name}hasEvent(e){return!!this.#s(e,null,!1)}getEvent(e,n){return this.#s(e,n||null,!0)}forEachEvent(e){const n=Array.from(this.#t.keys());n.sort((i,s)=>i.localeCompare(s));for(let i=0;i<n.length;i++){const s=n[i];e(this.#t.get(s),i)}}getError(e,n){if(pc(e)){const s=e.toLowerCase();if(ZY[s])return Ll.from(ZY[s].signature);for(const o of this.#e.values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of this.#e)o.split("(")[0]===e&&s.push(a);if(s.length===0)return e==="Error"?Ll.from("error Error(string)"):e==="Panic"?Ll.from("error Panic(uint256)"):null;if(s.length>1){const o=s.map(a=>JSON.stringify(a.format())).join(", ");xr(!1,`ambiguous error description (i.e. ${o})`,"name",e)}return s[0]}if(e=Ll.from(e).format(),e==="Error(string)")return Ll.from("error Error(string)");if(e==="Panic(uint256)")return Ll.from("error Panic(uint256)");const i=this.#e.get(e);return i||null}forEachError(e){const n=Array.from(this.#e.keys());n.sort((i,s)=>i.localeCompare(s));for(let i=0;i<n.length;i++){const s=n[i];e(this.#e.get(s),i)}}_decodeParams(e,n){return this.#n.decode(e,n)}_encodeParams(e,n){return this.#n.encode(e,n)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,n){if(typeof e=="string"){const i=this.getError(e);xr(i,"unknown error","fragment",e),e=i}return xr(kp(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,kp(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const i=this.getError(e);xr(i,"unknown error","fragment",e),e=i}return bo([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionData(e,n){if(typeof e=="string"){const i=this.getFunction(e);xr(i,"unknown function","fragment",e),e=i}return xr(kp(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,kp(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const i=this.getFunction(e);xr(i,"unknown function","fragment",e),e=i}return bo([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionResult(e,n){if(typeof e=="string"){const o=this.getFunction(e);xr(o,"unknown function","fragment",e),e=o}let i="invalid length for result data";const s=hc(n);if(s.length%32===0)try{return this.#n.decode(e.outputs,s)}catch{i="could not decode result data"}Ei(!1,i,"BAD_DATA",{value:jn(s),info:{method:e.name,signature:e.format()}})}makeError(e,n){const i=hi(e,"data"),s=Lp.getBuiltinCallException("call",n,i);if(s.message.startsWith("execution reverted (unknown custom error)")){const u=jn(i.slice(0,4)),l=this.getError(u);if(l)try{const g=this.#n.decode(l.inputs,i.slice(4));s.revert={name:l.name,signature:l.format(),args:g},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(n);return a&&(s.invocation={method:a.name,signature:a.signature,args:a.args}),s}encodeFunctionResult(e,n){if(typeof e=="string"){const i=this.getFunction(e);xr(i,"unknown function","fragment",e),e=i}return jn(this.#n.encode(e.outputs,n||[]))}encodeFilterTopics(e,n){if(typeof e=="string"){const o=this.getEvent(e);xr(o,"unknown event","eventFragment",e),e=o}Ei(n.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:e.inputs.length});const i=[];e.anonymous||i.push(e.topicHash);const s=(o,a)=>o.type==="string"?Bl(a):o.type==="bytes"?Ss(jn(a)):(o.type==="bool"&&typeof a=="boolean"&&(a=a?"0x01":"0x00"),o.type.match(/^u?int/)&&(a=eh(a)),o.type==="address"&&this.#n.encode(["address"],[a]),Ey(jn(a),32));for(n.forEach((o,a)=>{const u=e.inputs[a];if(!u.indexed){xr(o==null,"cannot filter non-indexed parameters; must be null","contract."+u.name,o);return}o==null?i.push(null):u.baseType==="array"||u.baseType==="tuple"?xr(!1,"filtering with tuples or arrays not supported","contract."+u.name,o):Array.isArray(o)?i.push(o.map(l=>s(u,l))):i.push(s(u,o))});i.length&&i[i.length-1]===null;)i.pop();return i}encodeEventLog(e,n){if(typeof e=="string"){const a=this.getEvent(e);xr(a,"unknown event","eventFragment",e),e=a}const i=[],s=[],o=[];return e.anonymous||i.push(e.topicHash),xr(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((a,u)=>{const l=n[u];if(a.indexed)if(a.type==="string")i.push(Bl(l));else if(a.type==="bytes")i.push(Ss(l));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");i.push(this.#n.encode([a.type],[l]))}else s.push(a),o.push(l)}),{data:this.#n.encode(s,o),topics:i}}decodeEventLog(e,n,i){if(typeof e=="string"){const P=this.getEvent(e);xr(P,"unknown event","eventFragment",e),e=P}if(i!=null&&!e.anonymous){const P=e.topicHash;xr(pc(i[0],32)&&i[0].toLowerCase()===P,"fragment/topic mismatch","topics[0]",i[0]),i=i.slice(1)}const s=[],o=[],a=[];e.inputs.forEach((P,D)=>{P.indexed?P.type==="string"||P.type==="bytes"||P.baseType==="tuple"||P.baseType==="array"?(s.push(da.from({type:"bytes32",name:P.name})),a.push(!0)):(s.push(P),a.push(!1)):(o.push(P),a.push(!1))});const u=i!=null?this.#n.decode(s,bo(i)):null,l=this.#n.decode(o,n,!0),g=[],y=[];let A=0,I=0;return e.inputs.forEach((P,D)=>{let U=null;if(P.indexed)if(u==null)U=new GY(null);else if(a[D])U=new GY(u[I++]);else try{U=u[I++]}catch(V){U=V}else try{U=l[A++]}catch(V){U=V}g.push(U),y.push(P.name||null)}),Cp.fromItems(g,y)}parseTransaction(e){const n=hi(e.data,"tx.data"),i=lo(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(jn(n.slice(0,4)));if(!s)return null;const o=this.#n.decode(s.inputs,n.slice(4));return new Qve(s,s.selector,o,i)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Jve(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=jn(e),i=this.getError(kp(n,0,4));if(!i)return null;const s=this.#n.decode(i.inputs,kp(n,4));return new ewe(i,i.selector,s)}static from(e){return e instanceof Jw?e:typeof e=="string"?new Jw(JSON.parse(e)):typeof e.format=="function"?new Jw(e.format("json")):new Jw(e)}}var YY=tn(36533).Buffer;const twe=r=>ca.from(r),XY=r=>ca.from(r).serialized,JY=r=>hi(r),rwe={sighash:"sighash",minimal:"minimal",full:"full",json:"json"},nwe=xy.isValidMnemonic;By.register((r,e,n)=>By._(r,YY.from(e),YY.from(n)));const QY=34,id="41",eX=65,Qw=/^(41)/,tX="m/44'/195'",yP=tX+"/0'/0/0";function rX(r){return $b(r)?Hy(zc(r.replace(/^0x/,id))):r}function mi(r){return $b(r)?r.toLowerCase().replace(/^0x/,id):Xs(IJ(r)).toLowerCase()}function iwe(r){r=r.toLowerCase();const e=r.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=e[s].charCodeAt(0);const i=zc(Ss(n).slice(2));for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(i[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return id+e.join("")}function mP(r){if(!kE(r))throw new Error(`'${r}' is not a valid address string`);return iwe(mi(r))}function nX(r){if(!$b(r)||r.length!==42)return!1;try{return mP(r)===r}catch{return!1}}function iX(r,e=!1){try{return OR(r,e)}catch{return!1}}function kE(r){if(!r||!$c(r))return!1;if(r.length===42)try{return kE(Hy(zc(r)))}catch{return!1}try{return RJ(r)}catch{return!1}}const bP="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",vP={};for(let r=0;r<bP.length;r++)vP[bP.charAt(r)]=r;const RE=58;function sX(r){if(r.length===0)return"";let e,n;const i=[0];for(e=0;e<r.length;e++){for(n=0;n<i.length;n++)i[n]<<=8;i[0]+=r[e];let s=0;for(n=0;n<i.length;++n)i[n]+=s,s=i[n]/RE|0,i[n]%=RE;for(;s;)i.push(s%RE),s=s/RE|0}for(e=0;r[e]===0&&e<r.length-1;e++)i.push(0);return i.reverse().map(s=>bP[s]).join("")}function lR(r){if(r.length===0)return[];let e,n;const i=[0];for(e=0;e<r.length;e++){const s=r[e];if(!(s in vP))throw new Error("Non-base58 character");for(n=0;n<i.length;n++)i[n]*=RE;i[0]+=vP[s];let o=0;for(n=0;n<i.length;++n)i[n]+=o,o=i[n]>>8,i[n]&=255;for(;o;)i.push(o&255),o>>=8}for(e=0;r[e]==="1"&&e<r.length-1;e++)i.push(0);return i.reverse()}function oX(r,e){return function(){return r.apply(e,arguments)}}var aX=tn(85409);const{toString:swe}=Object.prototype,{getPrototypeOf:wP}=Object,fR=(r=>e=>{const n=swe.call(e);return r[n]||(r[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),sh=r=>(r=r.toLowerCase(),e=>fR(e)===r),dR=r=>e=>typeof e===r,{isArray:e2}=Array,CE=dR("undefined");function owe(r){return r!==null&&!CE(r)&&r.constructor!==null&&!CE(r.constructor)&&Af(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const uX=sh("ArrayBuffer");function awe(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&uX(r.buffer),e}const uwe=dR("string"),Af=dR("function"),cX=dR("number"),hR=r=>r!==null&&typeof r=="object",cwe=r=>r===!0||r===!1,pR=r=>{if(fR(r)!=="object")return!1;const e=wP(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},lwe=sh("Date"),fwe=sh("File"),dwe=sh("Blob"),hwe=sh("FileList"),pwe=r=>hR(r)&&Af(r.pipe),gwe=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Af(r.append)&&((e=fR(r))==="formdata"||e==="object"&&Af(r.toString)&&r.toString()==="[object FormData]"))},ywe=sh("URLSearchParams"),[mwe,bwe,vwe,wwe]=["ReadableStream","Request","Response","Headers"].map(sh),Awe=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xE(r,e,{allOwnKeys:n=!1}={}){if(r===null||typeof r>"u")return;let i,s;if(typeof r!="object"&&(r=[r]),e2(r))for(i=0,s=r.length;i<s;i++)e.call(null,r[i],i,r);else{const o=n?Object.getOwnPropertyNames(r):Object.keys(r),a=o.length;let u;for(i=0;i<a;i++)u=o[i],e.call(null,r[u],u,r)}}function lX(r,e){e=e.toLowerCase();const n=Object.keys(r);let i=n.length,s;for(;i-- >0;)if(s=n[i],e===s.toLowerCase())return s;return null}const t1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,fX=r=>!CE(r)&&r!==t1;function AP(){const{caseless:r}=fX(this)&&this||{},e={},n=(i,s)=>{const o=r&&lX(e,s)||s;pR(e[o])&&pR(i)?e[o]=AP(e[o],i):pR(i)?e[o]=AP({},i):e2(i)?e[o]=i.slice():e[o]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&xE(arguments[i],n);return e}const _we=(r,e,n,{allOwnKeys:i}={})=>(xE(e,(s,o)=>{n&&Af(s)?r[o]=oX(s,n):r[o]=s},{allOwnKeys:i}),r),Ewe=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Twe=(r,e,n,i)=>{r.prototype=Object.create(e.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),n&&Object.assign(r.prototype,n)},Swe=(r,e,n,i)=>{let s,o,a;const u={};if(e=e||{},r==null)return e;do{for(s=Object.getOwnPropertyNames(r),o=s.length;o-- >0;)a=s[o],(!i||i(a,r,e))&&!u[a]&&(e[a]=r[a],u[a]=!0);r=n!==!1&&wP(r)}while(r&&(!n||n(r,e))&&r!==Object.prototype);return e},Iwe=(r,e,n)=>{r=String(r),(n===void 0||n>r.length)&&(n=r.length),n-=e.length;const i=r.indexOf(e,n);return i!==-1&&i===n},kwe=r=>{if(!r)return null;if(e2(r))return r;let e=r.length;if(!cX(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=r[e];return n},Rwe=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&wP(Uint8Array)),Cwe=(r,e)=>{const i=(r&&r[Symbol.iterator]).call(r);let s;for(;(s=i.next())&&!s.done;){const o=s.value;e.call(r,o[0],o[1])}},xwe=(r,e)=>{let n;const i=[];for(;(n=r.exec(e))!==null;)i.push(n);return i},Bwe=sh("HTMLFormElement"),Owe=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),dX=(({hasOwnProperty:r})=>(e,n)=>r.call(e,n))(Object.prototype),Pwe=sh("RegExp"),hX=(r,e)=>{const n=Object.getOwnPropertyDescriptors(r),i={};xE(n,(s,o)=>{let a;(a=e(s,o,r))!==!1&&(i[o]=a||s)}),Object.defineProperties(r,i)},Nwe=r=>{hX(r,(e,n)=>{if(Af(r)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=r[n];if(Af(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Mwe=(r,e)=>{const n={},i=s=>{s.forEach(o=>{n[o]=!0})};return e2(r)?i(r):i(String(r).split(e)),n},Lwe=()=>{},Dwe=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function Uwe(r){return!!(r&&Af(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const Fwe=r=>{const e=new Array(10),n=(i,s)=>{if(hR(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const o=e2(i)?[]:{};return xE(i,(a,u)=>{const l=n(a,s+1);!CE(l)&&(o[u]=l)}),e[s]=void 0,o}}return i};return n(r,0)},Wwe=sh("AsyncFunction"),Hwe=r=>r&&(hR(r)||Af(r))&&Af(r.then)&&Af(r.catch),pX=((r,e)=>r?setImmediate:e?((n,i)=>(t1.addEventListener("message",({source:s,data:o})=>{s===t1&&o===n&&i.length&&i.shift()()},!1),s=>{i.push(s),t1.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Af(t1.postMessage)),zwe=typeof queueMicrotask<"u"?queueMicrotask.bind(t1):typeof aX<"u"&&aX.nextTick||pX,cn={isArray:e2,isArrayBuffer:uX,isBuffer:owe,isFormData:gwe,isArrayBufferView:awe,isString:uwe,isNumber:cX,isBoolean:cwe,isObject:hR,isPlainObject:pR,isReadableStream:mwe,isRequest:bwe,isResponse:vwe,isHeaders:wwe,isUndefined:CE,isDate:lwe,isFile:fwe,isBlob:dwe,isRegExp:Pwe,isFunction:Af,isStream:pwe,isURLSearchParams:ywe,isTypedArray:Rwe,isFileList:hwe,forEach:xE,merge:AP,extend:_we,trim:Awe,stripBOM:Ewe,inherits:Twe,toFlatObject:Swe,kindOf:fR,kindOfTest:sh,endsWith:Iwe,toArray:kwe,forEachEntry:Cwe,matchAll:xwe,isHTMLForm:Bwe,hasOwnProperty:dX,hasOwnProp:dX,reduceDescriptors:hX,freezeMethods:Nwe,toObjectSet:Mwe,toCamelCase:Owe,noop:Lwe,toFiniteNumber:Dwe,findKey:lX,global:t1,isContextDefined:fX,isSpecCompliantForm:Uwe,toJSONObject:Fwe,isAsyncFn:Wwe,isThenable:Hwe,setImmediate:pX,asap:zwe};function t2(r,e,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}cn.inherits(t2,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:cn.toJSONObject(this.config),code:this.code,status:this.status}}});const gX=t2.prototype,yX={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{yX[r]={value:r}}),Object.defineProperties(t2,yX),Object.defineProperty(gX,"isAxiosError",{value:!0}),t2.from=(r,e,n,i,s,o)=>{const a=Object.create(gX);return cn.toFlatObject(r,a,function(l){return l!==Error.prototype},u=>u!=="isAxiosError"),t2.call(a,r.message,e,n,i,s),a.cause=r,a.name=r.name,o&&Object.assign(a,o),a};const ws=t2,mX=null;var $we=tn(36533).Buffer;function _P(r){return cn.isPlainObject(r)||cn.isArray(r)}function bX(r){return cn.endsWith(r,"[]")?r.slice(0,-2):r}function vX(r,e,n){return r?r.concat(e).map(function(s,o){return s=bX(s),!n&&o?"["+s+"]":s}).join(n?".":""):e}function Vwe(r){return cn.isArray(r)&&!r.some(_P)}const jwe=cn.toFlatObject(cn,{},null,function(e){return/^is[A-Z]/.test(e)});function Kwe(r,e,n){if(!cn.isObject(r))throw new TypeError("target must be an object");e=e||new(mX||FormData),n=cn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(U,V){return!cn.isUndefined(V[U])});const i=n.metaTokens,s=n.visitor||y,o=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&cn.isSpecCompliantForm(e);if(!cn.isFunction(s))throw new TypeError("visitor must be a function");function g(D){if(D===null)return"";if(cn.isDate(D))return D.toISOString();if(!l&&cn.isBlob(D))throw new ws("Blob is not supported. Use a Buffer instead.");return cn.isArrayBuffer(D)||cn.isTypedArray(D)?l&&typeof Blob=="function"?new Blob([D]):$we.from(D):D}function y(D,U,V){let J=D;if(D&&!V&&typeof D=="object"){if(cn.endsWith(U,"{}"))U=i?U:U.slice(0,-2),D=JSON.stringify(D);else if(cn.isArray(D)&&Vwe(D)||(cn.isFileList(D)||cn.endsWith(U,"[]"))&&(J=cn.toArray(D)))return U=bX(U),J.forEach(function(ce,Re){!(cn.isUndefined(ce)||ce===null)&&e.append(a===!0?vX([U],Re,o):a===null?U:U+"[]",g(ce))}),!1}return _P(D)?!0:(e.append(vX(V,U,o),g(D)),!1)}const A=[],I=Object.assign(jwe,{defaultVisitor:y,convertValue:g,isVisitable:_P});function P(D,U){if(!cn.isUndefined(D)){if(A.indexOf(D)!==-1)throw Error("Circular reference detected in "+U.join("."));A.push(D),cn.forEach(D,function(J,re){(!(cn.isUndefined(J)||J===null)&&s.call(e,J,cn.isString(re)?re.trim():re,U,I))===!0&&P(J,U?U.concat(re):[re])}),A.pop()}}if(!cn.isObject(r))throw new TypeError("data must be an object");return P(r),e}const gR=Kwe;function wX(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function AX(r,e){this._pairs=[],r&&gR(r,this,e)}const _X=AX.prototype;_X.append=function(e,n){this._pairs.push([e,n])},_X.toString=function(e){const n=e?function(i){return e.call(this,i,wX)}:wX;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};const EX=AX;function Gwe(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function TX(r,e,n){if(!e)return r;const i=n&&n.encode||Gwe;cn.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(e,n):o=cn.isURLSearchParams(e)?e.toString():new EX(e,n).toString(i),o){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+o}return r}class qwe{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){cn.forEach(this.handlers,function(i){i!==null&&e(i)})}}const SX=qwe,IX={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Zwe={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:EX,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},EP=!1,TP=typeof navigator=="object"&&navigator||void 0,Ywe=EP&&(!TP||["ReactNative","NativeScript","NS"].indexOf(TP.product)<0),Xwe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Jwe=EP&&self.location.href||"http://localhost",mc={...p,...Zwe};function Qwe(r,e){return gR(r,new mc.classes.URLSearchParams,Object.assign({visitor:function(n,i,s,o){return mc.isNode&&cn.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function e2e(r){return cn.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function t2e(r){const e={},n=Object.keys(r);let i;const s=n.length;let o;for(i=0;i<s;i++)o=n[i],e[o]=r[o];return e}function r2e(r){function e(n,i,s,o){let a=n[o++];if(a==="__proto__")return!0;const u=Number.isFinite(+a),l=o>=n.length;return a=!a&&cn.isArray(s)?s.length:a,l?(cn.hasOwnProp(s,a)?s[a]=[s[a],i]:s[a]=i,!u):((!s[a]||!cn.isObject(s[a]))&&(s[a]=[]),e(n,i,s[a],o)&&cn.isArray(s[a])&&(s[a]=t2e(s[a])),!u)}if(cn.isFormData(r)&&cn.isFunction(r.entries)){const n={};return cn.forEachEntry(r,(i,s)=>{e(e2e(i),s,n,0)}),n}return null}const kX=r2e;function n2e(r,e,n){if(cn.isString(r))try{return(e||JSON.parse)(r),cn.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(r)}const SP={transitional:IX,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,o=cn.isObject(e);if(o&&cn.isHTMLForm(e)&&(e=new FormData(e)),cn.isFormData(e))return s?JSON.stringify(kX(e)):e;if(cn.isArrayBuffer(e)||cn.isBuffer(e)||cn.isStream(e)||cn.isFile(e)||cn.isBlob(e)||cn.isReadableStream(e))return e;if(cn.isArrayBufferView(e))return e.buffer;if(cn.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Qwe(e,this.formSerializer).toString();if((u=cn.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return gR(u?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),n2e(e)):e}],transformResponse:[function(e){const n=this.transitional||SP.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(cn.isResponse(e)||cn.isReadableStream(e))return e;if(e&&cn.isString(e)&&(i&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(u){if(a)throw u.name==="SyntaxError"?ws.from(u,ws.ERR_BAD_RESPONSE,this,null,this.response):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mc.classes.FormData,Blob:mc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};cn.forEach(["delete","get","head","post","put","patch"],r=>{SP.headers[r]={}});const IP=SP,i2e=cn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),s2e=r=>{const e={};let n,i,s;return r&&r.split(`
|
||
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),i=a.substring(s+1).trim(),!(!n||e[n]&&i2e[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},RX=Symbol("internals");function BE(r){return r&&String(r).trim().toLowerCase()}function yR(r){return r===!1||r==null?r:cn.isArray(r)?r.map(yR):String(r)}function o2e(r){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(r);)e[i[1]]=i[2];return e}const a2e=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function kP(r,e,n,i,s){if(cn.isFunction(i))return i.call(this,e,n);if(s&&(e=n),!!cn.isString(e)){if(cn.isString(i))return e.indexOf(i)!==-1;if(cn.isRegExp(i))return i.test(e)}}function u2e(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function c2e(r,e){const n=cn.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(r,i+n,{value:function(s,o,a){return this[i].call(this,e,s,o,a)},configurable:!0})})}class mR{constructor(e){e&&this.set(e)}set(e,n,i){const s=this;function o(u,l,g){const y=BE(l);if(!y)throw new Error("header name must be a non-empty string");const A=cn.findKey(s,y);(!A||s[A]===void 0||g===!0||g===void 0&&s[A]!==!1)&&(s[A||l]=yR(u))}const a=(u,l)=>cn.forEach(u,(g,y)=>o(g,y,l));if(cn.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(cn.isString(e)&&(e=e.trim())&&!a2e(e))a(s2e(e),n);else if(cn.isHeaders(e))for(const[u,l]of e.entries())o(l,u,i);else e!=null&&o(n,e,i);return this}get(e,n){if(e=BE(e),e){const i=cn.findKey(this,e);if(i){const s=this[i];if(!n)return s;if(n===!0)return o2e(s);if(cn.isFunction(n))return n.call(this,s,i);if(cn.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=BE(e),e){const i=cn.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||kP(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let s=!1;function o(a){if(a=BE(a),a){const u=cn.findKey(i,a);u&&(!n||kP(i,i[u],u,n))&&(delete i[u],s=!0)}}return cn.isArray(e)?e.forEach(o):o(e),s}clear(e){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const o=n[i];(!e||kP(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const n=this,i={};return cn.forEach(this,(s,o)=>{const a=cn.findKey(i,o);if(a){n[a]=yR(s),delete n[o];return}const u=e?u2e(o):String(o).trim();u!==o&&delete n[o],n[u]=yR(s),i[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return cn.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=e&&cn.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[RX]=this[RX]={accessors:{}}).accessors,s=this.prototype;function o(a){const u=BE(a);i[u]||(c2e(s,a),i[u]=!0)}return cn.isArray(e)?e.forEach(o):o(e),this}}mR.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),cn.reduceDescriptors(mR.prototype,({value:r},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(i){this[n]=i}}}),cn.freezeMethods(mR);const oh=mR;function RP(r,e){const n=this||IP,i=e||n,s=oh.from(i.headers);let o=i.data;return cn.forEach(r,function(u){o=u.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function CX(r){return!!(r&&r.__CANCEL__)}function xX(r,e,n){ws.call(this,r??"canceled",ws.ERR_CANCELED,e,n),this.name="CanceledError"}cn.inherits(xX,ws,{__CANCEL__:!0});const OE=xX;function BX(r,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?r(n):e(new ws("Request failed with status code "+n.status,[ws.ERR_BAD_REQUEST,ws.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function l2e(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function f2e(r,e){r=r||10;const n=new Array(r),i=new Array(r);let s=0,o=0,a;return e=e!==void 0?e:1e3,function(l){const g=Date.now(),y=i[o];a||(a=g),n[s]=l,i[s]=g;let A=o,I=0;for(;A!==s;)I+=n[A++],A=A%r;if(s=(s+1)%r,s===o&&(o=(o+1)%r),g-a<e)return;const P=y&&g-y;return P?Math.round(I*1e3/P):void 0}}const d2e=f2e;function h2e(r,e){let n=0,i=1e3/e,s,o;const a=(g,y=Date.now())=>{n=y,s=null,o&&(clearTimeout(o),o=null),r.apply(null,g)};return[(...g)=>{const y=Date.now(),A=y-n;A>=i?a(g,y):(s=g,o||(o=setTimeout(()=>{o=null,a(s)},i-A)))},()=>s&&a(s)]}const p2e=h2e,bR=(r,e,n=3)=>{let i=0;const s=d2e(50,250);return p2e(o=>{const a=o.loaded,u=o.lengthComputable?o.total:void 0,l=a-i,g=s(l),y=a<=u;i=a;const A={loaded:a,total:u,progress:u?a/u:void 0,bytes:l,rate:g||void 0,estimated:g&&u&&y?(u-a)/g:void 0,event:o,lengthComputable:u!=null,[e?"download":"upload"]:!0};r(A)},n)},OX=(r,e)=>{const n=r!=null;return[i=>e[0]({lengthComputable:n,total:r,loaded:i}),e[1]]},PX=r=>(...e)=>cn.asap(()=>r(...e)),g2e=mc.hasStandardBrowserEnv?((r,e)=>n=>(n=new URL(n,mc.origin),r.protocol===n.protocol&&r.host===n.host&&(e||r.port===n.port)))(new URL(mc.origin),mc.navigator&&/(msie|trident)/i.test(mc.navigator.userAgent)):()=>!0,y2e=mc.hasStandardBrowserEnv?{write(r,e,n,i,s,o){const a=[r+"="+encodeURIComponent(e)];cn.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),cn.isString(i)&&a.push("path="+i),cn.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function m2e(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function b2e(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function NX(r,e,n){let i=!m2e(e);return r&&i||n==!1?b2e(r,e):e}const MX=r=>r instanceof oh?{...r}:r;function r1(r,e){e=e||{};const n={};function i(g,y,A,I){return cn.isPlainObject(g)&&cn.isPlainObject(y)?cn.merge.call({caseless:I},g,y):cn.isPlainObject(y)?cn.merge({},y):cn.isArray(y)?y.slice():y}function s(g,y,A,I){if(cn.isUndefined(y)){if(!cn.isUndefined(g))return i(void 0,g,A,I)}else return i(g,y,A,I)}function o(g,y){if(!cn.isUndefined(y))return i(void 0,y)}function a(g,y){if(cn.isUndefined(y)){if(!cn.isUndefined(g))return i(void 0,g)}else return i(void 0,y)}function u(g,y,A){if(A in e)return i(g,y);if(A in r)return i(void 0,g)}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:(g,y,A)=>s(MX(g),MX(y),A,!0)};return cn.forEach(Object.keys(Object.assign({},r,e)),function(y){const A=l[y]||s,I=A(r[y],e[y],y);cn.isUndefined(I)&&A!==u||(n[y]=I)}),n}const LX=r=>{const e=r1({},r);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:u}=e;e.headers=a=oh.from(a),e.url=TX(NX(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let l;if(cn.isFormData(n)){if(mc.hasStandardBrowserEnv||mc.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[g,...y]=l?l.split(";").map(A=>A.trim()).filter(Boolean):[];a.setContentType([g||"multipart/form-data",...y].join("; "))}}if(mc.hasStandardBrowserEnv&&(i&&cn.isFunction(i)&&(i=i(e)),i||i!==!1&&g2e(e.url))){const g=s&&o&&y2e.read(o);g&&a.set(s,g)}return e},v2e=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(n,i){const s=LX(r);let o=s.data;const a=oh.from(s.headers).normalize();let{responseType:u,onUploadProgress:l,onDownloadProgress:g}=s,y,A,I,P,D;function U(){P&&P(),D&&D(),s.cancelToken&&s.cancelToken.unsubscribe(y),s.signal&&s.signal.removeEventListener("abort",y)}let V=new XMLHttpRequest;V.open(s.method.toUpperCase(),s.url,!0),V.timeout=s.timeout;function J(){if(!V)return;const ce=oh.from("getAllResponseHeaders"in V&&V.getAllResponseHeaders()),De={data:!u||u==="text"||u==="json"?V.responseText:V.response,status:V.status,statusText:V.statusText,headers:ce,config:r,request:V};BX(function(Ve){n(Ve),U()},function(Ve){i(Ve),U()},De),V=null}"onloadend"in V?V.onloadend=J:V.onreadystatechange=function(){!V||V.readyState!==4||V.status===0&&!(V.responseURL&&V.responseURL.indexOf("file:")===0)||setTimeout(J)},V.onabort=function(){V&&(i(new ws("Request aborted",ws.ECONNABORTED,r,V)),V=null)},V.onerror=function(){i(new ws("Network Error",ws.ERR_NETWORK,r,V)),V=null},V.ontimeout=function(){let Re=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const De=s.transitional||IX;s.timeoutErrorMessage&&(Re=s.timeoutErrorMessage),i(new ws(Re,De.clarifyTimeoutError?ws.ETIMEDOUT:ws.ECONNABORTED,r,V)),V=null},o===void 0&&a.setContentType(null),"setRequestHeader"in V&&cn.forEach(a.toJSON(),function(Re,De){V.setRequestHeader(De,Re)}),cn.isUndefined(s.withCredentials)||(V.withCredentials=!!s.withCredentials),u&&u!=="json"&&(V.responseType=s.responseType),g&&([I,D]=bR(g,!0),V.addEventListener("progress",I)),l&&V.upload&&([A,P]=bR(l),V.upload.addEventListener("progress",A),V.upload.addEventListener("loadend",P)),(s.cancelToken||s.signal)&&(y=ce=>{V&&(i(!ce||ce.type?new OE(null,r,V):ce),V.abort(),V=null)},s.cancelToken&&s.cancelToken.subscribe(y),s.signal&&(s.signal.aborted?y():s.signal.addEventListener("abort",y)));const re=l2e(s.url);if(re&&mc.protocols.indexOf(re)===-1){i(new ws("Unsupported protocol "+re+":",ws.ERR_BAD_REQUEST,r));return}V.send(o||null)})},w2e=(r,e)=>{const{length:n}=r=r?r.filter(Boolean):[];if(e||n){let i=new AbortController,s;const o=function(g){if(!s){s=!0,u();const y=g instanceof Error?g:this.reason;i.abort(y instanceof ws?y:new OE(y instanceof Error?y.message:y))}};let a=e&&setTimeout(()=>{a=null,o(new ws(`timeout ${e} of ms exceeded`,ws.ETIMEDOUT))},e);const u=()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(g=>{g.unsubscribe?g.unsubscribe(o):g.removeEventListener("abort",o)}),r=null)};r.forEach(g=>g.addEventListener("abort",o));const{signal:l}=i;return l.unsubscribe=()=>cn.asap(u),l}},A2e=function*(r,e){let n=r.byteLength;if(!e||n<e){yield r;return}let i=0,s;for(;i<n;)s=i+e,yield r.slice(i,s),i=s},_2e=async function*(r,e){for await(const n of E2e(r))yield*A2e(n,e)},E2e=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},DX=(r,e,n,i)=>{const s=_2e(r,e);let o=0,a,u=l=>{a||(a=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:g,value:y}=await s.next();if(g){u(),l.close();return}let A=y.byteLength;if(n){let I=o+=A;n(I)}l.enqueue(new Uint8Array(y))}catch(g){throw u(g),g}},cancel(l){return u(l),s.return()}},{highWaterMark:2})},vR=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",UX=vR&&typeof ReadableStream=="function",T2e=vR&&(typeof TextEncoder=="function"?(r=>e=>r.encode(e))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),FX=(r,...e)=>{try{return!!r(...e)}catch{return!1}},S2e=UX&&FX(()=>{let r=!1;const e=new Request(mc.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!e}),WX=64*1024,CP=UX&&FX(()=>cn.isReadableStream(new Response("").body)),wR={stream:CP&&(r=>r.body)};vR&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!wR[e]&&(wR[e]=cn.isFunction(r[e])?n=>n[e]():(n,i)=>{throw new ws(`Response type '${e}' is not supported`,ws.ERR_NOT_SUPPORT,i)})})})(new Response);const I2e=async r=>{if(r==null)return 0;if(cn.isBlob(r))return r.size;if(cn.isSpecCompliantForm(r))return(await new Request(mc.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(cn.isArrayBufferView(r)||cn.isArrayBuffer(r))return r.byteLength;if(cn.isURLSearchParams(r)&&(r=r+""),cn.isString(r))return(await T2e(r)).byteLength},k2e=async(r,e)=>{const n=cn.toFiniteNumber(r.getContentLength());return n??I2e(e)},xP={http:mX,xhr:v2e,fetch:vR&&(async r=>{let{url:e,method:n,data:i,signal:s,cancelToken:o,timeout:a,onDownloadProgress:u,onUploadProgress:l,responseType:g,headers:y,withCredentials:A="same-origin",fetchOptions:I}=LX(r);g=g?(g+"").toLowerCase():"text";let P=w2e([s,o&&o.toAbortSignal()],a),D;const U=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let V;try{if(l&&S2e&&n!=="get"&&n!=="head"&&(V=await k2e(y,i))!==0){let De=new Request(e,{method:"POST",body:i,duplex:"half"}),Ue;if(cn.isFormData(i)&&(Ue=De.headers.get("content-type"))&&y.setContentType(Ue),De.body){const[Ve,pe]=OX(V,bR(PX(l)));i=DX(De.body,WX,Ve,pe)}}cn.isString(A)||(A=A?"include":"omit");const J="credentials"in Request.prototype;D=new Request(e,{...I,signal:P,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:i,duplex:"half",credentials:J?A:void 0});let re=await fetch(D);const ce=CP&&(g==="stream"||g==="response");if(CP&&(u||ce&&U)){const De={};["status","statusText","headers"].forEach(Se=>{De[Se]=re[Se]});const Ue=cn.toFiniteNumber(re.headers.get("content-length")),[Ve,pe]=u&&OX(Ue,bR(PX(u),!0))||[];re=new Response(DX(re.body,WX,Ve,()=>{pe&&pe(),U&&U()}),De)}g=g||"text";let Re=await wR[cn.findKey(wR,g)||"text"](re,r);return!ce&&U&&U(),await new Promise((De,Ue)=>{BX(De,Ue,{data:Re,headers:oh.from(re.headers),status:re.status,statusText:re.statusText,config:r,request:D})})}catch(J){throw U&&U(),J&&J.name==="TypeError"&&/fetch/i.test(J.message)?Object.assign(new ws("Network Error",ws.ERR_NETWORK,r,D),{cause:J.cause||J}):ws.from(J,J&&J.code,r,D)}})};cn.forEach(xP,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const HX=r=>`- ${r}`,R2e=r=>cn.isFunction(r)||r===null||r===!1,zX={getAdapter:r=>{r=cn.isArray(r)?r:[r];const{length:e}=r;let n,i;const s={};for(let o=0;o<e;o++){n=r[o];let a;if(i=n,!R2e(n)&&(i=xP[(a=String(n)).toLowerCase()],i===void 0))throw new ws(`Unknown adapter '${a}'`);if(i)break;s[a||"#"+o]=i}if(!i){const o=Object.entries(s).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?o.length>1?`since :
|
||
`+o.map(HX).join(`
|
||
`):" "+HX(o[0]):"as no adapter specified";throw new ws("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i},adapters:xP};function BP(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new OE(null,r)}function $X(r){return BP(r),r.headers=oh.from(r.headers),r.data=RP.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),zX.getAdapter(r.adapter||IP.adapter)(r).then(function(i){return BP(r),i.data=RP.call(r,r.transformResponse,i),i.headers=oh.from(i.headers),i},function(i){return CX(i)||(BP(r),i&&i.response&&(i.response.data=RP.call(r,r.transformResponse,i.response),i.response.headers=oh.from(i.response.headers))),Promise.reject(i)})}const VX="1.8.3",AR={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{AR[r]=function(i){return typeof i===r||"a"+(e<1?"n ":" ")+r}});const jX={};AR.transitional=function(e,n,i){function s(o,a){return"[Axios v"+VX+"] Transitional option '"+o+"'"+a+(i?". "+i:"")}return(o,a,u)=>{if(e===!1)throw new ws(s(a," has been removed"+(n?" in "+n:"")),ws.ERR_DEPRECATED);return n&&!jX[a]&&(jX[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,u):!0}},AR.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function C2e(r,e,n){if(typeof r!="object")throw new ws("options must be an object",ws.ERR_BAD_OPTION_VALUE);const i=Object.keys(r);let s=i.length;for(;s-- >0;){const o=i[s],a=e[o];if(a){const u=r[o],l=u===void 0||a(u,o,r);if(l!==!0)throw new ws("option "+o+" must be "+l,ws.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ws("Unknown option "+o,ws.ERR_BAD_OPTION)}}const _R={assertOptions:C2e,validators:AR},f0=_R.validators;class ER{constructor(e){this.defaults=e,this.interceptors={request:new SX,response:new SX}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
||
`+o):i.stack=o}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=r1(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:o}=n;i!==void 0&&_R.assertOptions(i,{silentJSONParsing:f0.transitional(f0.boolean),forcedJSONParsing:f0.transitional(f0.boolean),clarifyTimeoutError:f0.transitional(f0.boolean)},!1),s!=null&&(cn.isFunction(s)?n.paramsSerializer={serialize:s}:_R.assertOptions(s,{encode:f0.function,serialize:f0.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),_R.assertOptions(n,{baseUrl:f0.spelling("baseURL"),withXsrfToken:f0.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&cn.merge(o.common,o[n.method]);o&&cn.forEach(["delete","get","head","post","put","patch","common"],D=>{delete o[D]}),n.headers=oh.concat(a,o);const u=[];let l=!0;this.interceptors.request.forEach(function(U){typeof U.runWhen=="function"&&U.runWhen(n)===!1||(l=l&&U.synchronous,u.unshift(U.fulfilled,U.rejected))});const g=[];this.interceptors.response.forEach(function(U){g.push(U.fulfilled,U.rejected)});let y,A=0,I;if(!l){const D=[$X.bind(this),void 0];for(D.unshift.apply(D,u),D.push.apply(D,g),I=D.length,y=Promise.resolve(n);A<I;)y=y.then(D[A++],D[A++]);return y}I=u.length;let P=n;for(A=0;A<I;){const D=u[A++],U=u[A++];try{P=D(P)}catch(V){U.call(this,V);break}}try{y=$X.call(this,P)}catch(D){return Promise.reject(D)}for(A=0,I=g.length;A<I;)y=y.then(g[A++],g[A++]);return y}getUri(e){e=r1(this.defaults,e);const n=NX(e.baseURL,e.url,e.allowAbsoluteUrls);return TX(n,e.params,e.paramsSerializer)}}cn.forEach(["delete","get","head","options"],function(e){ER.prototype[e]=function(n,i){return this.request(r1(i||{},{method:e,url:n,data:(i||{}).data}))}}),cn.forEach(["post","put","patch"],function(e){function n(i){return function(o,a,u){return this.request(r1(u||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}ER.prototype[e]=n(),ER.prototype[e+"Form"]=n(!0)});const TR=ER;class OP{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const i=this;this.promise.then(s=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](s);i._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(u=>{i.subscribe(u),o=u}).then(s);return a.cancel=function(){i.unsubscribe(o)},a},e(function(o,a,u){i.reason||(i.reason=new OE(o,a,u),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new OP(function(s){e=s}),cancel:e}}}const x2e=OP;function B2e(r){return function(n){return r.apply(null,n)}}function O2e(r){return cn.isObject(r)&&r.isAxiosError===!0}const PP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(PP).forEach(([r,e])=>{PP[e]=r});const P2e=PP;function KX(r){const e=new TR(r),n=oX(TR.prototype.request,e);return cn.extend(n,TR.prototype,e,{allOwnKeys:!0}),cn.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return KX(r1(r,s))},n}const ja=KX(IP);ja.Axios=TR,ja.CanceledError=OE,ja.CancelToken=x2e,ja.isCancel=CX,ja.VERSION=VX,ja.toFormData=gR,ja.AxiosError=ws,ja.Cancel=ja.CanceledError,ja.all=function(e){return Promise.all(e)},ja.spread=B2e,ja.isAxiosError=O2e,ja.mergeConfig=r1,ja.AxiosHeaders=oh,ja.formToJSON=r=>kX(cn.isHTMLForm(r)?new FormData(r):r),ja.getAdapter=zX.getAdapter,ja.HttpStatusCode=P2e,ja.default=ja;const N2e=ja;class GX{host;timeout;user;password;headers;statusPage;instance;constructor(e,n=3e4,i="",s="",o={},a="/"){if(!h8(e))throw new Error("Invalid URL provided to HttpProvider");if(isNaN(n)||n<0)throw new Error("Invalid timeout duration provided");if(!sE(o))throw new Error("Invalid headers object provided");e=e.replace(/\/+$/,""),this.host=e,this.timeout=n,this.user=i,this.password=s,this.headers=o,this.statusPage=a,this.instance=N2e.create({baseURL:e,timeout:n,headers:o,auth:i?{username:i,password:s}:void 0})}setStatusPage(e="/"){this.statusPage=e}async isConnected(e=this.statusPage){return this.request(e).then(n=>DG(n,"blockID","block_header")).catch(()=>!1)}request(e,n={},i="get"){return i=i.toLowerCase(),this.instance.request({data:i=="post"&&Object.keys(n).length?n:null,params:i=="get"&&n,url:e,method:i}).then(({data:s})=>s)}}const _f={HttpProvider:GX};var qX=tn(74017);const SR=new Lp;function ZX(r){return pi.address.toHex(r).replace(Qw,"0x")}function M2e(r,e,n,i=!1){if(i&&n.replace(/^0x/,"").length%64===8&&(n="0x"+n.replace(/^0x/,"").substring(8)),n.replace(/^0x/,"").length%64)throw new Error("The encoded string is not valid. Its length must be a multiple of 64.");return e=e.map(s=>(/trcToken/.test(s)&&(s=s.replace(/trcToken/,"uint256")),s)),SR.decode(e,n).reduce((s,o,a)=>(e[a]=="address"&&(o=id+o.substr(2).toLowerCase()),r.length?s[r[a]]=o:s.push(o),s),r.length?{}:[])}function L2e(r,e){for(let n=0;n<r.length;n++)r[n]==="address"&&(e[n]=pi.address.toHex(e[n]).replace(Qw,"0x"));return SR.encode(r,e)}function PE(r){const e=r.match(/([a-zA-Z0-9])(\[.*\])/);return e?e[2]:""}function YX(r){return(PE(r).match(/\]\[/g)||[]).length+1}function IR(r,e){const n=[],i=l=>l&&l.type.indexOf("tuple")===0&&l.components?`tuple(${l.components.map(y=>i(y)).join(",")})${PE(l.type)}`:/trcToken/.test(l.type)?l.type.replace(/trcToken/,"uint256"):l.type,s=l=>{for(let g=0;g<l.length;g++){const y=l[g];/trcToken/.test(y)&&(l[g]=y.replace(/trcToken/,"uint256"))}},o=l=>Array.isArray(l)?(l.forEach((g,y)=>{l[y]=o(g)}),l):ZX(l),a=(l,g,y)=>{y>1?g.length&&g.forEach(A=>{a(l,A,y-1)}):g.length&&y&&g.forEach(A=>{u(l,A)})},u=(l=[],g)=>{l.length&&l.forEach((y,A)=>{const I=y.type;if(g[A]){if(I==="address")g[A]=ZX(g[A]);else if(I.match(/^([^\x5b]*)(\x5b|$)/)[0]==="address[")o(g[A]);else if(I.indexOf("tuple")===0)if(PE(I)){const P=YX(I);a(y.components,g[A],P)}else u(y.components,g[A])}})};if(r.inputs&&r.inputs.length)for(let l=0;l<r.inputs.length;l++){const g=r.inputs[l].type;g==="bool"&&e[l]==="false"&&(e[l]=!1),n.push(g.indexOf("tuple")===0?i(r.inputs[l]):g),e.length<n.length&&e.push("")}return u(r.inputs,e),s(n),SR.encode(n,e)}function XX(r,e){const n=u=>{for(let l=0;l<u.length;l++){const g=u[l];/^trcToken/.test(g)&&(u[l]=g.replace(/^trcToken/,"uint256"))}},i=u=>Array.isArray(u)?(u.forEach((l,g)=>{u[g]=i(l)}),u):pi.address.toHex(u),s=(u,l,g)=>{g>1?l.length&&l.forEach(y=>{s(u,y,g-1)}):l.length&&g&&l.forEach(y=>{a(u,y)})},o=u=>{const l=u.name?` ${u.name}`:"";return u&&u.type.indexOf("tuple")===0&&u.components?`tuple(${u.components.map(y=>o(y)).join(",")})${PE(u.type)}${l}`:/trcToken/.test(u.type)?u.type.replace(/trcToken/,"uint256")+l:u.type+l},a=(u,l)=>{u.length&&u.forEach((g,y)=>{const{type:A,name:I}=g;if(l[y])if(A==="address")l[y]=pi.address.toHex(l[y]),I&&(l[I]=pi.address.toHex(l[y]));else if(A.match(/^([^\x5b]*)(\x5b|$)/)[0]==="address[")i(l[y]),I&&(l[I]=i(l[y]));else if(A.indexOf("tuple")===0){if(PE(A)){const P=YX(A);s(g.components,l[y],P)}else a(g.components,l[y]);I&&(l[I]=l[y])}else I&&(l[I]=l[y]);else I&&(l[I]=l[y])})};if("outputs"in r&&r.outputs&&r.outputs.length>0){const u=[];for(let y=0;y<r.outputs.length;y++){const A=r.outputs[y].type,I=r.outputs[y].name?` ${r.outputs[y].name}`:"";u.push(A.indexOf("tuple")===0?o(r.outputs[y]):A+I)}n(u),(!e||!e.length)&&(e=new Uint8Array(32*r.outputs.length));const g=SR.decode(u,e).toArray(!0);return a(r.outputs,g),g}return[]}class JX{invalid(e){return e.msg||`Invalid ${e.name}${e.type==="address"?" address":""} provided`}notPositive(e){return`${e.name} must be a positive integer`}notEqual(e){return e.msg||`${e.names?.[0]} can not be equal to ${e.names?.[1]}`}notValid(e){const n={};let i=!1;for(const s of e){const{name:o,names:a,value:u,type:l,gt:g,lt:y,gte:A,lte:I,optional:P}=s;if(!(P&&(!Vc(u)||l!=="boolean"&&u===!1))){switch(n[o]=s.value,l){case"address":kE(u)?n[o]=mi(u):i=!0;break;case"integer":(!_y(u)||typeof g=="number"&&u<=g||typeof y=="number"&&u>=y||typeof A=="number"&&u<A||typeof I=="number"&&u>I)&&(i=!0);break;case"positive-integer":if(!_y(u)||u<=0)throw new Error(this.notPositive(s));break;case"tokenId":(!$c(u)||!u.length)&&(i=!0);break;case"notEmptyObject":(!sE(u)||!Object.keys(u).length)&&(i=!0);break;case"notEqual":if(a&&n[a[0]]===n[a[1]])throw new Error(this.notEqual(s));break;case"resource":["BANDWIDTH","ENERGY"].includes(u)||(i=!0);break;case"url":h8(u)||(i=!0);break;case"hex":$b(u)||(i=!0);break;case"array":Array.isArray(u)||(i=!0);break;case"not-empty-string":(!$c(u)||!u.length)&&(i=!0);break;case"boolean":MG(u)||(i=!0);break;case"string":(!$c(u)||typeof g=="number"&&u.length<=g||typeof y=="number"&&u.length>=y||typeof A=="number"&&u.length<A||typeof I=="number"&&u.length>I)&&(i=!0);break}if(i)throw new Error(this.invalid(s))}}return!1}}var Is;(function(r){r.AccountCreateContract="AccountCreateContract",r.TransferContract="TransferContract",r.TransferAssetContract="TransferAssetContract",r.VoteAssetContract="VoteAssetContract",r.VoteWitnessContract="VoteWitnessContract",r.WitnessCreateContract="WitnessCreateContract",r.AssetIssueContract="AssetIssueContract",r.WitnessUpdateContract="WitnessUpdateContract",r.ParticipateAssetIssueContract="ParticipateAssetIssueContract",r.AccountUpdateContract="AccountUpdateContract",r.FreezeBalanceContract="FreezeBalanceContract",r.UnfreezeBalanceContract="UnfreezeBalanceContract",r.CancelAllUnfreezeV2Contract="CancelAllUnfreezeV2Contract",r.WithdrawBalanceContract="WithdrawBalanceContract",r.UnfreezeAssetContract="UnfreezeAssetContract",r.UpdateAssetContract="UpdateAssetContract",r.ProposalCreateContract="ProposalCreateContract",r.ProposalApproveContract="ProposalApproveContract",r.ProposalDeleteContract="ProposalDeleteContract",r.SetAccountIdContract="SetAccountIdContract",r.CustomContract="CustomContract",r.CreateSmartContract="CreateSmartContract",r.TriggerSmartContract="TriggerSmartContract",r.GetContract="GetContract",r.UpdateSettingContract="UpdateSettingContract",r.ExchangeCreateContract="ExchangeCreateContract",r.ExchangeInjectContract="ExchangeInjectContract",r.ExchangeWithdrawContract="ExchangeWithdrawContract",r.ExchangeTransactionContract="ExchangeTransactionContract",r.UpdateEnergyLimitContract="UpdateEnergyLimitContract",r.AccountPermissionUpdateContract="AccountPermissionUpdateContract",r.ClearABIContract="ClearABIContract",r.UpdateBrokerageContract="UpdateBrokerageContract",r.ShieldedTransferContract="ShieldedTransferContract",r.MarketSellAssetContract="MarketSellAssetContract",r.MarketCancelOrderContract="MarketCancelOrderContract",r.FreezeBalanceV2Contract="FreezeBalanceV2Contract",r.UnfreezeBalanceV2Contract="UnfreezeBalanceV2Contract",r.WithdrawExpireUnfreezeContract="WithdrawExpireUnfreezeContract",r.DelegateResourceContract="DelegateResourceContract",r.UnDelegateResourceContract="UnDelegateResourceContract",r.UNRECOGNIZED="UNRECOGNIZED"})(Is||(Is={}));var QX;(function(r){r[r.Owner=0]="Owner",r[r.Witness=1]="Witness",r[r.Active=2]="Active",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(QX||(QX={}));var eJ;(function(r){r[r.Normal=0]="Normal",r[r.AssetIssue=1]="AssetIssue",r[r.Contract=2]="Contract",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(eJ||(eJ={}));var D2e=tn(52983),OXe=tn(11814),PXe=tn(99505),NXe=tn(69349),MXe=tn(74662),LXe=tn(97899),DXe=tn(75796),UXe=tn(60218),FXe=tn(62724),WXe=tn(853),HXe=tn(53440),U2e=tn(36533).Buffer;const{Transaction:As,Permission:F2e,Key:W2e}=globalThis.TronWebProto,{TransferContract:H2e,FreezeBalanceContract:z2e,UnfreezeBalanceContract:$2e,WithdrawBalanceContract:V2e,FreezeBalanceV2Contract:tJ,UnfreezeBalanceV2Contract:rJ,CancelAllUnfreezeV2Contract:nJ,WithdrawExpireUnfreezeContract:iJ,DelegateResourceContract:sJ,UnDelegateResourceContract:oJ}=globalThis.TronWebProto,{TransferAssetContract:j2e,ParticipateAssetIssueContract:K2e,AssetIssueContract:aJ,UpdateAssetContract:G2e}=globalThis.TronWebProto,{TriggerSmartContract:uJ,ClearABIContract:q2e,UpdateEnergyLimitContract:Z2e,UpdateSettingContract:Y2e,CreateSmartContract:X2e,SmartContract:r2}=globalThis.TronWebProto,{ResourceCode:n2}=globalThis.TronWebProto,{WitnessCreateContract:J2e,VoteWitnessContract:cJ}=globalThis.TronWebProto,{UpdateBrokerageContract:Q2e}=globalThis.TronWebProto,{AccountCreateContract:eAe,AccountUpdateContract:tAe,SetAccountIdContract:rAe,AccountPermissionUpdateContract:nAe}=globalThis.TronWebProto,{ProposalCreateContract:iAe,ProposalDeleteContract:sAe,ProposalApproveContract:oAe}=globalThis.TronWebProto,{ExchangeCreateContract:aAe,ExchangeInjectContract:uAe,ExchangeWithdrawContract:cAe,ExchangeTransactionContract:lAe}=globalThis.TronWebProto,$i=r=>!r||r.length===0?new Uint8Array([]):new Uint8Array(UP.address.toHex(r).match(/.{1,2}/g).map(e=>parseInt(e,16))),Ma=r=>!r||r.length===0?new Uint8Array([]):new Uint8Array(($b(r)?r:UP.toHex(r)).replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16))),n1=(r,e)=>Ma(e?UP.fromUtf8(r).replace(/^0x/,""):r.replace(/^0x/,"")),fAe=(r,e=!0)=>(e?"0x":"")+Ss(U2e.from(r,"utf-8")).toString().substring(2),Vs=(r,e,n,i)=>{const s=new D2e.Any;s.pack(r.serializeBinary(),"protocol."+n);const o=new As.Contract;o.setType(e),o.setParameter(s),i&&o.setPermissionId(i);const a=new As.raw;a.addContract(o);const u=new As;return u.setRawData(a),u},dAe=(r,e)=>{const{to_address:n,owner_address:i,amount:s}=r,o=new H2e;return o.setToAddress($i(n)),o.setOwnerAddress($i(i)),o.setAmount(s),Vs(o,As.Contract.ContractType.TRANSFERCONTRACT,"TransferContract",e.Permission_id)},hAe=(r,e)=>{const{to_address:n,owner_address:i,amount:s,asset_name:o}=r,a=new j2e;return a.setToAddress($i(n)),a.setOwnerAddress($i(i)),a.setAssetName(n1(o,e.visible)),a.setAmount(s),Vs(a,As.Contract.ContractType.TRANSFERASSETCONTRACT,"TransferAssetContract",e.Permission_id)},pAe=(r,e)=>{const n=new K2e;return n.setToAddress($i(r.to_address)),n.setOwnerAddress($i(r.owner_address)),n.setAssetName(n1(r.asset_name,e.visible)),n.setAmount(r.amount),Vs(n,As.Contract.ContractType.PARTICIPATEASSETISSUECONTRACT,"ParticipateAssetIssueContract",e.Permission_id)},gAe=(r,e)=>{const n=new uJ,{owner_address:i,contract_address:s,parameter:o="",function_selector:a,call_value:u,call_token_value:l,token_id:g,data:y}=r;if(n.setOwnerAddress($i(i)),n.setContractAddress($i(s)),n.setCallValue(u),y)n.setData(Ma(y));else if(a){const A=fAe(a).substring(2,10)+o;n.setData(Ma(A))}return g&&n.setTokenId(g),l&&n.setCallTokenValue(l),Vs(n,As.Contract.ContractType.TRIGGERSMARTCONTRACT,"TriggerSmartContract",e.Permission_id)},yAe=(r,e)=>{const n=new z2e,{owner_address:i,frozen_balance:s,frozen_duration:o,resource:a,receiver_address:u}=r;return n.setOwnerAddress($i(i)),n.setFrozenBalance(s),n.setFrozenDuration(o),a&&n.setResource(n2[a]),u&&n.setReceiverAddress($i(u)),Vs(n,As.Contract.ContractType.FREEZEBALANCECONTRACT,"FreezeBalanceContract",e.Permission_id)},mAe=(r,e)=>{const n=new $2e,{owner_address:i,resource:s,receiver_address:o}=r;return n.setOwnerAddress($i(i)),s&&n.setResource(n2[s]),o&&n.setReceiverAddress($i(o)),Vs(n,As.Contract.ContractType.UNFREEZEBALANCECONTRACT,"UnfreezeBalanceContract",e.Permission_id)},bAe=(r,e)=>{const n=new V2e,{owner_address:i}=r;return n.setOwnerAddress($i(i)),Vs(n,As.Contract.ContractType.WITHDRAWBALANCECONTRACT,"WithdrawBalanceContract",e.Permission_id)},vAe=(r,e)=>{const n=new tJ,{owner_address:i,frozen_balance:s,resource:o}=r;return n.setOwnerAddress($i(i)),n.setFrozenBalance(s),n.setResource(n2[o]),Vs(n,As.Contract.ContractType.FREEZEBALANCEV2CONTRACT,"FreezeBalanceV2Contract",e.Permission_id)},wAe=(r,e)=>{const n=new nJ,{owner_address:i}=r;return n.setOwnerAddress($i(i)),Vs(n,As.Contract.ContractType.CANCELALLUNFREEZEV2CONTRACT,"CancelAllUnfreezeV2Contract",e.Permission_id)},AAe=(r,e)=>{const n=new rJ,{owner_address:i,unfreeze_balance:s,resource:o}=r;return n.setOwnerAddress($i(i)),n.setUnfreezeBalance(s),n.setResource(n2[o]),Vs(n,As.Contract.ContractType.UNFREEZEBALANCEV2CONTRACT,"UnfreezeBalanceV2Contract",e.Permission_id)},_Ae=(r,e)=>{const n=new sJ,{owner_address:i,receiver_address:s,balance:o,resource:a,lock:u=!1,lock_period:l}=r;return n.setOwnerAddress($i(i)),n.setBalance(o),n.setResource(n2[a]),n.setLock(u),n.setLockPeriod(l),n.setReceiverAddress($i(s)),Vs(n,As.Contract.ContractType.DELEGATERESOURCECONTRACT,"DelegateResourceContract",e.Permission_id)},EAe=(r,e)=>{const n=new oJ,{owner_address:i,receiver_address:s,balance:o,resource:a}=r;return n.setOwnerAddress($i(i)),n.setBalance(o),n.setResource(n2[a]),n.setReceiverAddress($i(s)),Vs(n,As.Contract.ContractType.UNDELEGATERESOURCECONTRACT,"UnDelegateResourceContract",e.Permission_id)},TAe=(r,e)=>{const n=new iJ,{owner_address:i}=r;return n.setOwnerAddress($i(i)),Vs(n,As.Contract.ContractType.WITHDRAWEXPIREUNFREEZECONTRACT,"WithdrawExpireUnfreezeContract",e.Permission_id)},SAe=(r,e)=>{const n=new J2e,{owner_address:i,url:s}=r;return n.setOwnerAddress($i(i)),n.setUrl(Ma(s.replace(/^0x/,""))),Vs(n,As.Contract.ContractType.WITNESSCREATECONTRACT,"WitnessCreateContract",e.Permission_id)},IAe=(r,e)=>{const n=new cJ,{owner_address:i,votes:s}=r;return n.setOwnerAddress($i(i)),s.forEach(o=>{const a=new cJ.Vote,{vote_address:u,vote_count:l}=o;a.setVoteAddress($i(u));const g=parseInt(l);a.setVoteCount(g),n.addVotes(a)}),Vs(n,As.Contract.ContractType.VOTEWITNESSCONTRACT,"VoteWitnessContract",e.Permission_id)},kAe=(r,e)=>{const n=r?.new_contract?{owner_address:r.owner_address,call_token_value:r.call_token_value,token_id:r.token_id,...r.new_contract}:r,{owner_address:i,consume_user_resource_percent:s,origin_energy_limit:o,abi:a,bytecode:u="",parameter:l="",call_value:g,call_token_value:y,token_id:A,name:I}=n;let{origin_address:P}=n;const D=new X2e;D.setOwnerAddress($i(i)),A&&D.setTokenId(A),y&&D.setCallTokenValue(y);const U=new r2;if(a){let V;typeof a=="string"?V=JSON.parse(a):V=a?.entrys||[];const J=new r2.ABI,re=Re=>{const De=new r2.ABI.Entry.Param,{indexed:Ue,name:Ve,type:pe}=Re;return Ue===!0&&De.setIndexed(!0),De.setName(Ve),De.setType(pe),De},ce=V.map(Re=>{const{anonymous:De,constant:Ue,name:Ve,inputs:pe,outputs:Se,type:Ce,payable:je,stateMutability:$e}=Re,Qe=new r2.ABI.Entry;return Qe.setAnonymous(De),Qe.setConstant(Ue),Qe.setName(Ve),pe&&Qe.setInputsList(pe.map(nt=>re(nt))),Se&&Qe.setOutputsList(Se.map(nt=>re(nt))),Ce&&Qe.setType(r2.ABI.Entry.EntryType[Ce.toUpperCase()]),Qe.setPayable(je),$e&&Qe.setStatemutability(r2.ABI.Entry.StateMutabilityType[$e.toUpperCase()]),Qe});J.setEntrysList(ce),U.setAbi(J)}if(g&&U.setCallValue(g),U.setConsumeUserResourcePercent(s),U.setOriginEnergyLimit(o),P||(P=i),U.setOriginAddress($i(P)),u){const V=u.replace(/^0x/,"")+l.replace(/^0x/,"");U.setBytecode(Ma(V))}return U.setName(I),D.setNewContract(U),Vs(D,As.Contract.ContractType.CREATESMARTCONTRACT,"CreateSmartContract",e.Permission_id)},RAe=(r,e)=>{const{contract_address:n,owner_address:i}=r,s=new q2e;return s.setOwnerAddress($i(i)),s.setContractAddress($i(n)),Vs(s,As.Contract.ContractType.CLEARABICONTRACT,"ClearABIContract",e.Permission_id)},CAe=(r,e)=>{const{brokerage:n,owner_address:i}=r,s=new Q2e;return s.setOwnerAddress($i(i)),s.setBrokerage(n),Vs(s,As.Contract.ContractType.UPDATEBROKERAGECONTRACT,"UpdateBrokerageContract",e.Permission_id)},xAe=(r,e)=>{const{owner_address:n,name:i,abbr:s,description:o,url:a,total_supply:u,trx_num:l,num:g,start_time:y,end_time:A,precision:I,free_asset_net_limit:P,public_free_asset_net_limit:D,public_free_asset_net_usage:U=0,public_latest_free_net_time:V=0,vote_score:J=0,frozen_supply:re}=r,ce=new aJ;if(ce.setOwnerAddress($i(n)),i&&ce.setName(Ma(i.replace(/^0x/,""))),s&&ce.setAbbr(Ma(s.replace(/^0x/,""))),ce.setTotalSupply(u),ce.setNum(g),ce.setEndTime(A),ce.setStartTime(y),ce.setTrxNum(l),ce.setVoteScore(J),I&&ce.setPrecision(I),V&&ce.setPublicLatestFreeNetTime(V),o&&ce.setDescription(Ma(o.replace(/^0x/,""))),a&&ce.setUrl(Ma(a.replace(/^0x/,""))),ce.setPublicFreeAssetNetUsage(U),ce.setFreeAssetNetLimit(P),ce.setPublicFreeAssetNetLimit(D),re){const Re=new aJ.FrozenSupply;Re.setFrozenAmount(re.length?re[0].frozen_amount:re.frozen_amount),Re.setFrozenDays(re.length?re[0].frozen_days:re.frozen_days),ce.addFrozenSupply(Re)}return Vs(ce,As.Contract.ContractType.ASSETISSUECONTRACT,"AssetIssueContract",e.Permission_id)},BAe=(r,e)=>{const n=new eAe,{account_address:i,owner_address:s}=r;return n.setOwnerAddress($i(s)),n.setAccountAddress($i(i.replace(/^0x/,""))),Vs(n,As.Contract.ContractType.ACCOUNTCREATECONTRACT,"AccountCreateContract",e.Permission_id)},OAe=(r,e)=>{const n=new tAe,{account_name:i,owner_address:s}=r;return n.setOwnerAddress($i(s)),n.setAccountName(Ma(i.replace(/^0x/,""))),Vs(n,As.Contract.ContractType.ACCOUNTUPDATECONTRACT,"AccountUpdateContract",e.Permission_id)},PAe=(r,e)=>{const n=new rAe,{account_id:i,owner_address:s}=r;return n.setOwnerAddress($i(s)),n.setAccountId(Ma(i.replace(/^0x/,""))),Vs(n,As.Contract.ContractType.SETACCOUNTIDCONTRACT,"SetAccountIdContract",e.Permission_id)},NAe=(r,e)=>{const n=new iAe,{owner_address:i,parameters:s}=r;return n.setOwnerAddress($i(i)),s.forEach(o=>{n.getParametersMap().set(o.key,o.value)}),Vs(n,As.Contract.ContractType.PROPOSALCREATECONTRACT,"ProposalCreateContract",e.Permission_id)},MAe=(r,e)=>{const n=new sAe,{owner_address:i,proposal_id:s}=r;return n.setOwnerAddress($i(i)),n.setProposalId(s),Vs(n,As.Contract.ContractType.PROPOSALDELETECONTRACT,"ProposalDeleteContract",e.Permission_id)},LAe=(r,e)=>{const n=new oAe,{owner_address:i,proposal_id:s,is_add_approval:o}=r;return n.setOwnerAddress($i(i)),n.setProposalId(s),n.setIsAddApproval(o),Vs(n,As.Contract.ContractType.PROPOSALAPPROVECONTRACT,"ProposalApproveContract",e.Permission_id)},DAe=(r,e)=>{const n=new aAe,{owner_address:i,first_token_id:s,first_token_balance:o,second_token_id:a,second_token_balance:u}=r;return n.setOwnerAddress($i(i)),n.setFirstTokenId(n1(s,e.visible)),n.setFirstTokenBalance(o),n.setSecondTokenId(n1(a,e.visible)),n.setSecondTokenBalance(u),Vs(n,As.Contract.ContractType.EXCHANGECREATECONTRACT,"ExchangeCreateContract",e.Permission_id)},UAe=(r,e)=>{const n=new uAe,{owner_address:i,exchange_id:s,token_id:o,quant:a}=r;return n.setOwnerAddress($i(i)),n.setExchangeId(s),n.setTokenId(n1(o,e.visible)),n.setQuant(a),Vs(n,As.Contract.ContractType.EXCHANGEINJECTCONTRACT,"ExchangeInjectContract",e.Permission_id)},FAe=(r,e)=>{const n=new cAe,{owner_address:i,exchange_id:s,token_id:o,quant:a}=r;return n.setOwnerAddress($i(i)),n.setExchangeId(s),n.setTokenId(n1(o,e.visible)),n.setQuant(a),Vs(n,As.Contract.ContractType.EXCHANGEWITHDRAWCONTRACT,"ExchangeWithdrawContract",e.Permission_id)},WAe=(r,e)=>{const n=new lAe,{owner_address:i,exchange_id:s,token_id:o,quant:a,expected:u}=r;return n.setOwnerAddress($i(i)),n.setExchangeId(s),n.setTokenId(n1(o,e.visible)),n.setQuant(a),n.setExpected(u),Vs(n,As.Contract.ContractType.EXCHANGETRANSACTIONCONTRACT,"ExchangeTransactionContract",e.Permission_id)},HAe=(r,e)=>{const n=new Y2e,{owner_address:i,contract_address:s,consume_user_resource_percent:o}=r;return n.setOwnerAddress($i(i)),n.setContractAddress($i(s)),n.setConsumeUserResourcePercent(o),Vs(n,As.Contract.ContractType.UPDATESETTINGCONTRACT,"UpdateSettingContract",e.Permission_id)},zAe=(r,e)=>{const n=new Z2e,{owner_address:i,contract_address:s,origin_energy_limit:o}=r;return n.setOwnerAddress($i(i)),n.setContractAddress($i(s)),n.setOriginEnergyLimit(o),Vs(n,As.Contract.ContractType.UPDATEENERGYLIMITCONTRACT,"UpdateEnergyLimitContract",e.Permission_id)},$Ae=(r,e)=>{const n=new nAe,{owner_address:i,owner:s,witness:o,actives:a}=r;n.setOwnerAddress($i(i));const u=g=>isNaN(g)?g==="Active"?2:g==="Witness"?1:0:g,l=g=>{const y=new F2e,{type:A,id:I,permission_name:P,threshold:D,parentId:U,operations:V,keys:J}=g;return y.setType(u(A)),y.setId(I),y.setPermissionName(P),y.setThreshold(D),U&&y.setParentId(U),V&&y.setOperations(Ma(V)),J&&y.setKeysList(J.map(re=>{const ce=new W2e;return ce.setAddress($i(re.address)),ce.setWeight(re.weight),ce})),y};return s&&n.setOwner(l(s)),o&&n.setWitness(l(o)),a&&(Array.isArray(a)?n.setActivesList(a.map(g=>l(g))):n.setActivesList([l(a)])),Vs(n,As.Contract.ContractType.ACCOUNTPERMISSIONUPDATECONTRACT,"AccountPermissionUpdateContract",e.Permission_id)},VAe=(r,e)=>{const n=new G2e,{owner_address:i,description:s,url:o,new_limit:a,new_public_limit:u}=r;return n.setOwnerAddress($i(i)),s&&n.setDescription(Ma(s.replace(/^0x/,""))),o&&n.setUrl(Ma(o.replace(/^0x/,""))),a&&n.setNewLimit(a),u&&n.setNewPublicLimit(u),Vs(n,As.Contract.ContractType.UPDATEASSETCONTRACT,"UpdateAssetContract",e.Permission_id)},lJ=(r,e,n)=>{switch(r.type){case"TransferContract":return dAe(e,n);case"TransferAssetContract":return hAe(e,n);case"ParticipateAssetIssueContract":return pAe(e,n);case"TriggerSmartContract":return gAe(e,n);case"FreezeBalanceContract":return yAe(e,n);case"UnfreezeBalanceContract":return mAe(e,n);case"WithdrawBalanceContract":return bAe(e,n);case"FreezeBalanceV2Contract":return vAe(e,n);case"CancelAllUnfreezeV2Contract":return wAe(e,n);case"UnfreezeBalanceV2Contract":return AAe(e,n);case"DelegateResourceContract":return _Ae(e,n);case"UnDelegateResourceContract":return EAe(e,n);case"WithdrawExpireUnfreezeContract":return TAe(e,n);case"WitnessCreateContract":return SAe(e,n);case"VoteWitnessContract":return IAe(e,n);case"CreateSmartContract":return kAe(e,n);case"ClearABIContract":return RAe(e,n);case"UpdateBrokerageContract":return CAe(e,n);case"AssetIssueContract":return xAe(e,n);case"AccountCreateContract":return BAe(e,n);case"AccountUpdateContract":return OAe(e,n);case"SetAccountIdContract":return PAe(e,n);case"ProposalCreateContract":return NAe(e,n);case"ProposalDeleteContract":return MAe(e,n);case"ProposalApproveContract":return LAe(e,n);case"ExchangeCreateContract":return DAe(e,n);case"ExchangeInjectContract":return UAe(e,n);case"ExchangeWithdrawContract":return FAe(e,n);case"ExchangeTransactionContract":return WAe(e,n);case"UpdateSettingContract":return HAe(e,n);case"UpdateEnergyLimitContract":return zAe(e,n);case"AccountPermissionUpdateContract":return $Ae(e,n);case"UpdateAssetContract":return VAe(e,n)}},NP=r=>{const e=r.raw_data,n=e.contract[0],i=n.parameter.value,s={Permission_id:n.Permission_id,visible:r.visible},o=lJ(n,i,s),a=o.getRawData();return a.setRefBlockBytes(Ma(e.ref_block_bytes)),a.setRefBlockHash(Ma(e.ref_block_hash)),e.data&&a.setData(Ma(e.data)),e.fee_limit&&a.setFeeLimit(e.fee_limit),e.expiration&&a.setExpiration(e.expiration),e.timestamp&&a.setTimestamp(e.timestamp),o.setRawData(a),o},fJ=(r,e={},n={})=>{const i=r.raw_data,s=i.contract[0],o=lJ(s,e,{Permission_id:e?.Permission_id}),a=o.getRawData();return a.setRefBlockBytes(Ma(i.ref_block_bytes)),a.setRefBlockHash(Ma(i.ref_block_hash)),n.data&&a.setData(Ma(n.data.replace(/^0x/,""))),(n.fee_limit||e.fee_limit)&&a.setFeeLimit(n.fee_limit||e.fee_limit),i.expiration&&a.setExpiration(i.expiration),i.timestamp&&a.setTimestamp(i.timestamp),o.setRawData(a),o},dJ=(r,e)=>{const n=e.getRawData().serializeBinary(),i=Xs(n),s=gc(n);return i.toLowerCase()===r.raw_data_hex.toLowerCase()&&s.replace(/^0x/,"").toLowerCase()===r.txID.replace(/^0x/,"").toLowerCase()},hJ=r=>Xs(r.getRawData().serializeBinary()),kR=r=>{const e=NP(r);return dJ(r,e)},MP=(r,e,n)=>{const i=fJ(r,e,n);return dJ(r,i)},pJ=r=>{const e=r.getRawData().serializeBinary();return gc(e)},jAe={0:"AccountCreateContract",1:"TransferContract",2:"TransferAssetContract",4:"VoteWitnessContract",5:"WitnessCreateContract",6:"AssetIssueContract",9:"ParticipateAssetIssueContract",10:"AccountUpdateContract",11:"FreezeBalanceContract",12:"UnfreezeBalanceContract",13:"WithdrawBalanceContract",15:"UpdateAssetContract",16:"ProposalCreateContract",17:"ProposalApproveContract",18:"ProposalDeleteContract",19:"SetAccountIdContract",30:"CreateSmartContract",31:"TriggerSmartContract",33:"UpdateSettingContract",41:"ExchangeCreateContract",42:"ExchangeInjectContract",43:"ExchangeWithdrawContract",44:"ExchangeTransactionContract",45:"UpdateEnergyLimitContract",46:"AccountPermissionUpdateContract",48:"ClearABIContract",49:"UpdateBrokerageContract",54:"FreezeBalanceV2Contract",55:"UnfreezeBalanceV2Contract",56:"WithdrawExpireUnfreezeContract",57:"DelegateResourceContract",58:"UnDelegateResourceContract",59:"CancelAllUnfreezeV2Contract"},KAe=r=>r.getAuthsList().map(n=>{const i=Xs(n.getPermissionName_asU8()),s=n.getAccount(),o={name:Xs(s.getName_asU8()),address:Xs(s.getAddress_asU8())};return{permission_name:i,account:o}}),i1=(r,e)=>{const n=As.raw.deserializeBinary(zc(e)),i=n.getContractList()[0],s=i.getParameter().getValue(),o=jAe[i.getType()];if(r!==o)throw new Error(`type ${r} dismatches with rawDataHex type ${o}`);return[{contract:[{parameter:{value:{},type_url:i.getParameter().getTypeUrl()},type:r,Permission_id:i.getPermissionId()}],data:Xs(n.getData()),fee_limit:n.getFeeLimit(),ref_block_bytes:Xs(n.getRefBlockBytes_asU8()),ref_block_hash:Xs(n.getRefBlockHash_asU8()),expiration:n.getExpiration(),timestamp:n.getTimestamp(),scripts:Xs(n.getScripts_asU8()),auths:KAe(n)},s]},GAe=(r,e)=>{const[n,i]=i1(r,e),s=uJ.deserializeBinary(i);return n.contract[0].parameter.value={owner_address:Xs(s.getOwnerAddress_asU8()),contract_address:Xs(s.getContractAddress_asU8()),call_value:s.getCallValue(),data:Xs(s.getData_asU8()),call_token_value:s.getCallTokenValue(),token_id:s.getTokenId()},n},RR=r=>{switch(r){case 0:return"BANDWIDTH";case 1:return"ENERGY";default:return"BANDWIDTH"}},qAe=(r,e)=>{const[n,i]=i1(r,e),s=tJ.deserializeBinary(i);return n.contract[0].parameter.value={owner_address:Xs(s.getOwnerAddress_asU8()),frozen_balance:s.getFrozenBalance(),resource:RR(s.getResource())},n},ZAe=(r,e)=>{const[n,i]=i1(r,e),s=rJ.deserializeBinary(i);return n.contract[0].parameter.value={owner_address:Xs(s.getOwnerAddress_asU8()),unfreeze_balance:s.getUnfreezeBalance(),resource:RR(s.getResource())},n},YAe=(r,e)=>{const[n,i]=i1(r,e),s=nJ.deserializeBinary(i);return n.contract[0].parameter.value={owner_address:Xs(s.getOwnerAddress_asU8())},n},XAe=(r,e)=>{const[n,i]=i1(r,e),s=sJ.deserializeBinary(i);return n.contract[0].parameter.value={owner_address:Xs(s.getOwnerAddress_asU8()),balance:s.getBalance(),lock:s.getLock(),lock_period:s.getLockPeriod(),receiver_address:Xs(s.getReceiverAddress_asU8()),resource:RR(s.getResource())},n},JAe=(r,e)=>{const[n,i]=i1(r,e),s=oJ.deserializeBinary(i);return n.contract[0].parameter.value={owner_address:Xs(s.getOwnerAddress_asU8()),balance:s.getBalance(),receiver_address:Xs(s.getReceiverAddress_asU8()),resource:RR(s.getResource())},n},QAe=(r,e)=>{const[n,i]=i1(r,e),s=iJ.deserializeBinary(i);return n.contract[0].parameter.value={owner_address:Xs(s.getOwnerAddress_asU8())},n},e_e=(r,e)=>{if(!e)throw new Error("rawDataHex cannot be empty");if(!$b(e))throw new Error("rawDataHex is not a valid hex string");switch(r){case"TriggerSmartContract":return GAe(r,e);case"FreezeBalanceV2Contract":return qAe(r,e);case"UnfreezeBalanceV2Contract":return ZAe(r,e);case"CancelAllUnfreezeV2Contract":return YAe(r,e);case"DelegateResourceContract":return XAe(r,e);case"UnDelegateResourceContract":return JAe(r,e);case"WithdrawExpireUnfreezeContract":return QAe(r,e);default:throw new Error(`trasaction ${r} not supported`)}};var t_e=tn(36533).Buffer;function Yc(r){return pi.fromUtf8(r).replace(/^0x/,"")}function LP(r){return JSON.parse(JSON.stringify(r))}function r_e(r,e,n){if(r.Error)throw new Error(r.Error);if(r.result&&r.result.message)throw new Error(pi.toUtf8(r.result.message));if(MP(r,e,n))return r;throw new Error("Invalid transaction")}function n_e(r,e,n){if(r.Error)throw new Error(r.Error);if(r.result&&r.result.message)throw new Error(pi.toUtf8(r.result.message));if(!(n._isConstant||n.estimateEnergy)){if(MP(r.transaction,e,n))return r;throw new Error("Invalid transaction")}return r}function i_e(r,e){return"41"+Ss(t_e.from(e+r,"hex")).toString().substring(2).slice(24)}function s_e(r){return r.request("wallet/getblock",{detail:!1},"post").then(e=>({ref_block_bytes:e.block_header.raw_data.number.toString(16).slice(-4).padStart(4,"0"),ref_block_hash:e.blockID.slice(16,32),expiration:e.block_header.raw_data.timestamp+60*1e3,timestamp:e.block_header.raw_data.timestamp}))}function gJ(r={}){if(typeof r.ref_block_bytes>"u"&&typeof r.ref_block_hash>"u"&&typeof r.expiration>"u"&&typeof r.timestamp>"u")return!1;if(typeof r.ref_block_bytes!="string")throw new Error("Invalid ref_block_bytes provided.");if(typeof r.ref_block_hash!="string")throw new Error("Invalid ref_block_hash provided.");if(typeof r.expiration!="number")throw new Error("Invalid expiration provided.");if(typeof r.timestamp!="number")throw new Error("Invalid timestamp provided.");return!0}async function Ps(r,e,n,i,s={}){const o={visible:!1,txID:"",raw_data_hex:"",raw_data:{contract:[{parameter:{value:n,type_url:`type.googleapis.com/protocol.${e}`},type:e}],...gJ(s)?{}:await s_e(r.fullNode),...s}};i&&(o.raw_data.contract[0].Permission_id=i);const a=NP(o);return o.txID=pJ(a).replace(/^0x/,""),o.raw_data_hex=hJ(a).toLowerCase(),o}function Ws(r={}){const e={};return gJ(r.blockHeader)&&(e.ref_block_bytes=r.blockHeader.ref_block_bytes,e.ref_block_hash=r.blockHeader.ref_block_hash,e.expiration=r.blockHeader.expiration,e.timestamp=r.blockHeader.timestamp),e}var o_e=tn(36533).Buffer;class a_e{tronWeb;validator;constructor(e){if(!e||!(e instanceof pi))throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.validator=new JX}async sendTrx(e,n=0,i=this.tronWeb.defaultAddress.hex,s={}){n=parseInt(n),this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:i},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer TRX to the same account"},{name:"amount",type:"integer",gt:0,value:n}]);const o={to_address:mi(e),owner_address:mi(i),amount:n},a=Ws(s);return Ps(this.tronWeb,Is.TransferContract,o,s?.permissionId,a)}async sendToken(e,n=0,i,s=this.tronWeb.defaultAddress.hex,o={}){n=parseInt(n),this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:s},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer tokens to the same account"},{name:"amount",type:"integer",gt:0,value:n},{name:"token ID",type:"tokenId",value:i}]);const a={to_address:mi(e),owner_address:mi(s),asset_name:Yc(i),amount:n},u=Ws(o);return Ps(this.tronWeb,Is.TransferAssetContract,a,o?.permissionId,u)}async purchaseToken(e,n,i=0,s=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"buyer",type:"address",value:s},{name:"issuer",type:"address",value:e},{names:["buyer","issuer"],type:"notEqual",msg:"Cannot purchase tokens from same account"},{name:"amount",type:"integer",gt:0,value:i},{name:"token ID",type:"tokenId",value:n}]);const a={to_address:mi(e),owner_address:mi(s),asset_name:Yc(n),amount:parseInt(i)},u=Ws(o);return Ps(this.tronWeb,Is.ParticipateAssetIssueContract,a,o?.permissionId,u)}async freezeBalance(e=0,n=3,i="BANDWIDTH",s=this.tronWeb.defaultAddress.hex,o,a={}){this.validator.notValid([{name:"origin",type:"address",value:s},{name:"receiver",type:"address",value:o,optional:!0},{name:"amount",type:"integer",gt:0,value:e},{name:"duration",type:"integer",gte:3,value:n},{name:"resource",type:"resource",value:i,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const u={owner_address:mi(s),frozen_balance:parseInt(e),frozen_duration:parseInt(String(n))};i!=="BANDWIDTH"&&(u.resource=i),Vc(o)&&mi(o)!==mi(s)&&(u.receiver_address=mi(o));const l=Ws(a);return Ps(this.tronWeb,Is.FreezeBalanceContract,u,a?.permissionId,l)}async unfreezeBalance(e="BANDWIDTH",n=this.tronWeb.defaultAddress.hex,i,s={}){this.validator.notValid([{name:"origin",type:"address",value:n},{name:"receiver",type:"address",value:i,optional:!0},{name:"resource",type:"resource",value:e,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const o={owner_address:mi(n)};e!=="BANDWIDTH"&&(o.resource=e),Vc(i)&&mi(i)!==mi(n)&&(o.receiver_address=mi(i));const a=Ws(s);return Ps(this.tronWeb,Is.UnfreezeBalanceContract,o,s?.permissionId,a)}async freezeBalanceV2(e=0,n="BANDWIDTH",i=this.tronWeb.defaultAddress.hex,s={}){this.validator.notValid([{name:"origin",type:"address",value:i},{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:n,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const o={owner_address:mi(i),frozen_balance:parseInt(e)};n!=="BANDWIDTH"&&(o.resource=n);const a=Ws(s);return Ps(this.tronWeb,Is.FreezeBalanceV2Contract,o,s?.permissionId,a)}async unfreezeBalanceV2(e=0,n="BANDWIDTH",i=this.tronWeb.defaultAddress.hex,s={}){this.validator.notValid([{name:"origin",type:"address",value:i},{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:n,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const o={owner_address:mi(i),unfreeze_balance:parseInt(e)};n!=="BANDWIDTH"&&(o.resource=n);const a=Ws(s);return Ps(this.tronWeb,Is.UnfreezeBalanceV2Contract,o,s?.permissionId,a)}async cancelUnfreezeBalanceV2(e=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"origin",type:"address",value:e}]);const i={owner_address:mi(e)},s=Ws(n);return Ps(this.tronWeb,Is.CancelAllUnfreezeV2Contract,i,n?.permissionId,s)}async delegateResource(e=0,n,i="BANDWIDTH",s=this.tronWeb.defaultAddress.hex,o=!1,a,u={}){if(this.validator.notValid([{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:i,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'},{name:"receiver",type:"address",value:n},{name:"origin",type:"address",value:s},{name:"lock",type:"boolean",value:o},{name:"lock period",type:"integer",gte:0,value:a,optional:!0}]),mi(n)===mi(s))throw new Error("Receiver address must not be the same as owner address");const l={owner_address:mi(s),receiver_address:mi(n),balance:parseInt(e)};i!=="BANDWIDTH"&&(l.resource=i),o&&(l.lock=o,Vc(a)&&(l.lock_period=a));const g=Ws(u);return Ps(this.tronWeb,Is.DelegateResourceContract,l,u?.permissionId,g)}async undelegateResource(e=0,n,i="BANDWIDTH",s=this.tronWeb.defaultAddress.hex,o={}){if(this.validator.notValid([{name:"origin",type:"address",value:s},{name:"receiver",type:"address",value:n},{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:i,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]),mi(n)===mi(s))throw new Error("Receiver address must not be the same as owner address");const a={owner_address:mi(s),receiver_address:mi(n),balance:parseInt(e)};i!=="BANDWIDTH"&&(a.resource=i);const u=Ws(o);return Ps(this.tronWeb,Is.UnDelegateResourceContract,a,o?.permissionId,u)}async withdrawExpireUnfreeze(e=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"origin",type:"address",value:e}]);const i={owner_address:mi(e)},s=Ws(n);return Ps(this.tronWeb,Is.WithdrawExpireUnfreezeContract,i,n?.permissionId,s)}async withdrawBlockRewards(e=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"origin",type:"address",value:e}]);const i={owner_address:mi(e)},s=Ws(n);return Ps(this.tronWeb,Is.WithdrawBalanceContract,i,n?.permissionId,s)}async applyForSR(e=this.tronWeb.defaultAddress.hex,n="",i={}){this.validator.notValid([{name:"origin",type:"address",value:e},{name:"url",type:"url",value:n,msg:"Invalid url provided"},{name:"url",type:"string",value:n,lte:256,msg:"Invalid url provided"}]);const s={owner_address:mi(e),url:Yc(n)},o=Ws(i);return Ps(this.tronWeb,Is.WitnessCreateContract,s,i?.permissionId,o)}async vote(e={},n=this.tronWeb.defaultAddress.hex,i={}){this.validator.notValid([{name:"voter",type:"address",value:n},{name:"votes",type:"notEmptyObject",value:e}]);const s=Object.entries(e);for(const[l,g]of s)this.validator.notValid([{name:"SR",type:"address",value:l},{name:"vote count",type:"integer",gt:0,value:g,msg:"Invalid vote count provided for SR: "+l}]);const o=s.map(([l,g])=>({vote_address:mi(l),vote_count:parseInt(g)})),a={owner_address:mi(n),votes:o},u=Ws(i);return Ps(this.tronWeb,Is.VoteWitnessContract,a,i?.permissionId,u)}async createSmartContract(e={},n=this.tronWeb.defaultAddress.hex){const i=e.feeLimit||this.tronWeb.feeLimit;let s=e.userFeePercentage;typeof s!="number"&&!s&&(s=100);const o=e.originEnergyLimit||1e7,a=e.callValue||0,u=e.tokenValue,l=e.tokenId||e.token_id;let{abi:g}=e;const{parameters:y=[]}=e;let A="";const{bytecode:I=!1,name:P=""}=e;if(g&&$c(g))try{g=JSON.parse(g)}catch{throw new Error("Invalid options.abi provided")}const D=g;let U=D;if(D.entrys&&(U=D.entrys),!Ow(U))throw new Error("Invalid options.abi provided");const V=U.some(Se=>Se.type==="constructor"&&Se.stateMutability.toLowerCase()==="payable");if(this.validator.notValid([{name:"bytecode",type:"hex",value:I},{name:"feeLimit",type:"integer",value:i,gt:0},{name:"callValue",type:"integer",value:a,gte:0},{name:"userFeePercentage",type:"integer",value:s,gte:0,lte:100},{name:"originEnergyLimit",type:"integer",value:o,gte:0,lte:1e7},{name:"parameters",type:"array",value:y},{name:"issuer",type:"address",value:n},{name:"tokenValue",type:"integer",value:u,gte:0,optional:!0},{name:"tokenId",type:"integer",value:l,gte:0,optional:!0}]),!V&&(a>0||u>0))throw new Error("When contract is not payable, options.callValue and options.tokenValue must be 0");const{rawParameter:J,funcABIV2:re,parametersV2:ce}=e;if(J&&$c(J))A=J.replace(/^(0x)/,"");else if(re)A=IR(re,ce).replace(/^(0x)/,"");else{let Se=U.find(Ce=>Ce.type==="constructor");if(typeof Se<"u"&&Se){const Ce=new Lp,je=[],$e=[];if(Se=Se.inputs,y.length!=Se.length)throw new Error(`constructor needs ${Se.length} but ${y.length} provided`);for(let Qe=0;Qe<y.length;Qe++){let nt=Se[Qe].type,Ne=y[Qe];if(!nt||!$c(nt)||!nt.length)throw new Error("Invalid parameter type provided: "+nt);const Me=ct=>Ow(ct)?ct.map(mt=>Me(mt)):mi(ct).replace(Qw,"0x");nt==="address"||nt.match(/^([^\x5b]*)(\x5b|$)/)?.[0]==="address["?Ne=Me(Ne):/trcToken/.test(nt)&&(nt=nt.replace(/trcToken/,"uint256")),je.push(nt),$e.push(Ne)}try{A=Ce.encode(je,$e).replace(/^(0x)/,"")}catch(Qe){throw new Error(Qe)}}else A=""}const Re={owner_address:mi(n),fee_limit:parseInt(i),call_value:parseInt(a),consume_user_resource_percent:s,origin_energy_limit:o,abi:JSON.stringify(U),bytecode:I,parameter:A,name:P};Vc(u)&&(Re.call_token_value=parseInt(u)),Vc(l)&&(Re.token_id=parseInt(l));const De={};De.owner_address=Re.owner_address,Vc(Re.call_token_value)&&(De.call_token_value=Re.call_token_value),Vc(Re.token_id)&&(De.token_id=Re.token_id);const Ue=De.new_contract={};Re.abi?Ue.abi={entrys:JSON.parse(Re.abi)}:Ue.abi={},Re.call_value&&(Ue.call_value=Re.call_value),Ue.consume_user_resource_percent=Re.consume_user_resource_percent,Ue.origin_energy_limit=Re.origin_energy_limit,Ue.origin_address=Re.origin_address??Re.owner_address,Re.bytecode+Re.parameter&&(Ue.bytecode=(Re.bytecode+Re.parameter).replace(/^0x/,"")),Vc(Re.name)&&(Ue.name=Re.name);const Ve=Ws(e),pe=await Ps(this.tronWeb,Is.CreateSmartContract,De,e?.permissionId,{...Ve,fee_limit:Re.fee_limit});return pe.contract_address=i_e(Re.owner_address,pe.txID),pe}async triggerSmartContract(e,n,i,s,o){const a=[e,n,i,s,o];return typeof a[2]!="object"&&(a[2]={feeLimit:a[2],callValue:a[3]},a.splice(3,1)),a[2]?.txLocal?this._triggerSmartContractLocal(...a):this._triggerSmartContract(...a)}async triggerConstantContract(e,n,i={},s=[],o=this.tronWeb.defaultAddress.hex){return i._isConstant=!0,this._triggerSmartContract(e,n,i,s,o)}async triggerConfirmedConstantContract(e,n,i={},s=[],o=this.tronWeb.defaultAddress.hex){return i._isConstant=!0,i.confirmed=!0,this._triggerSmartContract(e,n,i,s,o)}async estimateEnergy(e,n,i={},s=[],o=this.tronWeb.defaultAddress.hex){return i.estimateEnergy=!0,await this._triggerSmartContract(e,n,i,s,o)}async deployConstantContract(e={input:"",ownerAddress:""}){const{input:n,ownerAddress:i,tokenId:s,tokenValue:o,callValue:a=0}=e;this.validator.notValid([{name:"input",type:"not-empty-string",value:n},{name:"callValue",type:"integer",value:a,gte:0},{name:"owner",type:"address",value:i},{name:"tokenValue",type:"integer",value:o,gte:0,optional:!0},{name:"tokenId",type:"integer",value:s,gte:0,optional:!0}]);const u={data:n,owner_address:mi(i),call_value:a};s&&(u.token_id=s),o&&(u.call_token_value=o);const l=`wallet${e.confirmed?"solidity":""}/estimateenergy`,g=await this.tronWeb[e.confirmed?"solidityNode":"fullNode"].request(l,u,"post");if(g.Error)throw new Error(g.Error);if(g.result&&g.result.message)throw new Error(this.tronWeb.toUtf8(g.result.message));return g}_getTriggerSmartContractArgs(e,n,i,s,o,a,u,l,g){const y={contract_address:mi(e),owner_address:mi(o)};if(n&&$c(n)){n=n.replace(/\s*/g,"");let A;if(s.length){const I=new Lp;let P=[];const D=[];for(let U=0;U<s.length;U++){let{value:V}=s[U];const{type:J}=s[U];if(!J||!$c(J)||!J.length)throw new Error("Invalid parameter type provided: "+J);const re=ce=>Ow(ce)?ce.map(Re=>re(Re)):mi(ce).replace(Qw,"0x");(J==="address"||J.match(/^([^\x5b]*)(\x5b|$)/)?.[0]==="address[")&&(V=re(V)),P.push(J),D.push(V)}try{P=P.map(U=>(/trcToken/.test(U)&&(U=U.replace(/trcToken/,"uint256")),U)),A=I.encode(P,D).replace(/^(0x)/,"")}catch(U){throw new Error(U)}}else A="";i.funcABIV2&&(A=IR(i.funcABIV2,i.parametersV2).replace(/^(0x)/,"")),i.shieldedParameter&&$c(i.shieldedParameter)&&(A=i.shieldedParameter.replace(/^(0x)/,"")),i.rawParameter&&$c(i.rawParameter)&&(A=i.rawParameter.replace(/^(0x)/,"")),y.function_selector=n,y.parameter=A}else i.input&&(y.data=i.input);return y.call_value=parseInt(l),Vc(a)&&(y.call_token_value=parseInt(a)),Vc(u)&&(y.token_id=parseInt(u)),i._isConstant||i.estimateEnergy||(y.fee_limit=parseInt(g)),i.permissionId&&(y.Permission_id=i.permissionId),y}async _triggerSmartContractLocal(e,n,i={},s=[],o=this.tronWeb.defaultAddress.hex){const{tokenValue:a,tokenId:u,callValue:l,feeLimit:g}=Object.assign({callValue:0,feeLimit:this.tronWeb.feeLimit},i);this.validator.notValid([{name:"feeLimit",type:"integer",value:g,gt:0},{name:"callValue",type:"integer",value:l,gte:0},{name:"parameters",type:"array",value:s},{name:"contract",type:"address",value:e},{name:"issuer",type:"address",value:o,optional:!0},{name:"tokenValue",type:"integer",value:a,gte:0,optional:!0},{name:"tokenId",type:"integer",value:u,gte:0,optional:!0}]);const y=this._getTriggerSmartContractArgs(e,n,i,s,o,a,u,l,g);y.function_selector&&(y.data=Ss(o_e.from(y.function_selector,"utf-8")).toString().substring(2,10)+y.parameter);const A={data:y.data,owner_address:y.owner_address,contract_address:y.contract_address};y.call_value&&(A.call_value=y.call_value),y.call_token_value&&(A.call_token_value=y.call_token_value),y.token_id&&(A.token_id=y.token_id);const I=Ws(i),P=await Ps(this.tronWeb,Is.TriggerSmartContract,A,i.permissionId,{...I,fee_limit:y.fee_limit});return{result:{result:!0},transaction:P}}async _triggerSmartContract(e,n,i={},s=[],o=this.tronWeb.defaultAddress.hex){const{tokenValue:a,tokenId:u,callValue:l,feeLimit:g}=Object.assign({callValue:0,feeLimit:this.tronWeb.feeLimit},i);this.validator.notValid([{name:"feeLimit",type:"integer",value:g,gt:0},{name:"callValue",type:"integer",value:l,gte:0},{name:"parameters",type:"array",value:s},{name:"contract",type:"address",value:e},{name:"issuer",type:"address",value:o,optional:!0},{name:"tokenValue",type:"integer",value:a,gte:0,optional:!0},{name:"tokenId",type:"integer",value:u,gte:0,optional:!0}]);const y=this._getTriggerSmartContractArgs(e,n,i,s,o,a,u,l,g);let A="triggersmartcontract";i._isConstant?A="triggerconstantcontract":i.estimateEnergy&&(A="estimateenergy"),A=`wallet${i.confirmed?"solidity":""}/${A}`;const I=await this.tronWeb[i.confirmed?"solidityNode":"fullNode"].request(A,y,"post");return n_e(I,y,i)}async clearABI(e,n=this.tronWeb.defaultAddress.hex,i={}){if(!pi.isAddress(e))throw new Error("Invalid contract address provided");if(!pi.isAddress(n))throw new Error("Invalid owner address provided");const s={contract_address:mi(e),owner_address:mi(n)};this.tronWeb.trx.cache.contracts[e]&&delete this.tronWeb.trx.cache.contracts[e];const o=Ws(i);return Ps(this.tronWeb,Is.ClearABIContract,s,i?.permissionId,o)}async updateBrokerage(e,n=this.tronWeb.defaultAddress.hex,i={}){if(!Vc(e))throw new Error("Invalid brokerage provided");if(!_y(e)||e<0||e>100)throw new Error("Brokerage must be an integer between 0 and 100");if(!pi.isAddress(n))throw new Error("Invalid owner address provided");const s={brokerage:parseInt(e),owner_address:mi(n)},o=Ws(i);return Ps(this.tronWeb,Is.UpdateBrokerageContract,s,i?.permissionId,o)}async createToken(e={},n=this.tronWeb.defaultAddress.hex){const{name:i=!1,abbreviation:s=!1,description:o="",url:a=!1,totalSupply:u=0,trxRatio:l=1,tokenRatio:g=1,saleStart:y=Date.now(),saleEnd:A=!1,freeBandwidth:I=0,freeBandwidthLimit:P=0,frozenAmount:D=0,frozenDuration:U=0,voteScore:V,precision:J}=e;if(this.validator.notValid([{name:"Supply amount",type:"positive-integer",value:u},{name:"TRX ratio",type:"positive-integer",value:l},{name:"Token ratio",type:"positive-integer",value:g},{name:"token abbreviation",type:"string",value:s,lte:32,gt:0},{name:"token name",type:"not-empty-string",value:i},{name:"token description",type:"string",value:o,lte:200},{name:"token url",type:"url",value:a},{name:"token url",type:"string",value:a,lte:256},{name:"issuer",type:"address",value:n},{name:"sale start timestamp",type:"integer",value:y,gte:Date.now()},{name:"sale end timestamp",type:"integer",value:A,gt:y},{name:"Frozen supply",type:"integer",value:D,gte:0},{name:"Frozen duration",type:"integer",value:U,gte:0}]),Vc(V)&&(!_y(V)||V<=0))throw new Error("voteScore must be a positive integer greater than 0");if(Vc(J)&&(!_y(J)||J<0||J>6))throw new Error("precision must be a positive integer >= 0 and <= 6");const re={owner_address:mi(n),name:Yc(i),abbr:Yc(s),description:Yc(o),url:Yc(a),total_supply:parseInt(u),trx_num:parseInt(l),num:parseInt(g),start_time:parseInt(y),end_time:parseInt(A),frozen_supply:[{frozen_amount:parseInt(D),frozen_days:parseInt(U)}]};["name","abbr","description","url"].forEach(Re=>{re[Re]||delete re[Re]}),parseInt(D)>0||delete re.frozen_supply,I&&!isNaN(parseInt(I))&&parseInt(I)>=0&&(re.free_asset_net_limit=parseInt(I)),P&&!isNaN(parseInt(P))&&parseInt(P)>=0&&(re.public_free_asset_net_limit=parseInt(P)),J&&!isNaN(parseInt(J))&&(re.precision=parseInt(J)),V&&!isNaN(parseInt(V))&&(re.vote_score=parseInt(V));const ce=Ws(e);return Ps(this.tronWeb,Is.AssetIssueContract,re,e?.permissionId,ce)}async createAccount(e,n=this.tronWeb.defaultAddress.hex,i={}){this.validator.notValid([{name:"account",type:"address",value:e},{name:"origin",type:"address",value:n}]);const s={owner_address:mi(n),account_address:mi(e)},o=Ws(i);return Ps(this.tronWeb,Is.AccountCreateContract,s,i?.permissionId,o)}async updateAccount(e,n=this.tronWeb.defaultAddress.hex,i={}){this.validator.notValid([{name:"Name",type:"string",lte:200,gt:0,value:e,msg:"Invalid accountName"},{name:"origin",type:"address",value:n}]);const s={account_name:Yc(e),owner_address:mi(n)},o=Ws(i);return Ps(this.tronWeb,Is.AccountUpdateContract,s,i?.permissionId,o)}async setAccountId(e,n=this.tronWeb.defaultAddress.hex,i={}){e&&$c(e)&&e.startsWith("0x")&&(e=e.slice(2)),this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e},{name:"origin",type:"address",value:n}]);const s={account_id:e,owner_address:mi(n)},o=Ws(i);return Ps(this.tronWeb,Is.SetAccountIdContract,s,i?.permissionId,o)}async updateToken(e={},n=this.tronWeb.defaultAddress.hex){const{description:i="",url:s=!1,freeBandwidth:o=0,freeBandwidthLimit:a=0}=e;this.validator.notValid([{name:"token description",type:"string",value:i,lte:200},{name:"token url",type:"url",value:s},{name:"token url",type:"string",value:s,lte:256},{name:"issuer",type:"address",value:n}]);const u={owner_address:mi(n),description:Yc(i),url:Yc(s)};o&&!isNaN(parseInt(o))&&parseInt(o)>=0&&(u.new_limit=parseInt(o)),a&&!isNaN(parseInt(a))&&parseInt(a)>=0&&(u.new_public_limit=parseInt(a));const l=Ws(e);return Ps(this.tronWeb,Is.UpdateAssetContract,u,e?.permissionId,l)}async sendAsset(e,n=0,i,s=this.tronWeb.defaultAddress.hex,o={}){return this.sendToken(e,n,i,s,o)}async purchaseAsset(e,n,i=0,s=this.tronWeb.defaultAddress.hex,o={}){return this.purchaseToken(e,n,i,s,o)}async createAsset(e,n){return this.createToken(e,n)}async updateAsset(e={},n=this.tronWeb.defaultAddress.hex){return this.updateToken(e,n)}async createProposal(e,n=this.tronWeb.defaultAddress.hex,i={}){this.validator.notValid([{name:"issuer",type:"address",value:n}]);const s="Invalid proposal parameters provided";if(!e)throw new Error(s);const o=Ow(e)?e:[e];for(const l of o)if(!sE(l))throw new Error(s);const a={owner_address:mi(n),parameters:o},u=Ws(i);return Ps(this.tronWeb,Is.ProposalCreateContract,a,i?.permissionId,u)}async deleteProposal(e,n=this.tronWeb.defaultAddress.hex,i={}){this.validator.notValid([{name:"issuer",type:"address",value:n},{name:"proposalID",type:"integer",value:e,gte:0}]);const s={owner_address:mi(n),proposal_id:parseInt(e)},o=Ws(i);return Ps(this.tronWeb,Is.ProposalDeleteContract,s,i?.permissionId,o)}async voteProposal(e,n=!1,i=this.tronWeb.defaultAddress.hex,s={}){this.validator.notValid([{name:"voter",type:"address",value:i},{name:"proposalID",type:"integer",value:e,gte:0},{name:"has approval",type:"boolean",value:n}]);const o={owner_address:mi(i),proposal_id:parseInt(e),is_add_approval:n},a=Ws(s);return Ps(this.tronWeb,Is.ProposalApproveContract,o,s?.permissionId,a)}async createTRXExchange(e,n,i,s=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"owner",type:"address",value:s},{name:"token name",type:"not-empty-string",value:e},{name:"token balance",type:"positive-integer",value:n},{name:"trx balance",type:"positive-integer",value:i}]);const a={owner_address:mi(s),first_token_id:Yc(e),first_token_balance:n,second_token_id:"5f",second_token_balance:i},u=Ws(o);return Ps(this.tronWeb,Is.ExchangeCreateContract,a,o?.permissionId,u)}async createTokenExchange(e,n,i,s,o=this.tronWeb.defaultAddress.hex,a={}){this.validator.notValid([{name:"owner",type:"address",value:o},{name:"first token name",type:"not-empty-string",value:e},{name:"second token name",type:"not-empty-string",value:i},{name:"first token balance",type:"positive-integer",value:n},{name:"second token balance",type:"positive-integer",value:s}]);const u={owner_address:mi(o),first_token_id:Yc(e),first_token_balance:n,second_token_id:Yc(i),second_token_balance:s},l=Ws(a);return Ps(this.tronWeb,Is.ExchangeCreateContract,u,a?.permissionId,l)}async injectExchangeTokens(e,n,i,s=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"owner",type:"address",value:s},{name:"token name",type:"not-empty-string",value:n},{name:"token amount",type:"integer",value:i,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}]);const a={owner_address:mi(s),exchange_id:parseInt(e),token_id:Yc(n),quant:parseInt(i)},u=Ws(o);return Ps(this.tronWeb,Is.ExchangeInjectContract,a,o?.permissionId,u)}async withdrawExchangeTokens(e,n,i,s=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"owner",type:"address",value:s},{name:"token name",type:"not-empty-string",value:n},{name:"token amount",type:"integer",value:i,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}]);const a={owner_address:mi(s),exchange_id:parseInt(e),token_id:Yc(n),quant:parseInt(i)},u=Ws(o);return Ps(this.tronWeb,Is.ExchangeWithdrawContract,a,o?.permissionId,u)}async tradeExchangeTokens(e,n,i,s,o=this.tronWeb.defaultAddress.hex,a={}){this.validator.notValid([{name:"owner",type:"address",value:o},{name:"token name",type:"not-empty-string",value:n},{name:"tokenAmountSold",type:"integer",value:i,gte:1},{name:"tokenAmountExpected",type:"integer",value:s,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}]);const u={owner_address:mi(o),exchange_id:parseInt(e),token_id:pi.fromAscii(n).replace(/^0x/,""),quant:parseInt(i),expected:parseInt(s)},l=Ws(a);return Ps(this.tronWeb,Is.ExchangeTransactionContract,u,a?.permissionId,l)}async updateSetting(e,n,i=this.tronWeb.defaultAddress.hex,s={}){this.validator.notValid([{name:"owner",type:"address",value:i},{name:"contract",type:"address",value:e},{name:"userFeePercentage",type:"integer",value:n,gte:0,lte:100}]);const o={owner_address:mi(i),contract_address:mi(e),consume_user_resource_percent:n},a=Ws(s);return Ps(this.tronWeb,Is.UpdateSettingContract,o,s?.permissionId,a)}async updateEnergyLimit(e,n=0,i=this.tronWeb.defaultAddress.hex,s={}){this.validator.notValid([{name:"owner",type:"address",value:i},{name:"contract",type:"address",value:e},{name:"originEnergyLimit",type:"integer",value:n,gte:0,lte:1e7}]);const o={owner_address:mi(i),contract_address:mi(e),origin_energy_limit:n},a=Ws(s);return Ps(this.tronWeb,Is.UpdateEnergyLimitContract,o,s?.permissionId,a)}checkPermissions(e,n){if(e){if(e.type!==n||!e.permission_name||!$c(e.permission_name)||!_y(e.threshold)||e.threshold<1||!e.keys)return!1;for(const i of e.keys)if(!pi.isAddress(i.address)||!_y(i.weight)||i.weight>e.threshold||i.weight<1||n===2&&!e.operations)return!1}return!0}async updateAccountPermissions(e=this.tronWeb.defaultAddress.hex,n,i,s,o={}){if(!pi.isAddress(e))throw new Error("Invalid ownerAddress provided");if(!this.checkPermissions(n,0))throw new Error("Invalid ownerPermissions provided");if(!this.checkPermissions(i,1))throw new Error("Invalid witnessPermissions provided");Array.isArray(s)||(s=[s]);for(const l of s)if(!this.checkPermissions(l,2))throw new Error("Invalid activesPermissions provided");const a={owner_address:mi(e)};if(n){const l=LP(n);"type"in l&&delete l.type,l.keys=l.keys?.map(({address:g,weight:y})=>({address:this.tronWeb.address.toHex(g),weight:y})),a.owner=l}if(i){const l=LP(i);l.type="Witness",l.keys=l.keys.map(({address:g,weight:y})=>({address:this.tronWeb.address.toHex(g),weight:y})),a.witness=l}if(s){const l=LP(s);l.forEach(g=>{g.type="Active"}),l.forEach(g=>{g.keys=g.keys.map(({address:y,weight:A})=>({address:this.tronWeb.address.toHex(y),weight:A}))}),a.actives=l}const u=Ws(o);return Ps(this.tronWeb,Is.AccountPermissionUpdateContract,a,o?.permissionId,u)}async newTxID(e,n={}){if(n?.txLocal){const i=e.raw_data.contract[0];try{const s=await Ps(this.tronWeb,i.type,i.parameter.value,i.Permission_id,{fee_limit:e.raw_data.fee_limit,data:e.raw_data.data,ref_block_bytes:e.raw_data.ref_block_bytes,ref_block_hash:e.raw_data.ref_block_hash,expiration:e.raw_data.expiration,timestamp:e.raw_data.timestamp});return s.signature=e.signature,s.visible=e.visible,s}catch{throw new Error("Error generating a new transaction id.")}}try{const i=await this.tronWeb.fullNode.request("wallet/getsignweight",e,"post");return typeof e.visible=="boolean"&&(i.transaction.transaction.visible=e.visible),r_e(i.transaction.transaction,{...e.raw_data.contract[0].parameter.value,Permission_id:e.raw_data.contract[0].Permission_id},{data:e.raw_data.data,fee_limit:e.raw_data.fee_limit})}catch{throw new Error("Error generating a new transaction id.")}}async alterTransaction(e,n={}){if(Reflect.has(e,"signature"))throw new Error("You can not extend the expiration of a signed transaction.");if(n.data){if(n.dataFormat!=="hex"&&(n.data=pi.toHex(n.data)),n.data=n.data.replace(/^0x/,""),n.data.length===0)throw new Error("Invalid data provided");e.raw_data.data=n.data}if(n.extension){if(n.extension=parseInt(n.extension*1e3),isNaN(n.extension)||e.raw_data.expiration+n.extension<=Date.now()+3e3)throw new Error("Invalid extension provided");e.raw_data.expiration+=n.extension}return await this.newTxID(e,{txLocal:n.txLocal})}async extendExpiration(e,n,i={}){return await this.alterTransaction(e,{extension:n,txLocal:i?.txLocal})}async addUpdateData(e,n,i="utf8",s={}){return this.alterTransaction(e,{data:n,dataFormat:i,txLocal:s?.txLocal})}}const yJ=`TRON Signed Message:
|
||
32`,mJ=`Ethereum Signed Message:
|
||
32`;function Wy(r){return pi.address.toHex(r)}class $p{tronWeb;cache;validator;signMessage;sendAsset;send;sendTrx;broadcast;broadcastHex;signTransaction;constructor(e){this.tronWeb=e,this.cache={contracts:{}},this.validator=new JX,this.signMessage=this.sign,this.sendAsset=this.sendToken,this.send=this.sendTransaction,this.sendTrx=this.sendTransaction,this.broadcast=this.sendRawTransaction,this.broadcastHex=this.sendHexTransaction,this.signTransaction=this.sign}_parseToken(e){return{...e,name:this.tronWeb.toUtf8(e.name),abbr:e.abbr&&this.tronWeb.toUtf8(e.abbr),description:e.description&&this.tronWeb.toUtf8(e.description),url:e.url&&this.tronWeb.toUtf8(e.url)}}getCurrentBlock(){return this.tronWeb.fullNode.request("wallet/getnowblock")}getConfirmedCurrentBlock(){return this.tronWeb.solidityNode.request("walletsolidity/getnowblock")}async getBlock(e=this.tronWeb.defaultBlock){if(e===!1)throw new Error("No block identifier provided");return e=="earliest"&&(e=0),e=="latest"?this.getCurrentBlock():isNaN(+e)&&qn.isHex(e.toString())?this.getBlockByHash(e):this.getBlockByNumber(e)}async getBlockByHash(e){const n=await this.tronWeb.fullNode.request("wallet/getblockbyid",{value:e},"post");if(!Object.keys(n).length)throw new Error("Block not found");return n}async getBlockByNumber(e){if(!qn.isInteger(e)||e<0)throw new Error("Invalid block number provided");return this.tronWeb.fullNode.request("wallet/getblockbynum",{num:parseInt(e)},"post").then(n=>{if(!Object.keys(n).length)throw new Error("Block not found");return n})}async getBlockTransactionCount(e=this.tronWeb.defaultBlock){const{transactions:n=[]}=await this.getBlock(e);return n.length}async getTransactionFromBlock(e=this.tronWeb.defaultBlock,n){const{transactions:i}=await this.getBlock(e);if(!i)throw new Error("Transaction not found in block");if(n>=0&&n<i.length)return i[n];throw new Error("Invalid transaction index provided")}async getTransactionsFromBlock(e=this.tronWeb.defaultBlock){const{transactions:n}=await this.getBlock(e);if(!n)throw new Error("Transaction not found in block");return n}async getTransaction(e){const n=await this.tronWeb.fullNode.request("wallet/gettransactionbyid",{value:e},"post");if(!Object.keys(n).length)throw new Error("Transaction not found");return n}async getConfirmedTransaction(e){const n=await this.tronWeb.solidityNode.request("walletsolidity/gettransactionbyid",{value:e},"post");if(!Object.keys(n).length)throw new Error("Transaction not found");return n}getUnconfirmedTransactionInfo(e){return this.tronWeb.fullNode.request("wallet/gettransactioninfobyid",{value:e},"post")}getTransactionInfo(e){return this.tronWeb.solidityNode.request("walletsolidity/gettransactioninfobyid",{value:e},"post")}getTransactionsToAddress(e=this.tronWeb.defaultAddress.hex,n=30,i=0){return this.getTransactionsRelated(this.tronWeb.address.toHex(e),"to",n,i)}getTransactionsFromAddress(e=this.tronWeb.defaultAddress.hex,n=30,i=0){return this.getTransactionsRelated(this.tronWeb.address.toHex(e),"from",n,i)}async getTransactionsRelated(e=this.tronWeb.defaultAddress.hex,n="all",i=30,s=0){if(this.tronWeb.fullnodeSatisfies(">=4.1.1"))throw new Error("This api is not supported any more");if(!["to","from","all"].includes(n))throw new Error('Invalid direction provided: Expected "to", "from" or "all"');if(n=="all"){const[o,a]=await Promise.all([this.getTransactionsRelated(e,"from",i,s),this.getTransactionsRelated(e,"to",i,s)]);return[...o.map(u=>(u.direction="from",u)),...a.map(u=>(u.direction="to",u))].sort((u,l)=>l.raw_data.timestamp-u.raw_data.timestamp)}if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");if(!qn.isInteger(i)||i<0||s&&i<1)throw new Error("Invalid limit provided");if(!qn.isInteger(s)||s<0)throw new Error("Invalid offset provided");return e=this.tronWeb.address.toHex(e),this.tronWeb.solidityNode.request(`walletextension/gettransactions${n}this`,{account:{address:e},offset:s,limit:i},"post").then(({transaction:o})=>o)}async getAccount(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=this.tronWeb.address.toHex(e),this.tronWeb.solidityNode.request("walletsolidity/getaccount",{address:e},"post")}getAccountById(e){return this.getAccountInfoById(e,{confirmed:!0})}async getAccountInfoById(e,n){return this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e}]),e.startsWith("0x")&&(e=e.slice(2)),this.tronWeb[n.confirmed?"solidityNode":"fullNode"].request(`wallet${n.confirmed?"solidity":""}/getaccountbyid`,{account_id:e},"post")}async getBalance(e=this.tronWeb.defaultAddress.hex){const{balance:n=0}=await this.getAccount(e);return n}async getUnconfirmedAccount(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=this.tronWeb.address.toHex(e),this.tronWeb.fullNode.request("wallet/getaccount",{address:e},"post")}getUnconfirmedAccountById(e){return this.getAccountInfoById(e,{confirmed:!1})}async getUnconfirmedBalance(e=this.tronWeb.defaultAddress.hex){const{balance:n=0}=await this.getUnconfirmedAccount(e);return n}async getBandwidth(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=this.tronWeb.address.toHex(e),this.tronWeb.fullNode.request("wallet/getaccountnet",{address:e},"post").then(({freeNetUsed:n=0,freeNetLimit:i=0,NetUsed:s=0,NetLimit:o=0})=>i-n+(o-s))}async getTokensIssuedByAddress(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=this.tronWeb.address.toHex(e),this.tronWeb.fullNode.request("wallet/getassetissuebyaccount",{address:e},"post").then(({assetIssue:n})=>n?n.map(s=>this._parseToken(s)).reduce((s,o)=>(s[o.name]=o,s),{}):{})}async getTokenFromID(e){if(qn.isInteger(e)&&(e=e.toString()),!qn.isString(e)||!e.length)throw new Error("Invalid token ID provided");return this.tronWeb.fullNode.request("wallet/getassetissuebyname",{value:this.tronWeb.fromUtf8(e)},"post").then(n=>{if(!n.name)throw new Error("Token does not exist");return this._parseToken(n)})}async listNodes(){const{nodes:e=[]}=await this.tronWeb.fullNode.request("wallet/listnodes");return e.map(({address:{host:n,port:i}})=>`${this.tronWeb.toUtf8(n)}:${i}`)}async getBlockRange(e=0,n=30){if(!qn.isInteger(e)||e<0)throw new Error("Invalid start of range provided");if(!qn.isInteger(n)||n<e)throw new Error("Invalid end of range provided");if(n+1-e>100)throw new Error("Invalid range size, which should be no more than 100.");return this.tronWeb.fullNode.request("wallet/getblockbylimitnext",{startNum:parseInt(e),endNum:parseInt(n)+1},"post").then(({block:i=[]})=>i)}async listSuperRepresentatives(){const{witnesses:e=[]}=await this.tronWeb.fullNode.request("wallet/listwitnesses");return e}async listTokens(e=0,n=0){if(!qn.isInteger(e)||e<0||n&&e<1)throw new Error("Invalid limit provided");if(!qn.isInteger(n)||n<0)throw new Error("Invalid offset provided");return e?this.tronWeb.fullNode.request("wallet/getpaginatedassetissuelist",{offset:parseInt(n),limit:parseInt(e)},"post").then(({assetIssue:i=[]})=>i.map(s=>this._parseToken(s))):this.tronWeb.fullNode.request("wallet/getassetissuelist").then(({assetIssue:i=[]})=>i.map(s=>this._parseToken(s)))}async timeUntilNextVoteCycle(){const{num:e=-1}=await this.tronWeb.fullNode.request("wallet/getnextmaintenancetime");if(e==-1)throw new Error("Failed to get time until next vote cycle");return Math.floor(e/1e3)}async getContract(e){if(!this.tronWeb.isAddress(e))throw new Error("Invalid contract address provided");if(this.cache.contracts[e])return this.cache.contracts[e];e=this.tronWeb.address.toHex(e);const n=await this.tronWeb.fullNode.request("wallet/getcontract",{value:e});if(n.Error)throw new Error("Contract does not exist");return this.cache.contracts[e]=n,n}ecRecover(e){return $p.ecRecover(e)}static ecRecover(e){if(!kR(e))throw new Error("Invalid transaction");if(!e.signature?.length)throw new Error("Transaction is not signed");if(e.signature.length===1){const n=WP(e.txID,e.signature[0]);return pi.address.fromHex(n)}return e.signature.map(n=>{const i=WP(e.txID,n);return pi.address.fromHex(i)})}async verifyMessage(e,n,i=this.tronWeb.defaultAddress.base58,s=!0){if(!qn.isHex(e))throw new Error("Expected hex message input");if($p.verifySignature(e,i,n,s))return!0;throw new Error("Signature does not match")}static verifySignature(e,n,i,s=!0){e=e.replace(/^0x/,"");const o=[...Kc(s?yJ:mJ),...qn.code.hexStr2byteArray(e)],a=Ss(new Uint8Array(o)),u=zw(a,ca.from(`0x${i.replace(/^0x/,"")}`)),l=id+u.substr(2);return pi.address.fromHex(l)==pi.address.fromHex(n)}async verifyMessageV2(e,n){return $p.verifyMessageV2(e,n)}static verifyMessageV2(e,n){return qn.message.verifyMessage(e,n)}verifyTypedData(e,n,i,s,o=this.tronWeb.defaultAddress.base58){if($p.verifyTypedData(e,n,i,s,o))return!0;throw new Error("Signature does not match")}static verifyTypedData(e,n,i,s,o){const a=qn._TypedDataEncoder.hash(e,n,i),u=zw(a,ca.from(`0x${s.replace(/^0x/,"")}`)),l=id+u.substr(2);return pi.address.fromHex(l)==pi.address.fromHex(o)}async sign(e,n=this.tronWeb.defaultPrivateKey,i=!0,s=!1){if(qn.isString(e)){if(!qn.isHex(e))throw new Error("Expected hex message input");return $p.signString(e,n,i)}if(!qn.isObject(e))throw new Error("Invalid transaction provided");if(!s&&e.signature)throw new Error("Transaction is already signed");if(!s){if(this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(n)).toLowerCase()!==this.tronWeb.address.toHex(e.raw_data.contract[0].parameter.value.owner_address))throw new Error("Private key does not match address in transaction");if(!kR(e))throw new Error("Invalid transaction")}return qn.crypto.signTransaction(n,e)}static signString(e,n,i=!0){e=e.replace(/^0x/,"");const s=`0x${n.replace(/^0x/,"")}`,o=new $u(s),a=[...Kc(i?yJ:mJ),...qn.code.hexStr2byteArray(e)],u=Ss(new Uint8Array(a)),l=o.sign(u);return["0x",l.r.substring(2),l.s.substring(2),Number(l.v).toString(16)].join("")}signMessageV2(e,n=this.tronWeb.defaultPrivateKey){return $p.signMessageV2(e,n)}static signMessageV2(e,n){return qn.message.signMessage(e,n)}_signTypedData(e,n,i,s=this.tronWeb.defaultPrivateKey){return $p._signTypedData(e,n,i,s)}static _signTypedData(e,n,i,s){return qn.crypto._signTypedData(e,n,i,s)}async multiSign(e,n=this.tronWeb.defaultPrivateKey,i=0){if(!qn.isObject(e)||!e.raw_data||!e.raw_data.contract)throw new Error("Invalid transaction provided");if(!e.raw_data.contract[0].Permission_id&&i>0){e.raw_data.contract[0].Permission_id=i;const s=this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(n)).toLowerCase(),o=await this.getSignWeight(e,i);if(o.result.code==="PERMISSION_ERROR")throw new Error(o.result.message);let a=!1;if(o.permission.keys.map(u=>{u.address===s&&(a=!0)}),!a)throw new Error(n+" has no permission to sign");if(o.approved_list&&o.approved_list.indexOf(s)!=-1)throw new Error(n+" already sign transaction");if(o.transaction&&o.transaction.transaction)e=o.transaction.transaction,i>0&&(e.raw_data.contract[0].Permission_id=i);else throw new Error("Invalid transaction provided")}if(!kR(e))throw new Error("Invalid transaction");return qn.crypto.signTransaction(n,e)}async getApprovedList(e){if(!qn.isObject(e))throw new Error("Invalid transaction provided");return this.tronWeb.fullNode.request("wallet/getapprovedlist",e,"post")}async getSignWeight(e,n){if(!qn.isObject(e)||!e.raw_data||!e.raw_data.contract)throw new Error("Invalid transaction provided");return qn.isInteger(n)?e.raw_data.contract[0].Permission_id=parseInt(n):typeof e.raw_data.contract[0].Permission_id!="number"&&(e.raw_data.contract[0].Permission_id=0),this.tronWeb.fullNode.request("wallet/getsignweight",e,"post")}async sendRawTransaction(e){if(!qn.isObject(e))throw new Error("Invalid transaction provided");if(!e.signature||!qn.isArray(e.signature))throw new Error("Transaction is not signed");return{...await this.tronWeb.fullNode.request("wallet/broadcasttransaction",e,"post"),transaction:e}}async sendHexTransaction(e){if(!qn.isHex(e))throw new Error("Invalid hex transaction provided");const n={transaction:e},i=await this.tronWeb.fullNode.request("wallet/broadcasthex",n,"post");return i.result?{...i,transaction:JSON.parse(i.transaction),hexTransaction:e}:i}async sendTransaction(e,n,i={}){if(typeof i=="string"&&(i={privateKey:i}),!this.tronWeb.isAddress(e))throw new Error("Invalid recipient provided");if(!qn.isInteger(n)||n<=0)throw new Error("Invalid amount provided");if(i={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...i},!i.privateKey&&!i.address)throw new Error("Function requires either a private key or address to be set");const s=i.privateKey?this.tronWeb.address.fromPrivateKey(i.privateKey):i.address,o=await this.tronWeb.transactionBuilder.sendTrx(e,n,s),a=await this.sign(o,i.privateKey);return await this.sendRawTransaction(a)}async sendToken(e,n,i,s={}){if(typeof s=="string"&&(s={privateKey:s}),!this.tronWeb.isAddress(e))throw new Error("Invalid recipient provided");if(!qn.isInteger(n)||n<=0)throw new Error("Invalid amount provided");if(qn.isInteger(i)&&(i=i.toString()),!qn.isString(i))throw new Error("Invalid token ID provided");if(s={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...s},!s.privateKey&&!s.address)throw new Error("Function requires either a private key or address to be set");const o=s.privateKey?this.tronWeb.address.fromPrivateKey(s.privateKey):s.address,a=await this.tronWeb.transactionBuilder.sendToken(e,n,i,o),u=await this.sign(a,s.privateKey);return await this.sendRawTransaction(u)}async freezeBalance(e=0,n=3,i="BANDWIDTH",s={},o){if(typeof s=="string"&&(s={privateKey:s}),!["BANDWIDTH","ENERGY"].includes(i))throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"');if(!qn.isInteger(e)||e<=0)throw new Error("Invalid amount provided");if(!qn.isInteger(n)||n<3)throw new Error("Invalid duration provided, minimum of 3 days");if(s={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...s},!s.privateKey&&!s.address)throw new Error("Function requires either a private key or address to be set");const a=s.privateKey?this.tronWeb.address.fromPrivateKey(s.privateKey):s.address,u=await this.tronWeb.transactionBuilder.freezeBalance(e,n,i,a,o),l=await this.sign(u,s.privateKey);return await this.sendRawTransaction(l)}async unfreezeBalance(e="BANDWIDTH",n={},i){if(typeof n=="string"&&(n={privateKey:n}),!["BANDWIDTH","ENERGY"].includes(e))throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"');if(n={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...n},!n.privateKey&&!n.address)throw new Error("Function requires either a private key or address to be set");const s=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,o=await this.tronWeb.transactionBuilder.unfreezeBalance(e,s,i),a=await this.sign(o,n.privateKey);return await this.sendRawTransaction(a)}async updateAccount(e,n={}){if(typeof n=="string"&&(n={privateKey:n}),!qn.isString(e)||!e.length)throw new Error("Name must be a string");if(n={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...n},!n.privateKey&&!n.address)throw Error("Function requires either a private key or address to be set");const i=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,s=await this.tronWeb.transactionBuilder.updateAccount(e,i),o=await this.sign(s,n.privateKey);return await this.sendRawTransaction(o)}async getProposal(e){if(!qn.isInteger(e)||e<0)throw new Error("Invalid proposalID provided");return this.tronWeb.fullNode.request("wallet/getproposalbyid",{id:parseInt(e)},"post")}async listProposals(){const{proposals:e=[]}=await this.tronWeb.fullNode.request("wallet/listproposals",{},"post");return e}async getChainParameters(){const{chainParameter:e=[]}=await this.tronWeb.fullNode.request("wallet/getchainparameters",{},"post");return e}async getAccountResources(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.tronWeb.fullNode.request("wallet/getaccountresource",{address:this.tronWeb.address.toHex(e)},"post")}async getDelegatedResourceV2(e=this.tronWeb.defaultAddress.hex,n=this.tronWeb.defaultAddress.hex,i={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");if(!this.tronWeb.isAddress(n))throw new Error("Invalid address provided");return this.tronWeb[i.confirmed?"solidityNode":"fullNode"].request(`wallet${i.confirmed?"solidity":""}/getdelegatedresourcev2`,{fromAddress:Wy(e),toAddress:Wy(n)},"post")}async getDelegatedResourceAccountIndexV2(e=this.tronWeb.defaultAddress.hex,n={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.tronWeb[n.confirmed?"solidityNode":"fullNode"].request(`wallet${n.confirmed?"solidity":""}/getdelegatedresourceaccountindexv2`,{value:Wy(e)},"post")}async getCanDelegatedMaxSize(e=this.tronWeb.defaultAddress.hex,n="BANDWIDTH",i={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.validator.notValid([{name:"resource",type:"resource",value:n,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]),this.tronWeb[i.confirmed?"solidityNode":"fullNode"].request(`wallet${i.confirmed?"solidity":""}/getcandelegatedmaxsize`,{owner_address:Wy(e),type:n==="ENERGY"?1:0},"post")}async getAvailableUnfreezeCount(e=this.tronWeb.defaultAddress.hex,n={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.tronWeb[n.confirmed?"solidityNode":"fullNode"].request(`wallet${n.confirmed?"solidity":""}/getavailableunfreezecount`,{owner_address:Wy(e)},"post")}async getCanWithdrawUnfreezeAmount(e=this.tronWeb.defaultAddress.hex,n=Date.now(),i={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");if(!qn.isInteger(n)||n<0)throw new Error("Invalid timestamp provided");return this.tronWeb[i.confirmed?"solidityNode":"fullNode"].request(`wallet${i.confirmed?"solidity":""}/getcanwithdrawunfreezeamount`,{owner_address:Wy(e),timestamp:n},"post")}async getExchangeByID(e){if(!qn.isInteger(e)||e<0)throw new Error("Invalid exchangeID provided");return this.tronWeb.fullNode.request("wallet/getexchangebyid",{id:e},"post")}async listExchanges(){return this.tronWeb.fullNode.request("wallet/listexchanges",{},"post").then(({exchanges:e=[]})=>e)}async listExchangesPaginated(e=10,n=0){return this.tronWeb.fullNode.request("wallet/getpaginatedexchangelist",{limit:e,offset:n},"post").then(({exchanges:i=[]})=>i)}async getNodeInfo(){return this.tronWeb.fullNode.request("wallet/getnodeinfo",{},"post")}async getTokenListByName(e){if(qn.isInteger(e)&&(e=e.toString()),!qn.isString(e)||!e.length)throw new Error("Invalid token ID provided");return this.tronWeb.fullNode.request("wallet/getassetissuelistbyname",{value:this.tronWeb.fromUtf8(e)},"post").then(n=>{if(Array.isArray(n.assetIssue))return n.assetIssue.map(i=>this._parseToken(i));if(!n.name)throw new Error("Token does not exist");return this._parseToken(n)})}getTokenByID(e){if(qn.isInteger(e)&&(e=e.toString()),!qn.isString(e)||!e.length)throw new Error("Invalid token ID provided");return this.tronWeb.fullNode.request("wallet/getassetissuebyid",{value:e},"post").then(n=>{if(!n.name)throw new Error("Token does not exist");return this._parseToken(n)})}async getReward(e,n={}){return n.confirmed=!0,this._getReward(e,n)}async getUnconfirmedReward(e,n={}){return n.confirmed=!1,this._getReward(e,n)}async getBrokerage(e,n={}){return n.confirmed=!0,this._getBrokerage(e,n)}async getUnconfirmedBrokerage(e,n={}){return n.confirmed=!1,this._getBrokerage(e,n)}async _getReward(e=this.tronWeb.defaultAddress.hex,n){this.validator.notValid([{name:"origin",type:"address",value:e}]);const i={address:Wy(e)};return this.tronWeb[n.confirmed?"solidityNode":"fullNode"].request(`wallet${n.confirmed?"solidity":""}/getReward`,i,"post").then((s={reward:void 0})=>{if(typeof s.reward>"u")throw new Error("Not found.");return s.reward})}async _getBrokerage(e=this.tronWeb.defaultAddress.hex,n){this.validator.notValid([{name:"origin",type:"address",value:e}]);const i={address:Wy(e)};return this.tronWeb[n.confirmed?"solidityNode":"fullNode"].request(`wallet${n.confirmed?"solidity":""}/getBrokerage`,i,"post").then((s={})=>{if(typeof s.brokerage>"u")throw new Error("Not found.");return s.brokerage})}async getBandwidthPrices(){return this.tronWeb.fullNode.request("wallet/getbandwidthprices",{},"post").then((e={})=>{if(typeof e.prices>"u")throw new Error("Not found.");return e.prices})}async getEnergyPrices(){return this.tronWeb.fullNode.request("wallet/getenergyprices",{},"post").then((e={})=>{if(typeof e.prices>"u")throw new Error("Not found.");return e.prices})}}const u_e=r=>{if("stateMutability"in r&&(r.stateMutability=r.stateMutability?r.stateMutability.toLowerCase():"nonpayable"),r.type=r.type?r.type.toLowerCase():"",r.type==="fallback"||r.type==="receive")return"0x";const e=new qn.ethersUtils.Interface([r]);let n;if(r.type==="event"?n=e.getEvent(r.name):n=e.getFunction(r.name),n)return n.format("sighash");throw new Error("unknown function")},DP=(r,e)=>XX(r,e);class c_e{tronWeb;contract;abi;name;inputs;outputs;functionSelector;signature;defaultOptions;constructor(e,n){this.tronWeb=e.tronWeb,this.contract=e,this.abi=n,this.name=n.name||n.type,this.inputs=n.inputs||[],this.outputs=[],"outputs"in n&&n.outputs&&(this.outputs=n.outputs),this.functionSelector=u_e(n),this.signature=CJ(this.functionSelector,!1).slice(0,8),this.defaultOptions={feeLimit:this.tronWeb.feeLimit,callValue:0,userFeePercentage:100,shouldPollResponse:!1}}decodeInput(e){const n=JSON.parse(JSON.stringify(this.abi));return n.outputs=n.inputs,DP(n,"0x"+e)}onMethod(...e){let n="";return this.abi&&!/event/i.test(this.abi.type)&&(n=IR(this.abi,e)),{call:async(i={})=>(i={...i,rawParameter:n},await this._call([],[],i)),send:async(i={},s=this.tronWeb.defaultPrivateKey)=>(i={...i,rawParameter:n},await this._send([],[],i,s))}}async _call(e,n,i={}){if(e.length!==n.length)throw new Error("Invalid argument count provided");if(!this.contract.address)throw new Error("Smart contract is missing address");if(!this.contract.deployed)throw new Error("Calling smart contracts requires you to load the contract first");if("stateMutability"in this.abi){const{stateMutability:l}=this.abi;if(l&&!["pure","view"].includes(l.toLowerCase()))throw new Error(`Methods with state mutability "${l}" must use send()`)}i={...this.defaultOptions,from:this.tronWeb.defaultAddress.hex,...i,_isConstant:!0};const s=n.map((l,g)=>({type:e[g],value:l})),o=await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,i,s,i.from?this.tronWeb.address.toHex(i.from):void 0);if(!qn.hasProperty(o,"constant_result"))throw new Error("Failed to execute");const a=o.constant_result[0].length;if(a===0||a%64===8){let l="The call has been reverted or has thrown an error.";if(a!==0){l+=" Error message: ";let g="";const y=o.constant_result[0].substring(8);for(let A=0;A<a-8;A+=64)g+=this.tronWeb.toUtf8(y.substring(A,A+64));l+=g.replace(/(\u0000|\u000b|\f)+/g," ").replace(/ +/g," ").replace(/\s+$/g,"")}throw new Error(l)}let u=DP(this.abi,"0x"+o.constant_result[0]);return u.length===1&&Object.keys(u).length===1&&(u=u[0]),u}async _send(e,n,i={},s=this.tronWeb.defaultPrivateKey){if(e.length!==n.length)throw new Error("Invalid argument count provided");if(!this.contract.address)throw new Error("Smart contract is missing address");if(!this.contract.deployed)throw new Error("Calling smart contracts requires you to load the contract first");const{stateMutability:o}=this.abi;if(["pure","view"].includes(o.toLowerCase()))throw new Error(`Methods with state mutability "${o}" must use call()`);["payable"].includes(o.toLowerCase())||(i.callValue=0),i={...this.defaultOptions,from:this.tronWeb.defaultAddress.hex,...i};const a=n.map((I,P)=>({type:e[P],value:I})),u=s?this.tronWeb.address.fromPrivateKey(s):this.tronWeb.defaultAddress.base58,l=await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,i,a,this.tronWeb.address.toHex(u));if(!l.result||!l.result.result)throw new Error("Unknown error: "+JSON.stringify(l,null,2));const g=await this.tronWeb.trx.sign(l.transaction,s);if(!g.signature)throw s?new Error("Invalid private key provided"):new Error("Transaction was not signed properly");const y=await this.tronWeb.trx.sendRawTransaction(g);if(y.code){const I={error:y.code,message:y.code};y.message&&(I.message=this.tronWeb.toUtf8(y.message));const P=new Error(I.message);throw P.error=y.code,P}if(!i.shouldPollResponse)return g.txID;const A=async I=>{if(I===(i.pollTimes||20)){const U=new Error("Cannot find result in solidity node");throw U.error="Cannot find result in solidity node",U.transaction=g,U}const P=await this.tronWeb.trx.getTransactionInfo(g.txID);if(!Object.keys(P).length)return await new Promise(U=>setTimeout(U,3e3)),A(I+1);if(P.result&&P.result==="FAILED"){const U=new Error(this.tronWeb.toUtf8(P.resMessage));throw U.error=this.tronWeb.toUtf8(P.resMessage),U.transaction=g,U.output=P,U}if(!qn.hasProperty(P,"contractResult")){const U=new Error("Failed to execute: "+JSON.stringify(P,null,2));throw U.error="Failed to execute: "+JSON.stringify(P,null,2),U.transaction=g,U.output=P,U}if(i.rawResponse)return P;let D=DP(this.abi,"0x"+P.contractResult[0]);return D.length===1&&Object.keys(D).length===1&&(D=D[0]),i.keepTxID?[g.txID,D]:D};return A(0)}}class l_e{tronWeb;abi;address;eventListener;bytecode;deployed;lastBlock;methods;methodInstances;props;constructor(e,n=[],i){if(!e||!(e instanceof pi))throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.address=i,this.abi=n,this.eventListener=!1,this.bytecode=!1,this.deployed=!1,this.lastBlock=!1,this.methods={},this.methodInstances={},this.props=[],qn.address.isAddress(i)?this.deployed=!0:this.address=!1,this.loadAbi(n)}hasProperty(e){return this.hasOwnProperty(e)||this.__proto__.hasOwnProperty(e)}loadAbi(e){this.abi=e,this.methods={},this.props.forEach(n=>delete this[n]),e.forEach(n=>{if(!n.type||/constructor|error/i.test(n.type))return;const i=new c_e(this,n),s=i.onMethod.bind(i),{name:o,functionSelector:a,signature:u}=i;this.methods[o]=s,this.methods[a]=s,this.methods[u]=s,this.methodInstances[o]=i,this.methodInstances[a]=i,this.methodInstances[u]=i,this.hasProperty(o)||(this[o]=s,this.props.push(o)),this.hasProperty(a)||(this[a]=s,this.props.push(a)),this.hasProperty(u)||(this[u]=s,this.props.push(u))})}decodeInput(e){const n=e.substring(0,8),i=e.substring(8);if(!this.methodInstances[n])throw new Error("Contract method "+n+" not found");return{name:this.methodInstances[n].name,params:this.methodInstances[n].decodeInput(i)}}async new(e,n=this.tronWeb.defaultPrivateKey){const i=this.tronWeb.address.fromPrivateKey(n),s=await this.tronWeb.transactionBuilder.createSmartContract(e,i),o=await this.tronWeb.trx.sign(s,n),a=await this.tronWeb.trx.sendRawTransaction(o);if(a.code)throw{error:a.code,message:this.tronWeb.toUtf8(a.message)};return await qn.sleep(3e3),this.at(o.contract_address)}async at(e){try{const n=await this.tronWeb.trx.getContract(e);if(!n.contract_address)throw new Error("Unknown error: "+JSON.stringify(n,null,2));return this.address=n.contract_address,this.bytecode=n.bytecode,this.deployed=!0,this.loadAbi(n.abi?n.abi.entrys?n.abi.entrys:[]:[]),this}catch(n){throw n.toString().includes("does not exist")?new Error("Contract has not been deployed on the network"):new Error(n)}}}class f_e{tronWeb;pluginNoOverride;disablePlugins;constructor(e,n={}){if(!e||!(e instanceof pi))throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.pluginNoOverride=["register"],this.disablePlugins=!!n.disablePlugins}register(e,n){let i={requires:"0.0.0",components:{}};const s={libs:[],plugged:[],skipped:[],error:void 0};if(this.disablePlugins)return s.error="This instance of TronWeb has plugins disabled.",s;const o=new e(this.tronWeb);if(qn.isFunction(o.pluginInterface)&&(i=o.pluginInterface(n)),qX.satisfies(pi.version,i.requires))if(i.fullClass){const a=o.constructor.name,u=a.substring(0,1).toLowerCase()+a.substring(1);a!==u&&(Object.assign(pi,{[a]:e}),Object.assign(this.tronWeb,{[u]:o}),s.libs.push(a))}else for(const a in i.components){if(!this.tronWeb.hasOwnProperty(a))continue;const u=i.components[a],l=this.tronWeb[a].pluginNoOverride||[];for(const g in u){if(g==="constructor"||this.tronWeb[a][g]&&(l.includes(g)||/^_/.test(g))){s.skipped.push(g);continue}this.tronWeb[a][g]=u[g].bind(this.tronWeb[a]),s.plugged.push(g)}}else throw new Error("The plugin is not compatible with this version of TronWeb");return s}}class d_e{tronWeb;constructor(e){if(!e||!(e instanceof pi))throw new Error("Expected instance of TronWeb");this.tronWeb=e}setServer(e,n="healthcheck"){if(!e)return this.tronWeb.eventServer=void 0;if(qn.isString(e)&&(e=new GX(e)),!this.tronWeb.isValidProvider(e))throw new Error("Invalid event server provided");this.tronWeb.eventServer=e,this.tronWeb.eventServer.isConnected=()=>this.tronWeb.eventServer.request(n).then(()=>!0).catch(()=>!1)}async getEventsByContractAddress(e,n={}){const i=Object.assign({limit:20},n),{eventName:s,blockNumber:o,onlyUnconfirmed:a,onlyConfirmed:u,minBlockTimestamp:l,maxBlockTimestamp:g,orderBy:y,fingerprint:A}=i;let{limit:I}=i;if(!this.tronWeb.eventServer)throw new Error("No event server configured");if(!this.tronWeb.isAddress(e))throw new Error("Invalid contract address provided");if(typeof l<"u"&&!qn.isInteger(l))throw new Error("Invalid minBlockTimestamp provided");if(typeof g<"u"&&!qn.isInteger(g))throw new Error("Invalid maxBlockTimestamp provided");qn.isInteger(I)&&I>200&&(console.warn("Defaulting to maximum accepted limit: 200"),I=200);const P={};s&&(P.event_name=s),o&&(P.block_number=o),typeof a=="boolean"&&(P.only_unconfirmed=a),typeof u=="boolean"&&(P.only_confirmed=u),l&&(P.min_block_timestamp=l),g&&(P.max_block_timestamp=g),y&&(P.order_by=y),A&&(P.fingerprint=A),qn.isInteger(I)&&(P.limit=I);const D=await this.tronWeb.eventServer.request(`v1/contracts/${this.tronWeb.address.fromHex(e)}/events?${new URLSearchParams(P).toString()}`);if(D.success)return D;throw new Error(D.error)}async getEventsByTransactionID(e,n={}){if(!this.tronWeb.eventServer)throw new Error("No event server configured");const i={};return typeof n.only_unconfirmed=="boolean"&&(i.only_unconfirmed=n.only_unconfirmed),typeof n.only_confirmed=="boolean"&&(i.only_confirmed=n.only_confirmed),this.tronWeb.eventServer.request(`v1/transactions/${e}/events?${new URLSearchParams(i).toString()}`).then(s=>{if(s.success)return s;throw new Error(JSON.parse(s.error).message)})}async getEventsByBlockNumber(e,n={}){if(!this.tronWeb.eventServer)throw new Error("No event server configured");const i={};return typeof n.only_confirmed=="boolean"&&(i.only_confirmed=n.only_confirmed),n.limit&&(i.limit=n.limit),n.fingerprint&&(i.fingerprint=n.fingerprint),this.tronWeb.eventServer.request(`v1/blocks/${e}/events?${new URLSearchParams(i).toString()}`).then(s=>{if(s.success)return s;throw new Error(s.error)})}async getEventsOfLatestBlock(e={}){if(!this.tronWeb.eventServer)throw new Error("No event server configured");const n={};return typeof e.only_confirmed=="boolean"&&(n.only_confirmed=e.only_confirmed),this.tronWeb.eventServer.request(`v1/blocks/latest/events?${new URLSearchParams(n).toString()}`).then(i=>{if(i.success)return i;throw new Error(i.error)})}}var CR=tn(36533).Buffer;const bJ="4.7.1",h_e=15e7,p_e="6.0.3";function vJ(r){return!!r&&typeof r=="object"&&(!!r.fullNode||!!r.fullHost)}class pi extends zde{providers;BigNumber;transactionBuilder;trx;plugin;event;version;static version=p_e;utils;defaultBlock;defaultPrivateKey;defaultAddress;fullnodeVersion;feeLimit;fullNode;solidityNode;eventServer;constructor(e,n="",i,s=""){super();let o,a=!1,u=!1;vJ(e)?(o=e.fullNode||e.fullHost,n=e.solidityNode||e.fullHost,i=e.eventServer||e.fullHost,a=e.headers||!1,u=e.eventHeaders||a,s=e.privateKey):o=e,qn.isString(o)&&(o=new _f.HttpProvider(o)),qn.isString(n)&&(n=new _f.HttpProvider(n)),qn.isString(i)&&(i=new _f.HttpProvider(i)),this.event=new d_e(this),this.transactionBuilder=new a_e(this),this.trx=new $p(this),this.plugin=new f_e(this,{disablePlugins:vJ(e)?e.disablePlugins:!1}),this.utils=qn,this.setFullNode(o),this.setSolidityNode(n),this.setEventServer(i),this.providers=_f,this.BigNumber=iE,this.defaultBlock=!1,this.defaultPrivateKey=!1,this.defaultAddress={hex:!1,base58:!1},this.version=pi.version,this.sha3=pi.sha3,this.fromUtf8=pi.fromUtf8,this.address=pi.address,this.toAscii=pi.toAscii,this.toUtf8=pi.toUtf8,this.isAddress=pi.isAddress,this.fromAscii=pi.fromAscii,this.toHex=pi.toHex,this.toBigNumber=pi.toBigNumber,this.toDecimal=pi.toDecimal,this.fromDecimal=pi.fromDecimal,this.toSun=pi.toSun,this.fromSun=pi.fromSun,this.createAccount=pi.createAccount,this.createRandom=pi.createRandom,this.fromMnemonic=pi.fromMnemonic,s&&this.setPrivateKey(s),this.fullnodeVersion=bJ,this.feeLimit=h_e,a&&this.setFullNodeHeader(a),u&&this.setEventHeader(u)}async getFullnodeVersion(){try{const e=await this.trx.getNodeInfo();this.fullnodeVersion=e.configNodeInfo.codeVersion,this.fullnodeVersion.split(".").length===2&&(this.fullnodeVersion+=".0")}catch{this.fullnodeVersion=bJ}}setDefaultBlock(e=!1){if([!1,"latest","earliest",0].includes(e))return this.defaultBlock=e;if(!qn.isInteger(e)||!e)throw new Error("Invalid block ID provided");return this.defaultBlock=Math.abs(e)}setPrivateKey(e){try{this.setAddress(pi.address.fromPrivateKey(e))}catch{throw new Error("Invalid private key provided")}this.defaultPrivateKey=e,this.emit("privateKeyChanged",e)}setAddress(e){if(!pi.isAddress(e))throw new Error("Invalid address provided");const n=pi.address.toHex(e),i=pi.address.fromHex(e);this.defaultPrivateKey&&pi.address.fromPrivateKey(this.defaultPrivateKey)!==i&&(this.defaultPrivateKey=!1),this.defaultAddress={hex:n,base58:i},this.emit("addressChanged",{hex:n,base58:i})}fullnodeSatisfies(e){return qX.satisfies(this.fullnodeVersion,e)}isValidProvider(e){return Object.values(_f).some(n=>e instanceof n)}setFullNode(e){if($c(e)&&(e=new _f.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid full node provided");this.fullNode=e,this.fullNode.setStatusPage("wallet/getnowblock")}setSolidityNode(e){if(qn.isString(e)&&(e=new _f.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid solidity node provided");this.solidityNode=e,this.solidityNode.setStatusPage("walletsolidity/getnowblock")}setEventServer(e,n){this.event.setServer(e,n)}setHeader(e={}){const n=new _f.HttpProvider(this.fullNode.host,3e4,"","",e),i=new _f.HttpProvider(this.solidityNode.host,3e4,"","",e),s=new _f.HttpProvider(this.eventServer.host,3e4,"","",e);this.setFullNode(n),this.setSolidityNode(i),this.setEventServer(s)}setFullNodeHeader(e={}){const n=new _f.HttpProvider(this.fullNode.host,3e4,"","",e),i=new _f.HttpProvider(this.solidityNode.host,3e4,"","",e);this.setFullNode(n),this.setSolidityNode(i)}setEventHeader(e={}){const n=new _f.HttpProvider(this.eventServer.host,3e4,"","",e);this.setEventServer(n)}currentProviders(){return{fullNode:this.fullNode,solidityNode:this.solidityNode,eventServer:this.eventServer}}currentProvider(){return this.currentProviders()}getEventResult(...e){return this.event.getEventsByContractAddress(...e)}getEventByTransactionID(...e){return this.event.getEventsByTransactionID(...e)}contract(e=[],n){return new l_e(this,e,n)}address;static get address(){return{fromHex(e){return rX(e)},toHex(e){return mi(e)},toChecksumAddress(e){return mP(e)},isChecksumAddress(e){return nX(e)},fromPrivateKey(e,n=!1){return iX(e,n)}}}sha3;static sha3(e,n=!0){return(n?"0x":"")+Ss(CR.from(e,"utf-8")).toString().substring(2)}toHex;static toHex(e){if(qn.isBoolean(e))return pi.fromDecimal(+e);if(qn.isBigNumber(e))return pi.fromDecimal(e);if(typeof e=="object")return pi.fromUtf8(JSON.stringify(e));if(qn.isString(e)){if(/^(-|)0x/.test(e))return e;if(!isFinite(e)||/^\s*$/.test(e))return pi.fromUtf8(e)}const n=pi.fromDecimal(e);if(n==="0xNaN")throw new Error("The passed value is not convertible to a hex string");return n}toUtf8;static toUtf8(e){if(qn.isHex(e))return e=e.replace(/^0x/,""),CR.from(e,"hex").toString("utf8");throw new Error("The passed value is not a valid hex string")}fromUtf8;static fromUtf8(e){if(!qn.isString(e))throw new Error("The passed value is not a valid utf-8 string");return"0x"+CR.from(e,"utf8").toString("hex")}toAscii;static toAscii(e){if(qn.isHex(e)){let n="",i=0;const s=e.length;for(e.substring(0,2)==="0x"&&(i=2);i<s;i+=2){const o=parseInt(e.substr(i,2),16);n+=String.fromCharCode(o)}return n}else throw new Error("The passed value is not a valid hex string")}fromAscii;static fromAscii(e,n){if(!qn.isString(e))throw new Error("The passed value is not a valid utf-8 string");return"0x"+CR.from(e,"ascii").toString("hex").padEnd(n,"0")}toDecimal;static toDecimal(e){return pi.toBigNumber(e).toNumber()}fromDecimal;static fromDecimal(e){const n=pi.toBigNumber(e),i=n.toString(16);return n.isLessThan(0)?"-0x"+i.substr(1):"0x"+i}fromSun;static fromSun(e){const n=pi.toBigNumber(e).div(1e6);return qn.isBigNumber(e)?n:n.toString(10)}toSun;static toSun(e){const n=pi.toBigNumber(e).times(1e6);return qn.isBigNumber(e)?n:n.toString(10)}toBigNumber;static toBigNumber(e=0){return qn.isBigNumber(e)?e:qn.isString(e)&&/^(-|)0x/.test(e)?new iE(e.replace("0x",""),16):new iE(e.toString(10),10)}isAddress;static isAddress(e=""){return kE(e)}createAccount;static async createAccount(){return qn.accounts.generateAccount()}createRandom;static createRandom(...e){return qn.accounts.generateRandom(...e)}fromMnemonic;static fromMnemonic(...e){return qn.accounts.generateAccountWithMnemonic(...e)}async isConnected(){return{fullNode:await this.fullNode.isConnected(),solidityNode:await this.solidityNode.isConnected(),eventServer:this.eventServer&&await this.eventServer.isConnected()}}}const UP=pi;function g_e(r){return pi.address.toHex(r).replace(Qw,"0x")}function y_e(r){return pi.address.toHex(r)}const wJ=new Uint8Array(32);wJ.fill(0);const m_e=BigInt(-1),AJ=BigInt(0),_J=BigInt(1),b_e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function v_e(r){const e=hi(r),n=e.length%32;return n?bo([e,wJ.slice(n)]):jn(e)}const w_e=eh(_J,32),A_e=eh(AJ,32),EJ={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},FP=["name","version","chainId","verifyingContract","salt"];function TJ(r){return function(e){return xr(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}const __e={name:TJ("name"),version:TJ("version"),chainId:function(r){const e=lo(r,"domain.chainId");return xr(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):KG(e)},verifyingContract:function(r){try{return y_e(r).toLowerCase()}catch{}xr(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){const e=hi(r,"domain.salt");return xr(e.length===32,'invalid domain value "salt"',"domain.salt",r),jn(e)}};function xR(r){{const e=r.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",i=parseInt(e[2]||"256");xr(i%8===0&&i!==0&&i<=256&&(e[2]==null||e[2]===String(i)),"invalid numeric width","type",r);const s=Mw(b_e,n?i-1:i),o=n?(s+_J)*m_e:AJ;return function(a){const u=lo(a,"value");return xr(u>=o&&u<=s,`value out-of-bounds for ${r}`,"value",u),eh(n?g8(u,256):u,32)}}}{const e=r.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return xr(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",r),function(i){const s=hi(i);return xr(s.length===n,`invalid length for ${r}`,"value",i),v_e(i)}}}switch(r){case"trcToken":return xR("uint256");case"address":return function(e){return Ey(g_e(e),32)};case"bool":return function(e){return e?w_e:A_e};case"bytes":return function(e){return Ss(e)};case"string":return function(e){return Bl(e)}}return null}function SJ(r,e){return`${r}(${e.map(({name:n,type:i})=>i+" "+n).join(",")})`}class Dl{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#e=JSON.stringify(e),this.#t=new Map,this.#r=new Map;const n=new Map,i=new Map,s=new Map;Object.keys(e).forEach(u=>{n.set(u,new Set),i.set(u,[]),s.set(u,new Set)});for(const u in e){const l=new Set;for(const g of e[u]){xr(!l.has(g.name),`duplicate variable name ${JSON.stringify(g.name)} in ${JSON.stringify(u)}`,"types",e),l.add(g.name);const y=g.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;xr(y!==u,`circular type reference to ${JSON.stringify(y)}`,"types",e),!xR(y)&&(xr(i.has(y),`unknown type ${JSON.stringify(y)}`,"types",e),i.get(y).push(u),n.get(u).add(y))}}const o=Array.from(i.keys()).filter(u=>i.get(u).length===0);xr(o.length!==0,"missing primary type","types",e),xr(o.length===1,`ambiguous primary types or unused types: ${o.map(u=>JSON.stringify(u)).join(", ")}`,"types",e),Ki(this,{primaryType:o[0]});function a(u,l){xr(!l.has(u),`circular type reference to ${JSON.stringify(u)}`,"types",e),l.add(u);for(const g of n.get(u))if(i.has(g)){a(g,l);for(const y of l)s.get(y).add(g)}l.delete(u)}a(this.primaryType,new Set);for(const[u,l]of s){const g=Array.from(l);g.sort(),this.#t.set(u,SJ(u,e[u])+g.map(y=>SJ(y,e[y])).join(""))}}getEncoder(e){let n=this.#r.get(e);return n||(n=this.#n(e),this.#r.set(e,n)),n}#n(e){{const s=xR(e);if(s)return s}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const s=n[1],o=this.getEncoder(s);return a=>{xr(!n[3]||parseInt(n[3])===a.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",a);let u=a.map(o);return this.#t.has(s)&&(u=u.map(Ss)),Ss(bo(u))}}const i=this.types[e];if(i){const s=Bl(this.#t.get(e));return o=>{const a=i.map(({name:u,type:l})=>{const g=this.getEncoder(l)(o[u]);return this.#t.has(l)?Ss(g):g});return a.unshift(s),bo(a)}}xr(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const n=this.#t.get(e);return xr(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Ss(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,i){if(xR(e))return i(e,n);const s=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(s)return xr(!s[3]||parseInt(s[3])===n.length,`array length mismatch; expected length ${parseInt(s[3])}`,"value",n),n.map(a=>this._visit(s[1],a,i));const o=this.types[e];if(o)return o.reduce((a,{name:u,type:l})=>(a[u]=this._visit(l,n[u],i),a),{});xr(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Dl(e)}static getPrimaryType(e){return Dl.from(e).primaryType}static hashStruct(e,n,i){return Dl.from(n).hashStruct(e,i)}static hashDomain(e){const n=[];for(const i in e){if(e[i]==null)continue;const s=EJ[i];xr(s,`invalid typed-data domain key: ${JSON.stringify(i)}`,"domain",e),n.push({name:i,type:s})}return n.sort((i,s)=>FP.indexOf(i.name)-FP.indexOf(s.name)),Dl.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,i){return bo(["0x1901",Dl.hashDomain(e),Dl.from(n).hash(i)])}static hash(e,n,i){return Ss(Dl.encode(e,n,i))}static async resolveNames(e,n,i,s){e=Object.assign({},e);for(const u in e)e[u]==null&&delete e[u];const o={};e.verifyingContract&&!pc(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const a=Dl.from(n);a.visit(i,(u,l)=>(u==="address"&&!pc(l,20)&&(o[l]="0x"),l));for(const u in o)o[u]=await s(u);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),i=a.visit(i,(u,l)=>u==="address"&&o[l]?o[l]:l),{domain:e,value:i}}static getPayload(e,n,i){Dl.hashDomain(e);const s={},o=[];FP.forEach(l=>{const g=e[l];g!=null&&(s[l]=__e[l](g),o.push({name:l,type:EJ[l]}))});const a=Dl.from(n),u=Object.assign({},n);return xr(u.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),u.EIP712Domain=o,a.encode(i),{types:u,domain:s,primaryType:a.primaryType,message:a.visit(i,(l,g)=>{if(l.match(/^bytes(\d*)/))return jn(hi(g));if(l.match(/^u?int/))return lo(g).toString();switch(l){case"trcToken":return lo(g).toString();case"address":return g.toLowerCase();case"bool":return!!g;case"string":return xr(typeof g=="string","invalid string","value",g),g}xr(!1,"unsupported type","type",l)})}}}function zXe(r,e,n,i){return recoverAddress(Dl.hash(r,e,n),i)}var E_e=tn(36533).Buffer;function T_e(r){return zc(Xs(r).padStart(64,"0"))}function Hy(r){const e=d0(r);let i=d0(e).slice(0,4);return i=r.concat(i),sX(i)}function IJ(r){if(typeof r!="string"||r.length<=4)return!1;let e=lR(r);if(r.length<=4)return!1;const i=e.length-4,s=e.slice(i);e=e.slice(0,i);const o=d0(e),u=d0(o).slice(0,4);if(s[0]==u[0]&&s[1]==u[1]&&s[2]==u[2]&&s[3]==u[3])return e;throw new Error("Invalid address provided")}function S_e(r,e){typeof r=="string"&&(r=zc(r));const n=e.txID,i=HP(zc(n),r);return Array.isArray(e.signature)?e.signature.includes(i)||e.signature.push(i):e.signature=[i],e}function WP(r,e){r="0x"+r.replace(/^0x/,""),e="0x"+e.replace(/^0x/,"");const n=zw(JY(r),ca.from(e));return id+n.substring(2)}function I_e(r){return btoa(String.fromCharCode(...r))}function k_e(r,e){typeof r=="string"&&(r=zc(r));const n=d0(e);return HP(n,r)}function R_e(r,e,n,i){const s=`0x${i.replace(/^0x/,"")}`,o=new $u(s),a=Dl.hash(r,e,n),u=o.sign(a);return["0x",u.r.substring(2),u.s.substring(2),Number(u.v).toString(16)].join("")}function C_e(r){const e=Hb(r);return globalThis.proto.protocol.Transaction.deserializeBinary(e).getRawData().serializeBinary()}function kJ(){const r=df.utils.randomPrivateKey();let e=Xs(r);return e=e.padStart(64,"0"),zc(e)}function NE(r){r.length===65&&(r=r.slice(1));const e=Ss(new Uint8Array(r)).toString().substring(2),n=id+e.substring(24);return zc(n)}function BR(r){const e=i2(r);return NE(e)}function x_e(r){const e=lR(r);if(e.length<=4)return!1;const n=e.slice(0,e.length-4),i=d0(n),s=d0(i);return s[0]===e[n.length]&&s[1]===e[n.length+1]&&s[2]===e[n.length+2]&&s[3]===e[n.length+3]?n:!1}function RJ(r){if(typeof r!="string"||r.length!==QY)return!1;let e=lR(r);if(e.length!==25||e[0]!==eX)return!1;const n=e.slice(21);e=e.slice(0,21);const i=d0(e),o=d0(i).slice(0,4);return n[0]==o[0]&&n[1]==o[1]&&n[2]==o[2]&&n[3]==o[3]}function B_e(r){const e=Hb(r),n=i2(e),i=NE(n);return Hy(i)}function O_e(r){const e=Hb(r),n=i2(e),i=NE(n);return Xs(i)}function P_e(r){const e=Hb(r),n=i2(e),i=NE(n);return u8(i)}function i2(r){const e=df.ProjectivePoint.fromPrivateKey(new Uint8Array(T_e(r))),n=e.x,i=e.y,s=n.toString(16).padStart(64,"0"),o=i.toString(16).padStart(64,"0"),a=`04${s}${o}`;return zc(a)}function HP(r,e){const n=df.sign(Xs(r),Xs(e)),i=n.r.toString(16),s=n.s.toString(16),o=n.recovery+27;return i.padStart(64,"0")+s.padStart(64,"0")+yk(o)}function d0(r){const e=Xs(r),n=gc("0x"+e).replace(/^0x/,"");return zc(n)}function N_e(r){const e=Hb(r),n=BR(e);return Hy(n)}function OR(r,e=!1){const n=zc(r,e),i=BR(n);return Hy(i)}function CJ(r,e=!0){return(e?"0x":"")+Ss(E_e.from(r,"utf-8")).toString().substring(2)}const M_e="Invalid tron path provided";function L_e(){const r=kJ(),e=i2(r),n=BR(r),i=Xs(r),s=Xs(e);return{privateKey:i,publicKey:s,address:{base58:Hy(n),hex:Xs(n)}}}function D_e(r="",e=yP,n){const i=nd.createRandom(r,e,n);return{mnemonic:i.mnemonic,privateKey:i.privateKey,publicKey:i.signingKey.publicKey,address:OR(i.privateKey.replace(/^0x/,"")),path:i.path}}function U_e(r,e=yP,n="",i=null){if(!String(e).match(/^m\/44\'\/195\'/))throw new Error(M_e);const s=nd.fromMnemonic(xy.fromPhrase(r,n,i),e);return{mnemonic:s.mnemonic,privateKey:s.privateKey,publicKey:s.signingKey.publicKey,address:OR(s.privateKey.replace(/^0x/,""))}}const xJ=`TRON Signed Message:
|
||
`;function zP(r){return typeof r=="string"?r=Kc(r):Array.isArray(r)&&(r=new Uint8Array(r)),Ss(bo([Kc(xJ),Kc(String(r.length)),r]))}function F_e(r,e){e.match(/^0x/)||(e="0x"+e);const n=new $u(e),i=zP(r),s=n.sign(i);return XY(s)}function W_e(r,e){e.match(/^0x/)||(e="0x"+e);const n=zw(zP(r),e);return Hy(zc(n.replace(/^0x/,id)))}const qn={...w,address:c,code:h,accounts:R,base58:d,bytes:_,crypto:x,abi:m,message:S,_TypedDataEncoder:Dl,transaction:C,ethersUtils:v};var BJ;(function(r){r[r.BANDWIDTH=0]="BANDWIDTH",r[r.ENERGY=1]="ENERGY",r[r.TRON_POWER=2]="TRON_POWER"})(BJ||(BJ={}));var OJ;(function(r){r.ENOUGH_PERMISSION="ENOUGH_PERMISSION",r.NOT_ENOUGH_PERMISSION="NOT_ENOUGH_PERMISSION",r.SIGNATURE_FORMAT_ERROR="SIGNATURE_FORMAT_ERROR",r.COMPUTE_ADDRESS_ERROR="COMPUTE_ADDRESS_ERROR",r.PERMISSION_ERROR="PERMISSION_ERROR",r.OTHER_ERROR="OTHER_ERROR"})(OJ||(OJ={}));var PJ;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.SIGERROR=1]="SIGERROR",r[r.CONTRACT_VALIDATE_ERROR=2]="CONTRACT_VALIDATE_ERROR",r[r.CONTRACT_EXE_ERROR=3]="CONTRACT_EXE_ERROR",r[r.BANDWITH_ERROR=4]="BANDWITH_ERROR",r[r.DUP_TRANSACTION_ERROR=5]="DUP_TRANSACTION_ERROR",r[r.TAPOS_ERROR=6]="TAPOS_ERROR",r[r.TOO_BIG_TRANSACTION_ERROR=7]="TOO_BIG_TRANSACTION_ERROR",r[r.TRANSACTION_EXPIRATION_ERROR=8]="TRANSACTION_EXPIRATION_ERROR",r[r.SERVER_BUSY=9]="SERVER_BUSY",r[r.NO_CONNECTION=10]="NO_CONNECTION",r[r.NOT_ENOUGH_EFFECTIVE_CONNECTION=11]="NOT_ENOUGH_EFFECTIVE_CONNECTION",r[r.OTHER_ERROR=20]="OTHER_ERROR"})(PJ||(PJ={}));var NJ;(function(r){r[r.PENDING=0]="PENDING",r[r.DISAPPROVED=1]="DISAPPROVED",r[r.APPROVED=2]="APPROVED",r[r.CANCELED=3]="CANCELED"})(NJ||(NJ={}));const VXe=null;var s2=tn(36533).Buffer,$P=new WeakMap,s1=new WeakMap,VP=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,s1,{get:z_e,set:H_e}),de(this,$P,{writable:!0,value:""}),he(this,s1,du(n))}var e=r.prototype;return e.getAddress=function(){var i=qn.address.fromPrivateKey(ys(X(this,s1)));if(!i)throw new Error("Invalid private key");return i},e.signTransaction=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return a=mo(du(X(s,s1))),u=du(i),l=o3(bl(u),a),g=(0,S_.concatSig)(s2.from(bl(l.v)),s2.from(l.r),s2.from(l.s)),y=nw(l.v),A=g.slice(0,g.length-2)+"0"+String(y),P.abrupt("return",A);case 7:case"end":return P.stop()}},o)}))()},e.signMessage=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return a=mo(du(X(s,s1))),u=du(i),l=o3(bl(u),a),g=(0,S_.concatSig)(s2.from(bl(l.v)),s2.from(l.r),s2.from(l.s)),A.abrupt("return",g);case 5:case"end":return A.stop()}},o)}))()},e.getPublicKeyHex=function(){return ys(this.sigingKey.publicKey)},e.exportPrivateKey=function(){return X(this,s1)},r.isValidPk=function(i){var s=ys(i);if(s.length!==64)return!1;try{var o=qn.address.fromPrivateKey(s);return qn.address.isAddress(o)}catch{return!1}},(0,L.A)(r,[{key:"pkBytes",get:function(){return mo(du(X(this,s1)))}},{key:"sigingKey",get:function(){var i=qn.ethersUtils.SigningKey;return new i(this.pkBytes)}}]),r}();function H_e(r){he(this,$P,Mg(r))}function z_e(){return Lg(X(this,$P))}const $_e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),MJ=new Uint8Array(new Array(16).fill(0).map((r,e)=>e)),V_e=MJ.map(r=>(9*r+5)%16);let jP=[MJ],KP=[V_e];for(let r=0;r<4;r++)for(let e of[jP,KP])e.push(e[r].map(n=>$_e[n]));const LJ=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),j_e=jP.map((r,e)=>r.map(n=>LJ[e][n])),K_e=KP.map((r,e)=>r.map(n=>LJ[e][n])),G_e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),q_e=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function DJ(r,e,n,i){return r===0?e^n^i:r===1?e&n|~e&i:r===2?(e|~n)^i:r===3?e&i|n&~i:e^(n|~i)}const PR=new Uint32Array(16);class Z_e extends eb{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:i,h3:s,h4:o}=this;return[e,n,i,s,o]}set(e,n,i,s,o){this.h0=e|0,this.h1=n|0,this.h2=i|0,this.h3=s|0,this.h4=o|0}process(e,n){for(let P=0;P<16;P++,n+=4)PR[P]=e.getUint32(n,!0);let i=this.h0|0,s=i,o=this.h1|0,a=o,u=this.h2|0,l=u,g=this.h3|0,y=g,A=this.h4|0,I=A;for(let P=0;P<5;P++){const D=4-P,U=G_e[P],V=q_e[P],J=jP[P],re=KP[P],ce=j_e[P],Re=K_e[P];for(let De=0;De<16;De++){const Ue=Q0(i+DJ(P,o,u,g)+PR[J[De]]+U,ce[De])+A|0;i=A,A=g,g=Q0(u,10)|0,u=o,o=Ue}for(let De=0;De<16;De++){const Ue=Q0(s+DJ(D,a,l,y)+PR[re[De]]+V,Re[De])+I|0;s=I,I=y,y=Q0(l,10)|0,l=a,a=Ue}}this.set(this.h1+u+y|0,this.h2+g+I|0,this.h3+A+s|0,this.h4+i+a|0,this.h0+o+l|0)}roundClean(){PR.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const Y_e=PA(()=>new Z_e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const NR=BigInt(0),MR=BigInt(1),X_e=BigInt(2);function o1(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function ME(r){if(!o1(r))throw new Error("Uint8Array expected")}function o2(r,e){if(typeof e!="boolean")throw new Error(r+" boolean expected, got "+e)}const J_e=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function a2(r){ME(r);let e="";for(let n=0;n<r.length;n++)e+=J_e[r[n]];return e}function u2(r){const e=r.toString(16);return e.length&1?"0"+e:e}function UJ(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return r===""?NR:BigInt("0x"+r)}const Vp={_0:48,_9:57,A:65,F:70,a:97,f:102};function FJ(r){if(r>=Vp._0&&r<=Vp._9)return r-Vp._0;if(r>=Vp.A&&r<=Vp.F)return r-(Vp.A-10);if(r>=Vp.a&&r<=Vp.f)return r-(Vp.a-10)}function c2(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=FJ(r.charCodeAt(o)),u=FJ(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}function a1(r){return UJ(a2(r))}function GP(r){return ME(r),UJ(a2(Uint8Array.from(r).reverse()))}function l2(r,e){return c2(r.toString(16).padStart(e*2,"0"))}function qP(r,e){return l2(r,e).reverse()}function jXe(r){return c2(u2(r))}function ah(r,e,n){let i;if(typeof e=="string")try{i=c2(e)}catch(o){throw new Error(r+" must be hex string or Uint8Array, cause: "+o)}else if(o1(e))i=Uint8Array.from(e);else throw new Error(r+" must be hex string or Uint8Array");const s=i.length;if(typeof n=="number"&&s!==n)throw new Error(r+" of length "+n+" expected, got "+s);return i}function LE(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];ME(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}function KXe(r,e){if(r.length!==e.length)return!1;let n=0;for(let i=0;i<r.length;i++)n|=r[i]^e[i];return n===0}function GXe(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}const ZP=r=>typeof r=="bigint"&&NR<=r;function LR(r,e,n){return ZP(r)&&ZP(e)&&ZP(n)&&e<=r&&r<n}function u1(r,e,n,i){if(!LR(e,n,i))throw new Error("expected valid "+r+": "+n+" <= n < "+i+", got "+e)}function WJ(r){let e;for(e=0;r>NR;r>>=MR,e+=1);return e}function qXe(r,e){return r>>BigInt(e)&MR}function ZXe(r,e,n){return r|(n?MR:NR)<<BigInt(e)}const YP=r=>(X_e<<BigInt(r-1))-MR,XP=r=>new Uint8Array(r),HJ=r=>Uint8Array.from(r);function zJ(r,e,n){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let i=XP(r),s=XP(r),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},u=(...A)=>n(s,i,...A),l=(A=XP())=>{s=u(HJ([0]),A),i=u(),A.length!==0&&(s=u(HJ([1]),A),i=u())},g=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let A=0;const I=[];for(;A<e;){i=u();const P=i.slice();I.push(P),A+=i.length}return LE(...I)};return(A,I)=>{a(),l(A);let P;for(;!(P=I(g()));)l();return a(),P}}const Q_e={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||o1(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function DE(r,e,n={}){const i=(s,o,a)=>{const u=Q_e[o];if(typeof u!="function")throw new Error("invalid validator function");const l=r[s];if(!(a&&l===void 0)&&!u(l,r))throw new Error("param "+String(s)+" is invalid. Expected "+o+", got "+l)};for(const[s,o]of Object.entries(e))i(s,o,!1);for(const[s,o]of Object.entries(n))i(s,o,!0);return r}const YXe=()=>{throw new Error("not implemented")};function JP(r){const e=new WeakMap;return(n,...i)=>{const s=e.get(n);if(s!==void 0)return s;const o=r(n,...i);return e.set(n,o),o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const iu=BigInt(0),Oo=BigInt(1),zy=BigInt(2),eEe=BigInt(3),QP=BigInt(4),$J=BigInt(5),VJ=BigInt(8),tEe=BigInt(9),rEe=BigInt(16);function ju(r,e){const n=r%e;return n>=iu?n:e+n}function nEe(r,e,n){if(e<iu)throw new Error("invalid exponent, negatives unsupported");if(n<=iu)throw new Error("invalid modulus");if(n===Oo)return iu;let i=Oo;for(;e>iu;)e&Oo&&(i=i*r%n),r=r*r%n,e>>=Oo;return i}function sd(r,e,n){let i=r;for(;e-- >iu;)i*=i,i%=n;return i}function DR(r,e){if(r===iu)throw new Error("invert: expected non-zero number");if(e<=iu)throw new Error("invert: expected positive modulus, got "+e);let n=ju(r,e),i=e,s=iu,o=Oo,a=Oo,u=iu;for(;n!==iu;){const g=i/n,y=i%n,A=s-a*g,I=o-u*g;i=n,n=y,s=a,o=u,a=A,u=I}if(i!==Oo)throw new Error("invert: does not exist");return ju(s,e)}function iEe(r){const e=(r-Oo)/zy;let n,i,s;for(n=r-Oo,i=0;n%zy===iu;n/=zy,i++);for(s=zy;s<r&&nEe(s,e,r)!==r-Oo;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(i===1){const a=(r+Oo)/QP;return function(l,g){const y=l.pow(g,a);if(!l.eql(l.sqr(y),g))throw new Error("Cannot find square root");return y}}const o=(n+Oo)/zy;return function(u,l){if(u.pow(l,e)===u.neg(u.ONE))throw new Error("Cannot find square root");let g=i,y=u.pow(u.mul(u.ONE,s),n),A=u.pow(l,o),I=u.pow(l,n);for(;!u.eql(I,u.ONE);){if(u.eql(I,u.ZERO))return u.ZERO;let P=1;for(let U=u.sqr(I);P<g&&!u.eql(U,u.ONE);P++)U=u.sqr(U);const D=u.pow(y,Oo<<BigInt(g-P-1));y=u.sqr(D),A=u.mul(A,D),I=u.mul(I,y),g=P}return A}}function sEe(r){if(r%QP===eEe){const e=(r+Oo)/QP;return function(i,s){const o=i.pow(s,e);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(r%VJ===$J){const e=(r-$J)/VJ;return function(i,s){const o=i.mul(s,zy),a=i.pow(o,e),u=i.mul(s,a),l=i.mul(i.mul(u,zy),a),g=i.mul(u,i.sub(l,i.ONE));if(!i.eql(i.sqr(g),s))throw new Error("Cannot find square root");return g}}return r%rEe,iEe(r)}const XXe=(r,e)=>(ju(r,e)&Oo)===Oo,oEe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function aEe(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=oEe.reduce((i,s)=>(i[s]="function",i),e);return DE(r,n)}function uEe(r,e,n){if(n<iu)throw new Error("invalid exponent, negatives unsupported");if(n===iu)return r.ONE;if(n===Oo)return e;let i=r.ONE,s=e;for(;n>iu;)n&Oo&&(i=r.mul(i,s)),s=r.sqr(s),n>>=Oo;return i}function cEe(r,e){const n=new Array(e.length),i=e.reduce((o,a,u)=>r.is0(a)?o:(n[u]=o,r.mul(o,a)),r.ONE),s=r.inv(i);return e.reduceRight((o,a,u)=>r.is0(a)?o:(n[u]=r.mul(o,n[u]),r.mul(o,a)),s),n}function JXe(r,e,n){return r.mul(e,typeof n=="bigint"?DR(n,r.ORDER):r.inv(n))}function lEe(r){const e=(r-Oo)/zy;return(n,i)=>n.pow(i,e)}function QXe(r){const e=lEe(r.ORDER);return n=>{const i=e(r,n);return r.eql(i,r.ZERO)||r.eql(i,r.ONE)}}function eN(r,e){const n=e!==void 0?e:r.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function jJ(r,e,n=!1,i={}){if(r<=iu)throw new Error("invalid field: expected ORDER > 0, got "+r);const{nBitLength:s,nByteLength:o}=eN(r,e);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const u=Object.freeze({ORDER:r,isLE:n,BITS:s,BYTES:o,MASK:YP(s),ZERO:iu,ONE:Oo,create:l=>ju(l,r),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return iu<=l&&l<r},is0:l=>l===iu,isOdd:l=>(l&Oo)===Oo,neg:l=>ju(-l,r),eql:(l,g)=>l===g,sqr:l=>ju(l*l,r),add:(l,g)=>ju(l+g,r),sub:(l,g)=>ju(l-g,r),mul:(l,g)=>ju(l*g,r),pow:(l,g)=>uEe(u,l,g),div:(l,g)=>ju(l*DR(g,r),r),sqrN:l=>l*l,addN:(l,g)=>l+g,subN:(l,g)=>l-g,mulN:(l,g)=>l*g,inv:l=>DR(l,r),sqrt:i.sqrt||(l=>(a||(a=sEe(r)),a(u,l))),invertBatch:l=>cEe(u,l),cmov:(l,g,y)=>y?g:l,toBytes:l=>n?qP(l,o):l2(l,o),fromBytes:l=>{if(l.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+l.length);return n?GP(l):a1(l)}});return Object.freeze(u)}function eJe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?n:r.neg(n)}function tJe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?r.neg(n):n}function rJe(r,e,n=!1){r=ensureBytes("privateHash",r);const i=r.length,s=eN(e).nByteLength+8;if(s<24||i<s||i>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+i);const o=n?bytesToNumberLE(r):bytesToNumberBE(r);return ju(o,e-Oo)+Oo}function KJ(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function GJ(r){const e=KJ(r);return e+Math.ceil(e/2)}function fEe(r,e,n=!1){const i=r.length,s=KJ(e),o=GJ(e);if(i<16||i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);const a=n?GP(r):a1(r),u=ju(a,e-Oo)+Oo;return n?qP(u,s):l2(u,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const qJ=BigInt(0),UR=BigInt(1);function tN(r,e){const n=e.negate();return r?n:e}function rN(r,e){if(!Number.isSafeInteger(r)||r<=0||r>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+r)}function nN(r,e){rN(r,e);const n=Math.ceil(e/r)+1,i=2**(r-1);return{windows:n,windowSize:i}}function ZJ(r,e){if(!Array.isArray(r))throw new Error("array expected");r.forEach((n,i)=>{if(!(n instanceof e))throw new Error("invalid point at index "+i)})}function YJ(r,e){if(!Array.isArray(r))throw new Error("array of scalars expected");r.forEach((n,i)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+i)})}const iN=new WeakMap,XJ=new WeakMap;function sN(r){return XJ.get(r)||1}function dEe(r,e){return{constTimeNegate:tN,hasPrecomputes(n){return sN(n)!==1},unsafeLadder(n,i,s=r.ZERO){let o=n;for(;i>qJ;)i&UR&&(s=s.add(o)),o=o.double(),i>>=UR;return s},precomputeWindow(n,i){const{windows:s,windowSize:o}=nN(i,e),a=[];let u=n,l=u;for(let g=0;g<s;g++){l=u,a.push(l);for(let y=1;y<o;y++)l=l.add(u),a.push(l);u=l.double()}return a},wNAF(n,i,s){const{windows:o,windowSize:a}=nN(n,e);let u=r.ZERO,l=r.BASE;const g=BigInt(2**n-1),y=2**n,A=BigInt(n);for(let I=0;I<o;I++){const P=I*a;let D=Number(s&g);s>>=A,D>a&&(D-=y,s+=UR);const U=P,V=P+Math.abs(D)-1,J=I%2!==0,re=D<0;D===0?l=l.add(tN(J,i[U])):u=u.add(tN(re,i[V]))}return{p:u,f:l}},wNAFUnsafe(n,i,s,o=r.ZERO){const{windows:a,windowSize:u}=nN(n,e),l=BigInt(2**n-1),g=2**n,y=BigInt(n);for(let A=0;A<a;A++){const I=A*u;if(s===qJ)break;let P=Number(s&l);if(s>>=y,P>u&&(P-=g,s+=UR),P===0)continue;let D=i[I+Math.abs(P)-1];P<0&&(D=D.negate()),o=o.add(D)}return o},getPrecomputes(n,i,s){let o=iN.get(i);return o||(o=this.precomputeWindow(i,n),n!==1&&iN.set(i,s(o))),o},wNAFCached(n,i,s){const o=sN(n);return this.wNAF(o,this.getPrecomputes(o,n,s),i)},wNAFCachedUnsafe(n,i,s,o){const a=sN(n);return a===1?this.unsafeLadder(n,i,o):this.wNAFUnsafe(a,this.getPrecomputes(a,n,s),i,o)},setWindowSize(n,i){rN(i,e),XJ.set(n,i),iN.delete(n)}}}function hEe(r,e,n,i){if(ZJ(n,r),YJ(i,e),n.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const s=r.ZERO,o=WJ(BigInt(n.length)),a=o>12?o-3:o>4?o-2:o?2:1,u=(1<<a)-1,l=new Array(u+1).fill(s),g=Math.floor((e.BITS-1)/a)*a;let y=s;for(let A=g;A>=0;A-=a){l.fill(s);for(let P=0;P<i.length;P++){const D=i[P],U=Number(D>>BigInt(A)&BigInt(u));l[U]=l[U].add(n[P])}let I=s;for(let P=l.length-1,D=s;P>0;P--)D=D.add(l[P]),I=I.add(D);if(y=y.add(I),A!==0)for(let P=0;P<a;P++)y=y.double()}return y}function nJe(r,e,n,i){rN(i,e.BITS),ZJ(n,r);const s=r.ZERO,o=2**i-1,a=Math.ceil(e.BITS/i),u=BigInt((1<<i)-1),l=n.map(g=>{const y=[];for(let A=0,I=g;A<o;A++)y.push(I),I=I.add(g);return y});return g=>{if(YJ(g,e),g.length>n.length)throw new Error("array of scalars must be smaller than array of points");let y=s;for(let A=0;A<a;A++){if(y!==s)for(let P=0;P<i;P++)y=y.double();const I=BigInt(a*i-(A+1)*i);for(let P=0;P<g.length;P++){const D=g[P],U=Number(D>>I&u);U&&(y=y.add(l[P][U-1]))}}return y}}function JJ(r){return aEe(r.Fp),DE(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...eN(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function QJ(r){r.lowS!==void 0&&o2("lowS",r.lowS),r.prehash!==void 0&&o2("prehash",r.prehash)}function pEe(r){const e=JJ(r);DE(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:i,a:s}=e;if(n){if(!i.eql(s,i.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{Ph:gEe,aT:yEe}=O;class mEe extends Error{constructor(e=""){super(e)}}const jp={Err:mEe,_tlv:{encode:(r,e)=>{const{Err:n}=jp;if(r<0||r>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const i=e.length/2,s=u2(i);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const o=i>127?u2(s.length/2|128):"";return u2(r)+o+s+e},decode(r,e){const{Err:n}=jp;let i=0;if(r<0||r>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[i++]!==r)throw new n("tlv.decode: wrong tlv");const s=e[i++],o=!!(s&128);let a=0;if(!o)a=s;else{const l=s&127;if(!l)throw new n("tlv.decode(long): indefinite length not supported");if(l>4)throw new n("tlv.decode(long): byte length is too big");const g=e.subarray(i,i+l);if(g.length!==l)throw new n("tlv.decode: length bytes not complete");if(g[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const y of g)a=a<<8|y;if(i+=l,a<128)throw new n("tlv.decode(long): not minimal encoding")}const u=e.subarray(i,i+a);if(u.length!==a)throw new n("tlv.decode: wrong value length");return{v:u,l:e.subarray(i+a)}}},_int:{encode(r){const{Err:e}=jp;if(r<uh)throw new e("integer: negative integers are not allowed");let n=u2(r);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(r){const{Err:e}=jp;if(r[0]&128)throw new e("invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return gEe(r)}},toSig(r){const{Err:e,_int:n,_tlv:i}=jp,s=typeof r=="string"?yEe(r):r;ME(s);const{v:o,l:a}=i.decode(48,s);if(a.length)throw new e("invalid signature: left bytes after parsing");const{v:u,l}=i.decode(2,o),{v:g,l:y}=i.decode(2,l);if(y.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(u),s:n.decode(g)}},hexFromSig(r){const{_tlv:e,_int:n}=jp,i=e.encode(2,n.encode(r.r)),s=e.encode(2,n.encode(r.s)),o=i+s;return e.encode(48,o)}},uh=BigInt(0),Io=BigInt(1),$y=BigInt(2),FR=BigInt(3),eQ=BigInt(4);function bEe(r){const e=pEe(r),{Fp:n}=e,i=jJ(e.n,e.nBitLength),s=e.toBytes||((U,V,J)=>{const re=V.toAffine();return LE(Uint8Array.from([4]),n.toBytes(re.x),n.toBytes(re.y))}),o=e.fromBytes||(U=>{const V=U.subarray(1),J=n.fromBytes(V.subarray(0,n.BYTES)),re=n.fromBytes(V.subarray(n.BYTES,2*n.BYTES));return{x:J,y:re}});function a(U){const{a:V,b:J}=e,re=n.sqr(U),ce=n.mul(re,U);return n.add(n.add(ce,n.mul(U,V)),J)}if(!n.eql(n.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function u(U){return LR(U,Io,e.n)}function l(U){const{allowedPrivateKeyLengths:V,nByteLength:J,wrapPrivateKey:re,n:ce}=e;if(V&&typeof U!="bigint"){if(o1(U)&&(U=a2(U)),typeof U!="string"||!V.includes(U.length))throw new Error("invalid private key");U=U.padStart(J*2,"0")}let Re;try{Re=typeof U=="bigint"?U:a1(ah("private key",U,J))}catch{throw new Error("invalid private key, expected hex or "+J+" bytes, got "+typeof U)}return re&&(Re=ju(Re,ce)),u1("private key",Re,Io,ce),Re}function g(U){if(!(U instanceof I))throw new Error("ProjectivePoint expected")}const y=JP((U,V)=>{const{px:J,py:re,pz:ce}=U;if(n.eql(ce,n.ONE))return{x:J,y:re};const Re=U.is0();V==null&&(V=Re?n.ONE:n.inv(ce));const De=n.mul(J,V),Ue=n.mul(re,V),Ve=n.mul(ce,V);if(Re)return{x:n.ZERO,y:n.ZERO};if(!n.eql(Ve,n.ONE))throw new Error("invZ was invalid");return{x:De,y:Ue}}),A=JP(U=>{if(U.is0()){if(e.allowInfinityPoint&&!n.is0(U.py))return;throw new Error("bad point: ZERO")}const{x:V,y:J}=U.toAffine();if(!n.isValid(V)||!n.isValid(J))throw new Error("bad point: x or y not FE");const re=n.sqr(J),ce=a(V);if(!n.eql(re,ce))throw new Error("bad point: equation left != right");if(!U.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class I{constructor(V,J,re){if(this.px=V,this.py=J,this.pz=re,V==null||!n.isValid(V))throw new Error("x required");if(J==null||!n.isValid(J))throw new Error("y required");if(re==null||!n.isValid(re))throw new Error("z required");Object.freeze(this)}static fromAffine(V){const{x:J,y:re}=V||{};if(!V||!n.isValid(J)||!n.isValid(re))throw new Error("invalid affine point");if(V instanceof I)throw new Error("projective point not allowed");const ce=Re=>n.eql(Re,n.ZERO);return ce(J)&&ce(re)?I.ZERO:new I(J,re,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(V){const J=n.invertBatch(V.map(re=>re.pz));return V.map((re,ce)=>re.toAffine(J[ce])).map(I.fromAffine)}static fromHex(V){const J=I.fromAffine(o(ah("pointHex",V)));return J.assertValidity(),J}static fromPrivateKey(V){return I.BASE.multiply(l(V))}static msm(V,J){return hEe(I,i,V,J)}_setWindowSize(V){D.setWindowSize(this,V)}assertValidity(){A(this)}hasEvenY(){const{y:V}=this.toAffine();if(n.isOdd)return!n.isOdd(V);throw new Error("Field doesn't support isOdd")}equals(V){g(V);const{px:J,py:re,pz:ce}=this,{px:Re,py:De,pz:Ue}=V,Ve=n.eql(n.mul(J,Ue),n.mul(Re,ce)),pe=n.eql(n.mul(re,Ue),n.mul(De,ce));return Ve&&pe}negate(){return new I(this.px,n.neg(this.py),this.pz)}double(){const{a:V,b:J}=e,re=n.mul(J,FR),{px:ce,py:Re,pz:De}=this;let Ue=n.ZERO,Ve=n.ZERO,pe=n.ZERO,Se=n.mul(ce,ce),Ce=n.mul(Re,Re),je=n.mul(De,De),$e=n.mul(ce,Re);return $e=n.add($e,$e),pe=n.mul(ce,De),pe=n.add(pe,pe),Ue=n.mul(V,pe),Ve=n.mul(re,je),Ve=n.add(Ue,Ve),Ue=n.sub(Ce,Ve),Ve=n.add(Ce,Ve),Ve=n.mul(Ue,Ve),Ue=n.mul($e,Ue),pe=n.mul(re,pe),je=n.mul(V,je),$e=n.sub(Se,je),$e=n.mul(V,$e),$e=n.add($e,pe),pe=n.add(Se,Se),Se=n.add(pe,Se),Se=n.add(Se,je),Se=n.mul(Se,$e),Ve=n.add(Ve,Se),je=n.mul(Re,De),je=n.add(je,je),Se=n.mul(je,$e),Ue=n.sub(Ue,Se),pe=n.mul(je,Ce),pe=n.add(pe,pe),pe=n.add(pe,pe),new I(Ue,Ve,pe)}add(V){g(V);const{px:J,py:re,pz:ce}=this,{px:Re,py:De,pz:Ue}=V;let Ve=n.ZERO,pe=n.ZERO,Se=n.ZERO;const Ce=e.a,je=n.mul(e.b,FR);let $e=n.mul(J,Re),Qe=n.mul(re,De),nt=n.mul(ce,Ue),Ne=n.add(J,re),Me=n.add(Re,De);Ne=n.mul(Ne,Me),Me=n.add($e,Qe),Ne=n.sub(Ne,Me),Me=n.add(J,ce);let ct=n.add(Re,Ue);return Me=n.mul(Me,ct),ct=n.add($e,nt),Me=n.sub(Me,ct),ct=n.add(re,ce),Ve=n.add(De,Ue),ct=n.mul(ct,Ve),Ve=n.add(Qe,nt),ct=n.sub(ct,Ve),Se=n.mul(Ce,Me),Ve=n.mul(je,nt),Se=n.add(Ve,Se),Ve=n.sub(Qe,Se),Se=n.add(Qe,Se),pe=n.mul(Ve,Se),Qe=n.add($e,$e),Qe=n.add(Qe,$e),nt=n.mul(Ce,nt),Me=n.mul(je,Me),Qe=n.add(Qe,nt),nt=n.sub($e,nt),nt=n.mul(Ce,nt),Me=n.add(Me,nt),$e=n.mul(Qe,Me),pe=n.add(pe,$e),$e=n.mul(ct,Me),Ve=n.mul(Ne,Ve),Ve=n.sub(Ve,$e),$e=n.mul(Ne,Qe),Se=n.mul(ct,Se),Se=n.add(Se,$e),new I(Ve,pe,Se)}subtract(V){return this.add(V.negate())}is0(){return this.equals(I.ZERO)}wNAF(V){return D.wNAFCached(this,V,I.normalizeZ)}multiplyUnsafe(V){const{endo:J,n:re}=e;u1("scalar",V,uh,re);const ce=I.ZERO;if(V===uh)return ce;if(this.is0()||V===Io)return this;if(!J||D.hasPrecomputes(this))return D.wNAFCachedUnsafe(this,V,I.normalizeZ);let{k1neg:Re,k1:De,k2neg:Ue,k2:Ve}=J.splitScalar(V),pe=ce,Se=ce,Ce=this;for(;De>uh||Ve>uh;)De&Io&&(pe=pe.add(Ce)),Ve&Io&&(Se=Se.add(Ce)),Ce=Ce.double(),De>>=Io,Ve>>=Io;return Re&&(pe=pe.negate()),Ue&&(Se=Se.negate()),Se=new I(n.mul(Se.px,J.beta),Se.py,Se.pz),pe.add(Se)}multiply(V){const{endo:J,n:re}=e;u1("scalar",V,Io,re);let ce,Re;if(J){const{k1neg:De,k1:Ue,k2neg:Ve,k2:pe}=J.splitScalar(V);let{p:Se,f:Ce}=this.wNAF(Ue),{p:je,f:$e}=this.wNAF(pe);Se=D.constTimeNegate(De,Se),je=D.constTimeNegate(Ve,je),je=new I(n.mul(je.px,J.beta),je.py,je.pz),ce=Se.add(je),Re=Ce.add($e)}else{const{p:De,f:Ue}=this.wNAF(V);ce=De,Re=Ue}return I.normalizeZ([ce,Re])[0]}multiplyAndAddUnsafe(V,J,re){const ce=I.BASE,Re=(Ue,Ve)=>Ve===uh||Ve===Io||!Ue.equals(ce)?Ue.multiplyUnsafe(Ve):Ue.multiply(Ve),De=Re(this,J).add(Re(V,re));return De.is0()?void 0:De}toAffine(V){return y(this,V)}isTorsionFree(){const{h:V,isTorsionFree:J}=e;if(V===Io)return!0;if(J)return J(I,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:V,clearCofactor:J}=e;return V===Io?this:J?J(I,this):this.multiplyUnsafe(e.h)}toRawBytes(V=!0){return o2("isCompressed",V),this.assertValidity(),s(I,this,V)}toHex(V=!0){return o2("isCompressed",V),a2(this.toRawBytes(V))}}I.BASE=new I(e.Gx,e.Gy,n.ONE),I.ZERO=new I(n.ZERO,n.ONE,n.ZERO);const P=e.nBitLength,D=dEe(I,e.endo?Math.ceil(P/2):P);return{CURVE:e,ProjectivePoint:I,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:u}}function vEe(r){const e=JJ(r);return DE(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function wEe(r){const e=vEe(r),{Fp:n,n:i}=e,s=n.BYTES+1,o=2*n.BYTES+1;function a(nt){return ju(nt,i)}function u(nt){return DR(nt,i)}const{ProjectivePoint:l,normPrivateKeyToScalar:g,weierstrassEquation:y,isWithinCurveOrder:A}=bEe({...e,toBytes(nt,Ne,Me){const ct=Ne.toAffine(),mt=n.toBytes(ct.x),Bt=LE;return o2("isCompressed",Me),Me?Bt(Uint8Array.from([Ne.hasEvenY()?2:3]),mt):Bt(Uint8Array.from([4]),mt,n.toBytes(ct.y))},fromBytes(nt){const Ne=nt.length,Me=nt[0],ct=nt.subarray(1);if(Ne===s&&(Me===2||Me===3)){const mt=a1(ct);if(!LR(mt,Io,n.ORDER))throw new Error("Point is not on curve");const Bt=y(mt);let er;try{er=n.sqrt(Bt)}catch(Dr){const Rr=Dr instanceof Error?": "+Dr.message:"";throw new Error("Point is not on curve"+Rr)}const cr=(er&Io)===Io;return(Me&1)===1!==cr&&(er=n.neg(er)),{x:mt,y:er}}else if(Ne===o&&Me===4){const mt=n.fromBytes(ct.subarray(0,n.BYTES)),Bt=n.fromBytes(ct.subarray(n.BYTES,2*n.BYTES));return{x:mt,y:Bt}}else{const mt=s,Bt=o;throw new Error("invalid Point, expected length of "+mt+", or uncompressed "+Bt+", got "+Ne)}}}),I=nt=>a2(l2(nt,e.nByteLength));function P(nt){const Ne=i>>Io;return nt>Ne}function D(nt){return P(nt)?a(-nt):nt}const U=(nt,Ne,Me)=>a1(nt.slice(Ne,Me));class V{constructor(Ne,Me,ct){this.r=Ne,this.s=Me,this.recovery=ct,this.assertValidity()}static fromCompact(Ne){const Me=e.nByteLength;return Ne=ah("compactSignature",Ne,Me*2),new V(U(Ne,0,Me),U(Ne,Me,2*Me))}static fromDER(Ne){const{r:Me,s:ct}=jp.toSig(ah("DER",Ne));return new V(Me,ct)}assertValidity(){u1("r",this.r,Io,i),u1("s",this.s,Io,i)}addRecoveryBit(Ne){return new V(this.r,this.s,Ne)}recoverPublicKey(Ne){const{r:Me,s:ct,recovery:mt}=this,Bt=Ue(ah("msgHash",Ne));if(mt==null||![0,1,2,3].includes(mt))throw new Error("recovery id invalid");const er=mt===2||mt===3?Me+e.n:Me;if(er>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const cr=mt&1?"03":"02",pr=l.fromHex(cr+I(er)),Dr=u(er),Rr=a(-Bt*Dr),Pr=a(ct*Dr),on=l.BASE.multiplyAndAddUnsafe(pr,Rr,Pr);if(!on)throw new Error("point at infinify");return on.assertValidity(),on}hasHighS(){return P(this.s)}normalizeS(){return this.hasHighS()?new V(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return c2(this.toDERHex())}toDERHex(){return jp.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return c2(this.toCompactHex())}toCompactHex(){return I(this.r)+I(this.s)}}const J={isValidPrivateKey(nt){try{return g(nt),!0}catch{return!1}},normPrivateKeyToScalar:g,randomPrivateKey:()=>{const nt=GJ(e.n);return fEe(e.randomBytes(nt),e.n)},precompute(nt=8,Ne=l.BASE){return Ne._setWindowSize(nt),Ne.multiply(BigInt(3)),Ne}};function re(nt,Ne=!0){return l.fromPrivateKey(nt).toRawBytes(Ne)}function ce(nt){const Ne=o1(nt),Me=typeof nt=="string",ct=(Ne||Me)&&nt.length;return Ne?ct===s||ct===o:Me?ct===2*s||ct===2*o:nt instanceof l}function Re(nt,Ne,Me=!0){if(ce(nt))throw new Error("first arg must be private key");if(!ce(Ne))throw new Error("second arg must be public key");return l.fromHex(Ne).multiply(g(nt)).toRawBytes(Me)}const De=e.bits2int||function(nt){if(nt.length>8192)throw new Error("input is too large");const Ne=a1(nt),Me=nt.length*8-e.nBitLength;return Me>0?Ne>>BigInt(Me):Ne},Ue=e.bits2int_modN||function(nt){return a(De(nt))},Ve=YP(e.nBitLength);function pe(nt){return u1("num < 2^"+e.nBitLength,nt,uh,Ve),l2(nt,e.nByteLength)}function Se(nt,Ne,Me=Ce){if(["recovered","canonical"].some(Ar=>Ar in Me))throw new Error("sign() legacy options not supported");const{hash:ct,randomBytes:mt}=e;let{lowS:Bt,prehash:er,extraEntropy:cr}=Me;Bt==null&&(Bt=!0),nt=ah("msgHash",nt),QJ(Me),er&&(nt=ah("prehashed msgHash",ct(nt)));const pr=Ue(nt),Dr=g(Ne),Rr=[pe(Dr),pe(pr)];if(cr!=null&&cr!==!1){const Ar=cr===!0?mt(n.BYTES):cr;Rr.push(ah("extraEntropy",Ar))}const Pr=LE(...Rr),on=pr;function xn(Ar){const Xr=De(Ar);if(!A(Xr))return;const Tn=u(Xr),Bn=l.BASE.multiply(Xr).toAffine(),ni=a(Bn.x);if(ni===uh)return;const en=a(Tn*a(on+ni*Dr));if(en===uh)return;let si=(Bn.x===ni?0:2)|Number(Bn.y&Io),ei=en;return Bt&&P(en)&&(ei=D(en),si^=1),new V(ni,ei,si)}return{seed:Pr,k2sig:xn}}const Ce={lowS:e.lowS,prehash:!1},je={lowS:e.lowS,prehash:!1};function $e(nt,Ne,Me=Ce){const{seed:ct,k2sig:mt}=Se(nt,Ne,Me),Bt=e;return zJ(Bt.hash.outputLen,Bt.nByteLength,Bt.hmac)(ct,mt)}l.BASE._setWindowSize(8);function Qe(nt,Ne,Me,ct=je){const mt=nt;Ne=ah("msgHash",Ne),Me=ah("publicKey",Me);const{lowS:Bt,prehash:er,format:cr}=ct;if(QJ(ct),"strict"in ct)throw new Error("options.strict was renamed to lowS");if(cr!==void 0&&cr!=="compact"&&cr!=="der")throw new Error("format must be compact or der");const pr=typeof mt=="string"||o1(mt),Dr=!pr&&!cr&&typeof mt=="object"&&mt!==null&&typeof mt.r=="bigint"&&typeof mt.s=="bigint";if(!pr&&!Dr)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Rr,Pr;try{if(Dr&&(Rr=new V(mt.r,mt.s)),pr){try{cr!=="compact"&&(Rr=V.fromDER(mt))}catch(si){if(!(si instanceof jp.Err))throw si}!Rr&&cr!=="der"&&(Rr=V.fromCompact(mt))}Pr=l.fromHex(Me)}catch{return!1}if(!Rr||Bt&&Rr.hasHighS())return!1;er&&(Ne=e.hash(Ne));const{r:on,s:xn}=Rr,Ar=Ue(Ne),Xr=u(xn),Tn=a(Ar*Xr),Bn=a(on*Xr),ni=l.BASE.multiplyAndAddUnsafe(Pr,Tn,Bn)?.toAffine();return ni?a(ni.x)===on:!1}return{CURVE:e,getPublicKey:re,getSharedSecret:Re,sign:$e,verify:Qe,ProjectivePoint:l,Signature:V,utils:J}}function AEe(r,e){const n=r.ORDER;let i=uh;for(let D=n-Io;D%$y===uh;D/=$y)i+=Io;const s=i,o=$y<<s-Io-Io,a=o*$y,u=(n-Io)/a,l=(u-Io)/$y,g=a-Io,y=o,A=r.pow(e,u),I=r.pow(e,(u+Io)/$y);let P=(D,U)=>{let V=A,J=r.pow(U,g),re=r.sqr(J);re=r.mul(re,U);let ce=r.mul(D,re);ce=r.pow(ce,l),ce=r.mul(ce,J),J=r.mul(ce,U),re=r.mul(ce,D);let Re=r.mul(re,J);ce=r.pow(Re,y);let De=r.eql(ce,r.ONE);J=r.mul(re,I),ce=r.mul(Re,V),re=r.cmov(J,re,De),Re=r.cmov(ce,Re,De);for(let Ue=s;Ue>Io;Ue--){let Ve=Ue-$y;Ve=$y<<Ve-Io;let pe=r.pow(Re,Ve);const Se=r.eql(pe,r.ONE);J=r.mul(re,V),V=r.mul(V,V),pe=r.mul(Re,V),re=r.cmov(J,re,Se),Re=r.cmov(pe,Re,Se)}return{isValid:De,value:re}};if(r.ORDER%eQ===FR){const D=(r.ORDER-FR)/eQ,U=r.sqrt(r.neg(e));P=(V,J)=>{let re=r.sqr(J);const ce=r.mul(V,J);re=r.mul(re,ce);let Re=r.pow(re,D);Re=r.mul(Re,ce);const De=r.mul(Re,U),Ue=r.mul(r.sqr(Re),J),Ve=r.eql(Ue,V);let pe=r.cmov(De,Re,Ve);return{isValid:Ve,value:pe}}}return P}function iJe(r,e){if(validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=AEe(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return i=>{let s,o,a,u,l,g,y,A;s=r.sqr(i),s=r.mul(s,e.Z),o=r.sqr(s),o=r.add(o,s),a=r.add(o,r.ONE),a=r.mul(a,e.B),u=r.cmov(e.Z,r.neg(o),!r.eql(o,r.ZERO)),u=r.mul(u,e.A),o=r.sqr(a),g=r.sqr(u),l=r.mul(g,e.A),o=r.add(o,l),o=r.mul(o,a),g=r.mul(g,u),l=r.mul(g,e.B),o=r.add(o,l),y=r.mul(s,a);const{isValid:I,value:P}=n(o,g);A=r.mul(s,i),A=r.mul(A,P),y=r.cmov(y,a,I),A=r.cmov(A,P,I);const D=r.isOdd(i)===r.isOdd(A);return A=r.cmov(r.neg(A),A,D),y=r.div(y,u),{x:y,y:A}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function _Ee(r){return{hash:r,hmac:(e,...n)=>ep(r,e,Ng(...n)),randomBytes:Cv}}function EEe(r,e){const n=i=>wEe({...r,..._Ee(i)});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const UE=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),WR=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),FE=BigInt(1),HR=BigInt(2),tQ=(r,e)=>(r+e/HR)/e;function rQ(r){const e=UE,n=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),u=BigInt(44),l=BigInt(88),g=r*r*r%e,y=g*g*r%e,A=sd(y,n,e)*y%e,I=sd(A,n,e)*y%e,P=sd(I,HR,e)*g%e,D=sd(P,s,e)*P%e,U=sd(D,o,e)*D%e,V=sd(U,u,e)*U%e,J=sd(V,l,e)*V%e,re=sd(J,u,e)*U%e,ce=sd(re,n,e)*y%e,Re=sd(ce,a,e)*D%e,De=sd(Re,i,e)*g%e,Ue=sd(De,HR,e);if(!oN.eql(oN.sqr(Ue),r))throw new Error("Cannot find square root");return Ue}const oN=jJ(UE,void 0,void 0,{sqrt:rQ}),ch=EEe({a:BigInt(0),b:BigInt(7),Fp:oN,n:WR,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=WR,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-FE*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),u=tQ(o*r,e),l=tQ(-i*r,e);let g=ju(r-u*n-l*s,e),y=ju(-u*i-l*o,e);const A=g>a,I=y>a;if(A&&(g=e-g),I&&(y=e-y),g>a||y>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:A,k1:g,k2neg:I,k2:y}}}},Ov),nQ=BigInt(0),iQ=null;function aN(r,...e){let n=iQ[r];if(n===void 0){const i=sha256(Uint8Array.from(r,s=>s.charCodeAt(0)));n=concatBytes(i,i),iQ[r]=n}return sha256(concatBytes(n,...e))}const sQ=r=>r.toRawBytes(!0).slice(1),uN=r=>numberToBytesBE(r,32),cN=r=>mod(r,UE),WE=r=>mod(r,WR),lN=ch.ProjectivePoint,TEe=(r,e,n)=>lN.BASE.multiplyAndAddUnsafe(r,e,n);function fN(r){let e=ch.utils.normPrivateKeyToScalar(r),n=lN.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:WE(-e),bytes:sQ(n)}}function SEe(r){aInRange("x",r,FE,UE);const e=cN(r*r),n=cN(e*r+BigInt(7));let i=rQ(n);i%HR!==nQ&&(i=cN(-i));const s=new lN(r,i,FE);return s.assertValidity(),s}const f2=null;function oQ(...r){return WE(f2(aN("BIP0340/challenge",...r)))}function sJe(r){return fN(r).bytes}function oJe(r,e,n=randomBytes(32)){const i=ensureBytes("message",r),{bytes:s,scalar:o}=fN(e),a=ensureBytes("auxRand",n,32),u=uN(o^f2(aN("BIP0340/aux",a))),l=aN("BIP0340/nonce",u,s,i),g=WE(f2(l));if(g===nQ)throw new Error("sign failed: k is zero");const{bytes:y,scalar:A}=fN(g),I=oQ(y,s,i),P=new Uint8Array(64);if(P.set(y,0),P.set(uN(WE(A+I*o)),32),!IEe(P,i,s))throw new Error("sign: Invalid signature produced");return P}function IEe(r,e,n){const i=ensureBytes("signature",r,64),s=ensureBytes("message",e),o=ensureBytes("publicKey",n,32);try{const a=SEe(f2(o)),u=f2(i.subarray(0,32));if(!inRange(u,FE,UE))return!1;const l=f2(i.subarray(32,64));if(!inRange(l,FE,WR))return!1;const g=oQ(uN(u),sQ(a),s),y=TEe(a,l,WE(-g));return!(!y||!y.hasEvenY()||y.toAffine().x!==u)}catch{return!1}}const aJe=null,uJe=null,cJe=null,lJe=null,fJe=null,dJe=null;/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const zR=ch.ProjectivePoint,dN=Fx(Ov);function aQ(r){Xa(r);const e=r.length===0?"0":VS(r);return BigInt("0x"+e)}function kEe(r){if(typeof r!="bigint")throw new Error("bigint expected");return OA(r.toString(16).padStart(64,"0"))}const REe=Lf("Bitcoin seed"),hN={private:76066276,public:76067358},pN=2147483648,CEe=r=>Y_e(Ov(r)),xEe=r=>Dh(r).getUint32(0,!1),$R=r=>{if(!Number.isSafeInteger(r)||r<0||r>2**32-1)throw new Error("invalid number, should be from 0 to 2**32-1, got "+r);const e=new Uint8Array(4);return Dh(e).setUint32(0,r,!1),e};class c1{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return xEe(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){const e=this.privateKey;if(!e)throw new Error("No private key");return dN.encode(this.serialize(this.versions.private,Ng(new Uint8Array([0]),e)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return dN.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(e,n=hN){if(Xa(e),8*e.length<128||8*e.length>512)throw new Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+e.length);const i=ep(UA,REe,e);return new c1({versions:n,chainCode:i.slice(32),privateKey:i.slice(0,32)})}static fromExtendedKey(e,n=hN){const i=dN.decode(e),s=Dh(i),o=s.getUint32(0,!1),a={versions:n,depth:i[4],parentFingerprint:s.getUint32(5,!1),index:s.getUint32(9,!1),chainCode:i.slice(13,45)},u=i.slice(45),l=u[0]===0;if(o!==n[l?"private":"public"])throw new Error("Version mismatch");return l?new c1({...a,privateKey:u.slice(1)}):new c1({...a,publicKey:u})}static fromJSON(e){return c1.fromExtendedKey(e.xpriv)}constructor(e){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!e||typeof e!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=e.versions||hN,this.depth=e.depth||0,this.chainCode=e.chainCode||null,this.index=e.index||0,this.parentFingerprint=e.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(e.publicKey&&e.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(e.privateKey){if(!ch.utils.isValidPrivateKey(e.privateKey))throw new Error("Invalid private key");this.privKey=typeof e.privateKey=="bigint"?e.privateKey:aQ(e.privateKey),this.privKeyBytes=kEe(this.privKey),this.pubKey=ch.getPublicKey(e.privateKey,!0)}else if(e.publicKey)this.pubKey=zR.fromHex(e.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=CEe(this.pubKey)}derive(e){if(!/^[mM]'?/.test(e))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(e))return this;const n=e.replace(/^[mM]'?\//,"").split("/");let i=this;for(const s of n){const o=/^(\d+)('?)$/.exec(s),a=o&&o[1];if(!o||o.length!==3||typeof a!="string")throw new Error("invalid child index: "+s);let u=+a;if(!Number.isSafeInteger(u)||u>=pN)throw new Error("Invalid index");o[2]==="'"&&(u+=pN),i=i.deriveChild(u)}return i}deriveChild(e){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let n=$R(e);if(e>=pN){const u=this.privateKey;if(!u)throw new Error("Could not derive hardened child key");n=Ng(new Uint8Array([0]),u,n)}else n=Ng(this.pubKey,n);const i=ep(UA,this.chainCode,n),s=aQ(i.slice(0,32)),o=i.slice(32);if(!ch.utils.isValidPrivateKey(s))throw new Error("Tweak bigger than curve order");const a={versions:this.versions,chainCode:o,depth:this.depth+1,parentFingerprint:this.fingerprint,index:e};try{if(this.privateKey){const u=ju(this.privKey+s,ch.CURVE.n);if(!ch.utils.isValidPrivateKey(u))throw new Error("The tweak was out of range or the resulted private key is invalid");a.privateKey=u}else{const u=zR.fromHex(this.pubKey).add(zR.fromPrivateKey(s));if(u.equals(zR.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");a.publicKey=u.toRawBytes(!0)}return new c1(a)}catch{return this.deriveChild(e+1)}}sign(e){if(!this.privateKey)throw new Error("No privateKey set!");return Xa(e,32),ch.sign(e,this.privKey).toCompactRawBytes()}verify(e,n){if(Xa(e,32),Xa(n,64),!this.publicKey)throw new Error("No publicKey set!");let i;try{i=ch.Signature.fromCompact(n)}catch{return!1}return ch.verify(i,e,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(e,n){if(!this.chainCode)throw new Error("No chainCode set");return Xa(n,33),Ng($R(e),new Uint8Array([this.depth]),$R(this.parentFingerprint),$R(this.index),this.chainCode,n)}}var BEe="m/44'/60'/0'/0",gN=new WeakMap,OEe=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,gN,{writable:!0,value:void 0});var i=c1.fromMasterSeed(n);he(this,gN,i.derive(BEe))}var e=r.prototype;return e.deriveChildWithIdx=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(a=X(s,gN).deriveChild(i),u=a.privateKey,u){g.next=6;break}throw new Error("Derive child with idx failed: key is null");case 6:return g.abrupt("return",u);case 7:case"end":return g.stop()}},o)}))()},r}();const d2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function VR(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function yN(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function lh(r,...e){if(!VR(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error("Uint8Array expected of length "+e+", got length="+r.length)}function PEe(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");yN(r.outputLen),yN(r.blockLen)}function jR(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function NEe(r,e){lh(r);const n=e.outputLen;if(r.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function hJe(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function pJe(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function od(...r){for(let e=0;e<r.length;e++)r[e].fill(0)}function HE(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function h0(r,e){return r<<32-e|r>>>e}function Vy(r,e){return r<<e|r>>>32-e>>>0}const gJe=null;function MEe(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}const yJe=null,mJe=null;function bJe(r){for(let e=0;e<r.length;e++)r[e]=MEe(r[e]);return r}const vJe=null,uQ=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",LEe=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function h2(r){if(lh(r),uQ)return r.toHex();let e="";for(let n=0;n<r.length;n++)e+=LEe[r[n]];return e}const Kp={_0:48,_9:57,A:65,F:70,a:97,f:102};function cQ(r){if(r>=Kp._0&&r<=Kp._9)return r-Kp._0;if(r>=Kp.A&&r<=Kp.F)return r-(Kp.A-10);if(r>=Kp.a&&r<=Kp.f)return r-(Kp.a-10)}function mN(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);if(uQ)return Uint8Array.fromHex(r);const e=r.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const i=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const a=cQ(r.charCodeAt(o)),u=cQ(r.charCodeAt(o+1));if(a===void 0||u===void 0){const l=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}i[s]=a*16+u}return i}const DEe=async()=>{};async function wJe(r,e,n){let i=Date.now();for(let s=0;s<r;s++){n(s);const o=Date.now()-i;o>=0&&o<e||(await DEe(),i+=o)}}function bN(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}function AJe(r){return new TextDecoder().decode(r)}function zE(r){return typeof r=="string"&&(r=bN(r)),lh(r),r}function _Je(r){return typeof r=="string"&&(r=bN(r)),lh(r),r}function KR(...r){let e=0;for(let i=0;i<r.length;i++){const s=r[i];lh(s),e+=s.length}const n=new Uint8Array(e);for(let i=0,s=0;i<r.length;i++){const o=r[i];n.set(o,s),s+=o.length}return n}function EJe(r,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(r,e)}class lQ{}function vN(r){const e=i=>r().update(zE(i)).digest(),n=r();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>r(),e}function TJe(r){const e=(i,s)=>r(s).update(zE(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}function SJe(r){const e=(i,s)=>r(s).update(zE(i)).digest(),n=r({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=i=>r(i),e}const IJe=null,kJe=null,RJe=null;function UEe(r=32){if(d2&&typeof d2.getRandomValues=="function")return d2.getRandomValues(new Uint8Array(r));if(d2&&typeof d2.randomBytes=="function")return Uint8Array.from(d2.randomBytes(r));throw new Error("crypto.getRandomValues must be defined")}function FEe(r,e,n,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,n,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(n>>s&o),u=Number(n&o),l=i?4:0,g=i?0:4;r.setUint32(e+l,a,i),r.setUint32(e+g,u,i)}function GR(r,e,n){return r&e^~r&n}function fQ(r,e,n){return r&e^r&n^e&n}class $E extends lQ{constructor(e,n,i,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=i,this.isLE=s,this.buffer=new Uint8Array(e),this.view=HE(this.buffer)}update(e){jR(this),e=zE(e),lh(e);const{view:n,buffer:i,blockLen:s}=this,o=e.length;for(let a=0;a<o;){const u=Math.min(s-this.pos,o-a);if(u===s){const l=HE(e);for(;s<=o-a;a+=s)this.process(l,a);continue}i.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){jR(this),NEe(e,this),this.finished=!0;const{buffer:n,view:i,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,od(this.buffer.subarray(a)),this.padOffset>s-a&&(this.process(i,0),a=0);for(let A=a;A<s;A++)n[A]=0;FEe(i,s-8,BigInt(this.length*8),o),this.process(i,0);const u=HE(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const g=l/4,y=this.get();if(g>y.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<g;A++)u.setUint32(4*A,y[A],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:i,length:s,finished:o,destroyed:a,pos:u}=this;return e.destroyed=a,e.finished=o,e.length=s,e.pos=u,s%n&&e.buffer.set(i),e}clone(){return this._cloneInto()}}const jy=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ky=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),bc=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),vc=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),qR=BigInt(2**32-1),wN=BigInt(32);function WEe(r,e=!1){return e?{h:Number(r&qR),l:Number(r>>wN&qR)}:{h:Number(r>>wN&qR)|0,l:Number(r&qR)|0}}function HEe(r,e=!1){const n=r.length;let i=new Uint32Array(n),s=new Uint32Array(n);for(let o=0;o<n;o++){const{h:a,l:u}=WEe(r[o],e);[i[o],s[o]]=[a,u]}return[i,s]}const CJe=(r,e)=>BigInt(r>>>0)<<wN|BigInt(e>>>0),dQ=(r,e,n)=>r>>>n,hQ=(r,e,n)=>r<<32-n|e>>>n,p2=(r,e,n)=>r>>>n|e<<32-n,g2=(r,e,n)=>r<<32-n|e>>>n,ZR=(r,e,n)=>r<<64-n|e>>>n-32,YR=(r,e,n)=>r>>>n-32|e<<64-n,xJe=(r,e)=>e,BJe=(r,e)=>r,OJe=(r,e,n)=>r<<n|e>>>32-n,PJe=(r,e,n)=>e<<n|r>>>32-n,NJe=(r,e,n)=>e<<n-32|r>>>64-n,MJe=(r,e,n)=>r<<n-32|e>>>64-n;function Gp(r,e,n,i){const s=(e>>>0)+(i>>>0);return{h:r+n+(s/2**32|0)|0,l:s|0}}const zEe=(r,e,n)=>(r>>>0)+(e>>>0)+(n>>>0),$Ee=(r,e,n,i)=>e+n+i+(r/2**32|0)|0,VEe=(r,e,n,i)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0),jEe=(r,e,n,i,s)=>e+n+i+s+(r/2**32|0)|0,KEe=(r,e,n,i,s)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0)+(s>>>0),GEe=(r,e,n,i,s,o)=>e+n+i+s+o+(r/2**32|0)|0,LJe=null,DJe=null,qEe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Gy=new Uint32Array(64);class pQ extends $E{constructor(e=32){super(64,e,8,!1),this.A=jy[0]|0,this.B=jy[1]|0,this.C=jy[2]|0,this.D=jy[3]|0,this.E=jy[4]|0,this.F=jy[5]|0,this.G=jy[6]|0,this.H=jy[7]|0}get(){const{A:e,B:n,C:i,D:s,E:o,F:a,G:u,H:l}=this;return[e,n,i,s,o,a,u,l]}set(e,n,i,s,o,a,u,l){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,n){for(let A=0;A<16;A++,n+=4)Gy[A]=e.getUint32(n,!1);for(let A=16;A<64;A++){const I=Gy[A-15],P=Gy[A-2],D=h0(I,7)^h0(I,18)^I>>>3,U=h0(P,17)^h0(P,19)^P>>>10;Gy[A]=U+Gy[A-7]+D+Gy[A-16]|0}let{A:i,B:s,C:o,D:a,E:u,F:l,G:g,H:y}=this;for(let A=0;A<64;A++){const I=h0(u,6)^h0(u,11)^h0(u,25),P=y+I+GR(u,l,g)+qEe[A]+Gy[A]|0,U=(h0(i,2)^h0(i,13)^h0(i,22))+fQ(i,s,o)|0;y=g,g=l,l=u,u=a+P|0,a=o,o=s,s=i,i=P+U|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,g=g+this.G|0,y=y+this.H|0,this.set(i,s,o,a,u,l,g,y)}roundClean(){od(Gy)}destroy(){this.set(0,0,0,0,0,0,0,0),od(this.buffer)}}class UJe extends pQ{constructor(){super(28),this.A=Ky[0]|0,this.B=Ky[1]|0,this.C=Ky[2]|0,this.D=Ky[3]|0,this.E=Ky[4]|0,this.F=Ky[5]|0,this.G=Ky[6]|0,this.H=Ky[7]|0}}const gQ=HEe(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),ZEe=gQ[0],YEe=gQ[1],qy=new Uint32Array(80),Zy=new Uint32Array(80);class XR extends $E{constructor(e=64){super(128,e,16,!1),this.Ah=vc[0]|0,this.Al=vc[1]|0,this.Bh=vc[2]|0,this.Bl=vc[3]|0,this.Ch=vc[4]|0,this.Cl=vc[5]|0,this.Dh=vc[6]|0,this.Dl=vc[7]|0,this.Eh=vc[8]|0,this.El=vc[9]|0,this.Fh=vc[10]|0,this.Fl=vc[11]|0,this.Gh=vc[12]|0,this.Gl=vc[13]|0,this.Hh=vc[14]|0,this.Hl=vc[15]|0}get(){const{Ah:e,Al:n,Bh:i,Bl:s,Ch:o,Cl:a,Dh:u,Dl:l,Eh:g,El:y,Fh:A,Fl:I,Gh:P,Gl:D,Hh:U,Hl:V}=this;return[e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V]}set(e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V){this.Ah=e|0,this.Al=n|0,this.Bh=i|0,this.Bl=s|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=g|0,this.El=y|0,this.Fh=A|0,this.Fl=I|0,this.Gh=P|0,this.Gl=D|0,this.Hh=U|0,this.Hl=V|0}process(e,n){for(let ce=0;ce<16;ce++,n+=4)qy[ce]=e.getUint32(n),Zy[ce]=e.getUint32(n+=4);for(let ce=16;ce<80;ce++){const Re=qy[ce-15]|0,De=Zy[ce-15]|0,Ue=p2(Re,De,1)^p2(Re,De,8)^dQ(Re,De,7),Ve=g2(Re,De,1)^g2(Re,De,8)^hQ(Re,De,7),pe=qy[ce-2]|0,Se=Zy[ce-2]|0,Ce=p2(pe,Se,19)^ZR(pe,Se,61)^dQ(pe,Se,6),je=g2(pe,Se,19)^YR(pe,Se,61)^hQ(pe,Se,6),$e=VEe(Ve,je,Zy[ce-7],Zy[ce-16]),Qe=jEe($e,Ue,Ce,qy[ce-7],qy[ce-16]);qy[ce]=Qe|0,Zy[ce]=$e|0}let{Ah:i,Al:s,Bh:o,Bl:a,Ch:u,Cl:l,Dh:g,Dl:y,Eh:A,El:I,Fh:P,Fl:D,Gh:U,Gl:V,Hh:J,Hl:re}=this;for(let ce=0;ce<80;ce++){const Re=p2(A,I,14)^p2(A,I,18)^ZR(A,I,41),De=g2(A,I,14)^g2(A,I,18)^YR(A,I,41),Ue=A&P^~A&U,Ve=I&D^~I&V,pe=KEe(re,De,Ve,YEe[ce],Zy[ce]),Se=GEe(pe,J,Re,Ue,ZEe[ce],qy[ce]),Ce=pe|0,je=p2(i,s,28)^ZR(i,s,34)^ZR(i,s,39),$e=g2(i,s,28)^YR(i,s,34)^YR(i,s,39),Qe=i&o^i&u^o&u,nt=s&a^s&l^a&l;J=U|0,re=V|0,U=P|0,V=D|0,P=A|0,D=I|0,{h:A,l:I}=Gp(g|0,y|0,Se|0,Ce|0),g=u|0,y=l|0,u=o|0,l=a|0,o=i|0,a=s|0;const Ne=zEe(Ce,$e,nt);i=$Ee(Ne,Se,je,Qe),s=Ne|0}({h:i,l:s}=Gp(this.Ah|0,this.Al|0,i|0,s|0)),{h:o,l:a}=Gp(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=Gp(this.Ch|0,this.Cl|0,u|0,l|0),{h:g,l:y}=Gp(this.Dh|0,this.Dl|0,g|0,y|0),{h:A,l:I}=Gp(this.Eh|0,this.El|0,A|0,I|0),{h:P,l:D}=Gp(this.Fh|0,this.Fl|0,P|0,D|0),{h:U,l:V}=Gp(this.Gh|0,this.Gl|0,U|0,V|0),{h:J,l:re}=Gp(this.Hh|0,this.Hl|0,J|0,re|0),this.set(i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re)}roundClean(){od(qy,Zy)}destroy(){od(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class FJe extends XR{constructor(){super(48),this.Ah=bc[0]|0,this.Al=bc[1]|0,this.Bh=bc[2]|0,this.Bl=bc[3]|0,this.Ch=bc[4]|0,this.Cl=bc[5]|0,this.Dh=bc[6]|0,this.Dl=bc[7]|0,this.Eh=bc[8]|0,this.El=bc[9]|0,this.Fh=bc[10]|0,this.Fl=bc[11]|0,this.Gh=bc[12]|0,this.Gl=bc[13]|0,this.Hh=bc[14]|0,this.Hl=bc[15]|0}}const wc=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Ac=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class WJe extends XR{constructor(){super(28),this.Ah=wc[0]|0,this.Al=wc[1]|0,this.Bh=wc[2]|0,this.Bl=wc[3]|0,this.Ch=wc[4]|0,this.Cl=wc[5]|0,this.Dh=wc[6]|0,this.Dl=wc[7]|0,this.Eh=wc[8]|0,this.El=wc[9]|0,this.Fh=wc[10]|0,this.Fl=wc[11]|0,this.Gh=wc[12]|0,this.Gl=wc[13]|0,this.Hh=wc[14]|0,this.Hl=wc[15]|0}}class HJe extends XR{constructor(){super(32),this.Ah=Ac[0]|0,this.Al=Ac[1]|0,this.Bh=Ac[2]|0,this.Bl=Ac[3]|0,this.Ch=Ac[4]|0,this.Cl=Ac[5]|0,this.Dh=Ac[6]|0,this.Dl=Ac[7]|0,this.Eh=Ac[8]|0,this.El=Ac[9]|0,this.Fh=Ac[10]|0,this.Fl=Ac[11]|0,this.Gh=Ac[12]|0,this.Gl=Ac[13]|0,this.Hh=Ac[14]|0,this.Hl=Ac[15]|0}}const XEe=vN(()=>new pQ),zJe=null,yQ=vN(()=>new XR),$Je=null,VJe=null,jJe=null;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const JR=BigInt(0),VE=BigInt(1);function KJe(r,e){if(typeof e!="boolean")throw new Error(r+" boolean expected, got "+e)}function AN(r,e=""){if(typeof r!="boolean"){const n=e&&`"${e}"`;throw new Error(n+"expected boolean, got type="+typeof r)}return r}function QR(r,e,n=""){const i=VR(r),s=r?.length,o=e!==void 0;if(!i||o&&s!==e){const a=n&&`"${n}" `,u=o?` of length ${e}`:"",l=i?`length=${s}`:`type=${typeof r}`;throw new Error(a+"expected Uint8Array"+u+", got "+l)}return r}function JEe(r){const e=r.toString(16);return e.length&1?"0"+e:e}function mQ(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return r===""?JR:BigInt("0x"+r)}function QEe(r){return mQ(h2(r))}function jE(r){return lh(r),mQ(h2(Uint8Array.from(r).reverse()))}function bQ(r,e){return mN(r.toString(16).padStart(e*2,"0"))}function eTe(r,e){return bQ(r,e).reverse()}function GJe(r){return hexToBytes_(JEe(r))}function p0(r,e,n){let i;if(typeof e=="string")try{i=mN(e)}catch(o){throw new Error(r+" must be hex string or Uint8Array, cause: "+o)}else if(VR(e))i=Uint8Array.from(e);else throw new Error(r+" must be hex string or Uint8Array");const s=i.length;if(typeof n=="number"&&s!==n)throw new Error(r+" of length "+n+" expected, got "+s);return i}function tTe(r,e){if(r.length!==e.length)return!1;let n=0;for(let i=0;i<r.length;i++)n|=r[i]^e[i];return n===0}function vQ(r){return Uint8Array.from(r)}function qJe(r){return Uint8Array.from(r,(e,n)=>{const i=e.charCodeAt(0);if(e.length!==1||i>127)throw new Error(`string contains non-ASCII character "${r[n]}" with code ${i} at position ${n}`);return i})}const _N=r=>typeof r=="bigint"&&JR<=r;function rTe(r,e,n){return _N(r)&&_N(e)&&_N(n)&&e<=r&&r<n}function wQ(r,e,n,i){if(!rTe(e,n,i))throw new Error("expected valid "+r+": "+n+" <= n < "+i+", got "+e)}function nTe(r){let e;for(e=0;r>JR;r>>=VE,e+=1);return e}function ZJe(r,e){return r>>BigInt(e)&VE}function YJe(r,e,n){return r|(n?VE:JR)<<BigInt(e)}const EN=r=>(VE<<BigInt(r))-VE;function XJe(r,e,n){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const i=P=>new Uint8Array(P),s=P=>Uint8Array.of(P);let o=i(r),a=i(r),u=0;const l=()=>{o.fill(1),a.fill(0),u=0},g=(...P)=>n(a,o,...P),y=(P=i(0))=>{a=g(s(0),P),o=g(),P.length!==0&&(a=g(s(1),P),o=g())},A=()=>{if(u++>=1e3)throw new Error("drbg: tried 1000 values");let P=0;const D=[];for(;P<e;){o=g();const U=o.slice();D.push(U),P+=o.length}return concatBytes_(...D)};return(P,D)=>{l(),y(P);let U;for(;!(U=D(A()));)y();return l(),U}}const iTe=null;function JJe(r,e,n={}){const i=(s,o,a)=>{const u=iTe[o];if(typeof u!="function")throw new Error("invalid validator function");const l=r[s];if(!(a&&l===void 0)&&!u(l,r))throw new Error("param "+String(s)+" is invalid. Expected "+o+", got "+l)};for(const[s,o]of Object.entries(e))i(s,o,!1);for(const[s,o]of Object.entries(n))i(s,o,!0);return r}function QJe(r){return typeof r=="function"&&Number.isSafeInteger(r.outputLen)}function TN(r,e,n={}){if(!r||typeof r!="object")throw new Error("expected valid options object");function i(s,o,a){const u=r[s];if(a&&u===void 0)return;const l=typeof u;if(l!==o||u===null)throw new Error(`param "${s}" is invalid: expected ${o}, got ${l}`)}Object.entries(e).forEach(([s,o])=>i(s,o,!1)),Object.entries(n).forEach(([s,o])=>i(s,o,!0))}const AQ=()=>{throw new Error("not implemented")};function _Q(r){const e=new WeakMap;return(n,...i)=>{const s=e.get(n);if(s!==void 0)return s;const o=r(n,...i);return e.set(n,o),o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xc=BigInt(0),Ka=BigInt(1),l1=BigInt(2),EQ=BigInt(3),TQ=BigInt(4),SQ=BigInt(5),sTe=BigInt(7),IQ=BigInt(8),oTe=BigInt(9),kQ=BigInt(16);function La(r,e){const n=r%e;return n>=Xc?n:e+n}function eQe(r,e,n){return xQ(f1(n),r,e)}function g0(r,e,n){let i=r;for(;e-- >Xc;)i*=i,i%=n;return i}function SN(r,e){if(r===Xc)throw new Error("invert: expected non-zero number");if(e<=Xc)throw new Error("invert: expected positive modulus, got "+e);let n=La(r,e),i=e,s=Xc,o=Ka,a=Ka,u=Xc;for(;n!==Xc;){const g=i/n,y=i%n,A=s-a*g,I=o-u*g;i=n,n=y,s=a,o=u,a=A,u=I}if(i!==Ka)throw new Error("invert: does not exist");return La(s,e)}function IN(r,e,n){if(!r.eql(r.sqr(e),n))throw new Error("Cannot find square root")}function RQ(r,e){const n=(r.ORDER+Ka)/TQ,i=r.pow(e,n);return IN(r,i,e),i}function aTe(r,e){const n=(r.ORDER-SQ)/IQ,i=r.mul(e,l1),s=r.pow(i,n),o=r.mul(e,s),a=r.mul(r.mul(o,l1),s),u=r.mul(o,r.sub(a,r.ONE));return IN(r,u,e),u}function uTe(r){const e=f1(r),n=CQ(r),i=n(e,e.neg(e.ONE)),s=n(e,i),o=n(e,e.neg(i)),a=(r+sTe)/kQ;return(u,l)=>{let g=u.pow(l,a),y=u.mul(g,i);const A=u.mul(g,s),I=u.mul(g,o),P=u.eql(u.sqr(y),l),D=u.eql(u.sqr(A),l);g=u.cmov(g,y,P),y=u.cmov(I,A,D);const U=u.eql(u.sqr(y),l),V=u.cmov(g,y,U);return IN(u,V,l),V}}function CQ(r){if(r<EQ)throw new Error("sqrt is not defined for small field");let e=r-Ka,n=0;for(;e%l1===Xc;)e/=l1,n++;let i=l1;const s=f1(r);for(;kN(s,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return RQ;let o=s.pow(i,e);const a=(e+Ka)/l1;return function(l,g){if(l.is0(g))return g;if(kN(l,g)!==1)throw new Error("Cannot find square root");let y=n,A=l.mul(l.ONE,o),I=l.pow(g,e),P=l.pow(g,a);for(;!l.eql(I,l.ONE);){if(l.is0(I))return l.ZERO;let D=1,U=l.sqr(I);for(;!l.eql(U,l.ONE);)if(D++,U=l.sqr(U),D===y)throw new Error("Cannot find square root");const V=Ka<<BigInt(y-D-1),J=l.pow(A,V);y=D,A=l.sqr(J),I=l.mul(I,A),P=l.mul(P,J)}return P}}function cTe(r){return r%TQ===EQ?RQ:r%IQ===SQ?aTe:r%kQ===oTe?uTe(r):CQ(r)}const Yy=(r,e)=>(La(r,e)&Ka)===Ka,lTe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function fTe(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=lTe.reduce((i,s)=>(i[s]="function",i),e);return TN(r,n),r}function xQ(r,e,n){if(n<Xc)throw new Error("invalid exponent, negatives unsupported");if(n===Xc)return r.ONE;if(n===Ka)return e;let i=r.ONE,s=e;for(;n>Xc;)n&Ka&&(i=r.mul(i,s)),s=r.sqr(s),n>>=Ka;return i}function BQ(r,e,n=!1){const i=new Array(e.length).fill(n?r.ZERO:void 0),s=e.reduce((a,u,l)=>r.is0(u)?a:(i[l]=a,r.mul(a,u)),r.ONE),o=r.inv(s);return e.reduceRight((a,u,l)=>r.is0(u)?a:(i[l]=r.mul(a,i[l]),r.mul(a,u)),o),i}function tQe(r,e,n){return r.mul(e,typeof n=="bigint"?SN(n,r.ORDER):r.inv(n))}function kN(r,e){const n=(r.ORDER-Ka)/l1,i=r.pow(e,n),s=r.eql(i,r.ONE),o=r.eql(i,r.ZERO),a=r.eql(i,r.neg(r.ONE));if(!s&&!o&&!a)throw new Error("invalid Legendre symbol result");return s?1:o?0:-1}function rQe(r,e){return kN(r,e)===1}function OQ(r,e){e!==void 0&&yN(e);const n=e!==void 0?e:r.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function f1(r,e,n=!1,i={}){if(r<=Xc)throw new Error("invalid field: expected ORDER > 0, got "+r);let s,o,a=!1,u;if(typeof e=="object"&&e!=null){if(i.sqrt||n)throw new Error("cannot specify opts in two arguments");const I=e;I.BITS&&(s=I.BITS),I.sqrt&&(o=I.sqrt),typeof I.isLE=="boolean"&&(n=I.isLE),typeof I.modFromBytes=="boolean"&&(a=I.modFromBytes),u=I.allowedLengths}else typeof e=="number"&&(s=e),i.sqrt&&(o=i.sqrt);const{nBitLength:l,nByteLength:g}=OQ(r,s);if(g>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let y;const A=Object.freeze({ORDER:r,isLE:n,BITS:l,BYTES:g,MASK:EN(l),ZERO:Xc,ONE:Ka,allowedLengths:u,create:I=>La(I,r),isValid:I=>{if(typeof I!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof I);return Xc<=I&&I<r},is0:I=>I===Xc,isValidNot0:I=>!A.is0(I)&&A.isValid(I),isOdd:I=>(I&Ka)===Ka,neg:I=>La(-I,r),eql:(I,P)=>I===P,sqr:I=>La(I*I,r),add:(I,P)=>La(I+P,r),sub:(I,P)=>La(I-P,r),mul:(I,P)=>La(I*P,r),pow:(I,P)=>xQ(A,I,P),div:(I,P)=>La(I*SN(P,r),r),sqrN:I=>I*I,addN:(I,P)=>I+P,subN:(I,P)=>I-P,mulN:(I,P)=>I*P,inv:I=>SN(I,r),sqrt:o||(I=>(y||(y=cTe(r)),y(A,I))),toBytes:I=>n?eTe(I,g):bQ(I,g),fromBytes:(I,P=!0)=>{if(u){if(!u.includes(I.length)||I.length>g)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+I.length);const U=new Uint8Array(g);U.set(I,n?0:U.length-I.length),I=U}if(I.length!==g)throw new Error("Field.fromBytes: expected "+g+" bytes, got "+I.length);let D=n?jE(I):QEe(I);if(a&&(D=La(D,r)),!P&&!A.isValid(D))throw new Error("invalid field element: outside of range 0..ORDER");return D},invertBatch:I=>BQ(A,I),cmov:(I,P,D)=>D?P:I});return Object.freeze(A)}function nQe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?n:r.neg(n)}function iQe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");const n=r.sqrt(e);return r.isOdd(n)?r.neg(n):n}function sQe(r,e,n=!1){r=ensureBytes("privateHash",r);const i=r.length,s=OQ(e).nByteLength+8;if(s<24||i<s||i>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+i);const o=n?bytesToNumberLE(r):bytesToNumberBE(r);return La(o,e-Ka)+Ka}function PQ(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function dTe(r){const e=PQ(r);return e+Math.ceil(e/2)}function oQe(r,e,n=!1){const i=r.length,s=PQ(e),o=dTe(e);if(i<16||i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);const a=n?bytesToNumberLE(r):bytesToNumberBE(r),u=La(a,e-Ka)+Ka;return n?numberToBytesLE(u,s):numberToBytesBE(u,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const y2=BigInt(0),d1=BigInt(1);function NQ(r,e){const n=e.negate();return r?n:e}function eC(r,e){const n=BQ(r.Fp,e.map(i=>i.Z));return e.map((i,s)=>r.fromAffine(i.toAffine(n[s])))}function RN(r,e){if(!Number.isSafeInteger(r)||r<=0||r>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+r)}function CN(r,e){RN(r,e);const n=Math.ceil(e/r)+1,i=2**(r-1),s=2**r,o=EN(r),a=BigInt(r);return{windows:n,windowSize:i,mask:o,maxNumber:s,shiftBy:a}}function MQ(r,e,n){const{windowSize:i,mask:s,maxNumber:o,shiftBy:a}=n;let u=Number(r&s),l=r>>a;u>i&&(u-=o,l+=d1);const g=e*i,y=g+Math.abs(u)-1,A=u===0,I=u<0,P=e%2!==0;return{nextN:l,offset:y,isZero:A,isNeg:I,isNegF:P,offsetF:g}}function LQ(r,e){if(!Array.isArray(r))throw new Error("array expected");r.forEach((n,i)=>{if(!(n instanceof e))throw new Error("invalid point at index "+i)})}function DQ(r,e){if(!Array.isArray(r))throw new Error("array of scalars expected");r.forEach((n,i)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+i)})}const xN=new WeakMap,UQ=new WeakMap;function BN(r){return UQ.get(r)||1}function FQ(r){if(r!==y2)throw new Error("invalid wNAF")}class hTe{constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,i=this.ZERO){let s=e;for(;n>y2;)n&d1&&(i=i.add(s)),s=s.double(),n>>=d1;return i}precomputeWindow(e,n){const{windows:i,windowSize:s}=CN(n,this.bits),o=[];let a=e,u=a;for(let l=0;l<i;l++){u=a,o.push(u);for(let g=1;g<s;g++)u=u.add(a),o.push(u);a=u.double()}return o}wNAF(e,n,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let s=this.ZERO,o=this.BASE;const a=CN(e,this.bits);for(let u=0;u<a.windows;u++){const{nextN:l,offset:g,isZero:y,isNeg:A,isNegF:I,offsetF:P}=MQ(i,u,a);i=l,y?o=o.add(NQ(I,n[P])):s=s.add(NQ(A,n[g]))}return FQ(i),{p:s,f:o}}wNAFUnsafe(e,n,i,s=this.ZERO){const o=CN(e,this.bits);for(let a=0;a<o.windows&&i!==y2;a++){const{nextN:u,offset:l,isZero:g,isNeg:y}=MQ(i,a,o);if(i=u,!g){const A=n[l];s=s.add(y?A.negate():A)}}return FQ(i),s}getPrecomputes(e,n,i){let s=xN.get(n);return s||(s=this.precomputeWindow(n,e),e!==1&&(typeof i=="function"&&(s=i(s)),xN.set(n,s))),s}cached(e,n,i){const s=BN(e);return this.wNAF(s,this.getPrecomputes(s,e,i),n)}unsafe(e,n,i,s){const o=BN(e);return o===1?this._unsafeLadder(e,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,e,i),n,s)}createCache(e,n){RN(n,this.bits),UQ.set(e,n),xN.delete(e)}hasCache(e){return BN(e)!==1}}function aQe(r,e,n,i){let s=e,o=r.ZERO,a=r.ZERO;for(;n>y2||i>y2;)n&d1&&(o=o.add(s)),i&d1&&(a=a.add(s)),s=s.double(),n>>=d1,i>>=d1;return{p1:o,p2:a}}function WQ(r,e,n,i){LQ(n,r),DQ(i,e);const s=n.length,o=i.length;if(s!==o)throw new Error("arrays of points and scalars must have equal length");const a=r.ZERO,u=nTe(BigInt(s));let l=1;u>12?l=u-3:u>4?l=u-2:u>0&&(l=2);const g=EN(l),y=new Array(Number(g)+1).fill(a),A=Math.floor((e.BITS-1)/l)*l;let I=a;for(let P=A;P>=0;P-=l){y.fill(a);for(let U=0;U<o;U++){const V=i[U],J=Number(V>>BigInt(P)&g);y[J]=y[J].add(n[U])}let D=a;for(let U=y.length-1,V=a;U>0;U--)V=V.add(y[U]),D=D.add(V);if(I=I.add(D),P!==0)for(let U=0;U<l;U++)I=I.double()}return I}function uQe(r,e,n,i){RN(i,e.BITS),LQ(n,r);const s=r.ZERO,o=2**i-1,a=Math.ceil(e.BITS/i),u=bitMask(i),l=n.map(g=>{const y=[];for(let A=0,I=g;A<o;A++)y.push(I),I=I.add(g);return y});return g=>{if(DQ(g,e),g.length>n.length)throw new Error("array of scalars must be smaller than array of points");let y=s;for(let A=0;A<a;A++){if(y!==s)for(let P=0;P<i;P++)y=y.double();const I=BigInt(a*i-(A+1)*i);for(let P=0;P<g.length;P++){const D=g[P],U=Number(D>>I&u);U&&(y=y.add(l[P][U-1]))}}return y}}function cQe(r){return validateField(r.Fp),validateObject(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function HQ(r,e,n){if(e){if(e.ORDER!==r)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return fTe(e),e}else return f1(r,{isLE:n})}function pTe(r,e,n={},i){if(i===void 0&&(i=r==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${r} CURVE object`);for(const l of["p","n","h"]){const g=e[l];if(!(typeof g=="bigint"&&g>y2))throw new Error(`CURVE.${l} must be positive bigint`)}const s=HQ(e.p,n.Fp,i),o=HQ(e.n,n.Fn,i),u=["Gx","Gy","a",r==="weierstrass"?"b":"d"];for(const l of u)if(!s.isValid(e[l]))throw new Error(`CURVE.${l} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:s,Fn:o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xy=BigInt(0),bu=BigInt(1),ON=BigInt(2),gTe=BigInt(8);function yTe(r,e,n,i){const s=r.sqr(n),o=r.sqr(i),a=r.add(r.mul(e.a,s),o),u=r.add(r.ONE,r.mul(e.d,r.mul(s,o)));return r.eql(a,u)}function mTe(r,e={}){const n=pTe("edwards",r,e,e.FpFnLE),{Fp:i,Fn:s}=n;let o=n.CURVE;const{h:a}=o;TN(e,{},{uvRatio:"function"});const u=ON<<BigInt(s.BYTES*8)-bu,l=V=>i.create(V),g=e.uvRatio||((V,J)=>{try{return{isValid:!0,value:i.sqrt(i.div(V,J))}}catch{return{isValid:!1,value:Xy}}});if(!yTe(i,o,o.Gx,o.Gy))throw new Error("bad curve params: generator point");function y(V,J,re=!1){const ce=re?bu:Xy;return wQ("coordinate "+V,J,ce,u),J}function A(V){if(!(V instanceof D))throw new Error("ExtendedPoint expected")}const I=_Q((V,J)=>{const{X:re,Y:ce,Z:Re}=V,De=V.is0();J==null&&(J=De?gTe:i.inv(Re));const Ue=l(re*J),Ve=l(ce*J),pe=i.mul(Re,J);if(De)return{x:Xy,y:bu};if(pe!==bu)throw new Error("invZ was invalid");return{x:Ue,y:Ve}}),P=_Q(V=>{const{a:J,d:re}=o;if(V.is0())throw new Error("bad point: ZERO");const{X:ce,Y:Re,Z:De,T:Ue}=V,Ve=l(ce*ce),pe=l(Re*Re),Se=l(De*De),Ce=l(Se*Se),je=l(Ve*J),$e=l(Se*l(je+pe)),Qe=l(Ce+l(re*l(Ve*pe)));if($e!==Qe)throw new Error("bad point: equation left != right (1)");const nt=l(ce*Re),Ne=l(De*Ue);if(nt!==Ne)throw new Error("bad point: equation left != right (2)");return!0});class D{constructor(J,re,ce,Re){this.X=y("x",J),this.Y=y("y",re),this.Z=y("z",ce,!0),this.T=y("t",Re),Object.freeze(this)}static CURVE(){return o}static fromAffine(J){if(J instanceof D)throw new Error("extended point not allowed");const{x:re,y:ce}=J||{};return y("x",re),y("y",ce),new D(re,ce,bu,l(re*ce))}static fromBytes(J,re=!1){const ce=i.BYTES,{a:Re,d:De}=o;J=vQ(QR(J,ce,"point")),AN(re,"zip215");const Ue=vQ(J),Ve=J[ce-1];Ue[ce-1]=Ve&-129;const pe=jE(Ue),Se=re?u:i.ORDER;wQ("point.y",pe,Xy,Se);const Ce=l(pe*pe),je=l(Ce-bu),$e=l(De*Ce-Re);let{isValid:Qe,value:nt}=g(je,$e);if(!Qe)throw new Error("bad point: invalid y coordinate");const Ne=(nt&bu)===bu,Me=(Ve&128)!==0;if(!re&&nt===Xy&&Me)throw new Error("bad point: x=0 and x_0=1");return Me!==Ne&&(nt=l(-nt)),D.fromAffine({x:nt,y:pe})}static fromHex(J,re=!1){return D.fromBytes(p0("point",J),re)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(J=8,re=!0){return U.createCache(this,J),re||this.multiply(ON),this}assertValidity(){P(this)}equals(J){A(J);const{X:re,Y:ce,Z:Re}=this,{X:De,Y:Ue,Z:Ve}=J,pe=l(re*Ve),Se=l(De*Re),Ce=l(ce*Ve),je=l(Ue*Re);return pe===Se&&Ce===je}is0(){return this.equals(D.ZERO)}negate(){return new D(l(-this.X),this.Y,this.Z,l(-this.T))}double(){const{a:J}=o,{X:re,Y:ce,Z:Re}=this,De=l(re*re),Ue=l(ce*ce),Ve=l(ON*l(Re*Re)),pe=l(J*De),Se=re+ce,Ce=l(l(Se*Se)-De-Ue),je=pe+Ue,$e=je-Ve,Qe=pe-Ue,nt=l(Ce*$e),Ne=l(je*Qe),Me=l(Ce*Qe),ct=l($e*je);return new D(nt,Ne,ct,Me)}add(J){A(J);const{a:re,d:ce}=o,{X:Re,Y:De,Z:Ue,T:Ve}=this,{X:pe,Y:Se,Z:Ce,T:je}=J,$e=l(Re*pe),Qe=l(De*Se),nt=l(Ve*ce*je),Ne=l(Ue*Ce),Me=l((Re+De)*(pe+Se)-$e-Qe),ct=Ne-nt,mt=Ne+nt,Bt=l(Qe-re*$e),er=l(Me*ct),cr=l(mt*Bt),pr=l(Me*Bt),Dr=l(ct*mt);return new D(er,cr,Dr,pr)}subtract(J){return this.add(J.negate())}multiply(J){if(!s.isValidNot0(J))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:re,f:ce}=U.cached(this,J,Re=>eC(D,Re));return eC(D,[re,ce])[0]}multiplyUnsafe(J,re=D.ZERO){if(!s.isValid(J))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return J===Xy?D.ZERO:this.is0()||J===bu?this:U.unsafe(this,J,ce=>eC(D,ce),re)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return U.unsafe(this,o.n).is0()}toAffine(J){return I(this,J)}clearCofactor(){return a===bu?this:this.multiplyUnsafe(a)}toBytes(){const{x:J,y:re}=this.toAffine(),ce=i.toBytes(re);return ce[ce.length-1]|=J&bu?128:0,ce}toHex(){return h2(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(J){return eC(D,J)}static msm(J,re){return WQ(D,s,J,re)}_setWindowSize(J){this.precompute(J)}toRawBytes(){return this.toBytes()}}D.BASE=new D(o.Gx,o.Gy,bu,l(o.Gx*o.Gy)),D.ZERO=new D(Xy,bu,bu,Xy),D.Fp=i,D.Fn=s;const U=new hTe(D,s.BITS);return D.BASE.precompute(8),D}class bTe{constructor(e){this.ep=e}static fromBytes(e){AQ()}static fromHex(e){AQ()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return h2(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,n){return this.init(this.ep.precompute(e,n))}toRawBytes(){return this.toBytes()}}function vTe(r,e,n={}){if(typeof e!="function")throw new Error('"hash" function param is required');TN(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:i}=n,{BASE:s,Fp:o,Fn:a}=r,u=n.randomBytes||UEe,l=n.adjustScalarBytes||(Se=>Se),g=n.domain||((Se,Ce,je)=>{if(AN(je,"phflag"),Ce.length||je)throw new Error("Contexts/pre-hash are not supported");return Se});function y(Se){return a.create(jE(Se))}function A(Se){const Ce=ce.secretKey;Se=p0("private key",Se,Ce);const je=p0("hashed private key",e(Se),2*Ce),$e=l(je.slice(0,Ce)),Qe=je.slice(Ce,2*Ce),nt=y($e);return{head:$e,prefix:Qe,scalar:nt}}function I(Se){const{head:Ce,prefix:je,scalar:$e}=A(Se),Qe=s.multiply($e),nt=Qe.toBytes();return{head:Ce,prefix:je,scalar:$e,point:Qe,pointBytes:nt}}function P(Se){return I(Se).pointBytes}function D(Se=Uint8Array.of(),...Ce){const je=KR(...Ce);return y(e(g(je,p0("context",Se),!!i)))}function U(Se,Ce,je={}){Se=p0("message",Se),i&&(Se=i(Se));const{prefix:$e,scalar:Qe,pointBytes:nt}=I(Ce),Ne=D(je.context,$e,Se),Me=s.multiply(Ne).toBytes(),ct=D(je.context,Me,nt,Se),mt=a.create(Ne+ct*Qe);if(!a.isValid(mt))throw new Error("sign failed: invalid s");const Bt=KR(Me,a.toBytes(mt));return QR(Bt,ce.signature,"result")}const V={zip215:!0};function J(Se,Ce,je,$e=V){const{context:Qe,zip215:nt}=$e,Ne=ce.signature;Se=p0("signature",Se,Ne),Ce=p0("message",Ce),je=p0("publicKey",je,ce.publicKey),nt!==void 0&&AN(nt,"zip215"),i&&(Ce=i(Ce));const Me=Ne/2,ct=Se.subarray(0,Me),mt=jE(Se.subarray(Me,Ne));let Bt,er,cr;try{Bt=r.fromBytes(je,nt),er=r.fromBytes(ct,nt),cr=s.multiplyUnsafe(mt)}catch{return!1}if(!nt&&Bt.isSmallOrder())return!1;const pr=D(Qe,er.toBytes(),Bt.toBytes(),Ce);return er.add(Bt.multiplyUnsafe(pr)).subtract(cr).clearCofactor().is0()}const re=o.BYTES,ce={secretKey:re,publicKey:re,signature:2*re,seed:re};function Re(Se=u(ce.seed)){return QR(Se,ce.seed,"seed")}function De(Se){const Ce=pe.randomSecretKey(Se);return{secretKey:Ce,publicKey:P(Ce)}}function Ue(Se){return VR(Se)&&Se.length===a.BYTES}function Ve(Se,Ce){try{return!!r.fromBytes(Se,Ce)}catch{return!1}}const pe={getExtendedPublicKey:I,randomSecretKey:Re,isValidSecretKey:Ue,isValidPublicKey:Ve,toMontgomery(Se){const{y:Ce}=r.fromBytes(Se),je=ce.publicKey,$e=je===32;if(!$e&&je!==57)throw new Error("only defined for 25519 and 448");const Qe=$e?o.div(bu+Ce,bu-Ce):o.div(Ce-bu,Ce+bu);return o.toBytes(Qe)},toMontgomeryPriv(Se){const Ce=ce.secretKey;QR(Se,Ce);const je=e(Se.subarray(0,Ce));return l(je).subarray(0,Ce)},randomPrivateKey:Re,precompute(Se=8,Ce=r.BASE){return Ce.precompute(Se,!1)}};return Object.freeze({keygen:De,getPublicKey:P,sign:U,verify:J,utils:pe,Point:r,lengths:ce})}function wTe(r){const e={a:r.a,d:r.d,p:r.Fp.ORDER,n:r.n,h:r.h,Gx:r.Gx,Gy:r.Gy},n=r.Fp,i=f1(e.n,r.nBitLength,!0),s={Fp:n,Fn:i,uvRatio:r.uvRatio},o={randomBytes:r.randomBytes,adjustScalarBytes:r.adjustScalarBytes,domain:r.domain,prehash:r.prehash,mapToCurve:r.mapToCurve};return{CURVE:e,curveOpts:s,hash:r.hash,eddsaOpts:o}}function ATe(r,e){const n=e.Point;return Object.assign({},e,{ExtendedPoint:n,CURVE:r,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}function _Te(r){const{CURVE:e,curveOpts:n,hash:i,eddsaOpts:s}=wTe(r),o=mTe(e,n),a=vTe(o,i,s);return ATe(r,a)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ETe=BigInt(0),y0=BigInt(1),PN=BigInt(2),lQe=BigInt(3),zQ=BigInt(5),$Q=BigInt(8),h1=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),KE={p:h1,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:$Q,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function TTe(r){const e=BigInt(10),n=BigInt(20),i=BigInt(40),s=BigInt(80),o=h1,u=r*r%o*r%o,l=g0(u,PN,o)*u%o,g=g0(l,y0,o)*r%o,y=g0(g,zQ,o)*g%o,A=g0(y,e,o)*y%o,I=g0(A,n,o)*A%o,P=g0(I,i,o)*I%o,D=g0(P,s,o)*P%o,U=g0(D,s,o)*P%o,V=g0(U,e,o)*y%o;return{pow_p_5_8:g0(V,PN,o)*r%o,b2:u}}function STe(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}const NN=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function MN(r,e){const n=h1,i=La(e*e*e,n),s=La(i*i*e,n),o=TTe(r*s).pow_p_5_8;let a=La(r*i*o,n);const u=La(e*a*a,n),l=a,g=La(a*NN,n),y=u===r,A=u===La(-r,n),I=u===La(-r*NN,n);return y&&(a=l),(A||I)&&(a=g),Yy(a,n)&&(a=La(-a,n)),{isValid:y||A,value:a}}const ci=f1(KE.p,{isLE:!0}),ITe=f1(KE.n,{isLE:!0}),kTe={...KE,Fp:ci,hash:yQ,adjustScalarBytes:STe,uvRatio:MN},ad=_Te(kTe);function fQe(r,e,n){if(e.length>255)throw new Error("Context is too big");return concatBytes(utf8ToBytes("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,e.length]),e,r)}const dQe=null,hQe=null,pQe=null,gQe=null,RTe=null,VQ=null;function CTe(r){const e=(h1-zQ)/$Q,n=BigInt(486662);let i=ci.sqr(r);i=ci.mul(i,PN);let s=ci.add(i,ci.ONE),o=ci.neg(n),a=ci.sqr(s),u=ci.mul(a,s),l=ci.mul(i,n);l=ci.mul(l,o),l=ci.add(l,a),l=ci.mul(l,o);let g=ci.sqr(u);a=ci.sqr(g),g=ci.mul(g,u),g=ci.mul(g,l),a=ci.mul(a,g);let y=ci.pow(a,e);y=ci.mul(y,g);let A=ci.mul(y,VQ);a=ci.sqr(y),a=ci.mul(a,u);let I=ci.eql(a,l),P=ci.cmov(A,y,I),D=ci.mul(o,i),U=ci.mul(y,r);U=ci.mul(U,RTe);let V=ci.mul(U,VQ),J=ci.mul(l,i);a=ci.sqr(U),a=ci.mul(a,u);let re=ci.eql(a,J),ce=ci.cmov(V,U,re);a=ci.sqr(P),a=ci.mul(a,u);let Re=ci.eql(a,l),De=ci.cmov(D,o,Re),Ue=ci.cmov(ce,P,Re),Ve=ci.isOdd(Ue);return Ue=ci.cmov(Ue,ci.neg(Ue),Re!==Ve),{xMn:De,xMd:s,yMn:Ue,yMd:y0}}const xTe=null;function yQe(r){const{xMn:e,xMd:n,yMn:i,yMd:s}=CTe(r);let o=ci.mul(e,s);o=ci.mul(o,xTe);let a=ci.mul(n,i),u=ci.sub(e,n),l=ci.add(e,n),g=ci.mul(a,l),y=ci.eql(g,ci.ZERO);o=ci.cmov(o,ci.ZERO,y),a=ci.cmov(a,ci.ONE,y),u=ci.cmov(u,ci.ONE,y),l=ci.cmov(l,ci.ONE,y);const[A,I]=FpInvertBatch(ci,[a,l],!0);return{x:ci.mul(o,A),y:ci.mul(u,I)}}const mQe=null,LN=NN,BTe=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),OTe=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),PTe=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),NTe=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),jQ=r=>MN(y0,r),MTe=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),DN=r=>ad.Point.Fp.create(jE(r)&MTe);function KQ(r){const{d:e}=KE,n=h1,i=J=>ci.create(J),s=i(LN*r*r),o=i((s+y0)*PTe);let a=BigInt(-1);const u=i((a-e*s)*i(s+e));let{isValid:l,value:g}=MN(o,u),y=i(g*r);Yy(y,n)||(y=i(-y)),l||(g=y),l||(a=s);const A=i(a*(s-y0)*NTe-u),I=g*g,P=i((g+g)*u),D=i(A*BTe),U=i(y0-I),V=i(y0+I);return new ad.Point(i(P*V),i(U*D),i(D*V),i(P*U))}function LTe(r){lh(r,64);const e=DN(r.subarray(0,32)),n=KQ(e),i=DN(r.subarray(32,64)),s=KQ(i);return new Jc(n.add(s))}class Jc extends bTe{constructor(e){super(e)}static fromAffine(e){return new Jc(ad.Point.fromAffine(e))}assertSame(e){if(!(e instanceof Jc))throw new Error("RistrettoPoint expected")}init(e){return new Jc(e)}static hashToCurve(e){return LTe(p0("ristrettoHash",e,64))}static fromBytes(e){lh(e,32);const{a:n,d:i}=KE,s=h1,o=Re=>ci.create(Re),a=DN(e);if(!tTe(ci.toBytes(a),e)||Yy(a,s))throw new Error("invalid ristretto255 encoding 1");const u=o(a*a),l=o(y0+n*u),g=o(y0-n*u),y=o(l*l),A=o(g*g),I=o(n*i*y-A),{isValid:P,value:D}=jQ(o(I*A)),U=o(D*g),V=o(D*U*I);let J=o((a+a)*U);Yy(J,s)&&(J=o(-J));const re=o(l*V),ce=o(J*re);if(!P||Yy(ce,s)||re===ETe)throw new Error("invalid ristretto255 encoding 2");return new Jc(new ad.Point(J,re,y0,ce))}static fromHex(e){return Jc.fromBytes(p0("ristrettoHex",e,32))}static msm(e,n){return WQ(Jc,ad.Point.Fn,e,n)}toBytes(){let{X:e,Y:n,Z:i,T:s}=this.ep;const o=h1,a=V=>ci.create(V),u=a(a(i+n)*a(i-n)),l=a(e*n),g=a(l*l),{value:y}=jQ(a(u*g)),A=a(y*u),I=a(y*l),P=a(A*I*s);let D;if(Yy(s*P,o)){let V=a(n*LN),J=a(e*LN);e=V,n=J,D=a(A*OTe)}else D=I;Yy(e*P,o)&&(n=a(-n));let U=a((i-n)*D);return Yy(U,o)&&(U=a(-U)),ci.toBytes(U)}equals(e){this.assertSame(e);const{X:n,Y:i}=this.ep,{X:s,Y:o}=e.ep,a=g=>ci.create(g),u=a(n*o)===a(i*s),l=a(i*o)===a(n*s);return u||l}is0(){return this.equals(Jc.ZERO)}}Jc.BASE=new Jc(ad.Point.BASE),Jc.ZERO=new Jc(ad.Point.ZERO),Jc.Fp=ci,Jc.Fn=ITe;const bQe=null,vQe=null,wQe=null;function AQe(r){return ad.utils.toMontgomery(ensureBytes("pub",r))}const _Qe=null;function EQe(r){return ad.utils.toMontgomeryPriv(ensureBytes("pub",r))}const TQe=null,SQe=null,IQe=null,kQe=null,RQe=null,UN=lh,CQe=null,xQe=null,BQe=null;class GQ extends lQ{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,PEe(e);const i=zE(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?e.create().update(i).digest():i);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),od(o)}update(e){return jR(this),this.iHash.update(e),this}digestInto(e){jR(this),lh(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:i,finished:s,destroyed:o,blockLen:a,outputLen:u}=this;return e=e,e.finished=s,e.destroyed=o,e.blockLen=a,e.outputLen=u,e.oHash=n._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const FN=(r,e,n)=>new GQ(r,e).update(n).digest();FN.create=(r,e)=>new GQ(r,e);const m2=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),Jy=new Uint32Array(80);class OQe extends $E{constructor(){super(64,20,8,!1),this.A=m2[0]|0,this.B=m2[1]|0,this.C=m2[2]|0,this.D=m2[3]|0,this.E=m2[4]|0}get(){const{A:e,B:n,C:i,D:s,E:o}=this;return[e,n,i,s,o]}set(e,n,i,s,o){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=o|0}process(e,n){for(let l=0;l<16;l++,n+=4)Jy[l]=e.getUint32(n,!1);for(let l=16;l<80;l++)Jy[l]=Vy(Jy[l-3]^Jy[l-8]^Jy[l-14]^Jy[l-16],1);let{A:i,B:s,C:o,D:a,E:u}=this;for(let l=0;l<80;l++){let g,y;l<20?(g=GR(s,o,a),y=1518500249):l<40?(g=s^o^a,y=1859775393):l<60?(g=fQ(s,o,a),y=2400959708):(g=s^o^a,y=3395469782);const A=Vy(i,5)+g+u+y+Jy[l]|0;u=a,a=o,o=Vy(s,30),s=i,i=A}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,this.set(i,s,o,a,u)}roundClean(){od(Jy)}destroy(){this.set(0,0,0,0,0),od(this.buffer)}}const PQe=null,DTe=Math.pow(2,32),UTe=Array.from({length:64},(r,e)=>Math.floor(DTe*Math.abs(Math.sin(e+1)))),tC=m2.slice(0,4),WN=new Uint32Array(16);class NQe extends $E{constructor(){super(64,16,8,!0),this.A=tC[0]|0,this.B=tC[1]|0,this.C=tC[2]|0,this.D=tC[3]|0}get(){const{A:e,B:n,C:i,D:s}=this;return[e,n,i,s]}set(e,n,i,s){this.A=e|0,this.B=n|0,this.C=i|0,this.D=s|0}process(e,n){for(let u=0;u<16;u++,n+=4)WN[u]=e.getUint32(n,!0);let{A:i,B:s,C:o,D:a}=this;for(let u=0;u<64;u++){let l,g,y;u<16?(l=GR(s,o,a),g=u,y=[7,12,17,22]):u<32?(l=GR(a,s,o),g=(5*u+1)%16,y=[5,9,14,20]):u<48?(l=s^o^a,g=(3*u+5)%16,y=[4,11,16,23]):(l=o^(s|~a),g=7*u%16,y=[6,10,15,21]),l=l+i+UTe[u]+WN[g],i=a,a=o,o=s,s=s+Vy(l,y[u%4])}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,this.set(i,s,o,a)}roundClean(){od(WN)}destroy(){this.set(0,0,0,0),od(this.buffer)}}const MQe=null,FTe=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),qQ=Uint8Array.from(new Array(16).fill(0).map((r,e)=>e)),WTe=qQ.map(r=>(9*r+5)%16),ZQ=(()=>{const n=[[qQ],[WTe]];for(let i=0;i<4;i++)for(let s of n)s.push(s[i].map(o=>FTe[o]));return n})(),YQ=ZQ[0],XQ=ZQ[1],JQ=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>Uint8Array.from(r)),HTe=YQ.map((r,e)=>r.map(n=>JQ[e][n])),zTe=XQ.map((r,e)=>r.map(n=>JQ[e][n])),$Te=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),VTe=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function QQ(r,e,n,i){return r===0?e^n^i:r===1?e&n|~e&i:r===2?(e|~n)^i:r===3?e&i|n&~i:e^(n|~i)}const rC=new Uint32Array(16);class jTe extends $E{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:i,h3:s,h4:o}=this;return[e,n,i,s,o]}set(e,n,i,s,o){this.h0=e|0,this.h1=n|0,this.h2=i|0,this.h3=s|0,this.h4=o|0}process(e,n){for(let P=0;P<16;P++,n+=4)rC[P]=e.getUint32(n,!0);let i=this.h0|0,s=i,o=this.h1|0,a=o,u=this.h2|0,l=u,g=this.h3|0,y=g,A=this.h4|0,I=A;for(let P=0;P<5;P++){const D=4-P,U=$Te[P],V=VTe[P],J=YQ[P],re=XQ[P],ce=HTe[P],Re=zTe[P];for(let De=0;De<16;De++){const Ue=Vy(i+QQ(P,o,u,g)+rC[J[De]]+U,ce[De])+A|0;i=A,A=g,g=Vy(u,10)|0,u=o,o=Ue}for(let De=0;De<16;De++){const Ue=Vy(s+QQ(D,a,l,y)+rC[re[De]]+V,Re[De])+I|0;s=I,I=y,y=Vy(l,10)|0,l=a,a=Ue}}this.set(this.h1+u+y|0,this.h2+g+I|0,this.h3+A+s|0,this.h4+i+a|0,this.h0+o+l|0)}roundClean(){od(rC)}destroy(){this.destroyed=!0,od(this.buffer),this.set(0,0,0,0,0)}}const KTe=vN(()=>new jTe),LQe=null,GTe=KTe,DQe=null,qTe=XEe,UQe=null,FQe=null,WQe=null,eee=yQ,HQe=null,zQe=null,$Qe=null,VQe=null,jQe=null,KQe=null;/*! micro-key-producer - MIT License (c) 2024 Paul Miller (paulmillr.com) */const ZTe=bN("ed25519 seed"),HN=2147483648,tee=new Uint8Array([0]);function ree(r,...e){return typeof r=="string"&&(r=mN(r)),UN(r,...e),r}const YTe=r=>GTe(qTe(r)),XTe=r=>HE(r).getUint32(0,!1),zN=r=>{if(!Number.isSafeInteger(r)||r<0||r>2**32-1)throw new Error(`Invalid number=${r}. Should be from 0 to 2 ** 32 - 1`);const e=new Uint8Array(4);return HE(e).setUint32(0,r,!1),e};class nC{get publicKeyRaw(){return ad.getPublicKey(this.privateKey)}get publicKey(){return KR(tee,this.publicKeyRaw)}get pubHash(){return YTe(this.publicKey)}get fingerprint(){return XTe(this.pubHash)}get fingerprintHex(){return h2(zN(this.fingerprint))}get parentFingerprintHex(){return h2(zN(this.parentFingerprint))}static fromMasterSeed(e){if(e=ree(e),8*e.length<128||8*e.length>512)throw new Error(`HDKey: wrong seed length=${e.length}. Should be between 128 and 512 bits; 256 bits is advised)`);const n=FN(eee,ZTe,e);return new nC({privateKey:n.slice(0,32),chainCode:n.slice(32)})}constructor(e){if(this.depth=0,this.index=0,this.parentFingerprint=0,!e||typeof e!="object")throw new Error("HDKey.constructor must not be called directly");if(UN(e.privateKey,32),UN(e.chainCode,32),this.depth=e.depth||0,this.index=e.index||0,this.parentFingerprint=e.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");this.chainCode=e.chainCode,this.privateKey=e.privateKey}derive(e,n=!1){if(!/^[mM]'?/.test(e))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(e))return this;const i=e.replace(/^[mM]'?\//,"").split("/");let s=this;for(const o of i){const a=/^(\d+)('?)$/.exec(o);if(!a||a.length!==3)throw new Error(`Invalid child index: ${o}`);let u=+a[1];if(!Number.isSafeInteger(u)||u>=HN)throw new Error("Invalid index");(n||a[2]==="'")&&(u+=HN),s=s.deriveChild(u)}return s}deriveChild(e){if(e<HN)throw new Error(`Non-hardened child derivation not possible for Ed25519 (index=${e})`);const n=KR(tee,this.privateKey,zN(e)),i=FN(eee,this.chainCode,n);return new nC({chainCode:i.slice(32),depth:this.depth+1,parentFingerprint:this.fingerprint,index:e,privateKey:i.slice(0,32)})}sign(e){return ad.sign(e,this.privateKey)}verify(e,n){return n=ree(n,64),ad.verify(n,e,this.publicKeyRaw)}}const nee=nC;var $N=new WeakMap,JTe=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,$N,{writable:!0,value:void 0}),he(this,$N,nee.fromMasterSeed(n))}var e=r.prototype;return e.deriveChildWithIdx=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return a="m/44'/501'/".concat(i,"'/0'"),u=X(s,$N).derive(a),l=u.privateKey,y.abrupt("return",l);case 4:case"end":return y.stop()}},o)}))()},r}(),VN=new WeakMap,jN=new WeakMap,QTe=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,jN,{get:tSe,set:eSe}),de(this,VN,{writable:!0,value:""}),he(this,jN,n)}var e=r.prototype;return e.deriveChildWithIdx=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(i===0){l.next=2;break}throw Error("Currently not supported derive for sui");case 2:return a=GO.deriveKeypair(X(s,jN)),l.abrupt("return",a.getSecretKey());case 4:case"end":return l.stop()}},o)}))()},r}();function eSe(r){he(this,VN,Mg(r))}function tSe(){return Lg(X(this,VN))}var KN=new WeakMap,rSe=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,KN,{writable:!0,value:void 0}),he(this,KN,nee.fromMasterSeed(n))}var e=r.prototype;return e.deriveChildWithIdx=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return a="m/44'/607'/".concat(i,"'"),u=X(s,KN).derive(a),l=u.privateKey,y.abrupt("return",l);case 4:case"end":return y.stop()}},o)}))()},r}(),GN=new WeakMap,qN=new WeakMap,nSe=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,qN,{get:sSe,set:iSe}),de(this,GN,{writable:!0,value:""}),he(this,qN,n)}var e=r.prototype;return e.deriveChildWithIdx=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a="m/44'/195'/0'/0/".concat(i),u=pi.fromMnemonic(X(s,qN),a),g.abrupt("return",u.privateKey);case 3:case"end":return g.stop()}},o)}))()},r}();function iSe(r){he(this,GN,Mg(r))}function sSe(){return Lg(X(this,GN))}var ZN=new WeakMap,Ef=new WeakMap,iC=new WeakMap,sC=new WeakMap,YN=new WeakMap,XN=new WeakMap,JN=new WeakMap,p1=new WeakMap,g1=new WeakMap,y1=new WeakMap,m1=new WeakMap,b1=new WeakMap,m0=new WeakMap,QN=new WeakSet,oC=new WeakSet,eM=function(){"use strict";function r(){(0,G.A)(this,r),de(this,m0,{get:aSe,set:oSe}),B(this,QN),B(this,oC),this.walletId=null,this.type=di.hd,de(this,ZN,{writable:!0,value:""}),de(this,Ef,{writable:!0,value:[]}),de(this,iC,{writable:!0,value:null}),de(this,sC,{writable:!0,value:null}),de(this,YN,{writable:!0,value:null}),de(this,XN,{writable:!0,value:null}),de(this,JN,{writable:!0,value:null}),de(this,p1,{writable:!0,value:{}}),de(this,g1,{writable:!0,value:{}}),de(this,y1,{writable:!0,value:{}}),de(this,m1,{writable:!0,value:{}}),de(this,b1,{writable:!0,value:{}})}var e=r.prototype;return e.getAccountIds=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",X(i,Ef));case 1:case"end":return a.stop()}},s)}))()},e.getAccountAddress=function(i,s,o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(X(a,Ef).includes(i)){g.next=2;break}throw new Error("Account not found");case 2:if(s!==nn.evm){g.next=6;break}return g.abrupt("return",X(a,p1)[i].getAddress());case 6:if(s!==nn.solana){g.next=10;break}return g.abrupt("return",X(a,g1)[i].getAddress());case 10:if(s!==nn.tron){g.next=14;break}return g.abrupt("return",X(a,y1)[i].getAddress());case 14:if(s!==nn.sui){g.next=18;break}return g.abrupt("return",X(a,m1)[i].getAddress());case 18:if(s!==nn.ton){g.next=22;break}return g.abrupt("return",X(a,b1)[i].getAddress());case 22:throw new Error("Network type not supported");case 23:case"end":return g.stop()}},u)}))()},e.getPublicKeyHex=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(X(o,Ef).includes(i)){l.next=2;break}throw new Error("Account not found");case 2:if(s!==nn.evm){l.next=6;break}return l.abrupt("return",X(o,p1)[i].getPublicKeyHex());case 6:if(s!==nn.solana){l.next=10;break}return l.abrupt("return",X(o,g1)[i].getPublicKeyHex());case 10:if(s!==nn.tron){l.next=14;break}return l.abrupt("return",X(o,y1)[i].getPublicKeyHex());case 14:if(s!==nn.sui){l.next=18;break}return l.abrupt("return",X(o,m1)[i].getPublicKeyHex());case 18:if(s!==nn.ton){l.next=22;break}return l.abrupt("return",X(o,b1)[i].getPublicKeyHex());case 22:throw new Error("Network type not supported");case 23:case"end":return l.stop()}},a)}))()},e.getSupportedNetworkAndAddressTypeList=function(){return(0,k.A)(b().mark(function i(){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",[{networkType:nn.evm,addressType:$s.EVM_EOA},{networkType:nn.solana,addressType:$s.SOL_2},{networkType:nn.tron,addressType:$s.TRON},{networkType:nn.sui,addressType:$s.SUI},{networkType:nn.ton,addressType:$s.TON}]);case 1:case"end":return o.stop()}},i)}))()},e.getDerivationInfo=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(u=X(o,Ef).indexOf(i),!(u<0)){g.next=3;break}throw new Error("Account not found");case 3:return g.abrupt("return",{derivationIndex:u});case 4:case"end":return g.stop()}},a)}))()},e.addAccount=function(){var i=this;return(0,k.A)(b().mark(function s(){var o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(X(i,m0)){u.next=2;break}throw new Error("No mnemonic");case 2:if(X(i,iC)){u.next=4;break}throw new Error("No evm network");case 4:if(X(i,sC)){u.next=6;break}throw new Error("No solana network");case 6:return o=ef(),X(i,Ef).push(o),u.next=10,K(i,oC,rM).call(i);case 10:return u.abrupt("return",o);case 11:case"end":return u.stop()}},s)}))()},e.exportAccount=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(X(o,m0)){l.next=2;break}throw new Error("No mnemonic");case 2:if(s!==nn.evm){l.next=6;break}return l.abrupt("return",X(o,p1)[i].exportPrivateKey());case 6:if(s!==nn.solana){l.next=10;break}return l.abrupt("return",X(o,g1)[i].exportPrivateKey());case 10:if(s!==nn.tron){l.next=14;break}return l.abrupt("return",X(o,y1)[i].exportPrivateKey());case 14:if(s!==nn.sui){l.next=18;break}return l.abrupt("return",X(o,m1)[i].exportPrivateKey());case 18:if(s!==nn.ton){l.next=22;break}return l.abrupt("return",X(o,b1)[i].exportPrivateKey());case 22:throw new Error("Network type not supported");case 23:case"end":return l.stop()}},a)}))()},e.exportMnemonic=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(X(i,m0)){a.next=2;break}throw new Error("No mnemonic");case 2:return a.abrupt("return",X(i,m0));case 3:case"end":return a.stop()}},s)}))()},e.signMessage=function(i,s,o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(X(u,Ef).includes(i)){y.next=2;break}throw new Error("Account not found");case 2:if(s!==nn.evm){y.next=6;break}return y.abrupt("return",X(u,p1)[i].signMessage(o,a));case 6:if(s!==nn.solana){y.next=10;break}return y.abrupt("return",X(u,g1)[i].signMessage(o));case 10:if(s!==nn.tron){y.next=14;break}return y.abrupt("return",X(u,y1)[i].signMessage(o));case 14:if(s!==nn.sui){y.next=18;break}return y.abrupt("return",X(u,m1)[i].signMessage(o));case 18:if(s!==nn.ton){y.next=22;break}return y.abrupt("return",X(u,b1)[i].signMessage(o));case 22:throw new Error("Network type not supported");case 23:case"end":return y.stop()}},l)}))()},e.signTx=function(i,s,o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(X(u,Ef).includes(i)){y.next=2;break}throw new Error("Account not found");case 2:if(s!==nn.evm){y.next=6;break}return y.abrupt("return",X(u,p1)[i].signTransaction(o,a));case 6:if(s!==nn.solana){y.next=10;break}return y.abrupt("return",X(u,g1)[i].signTransaction(o));case 10:if(s!==nn.tron){y.next=14;break}return y.abrupt("return",X(u,y1)[i].signTransaction(o));case 14:if(s!==nn.sui){y.next=18;break}return y.abrupt("return",X(u,m1)[i].signTransaction(o));case 18:if(s!==nn.ton){y.next=22;break}return y.abrupt("return",X(u,b1)[i].signTransaction(o));case 22:throw new Error("Network type not supported");case 23:case"end":return y.stop()}},l)}))()},e.checkDuplicate=function(i){var s=this;return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",i===X(s,m0));case 1:case"end":return u.stop()}},o)}))()},e.serialize=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",{accountIds:X(i,Ef),mnemonic:X(i,m0)});case 1:case"end":return a.stop()}},s)}))()},e.restoreFromMnemonic=function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,QN,iee).call(o,i);case 2:if(he(o,Ef,s||[]),X(o,Ef).length){l.next=6;break}return l.next=6,o.addAccount();case 6:return l.next=8,K(o,oC,rM).call(o);case 8:case"end":return l.stop()}},a)}))()},e.generateRandomMnemonic=function(){var i=this;return(0,k.A)(b().mark(function s(){var o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!X(i,m0)){u.next=2;break}throw new Error("Already generated mnemonic");case 2:return o=$x(qx),u.next=5,K(i,QN,iee).call(i,o);case 5:return u.next=7,i.addAccount();case 7:return u.next=9,K(i,oC,rM).call(i);case 9:case"end":return u.stop()}},s)}))()},r.deserialize=function(i){return(0,k.A)(b().mark(function s(){var o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=i.accountIds,a=i.mnemonic,u=new r,g.next=4,u.restoreFromMnemonic(a,o);case 4:return g.abrupt("return",u);case 5:case"end":return g.stop()}},s)}))()},r}();function oSe(r){he(this,ZN,Mg(r))}function aSe(){return Lg(X(this,ZN))}function iee(r){return tM.apply(this,arguments)}function tM(){return tM=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!X(this,m0)){s.next=2;break}throw new Error("Already has mnemonic");case 2:return he(this,m0,e),s.next=5,Gx(e);case 5:n=s.sent,he(this,iC,new OEe(n)),he(this,sC,new JTe(n)),he(this,YN,new nSe(e)),he(this,XN,new QTe(e)),he(this,JN,new rSe(n));case 11:case"end":return s.stop()}},r,this)})),tM.apply(this,arguments)}function rM(){return nM.apply(this,arguments)}function nM(){return nM=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:e=0;case 1:if(!(e<X(this,Ef).length)){g.next=36;break}return n=X(this,Ef)[e],g.t0=m3,g.next=6,X(this,iC).deriveChildWithIdx(e);case 6:return g.t1=g.sent,i=new g.t0(g.t1),g.t2=z3,g.next=11,X(this,sC).deriveChildWithIdx(e);case 11:return g.t3=g.sent,s=new g.t2(g.t3),g.t4=VP,g.next=16,X(this,YN).deriveChildWithIdx(e);case 16:return g.t5=g.sent,o=new g.t4(g.t5),g.t6=ZO,g.next=21,X(this,XN).deriveChildWithIdx(e);case 21:return g.t7=g.sent,a=new g.t6(g.t7),g.t8=o8,g.next=26,X(this,JN).deriveChildWithIdx(e);case 26:g.t9=g.sent,u=new g.t8(g.t9),X(this,p1)[n]=i,X(this,g1)[n]=s,X(this,y1)[n]=o,X(this,m1)[n]=a,X(this,b1)[n]=u;case 33:e++,g.next=1;break;case 36:case"end":return g.stop()}},r,this)})),nM.apply(this,arguments)}var b2=tn(79422),uSe={selectedAccountId:null,selectedWalletId:null,walletList:[],activeMPCWalletId:null,allMPCWalletSimpleInfo:[],isWalletLocked:!0,currentMPCImport:null,mpcWalletStatus:null,currentWalletImportedNetworkIds:null,removedOldWalletItem:null,fullMpcAddressListV2Atom:{}},cSe=function(r){var e=r.find(function(a){return a.addressType==="EVM_EOA"}),n=r.find(function(a){return a.addressType==="SOL_1"}),i=r.find(function(a){return a.addressType==="TRON"}),s=r.find(function(a){return a.addressType==="SUI"}),o=r.find(function(a){return a.addressType==="TON"});return[{address:e.address.toLowerCase(),network:nn.evm},{address:n.address,network:nn.solana},{address:i.address,network:nn.tron},{address:s.address,network:nn.sui},{address:o.address,network:nn.ton}]},fh=Nr(uSe,{persistKeys:["walletList","selectedAccountId","selectedWalletId","mpcWalletStatus","activeMPCWalletId","allMPCWalletSimpleInfo","fullMpcAddressListV2Atom"]}),Ku=fh.walletListBgAtom,v2=fh.selectedAccountIdBgAtom,w2=fh.selectedWalletIdBgAtom,Ul=fh.isWalletLockedBgAtom,ud=fh.mpcWalletStatusBgAtom,Fl=fh.activeMPCWalletIdBgAtom,v1=fh.allMPCWalletSimpleInfoBgAtom,b0=fh.currentMPCImportBgAtom,Qy=fh.currentWalletImportedNetworkIdsBgAtom,see=fh.removedOldWalletItemBgAtom,iM=fh.fullMpcAddressListV2AtomBgAtom,oee=tr(function(){var r=(0,k.A)(b().mark(function e(n){var i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n(iM);case 2:if(i=o.sent,i){o.next=5;break}return o.abrupt("return",{});case 5:return o.abrupt("return",(0,H.mapValues)(i,function(a){return cSe(a)}));case 6:case"end":return o.stop()}},e)}));return function(e){return r.apply(this,arguments)}}()),aee=["000002","351007","351216","351217","351218","351219","351220","351221","351222","351223","351225"],Hs;(function(r){r.PermissionRequest="permission_request",r.SignMessage="sign_message",r.SwitchNetwork="switch_network",r.SendTransaction="send_transaction",r.NeedRefresh="need_refresh",r.MPCAppSign="mpc_app_sign",r.MPCAppDexSign="mpc_app_dex_sign",r.Loading="loading",r.requestAutoSign="request_auto_sign",r.DexWebConnect="dex_web_connect",r.RequestSas="request_sas",r.AddEVMChain="add_ethereum_chain",r.SwapConfirm="swap_confirm",r.TransactionBlock="transaction_block"})(Hs||(Hs={}));var _c;(function(r){r.Pending="pending",r.Approved="approved",r.Rejected="rejected",r.Error="error",r.Approving="approving"})(_c||(_c={}));var Go;(function(r){r.send="ext-send",r.swap="ext-swap",r.dapp="ext-dapp",r.revoke="ext-revk",r.nft="ext-nft",r.sendToMp="ext-send-mp",r.dappToMp="ext-dapp-mp",r.swapToMap="ext-swap-mp",r.revokeToMp="ext-revk-mp",r.unknownToMp="ext-ukwn-mp"})(Go||(Go={}));var su;(function(r){r.qrCodeLoading="qrCodeLoading",r.valid="valid",r.scanned="scanned",r.importing="importing",r.expired="expired",r.success="success",r.scanFailed="scanFailed",r.importFailed="importFailed",r.userCancel="userCancel"})(su||(su={}));var v0;(function(r){r.pending="pending",r.expired="expired",r.success="success",r.userCancel="userCancel"})(v0||(v0={}));var lSe=function(r){var e="";(0,H.isString)(r)?e=r:r?.message&&(e=r.message);var n=ur(e.split(":"),1),i=n[0];return i},aC=function(r,e){try{var n,i=((n=r)===null||n===void 0?void 0:n.code)||lSe(r);return e.includes(String(i))}catch{return!1}},uee=new WeakSet,uC=function(){"use strict";function r(n){(0,G.A)(this,r),B(this,uee),this.isInLoop=!1,this.isActive=!1,this.waitBeforeStart=!1,this.cancelLoopWait=function(){},this.getRefreshInterval=n.getRefreshInterval;var i;this.waitBeforeStart=(i=n.waitBeforeStart)!==null&&i!==void 0?i:!1}var e=r.prototype;return e.checkLoop=function(){return(0,k.A)(b().mark(function i(){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",!0);case 1:case"end":return o.stop()}},i)}))()},e.preLoop=function(){return(0,k.A)(b().mark(function i(){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return");case 1:case"end":return o.stop()}},i)}))()},e.startLoop=function(i){K(this,uee,fSe).call(this,i)},e.stopLoop=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:i.isActive=!1,i.cancelLoopWait();case 2:case"end":return a.stop()}},s)}))()},r}();function fSe(r){return sM.apply(this,arguments)}function sM(){return sM=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return i=(n=e?.noWait)!==null&&n!==void 0?n:!1,this.isActive=!0,D.next=5,this.preLoop();case 5:if(this.isActive){D.next=7;break}return D.abrupt("return");case 7:if(!this.isInLoop){D.next=9;break}return D.abrupt("return");case 9:if(this.isInLoop=!0,D.prev=10,!(this.waitBeforeStart&&!i)){D.next=16;break}return s=pv(this.getRefreshInterval()),o=s.promise,a=s.cancel,this.cancelLoopWait=a,D.next=16,o;case 16:return D.next=18,this.checkLoop();case 18:u=D.sent,l=50;case 20:if(!(u&&this.isActive&&l-- >0)){D.next=41;break}return D.prev=21,D.next=24,this.refreshFn();case 24:D.next=29;break;case 26:D.prev=26,D.t0=D.catch(21),console.error(D.t0);case 29:return D.prev=29,g=this.getRefreshInterval(),y=pv(g),A=y.promise,I=y.cancel,this.cancelLoopWait=I,D.next=35,A;case 35:return D.next=37,this.checkLoop();case 37:return u=D.sent,D.finish(29);case 39:D.next=20;break;case 41:return D.prev=41,this.isInLoop=!1,D.finish(41);case 44:case"end":return D.stop()}},r,this,[[10,,41,44],[21,26,29,39]])})),sM.apply(this,arguments)}var cee=function(r){"use strict";N(n,r);var e=te(n);function n(s,o){(0,G.A)(this,n);var a;return a=e.call(this,{getRefreshInterval:(0,H.isNumber)(o)?function(){return o}:o}),a._refreshFn=s,a}var i=n.prototype;return i.refreshFn=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",o._refreshFn());case 1:case"end":return l.stop()}},a)}))()},n}(uC),oM=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g=arguments;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:i=g.length>1&&g[1]!==void 0?g[1]:{},s=i.interval,o=s===void 0?100:s,a=i.timeout,u=a===void 0?5e3:a,l=Date.now();case 3:return A.next=5,n();case 5:if(!A.sent){A.next=7;break}return A.abrupt("return",!0);case 7:if(!(Date.now()-l>=u)){A.next=9;break}return A.abrupt("return",!1);case 9:return A.next=11,new Promise(function(I){return setTimeout(I,o)});case 11:A.next=3;break;case 13:case"end":return A.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),dSe={pendingApprovalList:[],lastProcessedApproval:null},lee=Nr(dSe),aM=lee.pendingApprovalListBgAtom,hSe=lee.lastProcessedApprovalBgAtom;function cC(){var r,e,n=new Promise(function(i,s){r=i,e=s});return{promise:n,resolve:r,reject:e}}var pSe=630,uM=360,w1=chrome,cM=new WeakSet,fee=new WeakSet,gSe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),cM),B(F(s),fee),s.name="window",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:w1.windows.onRemoved.addListener(K(o,fee,ySe).bind(o));case 1:case"end":return l.stop()}},a)}))()},i.showPopup=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,K(o,cM,dee).call(o);case 2:if(u=J.sent,!u){J.next=6;break}return w1.windows.update(u.id,{focused:!0}),J.abrupt("return");case 6:if(l=Eh(),!l){J.next=9;break}return J.abrupt("return");case 9:return g=0,y=0,J.prev=11,J.next=14,w1.windows.getLastFocused();case 14:A=J.sent,y=A.top,g=Math.max(A.left+(A.width-uM),0),J.next=24;break;case 19:J.prev=19,J.t0=J.catch(11),I=self.screenX,P=self.screenY,D=self.outerWidth,y=Math.max(P,0),g=Math.max(I+(D-uM),0);case 24:return J.next=26,w1.windows.create({url:"index.html#/notification",type:"popup",width:uM,height:pSe,left:g,top:y});case 26:if(U=J.sent,!(U&&U.left!==g&&U.state!=="fullscreen")){J.next=30;break}return J.next=30,w1.windows.update(U.id,{left:g,top:y});case 30:U&&(o._popupWindowId=U.id);case 31:case"end":return J.stop()}},a,null,[[11,19]])}))()},i.closePopup=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,K(o,cM,dee).call(o);case 2:if(u=g.sent,!u){g.next=6;break}return g.next=6,w1.windows.remove(u.id);case 6:case"end":return g.stop()}},a)}))()},n}(Yr);function dee(){return lM.apply(this,arguments)}function lM(){return lM=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,!this._popupWindowId){n.next=5;break}return n.abrupt("return",w1.windows.get(this._popupWindowId));case 5:return n.abrupt("return",null);case 6:n.next=11;break;case 8:return n.prev=8,n.t0=n.catch(0),n.abrupt("return",null);case 11:case"end":return n.stop()}},r,this,[[0,8]])})),lM.apply(this,arguments)}function ySe(r){return fM.apply(this,arguments)}function fM(){return fM=(0,k.A)(b().mark(function r(e){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:e===this._popupWindowId&&(this._popupWindowId=void 0);case 1:case"end":return i.stop()}},r,this)})),fM.apply(this,arguments)}var lC=new gSe,em;(function(r){r.ApprovalNotFound="ApprovalNotFound",r.ApprovalRejected="ApprovalRejected",r.ApprovalUnknownError="ApprovalUnknownError"})(em||(em={}));function mSe(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:99;return r>e?"".concat(e,"+"):String(r)}var fC=chrome,tm=new WeakMap,GE=new WeakMap,dM=new WeakMap,qE=new WeakMap,qp=new WeakSet,hM=new WeakSet,pM=new WeakSet,dC=new WeakSet,hee=new WeakSet,bSe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),qp),B(F(s),hM),B(F(s),pM),B(F(s),dC),B(F(s),hee),s.name="approval",de(F(s),tm,{writable:!0,value:{}}),de(F(s),GE,{writable:!0,value:{}}),de(F(s),dM,{writable:!0,value:{}}),de(F(s),qE,{writable:!0,value:{}}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,hee,vSe).call(o);case 2:case"end":return l.stop()}},a)}))()},i.checkStatus=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Gt.get(o);case 2:return u=g.sent,g.abrupt("return",u?.status);case 4:case"end":return g.stop()}},a)}))()},i.getApproval=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",Gt.get(o));case 1:case"end":return l.stop()}},a)}))()},i.addApproval=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return l=o.origin,g=o.type,y=o.requestData,A=o.requestId,I=o.source,P=I===void 0?Go.dapp:I,D=o.onRefresh,U=o.onlyCancel,V=M4(A),J=cC(),X(a,tm)[V]=J,D&&(X(a,qE)[V]=D),ce.next=7,Gt.upsert(V,{id:V,origin:l,type:g,status:_c.Pending,timestamp:Date.now(),requestData:y,onlyCancel:U});case 7:return ce.next=9,K(a,qp,rm).call(a,V);case 9:return ce.next=11,K(a,dC,bM).call(a);case 11:if(P!==Go.dapp){ce.next=14;break}return ce.next=14,lC.showPopup();case 14:return ce.abrupt("return",V);case 15:case"end":return ce.stop()}},u)}))()},i.upsertApproval=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(l=o.approvalId,g=bs(o,["approvalId"]),!l){A.next=7;break}return A.next=4,a.changeApproval({id:l,approval:Mr({},g)});case 4:return A.abrupt("return",l);case 7:return A.abrupt("return",a.addApproval(g));case 8:case"end":return A.stop()}},u)}))()},i.waitForApproval=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!X(a,tm)[o]){y.next=2;break}return y.abrupt("return",X(a,tm)[o].promise);case 2:return y.next=4,Gt.get(o);case 4:if(l=y.sent,l){y.next=7;break}throw new Error(em.ApprovalNotFound);case 7:if(l.status!==_c.Approved){y.next=9;break}return y.abrupt("return",Promise.resolve(!0));case 9:if(l.status!==_c.Rejected){y.next=11;break}return y.abrupt("return",Promise.resolve(!1));case 11:if(l.status!==_c.Error){y.next=13;break}throw new Error(l.errMsg||em.ApprovalUnknownError);case 13:return X(a,tm)[o]=cC(),y.abrupt("return",X(a,tm)[o].promise);case 15:case"end":return y.stop()}},u)}))()},i.acceptApproval=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=3,Gt.get(o);case 3:if(y=D.sent,y){D.next=6;break}throw new Error(em.ApprovalNotFound);case 6:if(A=X(a,dM)[y.type],!A){D.next=26;break}return D.prev=8,D.next=11,Gt.update(o,{status:_c.Approving});case 11:return D.next=13,K(a,qp,rm).call(a,o);case 13:return D.next=15,A(y);case 15:I=D.sent,(0,H.isNil)(I)||(X(a,GE)[o]=I),D.next=26;break;case 19:return D.prev=19,D.t0=D.catch(8),D.next=23,Gt.update(o,{status:_c.Pending});case 23:return D.next=25,K(a,qp,rm).call(a,o);case 25:throw D.t0;case 26:return D.next=28,Gt.update(o,{status:_c.Approved});case 28:return(l=X(a,tm)[o])===null||l===void 0||(g=l.resolve)===null||g===void 0||g.call(l,!0),D.next=31,K(a,hM,pee).call(a,o);case 31:return D.next=33,K(a,qp,rm).call(a,o);case 33:return D.next=35,K(a,dC,bM).call(a);case 35:return D.next=37,K(a,pM,gee).call(a);case 37:case"end":return D.stop()}},u,null,[[8,19]])}))()},i.rejectApproval=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=3,Gt.get(o);case 3:if(y=I.sent,y){I.next=6;break}throw new Error(em.ApprovalNotFound);case 6:return I.next=8,Gt.update(o,{status:_c.Rejected});case 8:return(l=X(a,tm)[o])===null||l===void 0||(g=l.resolve)===null||g===void 0||g.call(l,!1),I.next=11,K(a,hM,pee).call(a,o);case 11:return I.next=13,K(a,qp,rm).call(a,o);case 13:return I.next=15,K(a,dC,bM).call(a);case 15:return I.next=17,K(a,pM,gee).call(a);case 17:case"end":return I.stop()}},u)}))()},i.changeRequestDataWithRefresh=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,l.changeRequestData(o,a);case 2:X(l,qE)[o]=u;case 3:case"end":return A.stop()}},g)}))()},i.changeRequestData=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,Gt.get(o);case 2:if(g=A.sent,g){A.next=5;break}throw new Error(em.ApprovalNotFound);case 5:return A.next=7,Gt.update(o,{requestData:a});case 7:return A.next=9,K(u,qp,rm).call(u,o);case 9:case"end":return A.stop()}},l)}))()},i.changeApproval=function(o){var a=o.id,u=o.approval,l=this;return(0,k.A)(b().mark(function g(){var y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return y=u.onRefresh,A=bs(u,["onRefresh"]),P.next=3,Gt.update(a,A);case 3:return P.next=5,K(l,qp,rm).call(l,a);case 5:y&&(X(l,qE)[a]=y);case 6:case"end":return P.stop()}},g)}))()},i.getPendingApproval=function(){return(0,k.A)(b().mark(function o(){var a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return a=Gt.table,y.next=3,a.where({status:_c.Pending}).toArray();case 3:return u=y.sent,y.next=6,a.where({status:_c.Approving}).toArray();case 6:return l=y.sent,y.abrupt("return",(0,H.sortBy)(u.concat(l),function(A){return-A.timestamp}));case 8:case"end":return y.stop()}},o)}))()},i.refreshApproval=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(l=X(a,qE)[o],!l){y.next=5;break}return y.next=4,l(o);case 4:return y.abrupt("return");case 5:case"end":return y.stop()}},u)}))()},i.getApprovalRequestById=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Gt.get(o);case 2:if(u=g.sent,u){g.next=5;break}throw Error(em.ApprovalNotFound);case 5:return g.abrupt("return",u);case 6:case"end":return g.stop()}},a)}))()},i.registerBeforeApprove=function(o,a){X(this,dM)[o]=a},i.fetchExtraReturn=function(o){var a=X(this,GE)[o];return delete X(this,GE)[o],a},i.setExtraReturn=function(o,a){X(this,GE)[o]=a},n}(Yr);function rm(r){return gM.apply(this,arguments)}function gM(){return gM=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.getPendingApproval();case 2:return n=s.sent,s.next=5,zt.set(aM,n);case 5:case"end":return s.stop()}},r,this)})),gM.apply(this,arguments)}function pee(r){return yM.apply(this,arguments)}function yM(){return yM=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Gt.get(e);case 2:if(n=s.sent,n){s.next=5;break}return s.abrupt("return");case 5:return s.next=7,zt.set(hSe,n);case 7:case"end":return s.stop()}},r)})),yM.apply(this,arguments)}function gee(){return mM.apply(this,arguments)}function mM(){return mM=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,zt.get(aM);case 2:e=i.sent,e.length===0&&lC.closePopup();case 4:case"end":return i.stop()}},r)})),mM.apply(this,arguments)}function bM(){return vM.apply(this,arguments)}function vM(){return vM=(0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,zt.get(aM);case 2:return e=o.sent,n=e.length,i="",n&&(i=mSe(n)),o.prev=6,o.next=9,fC.action.setBadgeText({text:i});case 9:return o.next=11,fC.action.setBadgeBackgroundColor({color:"#1F8DF9"});case 11:if(!fC.action.setBadgeTextColor){o.next=14;break}return o.next=14,fC.action.setBadgeTextColor({color:"#fff"});case 14:o.next=19;break;case 16:o.prev=16,o.t0=o.catch(6),console.error("[ApprovalController:updateCountBadge] Failed to update badge:",{pendingCount:n,label:i},o.t0);case 19:case"end":return o.stop()}},r,null,[[6,16]])})),vM.apply(this,arguments)}function vSe(){return wM.apply(this,arguments)}function wM(){return wM=(0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getPendingApproval();case 2:return e=o.sent,n=e.map(function(a){return a.id}),i=n.map(function(a){return Gt.update(a,{status:_c.Rejected})}),o.next=7,Promise.all(i);case 7:return o.next=9,K(this,qp,rm).call(this);case 9:case"end":return o.stop()}},r,this)})),wM.apply(this,arguments)}var Zn=new bSe;_e("approval",{acceptApproval:Zn.acceptApproval.bind(Zn),rejectApproval:Zn.rejectApproval.bind(Zn),changeRequestData:Zn.changeRequestData.bind(Zn),refreshApproval:Zn.refreshApproval.bind(Zn),getApprovalRequestById:Zn.getApprovalRequestById.bind(Zn)});var wSe={defiAssetsList:[],defiTotalBalance:"0"},yee=Nr(wSe),mee=yee.defiAssetsListBgAtom,bee=yee.defiTotalBalanceBgAtom,hC=tr(new Map),A1=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:if(i=n.fn,s=n.input,o=n.merge,a=n.chunkSize,u=a===void 0?100:a,l=n.callInSequence,g=(0,H.chunk)(s,u),y=[],!l){ce.next=33;break}A=!0,I=!1,P=void 0,ce.prev=5,D=g[Symbol.iterator]();case 7:if(A=(U=D.next()).done){ce.next=17;break}return V=U.value,ce.t0=y,ce.next=12,i(V);case 12:ce.t1=ce.sent,ce.t0.push.call(ce.t0,ce.t1);case 14:A=!0,ce.next=7;break;case 17:ce.next=23;break;case 19:ce.prev=19,ce.t2=ce.catch(5),I=!0,P=ce.t2;case 23:ce.prev=23,ce.prev=24,!A&&D.return!=null&&D.return();case 26:if(ce.prev=26,!I){ce.next=29;break}throw P;case 29:return ce.finish(26);case 30:return ce.finish(23);case 31:ce.next=36;break;case 33:return ce.next=35,Promise.all(g.map(function(Re){return i(Re)}));case 35:y=ce.sent;case 36:return J=o(y),ce.abrupt("return",J);case 38:case"end":return ce.stop()}},e,null,[[5,19,23,31],[24,,26,30]])}));return function(n){return r.apply(this,arguments)}}(),vee=function(r){var e={},n=!0,i=!1,s=void 0;try{for(var o=r[Symbol.iterator](),a;!(n=(a=o.next()).done);n=!0){var u=a.value;Object.assign(e,u)}}catch(l){i=!0,s=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return e};function wee(r,e){var n=r();return new Promise(function(i,s){var o=setTimeout(function(){s(new Error("Promise timed out after ".concat(e,"ms")))},e);n.then(function(a){clearTimeout(o),i(a)}).catch(function(a){clearTimeout(o),s(a)})})}var _1=tr([]),ASe=function(r){var e=r.str,n=r.startDecimal,i=n===void 0?6:n,s=r.endDecimal,o=s===void 0?4:s,a=r.ellipsis,u=a===void 0?"dot":a,l=u==="dot"?"...":"***";return e?"".concat(e.slice(0,i)).concat(l).concat(e.slice(e.length-o)):""},_Se=function(r,e){return ASe({str:r,startDecimal:6,endDecimal:6})},dh=function(r,e){return!r||!r.accounts?[]:(0,H.flatten)(r.accounts.map(function(n){return n.addressList.filter(function(i){return e?i.network===e:!0}).map(function(i){return i.address})}))},GQe=function(r,e){return r.addressList.filter(function(n){return e?n.network===e:!0}).map(function(n){return n.address})};function pC(r,e){var n=!0,i=!1,s=void 0;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=!0){var u=a.value;if(u.accounts.some(function(l){return l.id===r}))return u}}catch(l){i=!0,s=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return null}function ESe(r,e){return(0,H.uniq)(r.map(function(n){return pC(n,e)}).filter(function(n){return!!n}))}function Aee(r,e){if(!r)return[];var n=(0,H.keyBy)(e,function(i){return i.id});return(0,H.flatten)(r.map(function(i){var s=n[i];if(!s)return[];var o=[],a=!0,u=!1,l=void 0;try{for(var g=s.accounts[Symbol.iterator](),y;!(a=(y=g.next()).done);a=!0){var A=y.value;o.push(A.id)}}catch(I){u=!0,l=I}finally{try{!a&&g.return!=null&&g.return()}finally{if(u)throw l}}return o}))}function TSe(r,e){return r?e.filter(function(n){return r.includes(n.id)}):[]}function qQe(r,e){return r?e.filter(function(n){return n.accounts[0].addressList.some(function(i){return i.address.toLowerCase()===r.toLowerCase()})}):[]}function _ee(r,e){return e.accounts.find(function(n){return n.addressList.map(function(i){return i.address.toLowerCase()}).includes(r.toLowerCase())})}var Wl=function(r){return SSe(r)?r.toLowerCase():r},SSe=function(r){return Bz(r)},ISe={selectedNetworkId:null,networkList:[]},Eee=Nr(ISe,{persistKeys:["selectedNetworkId","networkList"]}),gC=Eee.selectedNetworkIdBgAtom,Zp=Eee.networkListBgAtom,AM=["56","1","CT_501","8453"],ZQe=AM.map(function(r){return no(r)}),kSe=function(r){var e=[];return r.includes(nn.evm)&&e.push("56","1","8453"),r.includes(nn.solana)&&e.push("CT_501"),AM.filter(function(n){return e.includes(n)})},RSe="56",Tee="CT_501",yC="CT_195",YQe="CT_784",CSe="CT_0",XQe="1",JQe="8453",QQe="137",eet="42161",tet="81457",ret="10",net="59144",iet="34443",set="43114",oet="9745",aet="143",xSe=function(r){switch(r){case nn.evm:return[$s.EVM_EOA];case nn.solana:return[$s.SOL_2];case nn.utxo:return[$s.BTC_TAPROOT,$s.BTC_NATIVE_SEGWIT];case nn.tron:return[$s.TRON];case nn.sui:return[$s.SUI];case nn.ton:return[$s.TON];default:throw new Error("Unsupported network type: ".concat(r))}},nm,_M=(nm={},vt(nm,nn.evm,"56"),vt(nm,nn.solana,"CT_501"),vt(nm,nn.utxo,"CT_0"),vt(nm,nn.tron,"CT_195"),vt(nm,nn.sui,"CT_784"),vt(nm,nn.ton,"CT_607"),nm),See=function(r){return r?r.accounts[0].addressList.map(function(e){return e.network}):Zx},mC=function(r){return r?r.startsWith("https://static.bnw3w.com")?r:r.startsWith("http")?r.replaceAll("https://bin.bnbstatic.com","https://static.bnw3w.com"):"https://static.bnw3w.com".concat(r):""},BSe={customChainList:[]},ZE=Nr(BSe,{persistKeys:["customChainList"]}).customChainListBgAtom,ou;(function(r){r[r.UnknownRisk=-1]="UnknownRisk",r[r.VeryLowRisk=0]="VeryLowRisk",r[r.LowRisk=1]="LowRisk",r[r.SomeRisk=2]="SomeRisk",r[r.MediumRisk=3]="MediumRisk",r[r.HighRisk=4]="HighRisk",r[r.Blacklist=5]="Blacklist"})(ou||(ou={}));var uet=ou.Blacklist,cet=ou.HighRisk,fet=ou.MediumRisk,bC="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",OSe="So11111111111111111111111111111111111111111",Iee=function(r){return r.toLowerCase()===bC.toLowerCase()||r===OSe},PSe=function(r){return No(r,bC)};const NSe="logger/5.4.0";let kee=!1,Ree=!1;const vC={debug:1,default:2,info:2,warning:3,error:4,off:5};let Cee=vC.default,EM=null;function MSe(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(r){return r.message}return null}const xee=MSe();var TM;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(TM||(TM={}));var SM;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(SM||(SM={}));class Yn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,n){const i=e.toLowerCase();vC[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Cee>vC[i])&&console.log.apply(console,n)}debug(...e){this._log(Yn.levels.DEBUG,e)}info(...e){this._log(Yn.levels.INFO,e)}warn(...e){this._log(Yn.levels.WARNING,e)}makeError(e,n,i){if(Ree)return this.makeError("censored error",n,{});n||(n=Yn.errors.UNKNOWN_ERROR),i||(i={});const s=[];Object.keys(i).forEach(u=>{try{s.push(u+"="+JSON.stringify(i[u]))}catch{s.push(u+"="+JSON.stringify(i[u].toString()))}}),s.push(`code=${n}`),s.push(`version=${this.version}`);const o=e;s.length&&(e+=" ("+s.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=n,Object.keys(i).forEach(function(u){a[u]=i[u]}),a}throwError(e,n,i){throw this.makeError(e,n,i)}throwArgumentError(e,n,i){return this.throwError(e,Yn.errors.INVALID_ARGUMENT,{argument:n,value:i})}assert(e,n,i,s){e||this.throwError(n,i,s)}assertArgument(e,n,i,s){e||this.throwArgumentError(n,i,s)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),xee&&this.throwError("platform missing String.prototype.normalize",Yn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:xee})}checkSafeUint53(e,n){typeof e=="number"&&(n==null&&(n="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(n,Yn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(n,Yn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,n,i){i?i=": "+i:i="",e<n&&this.throwError("missing argument"+i,Yn.errors.MISSING_ARGUMENT,{count:e,expectedCount:n}),e>n&&this.throwError("too many arguments"+i,Yn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:n})}checkNew(e,n){(e===Object||e==null)&&this.throwError("missing new",Yn.errors.MISSING_NEW,{name:n.name})}checkAbstract(e,n){e===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",Yn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Yn.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return EM||(EM=new Yn(NSe)),EM}static setCensorship(e,n){if(!e&&n&&this.globalLogger().throwError("cannot permanently disable censorship",Yn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),kee){if(!e)return;this.globalLogger().throwError("error censorship permanent",Yn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Ree=!!e,kee=!!n}static setLogLevel(e){const n=vC[e.toLowerCase()];if(n==null){Yn.globalLogger().warn("invalid log level - "+e);return}Cee=n}static from(e){return new Yn(e)}}Yn.errors=SM,Yn.levels=TM;const LSe="bytes/5.4.0",Ta=new Yn(LSe);function Bee(r){return!!r.toHexString}function A2(r){return r.slice||(r.slice=function(){const e=Array.prototype.slice.call(arguments);return A2(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}function IM(r){return Qo(r)&&!(r.length%2)||wC(r)}function wC(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||r.length==null)return!1;for(let e=0;e<r.length;e++){const n=r[e];if(typeof n!="number"||n<0||n>=256||n%1)return!1}return!0}function fo(r,e){if(e||(e={}),typeof r=="number"){Ta.checkSafeUint53(r,"invalid arrayify value");const n=[];for(;r;)n.unshift(r&255),r=parseInt(String(r/256));return n.length===0&&n.push(0),A2(new Uint8Array(n))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Bee(r)&&(r=r.toHexString()),Qo(r)){let n=r.substring(2);n.length%2&&(e.hexPad==="left"?n="0x0"+n.substring(2):e.hexPad==="right"?n+="0":Ta.throwArgumentError("hex data is odd-length","value",r));const i=[];for(let s=0;s<n.length;s+=2)i.push(parseInt(n.substring(s,s+2),16));return A2(new Uint8Array(i))}return wC(r)?A2(new Uint8Array(r)):Ta.throwArgumentError("invalid arrayify value","value",r)}function E1(r){const e=r.map(s=>fo(s)),n=e.reduce((s,o)=>s+o.length,0),i=new Uint8Array(n);return e.reduce((s,o)=>(i.set(o,s),s+o.length),0),A2(i)}function Yp(r){let e=fo(r);if(e.length===0)return e;let n=0;for(;n<e.length&&e[n]===0;)n++;return n&&(e=e.slice(n)),e}function DSe(r,e){r=fo(r),r.length>e&&Ta.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(e);return n.set(r,e-r.length),A2(n)}function Qo(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}const kM="0123456789abcdef";function ks(r,e){if(e||(e={}),typeof r=="number"){Ta.checkSafeUint53(r,"invalid hexlify value");let n="";for(;r;)n=kM[r&15]+n,r=Math.floor(r/16);return n.length?(n.length%2&&(n="0"+n),"0x"+n):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Bee(r))return r.toHexString();if(Qo(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":Ta.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(wC(r)){let n="0x";for(let i=0;i<r.length;i++){let s=r[i];n+=kM[(s&240)>>4]+kM[s&15]}return n}return Ta.throwArgumentError("invalid hexlify value","value",r)}function USe(r){if(typeof r!="string")r=ks(r);else if(!Qo(r)||r.length%2)return null;return(r.length-2)/2}function Oee(r,e,n){return typeof r!="string"?r=ks(r):(!Qo(r)||r.length%2)&&Ta.throwArgumentError("invalid hexData","value",r),e=2+2*e,n!=null?"0x"+r.substring(e,2+2*n):"0x"+r.substring(e)}function T1(r){let e="0x";return r.forEach(n=>{e+=ks(n).substring(2)}),e}function FSe(r){const e=WSe(ks(r,{hexPad:"left"}));return e==="0x"?"0x0":e}function WSe(r){typeof r!="string"&&(r=ks(r)),Qo(r)||Ta.throwArgumentError("invalid hex string","value",r),r=r.substring(2);let e=0;for(;e<r.length&&r[e]==="0";)e++;return"0x"+r.substring(e)}function Xp(r,e){for(typeof r!="string"?r=ks(r):Qo(r)||Ta.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&Ta.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}function AC(r){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(IM(r)){const n=fo(r);n.length!==65&&Ta.throwArgumentError("invalid signature string; must be 65 bytes","signature",r),e.r=ks(n.slice(0,32)),e.s=ks(n.slice(32,64)),e.v=n[64],e.v<27&&(e.v===0||e.v===1?e.v+=27:Ta.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(n[32]|=128),e._vs=ks(n.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){const s=DSe(fo(e._vs),32);e._vs=ks(s);const o=s[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&Ta.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),s[0]&=127;const a=ks(s);e.s==null?e.s=a:e.s!==a&&Ta.throwArgumentError("signature v mismatch _vs","signature",r)}e.recoveryParam==null?e.v==null?Ta.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2:e.v==null?e.v=27+e.recoveryParam:e.recoveryParam!==1-e.v%2&&Ta.throwArgumentError("signature recoveryParam mismatch v","signature",r),e.r==null||!Qo(e.r)?Ta.throwArgumentError("signature missing or invalid r","signature",r):e.r=Xp(e.r,32),e.s==null||!Qo(e.s)?Ta.throwArgumentError("signature missing or invalid s","signature",r):e.s=Xp(e.s,32);const n=fo(e.s);n[0]>=128&&Ta.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(n[0]|=128);const i=ks(n);e._vs&&(Qo(e._vs)||Ta.throwArgumentError("signature invalid _vs","signature",r),e._vs=Xp(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&Ta.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e}function det(r){return r=AC(r),ks(E1([r.r,r.s,r.recoveryParam?"0x1c":"0x1b"]))}var HSe=tn(23364),zSe=tn.n(HSe);const $Se="bignumber/5.4.0";var YE=zSe().BN;const w0=new Yn($Se),RM={},Pee=9007199254740991;function het(r){return r!=null&&(zi.isBigNumber(r)||typeof r=="number"&&r%1===0||typeof r=="string"&&!!r.match(/^-?[0-9]+$/)||isHexString(r)||typeof r=="bigint"||isBytes(r))}let Nee=!1;class zi{constructor(e,n){w0.checkNew(new.target,zi),e!==RM&&w0.throwError("cannot call constructor directly; use BigNumber.from",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=n,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Hl(Rs(this).fromTwos(e))}toTwos(e){return Hl(Rs(this).toTwos(e))}abs(){return this._hex[0]==="-"?zi.from(this._hex.substring(1)):this}add(e){return Hl(Rs(this).add(Rs(e)))}sub(e){return Hl(Rs(this).sub(Rs(e)))}div(e){return zi.from(e).isZero()&&cd("division by zero","div"),Hl(Rs(this).div(Rs(e)))}mul(e){return Hl(Rs(this).mul(Rs(e)))}mod(e){const n=Rs(e);return n.isNeg()&&cd("cannot modulo negative values","mod"),Hl(Rs(this).umod(n))}pow(e){const n=Rs(e);return n.isNeg()&&cd("cannot raise to negative values","pow"),Hl(Rs(this).pow(n))}and(e){const n=Rs(e);return(this.isNegative()||n.isNeg())&&cd("cannot 'and' negative values","and"),Hl(Rs(this).and(n))}or(e){const n=Rs(e);return(this.isNegative()||n.isNeg())&&cd("cannot 'or' negative values","or"),Hl(Rs(this).or(n))}xor(e){const n=Rs(e);return(this.isNegative()||n.isNeg())&&cd("cannot 'xor' negative values","xor"),Hl(Rs(this).xor(n))}mask(e){return(this.isNegative()||e<0)&&cd("cannot mask negative values","mask"),Hl(Rs(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&cd("cannot shift negative values","shl"),Hl(Rs(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&cd("cannot shift negative values","shr"),Hl(Rs(this).shrn(e))}eq(e){return Rs(this).eq(Rs(e))}lt(e){return Rs(this).lt(Rs(e))}lte(e){return Rs(this).lte(Rs(e))}gt(e){return Rs(this).gt(Rs(e))}gte(e){return Rs(this).gte(Rs(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Rs(this).isZero()}toNumber(){try{return Rs(this).toNumber()}catch{cd("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return w0.throwError("this platform does not support BigInt",Yn.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Nee||(Nee=!0,w0.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?w0.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Yn.errors.UNEXPECTED_ARGUMENT,{}):w0.throwError("BigNumber.toString does not accept parameters",Yn.errors.UNEXPECTED_ARGUMENT,{})),Rs(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof zi)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new zi(RM,XE(e)):e.match(/^-?[0-9]+$/)?new zi(RM,XE(new YE(e))):w0.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&cd("underflow","BigNumber.from",e),(e>=Pee||e<=-Pee)&&cd("overflow","BigNumber.from",e),zi.from(String(e));const n=e;if(typeof n=="bigint")return zi.from(n.toString());if(wC(n))return zi.from(ks(n));if(n)if(n.toHexString){const i=n.toHexString();if(typeof i=="string")return zi.from(i)}else{let i=n._hex;if(i==null&&n.type==="BigNumber"&&(i=n.hex),typeof i=="string"&&(Qo(i)||i[0]==="-"&&Qo(i.substring(1))))return zi.from(i)}return w0.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function XE(r){if(typeof r!="string")return XE(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&w0.throwArgumentError("invalid hex","value",r),r=XE(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Hl(r){return zi.from(XE(r))}function Rs(r){const e=zi.from(r).toHexString();return e[0]==="-"?new YE("-"+e.substring(3),16):new YE(e.substring(2),16)}function cd(r,e,n){const i={fault:r,operation:e};return n!=null&&(i.value=n),w0.throwError(r,Yn.errors.NUMERIC_FAULT,i)}function VSe(r){return new YE(r,36).toString(16)}function pet(r){return new YE(r,16).toString(36)}const jSe="properties/5.4.0";var KSe=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};const _C=new Yn(jSe);function bi(r,e,n){Object.defineProperty(r,e,{enumerable:!0,value:n,writable:!1})}function JE(r,e){for(let n=0;n<32;n++){if(r[e])return r[e];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}function im(r){return KSe(this,void 0,void 0,function*(){const e=Object.keys(r).map(i=>{const s=r[i];return Promise.resolve(s).then(o=>({key:i,value:o}))});return(yield Promise.all(e)).reduce((i,s)=>(i[s.key]=s.value,i),{})})}function GSe(r,e){(!r||typeof r!="object")&&_C.throwArgumentError("invalid object","object",r),Object.keys(r).forEach(n=>{e[n]||_C.throwArgumentError("invalid object key - "+n,"transaction:"+n,r)})}function S1(r){const e={};for(const n in r)e[n]=r[n];return e}const qSe={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Mee(r){if(r==null||qSe[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const e=Object.keys(r);for(let n=0;n<e.length;n++)if(!Mee(r[e[n]]))return!1;return!0}return _C.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function ZSe(r){if(Mee(r))return r;if(Array.isArray(r))return Object.freeze(r.map(e=>_2(e)));if(typeof r=="object"){const e={};for(const n in r){const i=r[n];i!==void 0&&bi(e,n,_2(i))}return e}return _C.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function _2(r){return ZSe(r)}class QE{constructor(e){for(const n in e)this[n]=_2(e[n])}}const eT="abi/5.4.0",CM=new Yn(eT);function YSe(r){const e=[],n=function(i,s){if(Array.isArray(s))for(let o in s){const a=i.slice();a.push(o);try{n(a,s[o])}catch(u){e.push({path:a,error:u})}}};return n([],r),e}class Jp{constructor(e,n,i,s){this.name=e,this.type=n,this.localName=i,this.dynamic=s}_throwError(e,n){CM.throwArgumentError(e,this.localName,n)}}class xM{constructor(e){bi(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return T1(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(E1(e._data))}writeBytes(e){let n=fo(e);const i=n.length%this.wordSize;return i&&(n=E1([n,this._padding.slice(i)])),this._writeData(n)}_getValue(e){let n=fo(zi.from(e));return n.length>this.wordSize&&CM.throwError("value out-of-bounds",Yn.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:n.length}),n.length%this.wordSize&&(n=E1([this._padding.slice(n.length%this.wordSize),n])),n}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,n=>{this._data[e]=this._getValue(n)}}}class EC{constructor(e,n,i,s){bi(this,"_data",fo(e)),bi(this,"wordSize",n||32),bi(this,"_coerceFunc",i),bi(this,"allowLoose",s),this._offset=0}get data(){return ks(this._data)}get consumed(){return this._offset}static coerce(e,n){let i=e.match("^u?int([0-9]+)$");return i&&parseInt(i[1])<=48&&(n=n.toNumber()),n}coerce(e,n){return this._coerceFunc?this._coerceFunc(e,n):EC.coerce(e,n)}_peekBytes(e,n,i){let s=Math.ceil(n/this.wordSize)*this.wordSize;return this._offset+s>this._data.length&&(this.allowLoose&&i&&this._offset+n<=this._data.length?s=n:CM.throwError("data out-of-bounds",Yn.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+s})),this._data.slice(this._offset,this._offset+s)}subReader(e){return new EC(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,n){let i=this._peekBytes(0,e,!!n);return this._offset+=i.length,i.slice(0,e)}readValue(){return zi.from(this.readBytes(this.wordSize))}}var XSe=tn(9162),JSe=tn.n(XSe);function Qp(r){return"0x"+JSe().keccak_256(fo(r))}const QSe="rlp/5.4.0",A0=new Yn(QSe);function Lee(r){const e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function Dee(r,e,n){let i=0;for(let s=0;s<n;s++)i=i*256+r[e+s];return i}function Uee(r){if(Array.isArray(r)){let i=[];if(r.forEach(function(o){i=i.concat(Uee(o))}),i.length<=55)return i.unshift(192+i.length),i;const s=Lee(i.length);return s.unshift(247+s.length),s.concat(i)}IM(r)||A0.throwArgumentError("RLP object must be BytesLike","object",r);const e=Array.prototype.slice.call(fo(r));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=Lee(e.length);return n.unshift(183+n.length),n.concat(e)}function tT(r){return ks(Uee(r))}function Fee(r,e,n,i){const s=[];for(;n<e+1+i;){const o=Wee(r,n);s.push(o.result),n+=o.consumed,n>e+1+i&&A0.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+i,result:s}}function Wee(r,e){if(r.length===0&&A0.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{}),r[e]>=248){const n=r[e]-247;e+1+n>r.length&&A0.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{});const i=Dee(r,e+1,n);return e+1+n+i>r.length&&A0.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{}),Fee(r,e,e+1+n,n+i)}else if(r[e]>=192){const n=r[e]-192;return e+1+n>r.length&&A0.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{}),Fee(r,e,e+1,n)}else if(r[e]>=184){const n=r[e]-183;e+1+n>r.length&&A0.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const i=Dee(r,e+1,n);e+1+n+i>r.length&&A0.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const s=hexlify(r.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(r[e]>=128){const n=r[e]-128;e+1+n>r.length&&A0.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{});const i=hexlify(r.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:hexlify(r[e])}}function get(r){const e=arrayify(r),n=Wee(e,0);return n.consumed!==e.length&&A0.throwArgumentError("invalid rlp data","data",r),n.result}const eIe="address/5.4.0",sm=new Yn(eIe);function Hee(r){Qo(r,20)||sm.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const e=r.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=e[s].charCodeAt(0);const i=fo(Qp(n));for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(i[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const tIe=9007199254740991;function rIe(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const BM={};for(let r=0;r<10;r++)BM[String(r)]=String(r);for(let r=0;r<26;r++)BM[String.fromCharCode(65+r)]=String(10+r);const zee=Math.floor(rIe(tIe));function $ee(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(i=>BM[i]).join("");for(;e.length>=zee;){let i=e.substring(0,zee);e=parseInt(i,10)%97+e.substring(i.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}function Gu(r){let e=null;if(typeof r!="string"&&sm.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=Hee(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&sm.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==$ee(r)&&sm.throwArgumentError("bad icap checksum","address",r),e=VSe(r.substring(4));e.length<40;)e="0"+e;e=Hee("0x"+e)}else sm.throwArgumentError("invalid address","address",r);return e}function yet(r){try{return Gu(r),!0}catch{}return!1}function met(r){let e=_base16To36(Gu(r).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+$ee("XE00"+e)+e}function nIe(r){let e=null;try{e=Gu(r.from)}catch{sm.throwArgumentError("missing from address","transaction",r)}const n=Yp(fo(zi.from(r.nonce).toHexString()));return Gu(Oee(Qp(tT([e,n])),12))}function bet(r,e,n){return hexDataLength(e)!==32&&sm.throwArgumentError("salt must be 32 bytes","salt",e),hexDataLength(n)!==32&&sm.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),Gu(hexDataSlice(keccak256(concat(["0xff",Gu(r),e,n])),12))}const iIe="strings/5.4.0",Vee=new Yn(iIe);var rT;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(rT||(rT={}));var Tf;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(Tf||(Tf={}));function sIe(r,e,n,i,s){return Vee.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",n)}function jee(r,e,n,i,s){if(r===Tf.BAD_PREFIX||r===Tf.UNEXPECTED_CONTINUE){let o=0;for(let a=e+1;a<n.length&&n[a]>>6===2;a++)o++;return o}return r===Tf.OVERRUN?n.length-e-1:0}function oIe(r,e,n,i,s){return r===Tf.OVERLONG?(i.push(s),0):(i.push(65533),jee(r,e,n,i,s))}const aIe=Object.freeze({error:sIe,ignore:jee,replace:oIe});function OM(r,e){e==null&&(e=aIe.error),r=fo(r);const n=[];let i=0;for(;i<r.length;){const s=r[i++];if(!(s>>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e(Tf.UNEXPECTED_CONTINUE,i-1,r,n):i+=e(Tf.BAD_PREFIX,i-1,r,n);continue}if(i-1+o>=r.length){i+=e(Tf.OVERRUN,i-1,r,n);continue}let u=s&(1<<8-o-1)-1;for(let l=0;l<o;l++){let g=r[i];if((g&192)!=128){i+=e(Tf.MISSING_CONTINUE,i,r,n),u=null;break}u=u<<6|g&63,i++}if(u!==null){if(u>1114111){i+=e(Tf.OUT_OF_RANGE,i-1-o,r,n,u);continue}if(u>=55296&&u<=57343){i+=e(Tf.UTF16_SURROGATE,i-1-o,r,n,u);continue}if(u<=a){i+=e(Tf.OVERLONG,i-1-o,r,n,u);continue}n.push(u)}}return n}function PM(r,e=rT.current){e!=rT.current&&(Vee.checkNormalize(),r=r.normalize(e));let n=[];for(let i=0;i<r.length;i++){const s=r.charCodeAt(i);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){i++;const o=r.charCodeAt(i);if(i>=r.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const a=65536+((s&1023)<<10)+(o&1023);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(a&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return fo(n)}function NM(r){const e="0000"+r.toString(16);return"\\u"+e.substring(e.length-4)}function vet(r,e){return'"'+OM(r,e).map(n=>{if(n<256){switch(n){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(n>=32&&n<127)return String.fromCharCode(n)}return n<=65535?NM(n):(n-=65536,NM((n>>10&1023)+55296)+NM((n&1023)+56320))}).join("")+'"'}function uIe(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function cIe(r,e){return uIe(OM(r,e))}function wet(r,e=rT.current){return OM(PM(r,e))}function E2(r){return Qp(PM(r))}var lIe=tn(99136),fIe=tn.n(lIe);function nT(r){return"0x"+fIe().keccak_256(fo(r))}class dIe extends Jp{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){try{Gu(n)}catch(i){this._throwError(i.message,n)}return e.writeValue(n)}decode(e){return Gu(Xp(e.readValue().toHexString(),20))}}class hIe extends Jp{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,n){return this.coder.encode(e,n)}decode(e){return this.coder.decode(e)}}const T2=new Yn(eT);function Kee(r,e,n){let i=null;if(Array.isArray(n))i=n;else if(n&&typeof n=="object"){let l={};i=e.map(g=>{const y=g.localName;return y||T2.throwError("cannot encode object for signature with missing names",Yn.errors.INVALID_ARGUMENT,{argument:"values",coder:g,value:n}),l[y]&&T2.throwError("cannot encode object for signature with duplicate names",Yn.errors.INVALID_ARGUMENT,{argument:"values",coder:g,value:n}),l[y]=!0,n[y]})}else T2.throwArgumentError("invalid tuple value","tuple",n);e.length!==i.length&&T2.throwArgumentError("types/value length mismatch","tuple",n);let s=new xM(r.wordSize),o=new xM(r.wordSize),a=[];e.forEach((l,g)=>{let y=i[g];if(l.dynamic){let A=o.length;l.encode(o,y);let I=s.writeUpdatableValue();a.push(P=>{I(P+A)})}else l.encode(s,y)}),a.forEach(l=>{l(s.length)});let u=r.appendWriter(s);return u+=r.appendWriter(o),u}function Gee(r,e){let n=[],i=r.subReader(0);e.forEach(o=>{let a=null;if(o.dynamic){let u=r.readValue(),l=i.subReader(u.toNumber());try{a=o.decode(l)}catch(g){if(g.code===Yn.errors.BUFFER_OVERRUN)throw g;a=g,a.baseType=o.name,a.name=o.localName,a.type=o.type}}else try{a=o.decode(r)}catch(u){if(u.code===Yn.errors.BUFFER_OVERRUN)throw u;a=u,a.baseType=o.name,a.name=o.localName,a.type=o.type}a!=null&&n.push(a)});const s=e.reduce((o,a)=>{const u=a.localName;return u&&(o[u]||(o[u]=0),o[u]++),o},{});e.forEach((o,a)=>{let u=o.localName;if(!u||s[u]!==1||(u==="length"&&(u="_length"),n[u]!=null))return;const l=n[a];l instanceof Error?Object.defineProperty(n,u,{get:()=>{throw l}}):n[u]=l});for(let o=0;o<n.length;o++){const a=n[o];a instanceof Error&&Object.defineProperty(n,o,{get:()=>{throw a}})}return Object.freeze(n)}class pIe extends Jp{constructor(e,n,i){const s=e.type+"["+(n>=0?n:"")+"]",o=n===-1||e.dynamic;super("array",s,i,o),this.coder=e,this.length=n}defaultValue(){const e=this.coder.defaultValue(),n=[];for(let i=0;i<this.length;i++)n.push(e);return n}encode(e,n){Array.isArray(n)||this._throwError("expected array value",n);let i=this.length;i===-1&&(i=n.length,e.writeValue(n.length)),T2.checkArgumentCount(n.length,i,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let o=0;o<n.length;o++)s.push(this.coder);return Kee(e,s,n)}decode(e){let n=this.length;n===-1&&(n=e.readValue().toNumber(),n*32>e._data.length&&T2.throwError("insufficient data length",Yn.errors.BUFFER_OVERRUN,{length:e._data.length,count:n}));let i=[];for(let s=0;s<n;s++)i.push(new hIe(this.coder));return e.coerce(this.name,Gee(e,i))}}class gIe extends Jp{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,n){return e.writeValue(n?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class qee extends Jp{constructor(e,n){super(e,e,n,!0)}defaultValue(){return"0x"}encode(e,n){n=fo(n);let i=e.writeValue(n.length);return i+=e.writeBytes(n),i}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class yIe extends qee{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,ks(super.decode(e)))}}class mIe extends Jp{constructor(e,n){let i="bytes"+String(e);super(i,i,n,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,n){let i=fo(n);return i.length!==this.size&&this._throwError("incorrect data length",n),e.writeBytes(i)}decode(e){return e.coerce(this.name,ks(e.readBytes(this.size)))}}class bIe extends Jp{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const vIe=zi.from(-1),wIe=zi.from(0),AIe=zi.from(1),Aet=null,_et=null,Zee=zi.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Eet=null,Tet=null;class _Ie extends Jp{constructor(e,n,i){const s=(n?"int":"uint")+e*8;super(s,s,i,!1),this.size=e,this.signed=n}defaultValue(){return 0}encode(e,n){let i=zi.from(n),s=Zee.mask(e.wordSize*8);if(this.signed){let o=s.mask(this.size*8-1);(i.gt(o)||i.lt(o.add(AIe).mul(vIe)))&&this._throwError("value out-of-bounds",n)}else(i.lt(wIe)||i.gt(s.mask(this.size*8)))&&this._throwError("value out-of-bounds",n);return i=i.toTwos(this.size*8).mask(this.size*8),this.signed&&(i=i.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(i)}decode(e){let n=e.readValue().mask(this.size*8);return this.signed&&(n=n.fromTwos(this.size*8)),e.coerce(this.name,n)}}class EIe extends qee{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,PM(n))}decode(e){return cIe(super.decode(e))}}class TC extends Jp{constructor(e,n){let i=!1;const s=[];e.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i),this.coders=e}defaultValue(){const e=[];this.coders.forEach(i=>{e.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),e[o]==null&&(e[o]=e[s]))}),Object.freeze(e)}encode(e,n){return Kee(e,this.coders,n)}decode(e){return e.coerce(this.name,Gee(e,this.coders))}}const Ns=new Yn(eT),I1={};let Yee={calldata:!0,memory:!0,storage:!0},TIe={calldata:!0,memory:!0};function SC(r,e){if(r==="bytes"||r==="string"){if(Yee[e])return!0}else if(r==="address"){if(e==="payable")return!0}else if((r.indexOf("[")>=0||r==="tuple")&&TIe[e])return!0;return(Yee[e]||e==="payable")&&Ns.throwArgumentError("invalid modifier","name",e),!1}function SIe(r,e){let n=r;function i(u){Ns.throwArgumentError(`unexpected character at position ${u}`,"param",r)}r=r.replace(/\s/g," ");function s(u){let l={type:"",name:"",parent:u,state:{allowType:!0}};return e&&(l.indexed=!1),l}let o={type:"",name:"",state:{allowType:!0}},a=o;for(let u=0;u<r.length;u++){let l=r[u];switch(l){case"(":a.state.allowType&&a.type===""?a.type="tuple":a.state.allowParams||i(u),a.state.allowType=!1,a.type=S2(a.type),a.components=[s(a)],a=a.components[0];break;case")":delete a.state,a.name==="indexed"&&(e||i(u),a.indexed=!0,a.name=""),SC(a.type,a.name)&&(a.name=""),a.type=S2(a.type);let g=a;a=a.parent,a||i(u),delete g.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,a.name==="indexed"&&(e||i(u),a.indexed=!0,a.name=""),SC(a.type,a.name)&&(a.name=""),a.type=S2(a.type);let y=s(a.parent);a.parent.components.push(y),delete a.parent,a=y;break;case" ":a.state.allowType&&a.type!==""&&(a.type=S2(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&a.name!==""&&(a.name==="indexed"?(e||i(u),a.indexed&&i(u),a.indexed=!0,a.name=""):SC(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||i(u),a.type+=l,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||i(u),a.type+=l,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=l,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=l,delete a.state.allowArray):a.state.readArray?a.type+=l:i(u)}}return a.parent&&Ns.throwArgumentError("unexpected eof","param",r),delete o.state,a.name==="indexed"?(e||i(n.length-7),a.indexed&&i(n.length-7),a.indexed=!0,a.name=""):SC(a.type,a.name)&&(a.name=""),o.type=S2(o.type),o}function IC(r,e){for(let n in e)bi(r,n,e[n])}const eo=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),IIe=new RegExp(/^(.*)\[([0-9]*)\]$/);class vu{constructor(e,n){e!==I1&&Ns.throwError("use fromString",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),IC(this,n);let i=this.type.match(IIe);i?IC(this,{arrayLength:parseInt(i[2]||"-1"),arrayChildren:vu.fromObject({type:i[1],components:this.components}),baseType:"array"}):IC(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=eo.sighash),eo[e]||Ns.throwArgumentError("invalid format type","format",e),e===eo.json){let i={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.components&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let n="";return this.baseType==="array"?(n+=this.arrayChildren.format(e),n+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==eo.sighash&&(n+=this.type),n+="("+this.components.map(i=>i.format(e)).join(e===eo.full?", ":",")+")"):n+=this.type,e!==eo.sighash&&(this.indexed===!0&&(n+=" indexed"),e===eo.full&&this.name&&(n+=" "+this.name)),n}static from(e,n){return typeof e=="string"?vu.fromString(e,n):vu.fromObject(e)}static fromObject(e){return vu.isParamType(e)?e:new vu(I1,{name:e.name||null,type:S2(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(vu.fromObject):null})}static fromString(e,n){function i(s){return vu.fromObject({name:s.name,type:s.type,indexed:s.indexed,components:s.components})}return i(SIe(e,!!n))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function iT(r,e){return RIe(r).map(n=>vu.fromString(n,e))}class eg{constructor(e,n){e!==I1&&Ns.throwError("use a static from method",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),IC(this,n),this._isFragment=!0,Object.freeze(this)}static from(e){return eg.isFragment(e)?e:typeof e=="string"?eg.fromString(e):eg.fromObject(e)}static fromObject(e){if(eg.isFragment(e))return e;switch(e.type){case"function":return E0.fromObject(e);case"event":return tg.fromObject(e);case"constructor":return _0.fromObject(e);case"error":return om.fromObject(e);case"fallback":case"receive":return null}return Ns.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?tg.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?E0.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?_0.fromString(e.trim()):e.split(" ")[0]==="error"?om.fromString(e.substring(5).trim()):Ns.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class tg extends eg{format(e){if(e||(e=eo.sighash),eo[e]||Ns.throwArgumentError("invalid format type","format",e),e===eo.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let n="";return e!==eo.sighash&&(n+="event "),n+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===eo.full?", ":",")+") ",e!==eo.sighash&&this.anonymous&&(n+="anonymous "),n.trim()}static from(e){return typeof e=="string"?tg.fromString(e):tg.fromObject(e)}static fromObject(e){if(tg.isEventFragment(e))return e;e.type!=="event"&&Ns.throwArgumentError("invalid event object","value",e);const n={name:sT(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(vu.fromObject):[],type:"event"};return new tg(I1,n)}static fromString(e){let n=e.match(oT);n||Ns.throwArgumentError("invalid event string","value",e);let i=!1;return n[3].split(" ").forEach(s=>{switch(s.trim()){case"anonymous":i=!0;break;case"":break;default:Ns.warn("unknown modifier: "+s)}}),tg.fromObject({name:n[1].trim(),anonymous:i,inputs:iT(n[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function Xee(r,e){e.gas=null;let n=r.split("@");return n.length!==1?(n.length>2&&Ns.throwArgumentError("invalid human-readable ABI signature","value",r),n[1].match(/^[0-9]+$/)||Ns.throwArgumentError("invalid human-readable ABI signature gas","value",r),e.gas=zi.from(n[1]),n[0]):r}function Jee(r,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",r.split(" ").forEach(n=>{switch(n.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+n)}})}function Qee(r){let e={constant:!1,payable:!0,stateMutability:"payable"};return r.stateMutability!=null?(e.stateMutability=r.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",r.constant!=null&&!!r.constant!==e.constant&&Ns.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",r),e.payable=e.stateMutability==="payable",r.payable!=null&&!!r.payable!==e.payable&&Ns.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",r)):r.payable!=null?(e.payable=!!r.payable,r.constant==null&&!e.payable&&r.type!=="constructor"&&Ns.throwArgumentError("unable to determine stateMutability","value",r),e.constant=!!r.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Ns.throwArgumentError("cannot have constant payable function","value",r)):r.constant!=null?(e.constant=!!r.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):r.type!=="constructor"&&Ns.throwArgumentError("unable to determine stateMutability","value",r),e}class _0 extends eg{format(e){if(e||(e=eo.sighash),eo[e]||Ns.throwArgumentError("invalid format type","format",e),e===eo.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});e===eo.sighash&&Ns.throwError("cannot format a constructor for sighash",Yn.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let n="constructor("+this.inputs.map(i=>i.format(e)).join(e===eo.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(n+=this.stateMutability+" "),n.trim()}static from(e){return typeof e=="string"?_0.fromString(e):_0.fromObject(e)}static fromObject(e){if(_0.isConstructorFragment(e))return e;e.type!=="constructor"&&Ns.throwArgumentError("invalid constructor object","value",e);let n=Qee(e);n.constant&&Ns.throwArgumentError("constructor cannot be constant","value",e);const i={name:null,type:e.type,inputs:e.inputs?e.inputs.map(vu.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:e.gas?zi.from(e.gas):null};return new _0(I1,i)}static fromString(e){let n={type:"constructor"};e=Xee(e,n);let i=e.match(oT);return(!i||i[1].trim()!=="constructor")&&Ns.throwArgumentError("invalid constructor string","value",e),n.inputs=iT(i[2].trim(),!1),Jee(i[3].trim(),n),_0.fromObject(n)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class E0 extends _0{format(e){if(e||(e=eo.sighash),eo[e]||Ns.throwArgumentError("invalid format type","format",e),e===eo.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e))),outputs:this.outputs.map(i=>JSON.parse(i.format(e)))});let n="";return e!==eo.sighash&&(n+="function "),n+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===eo.full?", ":",")+") ",e!==eo.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(n+=this.stateMutability+" "):this.constant&&(n+="view "),this.outputs&&this.outputs.length&&(n+="returns ("+this.outputs.map(i=>i.format(e)).join(", ")+") "),this.gas!=null&&(n+="@"+this.gas.toString()+" ")),n.trim()}static from(e){return typeof e=="string"?E0.fromString(e):E0.fromObject(e)}static fromObject(e){if(E0.isFunctionFragment(e))return e;e.type!=="function"&&Ns.throwArgumentError("invalid function object","value",e);let n=Qee(e);const i={type:e.type,name:sT(e.name),constant:n.constant,inputs:e.inputs?e.inputs.map(vu.fromObject):[],outputs:e.outputs?e.outputs.map(vu.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:e.gas?zi.from(e.gas):null};return new E0(I1,i)}static fromString(e){let n={type:"function"};e=Xee(e,n);let i=e.split(" returns ");i.length>2&&Ns.throwArgumentError("invalid function string","value",e);let s=i[0].match(oT);if(s||Ns.throwArgumentError("invalid function signature","value",e),n.name=s[1].trim(),n.name&&sT(n.name),n.inputs=iT(s[2],!1),Jee(s[3].trim(),n),i.length>1){let o=i[1].match(oT);(o[1].trim()!=""||o[3].trim()!="")&&Ns.throwArgumentError("unexpected tokens","value",e),n.outputs=iT(o[2],!1)}else n.outputs=[];return E0.fromObject(n)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function ete(r){const e=r.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Ns.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",r),r}class om extends eg{format(e){if(e||(e=eo.sighash),eo[e]||Ns.throwArgumentError("invalid format type","format",e),e===eo.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let n="";return e!==eo.sighash&&(n+="error "),n+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===eo.full?", ":",")+") ",n.trim()}static from(e){return typeof e=="string"?om.fromString(e):om.fromObject(e)}static fromObject(e){if(om.isErrorFragment(e))return e;e.type!=="error"&&Ns.throwArgumentError("invalid error object","value",e);const n={type:e.type,name:sT(e.name),inputs:e.inputs?e.inputs.map(vu.fromObject):[]};return ete(new om(I1,n))}static fromString(e){let n={type:"error"},i=e.match(oT);return i||Ns.throwArgumentError("invalid error signature","value",e),n.name=i[1].trim(),n.name&&sT(n.name),n.inputs=iT(i[2],!1),ete(om.fromObject(n))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function S2(r){return r.match(/^uint($|[^1-9])/)?r="uint256"+r.substring(4):r.match(/^int($|[^1-9])/)&&(r="int256"+r.substring(3)),r}const kIe=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function sT(r){return(!r||!r.match(kIe))&&Ns.throwArgumentError(`invalid identifier "${r}"`,"value",r),r}const oT=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function RIe(r){r=r.trim();let e=[],n="",i=0;for(let s=0;s<r.length;s++){let o=r[s];o===","&&i===0?(e.push(n),n=""):(n+=o,o==="("?i++:o===")"&&(i--,i===-1&&Ns.throwArgumentError("unbalanced parenthesis","value",r)))}return n&&e.push(n),e}const aT=new Yn(eT),CIe=new RegExp(/^bytes([0-9]*)$/),xIe=new RegExp(/^(u?int)([0-9]*)$/);class kC{constructor(e){aT.checkNew(new.target,kC),bi(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new dIe(e.name);case"bool":return new gIe(e.name);case"string":return new EIe(e.name);case"bytes":return new yIe(e.name);case"array":return new pIe(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new TC((e.components||[]).map(i=>this._getCoder(i)),e.name);case"":return new bIe(e.name)}let n=e.type.match(xIe);if(n){let i=parseInt(n[2]||"256");return(i===0||i>256||i%8!==0)&&aT.throwArgumentError("invalid "+n[1]+" bit length","param",e),new _Ie(i/8,n[1]==="int",e.name)}if(n=e.type.match(CIe),n){let i=parseInt(n[1]);return(i===0||i>32)&&aT.throwArgumentError("invalid bytes length","param",e),new mIe(i,e.name)}return aT.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,n){return new EC(e,this._getWordSize(),this.coerceFunc,n)}_getWriter(){return new xM(this._getWordSize())}getDefaultValue(e){const n=e.map(s=>this._getCoder(vu.from(s)));return new TC(n,"_").defaultValue()}encode(e,n){e.length!==n.length&&aT.throwError("types/values length mismatch",Yn.errors.INVALID_ARGUMENT,{count:{types:e.length,values:n.length},value:{types:e,values:n}});const i=e.map(a=>this._getCoder(vu.from(a))),s=new TC(i,"_"),o=this._getWriter();return s.encode(o,n),o.data}decode(e,n,i){const s=e.map(a=>this._getCoder(vu.from(a)));return new TC(s,"_").decode(this._getReader(fo(n),i))}}const BIe=new kC,ea=new Yn(eT);class OIe extends QE{}class PIe extends QE{}class NIe extends QE{}class MM extends QE{static isIndexed(e){return!!(e&&e._isIndexed)}}const MIe={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function tte(r,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${r}`);return n.error=e,n}class am{constructor(e){ea.checkNew(new.target,am);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,bi(this,"fragments",n.map(i=>eg.from(i)).filter(i=>i!=null)),bi(this,"_abiCoder",JE(new.target,"getAbiCoder")()),bi(this,"functions",{}),bi(this,"errors",{}),bi(this,"events",{}),bi(this,"structs",{}),this.fragments.forEach(i=>{let s=null;switch(i.type){case"constructor":if(this.deploy){ea.warn("duplicate definition - constructor");return}bi(this,"deploy",i);return;case"function":s=this.functions;break;case"event":s=this.events;break;case"error":s=this.errors;break;default:return}let o=i.format();if(s[o]){ea.warn("duplicate definition - "+o);return}s[o]=i}),this.deploy||bi(this,"deploy",_0.from({payable:!1,type:"constructor"})),bi(this,"_isInterface",!0)}format(e){e||(e=eo.full),e===eo.sighash&&ea.throwArgumentError("interface does not support formatting sighash","format",e);const n=this.fragments.map(i=>i.format(e));return e===eo.json?JSON.stringify(n.map(i=>JSON.parse(i))):n}static getAbiCoder(){return BIe}static getAddress(e){return Gu(e)}static getSighash(e){return Oee(E2(e.format()),0,4)}static getEventTopic(e){return E2(e.format())}getFunction(e){if(Qo(e)){for(const i in this.functions)if(e===this.getSighash(i))return this.functions[i];ea.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const i=e.trim(),s=Object.keys(this.functions).filter(o=>o.split("(")[0]===i);return s.length===0?ea.throwArgumentError("no matching function","name",i):s.length>1&&ea.throwArgumentError("multiple matching functions","name",i),this.functions[s[0]]}const n=this.functions[E0.fromString(e).format()];return n||ea.throwArgumentError("no matching function","signature",e),n}getEvent(e){if(Qo(e)){const i=e.toLowerCase();for(const s in this.events)if(i===this.getEventTopic(s))return this.events[s];ea.throwArgumentError("no matching event","topichash",i)}if(e.indexOf("(")===-1){const i=e.trim(),s=Object.keys(this.events).filter(o=>o.split("(")[0]===i);return s.length===0?ea.throwArgumentError("no matching event","name",i):s.length>1&&ea.throwArgumentError("multiple matching events","name",i),this.events[s[0]]}const n=this.events[tg.fromString(e).format()];return n||ea.throwArgumentError("no matching event","signature",e),n}getError(e){if(Qo(e)){const i=JE(this.constructor,"getSighash");for(const s in this.errors){const o=this.errors[s];if(e===i(o))return this.errors[s]}ea.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const i=e.trim(),s=Object.keys(this.errors).filter(o=>o.split("(")[0]===i);return s.length===0?ea.throwArgumentError("no matching error","name",i):s.length>1&&ea.throwArgumentError("multiple matching errors","name",i),this.errors[s[0]]}const n=this.errors[E0.fromString(e).format()];return n||ea.throwArgumentError("no matching error","signature",e),n}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(n){try{e=this.getError(e)}catch{throw n}}return JE(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),JE(this.constructor,"getEventTopic")(e)}_decodeParams(e,n){return this._abiCoder.decode(e,n)}_encodeParams(e,n){return this._abiCoder.encode(e,n)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,n){typeof e=="string"&&(e=this.getError(e));const i=fo(n);return ks(i.slice(0,4))!==this.getSighash(e)&&ea.throwArgumentError(`data signature does not match error ${e.name}.`,"data",ks(i)),this._decodeParams(e.inputs,i.slice(4))}encodeErrorResult(e,n){return typeof e=="string"&&(e=this.getError(e)),ks(E1([this.getSighash(e),this._encodeParams(e.inputs,n||[])]))}decodeFunctionData(e,n){typeof e=="string"&&(e=this.getFunction(e));const i=fo(n);return ks(i.slice(0,4))!==this.getSighash(e)&&ea.throwArgumentError(`data signature does not match function ${e.name}.`,"data",ks(i)),this._decodeParams(e.inputs,i.slice(4))}encodeFunctionData(e,n){return typeof e=="string"&&(e=this.getFunction(e)),ks(E1([this.getSighash(e),this._encodeParams(e.inputs,n||[])]))}decodeFunctionResult(e,n){typeof e=="string"&&(e=this.getFunction(e));let i=fo(n),s=null,o=null,a=null,u=null;switch(i.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,i)}catch{}break;case 4:{const l=ks(i.slice(0,4)),g=MIe[l];if(g)o=this._abiCoder.decode(g.inputs,i.slice(4)),a=g.name,u=g.signature,g.reason&&(s=o[0]);else try{const y=this.getError(l);o=this._abiCoder.decode(y.inputs,i.slice(4)),a=y.name,u=y.format()}catch(y){console.log(y)}break}}return ea.throwError("call revert exception",Yn.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:o,errorName:a,errorSignature:u,reason:s})}encodeFunctionResult(e,n){return typeof e=="string"&&(e=this.getFunction(e)),ks(this._abiCoder.encode(e.outputs,n||[]))}encodeFilterTopics(e,n){typeof e=="string"&&(e=this.getEvent(e)),n.length>e.inputs.length&&ea.throwError("too many arguments for "+e.format(),Yn.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:n});let i=[];e.anonymous||i.push(this.getEventTopic(e));const s=(o,a)=>o.type==="string"?E2(a):o.type==="bytes"?nT(ks(a)):(o.type==="address"&&this._abiCoder.encode(["address"],[a]),Xp(ks(a),32));for(n.forEach((o,a)=>{let u=e.inputs[a];if(!u.indexed){o!=null&&ea.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+u.name,o);return}o==null?i.push(null):u.baseType==="array"||u.baseType==="tuple"?ea.throwArgumentError("filtering with tuples or arrays not supported","contract."+u.name,o):Array.isArray(o)?i.push(o.map(l=>s(u,l))):i.push(s(u,o))});i.length&&i[i.length-1]===null;)i.pop();return i}encodeEventLog(e,n){typeof e=="string"&&(e=this.getEvent(e));const i=[],s=[],o=[];return e.anonymous||i.push(this.getEventTopic(e)),n.length!==e.inputs.length&&ea.throwArgumentError("event arguments/values mismatch","values",n),e.inputs.forEach((a,u)=>{const l=n[u];if(a.indexed)if(a.type==="string")i.push(E2(l));else if(a.type==="bytes")i.push(nT(l));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");i.push(this._abiCoder.encode([a.type],[l]))}else s.push(a),o.push(l)}),{data:this._abiCoder.encode(s,o),topics:i}}decodeEventLog(e,n,i){if(typeof e=="string"&&(e=this.getEvent(e)),i!=null&&!e.anonymous){let I=this.getEventTopic(e);(!Qo(i[0],32)||i[0].toLowerCase()!==I)&&ea.throwError("fragment/topic mismatch",Yn.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:I,value:i[0]}),i=i.slice(1)}let s=[],o=[],a=[];e.inputs.forEach((I,P)=>{I.indexed?I.type==="string"||I.type==="bytes"||I.baseType==="tuple"||I.baseType==="array"?(s.push(vu.fromObject({type:"bytes32",name:I.name})),a.push(!0)):(s.push(I),a.push(!1)):(o.push(I),a.push(!1))});let u=i!=null?this._abiCoder.decode(s,E1(i)):null,l=this._abiCoder.decode(o,n,!0),g=[],y=0,A=0;e.inputs.forEach((I,P)=>{if(I.indexed)if(u==null)g[P]=new MM({_isIndexed:!0,hash:null});else if(a[P])g[P]=new MM({_isIndexed:!0,hash:u[A++]});else try{g[P]=u[A++]}catch(D){g[P]=D}else try{g[P]=l[y++]}catch(D){g[P]=D}if(I.name&&g[I.name]==null){const D=g[P];D instanceof Error?Object.defineProperty(g,I.name,{get:()=>{throw tte(`property ${JSON.stringify(I.name)}`,D)}}):g[I.name]=D}});for(let I=0;I<g.length;I++){const P=g[I];P instanceof Error&&Object.defineProperty(g,I,{get:()=>{throw tte(`index ${I}`,P)}})}return Object.freeze(g)}parseTransaction(e){let n=this.getFunction(e.data.substring(0,10).toLowerCase());return n?new PIe({args:this._abiCoder.decode(n.inputs,"0x"+e.data.substring(10)),functionFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n),value:zi.from(e.value||"0")}):null}parseLog(e){let n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new OIe({eventFragment:n,name:n.name,signature:n.format(),topic:this.getEventTopic(n),args:this.decodeEventLog(n,e.data,e.topics)})}parseError(e){const n=ks(e);let i=this.getError(n.substring(0,10).toLowerCase());return i?new NIe({args:this._abiCoder.decode(i.inputs,"0x"+n.substring(10)),errorFragment:i,name:i.name,signature:i.format(),sighash:this.getSighash(i)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const LIe="abstract-provider/5.4.0";var DIe=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};const uT=new Yn(LIe);class LM extends QE{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Iet extends LM{constructor(e,n){Qo(e,32)||uT.throwArgumentError("invalid blockHash","blockHash",e),super({_isForkEvent:!0,_isBlockForkEvent:!0,expiry:n||0,blockHash:e})}}class ket extends LM{constructor(e,n){Qo(e,32)||uT.throwArgumentError("invalid transaction hash","hash",e),super({_isForkEvent:!0,_isTransactionForkEvent:!0,expiry:n||0,hash:e})}}class Ret extends LM{constructor(e,n,i){Qo(e,32)||uT.throwArgumentError("invalid transaction hash","beforeHash",e),Qo(n,32)||uT.throwArgumentError("invalid transaction hash","afterHash",n),super({_isForkEvent:!0,_isTransactionOrderForkEvent:!0,expiry:i||0,beforeHash:e,afterHash:n})}}class DM{constructor(){uT.checkAbstract(new.target,DM),bi(this,"_isProvider",!0)}getFeeData(){return DIe(this,void 0,void 0,function*(){const{block:e,gasPrice:n}=yield im({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let i=null,s=null;return e&&e.baseFeePerGas&&(s=zi.from("1000000000"),i=e.baseFeePerGas.mul(2).add(s)),{maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:n}})}addListener(e,n){return this.on(e,n)}removeListener(e,n){return this.off(e,n)}static isProvider(e){return!!(e&&e._isProvider)}}const UIe="abstract-signer/5.4.0";var T0=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};const Sf=new Yn(UIe),FIe=["accessList","chainId","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],WIe=[Yn.errors.INSUFFICIENT_FUNDS,Yn.errors.NONCE_EXPIRED,Yn.errors.REPLACEMENT_UNDERPRICED];class RC{constructor(){Sf.checkAbstract(new.target,RC),bi(this,"_isSigner",!0)}getBalance(e){return T0(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return T0(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return T0(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const n=yield im(this.checkTransaction(e));return yield this.provider.estimateGas(n)})}call(e,n){return T0(this,void 0,void 0,function*(){this._checkProvider("call");const i=yield im(this.checkTransaction(e));return yield this.provider.call(i,n)})}sendTransaction(e){return this._checkProvider("sendTransaction"),this.populateTransaction(e).then(n=>this.signTransaction(n).then(i=>this.provider.sendTransaction(i)))}getChainId(){return T0(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return T0(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return T0(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return T0(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const i in e)FIe.indexOf(i)===-1&&Sf.throwArgumentError("invalid transaction key: "+i,"transaction",e);const n=S1(e);return n.from==null?n.from=this.getAddress():n.from=Promise.all([Promise.resolve(n.from),this.getAddress()]).then(i=>(i[0].toLowerCase()!==i[1].toLowerCase()&&Sf.throwArgumentError("from address mismatch","transaction",e),i[0])),n}populateTransaction(e){return T0(this,void 0,void 0,function*(){const n=yield im(this.checkTransaction(e));n.to!=null&&(n.to=Promise.resolve(n.to).then(s=>T0(this,void 0,void 0,function*(){if(s==null)return null;const o=yield this.resolveName(s);return o==null&&Sf.throwArgumentError("provided ENS name resolves to null","tx.to",s),o})));const i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?Sf.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(n.type===0||n.type===1)&&i&&Sf.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1)n.gasPrice==null&&(n.gasPrice=this.getGasPrice());else{const s=yield this.getFeeData();if(n.type==null)if(s.maxFeePerGas!=null&&s.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=s.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=s.maxPriorityFeePerGas);else s.gasPrice!=null?(i&&Sf.throwError("network does not support EIP-1559",Yn.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=s.gasPrice),n.type=0):Sf.throwError("failed to get consistent fee data",Yn.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=s.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=s.maxPriorityFeePerGas))}return n.nonce==null&&(n.nonce=this.getTransactionCount("pending")),n.gasLimit==null&&(n.gasLimit=this.estimateGas(n).catch(s=>{if(WIe.indexOf(s.code)>=0)throw s;return Sf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Yn.errors.UNPREDICTABLE_GAS_LIMIT,{error:s,tx:n})})),n.chainId==null?n.chainId=this.getChainId():n.chainId=Promise.all([Promise.resolve(n.chainId),this.getChainId()]).then(s=>(s[1]!==0&&s[0]!==s[1]&&Sf.throwArgumentError("chainId address mismatch","transaction",e),s[0])),yield im(n)})}_checkProvider(e){this.provider||Sf.throwError("missing provider",Yn.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class CC extends RC{constructor(e,n){Sf.checkNew(new.target,CC),super(),bi(this,"address",e),bi(this,"provider",n||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,n){return Promise.resolve().then(()=>{Sf.throwError(e,Yn.errors.UNSUPPORTED_OPERATION,{operation:n})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,n,i){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new CC(this.address,e)}}const HIe="transactions/5.4.0",Ec=new Yn(HIe);var rte;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(rte||(rte={}));function UM(r){return r==="0x"?null:getAddress(r)}function Tc(r){return r==="0x"?Zero:BigNumber.from(r)}const zIe=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],$Ie={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function VIe(r){const e=computePublicKey(r);return getAddress(hexDataSlice(keccak256(hexDataSlice(e,1)),12))}function nte(r,e){return VIe(recoverPublicKey(arrayify(r),e))}function If(r,e){const n=Yp(zi.from(r).toHexString());return n.length>32&&Ec.throwArgumentError("invalid length for "+e,"transaction:"+e,r),n}function FM(r,e){return{address:Gu(r),storageKeys:(e||[]).map((n,i)=>(USe(n)!==32&&Ec.throwArgumentError("invalid access list storageKey",`accessList[${r}:${i}]`,n),n.toLowerCase()))}}function xC(r){if(Array.isArray(r))return r.map((n,i)=>Array.isArray(n)?(n.length>2&&Ec.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${i}]`,n),FM(n[0],n[1])):FM(n.address,n.storageKeys));const e=Object.keys(r).map(n=>{const i=r[n].reduce((s,o)=>(s[o]=!0,s),{});return FM(n,Object.keys(i).sort())});return e.sort((n,i)=>n.address.localeCompare(i.address)),e}function ite(r){return xC(r).map(e=>[e.address,e.storageKeys])}function ste(r,e){if(r.gasPrice!=null){const i=zi.from(r.gasPrice),s=zi.from(r.maxFeePerGas||0);i.eq(s)||Ec.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:i,maxFeePerGas:s})}const n=[If(r.chainId||0,"chainId"),If(r.nonce||0,"nonce"),If(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),If(r.maxFeePerGas||0,"maxFeePerGas"),If(r.gasLimit||0,"gasLimit"),r.to!=null?Gu(r.to):"0x",If(r.value||0,"value"),r.data||"0x",ite(r.accessList||[])];if(e){const i=AC(e);n.push(If(i.recoveryParam,"recoveryParam")),n.push(Yp(i.r)),n.push(Yp(i.s))}return T1(["0x02",tT(n)])}function ote(r,e){const n=[If(r.chainId||0,"chainId"),If(r.nonce||0,"nonce"),If(r.gasPrice||0,"gasPrice"),If(r.gasLimit||0,"gasLimit"),r.to!=null?Gu(r.to):"0x",If(r.value||0,"value"),r.data||"0x",ite(r.accessList||[])];if(e){const i=AC(e);n.push(If(i.recoveryParam,"recoveryParam")),n.push(Yp(i.r)),n.push(Yp(i.s))}return T1(["0x01",tT(n)])}function jIe(r,e){GSe(r,$Ie);const n=[];zIe.forEach(function(a){let u=r[a.name]||[];const l={};a.numeric&&(l.hexPad="left"),u=fo(ks(u,l)),a.length&&u.length!==a.length&&u.length>0&&Ec.throwArgumentError("invalid length for "+a.name,"transaction:"+a.name,u),a.maxLength&&(u=Yp(u),u.length>a.maxLength&&Ec.throwArgumentError("invalid length for "+a.name,"transaction:"+a.name,u)),n.push(ks(u))});let i=0;if(r.chainId!=null?(i=r.chainId,typeof i!="number"&&Ec.throwArgumentError("invalid transaction.chainId","transaction",r)):e&&!IM(e)&&e.v>28&&(i=Math.floor((e.v-35)/2)),i!==0&&(n.push(ks(i)),n.push("0x"),n.push("0x")),!e)return tT(n);const s=AC(e);let o=27+s.recoveryParam;return i!==0?(n.pop(),n.pop(),n.pop(),o+=i*2+8,s.v>28&&s.v!==o&&Ec.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):s.v!==o&&Ec.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),n.push(ks(o)),n.push(Yp(fo(s.r))),n.push(Yp(fo(s.s))),tT(n)}function ate(r,e){if(r.type==null||r.type===0)return r.accessList!=null&&Ec.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",r),jIe(r,e);switch(r.type){case 1:return ote(r,e);case 2:return ste(r,e);default:break}return Ec.throwError(`unsupported transaction type: ${r.type}`,Yn.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:r.type})}function ute(r,e,n){try{const i=Tc(e[0]).toNumber();if(i!==0&&i!==1)throw new Error("bad recid");r.v=i}catch{Ec.throwArgumentError("invalid v for transaction type: 1","v",e[0])}r.r=hexZeroPad(e[1],32),r.s=hexZeroPad(e[2],32);try{const i=keccak256(n(r));r.from=nte(i,{r:r.r,s:r.s,recoveryParam:r.v})}catch(i){console.log(i)}}function KIe(r){const e=RLP.decode(r.slice(1));e.length!==9&&e.length!==12&&Ec.throwArgumentError("invalid component count for transaction type: 2","payload",hexlify(r));const n=Tc(e[2]),i=Tc(e[3]),s={type:2,chainId:Tc(e[0]).toNumber(),nonce:Tc(e[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:i,gasPrice:null,gasLimit:Tc(e[4]),to:UM(e[5]),value:Tc(e[6]),data:e[7],accessList:xC(e[8])};return e.length===9||(s.hash=keccak256(r),ute(s,e.slice(9),ste)),s}function GIe(r){const e=RLP.decode(r.slice(1));e.length!==8&&e.length!==11&&Ec.throwArgumentError("invalid component count for transaction type: 1","payload",hexlify(r));const n={type:1,chainId:Tc(e[0]).toNumber(),nonce:Tc(e[1]).toNumber(),gasPrice:Tc(e[2]),gasLimit:Tc(e[3]),to:UM(e[4]),value:Tc(e[5]),data:e[6],accessList:xC(e[7])};return e.length===8||(n.hash=keccak256(r),ute(n,e.slice(8),ote)),n}function qIe(r){const e=RLP.decode(r);e.length!==9&&e.length!==6&&Ec.throwArgumentError("invalid raw transaction","rawTransaction",r);const n={nonce:Tc(e[0]).toNumber(),gasPrice:Tc(e[1]),gasLimit:Tc(e[2]),to:UM(e[3]),value:Tc(e[4]),data:e[5],chainId:0};if(e.length===6)return n;try{n.v=BigNumber.from(e[6]).toNumber()}catch(i){return console.log(i),n}if(n.r=hexZeroPad(e[7],32),n.s=hexZeroPad(e[8],32),BigNumber.from(n.r).isZero()&&BigNumber.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let i=n.v-27;const s=e.slice(0,6);n.chainId!==0&&(s.push(hexlify(n.chainId)),s.push("0x"),s.push("0x"),i-=n.chainId*2+8);const o=keccak256(RLP.encode(s));try{n.from=nte(o,{r:hexlify(n.r),s:hexlify(n.s),recoveryParam:i})}catch(a){console.log(a)}n.hash=keccak256(r)}return n.type=null,n}function Cet(r){const e=arrayify(r);if(e[0]>127)return qIe(e);switch(e[0]){case 1:return GIe(e);case 2:return KIe(e);default:break}return Ec.throwError(`unsupported transaction type: ${e[0]}`,Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const ZIe="contracts/5.4.0";var um=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};const Uo=new Yn(ZIe),YIe=null;function BC(r,e){return um(this,void 0,void 0,function*(){const n=yield e;try{return Gu(n)}catch{}r||Uo.throwError("a provider or signer is needed to resolve ENS names",Yn.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const i=yield r.resolveName(n);return i==null&&Uo.throwArgumentError("resolver or addr is not configured for ENS name","name",n),i})}function cT(r,e,n){return um(this,void 0,void 0,function*(){return Array.isArray(n)?yield Promise.all(n.map((i,s)=>cT(r,Array.isArray(e)?e[s]:e[i.name],i))):n.type==="address"?yield BC(r,e):n.type==="tuple"?yield cT(r,e,n.components):n.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(i=>cT(r,i,n.arrayChildren))):Promise.reject(new Error("invalid value for array")):e})}function OC(r,e,n){return um(this,void 0,void 0,function*(){let i={};n.length===e.inputs.length+1&&typeof n[n.length-1]=="object"&&(i=S1(n.pop())),Uo.checkArgumentCount(n.length,e.inputs.length,"passed to contract"),r.signer?i.from?i.from=im({override:BC(r.signer,i.from),signer:r.signer.getAddress()}).then(g=>um(this,void 0,void 0,function*(){return Gu(g.signer)!==g.override&&Uo.throwError("Contract with a Signer cannot override from",Yn.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),g.override})):i.from=r.signer.getAddress():i.from&&(i.from=BC(r.provider,i.from));const s=yield im({args:cT(r.signer||r.provider,n,e.inputs),address:r.resolvedAddress,overrides:im(i)||{}}),o=r.interface.encodeFunctionData(e,s.args),a={data:o,to:s.address},u=s.overrides;if(u.nonce!=null&&(a.nonce=zi.from(u.nonce).toNumber()),u.gasLimit!=null&&(a.gasLimit=zi.from(u.gasLimit)),u.gasPrice!=null&&(a.gasPrice=zi.from(u.gasPrice)),u.maxFeePerGas!=null&&(a.maxFeePerGas=zi.from(u.maxFeePerGas)),u.maxPriorityFeePerGas!=null&&(a.maxPriorityFeePerGas=zi.from(u.maxPriorityFeePerGas)),u.from!=null&&(a.from=u.from),u.type!=null&&(a.type=u.type),u.accessList!=null&&(a.accessList=xC(u.accessList)),a.gasLimit==null&&e.gas!=null){let g=21e3;const y=fo(o);for(let A=0;A<y.length;A++)g+=4,y[A]&&(g+=64);a.gasLimit=zi.from(e.gas).add(g)}if(u.value){const g=zi.from(u.value);!g.isZero()&&!e.payable&&Uo.throwError("non-payable method cannot override value",Yn.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:i.value}),a.value=g}delete i.nonce,delete i.gasLimit,delete i.gasPrice,delete i.from,delete i.value,delete i.type,delete i.accessList,delete i.maxFeePerGas,delete i.maxPriorityFeePerGas;const l=Object.keys(i).filter(g=>i[g]!=null);return l.length&&Uo.throwError(`cannot override ${l.map(g=>JSON.stringify(g)).join(",")}`,Yn.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),a})}function XIe(r,e){return function(...n){return OC(r,e,n)}}function JIe(r,e){const n=r.signer||r.provider;return function(...i){return um(this,void 0,void 0,function*(){n||Uo.throwError("estimate require a provider or signer",Yn.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const s=yield OC(r,e,i);return yield n.estimateGas(s)})}}function cte(r,e,n){const i=r.signer||r.provider;return function(...s){return um(this,void 0,void 0,function*(){let o;if(s.length===e.inputs.length+1&&typeof s[s.length-1]=="object"){const l=S1(s.pop());l.blockTag!=null&&(o=yield l.blockTag),delete l.blockTag,s.push(l)}r.deployTransaction!=null&&(yield r._deployed(o));const a=yield OC(r,e,s),u=yield i.call(a,o);try{let l=r.interface.decodeFunctionResult(e,u);return n&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===Yn.errors.CALL_EXCEPTION&&(l.address=r.address,l.args=s,l.transaction=a),l}})}}function QIe(r,e){return function(...n){return um(this,void 0,void 0,function*(){r.signer||Uo.throwError("sending a transaction requires a signer",Yn.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),r.deployTransaction!=null&&(yield r._deployed());const i=yield OC(r,e,n),s=yield r.signer.sendTransaction(i),o=s.wait.bind(s);return s.wait=a=>o(a).then(u=>(u.events=u.logs.map(l=>{let g=_2(l),y=null;try{y=r.interface.parseLog(l)}catch{}return y&&(g.args=y.args,g.decode=(A,I)=>r.interface.decodeEventLog(y.eventFragment,A,I),g.event=y.name,g.eventSignature=y.signature),g.removeListener=()=>r.provider,g.getBlock=()=>r.provider.getBlock(u.blockHash),g.getTransaction=()=>r.provider.getTransaction(u.transactionHash),g.getTransactionReceipt=()=>Promise.resolve(u),g}),u)),s})}}function lte(r,e,n){return e.constant?cte(r,e,n):QIe(r,e)}function fte(r){return r.address&&(r.topics==null||r.topics.length===0)?"*":(r.address||"*")+"@"+(r.topics?r.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class lT{constructor(e,n){bi(this,"tag",e),bi(this,"filter",n),this._listeners=[]}addListener(e,n){this._listeners.push({listener:e,once:n})}removeListener(e){let n=!1;this._listeners=this._listeners.filter(i=>n||i.listener!==e?!0:(n=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const n=this.listenerCount();return this._listeners=this._listeners.filter(i=>{const s=e.slice();return setTimeout(()=>{i.listener.apply(this,s)},0),!i.once}),n}prepareEvent(e){}getEmit(e){return[e]}}class e3e extends lT{constructor(){super("error",null)}}class dte extends lT{constructor(e,n,i,s){const o={address:e};let a=n.getEventTopic(i);s?(a!==s[0]&&Uo.throwArgumentError("topic mismatch","topics",s),o.topics=s.slice()):o.topics=[a],super(fte(o),o),bi(this,"address",e),bi(this,"interface",n),bi(this,"fragment",i)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(n,i)=>this.interface.decodeEventLog(this.fragment,n,i);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(n){e.args=null,e.decodeError=n}}getEmit(e){const n=YSe(e.args);if(n.length)throw n[0].error;const i=(e.args||[]).slice();return i.push(e),i}}class hte extends lT{constructor(e,n){super("*",{address:e}),bi(this,"address",e),bi(this,"interface",n)}prepareEvent(e){super.prepareEvent(e);try{const n=this.interface.parseLog(e);e.event=n.name,e.eventSignature=n.signature,e.decode=(i,s)=>this.interface.decodeEventLog(n.eventFragment,i,s),e.args=n.args}catch{}}}class t3e{constructor(e,n,i){Uo.checkNew(new.target,fT),bi(this,"interface",JE(new.target,"getInterface")(n)),i==null?(bi(this,"provider",null),bi(this,"signer",null)):RC.isSigner(i)?(bi(this,"provider",i.provider||null),bi(this,"signer",i)):DM.isProvider(i)?(bi(this,"provider",i),bi(this,"signer",null)):Uo.throwArgumentError("invalid signer or provider","signerOrProvider",i),bi(this,"callStatic",{}),bi(this,"estimateGas",{}),bi(this,"functions",{}),bi(this,"populateTransaction",{}),bi(this,"filters",{});{const a={};Object.keys(this.interface.events).forEach(u=>{const l=this.interface.events[u];bi(this.filters,u,(...g)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,g)})),a[l.name]||(a[l.name]=[]),a[l.name].push(u)}),Object.keys(a).forEach(u=>{const l=a[u];l.length===1?bi(this.filters,u,this.filters[l[0]]):Uo.warn(`Duplicate definition of ${u} (${l.join(", ")})`)})}if(bi(this,"_runningEvents",{}),bi(this,"_wrappedEmits",{}),e==null&&Uo.throwArgumentError("invalid contract address or ENS name","addressOrName",e),bi(this,"address",e),this.provider)bi(this,"resolvedAddress",BC(this.provider,e));else try{bi(this,"resolvedAddress",Promise.resolve(Gu(e)))}catch{Uo.throwError("provider is required to use ENS name as contract address",Yn.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}const s={},o={};Object.keys(this.interface.functions).forEach(a=>{const u=this.interface.functions[a];if(o[a]){Uo.warn(`Duplicate ABI entry for ${JSON.stringify(a)}`);return}o[a]=!0;{const l=u.name;s[l]||(s[l]=[]),s[l].push(a)}this[a]==null&&bi(this,a,lte(this,u,!0)),this.functions[a]==null&&bi(this.functions,a,lte(this,u,!1)),this.callStatic[a]==null&&bi(this.callStatic,a,cte(this,u,!0)),this.populateTransaction[a]==null&&bi(this.populateTransaction,a,XIe(this,u)),this.estimateGas[a]==null&&bi(this.estimateGas,a,JIe(this,u))}),Object.keys(s).forEach(a=>{const u=s[a];if(u.length>1)return;const l=u[0];try{this[a]==null&&bi(this,a,this[l])}catch{}this.functions[a]==null&&bi(this.functions,a,this.functions[l]),this.callStatic[a]==null&&bi(this.callStatic,a,this.callStatic[l]),this.populateTransaction[a]==null&&bi(this.populateTransaction,a,this.populateTransaction[l]),this.estimateGas[a]==null&&bi(this.estimateGas,a,this.estimateGas[l])})}static getContractAddress(e){return nIe(e)}static getInterface(e){return am.isInterface(e)?e:new am(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(n=>(n==="0x"&&Uo.throwError("contract not deployed",Yn.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Uo.throwError("sending a transactions require a signer",Yn.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const n=S1(e||{});return["from","to"].forEach(function(i){n[i]!=null&&Uo.throwError("cannot override "+i,Yn.errors.UNSUPPORTED_OPERATION,{operation:i})}),n.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(n))}connect(e){typeof e=="string"&&(e=new CC(e,this.provider));const n=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&bi(n,"deployTransaction",this.deployTransaction),n}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return MM.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new e3e);if(e==="event")return this._normalizeRunningEvent(new lT("event",null));if(e==="*")return this._normalizeRunningEvent(new hte(this.address,this.interface));const n=this.interface.getEvent(e);return this._normalizeRunningEvent(new dte(this.address,this.interface,n))}if(e.topics&&e.topics.length>0){try{const i=e.topics[0];if(typeof i!="string")throw new Error("invalid topic");const s=this.interface.getEvent(i);return this._normalizeRunningEvent(new dte(this.address,this.interface,s,e.topics))}catch{}const n={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new lT(fte(n),n))}return this._normalizeRunningEvent(new hte(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const n=this._wrappedEmits[e.tag];n&&e.filter&&(this.provider.off(e.filter,n),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,n,i){const s=_2(n);return s.removeListener=()=>{i&&(e.removeListener(i),this._checkRunningEvents(e))},s.getBlock=()=>this.provider.getBlock(n.blockHash),s.getTransaction=()=>this.provider.getTransaction(n.transactionHash),s.getTransactionReceipt=()=>this.provider.getTransactionReceipt(n.transactionHash),e.prepareEvent(s),s}_addEventListener(e,n,i){if(this.provider||Uo.throwError("events require a provider or a signer with a provider",Yn.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(n,i),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const s=o=>{let a=this._wrapEvent(e,o,n);if(a.decodeError==null)try{const u=e.getEmit(a);this.emit(e.filter,...u)}catch(u){a.decodeError=u.error}e.filter!=null&&this.emit("event",a),a.decodeError!=null&&this.emit("error",a.decodeError,a)};this._wrappedEmits[e.tag]=s,e.filter!=null&&this.provider.on(e.filter,s)}}queryFilter(e,n,i){const s=this._getRunningEvent(e),o=S1(s.filter);return typeof n=="string"&&Qo(n,32)?(i!=null&&Uo.throwArgumentError("cannot specify toBlock with blockhash","toBlock",i),o.blockHash=n):(o.fromBlock=n??0,o.toBlock=i??"latest"),this.provider.getLogs(o).then(a=>a.map(u=>this._wrapEvent(s,u,null)))}on(e,n){return this._addEventListener(this._getRunningEvent(e),n,!1),this}once(e,n){return this._addEventListener(this._getRunningEvent(e),n,!0),this}emit(e,...n){if(!this.provider)return!1;const i=this._getRunningEvent(e),s=i.run(n)>0;return this._checkRunningEvents(i),s}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((n,i)=>n+this._runningEvents[i].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const n=[];for(let i in this._runningEvents)this._runningEvents[i].listeners().forEach(s=>{n.push(s)});return n}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const i in this._runningEvents){const s=this._runningEvents[i];s.removeAllListeners(),this._checkRunningEvents(s)}return this}const n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}off(e,n){if(!this.provider)return this;const i=this._getRunningEvent(e);return i.removeListener(n),this._checkRunningEvents(i),this}removeListener(e,n){return this.off(e,n)}}class fT extends t3e{}class xet{constructor(e,n,i){let s=null;typeof n=="string"?s=n:isBytes(n)?s=hexlify(n):n&&typeof n.object=="string"?s=n.object:s="!",s.substring(0,2)!=="0x"&&(s="0x"+s),(!isHexString(s)||s.length%2)&&Uo.throwArgumentError("invalid bytecode","bytecode",n),i&&!Signer.isSigner(i)&&Uo.throwArgumentError("invalid signer","signer",i),defineReadOnly(this,"bytecode",s),defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(e)),defineReadOnly(this,"signer",i||null)}getDeployTransaction(...e){let n={};if(e.length===this.interface.deploy.inputs.length+1&&typeof e[e.length-1]=="object"){n=shallowCopy(e.pop());for(const i in n)if(!YIe[i])throw new Error("unknown transaction override "+i)}return["data","from","to"].forEach(i=>{n[i]!=null&&Uo.throwError("cannot override "+i,Logger.errors.UNSUPPORTED_OPERATION,{operation:i})}),Uo.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),n.data=hexlify(concat([this.bytecode,this.interface.encodeDeploy(e)])),n}deploy(...e){return um(this,void 0,void 0,function*(){let n={};e.length===this.interface.deploy.inputs.length+1&&(n=e.pop()),Uo.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const i=yield cT(this.signer,e,this.interface.deploy.inputs);i.push(n);const s=this.getDeployTransaction(...i),o=yield this.signer.sendTransaction(s),a=getStatic(this.constructor,"getContractAddress")(o),u=getStatic(this.constructor,"getContract")(a,this.interface,this.signer);return defineReadOnly(u,"deployTransaction",o),u})}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,n){e==null&&Uo.throwError("missing compiler output",Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),typeof e=="string"&&(e=JSON.parse(e));const i=e.abi;let s=null;return e.bytecode?s=e.bytecode:e.evm&&e.evm.bytecode&&(s=e.evm.bytecode),new this(i,s,n)}static getInterface(e){return fT.getInterface(e)}static getContractAddress(e){return getContractAddress(e)}static getContract(e,n,i){return new fT(e,n,i)}}var pte=["function balanceOf(address account) view returns (uint256)","function approve(address spender, uint256 amount) external returns (bool)","function transfer(address to, uint256 amount) external returns (bool)","function decimals() view returns (uint8)","function name() view returns (string)","function symbol() view returns (string)"],PC=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return i=n.contract,s=n.method,o=n.args,a=n.userAddress,u=n.rpcProvider,l=n.chainId,g=n.value,y=g===void 0?"0x0":g,A=i.interface.encodeFunctionData(s,o),I={jsonrpc:"2.0",params:[{from:a,to:i.address,data:A,value:y},"latest"],method:"eth_call",id:"1"},V.next=5,u.send(l,I);case 5:return P=V.sent,D=i.interface.decodeFunctionResult(s,P),V.abrupt("return",D);case 8:case"end":return V.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),gte=function(r,e,n){if(r==="0")return"0";for(var i=new ti(r).dividedBy(new ti(10).exponentiatedBy(e)),s=ur(i.toFixed().split("."),2),o=s[0],a=s[1],u=a||Array(e+1).join("0");a&&a.endsWith("0");)u=u.substring(0,a.length-1);return n&&n>0&&(u=u.slice(0,n)),(o+(u?"."+u:"")).replace(/\.0+$/,"")},Bet=function(r,e){return new BigNumber(r).multipliedBy(new BigNumber(10).exponentiatedBy(e))},yte=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return i=n.rpcProvider,s=n.userAddress,o=n.tokenAddress,a=n.chainId,u=n.decimals,l=new fT(o,pte),A.next=4,PC({chainId:a,contract:l,method:"balanceOf",args:[s],userAddress:s,rpcProvider:i});case 4:return g=A.sent,A.abrupt("return",gte(g[0].toString(),u));case 6:case"end":return A.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),r3e=function(r){var e=r.chainId,n=r.userAddress,i=r.tokenList,s=r.rpcProvider,o={},a=[],u=!0,l=!1,g=void 0;try{for(var y=function(P,D){var U=D.value,V=U.tokenAddress,J=U.decimals;a.push(yte({rpcProvider:s,userAddress:n,chainId:e,tokenAddress:V,decimals:J}).then(function(re){o[V]=re}))},A=i[Symbol.iterator](),I;!(u=(I=A.next()).done);u=!0)y(A,I)}catch(P){l=!0,g=P}finally{try{!u&&A.return!=null&&A.return()}finally{if(l)throw g}}return Promise.all(a).then(function(){return o})},mte=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return i=n.chainId,s=n.userAddress,o=n.rpcProvider,a=n.decimals,u=a===void 0?18:a,l={jsonrpc:"2.0",params:[s,"latest"],method:"eth_getBalance",id:"1"},I.next=4,o.send(i,l);case 4:return g=I.sent,y=g,I.abrupt("return",gte(y,u));case 7:case"end":return I.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),n3e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return i=n.rpcProvider,s=n.tokenAddress,o=n.chainId,a=new fT(s,pte),u=PC({contract:a,method:"name",args:[],rpcProvider:i,chainId:o}).then(function(V){return V[0]}),l=PC({contract:a,method:"decimals",args:[],rpcProvider:i,chainId:o}).then(function(V){return Number(V[0])}),g=PC({contract:a,method:"symbol",args:[],rpcProvider:i,chainId:o}).then(function(V){return V[0]}),U.t0=ur,U.next=8,Promise.all([u,l,g]);case 8:return U.t1=U.sent,y=(0,U.t0)(U.t1,3),A=y[0],I=y[1],P=y[2],U.abrupt("return",{tokenAddress:s,name:A,decimals:Number(I),symbol:P,chainId:o});case 14:case"end":return U.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),i3e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return i=n.rpcProvider,s=n.wkRpcProvider,o=n.chainId,a=n.chainName,u=n.message,l=n.address,y.abrupt("return",s.sendWKRpc("wk_preHashMessage",{customNetwork:{chainId:o,name:a},message:u,address:l}));case 2:case"end":return y.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),s3e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return i=n.wkRpcProvider,s=n.chainId,o=n.chainName,a=n.transaction,u=n.address,P.next=3,i.sendWKRpc("wk_getRequiredRpcRequests",{customNetwork:{chainId:s,name:o},transaction:a,senderAddress:u});case 3:return l=P.sent,g=l.parseTransaction,y=l.calculateFee,A=l.buildSigningInput,P.abrupt("return",{parseTransactionFrontedRpcRequests:g,gasAccountFrontedRpcRequests:y,buildTransactionFrontedRpcRequests:A});case 8:case"end":return P.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),NC=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return i=n.handler,s=n.rpcProvider,o=n.chainId,a=n.address,u=i.method,l=i.params,g={jsonrpc:"2.0",params:l,method:u,id:"1"},I.prev=3,I.next=6,s.send(o,g);case 6:return y=I.sent,I.abrupt("return",{method:u,params:l,response:y});case 10:if(I.prev=10,I.t0=I.catch(3),u!=="eth_call"){I.next=16;break}return I.abrupt("return",{method:u,params:l,response:"0x"});case 16:throw I.t0;case 17:case"end":return I.stop()}},e,null,[[3,10]])}));return function(n){return r.apply(this,arguments)}}(),Oet=function(r){if(typeof r!="string")return r;if(r.includes('"'))try{return JSON.parse(r)}catch{return r}return r},o3e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return i=n.rpcProvider,s=n.wkRpcProvider,o=n.chainId,a=n.chainName,u=n.transaction,l=n.address,g=n.requestId,y=n.buildTransactionFrontedRpcRequests,A=n.fee,I=n.gasAccountType,P=n.publicKeys,J.next=3,Promise.all(y.map(function(re){return NC({handler:re,rpcProvider:i,chainId:o,address:l})}));case 3:return D=J.sent,J.next=6,s.sendWKRpc("wk_getSigningInput",{requestId:g,customNetwork:{chainId:o,name:a},transaction:u,address:l,transactionConfig:{frontendRpcResponses:D},fee:A,gasAccountType:I,publicKeys:P});case 6:return U=J.sent,J.abrupt("return",U);case 8:case"end":return J.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),a3e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return i=n.rpcProvider,s=n.wkRpcProvider,o=n.chainId,a=n.chainName,u=n.transaction,l=n.address,g=n.requestId,y=n.signatures,A=n.unsignedTx,D.next=3,s.sendWKRpc("wk_compile",{requestId:g,customNetwork:{chainId:o,name:a},transaction:u,address:l,unsignedTx:A,signatures:y});case 3:return I=D.sent,D.abrupt("return",I);case 5:case"end":return D.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),bte=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return i=n.rpcProvider,s=n.wkRpcProvider,o=n.chainId,a=n.chainName,u=n.transaction,l=n.address,g=n.requestId,y=n.gasAccountFrontedRpcRequests,A=n.broadcast,U.next=3,Promise.all(y.map(function(V){return NC({handler:V,rpcProvider:i,chainId:o,address:l})}));case 3:return I=U.sent,U.next=6,s.sendWKRpc("wk_calculateFee",{requestId:g,customNetwork:{chainId:o,name:a},gasAccountType:"Default",transaction:u,address:l,broadcast:A,supportedFeeTemplates:["LegacyFeeTemplate","Eip1559FeeTemplate","SolanaFeeTemplate","SimpleFeeTemplate","FreeFeeTemplate"],transactionConfig:{frontendRpcResponses:I}});case 6:return P=U.sent,U.abrupt("return",P);case 8:case"end":return U.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),u3e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return i=n.rpcProvider,s=n.wkRpcProvider,o=n.chainId,a=n.chainName,u=n.message,l=n.url,g=n.address,y=n.source,A=n.requestId,P.abrupt("return",s.sendWKRpc("wk_parseMessage",{requestId:A,customNetwork:{chainId:o,name:a},message:u,url:l,address:g,source:y}));case 2:case"end":return P.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),c3e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return i=n.rpcProvider,s=n.wkRpcProvider,o=n.chainId,a=n.chainName,u=n.transaction,l=n.url,g=n.address,y=n.source,A=n.requestId,I=n.parseTransactionFrontedRpcRequests,V.next=3,Promise.all(I.map(function(J){return NC({handler:J,rpcProvider:i,chainId:o,address:g})}));case 3:return P=V.sent,V.next=6,s.sendWKRpc("wk_parseTransaction",{requestId:A,customNetwork:{chainId:o,name:a},transaction:u,url:l,address:g,source:y,transactionConfig:{frontendRpcResponses:P}});case 6:return D=V.sent,V.abrupt("return",D);case 8:case"end":return V.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),l3e=30*1e3,f3e=function(){"use strict";function r(n){(0,G.A)(this,r),this.activeTasks=0,this.taskQueue=[],this.consecutiveSuccesses=0,this.congestionTimer=null,this.enableLogging=!1;var i,s=(i=n.baseWindowMs)!==null&&i!==void 0?i:100,o,a=(o=n.baseConcurrency)!==null&&o!==void 0?o:10;this.baseWindowMs=s,this.baseConcurrency=a,this.currentWindowMs=s,this.currentConcurrency=a}var e=r.prototype;return e.getStatus=function(){return{currentConcurrency:this.currentConcurrency,currentWindowMs:this.currentWindowMs,activeTasks:this.activeTasks,pendingTasks:this.taskQueue.length,consecutiveSuccesses:this.consecutiveSuccesses,isPaused:!!this.congestionTimer}},e.execute=function(i){var s=this;return new Promise(function(o,a){var u={fn:i,resolve:o,reject:a,createTime:Date.now()};s.taskQueue.push(u),s.tryProcessQueue()})},e.tryProcessQueue=function(){if(!(this.taskQueue.length===0||this.activeTasks>=this.currentConcurrency||this.congestionTimer)){var i=this.taskQueue.shift();this.activeTasks++,this.runTask(i)}},e.runTask=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return a=i.fn,u=i.resolve,l=i.reject,g=i.createTime,I.prev=1,I.next=4,a();case 4:y=I.sent,y.isCongestion?(s.log("[Congestion] Task reported congestion."),s.handleCongestion(),Date.now()-g<l3e?s.taskQueue.unshift(i):l("[Error] Task failed with timeout"),s.activeTasks--,s.congestionTimer=setTimeout(function(){s.congestionTimer=null,s.log("[Resume] Congestion backoff finished. Resuming queue..."),s.tryProcessQueue()},s.currentWindowMs)):(s.handleSuccess(),s.activeTasks--,u(y.value),s.tryProcessQueue()),I.next=14;break;case 8:I.prev=8,I.t0=I.catch(1),s.log("[Error] Task failed with error: ".concat(I.t0)),s.activeTasks--,l(I.t0),s.tryProcessQueue();case 14:case"end":return I.stop()}},o,null,[[1,8]])}))()},e.handleCongestion=function(){this.consecutiveSuccesses=0,this.currentConcurrency===1?this.currentWindowMs=this.currentWindowMs*2:this.currentConcurrency=Math.max(1,Math.floor(this.currentConcurrency/2)),this.logState("Congestion")},e.handleSuccess=function(){this.consecutiveSuccesses++,this.consecutiveSuccesses>=this.currentConcurrency&&(this.consecutiveSuccesses=0,this.currentWindowMs>this.baseWindowMs?this.currentWindowMs=Math.max(this.baseWindowMs,Math.floor(this.currentWindowMs/2)):this.currentConcurrency++,this.logState("Success (AIMD Increase)"))},e.log=function(i){this.enableLogging&&console.log("[CongestionController] ".concat(i))},e.logState=function(i){this.enableLogging&&console.log("[StateChange: ".concat(i,"] Concurrency: ").concat(this.currentConcurrency,", Window: ").concat(this.currentWindowMs,"ms"))},r}(),d3e={customChainTokenBalanceMap:{},customChainTokenPreferenceMap:{},customChainTokenList:[]},WM=Nr(d3e),vte=WM.customChainTokenBalanceMapBgAtom,h3e=WM.customChainTokenListBgAtom,p3e=WM.customChainTokenPreferenceMapBgAtom,MC=function(r){var e=r.tokenId,n=r.userAddress;return"".concat(n,"^").concat(e).toLowerCase()},Pet=function(r){var e=_sliced_to_array(r.split("^"),2),n=e[0],i=e[1];return i},wte=function(r){var e=r.id,n=r.tokenAddress,i=r.chainId,s=r.symbol,o=r.decimals,a=r.name,u=r.status,l=Pf(i);return{id:e,name:a,symbol:s,icon:null,tokenAddresses:[{networkId:Pf(i),contractAddress:n,chainId:i,nativeAddressFlag:Iee(n),decimals:o}],singleNetworkToken:l,status:u}},I2;(function(r){r.exclusive="exclusive",r.high="high",r.low="low"})(I2||(I2={}));var g3e=tn(18844);const ld={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},Ate={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},_te=ld.rpc.internal,y3e="Unspecified error message. This is a bug, please report it.",m3e={code:_te,message:Ete(_te)},b3e="Unspecified server error.";function Ete(r,e=y3e){if(v3e(r)){const n=r.toString();if(Vm(Ate,n))return Ate[n].message;if(_3e(r))return b3e}return e}function v3e(r){return Number.isInteger(r)}function Net(r,{fallbackError:e=m3e,shouldIncludeStack:n=!0,shouldPreserveMessage:i=!0}={}){if(!isJsonRpcError(e))throw new Error("Must provide fallback error with integer number code and string message.");const s=w3e(r,e,i);return n||delete s.stack,s}function w3e(r,e,n){if(r&&typeof r=="object"&&"serialize"in r&&typeof r.serialize=="function")return r.serialize();if(isJsonRpcError(r))return r;const i=A3e(r),s=Tte(r);return{...e,...n&&i&&{message:i},data:{cause:s}}}function A3e(r){if(isObject(r)&&hasProperty(r,"message")&&typeof r.message=="string"&&r.message.length>0)return r.message}function _3e(r){return r>=-32099&&r<=-32e3}function Tte(r){return Array.isArray(r)?r.map(e=>Zm(e)?e:$m(e)?Ste(e):null):$m(r)?Ste(r):Zm(r)?r:null}function Ste(r){return Object.getOwnPropertyNames(r).reduce((e,n)=>{const i=r[n];return Zm(i)&&(e[n]=i),e},{})}function E3e(r){return $m(r)&&Vm(r,"cause")&&$m(r.cause)}function T3e(r){return r?.__esModule?r.default:r}const S3e=T3e(g3e);class Ite extends Error{constructor(e,n,i){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a non-empty string.');E3e(i)?(super(n,{cause:i.cause}),Vm(this,"cause")||Object.assign(this,{cause:i.cause})):super(n),i!==void 0&&(this.data=i),this.code=e}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data,K0(this.data)&&(e.data.cause=Tte(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return S3e(this.serialize(),k3e,2)}}class Met extends Ite{constructor(e,n,i){if(!I3e(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,i)}}function I3e(r){return Number.isInteger(r)&&r>=1e3&&r<=4999}function k3e(r,e){if(e!=="[Circular]")return e}const dT={parse:r=>fd(ld.rpc.parse,r),invalidRequest:r=>fd(ld.rpc.invalidRequest,r),invalidParams:r=>fd(ld.rpc.invalidParams,r),methodNotFound:r=>fd(ld.rpc.methodNotFound,r),internal:r=>fd(ld.rpc.internal,r),server:r=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=r;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return fd(e,r)},invalidInput:r=>fd(ld.rpc.invalidInput,r),resourceNotFound:r=>fd(ld.rpc.resourceNotFound,r),resourceUnavailable:r=>fd(ld.rpc.resourceUnavailable,r),transactionRejected:r=>fd(ld.rpc.transactionRejected,r),methodNotSupported:r=>fd(ld.rpc.methodNotSupported,r),limitExceeded:r=>fd(ld.rpc.limitExceeded,r)},Let=null;function fd(r,e){const[n,i]=kte(e);return new Ite(r,n??Ete(r),i)}function Det(r,e){const[n,i]=kte(e);return new EthereumProviderError(r,n??getMessageFromCode(r),i)}function kte(r){if(r){if(typeof r=="string")return[r];if(typeof r=="object"&&!Array.isArray(r)){const{message:e,data:n}=r;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e??void 0,n]}}return[]}function R3e(){return dT.internal({message:"Request is being rate limited."})}function C3e(){var r="Gateway timeout. The request took too long to process. ";return r+="This can happen when querying logs over too wide a block range.",dT.internal({message:r})}var Rte=["Gateway timeout","ETIMEDOUT","failed to parse response body","Failed to fetch"],Cte=new WeakSet,xte=new WeakSet,Bte=function(){"use strict";function r(n){(0,G.A)(this,r),B(this,Cte),B(this,xte),this.rpcNodes=n}var e=r.prototype;return e.sendJsonRPCRequest=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return u=JSON.stringify(K(o,xte,B3e).call(o,i)),l={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:u},g=o.getRpcUrl(),A.next=5,K(o,Cte,x3e).call(o,g,l,s);case 5:return A.abrupt("return",A.sent);case 6:case"end":return A.stop()}},a)}))()},e.getRpcUrl=function(){var i,s=(i={},vt(i,I2.high,2),vt(i,I2.low,1),vt(i,I2.exclusive,0),i),o=(0,H.sortBy)(this.rpcNodes,function(a){return-s[a.weight]});return o[0].url},r}();function x3e(r,e,n){return HM.apply(this,arguments)}function HM(){return HM=(0,k.A)(b().mark(function r(e,n,i){var s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:s=3,o=1e3,u=i?.skipRetry,l=0;case 5:if(!(l<s)){V.next=38;break}return V.prev=6,V.next=9,fetch(e,n);case 9:return g=V.sent,O3e(g),V.next=13,g.text();case 13:y=V.sent,A=void 0,V.prev=15,A=JSON.parse(y),V.next=22;break;case 19:throw V.prev=19,V.t0=V.catch(15),new Error('FetchMiddleware - failed to parse response body: "'.concat(y,'"'));case 22:return a=A,I=P3e(g,A),V.abrupt("return",I);case 27:if(V.prev=27,V.t1=V.catch(6),P=V.t1.toString(),D=!u&&Rte.some(function(J){return P.includes(J)})&&l<s-1,D){V.next=33;break}throw V.t1;case 33:return V.next=35,tc(o);case 35:l++,V.next=5;break;case 38:case"end":return V.stop()}},r,null,[[6,27],[15,19]])})),HM.apply(this,arguments)}function B3e(r){return r.jsonrpc||(r.jsonrpc="2.0"),r.id||(r.id=1),r}function O3e(r){switch(r.status){case 405:throw dT.methodNotFound();case 429:throw R3e();case 503:case 504:throw C3e();default:break}}function P3e(r,e){if(r.status!==200)throw dT.internal({message:"Non-200 status code: '".concat(r.status,"'"),data:e});if(e.error)throw dT.internal({data:e.error});return e.result}var hT=new WeakMap,Ote=new WeakSet,N3e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),Ote),s.name="rpcNode",de(F(s),hT,{writable:!0,value:new Map}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,Ote,M3e).call(o);case 2:case"end":return l.stop()}},a)}))()},i.sendJsonRPC=function(o,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=this;return(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(y=X(l,hT).get(o),y){I.next=3;break}throw new Error("networkClient not found for networkId: ".concat(o));case 3:return I.abrupt("return",y.sendJsonRPCRequest(a,u));case 4:case"end":return I.stop()}},g)}))()},i.getRpcUrl=function(o){var a=X(this,hT).get(o);if(a)return a.getRpcUrl()},i.addCustomNetworkClient=function(o,a){var u=Pf(String(o)),l=new Bte([{url:a,weight:I2.high}]);X(this,hT).set(u,l)},n}(Yr);function M3e(){return zM.apply(this,arguments)}function zM(){return zM=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,hn.ChainNodes.getChainNodesList();case 2:for(e=P.sent,n=e.data,i=!0,s=!1,o=void 0,P.prev=5,a=n[Symbol.iterator]();!(i=(u=a.next()).done);i=!0)l=u.value,g=l.binanceChainId,y=no(g),A=new Bte(l.nodes),X(this,hT).set(y,A);P.next=13;break;case 9:P.prev=9,P.t0=P.catch(5),s=!0,o=P.t0;case 13:P.prev=13,P.prev=14,!i&&a.return!=null&&a.return();case 16:if(P.prev=16,!s){P.next=19;break}throw o;case 19:return P.finish(16);case 20:return P.finish(13);case 21:case"end":return P.stop()}},r,this,[[5,9,13,21],[14,,16,20]])})),zM.apply(this,arguments)}var cm=new N3e,Pte=2,Sc={send:function(e,n){return(0,k.A)(b().mark(function i(){var s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=L3e(e),o=0,u.abrupt("return",s.execute((0,k.A)(b().mark(function l(){var g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.prev=0,P.next=3,cm.sendJsonRPC(Pf(e),n);case 3:return g=P.sent,vo.markChainUnreachable(e,!1),P.abrupt("return",{isCongestion:!1,value:g});case 8:if(P.prev=8,P.t0=P.catch(0),o++,y=P.t0.toString(),!y.includes("rate limit")){P.next=17;break}if(vo.markChainUnreachable(e,!1),!(o>=Pte)){P.next=16;break}throw P.t0;case 16:return P.abrupt("return",{isCongestion:!0});case 17:if(A=Rte.some(function(D){return y.includes(D)}),A&&vo.markChainUnreachable(e,!0),A){P.next=21;break}throw P.t0;case 21:if(!(o>=Pte)){P.next=23;break}throw P.t0;case 23:return P.abrupt("return",{isCongestion:!0});case 24:case"end":return P.stop()}},l,null,[[0,8]])}))));case 3:case"end":return u.stop()}},i)}))()}},LC={},L3e=function(r){var e=LC[r];return e||(LC[r]=new f3e({})),LC[r]},D3e=function(r){delete LC[r]},Nte=function(r,e){var n=e.length>15,i=n?F3e:U3e;return r.filter(function(s){return i(s,e)})},U3e=function(r,e){return(r.name||"").toLowerCase().includes(e.toLowerCase())||(r.symbol||"").toLowerCase().includes(e.toLowerCase())},F3e=function(r,e){return r.tokenAddresses.find(function(n){return n.contractAddress.toLowerCase()===e.toLowerCase()})},$M={},W3e=function(r,e){var n="".concat(r,"_").concat(e);return $M[n]||($M[n]=new Nh(5*60*1e3)),$M[n]},VM=rf(function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return i=n.chainId,s=n.tokenAddress,u.next=3,n3e({rpcProvider:Sc,chainId:i,tokenAddress:s});case 3:return o=u.sent,u.abrupt("return",gn(Mr({},o),{decimals:Number(o.decimals)}));case 5:case"end":return u.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),{hashArg:function(e){var n=e.chainId,i=e.tokenAddress;return"".concat(n,"-").concat(i).toLowerCase()},cacheTime:60*1e3}),H3e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="customChainToken",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.onCustomChainTokenChanged();case 2:setTimeout(function(){o.refreshBalance({})},0);case 3:case"end":return l.stop()}},a)}))()},i.validCustomChainToken=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,vo.getCustomChainByNetworkId(o);case 2:if(l=I.sent,l){I.next=5;break}throw Error("Network item not found");case 5:return g=l.chainId,I.next=8,VM({chainId:g,tokenAddress:a});case 8:return y=I.sent,I.abrupt("return",y);case 10:case"end":return I.stop()}},u)}))()},i.addCustomChainToken=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,u.validCustomChainToken(o,a);case 2:if(g=U.sent,g){U.next=5;break}throw new Error("Invalid custom chain token");case 5:return y=Pd(o),U.next=8,VM({chainId:y,tokenAddress:a});case 8:return A=U.sent,I=No(y,a),P=gn(Mr({},A),{id:I,status:"OPEN"}),U.next=13,Gr.upsert(I,P);case 13:return U.next=15,u.onCustomChainTokenChanged();case 15:return U.next=17,u.refreshForTokenId({tokenId:I});case 17:return U.abrupt("return",Mr({id:I},A));case 18:case"end":return U.stop()}},l)}))()},i.refreshForTokenId=function(o){var a=o.tokenId,u=o.walletId,l=this;return(0,k.A)(b().mark(function g(){var y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,vn.getDefaultWalletAddress({walletId:u,supportedNetworkType:nn.evm});case 2:if(y=D.sent,y){D.next=5;break}return D.abrupt("return");case 5:return A=MC({tokenId:a,userAddress:y}),D.next=8,l.getTokenBalanceOnAddress({tokenId:a,userAddress:y});case 8:if(I=D.sent,!(0,H.isNil)(I)){D.next=11;break}return D.abrupt("return");case 11:case"end":return D.stop()}},g)}))()},i.getTokenBalanceOnWallet=function(o){var a=o.tokenId,u=o.walletId,l=this;return(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,vn.getDefaultWalletAddress({walletId:u,supportedNetworkType:nn.evm});case 2:if(y=I.sent,y){I.next=5;break}return I.abrupt("return",null);case 5:return I.abrupt("return",l.getTokenBalanceOnAddress({tokenId:a,userAddress:y}));case 6:case"end":return I.stop()}},g)}))()},i.getTokenBalanceOnAddress=function(o){var a=o.tokenId,u=o.userAddress,l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Gr.get(a);case 2:if(y=J.sent,y){J.next=5;break}return J.abrupt("return",null);case 5:if(A=y.chainId,I=y.decimals,P=y.tokenAddress,D=MC({tokenId:a,userAddress:u}),U="0",!y.isNativeToken){J.next=14;break}return J.next=11,mte({chainId:A,userAddress:u,rpcProvider:Sc,decimals:I});case 11:U=J.sent,J.next=17;break;case 14:return J.next=16,yte({rpcProvider:Sc,userAddress:u,tokenAddress:P,chainId:A,decimals:I});case 16:U=J.sent;case 17:return J.next=19,l.updateBalace(vt({},D,U));case 19:return J.abrupt("return",U);case 20:case"end":return J.stop()}},g)}))()},i.refreshBalance=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,vn.getCurrentSelectedWallet();case 2:return l=A.sent,A.next=5,Fi.getCurrentSelectedNetworkId();case 5:if(g=A.sent,!(!g||!l||!za(g))){A.next=8;break}return A.abrupt("return");case 8:return A.next=10,a.refreshBalanceForWalletOnChain({walletId:l.id,networkId:g,options:o});case 10:case"end":return A.stop()}},u)}))()},i.refreshBalanceForWalletOnChain=function(o){var a=o.walletId,u=o.networkId,l=o.tokenId,g=o.options,y=g===void 0?{}:g,A=this;return(0,k.A)(b().mark(function I(){var P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,vn.getWalletItemByWalletId(a);case 2:if(P=J.sent,P){J.next=5;break}return J.abrupt("return");case 5:if(D=dh(P,nn.evm)[0],!l){J.next=10;break}return J.next=9,A.getTokenBalanceOnAddress({tokenId:l,userAddress:D});case 9:return J.abrupt("return");case 10:return U=W3e(a,u),J.next=13,U.execute((0,k.A)(b().mark(function re(){var ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e;return b().wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return nt.next=2,vo.getCustomChainByNetworkId(u);case 2:return ce=nt.sent,Re=Pd(u),nt.next=6,A.getWalletShowTokens(P,Re);case 6:return De=nt.sent,nt.next=9,mte({chainId:Re,userAddress:D,rpcProvider:Sc,decimals:ce.nativeTokenDecimals});case 9:return Ue=nt.sent,Ve=De.filter(function(Ne){return!Ne.isNativeToken}),nt.next=13,r3e({chainId:Re,userAddress:D,tokenList:Ve,rpcProvider:Sc});case 13:pe=nt.sent,Se={},Se[MC({tokenId:PSe(Re),userAddress:D})]=Ue,nt.t0=b().keys(pe);case 17:if((nt.t1=nt.t0()).done){nt.next=26;break}if(Ce=nt.t1.value,Object.hasOwn(pe,Ce)){nt.next=21;break}return nt.abrupt("continue",17);case 21:je=pe[Ce],$e=MC({tokenId:No(Re,Ce),userAddress:D}),Se[$e]=je,nt.next=17;break;case 26:return nt.next=28,A.updateBalace(Se);case 28:case"end":return nt.stop()}},re)})),{force:y.skipThrottle});case 13:case"end":return J.stop()}},I)}))()},i.refreshBalanceForAddressOnChain=function(o,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=this;return(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,vn.getWalletItemByAddress(o,a);case 2:if(y=I.sent,y){I.next=5;break}return I.abrupt("return");case 5:return I.next=7,l.refreshBalanceForWalletOnChain({walletId:y.id,networkId:a,options:u});case 7:case"end":return I.stop()}},g)}))()},i.getWalletShowTokens=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Gr.toArray();case 2:l=re.sent,g=[],y=!0,A=!1,I=void 0,re.prev=5,P=l[Symbol.iterator]();case 7:if(y=(D=P.next()).done){re.next=20;break}if(U=D.value,U.chainId===a){re.next=11;break}return re.abrupt("continue",17);case 11:return re.next=13,dn.get(U.id);case 13:if(V=re.sent,!(V&&V.showInWallet===!1)){re.next=16;break}return re.abrupt("continue",17);case 16:g.push(U);case 17:y=!0,re.next=7;break;case 20:re.next=26;break;case 22:re.prev=22,re.t0=re.catch(5),A=!0,I=re.t0;case 26:re.prev=26,re.prev=27,!y&&P.return!=null&&P.return();case 29:if(re.prev=29,!A){re.next=32;break}throw I;case 32:return re.finish(29);case 33:return re.finish(26);case 34:return re.abrupt("return",g);case 35:case"end":return re.stop()}},u,null,[[5,22,26,34],[27,,29,33]])}))()},i.onCustomChainTokenChanged=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Gr.toArray();case 2:return a=l.sent,l.next=5,zt.set(h3e,a);case 5:case"end":return l.stop()}},o)}))()},i.addCustomChainNativeToken=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return l=o.chainId,g=o.nativeToken,y=o.nativeTokenAddress,A=o.nativeTokenDecimals,I=o.nativeTokenName,P=No(l,y),D={id:P,tokenAddress:y,chainId:l,symbol:g||"",decimals:A,name:I||"",isNativeToken:!0,status:"OPEN"},V.next=5,Gr.upsert(P,D);case 5:return V.next=7,a.onCustomChainTokenChanged();case 7:case"end":return V.stop()}},u)}))()},i.updateCustomTokenSelected=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,dn.upsert(o,{showInWallet:a});case 2:return y.next=4,u.updateTokenPreferenceToAtom();case 4:if(!a){y.next=7;break}return y.next=7,u.refreshForTokenId({tokenId:o});case 7:case"end":return y.stop()}},l)}))()},i.updateBalace=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(vte);case 2:return u=g.sent,g.next=5,zt.set(vte,Mr({},u,o));case 5:case"end":return g.stop()}},a)}))()},i.getCustomChainTokenMeta=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Gr.get(o);case 2:if(u=g.sent,u){g.next=5;break}throw Error("No such token info");case 5:return g.abrupt("return",wte(u));case 6:case"end":return g.stop()}},a)}))()},i.getCustomChainTokenInfoMap=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:u={},l=!0,g=!1,y=void 0,Ve.prev=2,A=o[Symbol.iterator]();case 4:if(l=(I=A.next()).done){Ve.next=31;break}return P=I.value,D=Hm(P),U=D.chainId,V=D.tokenContract,Ve.next=9,Gr.get(P);case 9:if(J=Ve.sent,!(Iee(V)&&!J)){Ve.next=13;break}return console.error(" ---- no native ---"),Ve.abrupt("continue",28);case 13:if(!J){Ve.next=17;break}u[V]=gn(Mr({type:"TOKEN"},J),{icon:"",price:"0",decimals:String(J.decimals)}),Ve.next=28;break;case 17:return Ve.prev=17,Ve.next=20,VM({chainId:U,tokenAddress:V});case 20:re=Ve.sent,ce=re.decimals,Re=re.symbol,De=re.name,u[V]={type:"TOKEN",symbol:Re,name:De,icon:"",price:"0",decimals:String(ce)},Ve.next=28;break;case 25:Ve.prev=25,Ve.t0=Ve.catch(17),console.error(Ve.t0);case 28:l=!0,Ve.next=4;break;case 31:Ve.next=37;break;case 33:Ve.prev=33,Ve.t1=Ve.catch(2),g=!0,y=Ve.t1;case 37:Ve.prev=37,Ve.prev=38,!l&&A.return!=null&&A.return();case 40:if(Ve.prev=40,!g){Ve.next=43;break}throw y;case 43:return Ve.finish(40);case 44:return Ve.finish(37);case 45:return Ve.abrupt("return",u);case 46:case"end":return Ve.stop()}},a,null,[[2,33,37,45],[17,25],[38,,40,44]])}))()},i.updateTokenPreferenceToAtom=function(){return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,dn.toArray();case 2:return a=g.sent,u=(0,H.keyBy)(a,function(y){return y._id}),g.next=6,zt.set(p3e,u);case 6:case"end":return g.stop()}},o)}))()},i.searchToken=function(o,a){return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,Gr.toArray();case 2:return l=A.sent,g=l.filter(function(I){return I.chainId===Pd(a)}).map(function(I){return wte(I)}),A.abrupt("return",Nte(g,o));case 5:case"end":return A.stop()}},u)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[vo]}}]),n}(Yr),Da=new H3e;_e("customChainToken",{validCustomChainToken:Da.validCustomChainToken.bind(Da),addCustomChainToken:Da.addCustomChainToken.bind(Da),getTokenBalanceOnWallet:Da.getTokenBalanceOnWallet.bind(Da),refreshBalance:Da.refreshBalance.bind(Da),refreshBalanceForWalletOnChain:Da.refreshBalanceForWalletOnChain.bind(Da)}),globalThis.customChainTokenController=Da;var z3e={permissionList:[]},$3e=Nr(z3e).permissionListBgAtom,Mte;(function(r){r.normalConnect="normalConnect",r.multilConnect="multiConnect",r.requestDirectSign="requestDirectSign",r.disconnect="disconnect",r.requestPubKey="requestPubKey",r.changeConnectedChainId="changeConnectedChainId",r.changeConnectedAddress="changeConnectedAddress",r.requestWalletKitSign="requestWalletKitSign",r.requestReportSign="requestReportSign",r.requestReportConnect="requestReportConnect",r.requestRPC="requestRPC",r.requestCommonChainHTTPCall="requestCommonChainHTTPCall",r.previewTransaction="previewTransaction",r.previewMessage="previewMessage",r.reportError="reportError",r.universalSign="universalSign",r.requestIsUniversalSign="requestIsUniversalSign",r.requestIsNewSuiSign="requestIsNewSuiSign",r.requestHasStakedBabylon="requestHasStakedBabylon",r.reportMethodCalled="reportMethodCalled",r.dappLog="dappLog",r.addEvmChain="addEvmChain"})(Mte||(Mte={}));var Lte;(function(r){r.setResponse="setResponse",r.setError="setError"})(Lte||(Lte={}));var Dte;(function(r){r.setVersion="setVersion",r.updateConnectedInfo="updateConnectedInfo"})(Dte||(Dte={}));var Ute;(function(r){r.requestSignBip122OnlyAfterPreview="requestSignBip122OnlyAfterPreview",r.requestBinanceChainIdAndNetworkId="requestBinanceChainIdAndNetworkId",r.eip155AddAsset="eip155AddAsset",r.bip122GetBlockHeight="bip122GetBlockHeight",r.bip122PushTx="bip122PushTx",r.bip122PreviewTx="bip122PreviewTx",r.bip122GetUtxos="bip122GetUtxos",r.bip122GetNetworkFees="bip122GetNetworkFees",r.bip122GetBalance="bip122GetBalance",r.requestTonAddressByManifest="requestTonAddressByManifest",r.sign="sign",r.commonTgeSign="commonTgeSign",r.commonTgeVerify="commonTgeVerify"})(Ute||(Ute={}));var Fte;(function(r){r.mpChangeConnectedChainId="mpChangeConnectedChainId",r.mpChangeConnectedAddress="mpChangeConnectedAddress",r.mpDisconnect="mpDisconnect"})(Fte||(Fte={}));var Uet="Binance Wallet",Fet="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiBmaWxsPSIjMEIwRTExIi8+CjxwYXRoIGQ9Ik01IDE1TDcuMjU4MDYgMTIuNzQxOUw5LjUxNjEzIDE1TDcuMjU4MDYgMTcuMjU4MUw1IDE1WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNOC44NzA5NyAxMS4xMjlMMTUgNUwyMS4xMjkgMTEuMTI5TDE4Ljg3MSAxMy4zODcxTDE1IDkuNTE2MTNMMTEuMTI5IDEzLjM4NzFMOC44NzA5NyAxMS4xMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMi43NDE5IDE1TDE1IDEyLjc0MTlMMTcuMjU4MSAxNUwxNSAxNy4yNTgxTDEyLjc0MTkgMTVaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMS4xMjkgMTYuNjEyOUw4Ljg3MDk3IDE4Ljg3MUwxNSAyNUwyMS4xMjkgMTguODcxTDE4Ljg3MSAxNi42MTI5TDE1IDIwLjQ4MzlMMTEuMTI5IDE2LjYxMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0yMC40ODM5IDE1TDIyLjc0MTkgMTIuNzQxOUwyNSAxNUwyMi43NDE5IDE3LjI1ODFMMjAuNDgzOSAxNVoiIGZpbGw9IiNGMEI5MEIiLz4KPC9zdmc+Cg==",Wet="https://www.binance.com/en/web3wallet",Wte;(function(r){r.MISREPORT="MISREPORT",r.UNREPORT="UNREPORT"})(Wte||(Wte={}));var Hte;(function(r){r.NOT_PHISHING_OR_SCAM="NOT_PHISHING_OR_SCAM",r.PHISHING_SITES="PHISHING_SITES",r.FAKE_TOKEN_SALES_AND_AIRDROPS="FAKE_TOKEN_SALES_AND_AIRDROPS",r.FAKE_WALLETS_AND_APPS="FAKE_WALLETS_AND_APPS",r.PONZI_SCHEME="PONZI_SCHEME",r.OTHERS="OTHERS"})(Hte||(Hte={}));var zte;(function(r){r.disconnectTonInMP="disconnectTonInMP",r.tonHttpBridgeTxFinished="tonHttpBridgeTxFinished",r.tonHttpBridgeConnectFinished="tonHttpBridgeConnectFinished",r.tonJSridgeConnectFinished="tonJSBridgeConnectFinished",r.sseError="sseError",r.sseMessage="sseMessage",r.tonHttpBridgeReportTx="tonHttpBridgeReportTx",r.showToast="showToast"})(zte||(zte={}));var $te;(function(r){r.walletBuildTx="wallet_buildTx",r.walletSignTx="wallet_signTx",r.earnSolanaWeb3js="earnSolanaWeb3js",r.earnSolanaSPL="earnSolanaSPL",r.earnSui="earnSui",r.setConnectionInfo="setConnectionInfo",r.setSSEInfo="setSSEInfo",r.setConnectionInfoError="setConnectionInfoError",r.emit="emit",r.tonDisconnectByNative="tonDisconnectByNative"})($te||($te={}));var Vte;(function(r){r.GET="get",r.POST="post"})(Vte||(Vte={}));var jte="method-",Kte;(function(r){r.PAGE_READY="translate_page_ready",r.FETCH_TRANSLATION="fetch_translation",r.FETCH_TRANSLATION_TOO_MANY="translate_fail_too_many",r.TRANSLATE_SUCCESS="translate_success",r.TRANSLATE_FAIL="translate_fail",r.TRANSLATE_PAGE="translate_page",r.REFRESH_TRANSLATE="refresh_translate",r.TANSLATE_SHOW_ORIGINAL="translate_show_original",r[r.REQUEST=jte+"request"]="REQUEST",r[r.GET_TRANSLATE_SETTINGS=jte+"get_translate_settings"]="GET_TRANSLATE_SETTINGS",r.CLEAR_CACHE="translate_clear_cache",r.JUMP_TO_MP_PAGE="jump_to_mp_page"})(Kte||(Kte={}));var Gte=null,Het=function(r){var e=Gte.find(function(n){return n.key===r});return e?e.text:""},zet=function(r){var e=Gte.find(function(n){var i;return((i=n.alias)===null||i===void 0?void 0:i.includes(r))||n.key===r});return e?e.key:""};function V3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function DC(r,e,n){return V3e()?DC=Reflect.construct:DC=function(s,o,a){var u=[null];u.push.apply(u,o);var l=Function.bind.apply(s,u),g=new l;return a&&T(g,a.prototype),g},DC.apply(null,arguments)}function j3e(r,e,n){return DC.apply(null,arguments)}function K3e(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function jM(r){var e=typeof Map=="function"?new Map:void 0;return jM=function(i){if(i===null||!K3e(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,s)}function s(){return j3e(i,arguments,Z(this).constructor)}return s.prototype=Object.create(i.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),T(s,i)},jM(r)}function qte(r){return jM(r)}var $et=function(r){"use strict";N(n,r);var e=te(n);function n(s,o){(0,G.A)(this,n);var a;return a=e.call(this),a.code=s,a.message=o,a}var i=n.prototype;return i.toString=function(){return"".concat(this.message," (").concat(this.code,")")},n}(qte(Error)),k2;(function(r){r[r.USER_REJECTED=4001]="USER_REJECTED",r[r.UNAUTHORIZED=4100]="UNAUTHORIZED",r[r.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",r[r.DISCONNECTED=4900]="DISCONNECTED",r[r.CHAIN_DISCONNECTED=4901]="CHAIN_DISCONNECTED"})(k2||(k2={}));var k1={USER_REJECTED:"".concat(k2.USER_REJECTED,":User rejected"),UNSUPPORTED_METHOD:"".concat(k2.UNSUPPORTED_METHOD,":Unsupported method"),DISCONNECTED:"".concat(k2.DISCONNECTED,":Disconnected"),CHAIN_DISCONNECTED:"".concat(k2.CHAIN_DISCONNECTED,":Chain disconnected"),UNSUPPORTED_CHAIN:"4902:Unrecognized chain ID"},Vet=9,jet=15e6,Ket=1e6,Get=1e-9,qet=1e6,Zet=1e6,Zte=function(r){var e=r.metadata.keyring.type;if(e===di.hd){var n=r.accounts[0].addressList,i=n.find(function(a){return a.network===nn.evm});if(!i)throw Error("Cannot find target public key for seedphrase");if(!i.publicKeyHex)throw Error("Cannot found public key for seedphrase");return i.publicKeyHex}else if(e===di.privateKey){var s=r.accounts[0].addressList,o=s[0].publicKeyHex;if(!o)throw Error("Cannot found public key for private key");return o}else return null},G3e=function(r,e){return r.filter(function(n){return e.some(function(i){return q3e(n,i)})}).map(function(n){return n.id})},q3e=function(r,e){var n=r.metadata.keyring.type,i=n===di.hd&&e.walletType==="SEED_PHRASE"||n===di.privateKey&&e.walletType==="PRIVATE_KEY";return i?Zte(r)===e.userPublicKeyHex:!1},UC=function(r){var e=r.supportedNetworkType,n=r.supportedNetworkTypeList;return(0,H.uniq)([e].concat((0,Li.A)(n||[])).filter(Boolean))},Z3e=function(r,e,n){var i=r.currentNetworkId,s=r.networkIdForChainType,o=r.networkIds,a=i||o[0],u=(0,H.keyBy)(n,function(A){return A.id}),l=u[a||""];if(l?.chainType===e)return l;var g=s?.[e],y=u[g||""];return y||null},Y3e=function(r){if(r)return JSON.parse(r)};const X3e=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(r=>[r.name,r]),J3e=new Map(X3e);class KM extends Error{name="NonError";constructor(e){super(KM._prepareSuperMessage(e))}static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{return String(e)}}}const Q3e=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],GM=new WeakSet,eke=r=>{GM.add(r);const e=r.toJSON();return GM.delete(r),e},Yte=r=>J3e.get(r)??Error,qM=({from:r,seen:e,to:n,forceEnumerable:i,maxDepth:s,depth:o,useToJSON:a,serialize:u})=>{if(!n)if(Array.isArray(r))n=[];else if(!u&&Xte(r)){const g=Yte(r.name);n=new g}else n={};if(e.push(r),o>=s)return n;if(a&&typeof r.toJSON=="function"&&!GM.has(r))return eke(r);const l=g=>qM({from:g,seen:[...e],forceEnumerable:i,maxDepth:s,depth:o,useToJSON:a,serialize:u});for(const[g,y]of Object.entries(r)){if(y&&y instanceof Uint8Array&&y.constructor.name==="Buffer"){n[g]="[object Buffer]";continue}if(y!==null&&typeof y=="object"&&typeof y.pipe=="function"){n[g]="[object Stream]";continue}if(typeof y!="function"){if(!y||typeof y!="object"){try{n[g]=y}catch{}continue}if(!e.includes(r[g])){o++,n[g]=l(r[g]);continue}n[g]="[Circular]"}}for(const{property:g,enumerable:y}of Q3e)typeof r[g]<"u"&&r[g]!==null&&Object.defineProperty(n,g,{value:Xte(r[g])?l(r[g]):r[g],enumerable:i?!0:y,configurable:!0,writable:!0});return n};function Xet(r,e={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:i=!0}=e;return typeof r=="object"&&r!==null?qM({from:r,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:i,serialize:!0}):typeof r=="function"?`[Function: ${r.name||"anonymous"}]`:r}function tke(r,e={}){const{maxDepth:n=Number.POSITIVE_INFINITY}=e;if(r instanceof Error)return r;if(rke(r)){const i=Yte(r.name);return qM({from:r,seen:[],to:new i,maxDepth:n,depth:0,serialize:!1})}return new KM(r)}function Xte(r){return!!r&&typeof r=="object"&&"name"in r&&"message"in r&&"stack"in r}function rke(r){return!!r&&typeof r=="object"&&"message"in r&&!Array.isArray(r)}var FC;(function(r){r.disconnect="disconnect",r.connectionChanged="connectionChanged"})(FC||(FC={}));var pT;(function(r){r.signTransaction="signTransaction",r.sendTransaction="sendTransaction",r.signMessage="signMessage"})(pT||(pT={}));var lm;(function(r){r.Send="Send",r.SendNft="SendNft",r.Approve="Approve",r.ApproveNft="ApproveNft",r.ApproveNftCollection="ApproveNftCollection",r.Revoke="Revoke",r.RevokeNft="RevokeNft",r.RevokeNftCollection="RevokeNftCollection",r.Deploy="Deploy",r.Permit2="Permit2",r.Swap="Swap",r.ContractInteraction="ContractInteraction"})(lm||(lm={}));var Jte;(function(r){r.PersonalSign="PersonalSign",r.SignTypedData="SignTypedData",r.SignMessage="SignMessage",r.Permit="Permit",r.Permit2="Permit2"})(Jte||(Jte={}));var nke=Math.pow(10,36),Jet="000000000",Qet="0060004",ett="0070000",ttt="000001",rtt="000002",ntt="000003",ike={isComplianceBlocked:!1},Qte=Nr(ike).isComplianceBlockedBgAtom,ske=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="compliance",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return wo.onHasUIConnected(function(){return o.checkIsBlocked()}),l.next=3,o.checkIsBlocked();case 3:case"end":return l.stop()}},a)}))()},i.checkIsBlocked=function(){return(0,k.A)(b().mark(function o(){var a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.prev=0,y.next=3,hn.Compliance.check();case 3:return a=y.sent,u=a.data.restriction.keys,l=u.includes("wallet_extension_ip"),y.next=8,zt.set(Qte,l);case 8:if(!l){y.next=11;break}return y.next=11,qi.revokeAll();case 11:return y.abrupt("return",l);case 14:return y.prev=14,y.t0=y.catch(0),console.error("Compliance check failed:",y.t0),y.abrupt("return",!1);case 18:case"end":return y.stop()}},o,null,[[0,14]])}))()},i.isBlocked=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",zt.get(Qte));case 1:case"end":return u.stop()}},o)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[wo]}}]),n}(Yr),gT=new ske;_e("compliance",{checkIsBlocked:gT.checkIsBlocked.bind(gT)});var oke=function(r){if(za(r.id))return r.chainId;if(r.wcId){var e=r.wcId.match(/eip155:(\d+)/);if(e)return e[1]}return r.binanceChainId},ere={};function ake(r,e){return ZM.apply(this,arguments)}function ZM(){return ZM=(0,k.A)(b().mark(function r(e,n){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return i=ere[e]||new In,ere[e]=i,a.next=4,i.acquire();case 4:return s=a.sent,a.prev=5,a.next=8,n({releaseLock:s});case 8:return a.abrupt("return",a.sent);case 9:return a.prev=9,s(),a.finish(9);case 12:case"end":return a.stop()}},r,null,[[5,,9,12]])})),ZM.apply(this,arguments)}var yT=[],WC={add:function(e){var n=e.port,i=e.tab,s=e.origin;yT.push({port:n,tab:i,origin:s})},remove:function(r){var e=yT.findIndex(function(n){return n.port===r});e!==-1&&yT.splice(e,1)},getByOrigin:function(r){return yT.filter(function(e){return e.origin===r})},getByTabId:function(r){return yT.find(function(e){return e.tab.id===r})}},uke=function(r){var e=r.origin,n=r.networkType,i=r.eventType,s=r.args;return{type:ar.contentScriptEvent,networkType:n,eventType:i,args:s,target:wr.inPage}},cke=function(r){var e=r.origin,n=r.eventType,i=r.args;return{type:ar.contentScriptEvent,networkType:nn.evm,eventType:n,args:i,target:wr.inPage,isMultichainEvent:!0}},lke=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="providerMessage",s}var i=n.prototype;return i.emitDisconnectMessage=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,u.emitMessage({origin:o,eventType:FC.disconnect,networkType:a,args:null});case 2:case"end":return y.stop()}},l)}))()},i.emitMessage=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(console.debug("[ProviderMessageController] emitMessage",o),u=o.origin,l=WC.getByOrigin(u),l){J.next=5;break}return J.abrupt("return");case 5:for(g=!0,y=!1,A=void 0,J.prev=6,I=l[Symbol.iterator]();!(g=(P=I.next()).done);g=!0)D=P.value,U=D.port,et(U,uke(o));J.next=14;break;case 10:J.prev=10,J.t0=J.catch(6),y=!0,A=J.t0;case 14:J.prev=14,J.prev=15,!g&&I.return!=null&&I.return();case 17:if(J.prev=17,!y){J.next=20;break}throw A;case 20:return J.finish(17);case 21:return J.finish(14);case 22:case"end":return J.stop()}},a,null,[[6,10,14,22],[15,,17,21]])}))()},i.emitMultiChainProviderMessage=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(console.debug("[ProviderMessageController] emitMultiChainProviderMessage",o),u=o.origin,l=WC.getByOrigin(u),l){J.next=5;break}return J.abrupt("return");case 5:for(g=!0,y=!1,A=void 0,J.prev=6,I=l[Symbol.iterator]();!(g=(P=I.next()).done);g=!0)D=P.value,U=D.port,et(U,cke(o));J.next=14;break;case 10:J.prev=10,J.t0=J.catch(6),y=!0,A=J.t0;case 14:J.prev=14,J.prev=15,!g&&I.return!=null&&I.return();case 17:if(J.prev=17,!y){J.next=20;break}throw A;case 20:return J.finish(17);case 21:return J.finish(14);case 22:case"end":return J.stop()}},a,null,[[6,10,14,22],[15,,17,21]])}))()},n}(Yr),R1=new lke,YM="0x095ea7b3";function fke(r){if(!r.startsWith(YM))throw new Error("Invalid approve data");var e=r.slice(10),n="0x"+e.slice(0,64).replace(/^0+/,""),i=ti("0x"+e.slice(64));return{spender:n,amount:i}}function dke(r,e){var n=r.toLowerCase().replace(/^0x/,"").padStart(64,"0"),i=e.toString(16).padStart(64,"0");return YM+n+i}function hke(r,e){try{if(e.isNaN()||!e.isFinite())throw new Error("Invalid amount");var n=fke(r).spender;return dke(n,e)}catch(i){return console.error(i),r}}function tre(r){try{var e=r.params[0].data;return e.startsWith(YM)}catch(n){console.error(n)}}var fm={sendWKRpc:function(e,n){var i="/v1/public/wallet-direct/buw/jsonrpc";return Gn(i,{method:e,params:n,jsonrpc:"2.0",id:1}).then(function(s){return s.data.result})}},rg;(function(r){r.PENDING="init",r.SUBMITTED="submitted",r.CONFIRMED="confirmed",r.FAILED="failed",r.REPLACED="replaced",r.SUBMIT_FAIL="submit_fail",r.PARTIAL_SUCCESS="partial_success",r.EXPIRE_FAIL="expire_fail"})(rg||(rg={}));var rre;(function(r){r.DEFAULT="normal",r.CANCEL="cancel",r.SPEED_UP="speedup"})(rre||(rre={}));var hh;(function(r){r.TRANSFER="transfer",r.APPROVE="approve",r.SWAP="swap",r.BRIDGE="bridge",r.REGISTER="register",r.CONTRACT_CALL="contract_call",r.DEPLOY_CONTRACT="deploy",r.AUTHORITY="authority",r.BULK_TRANSACTION="bulkTransaction",r.BULK_USER_OPERATION="bulkUserOperation",r.DEPOSIT="deposit",r.WITHDRAW="withdraw",r.ADD_LIQUIDITY="add_liquidity",r.REMOVE_LIQUIDITY="rm_liquidity",r.STAKE="stake",r.UNSTAKE="unstake",r.BORROW="borrow",r.REPAY="repay",r.CLAIM="claim",r.SUPPLY="supply",r.REDEEM="redeem"})(hh||(hh={}));var C1;(function(r){r.SEND="send",r.RECEIVE="receive",r.SWAP="swap",r.BRIDGE="bridge",r.APPROVE="approve",r.REVOKE="revoke",r.REGISTER="register",r.CONTRACT_CALL="contract_call",r.AUTHORITY="authority",r.BULK_TRANSACTION="bulkTransaction",r.BULK_USER_OPERATION="bulkUserOperation",r.DEPOSIT="deposit",r.WITHDRAW="withdraw",r.ADD_LIQUIDITY="add_liquidity",r.REMOVE_LIQUIDITY="rm_liquidity",r.STAKE="stake",r.UNSTAKE="unstake",r.BORROW="borrow",r.REPAY="repay",r.CLAIM="claim",r.SUPPLY="supply",r.REDEEM="redeem"})(C1||(C1={}));var itt=null,stt=new Set(Object.values(C1)),nre;(function(r){r.DEFI="defi"})(nre||(nre={}));var pke=function(r){if(!r)return function(){return!0};var e=Hm(r),n=e.chainId,i=e.tokenContract,s=i,o=s===bC;return function(a){var u,l=a.parsedTx;return l?((u=a.parsedTx.contractAddress)===null||u===void 0?void 0:u.toLowerCase())===s?!0:o?l.type===lm.Send&&!a.parsedTx.contractAddress:!1:!1}},gke=function(r,e){if(!r)return!0;switch(r){case"send":return e.txType===hh.TRANSFER&&e.subType===C1.SEND;case"contract_call":return e.txType===hh.CONTRACT_CALL;case"approve":return e.txType===hh.APPROVE;case"others":return![hh.TRANSFER,hh.CONTRACT_CALL,hh.APPROVE].includes(e.txType);default:return!0}},yke=du,ott=null;function mke(r){var e=new TextEncoder().encode(r);return btoa(String.fromCharCode.apply(null,Array.from(e)))}function HC(r){var e=new TextEncoder().encode(r);return e}function bke(r){var e=new TextDecoder("utf8");return e.decode(r)}function att(r){var e=new TextEncoder().encode(r);return bytesToHex(e)}function utt(r){return bytesToBase64(hexToBytes(r))}function XM(r){var e=yf(r);return ys(Jo(e))}function ire(r){return new Uint8Array(r)}function sre(r){var e=Number(r);return du(e.toString(16))}var vke=rf(function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return i=n.chainId,s=n.blockNumber,o=sre(s),a=D4(i,o),y.next=5,Pn.get(a);case 5:if(u=y.sent,!u){y.next=8;break}return y.abrupt("return",u);case 8:return y.next=10,Sc.send(i,{method:"eth_getBlockByNumber",params:[o,!1]});case 10:return l=y.sent,y.next=13,Pn.upsert(a,l);case 13:return y.abrupt("return",l);case 14:case"end":return y.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),{cacheTime:5*100,hashArg:function(r){return"".concat(r.chainId,"-").concat(r.blockNumber)}}),ore=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn,Ar,Xr;return b().wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:if(i=n.parsedTx,s=n.chainId,o=n.address,a=n.txHash,u=n.status,l=n.createTime,g=n.receipt,y=n.feeInfo,A=n.txRaw,I=l,P=g?.blockNumber,D=null,!P){Bn.next=9;break}return Bn.next=7,vke({chainId:s,blockNumber:sre(P)});case 7:D=Bn.sent,D&&(I=Number(D.timestamp)*1e3);case 9:return U=i.type,V=i.spender,J=i.contractAddress,re=i.tokenId,ce=i.recipient,Re=i.amount,De=i.memo,Ue=i.action,Ve=i.balanceChanges,pe=i.allowanceChanges,Se=i.authorityChanges,Ce=i.tokenInfoMap,je=i.rawData,$e=J?.toLowerCase(),Qe=String(Re),Bn.next=14,vo.getCustomChainByChainId(s);case 14:if(nt=Bn.sent,nt){Bn.next=17;break}return Bn.abrupt("return",null);case 17:if(Ne=nt.chainId,Me={binanceChainId:s,feeTokenAddress:nt.nativeTokenAddress,feeTokenSymbol:nt.nativeToken,feeTokenDecimals:nt.nativeTokenDecimals,feeValue:"0"},ct={isCustomChainTx:!0,binanceChainId:Ne,address:o,from:o,txHash:a,txFee:Me,status:u,rawData:je,txTime:I,networkId:Pf(Ne)},mt="0",g&&g.effectiveGasPrice?mt=g.effectiveGasPrice:A&&(mt=A.gasPrice),g&&mt!=="0"?(Bt=g.gasUsed,er=ti(mt).multipliedBy(Bt),g.l1Fee&&(er=ti(g.l1Fee).plus(er)),Me.feeValue=er.toFixed()):y&&(Me.feeValue=String(y.feeAmount)),cr={binanceChainId:Ne,txHash:a,networkFee:Me},U!==lm.Send){Bn.next=32;break}return pr=$e||nt.nativeTokenAddress,Dr=Ce[pr],Rr={addressInfo:{address:o},tokenInfo:{contractAddress:pr,symbol:Dr?.symbol,decimals:Dr?.decimals},binanceChainId:Ne,amount:Qe},Pr={send:[Rr]},Bn.abrupt("return",gn(Mr({},ct),{txType:hh.TRANSFER,subType:C1.SEND,instructions:Pr,to:ce,txHashList:[gn(Mr({},cr),{instructions:Pr})]}));case 32:if(U!==lm.Approve){Bn.next=39;break}return on=$e,xn=Ce[on],Ar={approve:{binanceChainId:Ne,amount:Qe,to:{address:V},tokenInfo:{binanceChainId:Ne,contractAddress:on,symbol:xn?.symbol,decimals:xn?.decimals}}},Bn.abrupt("return",gn(Mr({},ct),{txType:hh.APPROVE,subType:C1.APPROVE,txHashList:[gn(Mr({},cr),{instructions:Ar})]}));case 39:return Xr={contractCall:{to:{address:$e}}},Bn.abrupt("return",gn(Mr({},ct),{txType:hh.CONTRACT_CALL,subType:C1.CONTRACT_CALL,txHashList:[gn(Mr({},cr),{instructions:Xr})]}));case 41:case"end":return Bn.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),wke=function(){"use strict";function r(){(0,G.A)(this,r),this.txIdMap={}}var e=r.prototype;return e.refreshTxs=function(){var i=Object.values(this.txIdMap),s=!0,o=!1,a=void 0;try{for(var u=i[Symbol.iterator](),l;!(s=(l=u.next()).done);s=!0){var g=l.value;g()}}catch(y){o=!0,a=y}finally{try{!s&&u.return!=null&&u.return()}finally{if(o)throw a}}},e.addTxId=function(i,s){var o=this;if(!this.txIdMap[i]){var a=new Nh(function(){return Ake(s)});this.txIdMap[i]=function(){return a.execute(function(){return o.pollTxById(i).catch(function(u){console.error(u)})})}}},e.pollTxById=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return a=U4(i),u=a.chainId,l=a.txHash,g=a.userAddress,D.prev=2,D.next=5,Sc.send(u,{method:"eth_getTransactionReceipt",params:[l],id:1,jsonrpc:"2.0"});case 5:y=D.sent,D.next=11;break;case 8:return D.prev=8,D.t0=D.catch(2),D.abrupt("return");case 11:if(y){D.next=13;break}return D.abrupt("return");case 13:if(A=y.status,A!=="0x1"){D.next=25;break}return D.next=17,Sc.send(u,{method:"eth_getTransactionByHash",params:[l],id:1,jsonrpc:"2.0"});case 17:return I=D.sent,D.next=20,jr.update(i,{status:rg.CONFIRMED,receipt:y,txRaw:I});case 20:return s.onTxIdFinished(i),D.next=23,Da.refreshBalanceForAddressOnChain(g,Pf(u),{skipThrottle:!0});case 23:D.next=29;break;case 25:if(A!=="0x0"){D.next=29;break}return D.next=28,jr.update(i,{status:rg.FAILED,receipt:y});case 28:s.onTxIdFinished(i);case 29:case"end":return D.stop()}},o,null,[[2,8]])}))()},e.onTxIdFinished=function(i){console.log("[CustomChainTxPoller]:onTxIdFinished",i),delete this.txIdMap[i]},r}(),zC=new wke;globalThis.customChainTxPoller=zC;var Ake=function(r){var e=Date.now(),n=e-r;return n<=5*60*1e3?3*1e3:n<=60*60*1e3?5*60*1e3:60*60*1e3},_ke=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="customChainTx",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:setTimeout(function(){o._pollPendingTx()},0),wo.registerOnUiActiveEvent(function(){return zC.refreshTxs()});case 2:case"end":return l.stop()}},a)}))()},i.addTx=function(o){var a=o.parsedTx,u=o.address,l=o.chainId,g=o.txHash,y=o.feeInfo;return(0,k.A)(b().mark(function A(){var I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,vo.getCustomChainByChainId(l);case 2:if(I=U.sent,I){U.next=5;break}throw Error("Cannot find custom chain");case 5:return P=Ya(l,g,u),U.next=8,jr.upsert(P,{parsedTx:a,chainId:l,address:u,txHash:g,status:rg.SUBMITTED,createTime:Date.now(),feeInfo:y});case 8:zC.addTxId(P,Date.now());case 9:case"end":return U.stop()}},A)}))()},i.txHistory=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je;return b().wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:if(u=o.walletId,l=o.networkId,g=o.startTime,y=o.endTime,A=o.tokenId,I=o.activityType,P=Pd(l),D=void 0,!u){Qe.next=8;break}return Qe.next=6,vn.getWalletItemByWalletId(u);case 6:U=Qe.sent,U&&(V=dh(U,nn.evm)[0],V&&(D=V));case 8:if(J="",A&&(re=Hm(A),ce=re.chainId,Re=re.tokenContract,J=Re),De=[],!D){Qe.next=17;break}return Qe.next=14,jr.table.where({chainId:P,address:D}).toArray();case 14:De=Qe.sent,Qe.next=25;break;case 17:return Qe.next=19,vn.getWalletList();case 19:return Ue=Qe.sent,Ve=Ue.map(function(nt){return dh(nt,nn.evm)[0]}).filter(Boolean),Qe.next=23,Promise.all(Ve.map(function(nt){return jr.table.where({chainId:P,address:nt}).toArray()}));case 23:pe=Qe.sent,De=(0,H.flatten)(pe);case 25:return Qe.next=27,Promise.all(De.filter(pke(A)).map(function(nt){return ore(nt)}));case 27:return Se=Qe.sent,Ce=function(nt){if(!nt)return!1;var Ne=!0;return g&&(Ne=Ne&&nt.txTime>=g),y&&(Ne=Ne&&nt.txTime<=y),I&&(Ne=Ne&&gke(I,nt)),Ne},je=Se.filter(Ce),je=(0,H.sortBy)(je,function(nt){return-nt.txTime}),Qe.abrupt("return",{list:je});case 32:case"end":return Qe.stop()}},a)}))()},i.txDetail=function(o){var a=o.chainId,u=o.address,l=o.txHash;return(0,k.A)(b().mark(function g(){var y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return y=Ya(a,l,u),P.next=3,jr.get(y);case 3:if(A=P.sent,A){P.next=6;break}return P.abrupt("return",null);case 6:return P.abrupt("return",ore(A));case 7:case"end":return P.stop()}},g)}))()},i._pollPendingTx=function(){return(0,k.A)(b().mark(function o(){var a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,jr.toArray();case 2:for(a=D.sent,u=!0,l=!1,g=void 0,D.prev=4,y=a[Symbol.iterator]();!(u=(A=y.next()).done);u=!0)I=A.value,[rg.FAILED,rg.CONFIRMED].includes(I.status)||zC.addTxId(I._id,I.createTime);D.next=12;break;case 8:D.prev=8,D.t0=D.catch(4),l=!0,g=D.t0;case 12:D.prev=12,D.prev=13,!u&&y.return!=null&&y.return();case 15:if(D.prev=15,!l){D.next=18;break}throw g;case 18:return D.finish(15);case 19:return D.finish(12);case 20:case"end":return D.stop()}},o,null,[[4,8,12,20],[13,,15,19]])}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[wo]}}]),n}(Yr),R2=new _ke;_e("customChainTx",{txHistory:R2.txHistory.bind(R2),txDetail:R2.txDetail.bind(R2)});function ctt(r,e){var n=[],i=!0,s=!1,o=void 0;try{for(var a=r[Symbol.iterator](),u;!(i=(u=a.next()).done);i=!0){var l=u.value,g=l.accounts,y=g.map(function(A){var I=A.addressList,P=I.filter(function(D){return D.network===e});return _object_spread_props(_object_spread({},A),{addressList:P})}).filter(function(A){return A.addressList.length>0});y.length>0&&n.push(_object_spread_props(_object_spread({},l),{accounts:y}))}}catch(A){s=!0,o=A}finally{try{!i&&a.return!=null&&a.return()}finally{if(s)throw o}}return n}function ltt(r,e){var n=r.accounts,i=n.map(function(s){var o=s.addressList,a=o.filter(function(u){return u.network===e});return _object_spread_props(_object_spread({},s),{addressList:a})}).filter(function(s){return s.addressList.length>0});return i.length>0}function Eke(r,e){var n=(0,H.flatten)(r.accounts.map(function(i){return i.addressList})).filter(function(i){return i.network===e}).map(function(i){return i.address});return n}var are=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return i=n.ret,s=n.customChainItem,o=n.userAddress,a=i.gasAccountList,u=s.nativeToken,l=s.nativeTokenAddress,g=s.nativeTokenDecimals,y=a[0],A=No(s.chainId,l),D.next=7,Da.getTokenBalanceOnAddress({tokenId:A,userAddress:o});case 7:return I=D.sent,D.abrupt("return",{feeInfo:Mr({},y.fee),costTokenSymbol:u,costTokenDecimals:g,balance:I,available:y.fee.succeedEstimateGas});case 9:case"end":return D.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),Tke=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="gas",s}var i=n.prototype;return i.getGasAccount=function(o){var a=o.networkId,u=o.walletId;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=3,Fi.getNetworkByNetworkId(a);case 3:if(A=V.sent,A){V.next=6;break}throw Error("No network for networkId:"+a);case 6:return V.next=8,vn.getWalletItemByWalletId(u);case 8:if(I=V.sent,I){V.next=11;break}throw Error("No wallet item for walletId:"+u);case 11:if(P=Eke(I,A.chainType),P.length){V.next=14;break}throw Error("Wallet not support for netword");case 14:return V.next=16,hn.Gas.gasAccountList({binanceChainId:A.binanceChainId,address:P[0]});case 16:if(D=V.sent,!((g=D.data)===null||g===void 0||(y=g.gasAccountList)===null||y===void 0)&&y.length){V.next=19;break}throw Error("Get gas account failed");case 19:return V.abrupt("return",D.data.gasAccountList[0]);case 20:case"end":return V.stop()}},l)}))()},i.getSignGasAccount=function(o,a,u,l){return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return I=o.networkId,P=o.accountId,D=o.networkType,U=Za(I),Re.next=5,vn.getAddressByAccountId(P,D);case 5:return V=Re.sent,Re.next=8,hn.Gas.gasAccountList({binanceChainId:U,address:V,transaction:a,walletType:u?"MPC":void 0,antiMev:l});case 8:if(J=Re.sent,re=J==null||(y=J.data)===null||y===void 0||(A=y.gasAccountList)===null||A===void 0?void 0:A[0],!(!re||!re.available)){Re.next=13;break}if(re?.reason==="INSUFFICIENT_BALANCE"){Re.next=13;break}throw Error("Get gas account failed");case 13:return Re.abrupt("return",re);case 14:case"end":return Re.stop()}},g)}))()},i.getCustomChainSignGasAccount=function(o){var a=o.signContext,u=o.gasAccountFrontedRpcRequests,l=o.transaction;return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return y=a.networkId,A=a.address,J.next=3,vo.getCustomChainByNetworkId(y);case 3:if(I=J.sent,I){J.next=6;break}throw Error("cannot get custom chain:".concat(Pd(y)));case 6:return P=I.chainId,D=I.name,J.next=10,bte({rpcProvider:Sc,wkRpcProvider:fm,chainId:P,chainName:D,transaction:l,address:A,gasAccountFrontedRpcRequests:u});case 10:return U=J.sent,J.abrupt("return",are({ret:U,customChainItem:I,userAddress:A}));case 12:case"end":return J.stop()}},g)}))()},n}(Yr),C2=new Tke;_e("gas",{getSignGasAccount:C2.getSignGasAccount.bind(C2),getCustomChainSignGasAccount:C2.getCustomChainSignGasAccount.bind(C2)});var Ske=function(r){switch(r){case Go.send:return Go.sendToMp;case Go.dapp:return Go.dappToMp;case Go.swap:return Go.swapToMap;case Go.revoke:return Go.revokeToMp;default:return Go.unknownToMp}},ure={},Ike=function(r){return ure[r]},JM=function(r,e){ure[r]=e},kke=function(r){var e=JSON.parse(r);return JSON.stringify(Mr({id:1,jsonrpc:"2.0"},e))},Rke=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="security",s}var i=n.prototype;return i.checkConnectWebsite=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return u=xu(),y.next=3,hn.Security.commonCheck({businessName:"web3_wallet_url_detection",params:{requestId:u,url:o}});case 3:return l=y.sent,y.abrupt("return",l.data);case 5:case"end":return y.stop()}},a)}))()},i.commonCheck=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.Security.commonCheck(o);case 2:return u=g.sent,g.abrupt("return",u.data);case 4:case"end":return g.stop()}},a)}))()},i.batchCheck=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.Security.batchCheck(o);case 2:return u=g.sent,g.abrupt("return",u.data);case 4:case"end":return g.stop()}},a)}))()},i.dataCollect=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,l.next=3,hn.Security.commonDataCollect(o);case 3:l.next=8;break;case 5:l.prev=5,l.t0=l.catch(0),console.error(l.t0);case 8:case"end":return l.stop()}},a,null,[[0,5]])}))()},n}(Yr),ng=new Rke;_e("security",{dataCollect:ng.dataCollect.bind(ng),commonCheck:ng.commonCheck.bind(ng),batchCheck:ng.batchCheck.bind(ng)});var Cke={addressTokenBalanceMap:{},staticTokenListIds:[],tokenPreferenceMap:{},tokenMetaMap:{},tokenPriceMap:{},ondoTokenMap:{},alphaTokenMap:{}},x1=Nr(Cke),mT=x1.addressTokenBalanceMapBgAtom,xke=x1.tokenPreferenceMapBgAtom,bT=x1.tokenMetaMapBgAtom,cre=x1.tokenPriceMapBgAtom,Bke=x1.staticTokenListIdsBgAtom,lre=x1.ondoTokenMapBgAtom,Oke=x1.alphaTokenMapBgAtom,ig;(function(r){r["1h"]="1h",r["24h"]="1d",r["7d"]="7d",r["30d"]="30d",r["1y"]="1y",r["5y"]="5y"})(ig||(ig={}));var fre=function(r){var e=r.contractAddress,n=r.binanceChainId;return"".concat(Wl(e),"-").concat(n)},$C=function(r){if(r)return r.split(",")},QM=["NT_42766","A97B597E63B7FCC51BB9E307E13EC2E3","NT_1","NT_56","NT_CT_501","NT_CT_195"],ftt=function(r,e,n){var i=BigNumber(e.balanceUSD).comparedTo(r.balanceUSD);if(i!==0)return i;var s=r.balance,o=e.balance,a=BigNumber(o).comparedTo(s);if(a!==0)return a;var u=Pke(r.tokenMeta,e.tokenMeta);if(u)return u;if(!n?.skipSymbolSort){var l,g,y=(l=r.tokenMeta)===null||l===void 0?void 0:l.symbol,A=(g=e.tokenMeta)===null||g===void 0?void 0:g.symbol;return y===A?0:y?A?y.localeCompare(A):-1:1}return 0},Pke=function(r,e){var n=QM.indexOf(String(r.binanceTokenId)),i=QM.indexOf(String(e.binanceTokenId));return n===-1&&i===-1?0:n===-1?1:i===-1?-1:n-i},Nke={approvalConfigInfo:{supportChain:[],unLimitAmount:""},walletApproveCountMap:{},walletRiskyApproveCountMap:{},walletRiskyLevel5ApproveCountMap:{},walletAddressRiskyCountMap:{},approveSpenderList:[],riskyWalletNoticeConfirmed:!1},dtt=function(r,e){return"".concat(r.toLowerCase(),"-").concat(e)},B1=Nr(Nke,{persistKeys:["riskyWalletNoticeConfirmed"]}),dre=B1.approvalConfigInfoBgAtom,e9=B1.walletApproveCountMapBgAtom,t9=B1.walletRiskyApproveCountMapBgAtom,Mke=B1.walletRiskyLevel5ApproveCountMapBgAtom,Lke=B1.walletAddressRiskyCountMapBgAtom,Dke=B1.approveSpenderListBgAtom,Uke=B1.riskyWalletNoticeConfirmedBgAtom,Fke=15e7,Wke=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(s=no(yC),o=cm.getRpcUrl(s),o){y.next=5;break}throw new Error("Tron RPC node URL not found");case 5:return a=new pi({fullHost:o}),y.next=8,a.transactionBuilder.triggerSmartContract(n.tokenContract,"approve(address,uint256)",{feeLimit:Fke},[{type:"address",value:n.spender},{type:"uint256",value:n.amount}],n.address);case 8:if(u=y.sent,!(u==null||(i=u.result)===null||i===void 0)&&i.result){y.next=12;break}throw new Error((u==null||(l=u.result)===null||l===void 0?void 0:l.message)||"Failed to build Tron approve transaction");case 12:return y.abrupt("return",u.transaction);case 13:case"end":return y.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),r9=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(i=n.binanceChainId,s=n.tokenContract,o=n.address,a=n.spender,u=n.amount,i!==yC){A.next=6;break}return A.next=4,Wke({tokenContract:s,address:o,spender:a,amount:u});case 4:return l=A.sent,A.abrupt("return",{id:1,method:"tron_signAndSendTransaction",jsonrpc:"2.0",params:l});case 6:return g=new am(["function approve(address spender,uint256 amount) returns (bool)"]).encodeFunctionData("approve",[a,u]),A.abrupt("return",{method:"eth_sendTransaction",jsonrpc:"2.0",params:[{to:s,data:g,value:"0x0",from:o}]});case 8:case"end":return A.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),Hke=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return i=n.permit2ContractAddress,s=n.address,o=n.tokenContract,a=n.spender,u=[{token:o,spender:a}],l=[{inputs:[{components:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"spender",type:"address"}],internalType:"struct IAllowanceTransfer.TokenSpenderPair[]",name:"approvals",type:"tuple[]"}],name:"lockdown",outputs:[],stateMutability:"nonpayable",type:"function"}],g=new am(l),y=g.encodeFunctionData("lockdown",[u]),I.abrupt("return",{method:"eth_sendTransaction",jsonrpc:"2.0",params:[{to:i,data:y,value:"0x0",from:s}]});case 6:case"end":return I.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),hre=new WeakSet,VC=new WeakSet,n9=new WeakSet,pre=new WeakSet,gre=new WeakSet,i9=new WeakSet,yre=new WeakSet,zke=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;s=e.apply(this,arguments),B(F(s),hre),B(F(s),VC),B(F(s),n9),B(F(s),pre),B(F(s),gre),B(F(s),i9),B(F(s),yre),s.name="tokenApproval";var o=F(s);s.refreshRiskyApproveCount=rf((0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:setTimeout((0,k.A)(b().mark(function y(){return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Promise.all([K(o,VC,o9).call(o),K(o,i9,bre).call(o)]);case 2:case"end":return I.stop()}},y)})),100);case 1:case"end":return g.stop()}},u)})),{cacheTime:5e3});var a=F(s);return s.refreshApproveCount=rf((0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:setTimeout((0,k.A)(b().mark(function y(){return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Promise.all([K(a,hre,$ke).call(a),K(a,pre,Vke).call(a),K(a,VC,o9).call(a),K(a,i9,bre).call(a)]);case 2:case"end":return I.stop()}},y)})),100);case 1:case"end":return g.stop()}},u)})),{cacheTime:5e3}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return setTimeout(function(){K(o,gre,jke).call(o)}),l.next=3,o.refreshApproveCount();case 3:globalThis.makeApproveTokenSignRequest=r9;case 4:case"end":return l.stop()}},a)}))()},i.getApprovalList=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return u=o.walletIds,l=o.networkId,g=o.limit,y=bs(o,["walletIds","networkId","limit"]),V.next=3,vn.splitWalletIdsToQueryArg(u||[]);case 3:return A=V.sent,V.next=6,hn.TokenApproval.approvalList(gn(Mr({limit:g},y,A),{binanceChainId:L4(l)}));case 6:return I=V.sent,P=I.data.list,D=null,P.length>=g&&(D=P[P.length-1].offset),V.abrupt("return",{list:P,nextToken:D});case 11:case"end":return V.stop()}},a)}))()},i.getApprovalRecords=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return u=o.limit,I.next=3,hn.TokenApproval.approvalRecords(o);case 3:return l=I.sent,g=l.data.list,y=null,g.length>=u&&(y=g[g.length-1].offset),I.abrupt("return",{list:g,nextOffset:y});case 8:case"end":return I.stop()}},a)}))()},i.getApprovalRiskyAlert=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.TokenApproval.approvalRiskAlert(o);case 2:return u=g.sent,g.abrupt("return",u.data);case 4:case"end":return g.stop()}},a)}))()},i.getApprovalBatchRiskAlert=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.TokenApproval.approvalBatchRiskAlert(o);case 2:return u=g.sent,g.abrupt("return",u.data.list);case 4:case"end":return g.stop()}},a)}))()},i.getApprovalDetail=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.TokenApproval.approvalDetail(o);case 2:return u=g.sent,g.abrupt("return",u.data);case 4:case"end":return g.stop()}},a)}))()},i.revokeApproval=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return u=o.type,l=o.binanceChainId,g=o.tokenContract,y=o.address,A=o.spender,I=o.permit2ContractAddress,De.next=3,Fi.getNetworkByChainId(l);case 3:if(P=De.sent,P){De.next=6;break}throw Error("Network not found for binanceChainId:".concat(l));case 6:return D=P.chainType,De.next=9,vn.getWalletItemByAddress(y,no(l));case 9:if(U=De.sent,U){De.next=12;break}throw Error("Cannot found wallet for address: ".concat(y));case 12:if(V=_ee(y,U),V){De.next=15;break}throw Error("Cannot found account in wallet address: ".concat(y));case 15:if(J={origin:"",networkType:D,accountId:V.id,networkId:P.id,signSource:Go.revoke,address:y},u!=="approve"){De.next=23;break}return De.next=20,r9({binanceChainId:l,tokenContract:g,address:y,spender:A,amount:"0"});case 20:re=De.sent,De.next=30;break;case 23:if(!I){De.next=29;break}return De.next=26,Hke({binanceChainId:l,tokenContract:g,address:y,spender:A,permit2ContractAddress:I});case 26:re=De.sent,De.next=30;break;case 29:throw Error("unknown revoke type");case 30:return De.next=32,kf.sendTransaction(J,re);case 32:return ce=De.sent,De.abrupt("return",ce.txHash);case 34:case"end":return De.stop()}},a)}))()},i.approveToken=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return u=o.binanceChainId,l=o.tokenContract,g=o.address,y=o.spender,A=o.amount,Re.next=3,Fi.getNetworkByChainId(u);case 3:if(I=Re.sent,I){Re.next=6;break}throw Error("Network not found for binanceChainId:".concat(u));case 6:return P=I.chainType,Re.next=9,vn.getWalletItemByAddress(g,no(u));case 9:if(D=Re.sent,D){Re.next=12;break}throw Error("Cannot found wallet for address: ".concat(g));case 12:if(U=_ee(g,D),U){Re.next=15;break}throw Error("Cannot found account in wallet address: ".concat(g));case 15:return V={origin:"",networkType:P,accountId:U.id,networkId:I.id,signSource:Go.revoke,address:g},Re.next=18,r9({binanceChainId:u,tokenContract:l,address:g,spender:y,amount:A});case 18:return J=Re.sent,Re.next=21,kf.sendTransaction(V,J);case 21:return re=Re.sent,Re.abrupt("return",re.txHash);case 23:case"end":return Re.stop()}},a)}))()},i.completeRiskyWalletNoticeConfirm=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.set(Uke,!0);case 2:return u.abrupt("return",!0);case 3:case"end":return u.stop()}},o)}))()},i.updateApproveCountForWalletId=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt;return b().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,vn.getWalletItemByWalletId(o);case 2:if(u=Me.sent,u){Me.next=5;break}return Me.abrupt("return");case 5:return Me.next=7,vn.splitWalletIdsToQueryArg([o]);case 7:return l=Me.sent,Me.next=10,hn.TokenApproval.approvalNum(l);case 10:return g=Me.sent,Me.next=13,hn.TokenApproval.riskyApprovalNum(l);case 13:for(y=Me.sent,A=g.data.list,I=y.data.list,P={},D={},U=!0,V=!1,J=void 0,Me.prev=19,re=A[Symbol.iterator]();!(U=(ce=re.next()).done);U=!0)Re=ce.value,P[Re.walletId]=Re.approvalNum;Me.next=27;break;case 23:Me.prev=23,Me.t0=Me.catch(19),V=!0,J=Me.t0;case 27:Me.prev=27,Me.prev=28,!U&&re.return!=null&&re.return();case 30:if(Me.prev=30,!V){Me.next=33;break}throw J;case 33:return Me.finish(30);case 34:return Me.finish(27);case 35:for(De=!0,Ue=!1,Ve=void 0,Me.prev=36,pe=I[Symbol.iterator]();!(De=(Se=pe.next()).done);De=!0)Ce=Se.value,D[Ce.walletId]=Ce.riskyNum;Me.next=44;break;case 40:Me.prev=40,Me.t1=Me.catch(36),Ue=!0,Ve=Me.t1;case 44:Me.prev=44,Me.prev=45,!De&&pe.return!=null&&pe.return();case 47:if(Me.prev=47,!Ue){Me.next=50;break}throw Ve;case 50:return Me.finish(47);case 51:return Me.finish(44);case 52:return Me.next=54,zt.get(e9);case 54:return je=Me.sent,Me.next=57,zt.get(t9);case 57:return $e=Me.sent,Qe=je||{},Qe=Mr({},Qe,P),nt=$e||{},nt=Mr({},nt,D),Me.next=64,zt.set(e9,Qe);case 64:return Me.next=66,zt.set(t9,nt);case 66:case"end":return Me.stop()}},a,null,[[19,23,27,35],[28,,30,34],[36,40,44,52],[45,,47,51]])}))()},i.refreshRiskyApproveCountNoCache=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,VC,o9).call(o);case 2:case"end":return l.stop()}},a)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[vn,Fi]}}]),n}(Yr);function $ke(){return s9.apply(this,arguments)}function s9(){return s9=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,vn.getWalletList();case 2:return e=I.sent,n=e.map(function(P){return P.id}),I.next=6,A1({input:n,fn:function(){var P=(0,k.A)(b().mark(function D(U){var V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,vn.splitWalletIdsToQueryArg(U);case 2:return V=ce.sent,ce.next=5,hn.TokenApproval.approvalNum(V);case 5:return J=ce.sent,ce.abrupt("return",J.data.list);case 7:case"end":return ce.stop()}},D)}));return function(D){return P.apply(this,arguments)}}(),merge:function(P){return(0,H.flatten)(P)},chunkSize:5});case 6:for(i=I.sent,s={},o=!0,a=!1,u=void 0,I.prev=9,l=i[Symbol.iterator]();!(o=(g=l.next()).done);o=!0)y=g.value,s[y.walletId]=y.approvalNum;I.next=17;break;case 13:I.prev=13,I.t0=I.catch(9),a=!0,u=I.t0;case 17:I.prev=17,I.prev=18,!o&&l.return!=null&&l.return();case 20:if(I.prev=20,!a){I.next=23;break}throw u;case 23:return I.finish(20);case 24:return I.finish(17);case 25:return I.next=27,zt.set(e9,s);case 27:case"end":return I.stop()}},r,null,[[9,13,17,25],[18,,20,24]])})),s9.apply(this,arguments)}function o9(){return a9.apply(this,arguments)}function a9(){return a9=(0,k.A)(b().mark(function r(){var e,n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,K(this,n9,mre).call(this,ou.HighRisk);case 2:return e=s.sent,s.next=5,K(this,n9,mre).call(this,ou.Blacklist);case 5:return n=s.sent,s.next=8,zt.set(t9,e);case 8:return s.next=10,zt.set(Mke,n);case 10:case"end":return s.stop()}},r,this)})),a9.apply(this,arguments)}function mre(r){return u9.apply(this,arguments)}function u9(){return u9=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,vn.getWalletList();case 2:return n=P.sent,i=n.map(function(D){return D.id}),P.next=6,A1({input:i,fn:function(){var D=(0,k.A)(b().mark(function U(V){var J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return Re.next=2,vn.splitWalletIdsToQueryArg(V);case 2:return J=Re.sent,Re.next=5,hn.TokenApproval.riskyApprovalNum(gn(Mr({},J),{minRiskLevel:e}));case 5:return re=Re.sent,Re.abrupt("return",re.data.list);case 7:case"end":return Re.stop()}},U)}));return function(U){return D.apply(this,arguments)}}(),merge:function(D){return(0,H.flatten)(D)},chunkSize:5});case 6:for(s=P.sent,o={},a=!0,u=!1,l=void 0,P.prev=9,g=s[Symbol.iterator]();!(a=(y=g.next()).done);a=!0)A=y.value,o[A.walletId]=A.riskyNum;P.next=17;break;case 13:P.prev=13,P.t0=P.catch(9),u=!0,l=P.t0;case 17:P.prev=17,P.prev=18,!a&&g.return!=null&&g.return();case 20:if(P.prev=20,!u){P.next=23;break}throw l;case 23:return P.finish(20);case 24:return P.finish(17);case 25:return P.abrupt("return",o);case 26:case"end":return P.stop()}},r,null,[[9,13,17,25],[18,,20,24]])})),u9.apply(this,arguments)}function Vke(){return c9.apply(this,arguments)}function c9(){return c9=(0,k.A)(b().mark(function r(){var e,n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,vn.getWalletList();case 2:return e=a.sent,n=e.map(function(u){return u.id}),a.next=6,vn.splitWalletIdsToQueryArg(n);case 6:return i=a.sent,a.next=9,K(this,yre,Kke).call(this,{fetchFn:function(){var u=(0,k.A)(b().mark(function l(g){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,hn.TokenApproval.approvalSpenderList(Mr({limit:20,offset:g},i));case 2:return y=I.sent,I.abrupt("return",y.data.list);case 4:case"end":return I.stop()}},l)}));return function(l){return u.apply(this,arguments)}}(),limit:20});case 9:return s=a.sent,a.next=12,zt.set(Dke,s);case 12:case"end":return a.stop()}},r,this)})),c9.apply(this,arguments)}function jke(){return l9.apply(this,arguments)}function l9(){return l9=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,hn.TokenApproval.approvalConfigInfo();case 2:return e=i.sent,i.next=5,zt.set(dre,e.data);case 5:case"end":return i.stop()}},r)})),l9.apply(this,arguments)}function bre(){return f9.apply(this,arguments)}function f9(){return f9=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er;return b().wrap(function(pr){for(;;)switch(pr.prev=pr.next){case 0:return pr.next=2,vn.getWalletList();case 2:return e=pr.sent,pr.next=5,zt.get(dre);case 5:return n=pr.sent,i=n.supportChain,pr.next=9,Promise.all(i.map(function(Dr){return Fi.getNetworkByChainId(Dr)}));case 9:s=pr.sent,o=(0,H.keyBy)(s.filter(Boolean),function(Dr){return Dr.binanceChainId}),a={},u=new Set,l=!0,g=!1,y=void 0,pr.prev=14,A=i[Symbol.iterator]();case 16:if(l=(I=A.next()).done){pr.next=64;break}P=I.value,D=!0,U=!1,V=void 0,pr.prev=19,J=e[Symbol.iterator]();case 21:if(D=(re=J.next()).done){pr.next=47;break}if(ce=re.value,De=(Re=o[P])===null||Re===void 0?void 0:Re.chainType,!De){pr.next=44;break}for(Ue=dh(ce,De),Ve=!0,pe=!1,Se=void 0,pr.prev=28,Ce=Ue[Symbol.iterator]();!(Ve=(je=Ce.next()).done);Ve=!0)$e=je.value,u.add($e);pr.next=36;break;case 32:pr.prev=32,pr.t0=pr.catch(28),pe=!0,Se=pr.t0;case 36:pr.prev=36,pr.prev=37,!Ve&&Ce.return!=null&&Ce.return();case 39:if(pr.prev=39,!pe){pr.next=42;break}throw Se;case 42:return pr.finish(39);case 43:return pr.finish(36);case 44:D=!0,pr.next=21;break;case 47:pr.next=53;break;case 49:pr.prev=49,pr.t1=pr.catch(19),U=!0,V=pr.t1;case 53:pr.prev=53,pr.prev=54,!D&&J.return!=null&&J.return();case 56:if(pr.prev=56,!U){pr.next=59;break}throw V;case 59:return pr.finish(56);case 60:return pr.finish(53);case 61:l=!0,pr.next=16;break;case 64:pr.next=70;break;case 66:pr.prev=66,pr.t2=pr.catch(14),g=!0,y=pr.t2;case 70:pr.prev=70,pr.prev=71,!l&&A.return!=null&&A.return();case 73:if(pr.prev=73,!g){pr.next=76;break}throw y;case 76:return pr.finish(73);case 77:return pr.finish(70);case 78:return Qe=Array.from(u),pr.next=81,A1({input:Qe,fn:function(){var Dr=(0,k.A)(b().mark(function Rr(Pr){var on;return b().wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return Ar.next=2,hn.TokenApproval.batchAddressCheckRisky({addresses:Pr.join(","),minRiskLevel:ou.HighRisk});case 2:return on=Ar.sent,Ar.abrupt("return",on.data.list);case 4:case"end":return Ar.stop()}},Rr)}));return function(Rr){return Dr.apply(this,arguments)}}(),merge:function(Dr){return(0,H.flatten)(Dr)},chunkSize:10});case 81:for(nt=pr.sent,Ne=!0,Me=!1,ct=void 0,pr.prev=83,mt=nt[Symbol.iterator]();!(Ne=(Bt=mt.next()).done);Ne=!0)er=Bt.value,a[er.address.toLowerCase()]=er.riskyNum;pr.next=91;break;case 87:pr.prev=87,pr.t3=pr.catch(83),Me=!0,ct=pr.t3;case 91:pr.prev=91,pr.prev=92,!Ne&&mt.return!=null&&mt.return();case 94:if(pr.prev=94,!Me){pr.next=97;break}throw ct;case 97:return pr.finish(94);case 98:return pr.finish(91);case 99:return pr.next=101,zt.set(Lke,a);case 101:case"end":return pr.stop()}},r,null,[[14,66,70,78],[19,49,53,61],[28,32,36,44],[37,,39,43],[54,,56,60],[71,,73,77],[83,87,91,99],[92,,94,98]])})),f9.apply(this,arguments)}function Kke(r){return d9.apply(this,arguments)}function d9(){return d9=(0,k.A)(b().mark(function r(e){var n,i,s,o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:n=e.fetchFn,i=e.limit,s=[],o=void 0;case 3:return l.next=6,n(o);case 6:if(a=l.sent,a=a||[],s=s.concat(a),!(a.length<i)){l.next=11;break}return l.abrupt("break",14);case 11:o=a[a.length-1].offset,l.next=3;break;case 14:return l.abrupt("return",s);case 15:case"end":return l.stop()}},r)})),d9.apply(this,arguments)}var ta=new zke;_e("tokenApproval",{getApprovalList:ta.getApprovalList.bind(ta),getApprovalDetail:ta.getApprovalDetail.bind(ta),getApprovalRecords:ta.getApprovalRecords.bind(ta),getApprovalRiskyAlert:ta.getApprovalRiskyAlert.bind(ta),getApprovalBatchRiskAlert:ta.getApprovalBatchRiskAlert.bind(ta),revokeApproval:ta.revokeApproval.bind(ta),approveToken:ta.approveToken.bind(ta),refreshApproveCount:ta.refreshApproveCount.bind(ta),completeRiskyWalletNoticeConfirm:ta.completeRiskyWalletNoticeConfirm.bind(ta)});var vre={},h9=[],p9=["channel","sourceTime","wsResp","wsReqId","reqTime","reqAction","service","tag","reqArgs","wsReqId","respTime","reqAction","respError","errorCode","errorMsg","resp"],g9=function(r){Object.assign(vre,r)};function Gke(r){return h9.includes(r)?!1:(h9.push(r),!0)}function htt(r){return typeof r.number=="number"&&typeof r.scope=="string"}function qke(r){var e=vre[r.key];return e?Object.assign(r,e):null}var Qc=function(r){return h9.map(qke).filter(Boolean).filter(function(e){return r?Object.keys(r).every(function(n){return e[n]===r[n]}):!0})},Zke=function(r){"use strict";N(n,r);var e=te(n);function n(i){(0,G.A)(this,n);var s;return s=e.call(this,i),s.name=s.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(F(s),s.constructor),s}return n}(qte(Error)),wre={};function x2(r){if(!wre[r]){wre[r]=!0;var e=setTimeout(function(){throw clearTimeout(e),new Zke(r)},1e3)}}var Yke=tn(65747);const Xke=/BNC\/([0-9.]+) \(([a-zA-Z]+) ([0-9.]+)\)/,jC=(r,e,n)=>Object.defineProperty(r,e,{value:n}),Are=r=>{if(typeof r!="string")throw new TypeError("agent must be a string");const e=r.match(Xke),n=Object.create({isHybrid:!1});if(e){const i=e[1];jC(n,"bridgeVersion",i),jC(n,"clientType",e[2]),jC(n,"clientVersion",e[3]),jC(n,"isHybrid",!!i)}return n};let _re,Ere;const ptt=r=>{Ere=r},Jke=()=>Ere||(typeof navigator<"u"?navigator.userAgent:"");function O1(r){return arguments.length===0?_re||(_re=Are(Jke())):Are(r)}var Qke=function(){"use strict";function r(n){(0,G.A)(this,r),this.cache=new Map,this.maxSize=n}var e=r.prototype;return e.get=function(i){if(this.cache.has(i)){var s=this.cache.get(i);return this.cache.delete(i),this.cache.set(i,s),s}return null},e.set=function(i,s){if(this.cache.has(i))this.cache.delete(i);else if(this.cache.size>=this.maxSize){var o=this.cache.keys().next().value;this.cache.delete(o)}this.cache.set(i,s)},r}();const eRe=Qke;var tRe=50,Tre=new eRe(tRe),rRe={"Mac OS":"macOS",iOS:"iOS",Windows:"Windows",Android:"Android","Windows Phone":"Windows Phone",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux","Chromium OS":"Chrome OS",PlayStation:"PlayStation 4"},nRe=function(r){return gn(Mr({},r),{name:rRe[r.name]||r.name})};function iRe(r){var e=r.getDevice(),n=e.type;return n||"desktop"}function Sre(r){var e=r;if(!e)return{platform:{isMobile:!1,isPc:!1,isTablet:!1},hybrid:{isHybrid:!1}};var n=Tre.get(e);if(n)return n;var i=O1(e),s=i.bridgeVersion,o=i.clientType,a=i.clientVersion,u=i.isHybrid,l=new Yke.UAParser(e),g=l.getResult(),y=iRe(l),A=y==="mobile",I=y==="desktop",P=y==="tablet",D=gn(Mr({},g?.device),{type:y}),U={platform:{isMobile:A,isPc:I,isTablet:P},ua:{raw:e,parsed:gn(Mr({},g),{platform:D,device:D,os:nRe(g.os)})},hybrid:{bridgeVersion:s,clientType:o,clientVersion:a,isHybrid:u}};return Tre.set(e,U),U}var dd=function(){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=Math.random()*16|0,i=e==="x"?n:n&3|8;return i.toString(16)});return"".concat(r.slice(0,-1),"b")},sRe=tn(47886),Ire=tn.n(sRe);const{fetch:oRe}=Ire()(),aRe=({title:r},e)=>{document.title=r,e()},uRe=({url:r,method:e,body:n,headers:i,credentials:s="same-origin"},o)=>{e=e.toUpperCase();const a={method:e,headers:i,credentials:s};e!=="GET"&&e!=="HEAD"&&(a.body=n),oRe(r,a).then(u=>{o({response:u})}).catch(u=>{o({error:u})})},KC=r=>{if(r)return JSON.parse(r)};function cRe(r,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let n="";for(let i=0;i<r;i++)n+=e.charAt(Math.floor(Math.random()*e.length));return n}const kre=(r,e)=>e===void 0?r():r(e);class Rre{constructor(){this._callbacks=Object.create(null),this._handlers=Object.create(null),this._nonce=cRe(10),this._uuid=0,this._setup()}_getCallbackId(e){const n=`${this._nonce}_${this._uuid++}`;return this._callbacks[n]=e,n}_receiveCallback(e,n){const i=this._callbacks[e];i&&(delete this._callbacks[e],kre(i,n))}_receiveEvent(e,n){const i=this._handlers[e];i&&kre(i,n)}invoke(e,n={}){return new Promise(i=>{const s=this._getCallbackId(i);this._send(e,n,s)})}handler(e,n){this._handlers[e]=n}ready(){this._ready()}}const y9=r=>()=>{throw new Error(`[bridge-core] ${r} must be implemented`)};Object.assign(Rre.prototype,{_setup:y9("_setup"),_send:y9("_send"),_ready:y9("_ready")});class lRe{constructor(){this._adapters=[],this._default=null}register({test:e,adapter:n}){return this._adapters.push({test:e,adapter:n}),this}default(e){return this._default=e,this}create(e,n){const i=O1(n);let s=this._default;this._adapters.some(({test:a,adapter:u})=>a(i)?(s=u,!0):!1);const o=s(Rre);return e(new o,i)}}function GC(r){const e=[],n={$push(i){e.push(i)}};return Object.keys(r).forEach(i=>{const s=r[i];typeof s=="function"?n[i]=(...o)=>{for(let a=0;a<e.length;a++)s.apply(e[a],o)}:n[i]=s}),n}const fRe=r=>class extends r{_setup(){self.BardApp||(self.BardApp=GC({callbackFromNative(n,i,s){this._receiveCallback(n,KC(s))},eventFromNative(n,i){this._receiveEvent(n,KC(i))}})),self.BardApp.$push(this)}_send(n,i,s){self.BardMagicalJourney.messageSend(n,s,JSON.stringify(i))}_ready(){self.BardMagicalJourney.bridgeReady()}},dRe=r=>class extends r{_setup(){if(!self.__BNC_BRIDGE_TEMP_VAR__){self.__BNC_BRIDGE_TEMP_VAR__=GC({onMessage(i){i=KC(i);const s=i.payload.data;i.action!=="web-view-post-message"||s.type!=="node-bridge"||this._receiveCallback(s.callbackId,s.data)}}),self.__NEZHA_WEB_BRIDGE__||(console.log("[node-bridge-core] window.__NEZHA_WEB_BRIDGE__:",self.__NEZHA_WEB_BRIDGE__),self.__NEZHA_WEB_BRIDGE__={});const n=self.__NEZHA_WEB_BRIDGE__.onMessage;self.__NEZHA_WEB_BRIDGE__.onMessage=function(...i){n&&n(...i),self.__BNC_BRIDGE_TEMP_VAR__.onMessage(...i)}}self.__BNC_BRIDGE_TEMP_VAR__.$push(this)}_send(n,i,s){self.__NEZHA_BRIDGE__.postMessage(JSON.stringify({action:"web-view-post-message",payload:{data:{type:"node-bridge",payload:{action:n,data:i,callbackId:s}}},callbackId:s}))}_ready(){self.__NEZHA_BRIDGE__.postMessage(JSON.stringify({action:"web-view-post-message",payload:{data:{type:"node-bridge",payload:{event:"bridge-ready"}}},callbackId:0}))}},Cre={},xre=(r,e={})=>{Cre[r]&&Cre[r].postMessage(e)},hRe=r=>class extends r{_setup(){self.BNCBridge||(self.BNCBridge=GC({receive(n){const{callbackId:i,eventType:s,data:o}=KC(n);if(i){this._receiveCallback(i,o);return}s&&this._receiveEvent(s,o)}})),self.BNCBridge.$push(this)}_send(n,i,s){xre(n,{data:JSON.stringify(i),callbackId:s})}_ready(){xre("bridgeReady")}},pRe=r=>class extends r{_setup(){}_send(){}_ready(){}};class gRe{constructor(){this._methods=Object.create(null)}add(e,n){return this._methods[e]=n,this}_send(e,n,i){const s=this._methods[e];if(!s)return console.error(`[bridge-core] bridge.${e} is not defined`);s(n,o=>{this._receiveCallback(i,o)})}create(e){const n=this;return i=>({[e]:class extends i{_setup(){n._bridge||(n._bridge=GC({receiveCallback(...o){this._receiveCallback(...o)},receiveEvent(...o){this._receiveEvent(...o)}})),n._receiveCallback=n._bridge.receiveCallback,n._bridge.$push(this)}_send(o,a,u){n._send(o,a,u)}_ready(){}}})[e]}}const yRe=gRe,mRe=(r,e)=>{const n=new Array(e);for(let i=0;i<e;++i)n[i]=r[i];return n},bRe=(r,e)=>{for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()},vRe=r=>r>=200&&r<300,gtt=r=>Object.prototype.toString.call(r)==="[object Array]",wRe=r=>typeof r=="string",ARe=(r,e)=>_Re(r,e)==="LT";function _Re(r,e){return TRe(Bre(r),Bre(e))}function ERe(r,e){return r===e?"EQ":r>e?"GT":"LT"}function TRe(r,e){if(r.join(".")===e.join("."))return"EQ";for(let n=0;n<r.length;n++)switch(ERe(r[n],e[n])){case"EQ":continue;case"GT":return"GT";case"LT":return"LT"}}function Bre(r){return r.replace(/-alpha/g,"").split(".").map(Number)}const{isHybrid:Ore,clientType:SRe,bridgeVersion:IRe}=O1(),kRe=r=>{const e=Object.create(null);e.back=(g=1)=>r.invoke("back",{amount:g}),e.setTitle=g=>r.invoke("setTitle",{title:g}),e.broadcast=g=>r.invoke("broadcast",{data:g}),e.toast=g=>r.invoke("toast",{text:g}),e.open=g=>{g.withNavigationBar===void 0&&(g.withNavigationBar=!0),r.invoke("open",g)};const n=["notExistBridge","stopLoading","isLogged","getUserInfo","getDiagnosticInfo","getAppConfig","isApplePayAvailable","isAppleWatchPaired"],i=["alert","addDebitCard","verifyDebitCard","face","getImage","jumio","captchaResult","kycVender","openChatVideo","setNavBar","ensureLogged","setKYCVendorUkrainDiiaPlugin","refreshKycStatus","getAutoCaptureImages","appUpdate","setStore","getMicroblinkImages","isMicroBlinkReady","payService","getProvisionedCards","addCard","notifyChatVideo","haodeskFileUpload","chatCaseToken","haodeskUploadUerLog","canShare","updateEntityTag"];n.forEach(g=>{e[g]=()=>r.invoke(g)}),i.forEach(g=>{e[g]=y=>r.invoke(g,y)});const s=Object.create(null),o=g=>{s[g]=Object.create({listened:!1,events:[]})};o("back"),o("broadcast"),o("theme-change"),o("session-change"),o("service-chat-change"),o("sendResultCheckoutForCryptoBox");const a=(g,y)=>{const A=g.indexOf(y);~A&&bRe(g,A)},u=(g,y)=>{const A=(...I)=>{a(g,A),y(...I)};return A},l=(g,y,A)=>{const I=s[g];if(!I)return;const{events:P}=I;I.listened||(I.listened=!0,r.handler(g,D=>{mRe(P,P.length).forEach(U=>U(D))})),P.push(A?u(P,y):y)};return e.on=(g,y)=>l(g,y),e.once=(g,y)=>l(g,y,!0),e.off=function(y,A){const I=s[y];if(!I)return;const{events:P}=I;if(arguments.length===1){P.length=0;return}a(P,A)},e.fetch=(g,{method:y="GET",body:A="",headers:I={},credentials:P}={})=>r.invoke("fetch",{url:g,method:y,body:A,headers:I,credentials:P}).then(({error:D,response:U})=>{if(!Ore)return D?Promise.reject(D):Promise.resolve(U);if(D){const Ue=new TypeError("Failed to fetch");switch(typeof D){case"object":Object.assign(Ue,D);break;case"string":Ue.message=D;break}throw Ue}const{status:V,headers:J,body:re,statusText:ce=""}=U,Re={};Object.keys(J).forEach(Ue=>{const Ve=J[Ue];Re[Ue]=wRe(Ve)?[Ve]:Ve});const De=vRe(V);return{url:g,ok:De,status:V,statusText:ce,json(){return new Promise((Ue,Ve)=>{try{Ue(JSON.parse(re||"{}"))}catch(pe){Ve(pe)}})},text(){return Promise.resolve(re)},headers:Re,clone(){return{url:g,ok:De,status:V,statusText:ce,json(){return new Promise((Ue,Ve)=>{try{Ue(JSON.parse(re||"{}"))}catch(pe){Ve(pe)}})},text(){return Promise.resolve(re)},headers:Re}}}}),e.share=g=>{const{type:y,image:A}=g;return SRe==="iOS"&&y==="IMAGE"&&typeof A=="string"&&A.indexOf("data:image")===0&&(g.image=A.split(",")[1]||""),r.invoke("share",g).then(({result:I="UNKNOWN"})=>{if(I==="SUCCESS")return Promise.resolve();{const P=new Error(I);return P.code=I,Promise.reject(P)}})},e.setButtons=(g,y)=>(y=y.map(A=>{const I=`button.${A.type}`;return s[I]||o(I),A.onClick&&l(I,A.onClick),I}),r.invoke("setButtons",{buttons:y,position:g})),e.openURWebview=({url:g,closePath:y="/app/bnc/urwebv/close",closeButtonVisible:A,viewExternal:I})=>r.invoke("openURWebview",{url:g,closePath:y,closeButtonVisible:A,viewExternal:I}).then(({result:P,callbackUrl:D})=>P==="SUCCESS"?Promise.resolve({callbackUrl:D}):Promise.reject({code:P})),e.isSupportDeeplink=g=>!Ore||ARe(IRe,"1.8.0")?Promise.resolve(!1):r.invoke("isSupportDeeplink",{deeplink:g}).then(({supported:y})=>y),e.sendEventToNative=({name:g,data:y={}})=>r.invoke("sendEventToNative",{name:g,data:y}),e.saveFile=({source:g,filename:y,fileType:A})=>r.invoke("saveFile",{source:g,filename:y,fileType:A}).then(I=>{if(I&&I.error)throw error}),r.ready(),e};var qC=tn(85409);const Pre=(r=pRe)=>new lRe().register({test:({clientType:e})=>e==="iOS"||e==="MacOS",adapter:hRe}).register({test:({clientType:e})=>e==="Android",adapter:fRe}).register({test:()=>!1,adapter:dRe}).default(r).create(kRe,RRe()),Nre=r=>{const e=new yRe;return Object.keys(r).forEach(n=>{e.add(n,r[n])}),e.create("BrowserFakeBridge")};function RRe(){const e=typeof qC<"u"&&qC.versions!=null&&qC.versions.node!=null;let n="";return e&&(n=`node ${qC.versions.node}`),n}var CRe=Pre(Nre(Mr({},M,{})));const xRe=CRe;var m9=30,hd={requestInterceptors:[],responseInterceptors:[],resultInterceptors:[],baseUrl:"",accelerate:{defaultOrigin:"",origins:[],enbleSites:null,checkAccelerable:null}};function mtt(r){hd.requestInterceptors.length>=m9||hd.requestInterceptors.push(r)}function btt(r){hd.responseInterceptors.length>=m9||hd.responseInterceptors.push(r)}function vtt(r){hd.resultInterceptors.length>=m9||hd.resultInterceptors.push(r)}var Mre=!1,wtt=function(r){if(Mre){var e="[http] initConfig should only be called once.";console.error(e)}try{var n=r.accelerate;n&&enbleAccelerate(n)&&accelerate(n)}catch{}Object.assign(hd,r),Mre=!0};function b9(r){return r&&r.Math==Math?r:void 0}const P1=typeof globalThis=="object"&&b9(globalThis)||!1||typeof self=="object"&&b9(self)||typeof tn.g=="object"&&b9(tn.g)||function(){return this}()||{};function Att(...r){GLOBAL_OBJ.pika=(GLOBAL_OBJ==null?void 0:GLOBAL_OBJ.pika)||{},GLOBAL_OBJ.pika.__REPORT_ERRORS__=GLOBAL_OBJ.pika.__REPORT_ERRORS__||[],GLOBAL_OBJ.pika.__REPORT_ERRORS__.push(r)}function BRe(r,...e){P1.pika=P1?.pika||{},P1.pika.__REPORT_MONITOR_EVENTS__=P1.pika.__REPORT_MONITOR_EVENTS__||[],P1.pika.__REPORT_MONITOR_EVENTS__.push([r,...e])}var Lre=function(r){try{var e,n,i,s,o,a,u;return;var l,g}catch(y){console.log("libs/http/logger2",y)}},ORe=function(r){var e={};return r&&["x-cache"].forEach(function(n){e[n]=r.get?r.get(n):r[n]}),e};function PRe(r){try{return r.startsWith("http")?new URL(r):new URL(r,self.location.origin)}catch(e){return console.warn("[http] getURLObject failed",e),{}}}function _tt(r){return new Promise(function(e,n){bn.request(_object_spread_props(_object_spread({},r),{success:function(s){var o,a=s?.data,u=_object_spread_props(_object_spread({},s),{json:function(){return new Promise(function(l,g){try{l(JSON.parse(a||"{}"))}catch{g(new Error(a))}})},text:function(){return Promise.resolve(a)}});e(u),r==null||(o=r.success)===null||o===void 0||o.call(r,u)},fail:function(s){var o;n(s),r==null||(o=r.fail)===null||o===void 0||o.call(r,s)}}))})}var ZC=function(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return n?"".concat(r,"_").concat(e,"_").concat(n):"".concat(r,"_").concat(e)};function v9(r){if(Object.prototype.toString.call(r)!=="[object Object]")return r;var e=Object.keys(r).sort(),n={};return e.forEach(function(i){n[i]=v9(r[i])}),n}var NRe=tn(73548),Dre=tn.n(NRe),MRe=tn(22057),YC="__BNC_USER_DEVICE_ID__",sg="unknown",LRe="__BNC_FP_INFO__",DRe=function(){var r=self.location.hostname,e=r.split(".");return e[0]="",e.join(".")},URe=function(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:365,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(!(typeof document>"u")){var s=new Date,o;n?(s.setTime(s.getTime()+n*24*60*60*1e3),o="; expires=".concat(s.toGMTString())):o="";var a=i?"; domain=".concat(DRe()):"";document.cookie="".concat(r,"=").concat(e).concat(o).concat(a,"; path=/; secure=true;")}},Ett=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.cookie,i=n===void 0?"":n,s="";typeof document>"u"?s=i:s=document.cookie;for(var o="".concat(r,"="),a=s.split(";"),u=0;u<a.length;u++){for(var l=a[u];l.charAt(0)===" ";)l=l.substring(1,l.length);if(l.indexOf(o)===0)return l.substring(o.length,l.length)}return null},FRe=function(r){URe(r,"",-1,!1)},XC=function(r){if(!r)return r;try{return JSON.parse(r)}catch{return r}},vT=!1,Ure={},Fre=function(){return typeof sessionStorage<"u"},JC=function(){return typeof localStorage<"u"};function WRe(r){return Object.prototype.toString.call(r)==="[object String]"}var Wre=function(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(JC())return n.ttl?localStorage.setItem(r,JSON.stringify({value:e,expire:new Date().getTime()+n.ttl})):localStorage.setItem(r,e)},Hre=function(r){if(JC()){var e=localStorage.getItem(r),n=XC(e)||{};return n.expire?n.expire&&n.expire>new Date().getTime()?n.value:null:e}},HRe=function(r){if(vT){var e=YC,n=JSON.stringify(r);FRe(e),JC()&&Wre(e,n),Fre()&&sessionStorage.setItem(e,n),Ure[YC]=n}},zRe=function(){if(!vT)return{};var r=YC,e=null;e||(e=Ure[YC]),!e&&JC()&&(e=Hre(r)||null),!e&&Fre()&&(e=sessionStorage.getItem(r)||null);var n=XC(e)||{};if(WRe(n)){console.log("device need decodeURIComponent");try{n=XC(decodeURIComponent(n))}catch(i){console.log("device need decodeURIComponent error",i)}}return e&&HRe(n),n},w9=function(){return zRe()},$Re=function(r){if(!r)return"";var e=w9(),n=Dre()(r),i=e[n];return i&&i.value||""},Ttt=function(r,e){var n=w9(),i=md5(r||""),s=n[i];if(!s){var o=Object.keys(n).reduce(function(u,l){return u.push({key:l,value:n[l]}),u},[]);if(o.length>=10){o=o.sort(function(u,l){return u.value.date-l.value.date});var a=o[0]||{};delete n[a.key]}}n[i]={date:new Date().getTime(),value:e},store.setCacheDevice(n)},VRe=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Object.assign({},e);if(vT){n.device_id=$Re(r);var i=Dre()(r||""),s=w9(),o=Object.keys(s).filter(function(a){return a!==i});n.related_device_ids=o.map(function(a){return s[a].value}).join(",")}return MRe.Base64.encode(JSON.stringify(n))},jRe=tn(16934),KRe=tn(69461),zre=tn.n(KRe),GRe={colorDepth:!0,deviceMemory:!0,pixelRatio:!0,hardwareConcurrency:!0,sessionStorage:!0,localStorage:!0,indexedDb:!0,addBehavior:!0,openDatabase:!0,cpuClass:!0,doNotTrack:!0,adBlock:!0,hasLiedLanguages:!0,hasLiedResolution:!0,hasLiedOs:!0,hasLiedBrowser:!0,touchSupport:!0,fonts:!0,fontsFlash:!0,enumerateDevices:!0},A9=sg,_9;function E9(){return _9=_9||new jRe.UAParser().getResult(),_9}var qRe=function(){var e=E9().os;return!e||!e.name?A9:"".concat(e.name," ").concat(e.version)},ZRe=function(){var e=E9().device;return!e||!e.model?A9:[e.type,e.vendor,e.model,""].join(" ")},YRe=function(){var e=E9(),n=e.browser,i=e.os||{};return!n||!n.name?A9:"".concat(n.name," V").concat(n.version," (").concat(i.name||"",")")},XRe=function(e){var n=Math.floor(Math.abs(e)/60),i=Math.abs(e%60),s;return i===0?s="".concat(n.toString().padStart(2,"0"),":00"):s="".concat(n.toString().padStart(2,"0"),":").concat(i.toString().padStart(2,"0")),e>0?s="-".concat(s):s="+".concat(s),"GMT".concat(s)},JRe=function(e){var n=e[1].replace("canvas fp:data:image/png;base64,",""),i=function(u){var l,g,y="",A;for(u+="",l=0,g=u.length;l<g;l++)A=u.charCodeAt(l).toString(16),y+=A.length<2?"0".concat(A):A;return y};try{var s=atob(n),o=i(s.slice(-16,-12));return o}catch(a){return console.warn("Failed to get canvas code: ",a),sg}},QRe=function(e){var n={vendor:sg,renderer:sg};if(!e||!e.length)return n;for(var i=e.length,s=0,o=0;o<i;o++){var a=e[o]||"";if(a.indexOf("webgl unmasked vendor:")>-1?(n.vendor=a.split("webgl unmasked vendor:")[1]||sg,s+=1):a.indexOf("webgl unmasked renderer:")>-1&&(n.renderer=a.split("webgl unmasked renderer:")[1]||sg,s+=1),s===2)break}return n},eCe=function(r){var e=r.plugins||r.regular_plugins||r.ie_plugins;if(!Array.isArray(e))return sg;var n=[];return e.forEach(function(i){n.push(i[0])}),n.length>500?n.slice(0,500).join(","):n.join(",")},tCe=function(r){var e={screenResolution:sg,avaScreenResolution:sg};return r.screenResolution&&Array.isArray(r.availableScreenResolution)&&(e.screenResolution=r.screenResolution.join(",")),r.availableScreenResolution&&Array.isArray(r.availableScreenResolution)&&(e.avaScreenResolution=r.availableScreenResolution.join(",")),e},rCe=function(){return LRe},nCe=function(){var r=(0,k.A)(b().mark(function e(){var n,i,s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(vT){u.next=2;break}return u.abrupt("return",Promise.resolve({}));case 2:if(n=rCe(),i=Mr({},GRe),s=XC(Hre(n)),!s){u.next=7;break}return u.abrupt("return",s);case 7:return o=function(){var l=(0,k.A)(b().mark(function g(){var y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,zre().getPromise({excludes:i});case 2:return y=J.sent,A=y.reduce(function(re,ce){return re[ce.key]=ce.value,re},{}),I=QRe(A.webgl),P=tCe(A),D={screen_resolution:P.screenResolution,available_screen_resolution:P.avaScreenResolution,system_version:qRe(),brand_model:ZRe(),system_lang:A.language,timezone:XRe(A.timezoneOffset),timezoneOffset:A.timezoneOffset,user_agent:A.userAgent,list_plugin:eCe(A),canvas_code:JRe(A.canvas),webgl_vendor:I.vendor,webgl_renderer:I.renderer,audio:A.audio,platform:A.platform,web_timezone:A.timezone,device_name:YRe()},U=Object.keys(D).sort().map(function(re){return D[re]}),D.fingerprint=zre().x64hash128(U.join(""),32),localStorage.removeItem("__BNC_FP_INFO__0093cf"),Wre(n,JSON.stringify(D),{ttl:864e5}),J.abrupt("return",D);case 12:case"end":return J.stop()}},g)}));return function(){return l.apply(this,arguments)}}(),u.prev=8,u.next=11,o();case 11:return u.abrupt("return",u.sent);case 14:u.prev=14,u.t0=u.catch(8),console.error("Fingerprint error: ",u.t0);case 17:return u.abrupt("return",Promise.resolve({}));case 18:case"end":return u.stop()}},e,null,[[8,14]])}));return function(){return r.apply(this,arguments)}}();const iCe=nCe;var QC={},$re=function(r){return withDeviceInfo(r,QC)},sCe=function(){var r=(0,k.A)(b().mark(function e(n){var i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(i=!Object.keys(QC).length,!(vT&&i)){o.next=5;break}return o.next=4,iCe();case 4:QC=o.sent;case 5:return o.abrupt("return",VRe(n,QC));case 6:case"end":return o.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),e6="",oCe=function(r){e6=r},Stt=function(){return e6},Itt=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";oCe(r),saveCurrentDeviceId(r,e)},ktt=function(r){var e=r||e6;return $re(e.trim().toLowerCase())},Vre=function(r){var e=r||e6;return sCe(e.trim().toLowerCase())},Rtt=function(){return{};var r;try{r=JSON.parse(atob($re()))}catch(e){console.error("getFPInfo error",e)}};const Ctt=null;var aCe=tn(94527),jre=tn.n(aCe),Kre=!1,uCe=function(r){return[void 0,null,""].indexOf(r)===-1};function cCe(){var r=self.location.hostname,e=r.split(".");return e.length>2?e.slice(-2).join("."):r}function T9(r){try{return decodeURIComponent(r)}catch{return r}}var Gre=function(r){var e=r||{},n=(e||{}).cookie;return(n||"").split(";").reduce(function(i,s){var o=(s||"").trim(),a=o.indexOf("=");if(a>0){var u=o.slice(0,a).trim(),l=o.slice(++a).trim();i[u]=T9(l[0]==='"'?l.slice(1,-1):l)}return i},{})},S9=function(r,e){if(uCe(r)){if(Kre){if(r==="BNC-Location")return self.__store.getState().temp.bncLocation;var n=self.localStorage.getItem("APP_COOKIES_".concat(r));return n?T9(n):null}for(var i="".concat(r,"=").trim(),s=e||{},o=(s||{}).cookie,a=(o||"").split(";"),u=0;u<a.length;u++){var l=(a[u]||"").trim();if(l.indexOf(i)===0){var g=l.slice(i.length).trim();return T9(g[0]==='"'?g.slice(1,-1):g)}}}return null};function I9(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:365,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4?arguments[4]:void 0;return;var o}function k9(r){if(0)var e,n,i,s,o,a,u,l,g,y;if(!r?.request)throw new Error("[@binance/essential] getLanguage request params is required");var A=r.request.headers;return A&&A["bnc-lang"]?A["bnc-lang"]:"en"}var lCe=Sre(),fCe=lCe.hybrid.isHybrid,dCe=function(){var r=(0,k.A)(b().mark(function e(){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",{});case 2:return i.next=4,Vre();case 4:return i.t0=i.sent,i.abrupt("return",{"device-info":i.t0});case 6:case"end":return i.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),hCe=function(){return"";var r},xtt=function(){return null},pCe=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return""}},gCe=hCe(),yCe=function(){return"en"},mCe=function(r){var e,n=(r==null||(e=r.headers)===null||e===void 0?void 0:e.cookie)||null;return n?{cookie:n}:{}},bCe=function(){return{}},vCe=function(){try{return"{}".CDN_REGION}catch{return"en"}},qre=vCe(),wT=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return s=i.omitHeader,o=i.lang,a=i.headers,u=i.req,l=i.credentials,J.next=3,dCe();case 3:return g=J.sent,y=s?{}:Mr({lang:o||yCe(),"X-UI-REQUEST-TRACE":n,"X-TRACE-ID":n,"BNC-UUID":gCe,"Content-Type":"application/json"},g),!s&&qre&&(y=Object.assign(y,{"X-CDN-REGION":qre})),!s&&!fCe&&(y=Object.assign(y,{clienttype:"web"})),P=mCe(u),D=bCe(),U={method:"GET",mode:"cors",headers:gn(Mr({},y,P,a,D),{"BNC-Time-Zone":pCe()}),credentials:l},J.abrupt("return",{opts:U});case 12:case"end":return J.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),AT=function(r){return r;var e},wCe=Sre(),R9=wCe.hybrid.isHybrid,Zre=function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",xRe.fetch(n,i));case 1:case"end":return o.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Btt=Zre,ACe=function(){return Zre},_Ce=function(r){return r>=200&&r<300||r===401},ECe=function(){var r=(0,k.A)(b().mark(function e(n){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!n._skipCheckStatus){a.next=2;break}return a.abrupt("return",n);case 2:if(!_Ce(n.status)){a.next=4;break}return a.abrupt("return",n);case 4:return a.prev=4,a.next=7,n.json();case 7:throw i=a.sent,s=new Error(n.statusText||n.status),s.errorMsg=i,s;case 13:throw a.prev=13,a.t0=a.catch(4),a.t0.code=n.status,a.t0;case 18:case"end":return a.stop()}},e,null,[[4,13]])}));return function(n){return r.apply(this,arguments)}}(),TCe=function(r){var e=hd.baseUrl,n=hd.accelerate,i,s=n.checkAccelerable;if(0)var o;return/^(https?:)?\/\//.test(r)?r:e?"".concat(e).concat(r):R9?"".concat(self.location.origin).concat(r):r},ph={},_T=function(){var r=(0,k.A)(b().mark(function e(n,i,s){var o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr;return b().wrap(function(Rr){for(;;)switch(Rr.prev=Rr.next){case 0:o=hd.requestInterceptors,a=hd.responseInterceptors,u=hd.resultInterceptors,l=Date.now(),g=(i||{}).body,y=ZC(i?.method||"GET",n,g),Rr.prev=7,n=TCe(n),D=!0,U=!1,V=void 0,Rr.prev=10,J=o[Symbol.iterator]();case 12:if(D=(re=J.next()).done){Rr.next=26;break}return ce=re.value,Rr.t0=ur,Rr.next=18,ce(n,i,s);case 18:Rr.t1=Rr.sent,Re=(0,Rr.t0)(Rr.t1,2),n=Re[0],i=Re[1];case 23:D=!0,Rr.next=12;break;case 26:Rr.next=32;break;case 28:Rr.prev=28,Rr.t2=Rr.catch(10),U=!0,V=Rr.t2;case 32:Rr.prev=32,Rr.prev=33,!D&&J.return!=null&&J.return();case 35:if(Rr.prev=35,!U){Rr.next=38;break}throw V;case 38:return Rr.finish(35);case 39:return Rr.finish(32);case 40:return De=ACe(),Rr.next=43,De(n,i,!0);case 43:A=Rr.sent,Ue=!0,Ve=!1,pe=void 0,Rr.prev=45,Se=a[Symbol.iterator]();case 47:if(Ue=(Ce=Se.next()).done){Rr.next=55;break}return je=Ce.value,Rr.next=51,je(A,s,i);case 51:A=Rr.sent;case 52:Ue=!0,Rr.next=47;break;case 55:Rr.next=61;break;case 57:Rr.prev=57,Rr.t3=Rr.catch(45),Ve=!0,pe=Rr.t3;case 61:Rr.prev=61,Rr.prev=62,!Ue&&Se.return!=null&&Se.return();case 64:if(Rr.prev=64,!Ve){Rr.next=67;break}throw pe;case 67:return Rr.finish(64);case 68:return Rr.finish(61);case 69:return $e=Date.now(),I=$e-l,Rr.next=73,ECe(A);case 73:nt=A._bodyBlob,nt&&(Qe=nt.type);try{Me=A==null||(Ne=A.headers)===null||Ne===void 0?void 0:Ne.get("content-type"),Me&&(Qe=Me)}catch{}if(!(Qe&&["application/vnd.ms-excel","application/vnd.ms-pdf","application/pdf","application/octet-stream"].some(function(Pr){return"".concat(Qe).includes(Pr)}))){Rr.next=79;break}return Rr.abrupt("return",A.blob());case 79:return Rr.next=81,A.json();case 81:P=Rr.sent,R9||Lre({opts:i,url:n,res:A,duration:I,result:P}),ct=!0,mt=!1,Bt=void 0,Rr.prev=84,er=u[Symbol.iterator]();case 86:if(ct=(cr=er.next()).done){Rr.next=94;break}return pr=cr.value,Rr.next=90,pr(P,{url:n});case 90:P=Rr.sent;case 91:ct=!0,Rr.next=86;break;case 94:Rr.next=100;break;case 96:Rr.prev=96,Rr.t4=Rr.catch(84),mt=!0,Bt=Rr.t4;case 100:Rr.prev=100,Rr.prev=101,!ct&&er.return!=null&&er.return();case 103:if(Rr.prev=103,!mt){Rr.next=106;break}throw Bt;case 106:return Rr.finish(103);case 107:return Rr.finish(100);case 108:return Rr.abrupt("return",P);case 111:throw Rr.prev=111,Rr.t5=Rr.catch(7),ph[y]&&(delete ph[y],console.warn("prefetch ".concat(y," error"))),R9||Lre({opts:i,url:n,res:A,duration:I,result:P,net_err_exist:!0}),console.warn(Rr.t5),Rr.t5;case 118:case"end":return Rr.stop()}},e,null,[[7,111],[10,28,32,40],[33,,35,39],[45,57,61,69],[62,,64,68],[84,96,100,108],[101,,103,107]])}));return function(n,i,s){return r.apply(this,arguments)}}(),Yre=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=ZC("GET",n),!ph[s]){g.next=5;break}return o=ph[s],delete ph[s],g.abrupt("return",o);case 5:return i=i||{},a=dd(),g.next=9,wT(a,AT(i));case 9:return u=g.sent.opts,g.abrupt("return",_T(n,u,i));case 11:case"end":return g.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),SCe=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g=arguments;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(s=g.length>2&&g[2]!==void 0?g[2]:{},o=ZC("POST",n,JSON.stringify(v9(i))),!ph[o]){A.next=6;break}return a=ph[o],delete ph[o],A.abrupt("return",a);case 6:return u=dd(),A.next=9,wT(u,AT(s));case 9:return l=A.sent.opts,l=Object.assign(l,{method:"POST",body:JSON.stringify(i)}),A.abrupt("return",_T(n,l,s));case 12:case"end":return A.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Ott=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u=arguments;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return s=u.length>2&&u[2]!==void 0?u[2]:{},o=dd(),g.next=4,wT(o,AT(s));case 4:return a=g.sent.opts,a=Object.assign(a,{method:"PUT",body:JSON.stringify(i)}),g.abrupt("return",_T(n,a,s));case 7:case"end":return g.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Ptt=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u=arguments;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return s=u.length>2&&u[2]!==void 0?u[2]:{},o=dd(),g.next=4,wT(o,AT(s));case 4:return a=g.sent.opts,a=Object.assign(a,{method:"DELETE",body:JSON.stringify(i)}),g.abrupt("return",_T(n,a,s));case 7:case"end":return g.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Ntt=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g=arguments;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return s=g.length>2&&g[2]!==void 0?g[2]:{},u=dd(),A.next=5,wT(u,AT(s));case 5:return l=A.sent.opts,!((o=s)===null||o===void 0||(a=o.headers)===null||a===void 0)&&a["Content-Type"]||delete l.headers["Content-Type"],l=Object.assign(l,{method:"POST",body:i}),A.abrupt("return",_T(n,l,s));case 9:case"end":return A.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}();function Mtt(r){return!r||/^https?:/.test(r)?r:"https://".concat(r)}var Xre=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.abrupt("return");case 2:if(!ph[n]){y.next=4;break}return y.abrupt("return");case 4:if(s=i||{},o=s.method,a=o===void 0?"GET":o,u=s.body,!(a!=="GET"&&a!=="POST")){y.next=7;break}return y.abrupt("return");case 7:return l=ZC(a,n,a==="GET"?"":JSON.stringify(v9(u))),ph[l]=a==="GET"?Yre(n,i):SCe(n,u,i),y.abrupt("return",ph[l]);case 10:case"end":return y.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),ICe=function(r){var e="__ACCELERATE_ENABLED__",n="__ACCELERATE_DEFAULT_DOMAIN__",i="__ACCELERATE_AVAILABLE_DOMAIN__",s="__ACCELERATE_ENBLED_SITES__",o={};if(r[e]){var a,u;o={defaultOrigin:r[n],origins:(a=r[i])===null||a===void 0?void 0:a.split(",").map(function(l){return l.trim()}),enbleSites:(u=r[s])===null||u===void 0?void 0:u.split(",").map(function(l){return l.trim()}),checkAccelerable:function(l){var g=l.split("?")[0];return!(g.includes("/private/")||g.includes("/protected/"))}}}return o},Jre=function(r){return;for(var e,n,i,s,o;o<s.length;o++)try{var a=s[o],u=a.url,l=a.options;Xre(u,_object_spread({},l))}catch(g){console.error("prefetch error",g)}},Ltt=function(){var r=self._bn_http_init;r&&r[0]?Jre(r[0]):(self._bn_http_init=self._bn_http_init||[],self._bn_http_init.push=function(e){return Jre(e)})},au=!1,Qre=function(r){return[void 0,null,""].indexOf(r)===-1};function kCe(r){try{return decodeURIComponent(r)}catch{return r}}var RCe=function(r,e){var n=Gre(e);return r.reduce(function(i,s){var o=s.key,a=s.matches;if(Qre(o)){var u=n[o];i[o]=a?a(u):u}return i},{})},CCe=function(r,e){var n=[];if(Qre(r))for(var i="".concat(r,"=").trim(),s=au?document:e||{},o=s.cookie,a=(o||"").split(";"),u=0;u<a.length;u++){var l=(a[u]||"").trim();if(l.indexOf(i)===0){var g=l.slice(i.length).trim();n.push(kCe(g[0]==='"'?g.slice(1,-1):g))}}return n};function t6(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:365,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;I9(r,e,n,i)}function xCe(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:365,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4?arguments[4]:void 0;I9(r,e,n,i,s)}var BCe=t6,OCe=t6,PCe=xCe,NCe=function(r){return t6(r,"",-1)},og={parse:Gre,read:S9,readAsList:CCe,matchRead:RCe,write:t6,erase:NCe,_update:function(){return!1},writeCookieWithDomain:BCe,writeCookieWithDomainLevel:OCe,writeCookieWithDomainLevelV2:PCe};function MCe(r){if(0)var e,n;else{var i,s,o=(i=r?.request.headers)===null||i===void 0?void 0:i["bnc-cpl-tags"],a=(s=r?.request.headers)===null||s===void 0?void 0:s["bnc-region"],u={};return o&&(u["bnc-cpl-tags"]=o),a&&(u["bnc-region"]=a),u}}function LCe(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return function(e){var n,i,s,o,a,u,l;for(i=s=0,o=e.length,a=o%3,o=o-a,u=o/3<<2,a>0&&(u+=4),n=new Array(u);i<o;)l=e.charCodeAt(i++)<<16|e.charCodeAt(i++)<<8|e.charCodeAt(i++),n[s++]=r[l>>18]+r[l>>12&63]+r[l>>6&63]+r[l&63];return a==1?(l=e.charCodeAt(i++),n[s++]=r[l>>2]+r[(l&3)<<4]+"=="):a==2&&(l=e.charCodeAt(i++)<<8|e.charCodeAt(i++),n[s++]=r[l>>10]+r[l>>4&63]+r[(l&15)<<2]+"="),n.join("")}}function DCe(){var r=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];return function(e){var n,i,s,o,a,u,l,g,y,A;if(l=e.length,l%4!==0||/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\+\/\=]/.test(e))return"";for(e.charAt(l-2)=="="?g=1:e.charAt(l-1)=="="?g=2:g=0,y=l,g>0&&(y-=4),y=(y>>2)*3+g,A=new Array(y),a=u=0;a<l&&(n=r[e.charCodeAt(a++)],!(n==-1||(i=r[e.charCodeAt(a++)],i==-1)||(A[u++]=String.fromCharCode(n<<2|(i&48)>>4),s=r[e.charCodeAt(a++)],s==-1)||(A[u++]=String.fromCharCode((i&15)<<4|(s&60)>>2),o=r[e.charCodeAt(a++)],o==-1)));)A[u++]=String.fromCharCode((s&3)<<6|o);return A.join("")}}var C9=2654435769;function ene(r,e){var n=r.length,i=n<<2;if(e){var s=r[n-1];if(i-=4,s<i-3||s>i)return null;i=s}for(var o=0;o<n;o++)r[o]=String.fromCharCode(r[o]&255,r[o]>>>8&255,r[o]>>>16&255,r[o]>>>24&255);var a=r.join("");return e?a.substring(0,i):a}function r6(r,e){var n=r.length,i=n>>2;n&3&&++i;var s;e?(s=new Array(i+1),s[i]=n):s=new Array(i);for(var o=0;o<n;++o)s[o>>2]|=r.charCodeAt(o)<<((o&3)<<3);return s}function N1(r){return r&4294967295}function n6(r,e,n,i,s,o){return(n>>>5^e<<2)+(e>>>3^n<<4)^(r^e)+(o[i&3^s]^n)}function tne(r){return r.length<4&&(r.length=4),r}function UCe(r,e){var n=r.length,i=n-1,s,o,a,u,l,g;for(o=r[i],a=0,g=Math.floor(6+52/n)|0;g>0;--g){for(a=N1(a+C9),u=a>>>2&3,l=0;l<i;++l)s=r[l+1],o=r[l]=N1(r[l]+n6(a,s,o,l,u,e));s=r[0],o=r[i]=N1(r[i]+n6(a,s,o,i,u,e))}return r}function FCe(r,e){var n=r.length,i=n-1,s,o,a,u,l,g;for(s=r[0],g=Math.floor(6+52/n),a=N1(g*C9);a!==0;a=N1(a-C9)){for(u=a>>>2&3,l=i;l>0;--l)o=r[l-1],s=r[l]=N1(r[l]-n6(a,s,o,l,u,e));o=r[i],s=r[0]=N1(r[0]-n6(a,s,o,0,u,e))}return r}function i6(r){if(/^[\x00-\x7f]*$/.test(r))return r;for(var e=[],n=r.length,i=0,s=0;i<n;++i,++s){var o=r.charCodeAt(i);if(o<128)e[s]=r.charAt(i);else if(o<2048)e[s]=String.fromCharCode(192|o>>6,128|o&63);else if(o<55296||o>57343)e[s]=String.fromCharCode(224|o>>12,128|o>>6&63,128|o&63);else{if(i+1<n){var a=r.charCodeAt(i+1);if(o<56320&&56320<=a&&a<=57343){var u=((o&1023)<<10|a&1023)+65536;e[s]=String.fromCharCode(240|u>>18&63,128|u>>12&63,128|u>>6&63,128|u&63),++i;continue}}throw new Error("Malformed string")}}return e.join("")}function WCe(r,e){for(var n=new Array(e),i=0,s=0,o=r.length;i<e&&s<o;i++){var a=r.charCodeAt(s++);switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n[i]=a;break;case 12:case 13:if(s<o)n[i]=(a&31)<<6|r.charCodeAt(s++)&63;else throw new Error("Unfinished UTF-8 octet sequence");break;case 14:if(s+1<o)n[i]=(a&15)<<12|(r.charCodeAt(s++)&63)<<6|r.charCodeAt(s++)&63;else throw new Error("Unfinished UTF-8 octet sequence");break;case 15:if(s+2<o){var u=((a&7)<<18|(r.charCodeAt(s++)&63)<<12|(r.charCodeAt(s++)&63)<<6|r.charCodeAt(s++)&63)-65536;if(0<=u&&u<=1048575)n[i++]=u>>10&1023|55296,n[i]=u&1023|56320;else throw new Error("Character outside valid Unicode range: 0x"+u.toString(16))}else throw new Error("Unfinished UTF-8 octet sequence");break;default:throw new Error("Bad UTF-8 encoding 0x"+a.toString(16))}}return i<e&&(n.length=i),String.fromCharCode.apply(String,n)}function HCe(r,e){for(var n=[],i=new Array(32768),s=0,o=0,a=r.length;s<e&&o<a;s++){var u=r.charCodeAt(o++);switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=u;break;case 12:case 13:if(o<a)i[s]=(u&31)<<6|r.charCodeAt(o++)&63;else throw new Error("Unfinished UTF-8 octet sequence");break;case 14:if(o+1<a)i[s]=(u&15)<<12|(r.charCodeAt(o++)&63)<<6|r.charCodeAt(o++)&63;else throw new Error("Unfinished UTF-8 octet sequence");break;case 15:if(o+2<a){var l=((u&7)<<18|(r.charCodeAt(o++)&63)<<12|(r.charCodeAt(o++)&63)<<6|r.charCodeAt(o++)&63)-65536;if(0<=l&&l<=1048575)i[s++]=l>>10&1023|55296,i[s]=l&1023|56320;else throw new Error("Character outside valid Unicode range: 0x"+l.toString(16))}else throw new Error("Unfinished UTF-8 octet sequence");break;default:throw new Error("Bad UTF-8 encoding 0x"+u.toString(16))}if(s>=32766){var g=s+1;i.length=g,n[n.length]=String.fromCharCode.apply(String,i),e-=g,s=-1}}return s>0&&(i.length=s,n[n.length]=String.fromCharCode.apply(String,i)),n.join("")}function rne(r,e){return(e==null||e<0)&&(e=r.length),e===0?"":/^[\x00-\x7f]*$/.test(r)||!/^[\x00-\xff]*$/.test(r)?e===r.length?r:r.substr(0,e):e<32767?WCe(r,e):HCe(r,e)}function nne(r,e){return r==null||r.length===0?r:(r=i6(r),e=i6(e),ene(UCe(r6(r,!0),tne(r6(e,!1))),!1))}function zCe(r,e){return LCe()(nne(r,e))}function ine(r,e){return r==null||r.length===0?r:(e=i6(e),rne(ene(FCe(r6(r,!1),tne(r6(e,!1))),!0)))}function $Ce(r,e){return r==null||r.length===0?r:ine(DCe()(r),e)}const VCe={utf8Encode:i6,utf8Decode:rne,encrypt:nne,encryptToBase64:zCe,decrypt:ine,decryptFromBase64:$Ce};var jCe=function(r){for(var e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",n="";n.length<r;){var i=Math.floor(Math.random()*e.length);n+=e[i]}return n},KCe=function(r){var e=0,n=!0,i=!1,s=void 0;try{for(var o=r[Symbol.iterator](),a;!(n=(a=o.next()).done);n=!0){var u=a.value;e^=u.charCodeAt(0)}}catch(g){i=!0,s=g}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}var l=e.toString(16);return l.length===2?l:"0".concat(l)},GCe=function(r){var e=jCe(6),n=Date.now(),i="".concat(r,"|").concat(n),s=VCe.encryptToBase64(i,e),o=KCe("".concat(e).concat(s));return"".concat(e).concat(s).concat(o)},sne=null;function Dtt(r){return x9.apply(this,arguments)}function x9(){return x9=_async_to_generator(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!isTelegramMiniApp()){i.next=5;break}return i.next=3,syncLocalTGMADfp(e);case 3:i.next=7;break;case 5:return i.next=7,syncLocalWebDfp(e);case 7:case"end":return i.stop()}},r)})),x9.apply(this,arguments)}var one=function(r){return GCe(r)},Utt=function(){var r=getCookie(sne.fvideo_token_key);return r?one(r):""},Ftt=function(){return getCookie(sne.storeKey.device_id_key)||""},qCe="",Ic={track:function(){},debug:!1,responseInterceptor:function(r){return r},requestInterceptor:function(r,e){return[r,e]},resultInterceptor:function(r){return r},baseUrl:qCe,accelerateOrigin:"",checkAccelerable:function(){return!1},accelerate:{defaultOrigin:"",origins:[],enbleSites:null,checkAccelerable:null},enableSentry:!0,enableLog:!0,enableMonitorLog:!0,enableBigdataApiLog:!0,logUrl:"",ssrHeaders:{},needAuthCheck:!1,needCaptcha:!1,captchaConfig:{staticHost:"",googleReCaptchaKey:""},staticUrl:""},ane=!1,Wtt=function(r){if(deprecateWarn("initConfig"),ane){var e="[http] initConfig should only be called once.";console.error(e)}ane=!0;try{var n=r.accelerate;n&&(ZCe(n),enbleAccelerate(n)&&accelerate(n))}catch{}return Object.assign(Ic,r)},Htt=function(r){globalThis.ssrHeaders={}};function ZCe(r){typeof r.origins=="string"&&(r.origins=r.origins.split(",").map(function(e){return e.trim()})),typeof r.enbleSites=="string"&&(r.enbleSites=r.enbleSites.split(",").map(function(e){return e.trim()}))}var YCe=O1().isHybrid,B9="",ztt=function(r){var e=r.req,n=r.page;try{e&&e.headers&&(B9="https://".concat(e.headers.host).concat(e.url)),typeof n=="string"&&(B9=n)}catch{}},XCe=function(){return B9},O9=Ic.enableLog&&Ic.enableMonitorLog,JCe=function(r){return!r.code&&typeof r.message=="string"&&~r.message.indexOf("JSON")?"Invalid-Json":r.name},une=function(r){if(!(YCe||!O9))try{var e=QCe(r),n=e.ret,i=e.bid,s=bs(e,["ret","bid"]);Ic.track("web_http",gn(Mr({},s),{wh_clientType:n,bnc_uuid:i}))}catch(o){console.error("libs/http@log",o)}};function QCe(r){var e=r.startTime,n=r.status,i=r.url,s=r.page,o=r.error,a=r.uuid,u=r.bncUuid,l=Date.now(),g={t:"API",resc:n,requ:i,ts:l,ct:l-e,ret:"Node",rest:o?"error":"success",uid:a,bid:u};return s&&(g.p=s),o&&(g.errt=JCe(o)),g}var P9=O1().isHybrid,cne=function(){var r=(0,k.A)(b().mark(function e(){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!(!au||P9)){i.next=2;break}return i.abrupt("return",{});case 2:return i.next=4,Vre();case 4:return i.t0=i.sent,i.abrupt("return",{"device-info":i.t0});case 6:case"end":return i.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),e6e=function(){return null},t6e=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return""}},lne=function(){if(!au)return"";var r=og.read("bnc-uuid");return r||(r=dd(),og.writeCookieWithDomainLevel("bnc-uuid",r,365*5,!0)),r},r6e=lne(),n6e=function(){return au?k9():"en"},i6e=function(r){var e;if(au)return{};var n=(r==null||(e=r.headers)===null||e===void 0?void 0:e.cookie)||null;return n?{cookie:n}:{}},s6e=function(){return au?MCe():{}},o6e=function(){if(au)return{};var r={};return r},a6e=function(r){var e="";au&&(e=self.location.href);try{var n=XCe();au||(e=r?"https://".concat(r.headers.host).concat(r.url):n)}catch{}return e},u6e=function(){if(au)return"";try{return"{}".CDN_REGION}catch{return"en"}},fne=u6e(),ET=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return s=i.omitHeader,o=i.lang,a=i.headers,u=i.req,l=i.credentials,g=i.request,Re.next=3,cne();case 3:return y=Re.sent,A=s?{}:Mr({lang:o||n6e(),"X-UI-REQUEST-TRACE":n,"X-TRACE-ID":n,"BNC-UUID":r6e,"Content-Type":"application/json"},y),!s&&fne&&(A=Object.assign(A,{"X-CDN-REGION":fne})),!s&&!P9&&(A=Object.assign(A,{clienttype:"web"})),au&&!P9&&(I=og.read("BNC_FV_KEY_T")||"",A=Object.assign(A,{"FVIDEO-ID":og.read("BNC_FV_KEY")||"","FVIDEO-TOKEN":I?one(I):"","X-PASSTHROUGH-TOKEN":localStorage.getItem("X-PASSTHROUGH-TOKEN")||og.read("bnc-challenge-token")||"","BNC-Location":og.read("BNC-Location")||""}),P=e6e(),P!==null&&(A["BNC-Level"]=P)),D=i6e(u),U=s6e(),V=o6e(),J=a6e(g||u),re={method:"GET",mode:"cors",headers:gn(Mr({},A,D,a,V,U),{"BNC-Time-Zone":t6e()}),credentials:l},Re.abrupt("return",{opts:re,page:J});case 14:case"end":return Re.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),TT=function(r){return r;var e},dne=function(r){function e(){this.message=r}return e.prototype=new Error,e.prototype.name="InvalidCharacterError",e.prototype.code=5,e},c6e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l6e=dne("The string to be encoded contains characters out of range"),f6e=typeof btoa<"u"?function(r){return btoa(r)}:function(r){for(var e=String(r),n="",i,s,o=0,a=c6e;e.charAt(o|0)||(a="=",o%1);n+=a.charAt(63&i>>8-o%1*8)){if(s=e.charCodeAt(o+=3/4),s>255)throw new l6e;i=i<<8|s}return n},d6e=function(r){return encodeURIComponent(r).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode("0x"+n)})};const h6e=function(r){return f6e(d6e(r))},p6e=function(r){return h6e(r).replace(/\+/g,"-").replace(/\//g,"_")};var $tt=dne("The string to be decoded is not correctly encoded"),g6e=null,y6e=function(r){return decodeURIComponent(r.split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))};const Vtt=function(r){return y6e(g6e(r))},jtt=function(r){return atob(r.replace(/-/g,"+").replace(/_/g,"/"))};var m6e=Ire()().fetch,b6e=O1().isHybrid,v6e="/bapi/composite/v2/public/common/config/stub/score",N9="_acc_org",w6e=12*60*60*1e3,A6e="03N03N03N01G02T02K03202S03202U02W01G02U033031",hne=0,M9=null,_6e=!1;function Ktt(r){var e=r.defaultOrigin,n=r.enbleSites,i=n===void 0?[]:n,s=r.checkAccelerable;return!1;var o}function Gtt(r){var e=r.defaultOrigin,n=e===void 0?"":e,i=r.origins,s=i===void 0?[]:i;return;var o,a,u}function E6e(){return;var r}function T6e(r){for(var e="0123ABCDEFGNXYZ456789OPQRSTUVWHIJKLM",n=e.length,i=e.split(""),s="",o,a,u,l,g=0;g<r.length;g++)o=r.charCodeAt(g),a=o%n,o=(o-a)/n,u=o%n,o=(o-u)/n,l=o%n,s+=i[l]+i[u]+i[a];return s}function L9(){if(++hne,!(!self._accelerate_http_failed||hne!==2)){var r=F9(),e=r.r,n=r.o,i=r.t;e||(self.localStorage.setItem(N9,JSON.stringify({r:!0,o:n,t:i})),self.location.reload())}}function pne(r,e){return o6(r),W9(r).then(function(){s6(e)||D9()}).catch(function(){self._accelerate_http_failed=!0,L9(),D9()})}function s6(r){return r&&+new Date-r<w6e}function D9(){var r=k6e();I6e(r).then(function(e){var n=r.find(function(i){return~e.url.indexOf(i)});o6(n),U9(n),L9()}).catch(function(){U9(null)})}function o6(r){r=a6(r),self._ACCELERATE_ORIGIN=r}function U9(r){var e={t:+new Date};r&&(r=a6(r),e.o=r);var n=F9(),i=n.r,s=n.t;s6(s)&&i&&(e.r=i),self.localStorage.setItem(N9,JSON.stringify(e))}function F9(){return JSON.parse(self.localStorage.getItem(N9)||"{}")}function W9(r){return m6e("".concat(a6(r)).concat(v6e,"?timestamp=").concat(+new Date)).then(function(e){return S6e(e.status)?e:Promise.reject()})}function S6e(r){return 200<=r&&r<300}function I6e(r){var e=0;return new Promise(function(n,i){r.forEach(function(s){W9(s).then(function(o){n(o),++e}).catch(function(){++e,e===r.length&&i()})})})}function a6(r){return!r||/^https?:/.test(r)?r:"https://".concat(r)}function k6e(){return M9.push(self.location.origin),M9}function R6e(r){return Object.prototype.toString.call(r)==="[object Array]"}var C6e=Pre(Nre(Mr({},M,{})));const x6e=C6e;function gne(r){var e=r.id,n=r.src,i=r.timeout,s=i===void 0?60*1e3:i;return new Promise(function(o,a){var u=document.createElement("script");u.src=n,e&&(u.id=e),u.onload=function(){return o(!0)},u.onerror=function(){return a("script load error")},setTimeout(function(){return a("script load timeout")},s),document.body.appendChild(u)})}function B6e(r){return H9.apply(this,arguments)}function H9(){return H9=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(n=e.bizId,i=e.staticHost,s=e.lang,o=e.apiHost,a=e.validateId,self.BCaptcha){g.next=4;break}return g.next=4,gne({id:"_bnwv_se_captcha",src:"".concat(i,"/static/js/se/captcha/v1/captcha.min.js")});case 4:return u=new self.BCaptcha({lang:s,bizId:n,staticHost:i,apiHost:o||"",apiBasePath:"/bapi/composite/v1/public/antibot"}),g.abrupt("return",new Promise(function(y,A){u.show({securityCheckResponseValidateId:a,onCancel:function(){return y(!1)},onError:function(I){return A({message:I})},onValidateSuccess:function(I,P){return y({challenge:I,token:P})}})}));case 6:case"end":return g.stop()}},r)})),H9.apply(this,arguments)}function O6e(r){return z9.apply(this,arguments)}function z9(){return z9=(0,k.A)(b().mark(function r(e){var n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=e.googleReCaptchaKey,i=e.needCaptcha,!(!n||!i)){a.next=3;break}throw new Error("miss google captchaKey & needCaptcha");case 3:if(s=self.grecaptcha,s){a.next=10;break}return a.next=7,gne({src:"/recaptcha/enterprise.js?render=".concat(n)});case 7:return s=self.grecaptcha,a.next=10,new Promise(function(u,l){s.enterprise.ready(u),setTimeout(function(){return l("grecaptcha ready timeout")},1e4)});case 10:return a.abrupt("return",s.enterprise.execute(n,{action:"submit"}).then(function(u){return{token:u}}));case 11:case"end":return a.stop()}},r)})),z9.apply(this,arguments)}function P6e(r){self._bn_reporter=self._bn_reporter||[],self._bn_reporter.push(r)}var Ztt=function(r){var e=r.data;t({data:{data:e},key:"reportPerformanceEvent"})},N6e=function(r){var e=r.data;P6e({data:{data:e},key:"reportMonitorEvent"})},Ytt=function(r){var e=r.data;t({data:{data:e},key:"reportErrorEvent"})},yne=function(r){try{var e,n,i,s,o,a,u,l,g;return;var y}catch(A){console.log("libs/http/logger2",A)}},M6e=function(r){var e={};return r&&["x-cache"].forEach(function(n){e[n]=r.get?r.get(n):r[n]}),e},L6e=function(){var r={};return function(e){r[e]}}(),ST=O1().isHybrid,mne=function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",x6e.fetch(n,i));case 1:case"end":return o.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),D6e=au?mne.bind(self):mne,bne=console.log,U6e=console.warn,F6e=function(r){return r>=200&&r<300||r===401},W6e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!n._skipCheckStatus){a.next=2;break}return a.abrupt("return",n);case 2:if(!F6e(n.status)){a.next=4;break}return a.abrupt("return",n);case 4:return a.prev=4,a.next=7,n.json();case 7:throw i=a.sent,s=new Error(n.statusText||n.status),s.errorMsg=i,s;case 13:throw a.prev=13,a.t0=a.catch(4),a.t0.code=n.status,au&&(a.t0.name=n.status),a.t0;case 18:case"end":return a.stop()}},e,null,[[4,13]])}));return function(n){return r.apply(this,arguments)}}(),vne=lne(),wne=function(){return au?k9():"en"},H6e=function(r){var e=Ic.baseUrl,n=Ic.accelerateOrigin,i=Ic.checkAccelerable,s=Ic.accelerate;if(i=s.checkAccelerable||i,au){var o=s.enbleSites;n=self._ACCELERATE_ORIGIN||s.defaultOrigin||n,typeof n=="string"&&(n=j6e(n)),o&&V6e(o)&&!~o.indexOf(self.location.hostname)&&(n="")}return/^(https?:)?\/\//.test(r)?r:au&&!ST&&n&&typeof n=="string"&&/^(https?:)?\/\//.test(n)&&i&&i(r)?"".concat(n).concat(r):e?"".concat(e).concat(r):au?"".concat(self.location.origin).concat(r):r},z6e=function(r,e){return;var n,i,s,o,a,u,l,g,y,A,I,P},u6=!1,Ane=function(r){return r.indexOf("/v1/public/account/security/challenge/select")===-1&&r.indexOf("/v1/public/account/security/challenge/pass")===-1},IT=function(){var r=(0,k.A)(b().mark(function e(n,i,s,o,a){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on;return b().wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return L6e("request"),u=Ic.debug,l=Ic.responseInterceptor,g=Ic.requestInterceptor,y=Ic.resultInterceptor,A=Ic.needAuthCheck,I=Ic.staticUrl,P=Date.now(),Ar.prev=6,n=H6e(n),Ar.t0=ur,Ar.next=12,g(n,i,a);case 12:if(Ar.t1=Ar.sent,J=(0,Ar.t0)(Ar.t1,2),n=J[0],i=J[1],!(Ane(n)&&u6)){Ar.next=19;break}throw new Error("captcha is doing, please wait");case 19:n.includes("gateway-api"),Ar.next=22;break;case 22:return Ar.t2=l,Ar.next=25,D6e(n,i);case 25:return Ar.t3=Ar.sent,Ar.t4=a,Ar.t5=i,Ar.next=30,(0,Ar.t2)(Ar.t3,Ar.t4,Ar.t5);case 30:return D=Ar.sent,re=Date.now(),U=re-P,Ar.next=35,W6e(D);case 35:if(ce=D._bodyBlob,!(ce&&["application/vnd.ms-excel","application/vnd.ms-pdf","application/pdf","application/octet-stream"].some(function(Xr){return"".concat(ce.type).includes(Xr)}))){Ar.next=38;break}return Ar.abrupt("return",D.blob());case 38:return Ar.next=40,D.json();case 40:V=Ar.sent,Ar.next=55;break;try{De=JSON.parse(sessionStorage.getItem(Re+"basecommontranslate")||"")||{}}catch{}case 49:return Ar.next=51,_ne("".concat(I,"/api/i18n/-/web/cms/").concat(Re,"/infra-common"));case 51:Ue=Ar.sent,sessionStorage.setItem(Re+"basecommontranslate",JSON.stringify(Ue)),De=Ue;case 54:z6e(Re,De);case 55:if(O9&&(une({startTime:P,status:D.status,url:D.url,page:o,uuid:i==null||(Ve=i.headers)===null||Ve===void 0?void 0:Ve["X-TRACE-ID"],bncUuid:vne}),ST||yne({opts:i,url:n,res:D,duration:U,result:V})),u&&bne(`
|
||
Request url: `.concat(n,`,
|
||
params is: `).concat(JSON.stringify(s),`
|
||
responseStatus: `).concat(D.status,`
|
||
duration time is `).concat(U,`,
|
||
`).concat(U>500?"more than 500ms, ":"")),!$6e(y)){Ar.next=59;break}return Ar.abrupt("return",y(V)||V);case 59:return Ar.abrupt("return",V);case 62:if(Ar.prev=62,Ar.t6=Ar.catch(6),Se=Ic.needCaptcha,Ce=Ic.captchaConfig,je=Ar.t6.status||Ar.t6.code||((pe=Ar.t6.errorMsg)===null||pe===void 0?void 0:pe.status),!(!ST&&au&&Se&&je===418)){Ar.next=110;break}if($e=Ce.staticHost,Qe=Ce.googleReCaptchaKey,!(Ane(n)&&!u6&&$e)){Ar.next=110;break}return u6=!0,Ar.prev=71,og.writeCookieWithDomainLevel("bnc-challenge-token","",-1,!0),nt={supportedTypes:["bCAPTCHA2",Qe?"reCAPTCHA":""].filter(Boolean)},Ar.next=76,Ene("/bapi/accounts/v1/public/account/security/challenge/select",nt);case 76:if(Ne=Ar.sent,Me=Ne.data,ct=Me||{},mt=ct.challengeType,Bt=ct.sessionId,er={validateCodeType:mt,sessionId:Bt},mt!=="bCAPTCHA2"){Ar.next=89;break}return cr=wne(),Ar.next=85,B6e({bizId:"issue_token",lang:cr,staticHost:$e});case 85:pr=Ar.sent,er.bCaptchaToken=pr.token,Ar.next=98;break;case 89:if(mt!=="reCAPTCHA"){Ar.next=97;break}return Ar.next=92,O6e({googleReCaptchaKey:Qe,needCaptcha:Se});case 92:Dr=Ar.sent,er.siteKey=Qe,er.recaptchaResponse=Dr.token,Ar.next=98;break;case 97:throw new Error("challengeType type is not support");case 98:return Ar.next=100,Ene("/bapi/accounts/v1/public/account/security/challenge/pass",er);case 100:Rr=Ar.sent,Pr=Rr.data,og.writeCookieWithDomainLevel("bnc-challenge-token",Pr.token,7,!0),Ar.next=109;break;case 105:Ar.prev=105,Ar.t7=Ar.catch(71),Ar.t6.message=Ar.t7.message,console.log("captcha error",Ar.t7);case 109:u6=!1;case 110:throw au&&!ST&&Ar.t6&&Ar.t6.name==="TypeError"&&E6e(),O9&&(une({startTime:P,status:D&&D.status,url:n,page:o,error:Ar.t6,uuid:i==null||(on=i.headers)===null||on===void 0?void 0:on["X-TRACE-ID"],bncUuid:vne}),ST||yne({opts:i,url:n,res:D,duration:U,result:V,net_err_exist:!0})),u&&bne(`
|
||
BAD REQUEST:
|
||
Request url: {`.concat(n,`},
|
||
params is: `).concat(JSON.stringify(s),`,
|
||
parse ERROR is `).concat(JSON.stringify(Ar.t6))),U6e(Ar.t6),Ar.t6;case 115:case"end":return Ar.stop()}},e,null,[[6,62],[71,105]])}));return function(n,i,s,o,a){return r.apply(this,arguments)}}(),_ne=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return i=i||{},s=dd(),g.next=4,ET(s,TT(i));case 4:return o=g.sent,a=o.opts,u=o.page,g.abrupt("return",IT(n,a,{},u,i));case 8:case"end":return g.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Ene=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g=arguments;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return s=g.length>2&&g[2]!==void 0?g[2]:{},o=dd(),A.next=4,ET(o,TT(s));case 4:return a=A.sent,u=a.opts,l=a.page,u=Object.assign(u,{method:"POST",body:JSON.stringify(i)}),A.abrupt("return",IT(n,u,i,l,s));case 9:case"end":return A.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Xtt=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g=arguments;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return s=g.length>2&&g[2]!==void 0?g[2]:{},o=dd(),A.next=4,ET(o,TT(s));case 4:return a=A.sent,u=a.opts,l=a.page,u=Object.assign(u,{method:"PUT",body:JSON.stringify(i)}),A.abrupt("return",IT(n,u,i,l,s));case 9:case"end":return A.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Jtt=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g=arguments;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return s=g.length>2&&g[2]!==void 0?g[2]:{},o=dd(),A.next=4,ET(o,TT(s));case 4:return a=A.sent,u=a.opts,l=a.page,u=Object.assign(u,{method:"DELETE",body:JSON.stringify(i)}),A.abrupt("return",IT(n,u,i,l,s));case 9:case"end":return A.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Qtt=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y=arguments;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return s=y.length>2&&y[2]!==void 0?y[2]:{},o=dd(),I.next=4,ET(o,TT(s));case 4:return a=I.sent,u=a.opts,l=a.page,s.headers&&s.headers["Content-Type"]||(g=u.headers)===null||g===void 0||delete g["Content-Type"],u=Object.assign(u,{method:"POST",body:i}),I.abrupt("return",IT(n,u,i,l,s));case 10:case"end":return I.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),ert=null,Tne=Object.prototype.toString;function $6e(r){return Tne.call(r)==="[object Function]"}function V6e(r){return Tne.call(r)==="[object Array]"}function j6e(r){return!r||/^https?:/.test(r)?r:"https://".concat(r)}function K6e(){return!0}function $9(r){return r&&r.Math==Math?r:void 0}var G6e=typeof globalThis=="object"&&$9(globalThis)||!1||typeof self=="object"&&$9(self)||typeof tn.g=="object"&&$9(tn.g)||function(){return this}()||{},kT=G6e;kT.__HTTP_NEXT_MODE_ENABLED__=kT.__HTTP_NEXT_MODE_ENABLED__||!1;function q6e(){try{kT.__HTTP_NEXT_MODE_ENABLED__=!0}catch(r){console.error("[@binance/http] __HTTP_NEXT_MODE_ENABLED__ failed",r)}}function trt(){try{kT.__HTTP_NEXT_MODE_ENABLED__=!1}catch(r){console.error("[@binance/http] __HTTP_NEXT_MODE_ENABLED__ failed",r)}}q6e();function Z6e(){try{if(kT.__HTTP_NEXT_MODE_ENABLED__&&K6e())return!0}catch(r){console.error("[@binance/http] canUsePikaFetch failed",r)}return!1}var rrt=cne,nrt=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=HTTPLegacy.fetch;try{isPikaFetchUsed()&&(i=HTTPPika.fetch)}catch(s){console.error("[@binance/http] fetch failed",s)}return i.apply(void 0,_to_consumable_array(e))},Y6e=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=_ne;try{Z6e()&&(i=Yre)}catch(s){console.error("[@binance/http] get failed",s)}return i.apply(void 0,(0,Li.A)(e))},irt=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=HTTPLegacy.post;try{isPikaFetchUsed()&&(i=HTTPPika.post)}catch(s){console.error("[@binance/http] post failed",s)}return i.apply(void 0,_to_consumable_array(e))},srt=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=HTTPLegacy.put;try{isPikaFetchUsed()&&(i=HTTPPika.put)}catch(s){console.error("[@binance/http] put failed",s)}return i.apply(void 0,_to_consumable_array(e))},ort=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=HTTPLegacy.del;try{isPikaFetchUsed()&&(i=HTTPPika.del)}catch(s){console.error("[@binance/http] del failed",s)}return i.apply(void 0,_to_consumable_array(e))},art=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=HTTPLegacy.postForm;try{isPikaFetchUsed()&&(i=HTTPPika.postForm)}catch(s){console.error("[@binance/http] postForm failed",s)}return i.apply(void 0,_to_consumable_array(e))},urt=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=HTTPLegacy.fetchOrigin;try{isPikaFetchUsed()&&(i=HTTPPika.fetchOrigin)}catch(s){console.error("[@binance/http] fetchOrigin failed",s)}return i.apply(void 0,_to_consumable_array(e))},M1=function(){},X6e=function(r){return Math.pow(2,r)},crt=null,J6e=["ws_start","ws_connected","ws_closed","ws_error","get_token","get_token_error","privateRequest"],Q6e=new Set(J6e),e4e=["ws_error","ws_start","ws_connected","ws_closed","publicRequest"],t4e=new Set(e4e),r4e=["ws_start","ws_connected","ws_closed","ws_error","get_token","get_token_error","friendlyRequest"],n4e=new Set(r4e),RT=[],el=function(r){RT.push({status:r,timeStamp:Date.now()})},c6=20,i4e=function(){return RT.filter(function(r){var e=r.status;return Q6e.has(e)}).slice(-c6)},s4e=function(){return RT.filter(function(r){var e=r.status;return t4e.has(e)}).slice(-c6)},o4e=function(){return RT.filter(function(r){var e=r.status;return n4e.has(e)}).slice(-c6)},a4e=function(){return RT.slice(-c6)},dm=function(){var r=!1,e=new Set,n=new Set,i=function(){e.forEach(function(o){o()}),e.clear()},s=function(o){i(),o&&(n.forEach(function(a){e.add(a())}),n.clear())};return{setReady:function(o){r=o,s(r)},onReady:function(o){n.add(o),r&&s(r)},clean:function(){n.clear(),i()}}},ag=tn(9495);function u4e(){let r=0,e=0;for(let i=0;i<28;i+=7){let s=this.buf[this.pos++];if(r|=(s&127)<<i,!(s&128))return this.assertBounds(),[r,e]}let n=this.buf[this.pos++];if(r|=(n&15)<<28,e=(n&112)>>4,!(n&128))return this.assertBounds(),[r,e];for(let i=3;i<=31;i+=7){let s=this.buf[this.pos++];if(e|=(s&127)<<i,!(s&128))return this.assertBounds(),[r,e]}throw new Error("invalid varint")}function V9(r,e,n){for(let o=0;o<28;o=o+7){const a=r>>>o,u=!(!(a>>>7)&&e==0),l=(u?a|128:a)&255;if(n.push(l),!u)return}const i=r>>>28&15|(e&7)<<4,s=!!(e>>3);if(n.push((s?i|128:i)&255),!!s){for(let o=3;o<31;o=o+7){const a=e>>>o,u=!!(a>>>7),l=(u?a|128:a)&255;if(n.push(l),!u)return}n.push(e>>>31&1)}}const l6=4294967296;function Sne(r){const e=r[0]==="-";e&&(r=r.slice(1));const n=1e6;let i=0,s=0;function o(a,u){const l=Number(r.slice(a,u));s*=n,i=i*n+l,i>=l6&&(s=s+(i/l6|0),i=i%l6)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),e?kne(i,s):j9(i,s)}function c4e(r,e){let n=j9(r,e);const i=n.hi&2147483648;i&&(n=kne(n.lo,n.hi));const s=Ine(n.lo,n.hi);return i?"-"+s:s}function Ine(r,e){if({lo:r,hi:e}=l4e(r,e),e<=2097151)return String(l6*e+r);const n=r&16777215,i=(r>>>24|e<<8)&16777215,s=e>>16&65535;let o=n+i*6777216+s*6710656,a=i+s*8147497,u=s*2;const l=1e7;return o>=l&&(a+=Math.floor(o/l),o%=l),a>=l&&(u+=Math.floor(a/l),a%=l),u.toString()+Rne(a)+Rne(o)}function l4e(r,e){return{lo:r>>>0,hi:e>>>0}}function j9(r,e){return{lo:r|0,hi:e|0}}function kne(r,e){return e=~e,r?r=~r+1:e+=1,j9(r,e)}const Rne=r=>{const e=String(r);return"0000000".slice(e.length)+e};function Cne(r,e){if(r>=0){for(;r>127;)e.push(r&127|128),r=r>>>7;e.push(r)}else{for(let n=0;n<9;n++)e.push(r&127|128),r=r>>7;e.push(1)}}function f4e(){let r=this.buf[this.pos++],e=r&127;if(!(r&128))return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<7,!(r&128))return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<14,!(r&128))return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<21,!(r&128))return this.assertBounds(),e;r=this.buf[this.pos++],e|=(r&15)<<28;for(let n=5;r&128&&n<10;n++)r=this.buf[this.pos++];if(r&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var d4e=tn(85409);const S0=h4e();function h4e(){const r=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof r.getBigInt64=="function"&&typeof r.getBigUint64=="function"&&typeof r.setBigInt64=="function"&&typeof r.setBigUint64=="function"&&(typeof d4e!="object"||!0)){const n=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const u=typeof a=="bigint"?a:BigInt(a);if(u>i||u<n)throw new Error(`invalid int64: ${a}`);return u},uParse(a){const u=typeof a=="bigint"?a:BigInt(a);if(u>o||u<s)throw new Error(`invalid uint64: ${a}`);return u},enc(a){return r.setBigInt64(0,this.parse(a),!0),{lo:r.getInt32(0,!0),hi:r.getInt32(4,!0)}},uEnc(a){return r.setBigInt64(0,this.uParse(a),!0),{lo:r.getInt32(0,!0),hi:r.getInt32(4,!0)}},dec(a,u){return r.setInt32(0,a,!0),r.setInt32(4,u,!0),r.getBigInt64(0,!0)},uDec(a,u){return r.setInt32(0,a,!0),r.setInt32(4,u,!0),r.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(n){return typeof n!="string"&&(n=n.toString()),xne(n),n},uParse(n){return typeof n!="string"&&(n=n.toString()),Bne(n),n},enc(n){return typeof n!="string"&&(n=n.toString()),xne(n),Sne(n)},uEnc(n){return typeof n!="string"&&(n=n.toString()),Bne(n),Sne(n)},dec(n,i){return c4e(n,i)},uDec(n,i){return Ine(n,i)}}}function xne(r){if(!/^-?[0-9]+$/.test(r))throw new Error("invalid int64: "+r)}function Bne(r){if(!/^[0-9]+$/.test(r))throw new Error("invalid uint64: "+r)}const f6=Symbol.for("@bufbuild/protobuf/text-encoding");function lrt(r){globalThis[f6]=r}function One(){if(globalThis[f6]==null){const r=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[f6]={encodeUtf8(n){return r.encode(n)},decodeUtf8(n){return e.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return globalThis[f6]}var hm;(function(r){r[r.Varint=0]="Varint",r[r.Bit64=1]="Bit64",r[r.LengthDelimited=2]="LengthDelimited",r[r.StartGroup=3]="StartGroup",r[r.EndGroup=4]="EndGroup",r[r.Bit32=5]="Bit32"})(hm||(hm={}));const p4e=34028234663852886e22,g4e=-34028234663852886e22,y4e=4294967295,m4e=2147483647,b4e=-2147483648;class d6{constructor(e=One().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let s=0;s<this.chunks.length;s++)e+=this.chunks[s].length;let n=new Uint8Array(e),i=0;for(let s=0;s<this.chunks.length;s++)n.set(this.chunks[s],i),i+=this.chunks[s].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Pne(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return K9(e),Cne(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){v4e(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){Pne(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){K9(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return K9(e),e=(e<<1^e>>31)>>>0,Cne(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),s=S0.enc(e);return i.setInt32(0,s.lo,!0),i.setInt32(4,s.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),s=S0.uEnc(e);return i.setInt32(0,s.lo,!0),i.setInt32(4,s.hi,!0),this.raw(n)}int64(e){let n=S0.enc(e);return V9(n.lo,n.hi,this.buf),this}sint64(e){const n=S0.enc(e),i=n.hi>>31,s=n.lo<<1^i,o=(n.hi<<1|n.lo>>>31)^i;return V9(s,o,this.buf),this}uint64(e){const n=S0.uEnc(e);return V9(n.lo,n.hi,this.buf),this}}class pm{constructor(e,n=One().decodeUtf8){this.decodeUtf8=n,this.varint64=u4e,this.uint32=f4e,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),n=e>>>3,i=e&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(e,n){let i=this.pos;switch(e){case hm.Varint:for(;this.buf[this.pos++]&128;);break;case hm.Bit64:this.pos+=4;case hm.Bit32:this.pos+=4;break;case hm.LengthDelimited:let s=this.uint32();this.pos+=s;break;case hm.StartGroup:for(;;){const[o,a]=this.tag();if(a===hm.EndGroup){if(n!==void 0&&o!==n)throw new Error("invalid end group tag");break}this.skip(a,o)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return S0.dec(...this.varint64())}uint64(){return S0.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),i=-(e&1);return e=(e>>>1|(n&1)<<31)^i,n=n>>>1^i,S0.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return S0.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return S0.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}function K9(r){if(typeof r=="string")r=Number(r);else if(typeof r!="number")throw new Error("invalid int32: "+typeof r);if(!Number.isInteger(r)||r>m4e||r<b4e)throw new Error("invalid int32: "+r)}function Pne(r){if(typeof r=="string")r=Number(r);else if(typeof r!="number")throw new Error("invalid uint32: "+typeof r);if(!Number.isInteger(r)||r>y4e||r<0)throw new Error("invalid uint32: "+r)}function v4e(r){if(typeof r=="string"){const e=r;if(r=Number(r),Number.isNaN(r)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof r!="number")throw new Error("invalid float32: "+typeof r);if(Number.isFinite(r)&&(r>p4e||r<g4e))throw new Error("invalid float32: "+r)}var frt="com",ko;(function(r){r[r.SERVICE_REQ=1]="SERVICE_REQ",r[r.SUBSCRIBE=2]="SUBSCRIBE",r[r.UNSUBSCRIBE=3]="UNSUBSCRIBE",r[r.LIST_CHANNELS=4]="LIST_CHANNELS",r[r.REFRESH_TOKEN=5]="REFRESH_TOKEN",r[r.LAST_TOKEN_TIME=6]="LAST_TOKEN_TIME",r[r.CLEAR_TOKEN=7]="CLEAR_TOKEN",r[r.PUBLIC_SERVICE_REQ=8]="PUBLIC_SERVICE_REQ",r[r.FRIENDLY_SERVICE_REQ=9]="FRIENDLY_SERVICE_REQ",r[r.PING=10]="PING",r[r.REFRESH_UUID=11]="REFRESH_UUID",r[r.REFRESH_LANG=12]="REFRESH_LANG",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ko||(ko={}));function Nne(r){switch(r){case 1:case"SERVICE_REQ":return ko.SERVICE_REQ;case 2:case"SUBSCRIBE":return ko.SUBSCRIBE;case 3:case"UNSUBSCRIBE":return ko.UNSUBSCRIBE;case 4:case"LIST_CHANNELS":return ko.LIST_CHANNELS;case 5:case"REFRESH_TOKEN":return ko.REFRESH_TOKEN;case 6:case"LAST_TOKEN_TIME":return ko.LAST_TOKEN_TIME;case 7:case"CLEAR_TOKEN":return ko.CLEAR_TOKEN;case 8:case"PUBLIC_SERVICE_REQ":return ko.PUBLIC_SERVICE_REQ;case 9:case"FRIENDLY_SERVICE_REQ":return ko.FRIENDLY_SERVICE_REQ;case 10:case"PING":return ko.PING;case 11:case"REFRESH_UUID":return ko.REFRESH_UUID;case 12:case"REFRESH_LANG":return ko.REFRESH_LANG;case-1:case"UNRECOGNIZED":default:return ko.UNRECOGNIZED}}function Mne(r){switch(r){case ko.SERVICE_REQ:return"SERVICE_REQ";case ko.SUBSCRIBE:return"SUBSCRIBE";case ko.UNSUBSCRIBE:return"UNSUBSCRIBE";case ko.LIST_CHANNELS:return"LIST_CHANNELS";case ko.REFRESH_TOKEN:return"REFRESH_TOKEN";case ko.LAST_TOKEN_TIME:return"LAST_TOKEN_TIME";case ko.CLEAR_TOKEN:return"CLEAR_TOKEN";case ko.PUBLIC_SERVICE_REQ:return"PUBLIC_SERVICE_REQ";case ko.FRIENDLY_SERVICE_REQ:return"FRIENDLY_SERVICE_REQ";case ko.PING:return"PING";case ko.REFRESH_UUID:return"REFRESH_UUID";case ko.REFRESH_LANG:return"REFRESH_LANG";case ko.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function Lne(){return{wsReqId:"",reqTime:0,reqAction:1,service:"",tag:"",reqArgs:void 0,trivialReq:void 0,balanceValuationReq:void 0,kycStatusReq:void 0,capitalConfigReq:void 0,getSelectorReq:void 0,getSubSelectorReq:void 0,isolatedMarginAccountReq:void 0,getAccountUserConfigReq:void 0,getAssetPortfolioReq:void 0,walletBalanceReq:void 0,getBuyAndSellSelectorReq:void 0,getBuyAndSellSubSelectorReq:void 0,getOpenGridsReq:void 0,getOrderConfirmationReq:void 0,getUserCommissionReq:void 0,inboxMsgReadReq:void 0,inboxMsgReq:void 0,inboxUnReadReq:void 0,faceSdkVerifyReq:void 0,buyRedesignQueryCryptoListReq:void 0,buyRedesignQueryFiatListReq:void 0,otcGetQuoteReq:void 0,activePositionsReq:void 0,loanableAssetReq:void 0,trialCalcForRepaymentReq:void 0,coinConfigReq:void 0,buwWalletBalanceReq:void 0,walletBalanceV2Req:void 0,faceRecognitionReq:void 0}}g9({wsReqId:{number:1,scope:"WsReq"},reqTime:{number:2,scope:"WsReq"},reqAction:{number:3,scope:"WsReq"},service:{number:4,scope:"WsReq"},tag:{number:5,scope:"WsReq"},reqArgs:{number:100,scope:"WsReq"},trivialReq:{number:101,scope:"WsReq"},balanceValuationReq:{number:102,scope:"WsReq"},kycStatusReq:{number:103,scope:"WsReq"},capitalConfigReq:{number:104,scope:"WsReq"},getSelectorReq:{number:105,scope:"WsReq"},getSubSelectorReq:{number:106,scope:"WsReq"},isolatedMarginAccountReq:{number:107,scope:"WsReq"},getAccountUserConfigReq:{number:108,scope:"WsReq"},getAssetPortfolioReq:{number:109,scope:"WsReq"},walletBalanceReq:{number:110,scope:"WsReq"},getBuyAndSellSelectorReq:{number:111,scope:"WsReq"},getBuyAndSellSubSelectorReq:{number:112,scope:"WsReq"},getOpenGridsReq:{number:113,scope:"WsReq"},getOrderConfirmationReq:{number:114,scope:"WsReq"},getUserCommissionReq:{number:115,scope:"WsReq"},inboxMsgReadReq:{number:116,scope:"WsReq"},inboxMsgReq:{number:117,scope:"WsReq"},inboxUnReadReq:{number:118,scope:"WsReq"},faceSdkVerifyReq:{number:119,scope:"WsReq"},buyRedesignQueryCryptoListReq:{number:120,scope:"WsReq"},buyRedesignQueryFiatListReq:{number:121,scope:"WsReq"},otcGetQuoteReq:{number:122,scope:"WsReq"},activePositionsReq:{number:123,scope:"WsReq"},loanableAssetReq:{number:124,scope:"WsReq"},trialCalcForRepaymentReq:{number:125,scope:"WsReq"},coinConfigReq:{number:126,scope:"WsReq"},buwWalletBalanceReq:{number:127,scope:"WsReq"},walletBalanceV2Req:{number:129,scope:"WsReq"},faceRecognitionReq:{number:130,scope:"WsReq"}});var Dne={key:"wsReq",encode:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new d6,i=[];return e.wsReqId!==""&&n.uint32(10).string(e.wsReqId),e.reqTime!==0&&n.uint32(16).int64(e.reqTime),e.reqAction!==1&&n.uint32(24).int32(e.reqAction),e.service!==void 0&&e.service!==""&&n.uint32(34).string(e.service),e.tag!==void 0&&e.tag!==""&&n.uint32(42).string(e.tag),e.reqArgs!==void 0&&n.uint32(802).string(e.reqArgs),Qc({scope:"WsReq"}).forEach(function(s){var o=e[s.key];if(o!==void 0){i.push(s.key);var a=(s.number<<3|2)>>>0;s.encode(o,n.uint32(a).fork()).join()}}),Object.keys(e).forEach(function(s){!i.includes(s)&&!p9.includes(s)&&x2("WsHttpSdkLiteMissMsg: scope(WsReq), key("+s+")")}),n},decode:function(e,n){for(var i=(0,ag.A)(e,pm)?e:new pm(e),s=n===void 0?i.len:i.pos+n,o=Lne();i.pos<s;){var a=i.uint32();switch(a>>>3){case 1:{if(a!==10)break;o.wsReqId=i.string();continue}case 2:{if(a!==16)break;o.reqTime=w4e(i.int64());continue}case 3:{if(a!==24)break;o.reqAction=i.int32();continue}case 4:{if(a!==34)break;o.service=i.string();continue}case 5:{if(a!==42)break;o.tag=i.string();continue}case 100:{if(a!==802)break;o.reqArgs=i.string();continue}}var u=a>>>3,l=Qc({scope:"WsReq"}).find(function(g){return g.number===u});if(l){o[l.key]=l.decode(i,i.uint32());break}if((a&7)===4||a===0)break;x2("WsHttpSdkLiteMissMsg: scope(WsReq), id("+String(a>>>3)+")"),i.skip(a&7)}return o},fromJSON:function(e){return Mr({wsReqId:L1(e.wsReqId)?globalThis.String(e.wsReqId):"",reqTime:L1(e.reqTime)?globalThis.Number(e.reqTime):0,reqAction:L1(e.reqAction)?Nne(e.reqAction):1,service:L1(e.service)?globalThis.String(e.service):"",tag:L1(e.tag)?globalThis.String(e.tag):"",reqArgs:L1(e.reqArgs)?globalThis.String(e.reqArgs):void 0},Qc({scope:"WsReq"}).reduce(function(n,i){var s=e[i.key];return s!==void 0&&(n[i.key]=L1(s)?i.fromJSON(s):void 0),n},{}))},toJSON:function(e){var n={};return e.wsReqId!==""&&(n.wsReqId=e.wsReqId),e.reqTime!==0&&(n.reqTime=Math.round(e.reqTime)),e.reqAction!==1&&(n.reqAction=Mne(e.reqAction)),e.service!==void 0&&e.service!==""&&(n.service=e.service),e.tag!==void 0&&e.tag!==""&&(n.tag=e.tag),e.reqArgs!==void 0&&(n.reqArgs=e.reqArgs),Qc({scope:"WsReq"}).forEach(function(i){var s=i.key;e[s]!==void 0&&(n[s]=i.toJSON(e[s]))}),n},create:function(e){return Dne.fromPartial(e??{})},fromPartial:function(e){var n=Lne(),i;n.wsReqId=(i=e.wsReqId)!==null&&i!==void 0?i:"";var s;n.reqTime=(s=e.reqTime)!==null&&s!==void 0?s:0;var o;n.reqAction=(o=e.reqAction)!==null&&o!==void 0?o:1;var a;n.service=(a=e.service)!==null&&a!==void 0?a:"";var u;n.tag=(u=e.tag)!==null&&u!==void 0?u:"";var l;return n.reqArgs=(l=e.reqArgs)!==null&&l!==void 0?l:void 0,Qc({scope:"WsReq"}).forEach(function(g){var y=g.key;n[y]=e[y]!==void 0&&e[y]!==null?g.fromPartial(e[y]):void 0}),n}};function w4e(r){var e=globalThis.Number(r.toString());if(e>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(e<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return e}function L1(r){return r!=null}var drt="com",I0;(function(r){r[r.INVALID_TOKEN=1]="INVALID_TOKEN",r[r.INVALID_REQUEST=2]="INVALID_REQUEST",r[r.SERVICE_ERROR=3]="SERVICE_ERROR",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(I0||(I0={}));function A4e(r){switch(r){case 1:case"INVALID_TOKEN":return I0.INVALID_TOKEN;case 2:case"INVALID_REQUEST":return I0.INVALID_REQUEST;case 3:case"SERVICE_ERROR":return I0.SERVICE_ERROR;case-1:case"UNRECOGNIZED":default:return I0.UNRECOGNIZED}}function _4e(r){switch(r){case I0.INVALID_TOKEN:return"INVALID_TOKEN";case I0.INVALID_REQUEST:return"INVALID_REQUEST";case I0.SERVICE_ERROR:return"SERVICE_ERROR";case I0.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function Une(){return{wsReqId:"",respTime:0,reqAction:1,respError:1,errorCode:0,errorMsg:"",resp:void 0,trivialResp:void 0,balanceValuationResp:void 0,kycStatusResp:void 0,capitalConfigResp:void 0,getSelectorResp:void 0,getSubSelectorResp:void 0,isolatedMarginAccountResp:void 0,getAccountUserConfigResp:void 0,getAssetPortfolioResp:void 0,walletBalanceResp:void 0,getBuyAndSellSelectorResp:void 0,getBuyAndSellSubSelectorResp:void 0,getOpenGridsResp:void 0,getOrderConfirmationResp:void 0,getUserCommissionResp:void 0,inboxMsgReadResp:void 0,inboxMsgResp:void 0,inboxUnReadResp:void 0,faceSdkVerifyResp:void 0,buyRedesignQueryCryptoListResp:void 0,buyRedesignQueryFiatListResp:void 0,buyRedesignQueryCryptoResp:void 0,otcGetQuoteResp:void 0,activePositionsResp:void 0,loanableAssetResp:void 0,trialCalcForRepaymentResp:void 0,coinConfigResp:void 0,buwWalletBalanceResp:void 0,walletBalanceV2Resp:void 0,faceRecognitionResp:void 0}}g9({wsReqId:{number:1,scope:"WsResp"},respTime:{number:2,scope:"WsResp"},reqAction:{number:3,scope:"WsResp"},respError:{number:4,scope:"WsResp"},errorCode:{number:5,scope:"WsResp"},errorMsg:{number:6,scope:"WsResp"},resp:{number:100,scope:"WsResp"},trivialResp:{number:101,scope:"WsResp"},balanceValuationResp:{number:102,scope:"WsResp"},kycStatusResp:{number:103,scope:"WsResp"},capitalConfigResp:{number:104,scope:"WsResp"},getSelectorResp:{number:105,scope:"WsResp"},getSubSelectorResp:{number:106,scope:"WsResp"},isolatedMarginAccountResp:{number:107,scope:"WsResp"},getAccountUserConfigResp:{number:108,scope:"WsResp"},getAssetPortfolioResp:{number:109,scope:"WsResp"},walletBalanceResp:{number:110,scope:"WsResp"},getBuyAndSellSelectorResp:{number:111,scope:"WsResp"},getBuyAndSellSubSelectorResp:{number:112,scope:"WsResp"},getOpenGridsResp:{number:113,scope:"WsResp"},getOrderConfirmationResp:{number:114,scope:"WsResp"},getUserCommissionResp:{number:115,scope:"WsResp"},inboxMsgReadResp:{number:116,scope:"WsResp"},inboxMsgResp:{number:117,scope:"WsResp"},inboxUnReadResp:{number:118,scope:"WsResp"},faceSdkVerifyResp:{number:119,scope:"WsResp"},buyRedesignQueryCryptoListResp:{number:120,scope:"WsResp"},buyRedesignQueryFiatListResp:{number:121,scope:"WsResp"},buyRedesignQueryCryptoResp:{number:122,scope:"WsResp"},otcGetQuoteResp:{number:123,scope:"WsResp"},activePositionsResp:{number:124,scope:"WsResp"},loanableAssetResp:{number:125,scope:"WsResp"},trialCalcForRepaymentResp:{number:126,scope:"WsResp"},coinConfigResp:{number:127,scope:"WsResp"},buwWalletBalanceResp:{number:128,scope:"WsResp"},walletBalanceV2Resp:{number:129,scope:"WsResp"},faceRecognitionResp:{number:130,scope:"WsResp"}});var B2={key:"wsResp",encode:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new d6,i=[];return e.wsReqId!==""&&n.uint32(10).string(e.wsReqId),e.respTime!==0&&n.uint32(16).int64(e.respTime),e.reqAction!==1&&n.uint32(24).int32(e.reqAction),e.respError!==void 0&&e.respError!==1&&n.uint32(32).int32(e.respError),e.errorCode!==void 0&&e.errorCode!==0&&n.uint32(40).int32(e.errorCode),e.errorMsg!==void 0&&e.errorMsg!==""&&n.uint32(50).string(e.errorMsg),e.resp!==void 0&&n.uint32(802).string(e.resp),Qc({scope:"WsResp"}).forEach(function(s){var o=e[s.key];if(o!==void 0){i.push(s.key);var a=(s.number<<3|2)>>>0;s.encode(o,n.uint32(a).fork()).join()}}),Object.keys(e).forEach(function(s){!i.includes(s)&&!p9.includes(s)&&x2("WsHttpSdkLiteMissMsg: scope(WsResp), key("+s+")")}),n},decode:function(e,n){for(var i=(0,ag.A)(e,pm)?e:new pm(e),s=n===void 0?i.len:i.pos+n,o=Une();i.pos<s;){var a=i.uint32();switch(a>>>3){case 1:{if(a!==10)break;o.wsReqId=i.string();continue}case 2:{if(a!==16)break;o.respTime=E4e(i.int64());continue}case 3:{if(a!==24)break;o.reqAction=i.int32();continue}case 4:{if(a!==32)break;o.respError=i.int32();continue}case 5:{if(a!==40)break;o.errorCode=i.int32();continue}case 6:{if(a!==50)break;o.errorMsg=i.string();continue}case 100:{if(a!==802)break;o.resp=i.string();continue}}var u=a>>>3,l=Qc({scope:"WsResp"}).find(function(g){return g.number===u});if(l){o[l.key]=l.decode(i,i.uint32());break}if((a&7)===4||a===0)break;x2("WsHttpSdkLiteMissMsg: scope(WsResp), id("+String(a>>>3)+")"),i.skip(a&7)}return o},fromJSON:function(e){return Mr({wsReqId:gm(e.wsReqId)?globalThis.String(e.wsReqId):"",respTime:gm(e.respTime)?globalThis.Number(e.respTime):0,reqAction:gm(e.reqAction)?Nne(e.reqAction):1,respError:gm(e.respError)?A4e(e.respError):1,errorCode:gm(e.errorCode)?globalThis.Number(e.errorCode):0,errorMsg:gm(e.errorMsg)?globalThis.String(e.errorMsg):"",resp:gm(e.resp)?globalThis.String(e.resp):void 0},Qc({scope:"WsResp"}).reduce(function(n,i){var s=e[i.key];return s!==void 0&&(n[i.key]=gm(s)?i.fromJSON(s):void 0),n},{}))},toJSON:function(e){var n={};return e.wsReqId!==""&&(n.wsReqId=e.wsReqId),e.respTime!==0&&(n.respTime=Math.round(e.respTime)),e.reqAction!==1&&(n.reqAction=Mne(e.reqAction)),e.respError!==void 0&&e.respError!==1&&(n.respError=_4e(e.respError)),e.errorCode!==void 0&&e.errorCode!==0&&(n.errorCode=Math.round(e.errorCode)),e.errorMsg!==void 0&&e.errorMsg!==""&&(n.errorMsg=e.errorMsg),e.resp!==void 0&&(n.resp=e.resp),Qc({scope:"WsResp"}).forEach(function(i){var s=i.key;e[s]!==void 0&&(n[s]=i.toJSON(e[s]))}),n},create:function(e){return B2.fromPartial(e??{})},fromPartial:function(e){var n=Une(),i;n.wsReqId=(i=e.wsReqId)!==null&&i!==void 0?i:"";var s;n.respTime=(s=e.respTime)!==null&&s!==void 0?s:0;var o;n.reqAction=(o=e.reqAction)!==null&&o!==void 0?o:1;var a;n.respError=(a=e.respError)!==null&&a!==void 0?a:1;var u;n.errorCode=(u=e.errorCode)!==null&&u!==void 0?u:0;var l;n.errorMsg=(l=e.errorMsg)!==null&&l!==void 0?l:"";var g;return n.resp=(g=e.resp)!==null&&g!==void 0?g:void 0,Qc({scope:"WsResp"}).forEach(function(y){var A=y.key;n[A]=e[A]!==void 0&&e[A]!==null?y.fromPartial(e[A]):void 0}),n}};function E4e(r){var e=globalThis.Number(r.toString());if(e>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(e<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return e}function gm(r){return r!=null}var hrt="com";function Fne(){return{channel:"",sourceTime:0,wsResp:void 0,trivialMsg:void 0,exchangeRateMsg:void 0,inboxMsg:void 0,c2cQuotePriceMsg:void 0,inboxNotificationMsg:void 0,coinPriceMsg:void 0,c2cAllQuotePriceMsg:void 0,c2cKlineMsg:void 0,emergencyBroadcastMsg:void 0,announcementBroadcastMsg:void 0,earnIndexMsg:void 0,pushMsg:void 0,nftInboxMsg:void 0,savingMarketAprMsg:void 0,earnDntProjectOverviewMsg:void 0,homePageRegUserMsg:void 0,growthButtonGameMsg:void 0,roamingWebAckPushMsg:void 0,assetRateMsg:void 0,quoteUpdatePushMsg:void 0,assetPushMsg:void 0,fundingBalanceMsg:void 0,txStatusEventMsg:void 0,web3CommonEventMsg:void 0,earnDcUnderlyingOverviewMsg:void 0,earnDcProjectOrderInfoMsg:void 0,apexIncomeMsg:void 0,assetBalancePushMsg:void 0,alphaBalanceMsg:void 0,alphaCexTokenAddMgs:void 0,alphaCexTokenDynamicMgs:void 0,alphaCexTokenKLineMgs:void 0,alphaCexTokenListDynamicMgs:void 0,alphaCexOrderChangeMsg:void 0,memeTokenInfoListMsg:void 0,userRefreshMsg:void 0,earnAccumulatorProjectDetailMsg:void 0,webAndAppInfoSyncWsMsg:void 0,web3DataTrackerWsMessage:void 0,paymentPixInfoSyncWsMsg:void 0,rfqEventMsg:void 0}}g9({channel:{number:1,scope:"WsMsg"},sourceTime:{number:2,scope:"WsMsg"},wsResp:{number:100,scope:"WsMsg"},trivialMsg:{number:101,scope:"WsMsg"},exchangeRateMsg:{number:102,scope:"WsMsg"},inboxMsg:{number:103,scope:"WsMsg"},c2cQuotePriceMsg:{number:104,scope:"WsMsg"},inboxNotificationMsg:{number:105,scope:"WsMsg"},coinPriceMsg:{number:106,scope:"WsMsg"},c2cAllQuotePriceMsg:{number:107,scope:"WsMsg"},c2cKlineMsg:{number:108,scope:"WsMsg"},emergencyBroadcastMsg:{number:109,scope:"WsMsg"},announcementBroadcastMsg:{number:110,scope:"WsMsg"},earnIndexMsg:{number:111,scope:"WsMsg"},pushMsg:{number:112,scope:"WsMsg"},nftInboxMsg:{number:113,scope:"WsMsg"},savingMarketAprMsg:{number:114,scope:"WsMsg"},earnDntProjectOverviewMsg:{number:115,scope:"WsMsg"},homePageRegUserMsg:{number:116,scope:"WsMsg"},growthButtonGameMsg:{number:117,scope:"WsMsg"},roamingWebAckPushMsg:{number:118,scope:"WsMsg"},assetRateMsg:{number:119,scope:"WsMsg"},quoteUpdatePushMsg:{number:120,scope:"WsMsg"},assetPushMsg:{number:121,scope:"WsMsg"},fundingBalanceMsg:{number:122,scope:"WsMsg"},txStatusEventMsg:{number:123,scope:"WsMsg"},web3CommonEventMsg:{number:124,scope:"WsMsg"},earnDcUnderlyingOverviewMsg:{number:125,scope:"WsMsg"},earnDcProjectOrderInfoMsg:{number:126,scope:"WsMsg"},apexIncomeMsg:{number:127,scope:"WsMsg"},assetBalancePushMsg:{number:128,scope:"WsMsg"},alphaBalanceMsg:{number:129,scope:"WsMsg"},alphaCexTokenAddMgs:{number:130,scope:"WsMsg"},alphaCexTokenDynamicMgs:{number:131,scope:"WsMsg"},alphaCexTokenKLineMgs:{number:132,scope:"WsMsg"},alphaCexTokenListDynamicMgs:{number:133,scope:"WsMsg"},alphaCexOrderChangeMsg:{number:134,scope:"WsMsg"},memeTokenInfoListMsg:{number:135,scope:"WsMsg"},userRefreshMsg:{number:136,scope:"WsMsg"},earnAccumulatorProjectDetailMsg:{number:137,scope:"WsMsg"},webAndAppInfoSyncWsMsg:{number:138,scope:"WsMsg"},web3DataTrackerWsMessage:{number:139,scope:"WsMsg"},paymentPixInfoSyncWsMsg:{number:140,scope:"WsMsg"},rfqEventMsg:{number:141,scope:"WsMsg"}});var Wne={key:"wsMsg",encode:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new d6,i=[];return e.channel!==""&&n.uint32(10).string(e.channel),e.sourceTime!==0&&n.uint32(16).int64(e.sourceTime),e.wsResp!==void 0&&B2.encode(e.wsResp,n.uint32(802).fork()).join(),Qc({scope:"WsMsg"}).forEach(function(s){var o=e[s.key];if(o!==void 0){i.push(s.key);var a=(s.number<<3|2)>>>0;s.encode(o,n.uint32(a).fork()).join()}}),Object.keys(e).forEach(function(s){!i.includes(s)&&!p9.includes(s)&&x2("WsHttpSdkLiteMissMsg: scope(WsMsg), key("+s+")")}),n},decode:function(e,n){for(var i=(0,ag.A)(e,pm)?e:new pm(e),s=n===void 0?i.len:i.pos+n,o=Fne();i.pos<s;){var a=i.uint32();switch(a>>>3){case 1:{if(a!==10)break;o.channel=i.string();continue}case 2:{if(a!==16)break;o.sourceTime=T4e(i.int64());continue}case 100:{if(a!==802)break;o.wsResp=B2.decode(i,i.uint32());continue}}var u=a>>>3,l=Qc({scope:"WsMsg"}).find(function(g){return g.number===u});if(l){o[l.key]=l.decode(i,i.uint32());break}if((a&7)===4||a===0)break;x2("WsHttpSdkLiteMissMsg: scope(WsMsg), id("+String(a>>>3)+")"),i.skip(a&7)}return o},fromJSON:function(e){return Mr({channel:h6(e.channel)?globalThis.String(e.channel):"",sourceTime:h6(e.sourceTime)?globalThis.Number(e.sourceTime):0,wsResp:h6(e.wsResp)?B2.fromJSON(e.wsResp):void 0},Qc({scope:"WsMsg"}).reduce(function(n,i){var s=e[i.key];return s!==void 0&&(n[i.key]=h6(s)?i.fromJSON(s):void 0),n},{}))},toJSON:function(e){var n={};return e.channel!==""&&(n.channel=e.channel),e.sourceTime!==0&&(n.sourceTime=Math.round(e.sourceTime)),e.wsResp!==void 0&&(n.wsResp=B2.toJSON(e.wsResp)),Qc({scope:"WsMsg"}).forEach(function(i){var s=i.key;e[s]!==void 0&&(n[s]=i.toJSON(e[s]))}),n},create:function(e){return Wne.fromPartial(e??{})},fromPartial:function(e){var n=Fne(),i;n.channel=(i=e.channel)!==null&&i!==void 0?i:"";var s;return n.sourceTime=(s=e.sourceTime)!==null&&s!==void 0?s:0,n.wsResp=e.wsResp!==void 0&&e.wsResp!==null?B2.fromPartial(e.wsResp):void 0,Qc({scope:"WsMsg"}).forEach(function(o){var a=o.key;n[a]=e[a]!==void 0&&e[a]!==null?o.fromPartial(e[a]):void 0}),n}};function T4e(r){var e=globalThis.Number(r.toString());if(e>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(e<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return e}function h6(r){return r!=null}var S4e=function(){return Dne},I4e=function(){return Wne},prt=10,Hne="ws_http_sdk_lite";function k4e(){try{return!1}catch{return!1}}var R4e=0,p6="",g6=!0,y6=!0,G9,zne=k4e(),C4e=function(r){typeof r=="boolean"&&(zne=r)},$ne=function(){g6=!0},x4e=function(){g6=y6},q9=function(){return p6},grt=function(){return g6},B4e=function(){return R4e++},Z9=function(r){return new Promise(function(e){return e(void 0)})},Y9=function(r,e){},m6="",b6="web",O4e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return i=n.sourceUrl,s=n.getSessionInfo,o=n.track,a=n.isHttp,u=n.clientType,l=n.getWsToken,g=n.logs,g6=a,y6=a,p6=i,Z9=s,Y9=o,G9=l,b6=u,A.next=10,Z9("bnc-uuid");case 10:if(A.t0=A.sent,A.t0){A.next=13;break}A.t0="";case 13:m6=A.t0,C4e(g);case 15:case"end":return A.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),Vne=M1,P4e=function(r){Vne=r},v6=function(){return Z9},N4e=function(){return Vne},M4e,yrt=function(){return M4e},ym,mm=function(){return function(r,e){var n=[];switch(e){case"private":{n=i4e();break}case"public":{n=s4e();break}case"friendly":{n=o4e();break}default:{n=a4e();break}}var i=n.reverse(),s=function(A){return A>=10?A:"0".concat(A)},o=new Date,a="".concat(o.getFullYear(),"-").concat(s(o.getMonth()+1),"-").concat(s(o.getDate())," ").concat(s(o.getHours()),":").concat(s(o.getMinutes()),":").concat(s(o.getSeconds()));if(i.length){for(var u=ur(i,1),l=u[0],g=l.status,y=1;y<i.length;y++)g+=" <-".concat(i[y-1].timeStamp-i[y].timeStamp,"- ").concat(i[y].status);Y9(Hne,Mr({ws_time:a,uuid:m6,clientType:b6,isHttp:y6.toString(),status:l.status,ws_token:typeof ym=="string"?ym.slice(-16):"undefined",duration:i.length===1?0:i[0].timeStamp-i[1].timeStamp,statuses:g,ws_sourceUrl:p6},r))}else Y9(Hne,Mr({ws_time:a,uuid:m6,clientType:b6,ws_token:typeof ym=="string"?ym.slice(-16):"undefined",isHttp:y6.toString(),ws_sourceUrl:p6},r))}},jne=dm(),X9=jne.setReady,mrt=jne.onReady,L4e=function(){var r=(0,k.A)(b().mark(function e(){var n,i,s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,v6()("cr00");case 2:if(n=u.sent,X9(!1),!n){u.next=10;break}return el("get_token"),i=mm(),s=Date.now(),o=function(l,g){return Math.min(Math.floor(l/1e3),g)},u.abrupt("return",G9?G9():Y6e("/bapi/composite/v1/private/market/ws-token",{enableErrorMsgIntercept:!1}).then(function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ym=l?.data||null,ym===null&&(el("get_token_value_invalid"),mm()({ws_tokenData:JSON.stringify(l)})),X9(ym===null),mm()({ws_token_time:o(Date.now()-s,10)}),ym}).catch(function(l){return X9(!0),el("get_token_error"),i({error:JSON.stringify(l.message)}),null}));case 10:return u.abrupt("return",void 0);case 11:case"end":return u.stop()}},e)}));return function(){return r.apply(this,arguments)}}();function J9(r,e){if(zne){var n=r,i="";if(n==="req")n+=".".concat(e?.wsReqId||"0"),i=">>> ";else if(n==="resp"){var s;n+=".".concat((e==null||(s=e.wsResp)===null||s===void 0?void 0:s.wsReqId)||"0"),i="<<< "}console.info("\x1B[32m".concat(i,"[ws-http-sdk-lite][").concat(n,"]:\x1B[0m"),e)}}var brt=function(){return"".concat(m6,"_").concat(Date.now())},D4e=function(){return b6},ug;(function(r){r[r.SERVICE_REQ=1]="SERVICE_REQ",r[r.SUBSCRIBE=2]="SUBSCRIBE",r[r.UNSUBSCRIBE=3]="UNSUBSCRIBE",r[r.LIST_CHANNELS=4]="LIST_CHANNELS",r[r.REFRESH_TOKEN=5]="REFRESH_TOKEN",r[r.CLEAR_TOKEN=7]="CLEAR_TOKEN",r[r.PUBLIC_SERVICE_REQ=8]="PUBLIC_SERVICE_REQ",r[r.FRIENDLY_SERVICE_REQ=9]="FRIENDLY_SERVICE_REQ",r[r.PING=10]="PING"})(ug||(ug={}));var bm;(function(r){r[r.INVALID_TOKEN=1]="INVALID_TOKEN",r[r.INVALID_REQUEST=2]="INVALID_REQUEST",r[r.SERVICE_ERROR=3]="SERVICE_ERROR"})(bm||(bm={}));var w6={},Kne=!1,Gne=function(r){Kne=r},k0={},U4e=function(){return new Set(Object.keys(k0))},F4e=function(r){var e=r.channel,n=r.callback;return k0[e]?k0[e].add(n):k0[e]=new Set([n]),function(){k0[e].delete(n),k0[e].size===0&&delete k0[e]}},A6=function(r){var e=r.payload,n=r.callback,i=B4e().toString(),s=S4e(),o=Mr(gn(Mr({},e),{wsReqId:i,reqTime:new Date().valueOf()}),e.reqAction===ug.PING||e.reqAction===ug.LIST_CHANNELS||e.reqAction===ug.CLEAR_TOKEN?{reqArgs:""}:{}),a=s.fromJSON(o);J9("req",a);var u=s.encode(a).finish();return N4e()(u),w6[i]=n,function(){delete w6[i]}},Q9=function(r){var e=r.data,n=mm(),i=e;if(i?.errorMsg==="SOCKET_CLOSED"||i?.errorMsg==="SOCKET_CONNECTION_ERROR"){Object.keys(k0).forEach(function(a){k0[a].forEach(function(u){u(i)})}),n({error:"socket response error ".concat(i?.errorMsg)});return}var s=function(a){try{var u=I4e(),l=u.toJSON(u.decode(new Uint8Array(a)));if(J9("resp",l),"wsResp"in l){var g=l.wsResp,y=g.wsReqId,A=g.respError,I=g.reqAction,P=g.errorCode,D=g.errorMsg,U=w6[y];if(U){if(A){var V=function(){switch(A){case bm[bm.INVALID_REQUEST]:return{error:{type:"INVALID_REQUEST"}};case bm[bm.INVALID_TOKEN]:return{error:{type:"INVALID_TOKEN"}};case bm[bm.SERVICE_ERROR]:return{error:{type:"SERVICE_ERROR",errorCode:P||0,errorMsg:D||""}};default:return{error:{type:"INVALID_REQUEST"}}}}();n(gn(Mr({},V.error),{reqAction:I})),U(V)}else U(l.wsResp);delete w6[y]}}else if(Kne){var J=l.channel;(k0[J]||[]).forEach(function(re){re(l)})}}catch(re){n({error:"socket decode error".concat(JSON.stringify(re.message))}),J9("respError",re)}};if(typeof Blob=="function"&&(0,ag.A)(e,Blob)){var o=new FileReader;o.readAsArrayBuffer(e),o.onload=(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:u=o.result,s(u);case 2:case"end":return g.stop()}},a)}))}else(0,ag.A)(e,ArrayBuffer)?s(e):n({error:"parse data type other then blob".concat(typeof e>"u"?"undefined":(0,z.A)(e))})};function W4e(){var r=Object.create(null);return{on:function(n,i){(r[n]||(r[n]=[])).push(i)},once:function(n,i){var s=this,o=function(){s.off(n,o),i()};this.on(n,i)},off:function(n,i){if(r[n])if(i){var s=r[n].indexOf(i);s>=0&&r[n].splice(s,1)}else r[n].length=0},emit:function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];(r[n]||[]).slice().forEach(function(a){a.apply(void 0,(0,Li.A)(s))})}}}var gh={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},H4e=1,z4e=function(){"use strict";function r(n){var i=this;(0,G.A)(this,r),this._debugId=H4e++,this._wsInstance=null,this._reconnectAttempts=0,this._maxReconnectTime=300,this._socketEvents=W4e(),this._readyState=gh.CONNECTING,this._timeout=5e3,this._netWorkStatus=!0,this._url=n,self.addEventListener("offline",function(){i._netWorkStatus=!1}),self.addEventListener("online",function(){i._netWorkStatus||i.open(),i._netWorkStatus=!0})}var e=r.prototype;return e.open=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=this;if(this._readyState!==gh.OPEN){this._readyState=gh.CONNECTING,i?(this._reconnectAttempts+=1,this._socketEvents.emit("reConnecting",this._reconnectAttempts),console.log("WebSocket Reconnecting Attempts:",this._url,this._reconnectAttempts)):this._reconnectAttempts=0;var o=this._wsInstance=new WebSocket(this._url),a=!1,u=setTimeout(function(){console.debug("WebSocket connection-timeout",s._url),a=!0,o.close(),a=!1},this._timeout),l=function(){return clearTimeout(u)};o.onerror=function(g){s._socketEvents.emit("error",g)},o.onclose=function(g){l(),s._wsInstance=null,s._readyState=gh.CONNECTING,s._reconnectAttempts<=0&&!a&&s._socketEvents.emit("close",g),s.reconnect()},o.onopen=function(g){l(),s._readyState=gh.OPEN,s._reconnectAttempts>0&&s._socketEvents.emit("reConnected",s._reconnectAttempts),s._reconnectAttempts=0,s._socketEvents.emit("open",g)},o.onmessage=function(g){s._socketEvents.emit("message",g)}}},e.onOpen=function(i){var s=this;return this._socketEvents.on("open",i),function(){s._socketEvents.off("open",i)}},e.onReConnected=function(i){var s=this;return this._socketEvents.on("reConnected",i),function(){s._socketEvents.off("reConnected",i)}},e.onReConnecting=function(i){var s=this;return this._socketEvents.on("reConnecting",i),function(){s._socketEvents.off("reConnecting",i)}},e.onMessage=function(i){var s=this;return this._socketEvents.on("message",i),function(){s._socketEvents.off("message",i)}},e.onClose=function(i){var s=this;return this._socketEvents.on("close",i),function(){s._socketEvents.off("close",i)}},e.onError=function(i){var s=this;return this._socketEvents.on("error",i),function(){s._socketEvents.off("error",i)}},e.send=function(i){this._wsInstance&&this.getStatus()===gh.OPEN&&this._wsInstance.send(i)},e.close=function(){var i=this,s=this._wsInstance;s&&(this._wsInstance=null,this._readyState=gh.CLOSED,s.onopen=null,s.onerror=null,s.onmessage=null,s.onclose=function(o){i._socketEvents.emit("close",o)},s.close())},e.isValidStatus=function(i){return i===gh.CONNECTING||i===gh.OPEN||i===gh.CLOSING||i===gh.CLOSED},e.getStatus=function(){var i;return this.isValidStatus((i=this._wsInstance)===null||i===void 0?void 0:i.readyState)?this._wsInstance.readyState:this._readyState},e.refresh=function(){this.close(),this.reconnect()},e.reconnect=function(){var i=this;this._reconnectHandle||(this._reconnectHandle=setTimeout(function(){i._reconnectHandle=null,i.open(!0)},this.calcReconnectTime()))},e.calcReconnectTime=function(){return Math.min(this._maxReconnectTime,Math.pow(2,this._reconnectAttempts))*1e3+Math.floor(Math.random()*1e3)},(0,L.A)(r,[{key:"readyState",get:function(){return this._readyState}}]),r}();function $4e(r){return new z4e(r)}var tl=function(r){var e="fn"in r?r.fn:r,n="fn"in r?r.seeds:X6e,i=[],s={},o=function(A){},a=!1,u=new Set,l=function(){u.forEach(function(A){A()}),u.clear(),a=!1},g=function(){var A=(0,k.A)(b().mark(function I(P,D){var U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return s=D,o=P,U=s,l(),a=!0,J=M1,u.add(function(){clearTimeout(V),J()}),re=function(){var De=(0,k.A)(b().mark(function Ue(Ve){return b().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return J(),V=setTimeout(function(){re(Ve+1)},n(Ve)*1e3),Se.next=4,e(function(Ce){if(U=Mr({},Ce),clearTimeout(V),i.length===0)o(Mr({},Ce));else{var je=function($e,Qe,nt){var Ne=i[nt];Ne.start(function(Me){nt>=i.length-1?$e(Mr({},Me)):je($e,Mr({},Me),nt+1)},Qe),u.add(Ne.cancel)};je(o,U,0)}},U);case 4:J=Se.sent;case 5:case"end":return Se.stop()}},Ue)}));return function(Ve){return De.apply(this,arguments)}}(),Re.next=11,re(0);case 11:case"end":return Re.stop()}},I)}));return function(P,D){return A.apply(this,arguments)}}(),y={then:function(A){return i.push(A),y},start:g,cancel:l,restart:function(){a&&(l(),g(o,s))}};return y};tl.all=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var i=[],s={},o=function(A){},a=!1,u=new Set,l=function(){u.forEach(function(A){A()}),u.clear(),a=!1},g=function(){var A=(0,k.A)(b().mark(function I(P,D){var U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:s=D,o=P,U=s,l(),a=!0,V=0,e.forEach(function(ce){ce.start(function(Re){if(U=Mr({},Re,U),V++,V>=e.length)if(i.length===0)o(U);else{var De=function(Ue,Ve,pe){var Se=i[pe];Se.start(function(Ce){pe>=i.length-1?Ue(Mr({},Ce)):De(Ue,Mr({},Ce),pe+1)},Ve),u.add(Se.cancel)};De(o,U,0)}},U),u.add(ce.cancel)});case 7:case"end":return re.stop()}},I)}));return function(P,D){return A.apply(this,arguments)}}(),y={then:function(A){return i.push(A),y},start:g,cancel:l,restart:function(){a&&(l(),g(o,s))}};return y},tl.oneOf=function(r,e){var n=[],i={},s=function(y){},o=!1,a=new Set,u=function(){a.forEach(function(y){y()}),a.clear(),o=!1},l=function(){var y=(0,k.A)(b().mark(function A(I,P){var D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return i=P,s=I,J.next=4,e(i);case 4:J.t0=J.sent,J.t1=r[J.t0],D=[J.t1].concat((0,Li.A)(n)),u(),o=!0,U=function(re,ce,Re){var De=D[Re];De.start(function(Ue){Re>=D.length-1?re(Mr({},Ue)):U(re,Mr({},Ue),Re+1)},ce),a.add(De.cancel)},U(s,i,0);case 11:case"end":return J.stop()}},A)}));return function(I,P){return y.apply(this,arguments)}}(),g={then:function(y){return n.push(y),g},start:l,cancel:u,restart:function(){o&&(u(),l(s,i))}};return g};var qne=dm(),Zne=qne.setReady,vrt=qne.onReady,Yne=dm(),Xne=Yne.setReady,wrt=Yne.onReady,Jne=dm(),Qne=Jne.setReady,Art=Jne.onReady,e7=dm(),t7=e7.setReady,_rt=e7.onReady,V4e=e7.clean,zl,r7=!1,n7=tl({fn:function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return s=function(){var U=(0,k.A)(b().mark(function V(J){var re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return re=q9(),De.next=3,v6()("bnc-uuid");case 3:return De.t0=De.sent,De.next=6,v6()("lang");case 6:return De.t1=De.sent,De.t2=J,De.t3=D4e(),ce={uuid:De.t0,lang:De.t1,token:De.t2,clienttype:De.t3},De.abrupt("return","".concat(re,"?").concat(Object.keys(ce).filter(function(Ue){return ce[Ue]}).map(function(Ue){return"".concat(Ue,"=").concat(ce[Ue])}).join("&")));case 11:case"end":return De.stop()}},V)}));return function(J){return U.apply(this,arguments)}}(),D.next=3,L4e();case 3:return o=D.sent,D.next=6,s(o);case 6:return a=D.sent,el("ws_start"),zl&&zl.close(),t7(!1),zl=$4e(a),zl.open(),Zne(!1),D.t0="",D.next=18,v6()("bnc-uuid");case 18:return D.t1=D.sent,g=D.t0.concat.call(D.t0,D.t1,"_").concat(Date.now()),y=Date.now(),A=setTimeout(function(){$ne(),Zne(!0),mm()({ws_connectId:g,ws_type:"ws_openDelay",duration:Math.floor((Date.now()-y)/1e3)})},1e4),I=function(){clearTimeout(u),clearInterval(l)},zl.onOpen(function(){Qne(!1),mm()({ws_connectId:g,ws_type:"ws_open",duration:Math.floor((Date.now()-y)/1e3)}),Xne(!0),clearTimeout(A),x4e(),el("ws_connected"),P4e(function(U){zl.readyState===1?zl.send(U):mm()({type:"SOCKET_NOT_READY_BEFORE_SEND",readyState:zl.readyState})}),n(gn(Mr({},i),{token:o})),zl.onMessage(function(U){console.log("socket onmessage"),I(),l=setInterval(function(){var V=M1;function J(re){V(),re>=2?zl.close():(V=A6({payload:{reqAction:ug.PING},callback:function(ce){"error"in ce||clearTimeout(u)}}),u=setTimeout(function(){J(re+1)},2e3))}J(0)},4e4),Q9(U)})}),zl.onError(function(){console.log("socket error"),el("ws_error"),Q9({data:{errorMsg:"SOCKET_CONNECTION_ERROR"}})}),zl.onClose(function(U){console.log("socket onclose"),Q9({data:{errorMsg:"SOCKET_CLOSED"}}),Qne(!0),Xne(!1),$ne(),el("ws_closed"),I(),clearTimeout(A),mm()({ws_connectId:g,ws_type:"ws_close",duration:Math.floor((Date.now()-y)/1e3),error:U.reason,code:U.code}),U.code===1e3?n7.restart():(r7||t7(!0),r7=!1,n7.cancel())}),D.abrupt("return",function(){r7=!0,zl&&zl.close()});case 27:case"end":return D.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}(),seeds:function(){return Math.floor(2147483647/1e3)}}),eie=dm(),tie=eie.setReady,Ert=eie.onReady,j4e=tl(function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return el("publicRequest"),n(i),tie(!0),o.abrupt("return",function(){tie(!1)});case 4:case"end":return o.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}()),i7=dm(),rie=i7.setReady,Trt=i7.onReady,K4e=i7.clean,G4e=tl(function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return el("privateRequest"),n(i),rie(!0),o.abrupt("return",function(){rie(!1)});case 4:case"end":return o.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}()),nie=tl(function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return el("list_channels"),o.abrupt("return",A6({payload:{reqAction:ug.LIST_CHANNELS},callback:function(a){if(!("error"in a)){var u=function(I,P){return Array.from(I).filter(function(D){return!P.has(D)}).join(",")},l=a.resp,g=l===void 0?"":l,y=new Set(g.trim()===""?[]:g.split(",")),A=U4e();n(gn(Mr({},i),{toSubscribeChannelStr:u(A,y),toUnSubscribeChannelStr:u(y,A)}))}}}));case 2:case"end":return o.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}()),q4e=tl(function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(el("subscribe_channels"),!i.toSubscribeChannelStr){o.next=3;break}return o.abrupt("return",A6({payload:{reqAction:ug.SUBSCRIBE,reqArgs:i.toSubscribeChannelStr},callback:function(a){"error"in a||n(i)}}));case 3:return n(i),o.abrupt("return",M1);case 5:case"end":return o.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}()),Z4e=tl(function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(el("unsubscribe_channels"),!i.toUnSubscribeChannelStr){o.next=3;break}return o.abrupt("return",A6({payload:{reqAction:ug.UNSUBSCRIBE,reqArgs:i.toUnSubscribeChannelStr},callback:function(a){"error"in a||n(i)}}));case 3:return n(i),o.abrupt("return",M1);case 5:case"end":return o.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}()),iie=dm(),sie=iie.setReady,Srt=iie.onReady,oie=tl(function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return el("friendlyRequest"),n(i),sie(!0),o.abrupt("return",function(){sie(!1)});case 4:case"end":return o.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}()),Y4e=tl(function(){var r=(0,k.A)(b().mark(function e(n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return el("stream"),n(i),Gne(!0),o.abrupt("return",function(){Gne(!1)});case 4:case"end":return o.stop()}},e)}));return function(e,n){return r.apply(this,arguments)}}()),X4e=tl({fn:(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return el("deadEnd"),n.abrupt("return",M1);case 2:case"end":return n.stop()}},r)})),seeds:function(){return Math.floor(2147483647/1e3)}}),aie=n7.then(tl.all(j4e,tl.oneOf({string:tl.all(G4e,oie),undefined:oie,null:X4e},function(r){return r.token===null?"null":r.token===void 0?"undefined":"string"}),nie.then(tl.all(q4e,Z4e)).then(Y4e))),J4e=aie.start,Q4e=aie.cancel,exe=nie.restart,s7=!1,txe=function(){K4e(),s7=!1,Q4e(),V4e(),t7(!1)},uie=function(){s7||(s7=!0,J4e(function(r){},{}))},rxe=function(r){var e=r.channel,n=r.responseName,i=r.onConnectionError,s=r.onSocketClosed;return function(o){if(!q9())return console.error("ws-http-sdk:error: need to init websocket before use"),M1;uie();var a=F4e({channel:e,callback:function(u){var l=u;if(l?.errorMsg==="SOCKET_CONNECTION_ERROR"&&i){i?.(l);return}if(l?.errorMsg==="SOCKET_CLOSED"&&s){s?.(l);return}var g=new Set(Object.keys(u));typeof n=="string"?o(u[n]):n.forEach(function(y){if(g.has(y))return o(vt({},y,u[y]))})}});return exe(),a}},nxe=!1,ixe=function(){var r=(0,k.A)(b().mark(function e(n){return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(console.log("wsHttpSdkLiteInit: IS_BMP(".concat(nxe,").")),q9()){s.next=4;break}return s.next=4,O4e({sourceUrl:n.sourceUrl,version:n.version||"V1",isHttp:n.isHttp,getWsToken:n.getWsToken,getSessionInfo:function(o){return n.getSessionInfo().then(function(a){return a[o]})},track:n.track||function(o,a){console.log(o+a.toString())},clientType:n.clientType,logs:n.logs});case 4:case"end":return s.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),Irt="com.web3";function cie(){return{type:"",eventData:""}}var lie={key:"web3CommonEventMsg",encode:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new d6;return e.type!==""&&n.uint32(10).string(e.type),e.eventData!==""&&n.uint32(18).string(e.eventData),n},decode:function(e,n){for(var i=(0,ag.A)(e,pm)?e:new pm(e),s=n===void 0?i.len:i.pos+n,o=cie();i.pos<s;){var a=i.uint32();switch(a>>>3){case 1:{if(a!==10)break;o.type=i.string();continue}case 2:{if(a!==18)break;o.eventData=i.string();continue}}if((a&7)===4||a===0)break;i.skip(a&7)}return o},fromJSON:function(e){return{type:fie(e.type)?globalThis.String(e.type):"",eventData:fie(e.eventData)?globalThis.String(e.eventData):""}},toJSON:function(e){var n={};return e.type!==""&&(n.type=e.type),e.eventData!==""&&(n.eventData=e.eventData),n},create:function(e){return lie.fromPartial(e??{})},fromPartial:function(e){var n=cie(),i;n.type=(i=e.type)!==null&&i!==void 0?i:"";var s;return n.eventData=(s=e.eventData)!==null&&s!==void 0?s:"",n}};function fie(r){return r!=null}var die=new Nh(2e3),sxe=function(){return die.execute((0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:uie();case 1:case"end":return n.stop()}},r)})))};Gke(lie);var o7=new WeakMap,a7=new WeakMap,_6=new WeakMap,hie=new WeakSet,oxe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;s=e.apply(this,arguments),B(F(s),hie),s.name="websocket",de(F(s),o7,{writable:!0,value:{}}),de(F(s),a7,{writable:!0,value:function(){return Promise.resolve()}}),de(F(s),_6,{writable:!0,value:!1});var o=F(s);return s.subscribeExtensionStream=(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!X(o,_6)){l.next=2;break}return l.abrupt("return");case 2:return he(o,_6,!0),l.prev=3,l.next=6,die.execute((0,k.A)(b().mark(function g(){var y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return console.debug("[subscribeExtensionStream]"),D.next=3,X(o,a7).call(o);case 3:return D.next=5,ll();case 5:y=D.sent,A=rxe({channel:"EXTENSION_WALLET_MESSAGE_".concat(y),responseName:"web3CommonEventMsg"}),I=A(K(o,hie,axe).bind(o)),he(o,a7,(0,k.A)(b().mark(function U(){return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.prev=0,console.debug("[WebsocketController:#unSubFn]"),I(),J.next=5,tc(100);case 5:return txe(),J.next=8,tc(100);case 8:return J.next=10,sxe();case 10:J.next=15;break;case 12:J.prev=12,J.t0=J.catch(0),console.error("[WebsocketController:#unSubFn] Error:",J.t0);case 15:case"end":return J.stop()}},U,null,[[0,12]])})));case 9:case"end":return D.stop()}},g)})));case 6:return l.abrupt("return",l.sent);case 7:return l.prev=7,he(o,_6,!1),l.finish(7);case 10:case"end":return l.stop()}},a,null,[[3,,7,10]])})),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,F4();case 2:u=g.sent,ixe({sourceUrl:"".concat(u,"/market"),isHttp:!0,getSessionInfo:(0,k.A)(b().mark(function y(){return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.abrupt("return",{});case 1:case"end":return I.stop()}},y)})),clientType:"web"}),o.subscribeExtensionStream(),navigator&&navigator.connection&&navigator.connection.addEventListener&&navigator.connection.addEventListener("change",function(){o.subscribeExtensionStream()});case 6:case"end":return g.stop()}},a)}))()},i.registerEvent=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:X(u,o7)[o]=a;case 1:case"end":return y.stop()}},l)}))()},n}(Yr);function axe(r){if(console.debug("[WebsocketController:#onCallback]",r),!(!r||!r.type||!r.eventData)){var e=r.type,n=r.eventData,i=JSON.parse(n),s=X(this,o7)[e];s&&s(i)}}var O2=new oxe;function uxe(){var r=new Date,e=r.getMinutes(),n=r.getSeconds(),i=r.getMilliseconds();if(e<1)return 1*60*1e3-n*1e3-i;var s=60-e;return(s+1)*60*1e3-n*1e3-i}var cxe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s._refreshFn=function(){return Promise.resolve()},s}var i=n.prototype;return i.setRefreshFn=function(o){this._refreshFn=o},i.refreshFn=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,l.next=3,o._refreshFn();case 3:l.next=8;break;case 5:l.prev=5,l.t0=l.catch(0),console.error("Error during alpha token refresh:",l.t0);case 8:case"end":return l.stop()}},a,null,[[0,5]])}))()},n}(uC),u7=new cxe({getRefreshInterval:function(){return uxe()}}),lxe=["NT_CT_195"],fxe=function(r){switch(r){case ig["1h"]:return{interval:"1m",limit:60};case ig["24h"]:return{interval:"5m",limit:288};case ig["7d"]:return{interval:"1h",limit:168};case ig["30d"]:return{interval:"4h",limit:180};case ig["1y"]:return{interval:"1d",limit:365};case ig["5y"]:return{interval:"1d",limit:500}}},dxe=function(r){return r.map(function(e){return{timestamp:e.time,price:e.close}})},pie=function(r){return r.map(function(e){var n=ur(e,7),i=n[0],s=n[1],o=n[2],a=n[3],u=n[4],l=n[5],g=n[6];return{timestamp:g,price:u}})},hxe=60*60*1e3,pxe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s._refreshFn=function(){return Promise.resolve()},s}var i=n.prototype;return i.setRefreshFn=function(o){this._refreshFn=o},i.refreshFn=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,l.next=3,o._refreshFn();case 3:l.next=8;break;case 5:l.prev=5,l.t0=l.catch(0),console.error("Error during refresh:",l.t0);case 8:case"end":return l.stop()}},a,null,[[0,5]])}))()},n}(uC),c7=new pxe({getRefreshInterval:function(){return hxe}}),CT={},gie=function(r,e){e?CT[r]=e:delete CT[r]},krt=function(){CT={}},E6=function(r,e){return r==="HIGH"?ou.HighRisk:e&&CT[e]?CT[e]:r==="LOW"?ou.LowRisk:r||ou.UnknownRisk};function l7(r,e){return f7.apply(this,arguments)}function f7(){return f7=(0,k.A)(b().mark(function r(e,n){var i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,e.acquire();case 2:return i=o.sent,o.prev=3,o.next=6,n({releaseLock:i});case 6:return o.abrupt("return",o.sent);case 7:return o.prev=7,i(),o.finish(7);case 10:case"end":return o.stop()}},r,null,[[3,,7,10]])})),f7.apply(this,arguments)}var d7=new WeakMap,yie=function(){"use strict";function r(n){(0,G.A)(this,r),de(this,d7,{writable:!0,value:void 0}),this.atom=n,he(this,d7,new In)}var e=r.prototype;return e.updateValue=function(i){var s=this;return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,l7(X(s,d7),(0,k.A)(b().mark(function l(){var g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,zt.get(s.atom);case 2:return g=I.sent,y=Object.assign({},g,i),console.debug("[TokenInfoUpdater:updateValue]",y),I.next=7,zt.set(s.atom,y);case 7:case"end":return I.stop()}},l)})));case 2:case"end":return u.stop()}},o)}))()},r}(),h7=new yie(bT),p7=new yie(cre),mie=new Set,T6=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:for(s={},o=[],a=!0,u=!1,l=void 0,D.prev=3,g=n[Symbol.iterator]();!(a=(y=g.next()).done);a=!0)A=y.value,I=i(A),s[I.id]=I,o.push(I);D.next=11;break;case 7:D.prev=7,D.t0=D.catch(3),u=!0,l=D.t0;case 11:D.prev=11,D.prev=12,!a&&g.return!=null&&g.return();case 14:if(D.prev=14,!u){D.next=17;break}throw l;case 17:return D.finish(14);case 18:return D.finish(11);case 19:return D.next=21,h7.updateValue(s);case 21:return D.abrupt("return",o);case 22:case"end":return D.stop()}},e,null,[[3,7,11,19],[12,,14,18]])}));return function(n,i){return r.apply(this,arguments)}}(),gxe=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:i={};for(s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o=n[s],o===null?i[fl(s)]={price:null,percentChange24h:null}:i[fl(s)]={price:o.price,percentChange24h:o.percentChange24h});return u.next=4,p7.updateValue(i);case 4:case"end":return u.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),yxe=function(r){var e=r.binanceTokenId,n=r.name,i=r.symbol,s=r.tokenAddresses,o=r.icon,a=r.isSingleChainToken,u=fl(e),l={id:u,binanceTokenId:e,name:n,symbol:i,icon:mC(o),tokenAddresses:wie(s),singleNetworkToken:a?no(s[0].chainId):null};return l},bie=function(r){var e=r.binanceTokenId,n=r.name,i=r.symbol,s=r.decimals,o=r.icon,a=r.riskLevel,u=r.staticToken,l=r.links,g=r.socialMedias,y=r.tokenAddresses,A=r.status,I=fl(e),P=wie(y);return{id:I,binanceTokenId:e,name:n,symbol:i,icon:mC(o),riskLevel:E6(a,I),links:l,socialMedias:g,singleNetworkToken:P.length===1?P[0].networkId:null,tokenAddresses:P,status:A}},vie=function(r){var e=r.tokenId,n=bs(r,["tokenId"]);return bie(gn(Mr({},n),{binanceTokenId:e}))},mxe=function(r){return gn(Mr({},r),{networkId:no(r.chainId)})},wie=function(r){var e=[],n=!0,i=!1,s=void 0;try{for(var o=r[Symbol.iterator](),a;!(n=(a=o.next()).done);n=!0){var u=a.value;u.chainId==="CT_607"&&u.contractAddress==="UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ"||e.push(mxe(u))}}catch(l){i=!0,s=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return e},bxe=function(r){return r==="OPEN"?{showInWallet:!0}:{showInWallet:!1}},g7=function(r){var e=r.binanceChainId,n=r.userAddress,i=r.binanceTokenId;return"".concat(e,"-").concat(n,"-").concat(i).toLowerCase()},vxe=new Nh(5*60*1e3),wxe=new Nh(5*60*1e3),S6=new WeakMap,Aie=new WeakSet,_ie=new WeakSet,I6=new WeakMap,Eie=new WeakSet,y7=new WeakSet,Tie=new WeakMap,xT=new WeakSet,BT=new WeakSet,Sie=new WeakSet,m7=new WeakSet,b7=new WeakSet,Iie=new WeakSet,kie=new WeakSet,k6=new WeakSet,Axe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;s=e.apply(this,arguments),B(F(s),Aie),B(F(s),_ie),B(F(s),Eie),B(F(s),y7),B(F(s),xT),B(F(s),BT),B(F(s),Sie),B(F(s),m7),B(F(s),b7),B(F(s),Iie),B(F(s),kie),B(F(s),k6),s.name="token",de(F(s),S6,{writable:!0,value:{}}),s.refreshToken=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return X(s,I6).call(F(s),u)},s.refreshTokenDebounced=(0,H.debounce)(function(){return s.refreshToken()},200);var o=F(s);de(F(s),I6,{writable:!0,value:(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn,Ar=arguments;return b().wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return l=Ar.length>0&&Ar[0]!==void 0?Ar[0]:{},g=l.force,y=g===void 0?!1:g,A=l.throwError,I=A===void 0?!1:A,P=l.fetchAll,D=P===void 0?!1:P,Tn.next=3,zt.get(Ul);case 3:if(U=Tn.sent,!(U&&!y)){Tn.next=6;break}return Tn.abrupt("return");case 6:return V={},Tn.prev=7,Tn.next=10,K(o,Eie,Txe).call(o,{fetchAll:D});case 10:J=Tn.sent,re={},ce={},Re=new Set,De=new Set,Ue=!0,Ve=!1,pe=void 0,Tn.prev=16,Se=J[Symbol.iterator]();case 18:if(Ue=(Ce=Se.next()).done){Tn.next=39;break}return je=Ce.value,$e=je.balance,Qe=je.binanceChainId,nt=je.binanceTokenId,Ne=je.price,Me=je.percentChange24h,ct=je.userAddress,mt=je.riskLevel,Bt=je.status,er=je.lsdFlag,cr=Wl(ct),pr=g7(je),X(o,S6)[pr]=$e,Dr=fl(nt),er&&mie.add(Dr),De.add(nt),(0,H.isNil)(Ne)?ti($e).isZero()||Re.add(nt):re[Dr]={price:Ne,percentChange24h:Me},mt==="HIGH"?gie(Dr,ou.HighRisk):gie(Dr,ou.LowRisk),Tn.next=31,vn.getWalletItemByAddress(cr,no(Qe));case 31:Rr=Tn.sent,Rr&&(Pr=Rr.id,ce[Pr]=ce[Pr]||{},ce[Pr][Dr]=bxe(Bt)),on=V[cr]||[],on.push({balance:$e,binanceChainId:Qe,binanceTokenId:nt,userAddress:Wl(cr),tokenId:Dr,networkId:no(Qe),lsdFlag:er===1}),V[cr]=(0,H.uniqBy)(on,function(Bn){return"".concat(Bn.tokenId,"-").concat(Bn.networkId)});case 36:Ue=!0,Tn.next=18;break;case 39:Tn.next=45;break;case 41:Tn.prev=41,Tn.t0=Tn.catch(16),Ve=!0,pe=Tn.t0;case 45:Tn.prev=45,Tn.prev=46,!Ue&&Se.return!=null&&Se.return();case 48:if(Tn.prev=48,!Ve){Tn.next=51;break}throw pe;case 51:return Tn.finish(48);case 52:return Tn.finish(45);case 53:return Tn.next=55,Promise.all([K(o,xT,R6).call(o,Array.from(De),{dedupeWithLocalMetas:!0})]);case 55:return Tn.next=57,p7.updateValue(re);case 57:return Tn.next=59,zt.set(xke,ce);case 59:return Tn.next=61,zt.get(mT);case 61:return xn=Tn.sent,Tn.next=64,zt.set(mT,Mr({},xn,V));case 64:Tn.next=73;break;case 66:if(Tn.prev=66,Tn.t1=Tn.catch(7),!I){Tn.next=72;break}throw Tn.t1;case 72:console.error(Tn.t1);case 73:case"end":return Tn.stop()}},u,null,[[7,66],[16,41,45,53],[46,,48,52]])}))});var a=F(s);return de(F(s),Tie,{writable:!0,value:(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.t0=ur,D.next=3,Promise.all([K(a,Sie,Sxe).call(a),zt.get(mT)]);case 3:return D.t1=D.sent,l=(0,D.t0)(D.t1,2),g=l[0],y=l[1],A=(0,H.uniq)(g),I=(0,H.uniq)(A.concat((0,H.flatten)(Object.values(y)).map(function(U){return U.binanceTokenId}))),D.next=11,Promise.all([K(a,xT,R6).call(a,I),K(a,BT,C6).call(a,A)]);case 11:return D.next=13,zt.set(Bke,g.map(function(U){return fl(U)}));case 13:case"end":return D.stop()}},u)}))}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,X(o,I6).call(o,{fetchAll:!0,force:!0});case 2:return l.next=4,X(o,Tie).call(o);case 4:wo.registerOnUiActiveEvent(function(){K(o,m7,Cie).call(o)}),K(o,m7,Cie).call(o),K(o,b7,xie).call(o),wo.onHasUIConnected(function(){setTimeout(function(){c7.startLoop()},50),u7.startLoop()}),wo.onAllUIDisconnected(function(){c7.stopLoop(),u7.stopLoop()}),u7.setRefreshFn(function(){return K(o,b7,xie).call(o)}),O2.registerEvent("BALANCE_CHANGE_EVENT",K(o,Iie,Ixe).bind(o));case 11:case"end":return l.stop()}},a)}))()},i.refreshTokenBalance=function(o){var a=o.force,u=a===void 0?!1:a,l=o.manual,g=l===void 0?!1:l,y=this;return(0,k.A)(b().mark(function A(){var I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Fi.getCurrentSelectedNetworkId();case 2:if(I=V.sent,!za(I)){V.next=8;break}return V.next=6,Da.refreshBalance({skipThrottle:g});case 6:V.next=19;break;case 8:return P=X(y,I6).call(y,{force:u,throwError:!0})||Promise.resolve(),D=g?H1.fetchDefiList():H1.fetchDefiList({noRefresh:!0}),V.next=12,Promise.all([P,D,Ci.pollLoginStatus(),tc(2*100)]);case 12:if(!g){V.next=17;break}return V.next=15,ta.refreshApproveCount();case 15:V.next=19;break;case 17:return V.next=19,ta.refreshRiskyApproveCount();case 19:case"end":return V.stop()}},A)}))()},i.importToken=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,u.validateToken(o,a);case 2:return g=U.sent,y=g.decimals,A=g.symbol,U.next=6,Fi.getNetworkByNetworkId(o);case 6:if(I=U.sent,I){U.next=9;break}throw Error("Unknown network id:"+o);case 9:return U.next=11,hn.Token.tokenImport({symbol:A,decimals:y,contractAddress:a,binanceChainId:I.binanceChainId,type:I.customTokenType});case 11:return U.next=13,u.getTokenMetaByContract(o,a);case 13:return P=U.sent,U.next=16,T6([P],function(V){return V});case 16:return U.next=18,u.updateTokenSelected(P.id,!0);case 18:case"end":return U.stop()}},l)}))()},i.searchToken=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return l=o.keyword,g=o.networkId,y=o.onlyLocal,A=g?za(g):!1,V.t0=ur,V.next=5,Promise.all([A?Da.searchToken(l,g):K(a,Aie,_xe).call(a,l),y||A?Promise.resolve([]):K(a,_ie,Exe).call(a,l,g)]);case 5:return V.t1=V.sent,I=(0,V.t0)(V.t1,2),P=I[0],D=I[1],V.abrupt("return",(0,H.uniqBy)((0,Li.A)(D).concat((0,Li.A)(P)),function(J){return J.id}));case 10:case"end":return V.stop()}},u)}))()},i.updateTokenSelected=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!dA(o)){A.next=4;break}return A.next=3,Da.updateCustomTokenSelected(o,a);case 3:return A.abrupt("return");case 4:if(!a){A.next=8;break}return g=Wm(o),A.next=8,Promise.all([K(u,xT,R6).call(u,[g],{dedupeWithLocalMetas:!0}),K(u,BT,C6).call(u,[g])]);case 8:return A.next=10,hn.Token.updateHomeTokenStatus({userBinanceTokensManageList:[{binanceTokenId:Wm(o),deleteStatus:a?"OPEN":"CLOSE"}]});case 10:return A.next=12,u.refreshTokenDebounced();case 12:case"end":return A.stop()}},l)}))()},i.updateDefaultExtraOpenToken=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:u=!0,l=!1,g=void 0,D.prev=1,y=lxe[Symbol.iterator]();case 3:if(u=(A=y.next()).done){D.next=10;break}return I=A.value,D.next=7,o.updateTokenSelected(fl(I),!0);case 7:u=!0,D.next=3;break;case 10:D.next=16;break;case 12:D.prev=12,D.t0=D.catch(1),l=!0,g=D.t0;case 16:D.prev=16,D.prev=17,!u&&y.return!=null&&y.return();case 19:if(D.prev=19,!l){D.next=22;break}throw g;case 22:return D.finish(19);case 23:return D.finish(16);case 24:case"end":return D.stop()}},a,null,[[1,12,16,24],[17,,19,23]])}))()},i.getTokenStats=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return u=Wm(o),y.next=3,hn.Token.tokenStatsInfo({binanceTokenIdList:[u]});case 3:return l=y.sent,y.abrupt("return",l.data[u]);case 5:case"end":return y.stop()}},a)}))()},i.getTokenMetaByTokenId=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!dA(o)){y.next=2;break}return y.abrupt("return",Da.getCustomChainTokenMeta(o));case 2:return y.next=4,zt.get(bT);case 4:return u=y.sent,l=u[o],y.abrupt("return",l);case 7:case"end":return y.stop()}},a)}))()},i.getTokenMetaByContract=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return g=Za(o),U.next=3,K(u,k6,R7).call(u,g,a);case 3:if(y=U.sent,!y){U.next=6;break}return U.abrupt("return",y);case 6:return U.next=8,hn.Token.tokenInfoByContractAddress([{chainId:g,contractAddress:a}]);case 8:return A=U.sent,I=Object.values(A.data),P=vie(I[0]),U.abrupt("return",P);case 12:case"end":return U.stop()}},l)}))()},i.getTokenMetaByContractList=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce;return b().wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:if(l=o.filter(function(Qe){return Qe.contractAddress&&Qe.binanceChainId}),l.length!==0){$e.next=3;break}return $e.abrupt("return",[]);case 3:g=[],y=[],A=!0,I=!1,P=void 0,$e.prev=6,D=l[Symbol.iterator]();case 8:if(A=(U=D.next()).done){$e.next=17;break}return V=U.value,$e.next=12,K(a,k6,R7).call(a,V.binanceChainId,V.contractAddress);case 12:J=$e.sent,J?g.push(J):y.push({chainId:V.binanceChainId,contractAddress:V.contractAddress});case 14:A=!0,$e.next=8;break;case 17:$e.next=23;break;case 19:$e.prev=19,$e.t0=$e.catch(6),I=!0,P=$e.t0;case 23:$e.prev=23,$e.prev=24,!A&&D.return!=null&&D.return();case 26:if($e.prev=26,!I){$e.next=29;break}throw P;case 29:return $e.finish(26);case 30:return $e.finish(23);case 31:if(!(y.length>0)){$e.next=67;break}return $e.prev=32,$e.next=35,hn.Token.tokenInfoByContractAddress(y);case 35:for(re=$e.sent,ce=Object.values(re.data),Re=!0,De=!1,Ue=void 0,$e.prev=38,Ve=ce[Symbol.iterator]();!(Re=(pe=Ve.next()).done);Re=!0)Se=pe.value,Se&&(Ce=vie(Se),g.push(Ce));$e.next=46;break;case 42:$e.prev=42,$e.t1=$e.catch(38),De=!0,Ue=$e.t1;case 46:$e.prev=46,$e.prev=47,!Re&&Ve.return!=null&&Ve.return();case 49:if($e.prev=49,!De){$e.next=52;break}throw Ue;case 52:return $e.finish(49);case 53:return $e.finish(46);case 54:return $e.prev=54,$e.next=57,T6(g,function(Qe){return Qe});case 57:$e.next=62;break;case 59:$e.prev=59,$e.t2=$e.catch(54),console.error("[TokenController] Failed to save tokenMeta:",$e.t2);case 62:$e.next=67;break;case 64:$e.prev=64,$e.t3=$e.catch(32),console.error("[TokenController] Failed to batch fetch tokenMeta:",$e.t3);case 67:return $e.abrupt("return",g);case 68:case"end":return $e.stop()}},u,null,[[6,19,23,31],[24,,26,30],[32,64],[38,42,46,54],[47,,49,53],[54,59]])}))()},i.updateTokenPriceByContractAndBinanceChainIdList=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,a.getTokenMetaByContractList(o);case 2:if(l=I.sent,g=l.map(function(P){return P.binanceTokenId}).filter(Boolean),y=(0,H.uniq)(g),!(y.length>0)){I.next=8;break}return I.next=8,K(a,BT,C6).call(a,y);case 8:case"end":return I.stop()}},u)}))()},i.saveTokenMetaAndFetchPrice=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,T6([o],function(y){return y});case 2:if(!o.binanceTokenId){g.next=13;break}return g.prev=3,g.next=6,K(a,BT,C6).call(a,[o.binanceTokenId]);case 6:g.next=11;break;case 8:g.prev=8,g.t0=g.catch(3),console.error("[TokenController] Failed to fetch price for token:",o.id,g.t0);case 11:g.next=14;break;case 13:console.warn("[TokenController] Token missing binanceTokenId:",o.id);case 14:case"end":return g.stop()}},u,null,[[3,8]])}))()},i.getDefaultReceiveTokenList=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,hn.Token.tokenReceiveDefaultList();case 2:return u=A.sent,l=u.data.map(function(I){return I.binanceTokenId}),g=(0,H.uniq)(QM.concat(l)),A.next=7,K(o,xT,R6).call(o,g,{dedupeWithLocalMetas:!0});case 7:return A.abrupt("return",g.map(function(I){return fl(I)}));case 8:case"end":return A.stop()}},a)}))()},i.getTokenListPrice=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.Token.tokenPriceInfo({binanceTokenIdList:o});case 2:return u=g.sent,g.abrupt("return",u.data);case 4:case"end":return g.stop()}},a)}))()},i.getTokenPriceHistory=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Ii.getTokenMetaByTokenId(o);case 2:if(y=V.sent,!a){V.next=8;break}if(I=(A=y.tokenAddresses.find(function(J){return J.networkId===a}))===null||A===void 0?void 0:A.contractAddress,!I){V.next=8;break}return V.abrupt("return",l.getTokenPriceHistoryV2(I,a,u));case 8:return P=Wm(o),V.next=11,hn.Token.tokenKLine({binanceTokenId:P,interval:u});case 11:return D=V.sent,V.abrupt("return",dxe(D.data));case 13:case"end":return V.stop()}},g)}))()},i.getTokenPriceHistoryV2=function(o,a,u){return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return g=fxe(u),y=g.interval,A=g.limit,ce.next=3,hn.Token.tokenKLinev2({interval:y,limit:A,chainId:Za(a),contractAddress:o});case 3:if(I=ce.sent,u!==ig["5y"]){ce.next=21;break}P=Date.now(),D=I.data.klineInfos,U=D,V=D.length>=A;case 9:if(!V){ce.next=18;break}return ce.next=12,hn.Token.tokenKLinev2({interval:y,limit:A,chainId:Za(a),contractAddress:o,endTime:D[0][0]});case 12:J=ce.sent,D=J.data.klineInfos,U=D.concat(U),V=D.length>=A-2&&U.length<3e3,ce.next=9;break;case 18:return ce.abrupt("return",pie(U));case 21:return ce.abrupt("return",pie(I.data.klineInfos));case 22:case"end":return ce.stop()}},l)}))()},i.getTokenInfoAiNarrative=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,hn.Token.tokenInfoAiNarrative({chainId:o,contractAddress:a});case 2:return l=y.sent,y.abrupt("return",l.data);case 4:case"end":return y.stop()}},u)}))()},i.getTokenInfoMarketMeta=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,hn.Token.tokenInfoMarketMeta({chainId:o,contractAddress:a});case 2:return l=y.sent,y.abrupt("return",l.data);case 4:case"end":return y.stop()}},u)}))()},i.getTokenInfoMarketDynamicInfo=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,hn.Token.tokenInfoMarketDynamicInfo({chainId:o,contractAddress:a});case 2:return l=y.sent,y.abrupt("return",l.data);case 4:case"end":return y.stop()}},u)}))()},i.getTokenTagsInfo=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,hn.Token.tokenInfoTagsInfo({chainId:o,contractAddress:a});case 2:return l=y.sent,y.abrupt("return",l.data);case 4:case"end":return y.stop()}},u)}))()},i.validateToken=function(o,a){return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,hn.Token.tokenValidate({chainId:Za(o),contractAddress:a});case 2:return l=A.sent,g=l.data,A.abrupt("return",gn(Mr({},g),{riskLevel:E6(g.riskLevel)}));case 5:case"end":return A.stop()}},u)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[wo,O2]}}]),n}(Yr);function _xe(r){return v7.apply(this,arguments)}function v7(){return v7=(0,k.A)(b().mark(function r(e){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,zt.get(bT);case 2:return n=o.sent,i=Object.values(n),o.abrupt("return",Nte(i,e));case 5:case"end":return o.stop()}},r)})),v7.apply(this,arguments)}function Exe(r,e){return w7.apply(this,arguments)}function w7(){return w7=(0,k.A)(b().mark(function r(e,n){var i,s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,hn.Token.tokenSearchMultiChain({keyword:e});case 2:return i=u.sent,s=i.data,o=s.map(yxe),u.abrupt("return",o);case 6:case"end":return u.stop()}},r)})),w7.apply(this,arguments)}function Txe(r){return A7.apply(this,arguments)}function A7(){return A7=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=e.fetchAll,s.prev=1,s.next=4,K(this,y7,Rie).call(this,{fetchAll:n});case 4:return s.abrupt("return",s.sent);case 7:if(s.prev=7,s.t0=s.catch(1),!aC(s.t0,["000002"])){s.next=15;break}return s.next=12,wo.updateOneConfig("homePageTokenListWithKeyIdsQueryLimit");case 12:return s.abrupt("return",K(this,y7,Rie).call(this,{fetchAll:n}));case 15:throw s.t0;case 16:case"end":return s.stop()}},r,this,[[1,7]])})),A7.apply(this,arguments)}function Rie(r){return _7.apply(this,arguments)}function _7(){return _7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return n=e.fetchAll,i=wo.getApolloConfig("homePageTokenListWithKeyIdsQueryLimit")||"5",s=Number(i),D.next=5,vn.getWalletList();case 5:if(o=D.sent,a=o.map(function(U){return U.id}),!n){D.next=11;break}return D.abrupt("return",A1({input:a,chunkSize:s,fn:function(){var U=(0,k.A)(b().mark(function V(J){var re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return console.log("----- input--- ",J),De.next=3,vn.splitWalletIdsToQueryArg(J);case 3:return re=De.sent,De.next=6,hn.Token.tokenHomepageBalance({walletIds:$C(re.walletIds),mpcWalletIds:$C(re.mpcWalletIds)});case 6:return ce=De.sent,De.abrupt("return",ce.data);case 8:case"end":return De.stop()}},V)}));return function(V){return U.apply(this,arguments)}}(),merge:function(U){return(0,H.flatten)(U)},callInSequence:!0}));case 11:return D.next=13,vn.getCurrentSelectedWallet();case 13:return u=D.sent,l=u?.id,g=o.filter(function(U){return U.metadata.keyring.type===di.mpc}).map(function(U){return U.id}),y=(0,H.uniq)([l].filter(Boolean).concat(g).concat(a)),D.next=19,vn.splitWalletIdsToQueryArg(y.slice(0,s));case 19:return A=D.sent,D.next=22,hn.Token.tokenHomepageBalance({walletIds:$C(A.walletIds),mpcWalletIds:$C(A.mpcWalletIds)});case 22:return I=D.sent,D.abrupt("return",I.data);case 24:case"end":return D.stop()}},r)})),_7.apply(this,arguments)}function R6(r){return E7.apply(this,arguments)}function E7(){return E7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V=arguments;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:if(n=V.length>1&&V[1]!==void 0?V[1]:{},i=e,!n?.dedupeWithLocalMetas){re.next=27;break}return re.next=5,zt.get(bT);case 5:for(s=re.sent,o={},i=[],a=!0,u=!1,l=void 0,re.prev=9,g=e[Symbol.iterator]();!(a=(y=g.next()).done);a=!0)A=y.value,I=fl(A),P=s[I],P?(P.riskLevel!==E6(P.riskLevel,I)&&(o[I]=gn(Mr({},P),{riskLevel:E6(P.riskLevel,I)})),!P.lsdFlag&&mie.has(I)&&(o[I]=gn(Mr({},o[I]||P),{lsdFlag:!0}))):i.push(A);re.next=17;break;case 13:re.prev=13,re.t0=re.catch(9),u=!0,l=re.t0;case 17:re.prev=17,re.prev=18,!a&&g.return!=null&&g.return();case 20:if(re.prev=20,!u){re.next=23;break}throw l;case 23:return re.finish(20);case 24:return re.finish(17);case 25:return re.next=27,h7.updateValue(o);case 27:if(!(!i||!i.length)){re.next=29;break}return re.abrupt("return");case 29:return re.next=31,A1({input:i,fn:function(){var ce=(0,k.A)(b().mark(function Re(De){var Ue;return b().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return pe.next=2,hn.Token.tokenInfo({binanceTokenIdList:De});case 2:return Ue=pe.sent,pe.abrupt("return",Ue.data);case 4:case"end":return pe.stop()}},Re)}));return function(Re){return ce.apply(this,arguments)}}(),merge:vee});case 31:return D=re.sent,U=i.map(function(ce){return D[ce]}).filter(Boolean),re.next=35,T6(U,bie);case 35:return re.abrupt("return");case 36:case"end":return re.stop()}},r,null,[[9,13,17,25],[18,,20,24]])})),E7.apply(this,arguments)}function C6(r){return T7.apply(this,arguments)}function T7(){return T7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,A1({input:e,fn:function(){var I=(0,k.A)(b().mark(function P(D){var U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,hn.Token.tokenPriceInfo({binanceTokenIdList:D});case 2:return U=J.sent,J.abrupt("return",U.data);case 4:case"end":return J.stop()}},P)}));return function(P){return I.apply(this,arguments)}}(),merge:vee});case 2:for(n=A.sent,i=n,s=!0,o=!1,a=void 0,A.prev=5,u=e[Symbol.iterator]();!(s=(l=u.next()).done);s=!0)g=l.value,Object.prototype.hasOwnProperty.call(n,g)||(i[g]=null);A.next=13;break;case 9:A.prev=9,A.t0=A.catch(5),o=!0,a=A.t0;case 13:A.prev=13,A.prev=14,!s&&u.return!=null&&u.return();case 16:if(A.prev=16,!o){A.next=19;break}throw a;case 19:return A.finish(16);case 20:return A.finish(13);case 21:return A.next=23,gxe(i);case 23:case"end":return A.stop()}},r,null,[[5,9,13,21],[14,,16,20]])})),T7.apply(this,arguments)}function Sxe(){return S7.apply(this,arguments)}function S7(){return S7=(0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,hn.Token.tokenStaticList();case 2:return e=o.sent,n=e.data,i=n.map(function(a){return a.binanceTokenId}),o.abrupt("return",i);case 6:case"end":return o.stop()}},r)})),S7.apply(this,arguments)}function Cie(){return wxe.execute((0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.prev=0,I.next=3,hn.Token.getOndoTokenList();case 3:for(e=I.sent,n=e.data,i={},s=!0,o=!1,a=void 0,I.prev=7,u=n[Symbol.iterator]();!(s=(l=u.next()).done);s=!0)g=l.value,y=fre({contractAddress:g.contractAddress,binanceChainId:g.chainId}),i[y]=g;I.next=15;break;case 11:I.prev=11,I.t0=I.catch(7),o=!0,a=I.t0;case 15:I.prev=15,I.prev=16,!s&&u.return!=null&&u.return();case 18:if(I.prev=18,!o){I.next=21;break}throw a;case 21:return I.finish(18);case 22:return I.finish(15);case 23:return I.next=25,zt.set(lre,i);case 25:I.next=30;break;case 27:I.prev=27,I.t1=I.catch(0),console.error(I.t1);case 30:case"end":return I.stop()}},r,null,[[0,27],[7,11,15,23],[16,,18,22]])})))}function xie(){return vxe.execute((0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.prev=0,P.next=3,hn.Token.getAlphaTokenList();case 3:for(e=P.sent,n=e.data,i=n.filter(function(D){return D.cexOffDisplay===!1}),s={},o=!0,a=!1,u=void 0,P.prev=8,l=i[Symbol.iterator]();!(o=(g=l.next()).done);o=!0)y=g.value,A=fre({contractAddress:y.contractAddress.toLowerCase(),binanceChainId:y.chainId}),s[A]=y;P.next=16;break;case 12:P.prev=12,P.t0=P.catch(8),a=!0,u=P.t0;case 16:P.prev=16,P.prev=17,!o&&l.return!=null&&l.return();case 19:if(P.prev=19,!a){P.next=22;break}throw u;case 22:return P.finish(19);case 23:return P.finish(16);case 24:return P.next=26,zt.set(Oke,s);case 26:P.next=31;break;case 28:P.prev=28,P.t1=P.catch(0),console.error(P.t1);case 31:case"end":return P.stop()}},r,null,[[0,28],[8,12,16,24],[17,,19,23]])})))}function Ixe(r){return I7.apply(this,arguments)}function I7(){return I7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return console.debug("[TokenController#onBalanceChangeEvent]",e),n=e.contractAddress,i=e.balance,s=e.binanceChainId,o=e.address,A.next=4,vn.checkIsMpcAddress(o,s);case 4:if(a=A.sent,!a){A.next=11;break}return A.next=8,Ci.checkMpcWalletActive();case 8:if(u=A.sent,u){A.next=11;break}return A.abrupt("return");case 11:return A.next=13,K(this,k6,R7).call(this,s,n);case 13:if(l=A.sent,l){A.next=17;break}return console.debug("[TokenController:#onBalanceChangeEvent] noMeta"),A.abrupt("return",this.refreshTokenDebounced());case 17:return g=g7({binanceChainId:s,binanceTokenId:l.binanceTokenId,userAddress:o}),X(this,S6)[g]=i,A.next=21,K(this,kie,kxe).call(this,Wl(o),g);case 21:case"end":return A.stop()}},r,this)})),I7.apply(this,arguments)}function kxe(r,e){return k7.apply(this,arguments)}function k7(){return k7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return console.debug("[updateBalanceListOnBalanceChangeEvent]",n),D.next=3,zt.get(mT);case 3:i=D.sent,s=!1,o=!0,a=!1,u=void 0,D.prev=6,l=(i[e]||[])[Symbol.iterator]();case 8:if(o=(g=l.next()).done){D.next=20;break}if(y=g.value,A=g7(y),A!==n){D.next=17;break}return console.debug("[updateBalanceListOnBalanceChangeEvent]: updated",n),s=!0,I=X(this,S6)[A],y.balance=I||y.balance,D.abrupt("break",20);case 17:o=!0,D.next=8;break;case 20:D.next=26;break;case 22:D.prev=22,D.t0=D.catch(6),a=!0,u=D.t0;case 26:D.prev=26,D.prev=27,!o&&l.return!=null&&l.return();case 29:if(D.prev=29,!a){D.next=32;break}throw u;case 32:return D.finish(29);case 33:return D.finish(26);case 34:if(s){D.next=37;break}return console.debug("[updateBalanceListOnBalanceChangeEvent]: not updated",n),D.abrupt("return",this.refreshTokenDebounced());case 37:return D.next=39,zt.set(mT,Mr({},i));case 39:case"end":return D.stop()}},r,this,[[6,22,26,34],[27,,29,33]])})),k7.apply(this,arguments)}function R7(r,e){return C7.apply(this,arguments)}function C7(){return C7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,zt.get(bT);case 2:i=ce.sent,s=Object.values(i),o=!0,a=!1,u=void 0,ce.prev=5,l=s[Symbol.iterator]();case 7:if(o=(g=l.next()).done){ce.next=37;break}y=g.value,A=y.tokenAddresses,I=!0,P=!1,D=void 0,ce.prev=11,U=A[Symbol.iterator]();case 13:if(I=(V=U.next()).done){ce.next=20;break}if(J=V.value,!(J.chainId===e&&Wl(J.contractAddress)===Wl(n))){ce.next=17;break}return ce.abrupt("return",y);case 17:I=!0,ce.next=13;break;case 20:ce.next=26;break;case 22:ce.prev=22,ce.t0=ce.catch(11),P=!0,D=ce.t0;case 26:ce.prev=26,ce.prev=27,!I&&U.return!=null&&U.return();case 29:if(ce.prev=29,!P){ce.next=32;break}throw D;case 32:return ce.finish(29);case 33:return ce.finish(26);case 34:o=!0,ce.next=7;break;case 37:ce.next=43;break;case 39:ce.prev=39,ce.t1=ce.catch(5),a=!0,u=ce.t1;case 43:ce.prev=43,ce.prev=44,!o&&l.return!=null&&l.return();case 46:if(ce.prev=46,!a){ce.next=49;break}throw u;case 49:return ce.finish(46);case 50:return ce.finish(43);case 51:return ce.abrupt("return",null);case 52:case"end":return ce.stop()}},r,null,[[5,39,43,51],[11,22,26,34],[27,,29,33],[44,,46,50]])})),C7.apply(this,arguments)}var Ii=new Axe;_e("token",{importToken:Ii.importToken.bind(Ii),validateToken:Ii.validateToken.bind(Ii),searchToken:Ii.searchToken.bind(Ii),updateTokenSelected:Ii.updateTokenSelected.bind(Ii),getTokenStats:Ii.getTokenStats.bind(Ii),getTokenInfoAiNarrative:Ii.getTokenInfoAiNarrative.bind(Ii),getTokenInfoMarketMeta:Ii.getTokenInfoMarketMeta.bind(Ii),getTokenInfoMarketDynamicInfo:Ii.getTokenInfoMarketDynamicInfo.bind(Ii),getTokenPriceHistory:Ii.getTokenPriceHistory.bind(Ii),getTokenListPrice:Ii.getTokenListPrice.bind(Ii),getTokenMetaByContract:Ii.getTokenMetaByContract.bind(Ii),getTokenMetaByContractList:Ii.getTokenMetaByContractList.bind(Ii),updateTokenPriceByContractAndBinanceChainIdList:Ii.updateTokenPriceByContractAndBinanceChainIdList.bind(Ii),saveTokenMetaAndFetchPrice:Ii.saveTokenMetaAndFetchPrice.bind(Ii),getTokenTagInfo:Ii.getTokenTagsInfo.bind(Ii),getDefaultReceiveTokenList:Ii.getDefaultReceiveTokenList.bind(Ii),refreshTokenBalance:Ii.refreshTokenBalance.bind(Ii)}),c7.setRefreshFn(function(){return Ii.refreshToken({fetchAll:!0})}),globalThis.tokenController=Ii;var Rxe=function(r){return r.endsWith("/")&&(r=r.substring(0,r.length-1)),r},Cxe=function(r){if(!r)return null;var e=new URL(r);return e.protocol!=="https:"?null:r},xxe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="website",s}var i=n.prototype;return i.setCurrentActiveTabId=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:case"end":return l.stop()}},a)}))()},i.setMetadata=function(o,a){return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return l=Rxe(o.origin),g=Cxe(a.favicon),A.next=4,yr.upsert(l,gn(Mr({},a),{favicon:g,origin:l}));case 4:case"end":return A.stop()}},u)}))()},i.getMetadata=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,yr.get(o);case 2:return l.abrupt("return",l.sent);case 3:case"end":return l.stop()}},a)}))()},i.updateWebsiteRisk=function(o,a){return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(a){g.next=2;break}return g.abrupt("return");case 2:return g.next=4,yr.update(o,{risks:a});case 4:case"end":return g.stop()}},u)}))()},n}(Yr),vm=new xxe;_e("website",{getMetadata:vm.getMetadata.bind(vm)}),be("website",{setMetadata:vm.setMetadata.bind(vm)});var Bxe=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return s=n.networkId,U.next=3,Fi.getNetworkByNetworkId(s);case 3:return o=U.sent,a=o.nativeToken,u=o.nativeTokenId,l=o.nativeTokenAddress,g=o.nativeTokenDecimals,U.next=7,Ii.getTokenMetaByTokenId(fl(u));case 7:return y=U.sent,U.next=10,Ii.getTokenListPrice([u]);case 10:return A=U.sent,I=A[u],P=y?.icon,U.abrupt("return",{type:pA.CurrentWallet,name:gA.CurrentWallet,uniqueKey:"current_wallet-current_wallet",balance:"9999999999999999999",balanceSymbol:a,balanceIconUrl:P||"",balanceUsdPrice:"9999999999999999999",costTokenSymbol:a,costTokenDecimals:g,costWithdrawFee:"",costTokenUsdPrice:I?.price||null,available:!0,reason:null,gasStationDetailVo:null,feeInfo:{feeTemplate:Mo.SimpleFeeTemplate,feeType:"",rentAmount:0,feeAmount:Number(i),computeUnitLimit:0,computeUnitPrice:0,feeToken:l||"",baseAmount:0}});case 14:case"end":return U.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Oxe=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:if(i=n.isMpc,s=n.extensionMpcOrderId,o=bs(n,["isMpc","extensionMpcOrderId"]),!i){Re.next=12;break}return a=o.rpcProvider,u=o.wkRpcProvider,l=o.chainId,g=o.chainName,y=o.transaction,A=o.address,I=o.requestId,P=o.buildTransactionFrontedRpcRequests,D=o.fee,U=o.gasAccountType,V=o.publicKeys,Re.next=5,Promise.all(P.map(function(De){return NC({handler:De,rpcProvider:a,chainId:l,address:A})}));case 5:return J=Re.sent,Re.next=8,hn.Sign.customNetworkBuildTx({extensionMpcOrderId:s,customNetwork:{chainId:l,name:g},transaction:y,address:A,transactionConfig:{frontendRpcResponses:J},cachedFee:D,gasAccount:{type:"currentWallet",name:"currentWallet"},publicKeys:V});case 8:return re=Re.sent,Re.abrupt("return",re.data);case 12:return Re.abrupt("return",o3e(o));case 13:case"end":return Re.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),Pxe=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(i=n.isMpc,s=n.extensionMpcOrderId,o=bs(n,["isMpc","extensionMpcOrderId"]),!i){D.next=9;break}return a=o.rpcProvider,u=o.wkRpcProvider,l=o.chainId,g=o.chainName,y=o.message,A=o.address,D.next=5,hn.Sign.customNetworkBuildMsg({extensionMpcOrderId:s,customNetwork:{chainId:l,name:g},message:y,address:A});case 5:return I=D.sent,D.abrupt("return",I.data);case 9:return D.abrupt("return",i3e(o));case 10:case"end":return D.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),x7=function(){"use strict";function r(){(0,G.A)(this,r)}var e=r.prototype;return e.normalizeTransactionData=function(i,s){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",s);case 1:case"end":return u.stop()}},o)}))()},r}(),Nxe="eip155",Mxe=function(r){"use strict";N(n,r);var e=te(n);function n(){return(0,G.A)(this,n),e.apply(this,arguments)}var i=n.prototype;return i.normalizeTransactionSignature=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",yke(o));case 1:case"end":return l.stop()}},a)}))()},n}(x7),Lxe="solana",Dxe=function(r){"use strict";N(n,r);var e=te(n);function n(){return(0,G.A)(this,n),e.apply(this,arguments)}var i=n.prototype;return i.normalizeTransactionSignature=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",Aw.encode(mo(ys(o))));case 1:case"end":return l.stop()}},a)}))()},n}(x7),Uxe="sui",Fxe=function(r){"use strict";N(n,r);var e=te(n);function n(){return(0,G.A)(this,n),e.apply(this,arguments)}var i=n.prototype;return i.normalizeTransactionSignature=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return l=JSON.parse(a),y.abrupt("return",l.signatures[0]);case 2:case"end":return y.stop()}},u)}))()},i.normalizeTransactionData=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return l=JSON.parse(a),y.abrupt("return",l.txBytes);case 2:case"end":return y.stop()}},u)}))()},n}(x7),OT,Wxe=(OT={},vt(OT,Nxe,new Mxe),vt(OT,Lxe,new Dxe),vt(OT,Uxe,new Fxe),OT),Hxe=["normalizeTransactionSignature","normalizeTransactionData"];function zxe(r){return B7.apply(this,arguments)}function B7(){return B7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:n=e.type,i=e.wcId,s=e.signatureOrTxHash,o=e.transaction,I.prev=1,a=ur(i.split(":"),1),u=a[0],l=Wxe[u],I.t0=n,I.next=I.t0==="normalizeTransactionSignature"?7:I.t0==="normalizeTransactionData"?20:33;break;case 7:return I.next=10,l?.normalizeTransactionSignature(s,o);case 10:if(I.t2=g=I.sent,I.t1=I.t2!==null,!I.t1){I.next=14;break}I.t1=g!==void 0;case 14:if(!I.t1){I.next=18;break}I.t3=g,I.next=19;break;case 18:I.t3=s;case 19:return I.abrupt("return",I.t3);case 20:return I.next=23,l?.normalizeTransactionData(s,o);case 23:if(I.t5=y=I.sent,I.t4=I.t5!==null,!I.t4){I.next=27;break}I.t4=y!==void 0;case 27:if(!I.t4){I.next=31;break}I.t6=y,I.next=32;break;case 31:I.t6=o;case 32:return I.abrupt("return",I.t6);case 33:I.next=39;break;case 35:return I.prev=35,I.t7=I.catch(1),console.error(I.t7),I.abrupt("return",s);case 39:case"end":return I.stop()}},r,null,[[1,35]])})),B7.apply(this,arguments)}function $xe(r){var e={};return Hxe.forEach(function(n){e[n]=function(i,s){return zxe({type:n,wcId:r,signatureOrTxHash:i,transaction:s})}}),e}function Vxe(r,e){return r===nn.ton?ys(e):e}var jxe=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return s=n.parsedTransaction,o=bs(n,["parsedTransaction"]),a=i.nativeTokenAddress,u=s?.contractAddress,l=(0,H.uniq)([a,u||a].map(function(I){return No(i.chainId,I)})),A.next=6,Da.getCustomChainTokenInfoMap(l);case 6:return g=A.sent,A.abrupt("return",gn(Mr({},n,s),{type:s.transactionType,tokenInfoMap:g}));case 8:case"end":return A.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),Kxe=function(r){return JSON.stringify(r)},Gxe=function(r){var e={},n=!0,i=!1,s=void 0;try{for(var o=Object.entries(r)[Symbol.iterator](),a;!(n=(a=o.next()).done);n=!0){var u=ur(a.value,2),l=u[0],g=u[1];e[l]=gn(Mr({},g),{icon:mC(g.icon)})}}catch(y){i=!0,s=y}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return e},qxe=function(r){return gn(Mr({},r),{tokenInfoMap:Gxe(r.tokenInfoMap)})},O7=[nn.sui,nn.solana,nn.ton],P2=new WeakSet,Bie=new WeakSet,Oie=new WeakSet,wm=new WeakSet,Pie=new WeakSet,P7=new WeakMap,N7=new WeakSet,Zxe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;s=e.apply(this,arguments),B(F(s),P2),B(F(s),Bie),B(F(s),Oie),B(F(s),wm),B(F(s),Pie),B(F(s),N7),s.name="sign";var o=F(s);s.beforeSendTransactionApproval=function(){var u=(0,k.A)(b().mark(function l(g){var y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn,Ar,Xr,Tn,Bn,ni,en,si,ei,Ia,wi,ho,Zo,qa,ya,Fa,Xu,_h,uA;return b().wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return y=g.requestData,A=y.signContext,I=y.requestId,P=y.transaction,D=y.gasAccountInfo,U=y.isBroadcast,V=y.signOrderId,J=y.parsedResult,re=y.antiMEV,ce=y.signOrderDigest,Re=y.signOrderFeeAmount,De=y.buildTransactionFrontedRpcRequests,Fn.next=4,K(o,P2,PT).call(o,A,I);case 4:return Ue=Fn.sent,Ve={"mev.protection":re},pe=Ue.address,Se=Ue.binanceChainId,Ce=gn(Mr({},Ue),{transaction:P,transactionConfig:Ve}),Fn.next=10,K(o,wm,D1).call(o,A);case 10:return je=Fn.sent,$e=A.networkType,Qe=A.accountId,nt=A.networkId,Fn.next=14,vn.getWalletItemByAccountId(Qe);case 14:if(Ne=Fn.sent,Ne){Fn.next=17;break}throw new Error("Wallet item not found");case 17:return Fn.next=19,Fi.getFullNetworkByNetworkId(nt);case 19:if(Me=Fn.sent,Me){Fn.next=22;break}throw Error("Network not found");case 22:if(!ce){Fn.next=27;break}return Fn.next=25,li.signTx({transaction:ce,accountId:Qe,walletId:Ne.id,networkType:$e,chainId:Se,signOrderId:V});case 25:return ct=Fn.sent,Fn.abrupt("return",{signature:ct});case 27:if(mt=[],Bt=O7.includes($e),!Bt){Fn.next=36;break}return Fn.next=32,li.getPublicKeyHex(Ne.id,Qe,$e);case 32:if(er=Fn.sent,er){Fn.next=35;break}throw Error("Get public key failed");case 35:mt.push(er);case 36:if(cr=[],pr="",!za(nt)){Fn.next=48;break}return Dr=Me,Rr=Dr.chainId,Pr=Dr.name,Fn.next=43,Oxe({rpcProvider:Sc,wkRpcProvider:fm,chainId:Rr,chainName:Pr,transaction:P,requestId:I,address:pe,fee:D.feeInfo,gasAccountType:"Default",publicKeys:[pe],buildTransactionFrontedRpcRequests:De,isMpc:je,extensionMpcOrderId:V});case 43:on=Fn.sent,cr=on.digests,pr=on.unsignedTx,Fn.next=53;break;case 48:return Fn.next=50,hn.Sign.buildTransaction(gn(Mr({},Ce),{address:pe,binanceChainId:Se,transaction:P,gasAccount:{type:D.type,name:D.name},cachedFee:D.feeInfo,extensionMpcOrderId:V,isMpc:je,publicKeys:mt}));case 50:xn=Fn.sent,cr=xn.data.digests,pr=xn.data.unsignedTx;case 53:Ar=[],Xr=!0,Tn=!1,Bn=void 0,Fn.prev=55,ni=cr[Symbol.iterator]();case 57:if(Xr=(en=ni.next()).done){Fn.next=67;break}return si=en.value,Fn.next=61,li.signTx({transaction:si,accountId:Qe,walletId:Ne.id,networkType:$e,chainId:Se,signOrderId:V});case 61:ei=Fn.sent,console.debug("[SignController:nativeSign] "),Ar.push(ei);case 64:Xr=!0,Fn.next=57;break;case 67:Fn.next=73;break;case 69:Fn.prev=69,Fn.t0=Fn.catch(55),Tn=!0,Bn=Fn.t0;case 73:Fn.prev=73,Fn.prev=74,!Xr&&ni.return!=null&&ni.return();case 76:if(Fn.prev=76,!Tn){Fn.next=79;break}throw Bn;case 79:return Fn.finish(76);case 80:return Fn.finish(73);case 81:if(!za(nt)){Fn.next=106;break}return Ia=Me,wi=Ia.chainId,ho=Ia.name,Fn.next=86,a3e({rpcProvider:Sc,wkRpcProvider:fm,chainId:wi,chainName:ho,address:pe,transaction:P,requestId:I,signatures:Ar,unsignedTx:pr});case 86:if(Zo=Fn.sent,qa=Zo.txHash,ya=Zo.signedTransaction,Fa=du(ya),U){Fn.next=93;break}return Fn.abrupt("return",{signature:Fa,transaction:Fa});case 93:return Fn.next=95,Sc.send(wi,{jsonrpc:"2.0",id:1,method:"eth_sendRawTransaction",params:[Fa]});case 95:return Fn.prev=95,Fn.next=98,R2.addTx({parsedTx:J,address:pe,chainId:wi,txHash:qa,feeInfo:D.feeInfo});case 98:Fn.next=103;break;case 100:Fn.prev=100,Fn.t1=Fn.catch(95),console.error(Fn.t1);case 103:return Fn.abrupt("return",{txHash:qa,signature:Fa,transaction:Fa});case 104:Fn.next=132;break;case 106:return Fn.next=108,hn.Sign.compileTransaction(gn(Mr({},Ce),{gasAccount:{type:D.type,name:D.name},unsignedTx:pr,signatures:Ar,publicKeys:mt,isMpc:je}));case 108:if(Xu=Fn.sent,Xu.data.txHash&&ng.dataCollect({businessName:"w3w_sign_page_tx_hash_event",params:{requestId:I,version:"v2",df_1:Ne.id,df_2:origin,df_3:"",df_4:Za(nt),df_5:Xu.data.txHash}}),_h=$xe(Me.wcId),U){Fn.next=121;break}return Fn.next=114,_h.normalizeTransactionSignature(Ar[0],Xu.data.signedTransaction);case 114:return Fn.t2=Fn.sent,Fn.next=117,_h.normalizeTransactionData(Ar[0],Xu.data.signedTransaction);case 117:return Fn.t3=Fn.sent,Fn.abrupt("return",{signature:Fn.t2,transaction:Fn.t3});case 121:return Fn.next=123,hn.Sign.broadcastTransaction(gn(Mr({},Ce),{gasAccount:{type:D.type,name:D.name},signedTransaction:Xu.data.signedTransaction,reportData:y.parsedResult.reportData,cachedFee:D.feeInfo,isMpc:je}));case 123:return uA=Fn.sent,Fn.next=126,_h.normalizeTransactionSignature(Ar[0],Xu.data.signedTransaction);case 126:return Fn.t4=Fn.sent,Fn.t5=uA.data.txHash,Fn.next=130,_h.normalizeTransactionData(Ar[0],Xu.data.signedTransaction);case 130:return Fn.t6=Fn.sent,Fn.abrupt("return",{signature:Fn.t4,txHash:Fn.t5,transaction:Fn.t6});case 132:case"end":return Fn.stop()}},l,null,[[55,69,73,81],[74,,76,80],[95,100]])}));return function(l){return u.apply(this,arguments)}}();var a=F(s);return s.beforeSignMessageApproval=function(){var u=(0,k.A)(b().mark(function l(g){var y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce;return b().wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return y=g.requestData,A=y.message,I=y.signContext,P=y.signOrderId,D=I.networkType,U=I.accountId,V=I.networkId,J=I.address,$e.next=5,K(a,wm,D1).call(a,I);case 5:if(re=$e.sent,ce="",Re="",!za(V)){$e.next=21;break}return $e.next=11,vo.getCustomChainByNetworkId(V);case 11:if(De=$e.sent,De){$e.next=14;break}throw Error("Custom chain not found:"+Pd(V));case 14:return Re=De.chainId,$e.next=17,Pxe({isMpc:re,extensionMpcOrderId:P,rpcProvider:Sc,wkRpcProvider:fm,chainId:Re,chainName:De.name,message:A,address:J});case 17:Ue=$e.sent,ce=Ue.digest,$e.next=29;break;case 21:return $e.next=23,K(a,P2,PT).call(a,I);case 23:return Ve=$e.sent.binanceChainId,$e.next=26,hn.Sign.buildMsg({address:J,binanceChainId:Ve,message:A,extensionMpcOrderId:P,isMpc:re});case 26:pe=$e.sent,ce=pe.data.digest,Re=Ve;case 29:return $e.next=31,vn.getWalletItemByAccountId(U);case 31:if(Se=$e.sent,Se){$e.next=34;break}throw new Error("Wallet item not found");case 34:return $e.next=36,li.signMessage({message:ce,accountId:U,walletId:Se.id,networkType:D,chainId:Re,signOrderId:P});case 36:return Ce=$e.sent,$e.abrupt("return",{signature:Vxe(D,Ce)});case 38:case"end":return $e.stop()}},l)}));return function(l){return u.apply(this,arguments)}}(),de(F(s),P7,{writable:!0,value:function(u){var l=u.signContext,g=u.needConfirmReason,y=u.origRequest,A=u.isBroadcast,I=u.signType;return function(){var P=(0,k.A)(b().mark(function D(U){var V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt;return b().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return V=U.txId,J=l.networkId,re=l.origin,ce=l.networkType,Re=l.accountId,De=l.signSource,Ue=Za(J),Me.next=5,vm.getMetadata(re);case 5:return Ve=Me.sent,Me.next=8,vn.getAddressByAccountId(Re,ce);case 8:return pe=Me.sent,Me.next=11,vn.getWalletItemByAccountId(Re);case 11:return Se=Me.sent,Me.next=14,ll();case 14:return Ce=Me.sent,je=re?JSON.stringify({icon:Ve?.favicon,name:Ve?.name,url:re}):null,$e=I===Hs.SignMessage?"signMessage":A?"sendTransaction":"signTransaction",Qe=Se.id,nt=kke(y),Me.abrupt("return",{extensionId:Ce,txId:V,type:$e,origRequestJson:nt,address:pe,binanceChainId:Ue,dappInfo:je,walletId:Qe,keyId:Qe,source:"".concat(Ske(De)).concat(g||"")});case 20:case"end":return Me.stop()}},D)}));return function(D){return P.apply(this,arguments)}}()}}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:Zn.registerBeforeApprove(Hs.SendTransaction,o.beforeSendTransactionApproval),Zn.registerBeforeApprove(Hs.SignMessage,o.beforeSignMessageApproval);case 2:case"end":return l.stop()}},a)}))()},i.sendTransaction=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.abrupt("return",u.doSignTx(o,a,{isBroadcast:!0}));case 1:case"end":return y.stop()}},l)}))()},i.signTransaction=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.abrupt("return",u.doSignTx(o,a,{isBroadcast:!1}));case 1:case"end":return y.stop()}},l)}))()},i.signMessage=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return g=za(o.networkId),J.next=3,K(u,wm,D1).call(u,o);case 3:return y=J.sent,A=xu(),I=Kxe(a),P=Pc(),J.next=9,Fi.getFullNetworkByNetworkId(o.networkId);case 9:return D=J.sent,U=function(){var re=(0,k.A)(b().mark(function ce(){var Re,De,Ue,Ve,pe,Se,Ce,je;return b().wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:if(Qe.prev=0,!g){Qe.next=9;break}return y&&JM(P,{isCustomNetwork:!0}),Qe.next=5,u3e({rpcProvider:Sc,wkRpcProvider:fm,chainId:Pd(o.networkId),chainName:D?.name||"Unknown chain name",message:I,address:o.address});case 5:return Re=Qe.sent,Qe.abrupt("return",{requestData:{parsedResult:Re,message:I,signContext:o,signOrderId:P},needMPCQRCode:!1,onlyCancel:!1});case 9:return Qe.next=12,K(u,P2,PT).call(u,o,A);case 12:return pe=Qe.sent,Qe.next=15,hn.Sign.parseMsg(gn(Mr({},pe),{message:I,extensionMpcOrderId:P,isMpc:y}));case 15:return Se=Qe.sent,Ce=(De=Se.data)===null||De===void 0||(Ue=De.risks)===null||Ue===void 0?void 0:Ue.riskLevel,je=!!(Ce!==ou.Blacklist&&Se.data.needConfirm),Qe.abrupt("return",{requestData:{parsedResult:qxe(Se.data),message:I,signContext:o,requestId:A,signOrderId:P},needMPCQRCode:je,onlyCancel:je||Ce===ou.Blacklist,needConfirmReason:Se==null||(Ve=Se.data)===null||Ve===void 0?void 0:Ve.needConfirmReason});case 19:Qe.next=28;break;case 21:if(Qe.prev=21,Qe.t0=Qe.catch(0),!y){Qe.next=27;break}return Qe.abrupt("return",{requestData:null,needMPCQRCode:!0,onlyCancel:!0});case 27:throw Qe.t0;case 28:case"end":return Qe.stop()}},ce,null,[[0,21]])}));return function(){return re.apply(this,arguments)}}(),J.abrupt("return",K(u,N7,Nie).call(u,{type:Hs.SignMessage,getApprovalRequestData:U,ctx:o,requestId:A,origRequest:I}));case 12:case"end":return J.stop()}},l)}))()},i.doSignTx=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return y=u.isBroadcast,A=u.isSignOrder,I=u.signOrderInfo,P=o.networkId,D=o.address,U=xu(),De.next=5,K(l,wm,D1).call(l,o);case 5:return V=De.sent,J=Pc(),re=JSON.stringify(a),ce=function(){var Ue=(0,k.A)(b().mark(function Ve(){var pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn,Ar,Xr,Tn,Bn;return b().wrap(function(en){for(;;)switch(en.prev=en.next){case 0:if(en.prev=0,!za(P)){en.next=40;break}return V&&JM(J,{isCustomNetwork:!0}),en.next=5,vo.getCustomChainByNetworkId(P);case 5:if(pe=en.sent,pe){en.next=8;break}throw Error("cannot get custom chain:".concat(Pd(P)));case 8:return Se=pe.chainId,Ce=pe.name,en.next=12,s3e({wkRpcProvider:fm,transaction:re,chainId:Se,chainName:Ce,address:D});case 12:return je=en.sent,$e=je.parseTransactionFrontedRpcRequests,Qe=je.gasAccountFrontedRpcRequests,nt=je.buildTransactionFrontedRpcRequests,en.t0=ur,en.next=17,Promise.all([c3e({rpcProvider:Sc,wkRpcProvider:fm,chainId:Se,chainName:Ce,transaction:re,url:o.origin,requestId:U,address:D,parseTransactionFrontedRpcRequests:$e}),bte({rpcProvider:Sc,wkRpcProvider:fm,chainId:Se,chainName:Ce,transaction:re,requestId:U,address:D,gasAccountFrontedRpcRequests:Qe})]);case 17:return en.t1=en.sent,Ne=(0,en.t0)(en.t1,2),Me=Ne[0],ct=Ne[1],en.next=23,jxe(Me,pe);case 23:return mt=en.sent,en.t2=mt,en.t3=re,en.t4=o,en.t5=U,en.next=30,are({ret:ct,customChainItem:pe,userAddress:D});case 30:return en.t6=en.sent,en.t7=y,en.t8=J,en.t9=mt?.type===lm.Approve&&tre(a),en.t10=Qe,en.t11=nt,Bt={parsedResult:en.t2,transaction:en.t3,signContext:en.t4,requestId:en.t5,gasAccountInfo:en.t6,isBroadcast:en.t7,signOrderId:en.t8,antiMEV:!1,canEditApprove:en.t9,gasAccountFrontedRpcRequests:en.t10,buildTransactionFrontedRpcRequests:en.t11},en.abrupt("return",{requestData:Bt,onlyCancel:!1,needMPCQRCode:!1});case 40:return en.next=43,K(l,P2,PT).call(l,o,U);case 43:return pr=en.sent,en.next=46,hn.Sign.parseTransaction(gn(Mr({},pr),{transaction:re,extensionMpcOrderId:J,isMpc:V}));case 46:if(Dr=en.sent,!A){en.next=53;break}return en.next=50,Bxe(o,I.feeAmount);case 50:en.t12=en.sent,en.next=56;break;case 53:return en.next=55,C2.getSignGasAccount(o,re,V,Dr.data.enableAntiMEV);case 55:en.t12=en.sent;case 56:return Rr=en.t12,en.next=59,K(l,Bie,Yxe).call(l,Dr.data,o);case 59:return Pr=en.sent,on=Pr==null||(er=Pr.risks)===null||er===void 0?void 0:er.riskLevel,Ar=A||((xn=(cr=Rr?.feeInfo)===null||cr===void 0?void 0:cr.succeedEstimateGas)!==null&&xn!==void 0?xn:!0),Xr={parsedResult:Pr,transaction:re,signContext:o,requestId:U,gasAccountInfo:Rr,isBroadcast:y,signOrderId:J,antiMEV:!A&&Pr.enableAntiMEV,canEditApprove:!A&&Pr?.type===lm.Approve&&tre(a),signOrderDigest:I?.digest,signOrderFeeAmount:I?.feeAmount,signOrderInfo:I},Tn=!Ar||on===ou.Blacklist,Bn=!!(!Tn&&Pr.needConfirm),en.abrupt("return",{requestData:Xr,needMPCQRCode:Bn,onlyCancel:Bn||Tn,needConfirmReason:Pr?.needConfirmReason});case 67:en.next=76;break;case 69:if(en.prev=69,en.t13=en.catch(0),!V){en.next=75;break}return en.abrupt("return",{requestData:null,needMPCQRCode:!0,onlyCancel:!0});case 75:throw en.t13;case 76:case"end":return en.stop()}},Ve,null,[[0,69]])}));return function(){return Ue.apply(this,arguments)}}(),De.abrupt("return",K(l,N7,Nie).call(l,{ctx:o,type:Hs.SendTransaction,getApprovalRequestData:ce,requestId:U,isBroadcast:y,origRequest:re}));case 10:case"end":return De.stop()}},g)}))()},i.changeApprovalAmount=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe;return b().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Zn.getApprovalRequestById(o);case 2:if(g=Ce.sent,y=g.requestData,A=y.transaction,I=y.signContext,P=y.parsedResult,D=JSON.parse(A),U=D.params[0].data,D.params[0].data=hke(U,ti(a)),V=JSON.stringify(D),J=xu(),!za(I.networkId)){Ce.next=14;break}return Ce.next=13,Zn.changeRequestData(o,gn(Mr({},y),{transaction:V,parsedResult:gn(Mr({},P),{amount:a}),requestId:J}));case 13:return Ce.abrupt("return");case 14:return re=Pc(),Ce.next=17,K(u,wm,D1).call(u,I);case 17:return ce=Ce.sent,Ce.next=20,K(u,P2,PT).call(u,I,J);case 20:return Re=Ce.sent,Ce.next=23,hn.Sign.parseTransaction(gn(Mr({},Re),{transaction:V,extensionMpcOrderId:re,isMpc:ce}));case 23:if(De=Ce.sent,Ue=De.data,Ve=Ue.needConfirm,!(ce&&Ve)){Ce.next=30;break}pe=Ci.createMPCAppApproval({approvalId:o,arg:{signType:g.type,signContext:I,isBroadcast:!0},generateTaskData:X(u,P7).call(u,{signType:g.type,origRequest:V,signContext:I,isBroadcast:!0})}),Ce.next=32;break;case 30:return Ce.next=32,Zn.changeRequestData(o,gn(Mr({},y),{transaction:V,parsedResult:Ue,signOrderId:re,requestId:J}));case 32:case"end":return Ce.stop()}},l)}))()},i.pendingNonceCheck=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,hn.Sign.pendingNonceCheck(o);case 3:return u=g.sent,g.abrupt("return",u.data);case 7:return g.prev=7,g.t0=g.catch(0),g.abrupt("return",{pendingTotal:0,pendingDistinct:0,confirmedNonce:0,pendingNonce:0,hitRule:!1});case 10:case"end":return g.stop()}},a,null,[[0,7]])}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[Zn]}}]),n}(Yr);function PT(r,e){return M7.apply(this,arguments)}function M7(){return M7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return i=e.networkId,s=e.accountId,o=e.networkType,a="",za(i)?a=Pd(i):a=Za(i),g.next=5,vn.getAddressByAccountId(s,o);case 5:return u=g.sent,g.abrupt("return",{address:u,binanceChainId:a,source:e.signSource,url:e.origin,requestId:n||xu()});case 7:case"end":return g.stop()}},r)})),M7.apply(this,arguments)}function Yxe(r,e){return L7.apply(this,arguments)}function L7(){return L7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:if(!(e.tokenInfoMap&&Object.keys(e.tokenInfoMap).length>0)){ce.next=2;break}return ce.abrupt("return",e);case 2:for(i=new Set,e.contractAddress&&i.add(e.contractAddress),s=!0,o=!1,a=void 0,ce.prev=5,u=(e.allowanceChanges||[])[Symbol.iterator]();!(s=(l=u.next()).done);s=!0)g=l.value,i.add(g.token);ce.next=13;break;case 9:ce.prev=9,ce.t0=ce.catch(5),o=!0,a=ce.t0;case 13:ce.prev=13,ce.prev=14,!s&&u.return!=null&&u.return();case 16:if(ce.prev=16,!o){ce.next=19;break}throw a;case 19:return ce.finish(16);case 20:return ce.finish(13);case 21:for(y=!0,A=!1,I=void 0,ce.prev=22,P=(e.balanceChanges||[])[Symbol.iterator]();!(y=(D=P.next()).done);y=!0)U=D.value,i.add(U.contractAddress);ce.next=30;break;case 26:ce.prev=26,ce.t1=ce.catch(22),A=!0,I=ce.t1;case 30:ce.prev=30,ce.prev=31,!y&&P.return!=null&&P.return();case 33:if(ce.prev=33,!A){ce.next=36;break}throw I;case 36:return ce.finish(33);case 37:return ce.finish(30);case 38:if(V=Array.from(i),V.length!==0){ce.next=41;break}return ce.abrupt("return",e);case 41:return ce.next=43,K(this,Oie,Xxe).call(this,n.networkId,V);case 43:return J=ce.sent,ce.abrupt("return",gn(Mr({},e),{tokenInfoMap:J}));case 45:case"end":return ce.stop()}},r,this,[[5,9,13,21],[14,,16,20],[22,26,30,38],[31,,33,37]])})),L7.apply(this,arguments)}function Xxe(r,e){return D7.apply(this,arguments)}function D7(){return D7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce;return b().wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return i=Za(e),s=n.map(function(Qe){return{chainId:i,contractAddress:Qe}}),$e.next=4,hn.Token.tokenInfoByContractAddress(s);case 4:return o=$e.sent,a=Object.values(o.data).map(function(Qe){return Qe.tokenId}),$e.next=8,Ii.getTokenListPrice(a);case 8:for(u=$e.sent,l={},g=!0,y=!1,A=void 0,$e.prev=11,I=Object.entries(o.data)[Symbol.iterator]();!(g=(P=I.next()).done);g=!0)D=ur(P.value,2),U=D[0],V=D[1],re=ur(U.split("|"),1),ce=re[0],Re=V.tokenId,De=V.decimals,Ue=V.symbol,Ve=V.icon,pe=V.name,Ce=(Se=(J=u[Re])===null||J===void 0?void 0:J.price)!==null&&Se!==void 0?Se:"0",l[ce]={type:"TOKEN",decimals:String(De),symbol:Ue,icon:Ve,name:pe,price:Ce};$e.next=19;break;case 15:$e.prev=15,$e.t0=$e.catch(11),y=!0,A=$e.t0;case 19:$e.prev=19,$e.prev=20,!g&&I.return!=null&&I.return();case 22:if($e.prev=22,!y){$e.next=25;break}throw A;case 25:return $e.finish(22);case 26:return $e.finish(19);case 27:return $e.abrupt("return",l);case 28:case"end":return $e.stop()}},r,null,[[11,15,19,27],[20,,22,26]])})),D7.apply(this,arguments)}function D1(r){return U7.apply(this,arguments)}function U7(){return U7=(0,k.A)(b().mark(function r(e){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=e.accountId,o.next=3,vn.getWalletItemByAccountId(n);case 3:if(i=o.sent,i){o.next=6;break}return o.abrupt("return",!1);case 6:return o.abrupt("return",i.metadata.keyring.type===di.mpc);case 7:case"end":return o.stop()}},r)})),U7.apply(this,arguments)}function Jxe(r){return F7.apply(this,arguments)}function F7(){return F7=(0,k.A)(b().mark(function r(e){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,K(this,wm,D1).call(this,e);case 2:if(n=o.sent,n){o.next=5;break}return o.abrupt("return",null);case 5:return o.next=7,Ci.checkWalletStatus();case 7:return i=o.sent,o.abrupt("return",i);case 9:case"end":return o.stop()}},r,this)})),F7.apply(this,arguments)}function Nie(r){return W7.apply(this,arguments)}function W7(){return W7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return n=e.ctx,i=e.type,s=e.getApprovalRequestData,o=e.requestId,a=e.origRequest,u=e.isBroadcast,l=n.origin,re.next=4,Zn.addApproval({type:Hs.Loading,origin:l,requestData:{originType:i},requestId:o,source:n.signSource,onlyCancel:!0});case 4:return g=re.sent,y=this,A=function(){var ce=(0,k.A)(b().mark(function Re(){var De,Ue,Ve,pe,Se;return b().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return console.debug("[SignController:tryUpsertSignApproval] to get approval request data"),je.next=3,s();case 3:if(De=je.sent,Ue=De.requestData,Ve=De.needMPCQRCode,pe=De.onlyCancel,Se=De.needConfirmReason,!Ve){je.next=16;break}return console.debug("[tryUpsertSignApproval]:createMPCAppApproval"),je.next=12,Ci.createMPCAppApproval({approvalId:g,arg:{signType:i,signContext:n,isBroadcast:u},generateTaskData:X(y,P7).call(y,{signType:i,origRequest:a,signContext:n,isBroadcast:u,needConfirmReason:Se})});case 12:return g=je.sent,je.abrupt("return");case 16:return je.next=18,Zn.upsertApproval({approvalId:g,origin:l,type:i,requestData:Ue,requestId:o,source:n.signSource,onlyCancel:pe});case 18:g=je.sent;case 19:case"end":return je.stop()}},Re)}));return function(){return ce.apply(this,arguments)}}(),I=function(){var ce=(0,k.A)(b().mark(function Re(){return b().wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.prev=0,Ue.next=3,A();case 3:Ue.next=12;break;case 5:return Ue.prev=5,Ue.t0=Ue.catch(0),console.debug("[SignController:upsertSignApprovalWithCatch] error"),console.error(Ue.t0),Ue.next=11,Zn.upsertApproval({approvalId:g,origin:l,type:Hs.NeedRefresh,requestData:{},requestId:o,source:n.signSource,onRefresh:(0,k.A)(b().mark(function Ve(){return b().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,A();case 2:case"end":return Se.stop()}},Ve)})),onlyCancel:!0});case 11:g=Ue.sent;case 12:return Ue.abrupt("return",g);case 13:case"end":return Ue.stop()}},Re,null,[[0,5]])}));return function(){return ce.apply(this,arguments)}}(),re.next=10,K(this,wm,D1).call(this,n);case 10:return P=re.sent,re.next=13,K(this,Pie,Jxe).call(this,n);case 13:if(D=re.sent,!(D&&D!==sp.active)){re.next=19;break}return re.next=17,Zn.rejectApproval(g);case 17:re.next=22;break;case 19:return re.next=21,I();case 21:g=re.sent;case 22:if(!P){re.next=25;break}return re.next=25,Ci.wrapMPCSignCheck(g,{signType:i,signContext:n,isBroadcast:u});case 25:return re.next=27,Zn.waitForApproval(g);case 27:if(U=re.sent,U){re.next=30;break}throw new Error(k1.USER_REJECTED);case 30:return V=Zn.fetchExtraReturn(g),re.abrupt("return",V);case 32:case"end":return re.stop()}},r,this)})),W7.apply(this,arguments)}var kf=new Zxe;_e("sign",{changeApprovalAmount:kf.changeApprovalAmount.bind(kf),pendingNonceCheck:kf.pendingNonceCheck.bind(kf)});var Am=new WeakSet,Mie=new WeakSet,Lie=new WeakSet,Qxe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),Am),B(F(s),Mie),B(F(s),Lie),s.name="providerAdapter",s}var i=n.prototype;return i.normalConnect=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,a.multiAddressConnect(o);case 2:return l=y.sent,y.abrupt("return",l[0]);case 4:case"end":return y.stop()}},u)}))()},i.multiAddressConnect=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return console.debug("[ProviderAdapterController:normalConnect] context:",o),y.next=3,gT.isBlocked();case 3:if(l=y.sent,!l){y.next=6;break}throw new Error(k1.USER_REJECTED);case 6:return y.abrupt("return",ake(o.origin,(0,k.A)(b().mark(function A(){var I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se;return b().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,K(a,Am,U1).call(a,o);case 2:if(I=je.sent,P=I.publicAddress,D=I.publicAddressList,U=I.hasPermissionItem,V=I.needAddExtraNetwork,!P){je.next=17;break}if(!V){je.next=14;break}if(re=(J=o.providerCallContext)===null||J===void 0?void 0:J.networkType,!re){je.next=14;break}return je.next=14,qi.addExtraNetworkTypeInPermission(o.origin,re,no(_M[re]));case 14:return je.next=16,a.emitCurrentConnectionInfo(o);case 16:return je.abrupt("return",D);case 17:return ce=o.origin,Re=o.providerCallContext,De=Re.networkType,je.next=21,Fi.getCurrentSelectedNetwork();case 21:return Ue=je.sent,Ve=Ue&&Ue.chainType===De?Ue.id:Fi.getDefaultIdForType(De),console.debug("[ProviderAdapterController:normalConnect] selectedNetworkItem:",Ve),je.next=26,K(a,Mie,e5e).call(a);case 26:if(pe=je.sent,!U){je.next=32;break}return je.next=30,qi.requestPermissionForExtraNetwork(ce,{accountId:pe,networkId:Ve,supportedNetworkType:De});case 30:je.next=41;break;case 32:return je.prev=32,je.next=35,qi.requestPermission(ce,{accountId:pe,networkId:Ve,supportedNetworkType:De});case 35:je.next=41;break;case 37:throw je.prev=37,je.t0=je.catch(32),a.emitCurrentConnectionInfo(o),je.t0;case 41:return je.next=43,a.emitCurrentConnectionInfo(o);case 43:return Se=je.sent.publicAddressList,je.abrupt("return",Se);case 45:case"end":return je.stop()}},A,null,[[32,37]])}))));case 7:case"end":return y.stop()}},u)}))()},i.checkCurrentConnection=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return console.debug("[ProviderAdapterController:checkCurrentConnection] context:",o),P.next=3,gT.isBlocked();case 3:if(l=P.sent,!l){P.next=6;break}return P.abrupt("return",null);case 6:return P.next=8,K(a,Am,U1).call(a,o);case 8:if(g=P.sent,y=g.publicAddress,A=g.publicAddressList,!y){P.next=15;break}return P.next=14,a.emitCurrentConnectionInfo(o);case 14:return P.abrupt("return",{address:y,addressList:A});case 15:return P.abrupt("return",null);case 16:case"end":return P.stop()}},u)}))()},i.universalSign=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,u.checkPermission(o);case 2:return g=a.type,y=a.request,console.log("[ProviderAdapter:universalSign]",a),P.next=6,K(u,Lie,t5e).call(u,o);case 6:A=P.sent,P.t0=g,P.next=P.t0===pT.signMessage?10:P.t0===pT.signTransaction?11:P.t0===pT.sendTransaction?12:13;break;case 10:return P.abrupt("return",kf.signMessage(A,y));case 11:return P.abrupt("return",kf.signTransaction(A,y));case 12:return P.abrupt("return",kf.sendTransaction(A,y));case 13:throw Error("Unsupported sign type: ".concat(g));case 14:case"end":return P.stop()}},l)}))()},i.changeConnectedChainId=function(o,a){var u=a.chainId,l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(u){V.next=4;break}return V.next=3,l.emitCurrentConnectionInfo(o);case 3:return V.abrupt("return");case 4:return y=o.origin,V.prev=5,V.next=8,l.checkPermission(o);case 8:V.next=13;break;case 10:return V.prev=10,V.t0=V.catch(5),V.abrupt("return");case 13:return V.next=15,K(l,Am,U1).call(l,o);case 15:if(A=V.sent,I=A.accountId,P=A.chainId,P!==u){V.next=20;break}return V.abrupt("return");case 20:return V.next=22,Fi.getFullNetworkByEVMChainId(u);case 22:if(D=V.sent,D){V.next=26;break}throw console.log("[ProviderAdapter:changeConnectedChainId] No target network found for chainId:",u),Error(k1.UNSUPPORTED_CHAIN);case 26:return V.next=28,qi.changeConnectedNetwork(y,D.id);case 28:return V.next=30,l.emitCurrentConnectionInfo(o);case 30:case"end":return V.stop()}},g,null,[[5,10]])}))()},i.changeConnectedAddress=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,u.checkPermission(o,{newAddress:a});case 2:return y.next=4,u.emitCurrentConnectionInfo(o);case 4:console.log("Method not implemented");case 5:case"end":return y.stop()}},l)}))()},i.addEvmChain=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return g=a.rpcUrls,y=a.chainId,A=a.chainName,I=a.nativeCurrency,re.next=3,Zn.addApproval({origin:o.origin,type:Hs.AddEVMChain,requestData:a});case 3:return P=re.sent,re.next=6,Zn.waitForApproval(P);case 6:if(D=re.sent,D){re.next=9;break}throw Error(k1.USER_REJECTED);case 9:if(!(g[0]&&y&&A&&I)){re.next=19;break}return re.next=14,vo.addCustomChain({rpcUrl:g[0],chainId:Number(y).toString(),name:A,nativeToken:I.symbol,blockExplorerUrl:(V=a==null||(U=a.blockExplorerUrls)===null||U===void 0?void 0:U[0])!==null&&V!==void 0?V:""});case 14:return re.next=16,u.changeConnectedChainId(o,{chainId:y});case 16:return re.abrupt("return",null);case 19:throw Error("Invalid chain data");case 20:case"end":return re.stop()}},l)}))()},i.disconnect=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return l=o.origin,U.next=3,K(a,Am,U1).call(a,o);case 3:if(g=U.sent,y=g.publicAddress,A=g.publicAddressList,I=g.hasPermissionItem,P=g.needAddExtraNetwork,y){U.next=10;break}return U.abrupt("return");case 10:return U.next=12,qi.revokePermissionForOrigin(l);case 12:case"end":return U.stop()}},u)}))()},i.requestPubKey=function(o,a){var u=a.chainId,l=a.address,g=a.disableTweak,y=g===void 0?!1:g,A=this;return(0,k.A)(b().mark(function I(){var P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,A.checkPermission(o);case 2:return J.next=4,K(A,Am,U1).call(A,o);case 4:if(P=J.sent.publicAddressList,P.includes(l)){J.next=7;break}throw Error("Address not connected:".concat(l));case 7:return J.next=9,vn.getWalletItemByAddress(l,no(u));case 9:return D=J.sent,J.next=12,li.getPublicKeyHex(D.id,D.accounts[0].id,o.providerCallContext.networkType);case 12:return U=J.sent,J.abrupt("return",U);case 14:case"end":return J.stop()}},I)}))()},i.requestDirectSign=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,u.checkPermission(o);case 2:throw Error("Method not supporetd");case 3:case"end":return y.stop()}},l)}))()},i.reportError=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:l=tke(a);case 1:case"end":return y.stop()}},u)}))()},i.requestReportSign=function(o,a){return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:console.log(" --- request report sign ---");case 1:case"end":return g.stop()}},u)}))()},i.requestReportConnect=function(o,a){return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:console.log(" --- request report connect ---");case 1:case"end":return g.stop()}},u)}))()},i.requestRPC=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(g=(l=o.providerCallContext)===null||l===void 0?void 0:l.networkType,g){D.next=4;break}throw new Error("No networkType");case 4:if(y=a.chainId,A=bs(a,["chainId"]),y){D.next=7;break}throw new Error("No chainId");case 7:return D.next=9,Fi.getFullNetworkByEVMChainId(y);case 9:if(I=D.sent,I){D.next=12;break}throw new Error("No network");case 12:if(g===I.chainType){D.next=14;break}throw new Error("Network type not match");case 14:return D.abrupt("return",cm.sendJsonRPC(I.id,A));case 15:case"end":return D.stop()}},u)}))()},i.requestIsUniversalSign=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",!0);case 1:case"end":return u.stop()}},o)}))()},i.requestIsNewSuiSign=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",!0);case 1:case"end":return u.stop()}},o)}))()},i.requestFeatureGate=function(o,a){return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(l=a.featureGate,l!=="revamp"){y.next=5;break}return y.abrupt("return",!0);case 5:return y.abrupt("return",!1);case 6:case"end":return y.stop()}},u)}))()},i.checkPermission=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return l=o.origin,A.next=3,qi.getPermissionsForOrigin(l);case 3:if(g=A.sent,g){A.next=6;break}throw Error("Dapp not connected");case 6:case"end":return A.stop()}},u)}))()},i.emitCurrentConnectionInfo=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return l=o.origin,g=o.providerCallContext,y=g.networkType,ce.next=4,qi.getPermissionsForOrigin(l);case 4:if(A=ce.sent,A){ce.next=9;break}return ce.next=8,R1.emitDisconnectMessage(l,y);case 8:return ce.abrupt("return",{publicAddress:"",accountId:null,publicAddressList:[],accountIds:[]});case 9:return ce.next=11,K(a,Am,U1).call(a,o);case 11:return I=ce.sent,P=I.chainId,D=I.publicAddress,U=I.accountId,V=I.accountIds,J=I.publicAddressList,ce.next=19,R1.emitMessage({origin:l,networkType:y,eventType:FC.connectionChanged,args:{address:D,pubKey:D,chainId:P,addressList:J}});case 19:return ce.abrupt("return",{publicAddress:D,accountId:U,accountIds:V,publicAddressList:J});case 20:case"end":return ce.stop()}},u)}))()},i.emitCurrentConnectionInfoByOrigin=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(!(!o||!a.length)){J.next=3;break}return console.log("no origin or supported networkType",o,a),J.abrupt("return");case 3:g=!0,y=!1,A=void 0,J.prev=4,I=a[Symbol.iterator]();case 6:if(g=(P=I.next()).done){J.next=14;break}return D=P.value,U={origin:o,providerCallContext:{networkType:D}},J.next=11,u.emitCurrentConnectionInfo(U);case 11:g=!0,J.next=6;break;case 14:J.next=20;break;case 16:J.prev=16,J.t0=J.catch(4),y=!0,A=J.t0;case 20:J.prev=20,J.prev=21,!g&&I.return!=null&&I.return();case 23:if(J.prev=23,!y){J.next=26;break}throw A;case 26:return J.finish(23);case 27:return J.finish(20);case 28:case"end":return J.stop()}},l,null,[[4,16,20,28],[21,,23,27]])}))()},n}(Yr);function U1(r){return H7.apply(this,arguments)}function H7(){return H7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return n=e.origin,i=e.providerCallContext.networkType,Ve.next=4,qi.getPermissionsForOrigin(n);case 4:if(s=Ve.sent,s){Ve.next=7;break}return Ve.abrupt("return",{publicAddress:"",accountId:null,chainId:"",networkType:i,accountIds:[],publicAddressList:[],hasPermissionItem:!1});case 7:if(o=s.permission.accountIds,a=s.permission.currentAccountId,u=a||o?.[0],u){Ve.next=12;break}throw new Error("No accountId");case 12:return l="",g=[],Ve.prev=14,Ve.next=17,vn.getAddressByAccountId(u,i);case 17:l=Ve.sent,Ve.next=22;break;case 20:Ve.prev=20,Ve.t0=Ve.catch(14);case 22:y=!0,A=!1,I=void 0,Ve.prev=23,P=o[Symbol.iterator]();case 25:if(y=(D=P.next()).done){Ve.next=40;break}return U=D.value,Ve.prev=27,Ve.next=30,vn.getAddressByAccountId(U,i);case 30:V=Ve.sent,g.push(V),l||(l=V,u=U),Ve.next=37;break;case 35:Ve.prev=35,Ve.t1=Ve.catch(27);case 37:y=!0,Ve.next=25;break;case 40:Ve.next=46;break;case 42:Ve.prev=42,Ve.t2=Ve.catch(23),A=!0,I=Ve.t2;case 46:Ve.prev=46,Ve.prev=47,!y&&P.return!=null&&P.return();case 49:if(Ve.prev=49,!A){Ve.next=52;break}throw I;case 52:return Ve.finish(49);case 53:return Ve.finish(46);case 54:if(l){Ve.next=56;break}return Ve.abrupt("return",{publicAddress:"",accountId:null,chainId:"",networkType:i,accountIds:[],publicAddressList:[],hasPermissionItem:!0});case 56:return J=[l].concat(g.filter(function(pe){return pe!==l})),Ve.next=59,Fi.getNetworkListByChainType({chainType:i,includeCustomChain:!0});case 59:return re=Ve.sent,ce=Z3e(s.permission,i,re),Re="",ce?Re=oke(ce):Re=_M[i],De=s.permission.supportedNetworkType!==i&&!(s.permission.supportedNetworkTypeList||[]).includes(i),Ve.abrupt("return",{publicAddress:l,accountId:u,chainId:Re,networkType:i,accountIds:o,publicAddressList:J,hasPermissionItem:!0,needAddExtraNetwork:De});case 65:case"end":return Ve.stop()}},r,null,[[14,20],[23,42,46,54],[27,35],[47,,49,53]])})),H7.apply(this,arguments)}function e5e(){return z7.apply(this,arguments)}function z7(){return z7=(0,k.A)(b().mark(function r(){var e,n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,vn.getCurrentSelectedWallet();case 2:return e=s.sent,s.next=5,vn.getCurrentSelectedAccount();case 5:if(n=s.sent,!n){s.next=10;break}return s.abrupt("return",n.id);case 10:return s.abrupt("return",null);case 11:case"end":return s.stop()}},r)})),z7.apply(this,arguments)}function t5e(r){return $7.apply(this,arguments)}function $7(){return $7=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return n=e.origin,y.next=3,K(this,Am,U1).call(this,e);case 3:return i=y.sent,s=i.accountId,o=i.chainId,a=i.networkType,u=i.publicAddress,y.next=10,Fi.getFullNetworkByEVMChainId(o);case 10:return l=y.sent,y.abrupt("return",{origin:n,accountId:s,networkId:l.id,networkType:a,signSource:Go.dapp,address:u});case 12:case"end":return y.stop()}},r,this)})),$7.apply(this,arguments)}var hs=new Qxe;be("providerAdapter",{normalConnect:hs.normalConnect.bind(hs),multiAddressConnect:hs.multiAddressConnect.bind(hs),checkCurrentConnection:hs.checkCurrentConnection.bind(hs),universalSign:hs.universalSign.bind(hs),changeConnectedChainId:hs.changeConnectedChainId.bind(hs),changeConnectedAddress:hs.changeConnectedAddress.bind(hs),disconnect:hs.disconnect.bind(hs),requestPubKey:hs.requestPubKey.bind(hs),requestDirectSign:hs.requestDirectSign.bind(hs),reportError:hs.reportError.bind(hs),requestIsUniversalSign:hs.requestIsUniversalSign.bind(hs),requestRPC:hs.requestRPC.bind(hs),requestFeatureGate:hs.requestFeatureGate.bind(hs),requestReportSign:hs.requestReportSign.bind(hs),requestReportConnect:hs.requestReportConnect.bind(hs),requestIsNewSuiSign:hs.requestIsNewSuiSign.bind(hs),addEvmChain:hs.addEvmChain.bind(hs)});var Die=function(){var r=(0,k.A)(b().mark(function e(n){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return i=HC(n),a.next=3,crypto.subtle.digest("SHA-256",i);case 3:return s=a.sent,a.abrupt("return",new Uint8Array(s));case 5:case"end":return a.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),r5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="sas",s}var i=n.prototype;return i.batchGenerateKeyshare=function(o){var a=o.userId,u=o.walletIds,l=o.spsVersion,g=this;return(0,k.A)(b().mark(function y(){var A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.t0=ur,J.next=3,Promise.all([hn.Sas.getPublicKey({source:"WEB_DEX",binanceChainIds:"56,CT_501",spsVersion:l}),hn.Sas.getConfig()]);case 3:return J.t1=J.sent,A=(0,J.t0)(J.t1,2),I=A[0],P=A[1],D=P.data.expireAtDefault,U=(0,H.keyBy)(I.data.publicKeyList,function(re){return re.chain==="evm"?nn.evm:re.chain==="sol"?nn.solana:""}),J.abrupt("return",Promise.all(u.map(function(re){return g.generateKeyshare({userId:a,walletId:re,keyshareConfig:U,expireAt:D})})));case 10:case"end":return J.stop()}},y)}))()},i.generateKeyshare=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe;return b().wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return Ne.next=2,ll();case 2:return l=Ne.sent,g=o.userId,y=o.walletId,A=o.expireAt,I=o.keyshareConfig,Ne.next=6,a.generateNewProofKey({userId:g,walletId:y,expireAt:A});case 6:return P=Ne.sent,Ne.next=9,vn.getWalletItemByWalletId(y);case 9:if(D=Ne.sent,D){Ne.next=12;break}throw Error("No wallet item");case 12:U=D.accounts[0],V=U.id,J=U.addressList,re=[],ce=!0,Re=!1,De=void 0,Ne.prev=17,Ue=J[Symbol.iterator]();case 19:if(ce=(Ve=Ue.next()).done){Ne.next=32;break}if(pe=Ve.value,Se=pe.publicKeyHex,Ce=pe.network,je=pe.address,$e=I[Ce],$e){Ne.next=25;break}return Ne.abrupt("continue",29);case 25:return Ne.next=27,li.splitKeyshare({walletId:y,accountId:V,networkType:Ce,config:gn(Mr({},$e),{expireAt:A,proofKeyPublicKeyHex:P,userPublicKeyHex:Se})});case 27:Qe=Ne.sent,re.push(Qe);case 29:ce=!0,Ne.next=19;break;case 32:Ne.next=38;break;case 34:Ne.prev=34,Ne.t0=Ne.catch(17),Re=!0,De=Ne.t0;case 38:Ne.prev=38,Ne.prev=39,!ce&&Ue.return!=null&&Ue.return();case 41:if(Ne.prev=41,!Re){Ne.next=44;break}throw De;case 44:return Ne.finish(41);case 45:return Ne.finish(38);case 46:return Ne.abrupt("return",{walletId:y,expireAt:A,walletType:D.metadata.keyring.type===di.privateKey?"PRIVATE_KEY":"SEED_PHRASE",proofKeyPublicKey:P,authorizeList:re,extensionId:l});case 47:case"end":return Ne.stop()}},u,null,[[17,34,38,46],[39,,41,45]])}))()},i.generateNewProofKey=function(o){var a=o.userId,u=o.walletId,l=o.expireAt;return(0,k.A)(b().mark(function g(){var y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return y=xg(a,u),A=lme.randomPrivateKey(),I=Jo(A),U.next=5,Or.upsert(y,{id:y,userId:a,walletId:u,expireAt:l,proofKeyHex:I});case 5:return U.next=7,dk(mo(I));case 7:return P=U.sent,U.abrupt("return",ys(Jo(P)));case 9:case"end":return U.stop()}},g)}))()},i.getExistProofKey=function(o){var a=o.userId,u=o.walletId;return(0,k.A)(b().mark(function l(){var g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return g=xg(a,u),D.next=3,Or.get(g);case 3:if(y=D.sent,y){D.next=6;break}return D.abrupt("return",null);case 6:return A=y.proofKeyHex,D.next=9,dk(mo(A));case 9:return I=D.sent,D.abrupt("return",ys(Jo(I)));case 11:case"end":return D.stop()}},l)}))()},i.getProofKeySignature=function(o){var a=o.userId,u=o.walletId;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return g=xg(a,u),ce.next=3,Or.get(g);case 3:if(y=ce.sent,y){ce.next=6;break}throw Error("Proofkey does not exist");case 6:return A=y.proofKeyHex,I=String(Date.now()),P=mo(A),ce.next=11,dk(mo(A));case 11:return D=ce.sent,U=Jo(D),ce.next=15,Die(I);case 15:return V=ce.sent,ce.next=18,pk(V,P);case 18:return J=ce.sent,ce.abrupt("return",{timeStamp:I,proofKeyPublicKey:ys(U),timestampSignature:ys(Jo(J))});case 20:case"end":return ce.stop()}},l)}))()},i.deleteProofKeys=function(o){var a=o.userId,u=o.walletIds;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Promise.all(u.map(function(A){var I=xg(a,A);return Or.delete(I)}));case 2:case"end":return y.stop()}},l)}))()},i.deleteProofKeysByWalletIds=function(o){return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return u=new Set(o),A.next=3,Or.toArray();case 3:if(l=A.sent,g=l.filter(function(I){return u.has(I.walletId)}).map(function(I){return I.id}),!g.length){A.next=8;break}return A.next=8,Or.table.bulkDelete(g);case 8:case"end":return A.stop()}},a)}))()},i.getSignature=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return l=mo(o),D.next=3,dk(mo(o));case 3:return g=D.sent,y=Jo(g),D.next=7,Die(a);case 7:return A=D.sent,console.log(Jo(A),"hashed"),D.next=11,pk(A,l);case 11:return I=D.sent,D.abrupt("return",{timeStamp:a,proofKeyPublicKey:y,timestampSignature:Jo(I)});case 13:case"end":return D.stop()}},u)}))()},n}(Yr),F1=new r5e;globalThis.sasController=F1;var V7=function(r,e){var n=r.metadata,i=r.accounts,s=r.id,o=[],a=i[0].addressList,u=!0,l=!1,g=void 0;try{for(var y=function(P,D){var U=D.value,V=a.find(function(J){return J.network===U.chainType});V&&o.push({binanceChainId:U.binanceChainId,address:V.address,publicKeyHex:V.publicKeyHex})},A=e[Symbol.iterator](),I;!(u=(I=A.next()).done);u=!0)y(A,I)}catch(P){l=!0,g=P}finally{try{!u&&A.return!=null&&A.return()}finally{if(l)throw g}}return{walletId:s,walletIcon:n.walletIcon||"",walletName:n.name,walletType:n.keyring.type,addressList:o}},Uie=(0,H.once)((0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return e=chrome.runtime.getURL("/resource/dexpub"),o.next=3,fetch(e).then(function(a){return a.text()});case 3:return n=o.sent,i=n.replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").split(`
|
||
`).map(function(a){return a.trim()}).join(""),console.log("loadPropKey",i),o.abrupt("return",i);case 7:case"end":return o.stop()}},r)}))),n5e=`
|
||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0pKWN3lBaFlLC4akjvLd
|
||
mnk/3q3TnZ0Yz89AEEvoRq6x0hz2//7nVD5Usw60cpAQbWmcwd/L9NZc9C0ZyrXE
|
||
zROslfCwBSqfLsK2KXZrxOF92Z3EanHFedRezwBPbOahe1UV/p/NIiJYnJ69B0Sd
|
||
vogCF+ajU+0ayCHPwQfPo+EsY0B54owD7/xuydCVcHmjmAW7uKYR6zuMf7VFeMoe
|
||
vfjDs1sij712wytaAywtcoRmvMHig9HK2ndntABDmVngOpQkRbiiovSORjxSrThO
|
||
rzjKzsXQ6teSVRETqrzfkjCa3kZ1XPBiKOtCII2gV7GkkNwxtl4Z4Ea3qi69WI63
|
||
/QIDAQAB
|
||
`.split(`
|
||
`).map(function(r){return r.trim()}).join("");function i5e(r){var e=yf(r);return crypto.subtle.importKey("spki",e.buffer,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-512"},!0,["verify"])}function s5e(r,e,n){return j7.apply(this,arguments)}function j7(){return j7=(0,k.A)(b().mark(function r(e,n,i){var s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,i5e(e);case 2:return s=g.sent,o=yf(i),a=HC(n),g.next=7,crypto.subtle.verify({name:"RSASSA-PKCS1-v1_5",hash:"SHA-512"},s,o.buffer,a.buffer);case 7:return u=g.sent,g.abrupt("return",u);case 9:case"end":return g.stop()}},r)})),j7.apply(this,arguments)}function Fie(r,e){return K7.apply(this,arguments)}function K7(){return K7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,Uie();case 2:i=P.sent,s=[i],Si||s.push(n5e),o=!0,a=!1,u=void 0,P.prev=6,l=s[Symbol.iterator]();case 8:if(o=(g=l.next()).done){P.next=18;break}return y=g.value,P.next=12,s5e(y,e,n);case 12:if(A=P.sent,!A){P.next=15;break}return P.abrupt("return",!0);case 15:o=!0,P.next=8;break;case 18:P.next=24;break;case 20:P.prev=20,P.t0=P.catch(6),a=!0,u=P.t0;case 24:P.prev=24,P.prev=25,!o&&l.return!=null&&l.return();case 27:if(P.prev=27,!a){P.next=30;break}throw u;case 30:return P.finish(27);case 31:return P.finish(24);case 32:return P.abrupt("return",!1);case 33:case"end":return P.stop()}},r,null,[[6,20,24,32],[25,,27,31]])})),K7.apply(this,arguments)}var o5e="https://web3.binance.com",a5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="multiChainWallet",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o.subscribe(Ul,function(g){o.onLockedChanged(g)}),globalThis.changeConnectedChain=function(g,y){qi.changeConnectedNetwork(g,no(y))},l.next=4,Uie();case 4:globalThis.verifyDigestSign=Fie;case 5:case"end":return l.stop()}},a)}))()},i.requestConnect=function(o,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return l.checkOrigin(o),J.next=3,l.checkConnectedWallet(o);case 3:if(y=J.sent,!y?.length){J.next=6;break}return J.abrupt("return",y);case 6:return A=o.origin,I=o.tabId,J.next=9,Promise.all(a.map(function(re){return Fi.getNetworkByChainId(re)}));case 9:return P=J.sent,D=P.filter(Boolean).map(function(re){return re}),J.next=13,qi.requestMultiChainPermission(A,a,u);case 13:return J.next=15,qi.getConnectedWalletItemsForOrign(o.origin);case 15:return U=J.sent,J.abrupt("return",U.map(function(re){return V7(re,D)}));case 17:case"end":return J.stop()}},g)}))()},i.checkConnectedWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return a.checkOrigin(o),l=o.origin,I.next=4,a.getConnectedNetworks(l);case 4:return g=I.sent,I.next=7,qi.getConnectedWalletItemsForOrign(l);case 7:return y=I.sent,I.abrupt("return",y.map(function(P){return V7(P,g)}));case 9:case"end":return I.stop()}},u)}))()},i.getWalletInfo=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return l.checkOrigin(o),A.abrupt("return",null);case 2:case"end":return A.stop()}},g)}))()},i.disconnect=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a.checkOrigin(o),g.next=3,qi.revokePermissionForOrigin(o.origin);case 3:case"end":return g.stop()}},u)}))()},i.switchChain=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return u.checkOrigin(o),y.next=3,u.checkPermission(o);case 3:return y.next=5,qi.changeConnectedNetwork(o.origin,no(a));case 5:case"end":return y.stop()}},l)}))()},i.requestAutoSign=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a.checkOrigin(o),g.next=3,a.checkPermission(o);case 3:case"end":return g.stop()}},u)}))()},i.signOrder=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J,re,ce,Re,De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return u.checkOrigin(o),Ve.next=3,u.checkPermission(o);case 3:return g=o.origin,y=a.walletId,A=a.txData,I=a.feeAmount,P=a.digest,D=a.digestSign,U=a.binanceChainId||a.bianceChainId,Ve.next=8,Fie(P,D);case 8:if(V=Ve.sent,V){Ve.next=11;break}throw Error("Digest sign verify failed");case 11:return Ve.next=13,Fi.getNetworkByChainId(U);case 13:return J=Ve.sent,Ve.next=16,vn.getWalletItemByWalletId(y);case 16:if(re=Ve.sent,!(!re||!J)){Ve.next=19;break}throw Error("Cannot found walletItem or chain");case 19:if(ce=dh(re,J.chainType)[0],ce){Ve.next=22;break}throw Error("Cannot get address to sign");case 22:return Re={origin:g,accountId:re.accounts[0].id,networkId:J.id,networkType:J.chainType,signSource:Go.dapp,address:ce},Ve.next=25,kf.doSignTx(Re,JSON.parse(A),{isSignOrder:!0,isBroadcast:!1,signOrderInfo:{feeAmount:I,digest:P,feeAmountLevel:a.feeAmountLevel,feeDetail:Y3e(a.feeDetail)}});case 25:return De=Ve.sent,Ve.next=28,tc(100);case 28:return Ve.abrupt("return",De.signature);case 29:case"end":return Ve.stop()}},l)}))()},i.getExtensionInfo=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return a.checkOrigin(o),I.next=3,ll();case 3:return l=I.sent,g=Nc(),I.next=7,zt.get(Ul);case 7:return y=I.sent,I.abrupt("return",{extensionId:l,version:g,walletLocked:y,autoSignEnabled:!1});case 9:case"end":return I.stop()}},u)}))()},i.requestConnectWithSAS=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return u.checkOrigin(o),y=a.binanceChainIds,A=a.userId,console.log("[MultiChainWalletController] requestConnectWithSAS",a),ce.next=6,u.getConnectedWalletAndProofKey(o,{userId:A});case 6:if(I=ce.sent,!I.length){ce.next=10;break}return P=I[0],ce.abrupt("return",{wallet:P.wallet,aggreeEnableSAS:!!P.proofKeyPublicKey});case 10:return ce.next=12,u.requestConnect(o,y,{userId:A,enabledWalletIds:[],enabledWalletInfo:[]});case 12:return D=ce.sent,U=D[0],ce.next=16,qi.getPermissionsForOrigin(o.origin);case 16:if(V=ce.sent,J=!!(!(V==null||(g=V.permission)===null||g===void 0)&&g.agreeEnableSas),!J){ce.next=21;break}return ce.next=21,u.persistSasWalletPermission(o.origin,U.walletId);case 21:return ce.abrupt("return",{wallet:U,aggreeEnableSAS:J});case 22:case"end":return ce.stop()}},l)}))()},i.getConnectedWalletAndProofKey=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return u.checkOrigin(o),y=a.userId,U.next=5,u.checkConnectedWallet(o);case 5:if(A=U.sent,A?.length){U.next=8;break}return U.abrupt("return",[]);case 8:return U.next=10,qi.getPermissionsForOrigin(o.origin);case 10:return I=U.sent,P=I==null||(g=I.permission)===null||g===void 0?void 0:g.enabledSasWalletInfos,U.abrupt("return",Promise.all(A.map(function(){var V=(0,k.A)(b().mark(function J(re){var ce,Re,De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(ce=re.walletId,Re=P?.includes(ce),!Re){Ve.next=8;break}return Ve.next=5,F1.getExistProofKey({userId:y,walletId:ce});case 5:Ve.t0=Ve.sent,Ve.next=9;break;case 8:Ve.t0=null;case 9:return De=Ve.t0,Ve.abrupt("return",{wallet:re,proofKeyPublicKey:De||void 0});case 11:case"end":return Ve.stop()}},J)}));return function(J){return V.apply(this,arguments)}}())));case 13:case"end":return U.stop()}},l)}))()},i.requestEnableSAS=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return u.checkOrigin(o),U.next=3,u.checkPermission(o);case 3:return g=a.userId,y=a.walletId,A=a.userEmail,U.next=6,Zn.addApproval({origin:o.origin,type:Hs.RequestSas,requestData:{userInfo:{email:A},walletId:y}});case 6:return I=U.sent,U.next=9,Zn.waitForApproval(I);case 9:if(P=U.sent,!P){U.next=13;break}return U.next=13,u.persistSasWalletPermission(o.origin,y);case 13:return U.abrupt("return",{aggreeEnableSAS:P});case 14:case"end":return U.stop()}},l)}))()},i.getSASKeyshare=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J,re,ce,Re,De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return u.checkOrigin(o),Ve.next=4,u.checkPermission(o);case 4:return y=a.userId,A=a.walletIds,I=a.isSilent,P=a.spsVersion,Ve.next=7,qi.getConnectedWalletItemsForOrign(o.origin);case 7:return D=Ve.sent,U=new Set(D.map(function(pe){return pe.id})),Ve.next=11,qi.getPermissionsForOrigin(o.origin);case 11:if(V=Ve.sent,J=new Set((V==null||(g=V.permission)===null||g===void 0?void 0:g.enabledSasWalletInfos)||[]),re=A.filter(function(pe){return U.has(pe)&&J.has(pe)}),re.length!==0){Ve.next=16;break}return Ve.abrupt("return",[]);case 16:return Ve.next=18,zt.get(Ul);case 18:if(ce=Ve.sent,!(ce&&!I)){Ve.next=30;break}return lC.showPopup(),Ve.next=23,oM((0,k.A)(b().mark(function pe(){var Se;return b().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,zt.get(Ul);case 2:return Se=je.sent,je.abrupt("return",!Se);case 4:case"end":return je.stop()}},pe)})),{timeout:60*1e3,interval:100});case 23:return Ve.next=25,zt.get(Ul);case 25:if(Re=Ve.sent,!Re){Ve.next=28;break}return Ve.abrupt("return",[]);case 28:Ve.next=32;break;case 30:if(!ce){Ve.next=32;break}return Ve.abrupt("return",[]);case 32:return Ve.next=34,F1.batchGenerateKeyshare({userId:y,walletIds:re,spsVersion:P});case 34:return De=Ve.sent,Ve.abrupt("return",De);case 36:case"end":return Ve.stop()}},l)}))()},i.syncSASStatus=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return u.checkOrigin(o),console.log("[MultiChainWalletController] syncSASStatus",a),D.next=4,u.checkPermission(o);case 4:return g=a.statusList,D.next=7,qi.getPermissionsForOrigin(o.origin);case 7:if(y=D.sent,y){D.next=10;break}return D.abrupt("return");case 10:return A=y.permission.enabledSasWalletInfos||[],I=new Set(g.filter(function(U){return!U.enabled}).map(function(U){return U.walletId})),y.permission.enabledSasWalletInfos=A.filter(function(U){return!I.has(U)}),D.next=15,qi.updatePermissionForOrigin(o.origin,y);case 15:case"end":return D.stop()}},l)}))()},i.getSASProofKeySignature=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return u.checkOrigin(o),I.next=3,u.checkPermission(o);case 3:return g=a.walletId,y=a.userId,I.abrupt("return",F1.getProofKeySignature({userId:y,walletId:g}));case 5:case"end":return I.stop()}},l)}))()},i.emitCurrentConnectedWallets=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,a.getConnectedNetworks(o);case 2:return l=I.sent,I.next=5,qi.getConnectedWalletItemsForOrign(o);case 5:return g=I.sent,y=g.map(function(P){return V7(P,l)}),I.next=9,R1.emitMultiChainProviderMessage({origin:o,eventType:"connectedWalletsChanged",args:y});case 9:case"end":return I.stop()}},u)}))()},i.emitCurrentConnectedChainId=function(o,a){return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,R1.emitMultiChainProviderMessage({origin:o,eventType:"connectedChainIdChanged",args:a});case 2:case"end":return g.stop()}},u)}))()},i.onLockedChanged=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,qi.getMultiChainOriginList();case 2:u=U.sent,l=!0,g=!1,y=void 0,U.prev=4,A=u[Symbol.iterator]();case 6:if(l=(I=A.next()).done){U.next=13;break}return P=I.value,U.next=10,R1.emitMultiChainProviderMessage({origin:P,eventType:"walletLockedChanged",args:o});case 10:l=!0,U.next=6;break;case 13:U.next=19;break;case 15:U.prev=15,U.t0=U.catch(4),g=!0,y=U.t0;case 19:U.prev=19,U.prev=20,!l&&A.return!=null&&A.return();case 22:if(U.prev=22,!g){U.next=25;break}throw y;case 25:return U.finish(22);case 26:return U.finish(19);case 27:case"end":return U.stop()}},a,null,[[4,15,19,27],[20,,22,26]])}))()},i.getConnectedNetworks=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=3,qi.getPermissionsForOrigin(o);case 3:return l=D.sent,y=(g=l==null||(u=l.permission)===null||u===void 0?void 0:u.availableNetworkIds)!==null&&g!==void 0?g:[],D.next=8,Promise.all(y.map(function(U){return Fi.getNetworkByNetworkId(U)}));case 8:return A=D.sent,I=A.filter(Boolean).map(function(U){return U}),D.abrupt("return",I);case 11:case"end":return D.stop()}},a)}))()},i.checkOrigin=function(o){if(o.origin!==o5e)throw new Error("Origin not allowed")},i.persistSasWalletPermission=function(o,a){return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,qi.getPermissionsForOrigin(o);case 2:if(l=A.sent,l){A.next=5;break}return A.abrupt("return");case 5:if(g=l.permission.enabledSasWalletInfos||[],!g.includes(a)){A.next=8;break}return A.abrupt("return");case 8:return l.permission.enabledSasWalletInfos=(0,Li.A)(g).concat([a]),A.next=11,qi.updatePermissionForOrigin(o,l);case 11:case"end":return A.stop()}},u)}))()},i.checkPermission=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,hs.checkPermission(o);case 2:case"end":return l.stop()}},a)}))()},n}(Yr),js=new a5e;be("multichainWallet",{requestConnect:js.requestConnect.bind(js),checkConnectedWallet:js.checkConnectedWallet.bind(js),getWalletInfo:js.getWalletInfo.bind(js),disconnect:js.disconnect.bind(js),switchChain:js.switchChain.bind(js),requestAutoSign:js.requestAutoSign.bind(js),getExtensionInfo:js.getExtensionInfo.bind(js),signOrder:js.signOrder.bind(js),requestConnectWithSAS:js.requestConnectWithSAS.bind(js),requestEnableSAS:js.requestEnableSAS.bind(js),getSASKeyshare:js.getSASKeyshare.bind(js),syncSASStatus:js.syncSASStatus.bind(js),getConnectedWalletAndProofKey:js.getConnectedWalletAndProofKey.bind(js),getSASProofKeySignature:js.getSASProofKeySignature.bind(js)});var Wie=new WeakSet,x6=new WeakSet,Hie=new WeakSet,G7=new WeakSet,yh=new WeakSet,zie=new WeakSet,$ie=new WeakSet,Vie=new WeakSet,NT=new WeakSet,jie=new WeakSet,u5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),Wie),B(F(s),x6),B(F(s),Hie),B(F(s),G7),B(F(s),yh),B(F(s),zie),B(F(s),$ie),B(F(s),Vie),B(F(s),NT),B(F(s),jie),s.name="permission",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,yh,R0).call(o);case 2:o.subscribe(v2,K(o,zie,f5e).bind(o)),o.subscribe(gC,K(o,$ie,d5e).bind(o));case 4:case"end":return l.stop()}},a)}))()},i.requestPermission=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,K(u,Wie,c5e).call(u,o);case 2:if(g=V.sent,y=!g,g){V.next=18;break}return V.prev=5,V.next=8,ng.checkConnectWebsite(o);case 8:A=V.sent,A&&(a.risks=A),V.next=15;break;case 12:V.prev=12,V.t0=V.catch(5),console.error(V.t0);case 15:return V.next=17,Zn.addApproval({origin:o,type:Hs.PermissionRequest,requestData:a});case 17:g=V.sent;case 18:return V.next=20,Zn.waitForApproval(g);case 20:if(I=V.sent,!I){V.next=36;break}if(!y){V.next=31;break}return V.next=25,Zn.getApprovalRequestById(g);case 25:return P=V.sent,D=P.requestData,V.next=29,K(u,x6,Z7).call(u,o,D);case 29:V.next=34;break;case 31:return console.log("[PermissionController] not new approval, wait"),V.next=34,tc(500);case 34:V.next=37;break;case 36:throw new Error(k1.USER_REJECTED);case 37:case"end":return V.stop()}},l,null,[[5,12]])}))()},i.requestPermissionForExtraNetwork=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Zn.addApproval({origin:o,type:Hs.PermissionRequest,requestData:a});case 2:return g=D.sent,D.next=5,Zn.waitForApproval(g);case 5:if(y=D.sent,!y){D.next=15;break}return D.next=9,Zn.getApprovalRequestById(g);case 9:return A=D.sent,I=A.requestData,D.next=13,K(u,Hie,l5e).call(u,o,I);case 13:D.next=16;break;case 15:throw new Error(k1.USER_REJECTED);case 16:case"end":return D.stop()}},l)}))()},i.requestMultiChainPermission=function(o,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U,V,J,re,ce,Re;return b().wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,vn.getCurrentSelectedAccount();case 2:return y=Ue.sent,Ue.next=5,vn.getCurrentSelectedWallet();case 5:return A=Ue.sent,Ue.next=8,Promise.all(a.map(function(Ve){return Fi.getNetworkByChainId(Ve)}));case 8:return I=Ue.sent,P=(0,H.uniq)(I.filter(Boolean).map(function(Ve){return Ve.chainType})),D=!!u.userId,Ue.next=14,Zn.addApproval({origin:o,type:D?Hs.DexWebConnect:Hs.PermissionRequest,requestData:{accountId:(U=y?.id)!==null&&U!==void 0?U:null,walletIds:A?.id?[A.id]:[],networkId:no(a[0]),supportedNetworkType:P[0],supportedNetworkTypeList:P,availableNetworkIds:a.map(function(Ve){return no(Ve)}),isMultichainConnect:!0,filterKeylessWallet:!0,enabledSasWalletInfos:((V=u.enabledWalletInfo)!==null&&V!==void 0?V:[])||[],onlyOneWallet:D,currentUserId:u.userId}});case 14:return J=Ue.sent,Ue.next=17,Zn.waitForApproval(J);case 17:if(re=Ue.sent,!re){Ue.next=27;break}return Ue.next=21,Zn.getApprovalRequestById(J);case 21:return ce=Ue.sent,Re=ce.requestData,Ue.next=25,K(l,x6,Z7).call(l,o,Re);case 25:Ue.next=28;break;case 27:throw new Error(k1.USER_REJECTED);case 28:case"end":return Ue.stop()}},g)}))()},i.addExtraNetworkTypeInPermission=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Qt.get(o);case 2:if(y=I.sent,y){I.next=5;break}return I.abrupt("return");case 5:return K(l,G7,Kie).call(l,y,a,u),I.next=8,Qt.update(o,y);case 8:return I.next=10,K(l,yh,R0).call(l);case 10:case"end":return I.stop()}},g)}))()},i.changeConnectedNetwork=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Qt.get(o);case 2:if(g=I.sent,g){I.next=5;break}throw new Error("Permission not granted");case 5:return I.next=7,Fi.getFullNetworkByNetworkId(a);case 7:return y=I.sent,g.permission.networkIds=[a],g.permission.currentNetworkId=a,g.permission.networkIdForChainType=g.permission.networkIdForChainType||{},g.permission.networkIdForChainType[y.chainType]=a,g.permission.supportedNetworkType=y.chainType,I.next=15,Qt.update(o,g);case 15:return I.next=17,K(u,yh,R0).call(u);case 17:return I.next=19,hs.emitCurrentConnectionInfoByOrigin(o,UC(g.permission));case 19:if(za(a)){I.next=22;break}return I.next=22,js.emitCurrentConnectedChainId(o,Za(a));case 22:case"end":return I.stop()}},l)}))()},i.changeAllConnectedWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Qt.toArray();case 2:l=re.sent,g=o.accounts[0].id,y=!0,A=!1,I=void 0,re.prev=5,P=l[Symbol.iterator]();case 7:if(y=(D=P.next()).done){re.next=16;break}if(U=D.value,V=U.permission,!V.accountIds.includes(g)){re.next=13;break}return re.next=13,a.changeConnectedWallet(U.origin,o);case 13:y=!0,re.next=7;break;case 16:re.next=22;break;case 18:re.prev=18,re.t0=re.catch(5),A=!0,I=re.t0;case 22:re.prev=22,re.prev=23,!y&&P.return!=null&&P.return();case 25:if(re.prev=25,!A){re.next=28;break}throw I;case 28:return re.finish(25);case 29:return re.finish(22);case 30:case"end":return re.stop()}},u,null,[[5,18,22,30],[23,,25,29]])}))()},i.changeConnectedWallet=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,Qt.get(o);case 2:if(g=P.sent,g){P.next=5;break}throw new Error("Permission not granted");case 5:if(a){P.next=7;break}throw new Error("Wallet not granted");case 7:return y=a.accounts[0].id,g.permission.accountIds.includes(y)||(A=(0,Li.A)(g.permission.accountIds).concat([y]),g.permission.accountIds=A),g.permission.currentAccountId=y,g.permission.currentWalletId=a.id,P.next=13,Qt.update(o,g);case 13:return P.next=15,K(u,yh,R0).call(u);case 15:return P.next=17,hs.emitCurrentConnectionInfoByOrigin(o,UC(g.permission));case 17:return P.next=19,js.emitCurrentConnectedWallets(o);case 19:case"end":return P.stop()}},l)}))()},i.revokePermissionForOrigin=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Qt.get(o);case 2:if(l=y.sent,l){y.next=5;break}return y.abrupt("return");case 5:return y.next=7,K(a,NT,B6).call(a,[l]);case 7:case"end":return y.stop()}},u)}))()},i.revokePermissionForWalletItem=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve;return b().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(o){Se.next=2;break}return Se.abrupt("return");case 2:return g=o.accounts.map(function(Ce){return Ce.id}),Se.next=5,Qt.toArray();case 5:y=Se.sent,A=[],a&&(y=y.filter(function(Ce){return Ce.origin===a})),I=[],P=!1,D=!0,U=!1,V=void 0,Se.prev=11,J=y[Symbol.iterator]();case 13:if(D=(re=J.next()).done){Se.next=33;break}if(ce=re.value,!(((Re=ce.permission.accountIds)===null||Re===void 0?void 0:Re.length)>1)){Se.next=29;break}return Ue=Mr({},ce),Ve=Ue.permission.accountIds,Ue.permission.accountIds=Ve.filter(function(Ce){return Ce!==o.accounts[0].id}),Ue.permission.currentWalletId===o.id&&(Ue.permission.currentWalletId=void 0),Ue.permission.currentAccountId&&o.accounts.find(function(Ce){return Ce.id===Ue.permission.currentAccountId})&&(Ue.permission.currentAccountId=Ue.permission.accountIds[0]),!((De=Ue.permission.enabledSasWalletInfos)===null||De===void 0)&&De.includes(o.id)&&(Ue.permission.enabledSasWalletInfos=Ue.permission.enabledSasWalletInfos.filter(function(Ce){return Ce!==o.id}),P=!0),Se.next=26,Qt.update(ce.origin,Ue);case 26:I.push(ce.origin),Se.next=30;break;case 29:ce.permission.accountIds.some(function(Ce){return g.includes(Ce)})&&(A.push(ce),I.push(ce.origin));case 30:D=!0,Se.next=13;break;case 33:Se.next=39;break;case 35:Se.prev=35,Se.t0=Se.catch(11),U=!0,V=Se.t0;case 39:Se.prev=39,Se.prev=40,!D&&J.return!=null&&J.return();case 42:if(Se.prev=42,!U){Se.next=45;break}throw V;case 45:return Se.finish(42);case 46:return Se.finish(39);case 47:if(!P){Se.next=50;break}return Se.next=50,F1.deleteProofKeysByWalletIds([o.id]);case 50:return Se.next=52,K(u,yh,R0).call(u);case 52:return Se.next=54,K(u,NT,B6).call(u,A);case 54:return Se.next=56,K(u,jie,p5e).call(u,I);case 56:case"end":return Se.stop()}},l,null,[[11,35,39,47],[40,,42,46]])}))()},i.revokeAll=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Qt.toArray();case 2:return u=g.sent,g.next=5,K(o,NT,B6).call(o,u);case 5:case"end":return g.stop()}},a)}))()},i.revokePermissionForNetworkId=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Qt.toArray();case 2:for(l=re.sent,g=[],y=!0,A=!1,I=void 0,re.prev=5,P=l[Symbol.iterator]();!(y=(D=P.next()).done);y=!0)U=D.value,V=U.permission,V.currentNetworkId===o&&g.push(U);re.next=13;break;case 9:re.prev=9,re.t0=re.catch(5),A=!0,I=re.t0;case 13:re.prev=13,re.prev=14,!y&&P.return!=null&&P.return();case 16:if(re.prev=16,!A){re.next=19;break}throw I;case 19:return re.finish(16);case 20:return re.finish(13);case 21:return re.next=23,K(a,NT,B6).call(a,g);case 23:case"end":return re.stop()}},u,null,[[5,9,13,21],[14,,16,20]])}))()},i.getPermissionsForOrigin=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Qt.get(o);case 2:if(u=g.sent,u){g.next=7;break}return g.abrupt("return",null);case 7:return g.abrupt("return",u);case 8:case"end":return g.stop()}},a)}))()},i.updatePermissionForOrigin=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Qt.update(o,a);case 2:return y.next=4,K(u,yh,R0).call(u);case 4:case"end":return y.stop()}},l)}))()},i.getConnectedWalletItemsForOrign=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,a.getPermissionsForOrigin(o);case 2:if(l=V.sent,l){V.next=5;break}return V.abrupt("return",[]);case 5:return g=l.permission,y=g.accountIds,A=g.currentAccountId,V.next=8,vn.getWalletList();case 8:return I=V.sent,P=A||y[0],D=[P].concat((0,Li.A)(y.filter(function(J){return J!==P}))).filter(Boolean),V.abrupt("return",ESe(D,I));case 12:case"end":return V.stop()}},u)}))()},i.getMultiChainOriginList=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Qt.toArray();case 2:return a=l.sent,l.abrupt("return",a.map(function(g){return g.origin}));case 4:case"end":return l.stop()}},o)}))()},i.transferPermission=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return g=o.accounts.map(function(De){return De.id}),y=a.accounts.map(function(De){return De.id}),Re.next=4,Qt.toArray();case 4:A=Re.sent,I=[],A.forEach(function(De){if(De.permission.accountIds.some(function(Ve){return g.includes(Ve)})){var Ue=Mr({},De);Ue.permission.accountIds=Ue.permission.accountIds.map(function(Ve){return g.includes(Ve)?y[0]:Ve}),Ue.permission.currentAccountId&&g.includes(Ue.permission.currentAccountId)&&(Ue.permission.currentAccountId=y[0]),Ue.permission.currentWalletId===o.id&&(Ue.permission.currentWalletId=a.id),I.push(Ue)}}),P=!0,D=!1,U=void 0,Re.prev=8,V=I[Symbol.iterator]();case 10:if(P=(J=V.next()).done){Re.next=17;break}return re=J.value,Re.next=14,Qt.update(re.origin,re);case 14:P=!0,Re.next=10;break;case 17:Re.next=23;break;case 19:Re.prev=19,Re.t0=Re.catch(8),D=!0,U=Re.t0;case 23:Re.prev=23,Re.prev=24,!P&&V.return!=null&&V.return();case 26:if(Re.prev=26,!D){Re.next=29;break}throw U;case 29:return Re.finish(26);case 30:return Re.finish(23);case 31:if(!I.length){Re.next=34;break}return Re.next=34,K(u,yh,R0).call(u);case 34:case"end":return Re.stop()}},l,null,[[8,19,23,31],[24,,26,30]])}))()},n}(Yr);function c5e(r){return q7.apply(this,arguments)}function q7(){return q7=(0,k.A)(b().mark(function r(e){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Zn.getPendingApproval();case 2:return n=o.sent,i=n.find(function(a){return a.origin===e&&a.type===Hs.PermissionRequest}),o.abrupt("return",i?.id);case 5:case"end":return o.stop()}},r)})),q7.apply(this,arguments)}function Z7(r,e){return Y7.apply(this,arguments)}function Y7(){return Y7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue;return b().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:if(i=n.walletIds,s=n.accountId,o=n.networkId,a=n.risks,u=n.supportedNetworkType,l=n.availableNetworkIds,g=n.isMultichainConnect,y=n.filterKeylessWallet,A=n.enabledSasWalletInfos,I=n.onlyOneWallet,P=n.currentUserId,D=n.agreeEnableSas,U=u,!(!s||!i?.length)){pe.next=4;break}throw new Error("accountId or walletId not found in permission request data");case 4:if(V=o,V){pe.next=7;break}throw new Error("networkId not found in permission request data");case 7:return pe.next=9,vn.getWalletList();case 9:return J=pe.sent,re=pC(s,J),ce=Aee(i,J),Re=G3e(J,A||[]),pe.next=15,Promise.all([vn.selectAccount(s)]);case 15:if(De=[],!l?.length){pe.next=24;break}return pe.next=19,Promise.all(l.map(function(Se){return Fi.getNetworkByNetworkId(Se)}));case 19:Ue=pe.sent,De=(0,H.uniq)(Ue.filter(Boolean).map(function(Se){return Se.chainType})),U=De[0],pe.next=25;break;case 24:De=[U];case 25:return pe.next=27,vm.updateWebsiteRisk(e,a);case 27:return pe.next=29,Qt.upsert(e,{origin:e,permission:{accountIds:ce,networkIds:[V],currentWalletId:re?.id,currentNetworkId:V,supportedNetworkType:U,supportedNetworkTypeList:De,currentAccountId:s,networkIdForChainType:vt({},U,V),availableNetworkIds:l,isMultichainConnect:g,filterKeylessWallet:y,enabledSasWalletInfos:Re,onlyOneWallet:I,currentUserId:P,agreeEnableSas:D},createdAt:Date.now()});case 29:return pe.next=31,K(this,yh,R0).call(this);case 31:case"end":return pe.stop()}},r,this)})),Y7.apply(this,arguments)}function l5e(r,e){return X7.apply(this,arguments)}function X7(){return X7=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Qt.get(e);case 2:if(i=I.sent,i){I.next=5;break}return I.abrupt("return",K(this,x6,Z7).call(this,e,n));case 5:if(s=n.walletIds,o=n.accountId,a=n.supportedNetworkType,u=n.networkId,!(!o||!s?.length)){I.next=8;break}throw new Error("accountId or walletId not found in permission request data");case 8:return I.next=10,vn.getWalletList();case 10:return l=I.sent,g=pC(o,l),y=Aee(s,l),I.next=15,Promise.all([vn.selectAccount(o)]);case 15:return i.permission.accountIds=(0,H.uniq)((0,Li.A)(y).concat((0,Li.A)(i.permission.accountIds))),i.permission.currentAccountId=o,i.permission.currentWalletId=g?.id,K(this,G7,Kie).call(this,i,a,u),I.next=21,Qt.update(e,i);case 21:return I.next=23,K(this,yh,R0).call(this);case 23:case"end":return I.stop()}},r,this)})),X7.apply(this,arguments)}function Kie(r,e,n){return J7.apply(this,arguments)}function J7(){return J7=(0,k.A)(b().mark(function r(e,n,i){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return e.permission.supportedNetworkTypeList=(0,H.uniq)((0,Li.A)(Array.from(e.permission.supportedNetworkTypeList||[])).concat([e.permission.supportedNetworkType,n])),e.permission.supportedNetworkType=n,i&&(e.permission.networkIds=[i],e.permission.currentNetworkId=i,e.permission.networkIdForChainType=e.permission.networkIdForChainType||{},e.permission.networkIdForChainType[n]=i),o.abrupt("return",e);case 4:case"end":return o.stop()}},r)})),J7.apply(this,arguments)}function R0(){return Q7.apply(this,arguments)}function Q7(){return Q7=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Qt.toArray();case 2:return e=i.sent,i.next=5,zt.set($3e,e);case 5:case"end":return i.stop()}},r)})),Q7.apply(this,arguments)}function f5e(r){return eL.apply(this,arguments)}function eL(){return eL=(0,k.A)(b().mark(function r(e){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:case"end":return i.stop()}},r)})),eL.apply(this,arguments)}function d5e(r){return tL.apply(this,arguments)}function tL(){return tL=(0,k.A)(b().mark(function r(e){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:case"end":return i.stop()}},r)})),tL.apply(this,arguments)}function h5e(r){return rL.apply(this,arguments)}function rL(){return rL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:for(n=[],i=!0,s=!1,o=void 0,I.prev=2,a=e[Symbol.iterator]();!(i=(u=a.next()).done);i=!0)l=u.value,g=l.permission.enabledSasWalletInfos,g?.length&&(y=n).push.apply(y,(0,Li.A)(g));I.next=10;break;case 6:I.prev=6,I.t0=I.catch(2),s=!0,o=I.t0;case 10:I.prev=10,I.prev=11,!i&&a.return!=null&&a.return();case 13:if(I.prev=13,!s){I.next=16;break}throw o;case 16:return I.finish(13);case 17:return I.finish(10);case 18:if(!n.length){I.next=21;break}return I.next=21,F1.deleteProofKeysByWalletIds(n);case 21:case"end":return I.stop()}},r,null,[[2,6,10,18],[11,,13,17]])})),rL.apply(this,arguments)}function B6(r){return nL.apply(this,arguments)}function nL(){return nL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:if(e.length){ce.next=2;break}return ce.abrupt("return");case 2:return ce.next=4,K(this,Vie,h5e).call(this,e);case 4:return ce.next=6,Qt.table.bulkDelete(e.map(function(Re){return Re.origin}));case 6:return ce.next=8,K(this,yh,R0).call(this);case 8:n=[],i=!0,s=!1,o=void 0,ce.prev=10,a=e[Symbol.iterator]();case 12:if(i=(u=a.next()).done){ce.next=37;break}for(l=u.value,g=l.origin,y=l.permission,A=UC(y),y.isMultichainConnect&&n.push(js.emitCurrentConnectedWallets(g)),I=!0,P=!1,D=void 0,ce.prev=18,U=A[Symbol.iterator]();!(I=(V=U.next()).done);I=!0)J=V.value,n.push(R1.emitDisconnectMessage(g,J));ce.next=26;break;case 22:ce.prev=22,ce.t0=ce.catch(18),P=!0,D=ce.t0;case 26:ce.prev=26,ce.prev=27,!I&&U.return!=null&&U.return();case 29:if(ce.prev=29,!P){ce.next=32;break}throw D;case 32:return ce.finish(29);case 33:return ce.finish(26);case 34:i=!0,ce.next=12;break;case 37:ce.next=43;break;case 39:ce.prev=39,ce.t1=ce.catch(10),s=!0,o=ce.t1;case 43:ce.prev=43,ce.prev=44,!i&&a.return!=null&&a.return();case 46:if(ce.prev=46,!s){ce.next=49;break}throw o;case 49:return ce.finish(46);case 50:return ce.finish(43);case 51:return ce.next=53,Promise.all(n);case 53:case"end":return ce.stop()}},r,this,[[10,39,43,51],[18,22,26,34],[27,,29,33],[44,,46,50]])})),nL.apply(this,arguments)}function p5e(r){return iL.apply(this,arguments)}function iL(){return iL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,Qt.toArray();case 2:for(n=P.sent,i=[],s=!0,o=!1,a=void 0,P.prev=5,u=n[Symbol.iterator]();!(s=(l=u.next()).done);s=!0)g=l.value,y=g.origin,A=g.permission,e.includes(y)&&(A.isMultichainConnect&&i.push(js.emitCurrentConnectedWallets(y)),i.push(hs.emitCurrentConnectionInfoByOrigin(y,UC(A))));P.next=13;break;case 9:P.prev=9,P.t0=P.catch(5),o=!0,a=P.t0;case 13:P.prev=13,P.prev=14,!s&&u.return!=null&&u.return();case 16:if(P.prev=16,!o){P.next=19;break}throw a;case 19:return P.finish(16);case 20:return P.finish(13);case 21:return P.next=23,Promise.all(i);case 23:case"end":return P.stop()}},r,null,[[5,9,13,21],[14,,16,20]])})),iL.apply(this,arguments)}var qi=new u5e;_e("permission",{revokePermissionForOrigin:qi.revokePermissionForOrigin.bind(qi),revokeAll:qi.revokeAll.bind(qi),changeConnectedNetwork:qi.changeConnectedNetwork.bind(qi),changeConnectedWallet:qi.changeConnectedWallet.bind(qi),revokePermissionForWalletItem:qi.revokePermissionForWalletItem.bind(qi)});var g5e=function(r,e){return zm(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Mr({id:1,jsonrpc:"2.0"},e))}).then(function(n){return n.result})},y5e=new Nh(10*60*1e3),sL=new WeakMap,N2=new WeakMap,m5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;s=e.apply(this,arguments),s.name="customChainController",s.chainIsUnreachable={},de(F(s),sL,{writable:!0,value:{}}),de(F(s),N2,{writable:!0,value:{}});var o=F(s);return s.updateChainListItemMap=rf((0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.prev=0,y.next=3,hn.Network.getChainListChains(void 0);case 3:u=y.sent,l=(0,H.keyBy)(u,function(A){return A.chainId}),he(o,sL,l),y.next=11;break;case 8:y.prev=8,y.t0=y.catch(0),console.error(y.t0);case 11:case"end":return y.stop()}},a,null,[[0,8]])})),{cacheTime:10*60*1e3}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.initCustomChainChainId();case 2:wo.registerOnUiActiveEvent(function(){o.refreshCustomChainSecurity()});case 3:case"end":return l.stop()}},a)}))()},i.getChainIdByRpcUrl=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.prev=0,y.next=3,g5e(o,{method:"eth_chainId",params:[]});case 3:return u=y.sent,l=Number(u),y.abrupt("return",l);case 8:return y.prev=8,y.t0=y.catch(0),console.error(y.t0),y.abrupt("return",null);case 12:case"end":return y.stop()}},a,null,[[0,8]])}))()},i.getChainInfoByChainId=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,a.updateChainListItemMap(void 0);case 2:return g.abrupt("return",X(a,sL)[o]);case 3:case"end":return g.stop()}},u)}))()},i.addCustomChain=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return l=o.rpcUrl,g=o.chainId,y=o.name,A=o.nativeToken,I=o.blockExplorerUrl,re.next=3,a.assertNotBuiltInNetwork(g);case 3:return P=Pf(g),D={id:P,rpcUrl:l,isBuiltIn:!1,chainId:String(g),name:y,simpleName:y,nativeToken:A,nativeTokenDecimals:18,nativeTokenAddress:bC,chainType:nn.evm,addressRegex:"^(0x)[0-9A-Fa-f]{40}$",customTokenType:"erc20",isPopularNetwork:!1,blockExplorerUrl:I,createdAt:Date.now(),wcId:"eip155:".concat(g)},re.next=7,Vr.get(P);case 7:return U=re.sent,U&&delete D.createdAt,V=U&&U.rpcUrl!==l,re.next=12,Vr.upsert(P,D);case 12:if(!V){re.next=15;break}return re.next=15,a.onRpcUrlChanged(g,l);case 15:return re.next=17,cm.addCustomNetworkClient(g,l);case 17:return re.next=19,a.onCustomChainUpdated();case 19:return re.next=21,Da.addCustomChainNativeToken(D);case 21:return re.abrupt("return",P);case 22:case"end":return re.stop()}},u)}))()},i.assertNotBuiltInNetwork=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Fi.getNetworkByEVMChainId(o);case 2:if(u=g.sent,!u){g.next=5;break}throw Error("This network already exists as a built-in network.");case 5:case"end":return g.stop()}},a)}))()},i.onCustomChainUpdated=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,zt.get(Zp);case 2:return u=A.sent,l=new Set(u.filter(function(I){return I.chainType===nn.evm}).map(function(I){return I.wcId.replace("eip155:","")})),A.next=6,Vr.toArray();case 6:return g=A.sent,g=g.map(function(I){var P=X(o,N2)[I.rpcUrl],D=!!P&&P>=ou.Blacklist;return gn(Mr({},I),{unreachable:o.chainIsUnreachable[I.chainId],isRisky:D})}).filter(function(I){return!l.has(I.chainId)}),A.next=10,zt.set(ZE,(0,H.sortBy)(g,function(I){return-I.createdAt}));case 10:case"end":return A.stop()}},a)}))()},i.onRpcUrlChanged=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return D3e(o),delete u.chainIsUnreachable[o],y.next=4,u.updateRiskInfo([a]);case 4:case"end":return y.stop()}},l)}))()},i.markChainUnreachable=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(u.chainIsUnreachable[o]===a){y.next=4;break}return u.chainIsUnreachable[o]=a,y.next=4,u.onCustomChainUpdated();case 4:case"end":return y.stop()}},l)}))()},i.getCustomChainByChainId=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(ZE);case 2:return u=g.sent,g.abrupt("return",u.find(function(y){return y.chainId===String(o)}));case 4:case"end":return g.stop()}},a)}))()},i.getCustomChainList=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.get(ZE);case 2:return a=l.sent,l.abrupt("return",a);case 4:case"end":return l.stop()}},o)}))()},i.checkCurrentCustomChainRpcUrlRisk=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,o.getCustomChainList();case 3:return u=g.sent,g.next=6,o.updateRiskInfo(u.map(function(y){return y.rpcUrl}));case 6:g.next=11;break;case 8:g.prev=8,g.t0=g.catch(0),console.error(g.t0);case 11:case"end":return g.stop()}},a,null,[[0,8]])}))()},i.getCustomChainByNetworkId=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(ZE);case 2:return u=g.sent,g.abrupt("return",u.find(function(y){return y.id===o}));case 4:case"end":return g.stop()}},a)}))()},i.initCustomChainChainId=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,o.onCustomChainUpdated();case 2:return U.next=4,zt.get(ZE);case 4:u=U.sent,l=!0,g=!1,y=void 0,U.prev=6,A=u[Symbol.iterator]();case 8:if(l=(I=A.next()).done){U.next=15;break}return P=I.value,U.next=12,cm.addCustomNetworkClient(P.chainId,P.rpcUrl);case 12:l=!0,U.next=8;break;case 15:U.next=21;break;case 17:U.prev=17,U.t0=U.catch(6),g=!0,y=U.t0;case 21:U.prev=21,U.prev=22,!l&&A.return!=null&&A.return();case 24:if(U.prev=24,!g){U.next=27;break}throw y;case 27:return U.finish(24);case 28:return U.finish(21);case 29:case"end":return U.stop()}},a,null,[[6,17,21,29],[22,,24,28]])}))()},i.deleteCustomChain=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Vr.delete(o);case 2:return g.next=4,a.onCustomChainUpdated();case 4:return g.next=6,qi.revokePermissionForNetworkId(o);case 6:case"end":return g.stop()}},u)}))()},i.getRpcRiskInfo=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return u=xu(),y.next=3,hn.Security.commonCheck({businessName:"web3_wallet_custom_url_detection",params:{requestId:u,url:o}});case 3:return l=y.sent,y.abrupt("return",l.data);case 5:case"end":return y.stop()}},a)}))()},i.updateRiskInfo=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,hn.Security.batchCheck({businessName:"web3_wallet_custom_url_detection",paramList:o.map(function(U){return{requestId:xu(),url:U}})});case 2:for(l=D.sent,g={},y=0;y<l.data.length;++y)A=o[y],I=l.data[y],g[A]=I.riskLevel;return he(a,N2,Mr({},X(a,N2),g)),D.next=8,a.onCustomChainUpdated();case 8:case"end":return D.stop()}},u)}))()},i.refreshCustomChainSecurity=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,y5e.execute((0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",o.checkCurrentCustomChainRpcUrlRisk());case 1:case"end":return A.stop()}},g)})));case 2:case"end":return l.stop()}},a)}))()},i.checkRpcStatusBeforeSelect=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return g=!1,P.prev=1,P.next=4,u.getChainIdByRpcUrl(o);case 4:y=P.sent,y===null&&(g=!0),P.next=11;break;case 8:P.prev=8,P.t0=P.catch(1),g=!0;case 11:if(!g){P.next=15;break}return P.next=14,u.markChainUnreachable(a,!0);case 14:return P.abrupt("return",{unreachable:!0,isRisky:!1});case 15:return P.next=17,u.markChainUnreachable(a,!1);case 17:return P.next=19,u.updateRiskInfo([o]);case 19:return A=!!X(u,N2)[o]&&X(u,N2)[o]>=ou.Blacklist,P.abrupt("return",{unreachable:!1,isRisky:A});case 21:case"end":return P.stop()}},l,null,[[1,8]])}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[wo,Fi]}}]),n}(Yr),vo=new m5e;_e("customChain",{getChainIdByRpcUrl:vo.getChainIdByRpcUrl.bind(vo),getChainInfoByChainId:vo.getChainInfoByChainId.bind(vo),addCustomChain:vo.addCustomChain.bind(vo),deleteCustomChain:vo.deleteCustomChain.bind(vo),getRpcRiskInfo:vo.getRpcRiskInfo.bind(vo),checkRpcStatusBeforeSelect:vo.checkRpcStatusBeforeSelect.bind(vo)}),globalThis.customChainController=vo;const b5e=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Gie=r=>{if(typeof r!="string")throw new TypeError("Invalid argument expected string");const e=r.match(b5e);if(!e)throw new Error(`Invalid argument not valid semver ('${r}' received)`);return e.shift(),e},qie=r=>r==="*"||r==="x"||r==="X",Zie=r=>{const e=parseInt(r,10);return isNaN(e)?r:e},v5e=(r,e)=>typeof r!=typeof e?[String(r),String(e)]:[r,e],w5e=(r,e)=>{if(qie(r)||qie(e))return 0;const[n,i]=v5e(Zie(r),Zie(e));return n>i?1:n<i?-1:0},Yie=(r,e)=>{for(let n=0;n<Math.max(r.length,e.length);n++){const i=w5e(r[n]||"0",e[n]||"0");if(i!==0)return i}return 0},M2=(r,e)=>{const n=Gie(r),i=Gie(e),s=n.pop(),o=i.pop(),a=Yie(n,i);return a!==0?a:s&&o?Yie(s.split("."),o.split(".")):s||o?s?-1:1:0};var A5e=function(r){var e=Nc();return M2(e,r)>=0},_5e=[$s.EVM_EOA,$s.SOL_2,$s.TRON,$s.SUI,$s.TON],E5e=function(r,e){var n,i=r.binanceChainId,s=e.defaultBinanceChainIds;if(s.includes(i)||i==="CT_607")return!0;if(r.status!=="ACTIVE")return!1;var o,a=(n=((o=r?.supportVersionList)!==null&&o!==void 0?o:[]).find(function(y){return y.clientType==="EXTENSION"}))===null||n===void 0?void 0:n.version;if(!a)return!1;var u=A5e(a);if(!u)return!1;var l=r.addressTypeList,g=l.find(function(y){return _5e.includes(y.addressType)&&y.derivationType==="SEED_PHRASE"});return!!g},T5e=function(r){return(0,H.isNumber)(r)?String(r):isNaN(Number(r))?r==="ton-1"?"CT_607":r:String(Number(r))},Xie=new WeakSet,S5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),Xie),s.name="network",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Promise.all([K(o,Xie,I5e).call(o)]);case 2:case"end":return l.stop()}},a)}))()},i.selectNetwork=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.set(gC,o);case 2:if(!za(o)){l.next=5;break}return l.next=5,Da.refreshBalance({});case 5:case"end":return l.stop()}},a)}))()},i.getCurrentSelectedNetworkId=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",zt.get(gC));case 1:case"end":return u.stop()}},o)}))()},i.getCurrentSelectedNetwork=function(){return(0,k.A)(b().mark(function o(){var a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(Zp);case 2:return a=y.sent,y.next=5,zt.get(gC);case 5:return u=y.sent,l=a.find(function(A){return A.id===u}),y.abrupt("return",l);case 8:case"end":return y.stop()}},o)}))()},i.getNetworkListByChainType=function(o){var a=o.chainType,u=o.includeCustomChain,l=u===void 0?!1:u;return(0,k.A)(b().mark(function g(){var y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,zt.get(Zp);case 2:if(y=D.sent,A=y.filter(function(U){return U.chainType===a}),!(a===nn.evm&&l)){D.next=11;break}return D.next=7,vo.getCustomChainList();case 7:return I=D.sent,D.abrupt("return",A.concat(I));case 11:return D.abrupt("return",A);case 12:case"end":return D.stop()}},g)}))()},i.getNetworkByChainId=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(Zp);case 2:return u=y.sent,l=u.find(function(A){return A.binanceChainId===String(o)}),y.abrupt("return",l);case 5:case"end":return y.stop()}},a)}))()},i.getNetworkByEVMChainId=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(Zp);case 2:return u=y.sent,l=u.find(function(A){return A.binanceChainId===String(o)||A.wcId==="eip155:".concat(o)}),y.abrupt("return",l);case 5:case"end":return y.stop()}},a)}))()},i.getFullNetworkByEVMChainId=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return o=T5e(o),y.next=3,a.getNetworkByEVMChainId(o);case 3:if(l=y.sent,!l){y.next=6;break}return y.abrupt("return",l);case 6:return y.abrupt("return",vo.getCustomChainByChainId(o));case 7:case"end":return y.stop()}},u)}))()},i.getFullNetworkByNetworkId=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(l=za(o),!l){y.next=5;break}return y.abrupt("return",vo.getCustomChainByNetworkId(o));case 5:return y.abrupt("return",a.getNetworkByNetworkId(o));case 6:case"end":return y.stop()}},u)}))()},i.getNetworkList=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",zt.get(Zp));case 1:case"end":return u.stop()}},o)}))()},i.getNetworkByNetworkId=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(Zp);case 2:return u=y.sent,l=u.find(function(A){return A.id===o}),y.abrupt("return",l);case 5:case"end":return y.stop()}},a)}))()},i.onSelectedWalletAvailableNetworkChanged=function(o,a){return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:case"end":return g.stop()}},u)}))()},i.getNetworkTypeMap=function(){return(0,k.A)(b().mark(function o(){var a,u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,zt.get(Zp);case 2:for(a=U.sent,u={},l=!0,g=!1,y=void 0,U.prev=5,A=a[Symbol.iterator]();!(l=(I=A.next()).done);l=!0)P=I.value,u[P.id]=P.chainType;U.next=13;break;case 9:U.prev=9,U.t0=U.catch(5),g=!0,y=U.t0;case 13:U.prev=13,U.prev=14,!l&&A.return!=null&&A.return();case 16:if(U.prev=16,!g){U.next=19;break}throw y;case 19:return U.finish(16);case 20:return U.finish(13);case 21:return U.abrupt("return",u);case 22:case"end":return U.stop()}},o,null,[[5,9,13,21],[14,,16,20]])}))()},i.changeNetworkForSelectWalletIfNeeded=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return l=See(o),A.next=3,a.getCurrentSelectedNetwork();case 3:if(g=A.sent,!(!g||l.includes(g.chainType))){A.next=6;break}return A.abrupt("return");case 6:return A.next=8,a.selectNetwork(null);case 8:case"end":return A.stop()}},u)}))()},i.getDefaultIdForType=function(o){var a=_M[o];return no(a)},n}(Yr);function I5e(){return oL.apply(this,arguments)}function oL(){return oL=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.t0=ur,re.next=3,Promise.all([hn.Network.getNetworkList(),hn.Network.activeNetworkList()]);case 3:re.t1=re.sent,e=(0,re.t0)(re.t1,2),n=e[0],i=e[1],s=n.data,o=[],a=!0,u=!1,l=void 0,re.prev=10,g=s[Symbol.iterator]();case 12:if(a=(y=g.next()).done){re.next=22;break}if(A=y.value,I=E5e(A,i.data),I){re.next=17;break}return re.abrupt("continue",19);case 17:if(P={icon:mC(A.icon),isBuiltIn:!0,binanceChainId:A.binanceChainId,name:A.name,simpleName:A.simpleName,networkOnBinance:A.networkOnBinance,networkIdOnBinance:A.networkId,nativeToken:A.nativeToken,nativeTokenId:A.nativeTokenId,nativeTokenDecimals:A.nativeTokenDecimals,nativeTokenAddress:A.nativeTokenAddress,chainType:A.chainType,explorer:A.explorer,wcId:A.wcId,twIndex:A.twIndex,tier:A.tier,seq:A.seq,addressRegex:A.addressRegex,customTokenType:A.customTokenType,transactionType:A.transactionType,caseSensitive:A.caseSensitive,isPopularNetwork:AM.includes(A.binanceChainId)},P.chainType===nn.utxo)for(D=0,U=[$s.BTC_NATIVE_SEGWIT,$s.BTC_TAPROOT];D<U.length;D++)V=U[D],o.push(gn(Mr({},P),{addressType:V,id:no(A.binanceChainId,V)}));else o.push(gn(Mr({},P),{addressType:xSe(P.chainType)[0],id:no(A.binanceChainId)}));case 19:a=!0,re.next=12;break;case 22:re.next=28;break;case 24:re.prev=24,re.t2=re.catch(10),u=!0,l=re.t2;case 28:re.prev=28,re.prev=29,!a&&g.return!=null&&g.return();case 31:if(re.prev=31,!u){re.next=34;break}throw l;case 34:return re.finish(31);case 35:return re.finish(28);case 36:zt.set(Zp,o);case 37:case"end":return re.stop()}},r,null,[[10,24,28,36],[29,,31,35]])})),oL.apply(this,arguments)}var Fi=new S5e;_e("network",{selectNetwork:Fi.selectNetwork.bind(Fi)});var k5e={hasCompletedOnboarding:!1},aL=Nr(k5e,{persistKeys:["hasCompletedOnboarding"]}).hasCompletedOnboardingBgAtom,R5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="onboarding",s}var i=n.prototype;return i.completeOnboarding=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.set(aL,!0);case 2:return u.abrupt("return",!0);case 3:case"end":return u.stop()}},o)}))()},i.resetOnboarding=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.set(aL,!1);case 2:return u.next=4,Lm();case 4:return u.next=6,Fi.selectNetwork(null);case 6:return u.next=8,O2.subscribeExtensionStream();case 8:return u.abrupt("return",!0);case 9:case"end":return u.stop()}},o)}))()},i.checkHasCompletedOnboarding=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.get(aL);case 2:return a=l.sent,l.abrupt("return",a);case 4:case"end":return l.stop()}},o)}))()},n}(Yr),mh=new R5e;_e("onboarding",{completeOnboarding:mh.completeOnboarding.bind(mh)});var MT={EVM:"m/44'/60'/0'/0/{index}",SOL:"m/44'/501'/{index}'/0'",TRON:"m/44'/195'/0'/0/{index}",SUI:"m/44'/784'/{index}'/0'/0'",TON:"m/44'/607'/{index}'"},Jie=function(){var r=(0,k.A)(b().mark(function e(){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,ee.getItem("local:re_import_all_wallets");case 2:return n=s.sent,s.abrupt("return",!!n);case 4:case"end":return s.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),O6={syncAllWalletsIfNeeded:function(e){return(0,k.A)(b().mark(function n(){var i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,zt.get(Ul);case 2:if(i=I.sent,!i){I.next=5;break}return I.abrupt("return",e);case 5:s=(0,H.cloneDeep)(e),o=!0,a=!1,u=void 0,I.prev=7,l=e[Symbol.iterator]();case 9:if(o=(g=l.next()).done){I.next=22;break}return y=g.value,I.prev=11,I.next=14,B5e(y);case 14:I.next=19;break;case 16:I.prev=16,I.t0=I.catch(11),console.error(I.t0);case 19:o=!0,I.next=9;break;case 22:I.next=28;break;case 24:I.prev=24,I.t1=I.catch(7),a=!0,u=I.t1;case 28:I.prev=28,I.prev=29,!o&&l.return!=null&&l.return();case 31:if(I.prev=31,!a){I.next=34;break}throw u;case 34:return I.finish(31);case 35:return I.finish(28);case 36:return I.prev=36,I.next=39,O5e(e);case 39:I.next=44;break;case 41:I.prev=41,I.t2=I.catch(36),console.error(I.t2);case 44:if(!(0,H.isEqual)(s,e)){I.next=48;break}return I.abrupt("return",s);case 48:return I.abrupt("return",e);case 49:case"end":return I.stop()}},n,null,[[7,24,28,36],[11,16],[29,,31,35],[36,41]])}))()},syncDelWallet:function(e){return(0,k.A)(b().mark(function n(){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(i=e.id,s=e.metadata.keyring.type,s!==di.mpc){a.next=4;break}return a.abrupt("return");case 4:return a.next=6,hn.Wallet.importKeyWalletDelete({keyId:i,keyType:P6(s)});case 6:case"end":return a.stop()}},n)}))()}},C5e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(i=n.metadata.keyring.type,i===di.privateKey){a.next=3;break}return a.abrupt("return");case 3:if(s=n.accounts[0].addressList[0].network,s!==nn.evm){a.next=8;break}return a.abrupt("return","EVM");case 8:if(s!==nn.solana){a.next=12;break}return a.abrupt("return","Sol");case 12:if(s!==nn.tron){a.next=16;break}return a.abrupt("return","TRON");case 16:if(s!==nn.sui){a.next=20;break}return a.abrupt("return",cf.Move);case 20:if(s!==nn.ton){a.next=24;break}return a.abrupt("return",cf.Ton);case 24:throw Error("Unsupported network");case 25:case"end":return a.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),P6=function(r){if(r===di.hd)return"SEED_PHRASE";if(r===di.privateKey)return"PRIVATE_KEY";throw Error("Unsupported keyring type")},x5e=function(r,e){var n=function(i){return i.replaceAll("{index}",String(e))};if(r===nn.evm)return{derivationPath:n(MT.EVM),addressType:$s.EVM_EOA};if(r===nn.solana)return{derivationPath:n(MT.SOL),addressType:$s.SOL_2};if(r===nn.tron)return{derivationPath:n(MT.TRON),addressType:$s.TRON};if(r===nn.sui)return{derivationPath:n(MT.SUI),addressType:$s.SUI};if(r===nn.ton)return{derivationPath:n(MT.TON),addressType:$s.TON};throw Error("unsupported network type")};function B5e(r){return uL.apply(this,arguments)}function uL(){return uL=(0,k.A)(b().mark(function r(e){var n,i,s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return n=Date.now(),u.next=3,Jie();case 3:if(i=u.sent,s=e.metadata.lastSyncedAtV2,o=Zte(e),o){u.next=8;break}return u.abrupt("return");case 8:if(!(i||!s)){u.next=11;break}return u.next=11,M5e(e,o);case 11:case"end":return u.stop()}},r)})),uL.apply(this,arguments)}function O5e(r){return cL.apply(this,arguments)}function cL(){return cL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Jie();case 2:return n=I.sent,I.next=5,Nc();case 5:if(i=I.sent,s=Date.now(),o=e.filter(function(P){return P.metadata.keyring.type===di.privateKey}),a=e.filter(function(P){return P.metadata.keyring.type===di.hd}),u=function(P){if(n)return!0;var D=P.every(function(U){return U.accounts.every(function(V){return V.metadata.lastSyncedAt&&V.metadata.lastSyncedVersion&&M2(V.metadata.lastSyncedVersion,i)>=0})});return!D},l=function(){var P=(0,k.A)(b().mark(function D(U){var V,J,re,ce,Re,De,Ue;return b().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:V=(0,H.flatten)(U.map(function(Se){return Se.accounts})),J=!0,re=!1,ce=void 0,pe.prev=2,Re=V[Symbol.iterator]();case 4:if(J=(De=Re.next()).done){pe.next=12;break}return Ue=De.value,Ue.metadata.lastSyncedAt=s,pe.next=9,jt.update(Ue.id,{lastSyncedAt:s,lastSyncedVersion:i});case 9:J=!0,pe.next=4;break;case 12:pe.next=18;break;case 14:pe.prev=14,pe.t0=pe.catch(2),re=!0,ce=pe.t0;case 18:pe.prev=18,pe.prev=19,!J&&Re.return!=null&&Re.return();case 21:if(pe.prev=21,!re){pe.next=24;break}throw ce;case 24:return pe.finish(21);case 25:return pe.finish(18);case 26:case"end":return pe.stop()}},D,null,[[2,14,18,26],[19,,21,25]])}));return function(U){return P.apply(this,arguments)}}(),!u(o)){I.next=21;break}return I.t0=H.flatten,I.next=15,Promise.all(o.map(function(P){return P5e(P)}));case 15:return I.t1=I.sent,g=(0,I.t0)(I.t1),I.next=19,hn.Wallet.uploadPrivateKeyAddress({addressList:g});case 19:return I.next=21,l(o);case 21:if(!u(a)){I.next=31;break}return I.t2=H.flatten,I.next=25,Promise.all(a.map(function(P){return N5e(P)}));case 25:return I.t3=I.sent,y=(0,I.t2)(I.t3),I.next=29,hn.Wallet.uploadSeedPhraseKeyAddress({addressList:y});case 29:return I.next=31,l(a);case 31:case"end":return I.stop()}},r)})),cL.apply(this,arguments)}function P5e(r){return lL.apply(this,arguments)}function lL(){return lL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re;return b().wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:n=[],i=e.accounts,s=i[0].addressList,o=!0,a=!1,u=void 0,Ue.prev=4,l=s[Symbol.iterator]();case 6:if(o=(g=l.next()).done){Ue.next=32;break}return y=g.value,A=y.network,I=y.address,P=y.publicKeyHex,Ue.next=11,Fi.getNetworkListByChainType({chainType:A});case 11:for(D=Ue.sent,U=!0,V=!1,J=void 0,Ue.prev=13,re=D[Symbol.iterator]();!(U=(ce=re.next()).done);U=!0)Re=ce.value,n.push({keyId:e.id,address:I,publicKeyHex:Qie(P,Re),binanceChainId:Re.binanceChainId});Ue.next=21;break;case 17:Ue.prev=17,Ue.t0=Ue.catch(13),V=!0,J=Ue.t0;case 21:Ue.prev=21,Ue.prev=22,!U&&re.return!=null&&re.return();case 24:if(Ue.prev=24,!V){Ue.next=27;break}throw J;case 27:return Ue.finish(24);case 28:return Ue.finish(21);case 29:o=!0,Ue.next=6;break;case 32:Ue.next=38;break;case 34:Ue.prev=34,Ue.t1=Ue.catch(4),a=!0,u=Ue.t1;case 38:Ue.prev=38,Ue.prev=39,!o&&l.return!=null&&l.return();case 41:if(Ue.prev=41,!a){Ue.next=44;break}throw u;case 44:return Ue.finish(41);case 45:return Ue.finish(38);case 46:return Ue.abrupt("return",n);case 47:case"end":return Ue.stop()}},r,null,[[4,34,38,46],[13,17,21,29],[22,,24,28],[39,,41,45]])})),lL.apply(this,arguments)}function N5e(r){return fL.apply(this,arguments)}function fL(){return fL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e;return b().wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:n=[],i=e.accounts,s=!0,o=!1,a=void 0,nt.prev=3,u=i[Symbol.iterator]();case 5:if(s=(l=u.next()).done){nt.next=54;break}g=l.value,y=!0,A=!1,I=void 0,nt.prev=8,P=g.addressList[Symbol.iterator]();case 10:if(y=(D=P.next()).done){nt.next=37;break}return U=D.value,V=U.network,J=U.address,re=U.publicKeyHex,ce=U.derivationIndex,Re=x5e(V,ce),nt.next=16,Fi.getNetworkListByChainType({chainType:V});case 16:for(De=nt.sent,Ue=!0,Ve=!1,pe=void 0,nt.prev=18,Se=De[Symbol.iterator]();!(Ue=(Ce=Se.next()).done);Ue=!0)je=Ce.value,$e=Qie(re,je),n.push(Mr({keyId:e.id,address:J,publicKeyHex:$e,binanceChainId:je.binanceChainId,derivationIndex:ce,derivationType:"SEED_PHRASE"},Re));nt.next=26;break;case 22:nt.prev=22,nt.t0=nt.catch(18),Ve=!0,pe=nt.t0;case 26:nt.prev=26,nt.prev=27,!Ue&&Se.return!=null&&Se.return();case 29:if(nt.prev=29,!Ve){nt.next=32;break}throw pe;case 32:return nt.finish(29);case 33:return nt.finish(26);case 34:y=!0,nt.next=10;break;case 37:nt.next=43;break;case 39:nt.prev=39,nt.t1=nt.catch(8),A=!0,I=nt.t1;case 43:nt.prev=43,nt.prev=44,!y&&P.return!=null&&P.return();case 46:if(nt.prev=46,!A){nt.next=49;break}throw I;case 49:return nt.finish(46);case 50:return nt.finish(43);case 51:s=!0,nt.next=5;break;case 54:nt.next=60;break;case 56:nt.prev=56,nt.t2=nt.catch(3),o=!0,a=nt.t2;case 60:nt.prev=60,nt.prev=61,!s&&u.return!=null&&u.return();case 63:if(nt.prev=63,!o){nt.next=66;break}throw a;case 66:return nt.finish(63);case 67:return nt.finish(60);case 68:return nt.abrupt("return",n);case 69:case"end":return nt.stop()}},r,null,[[3,56,60,68],[8,39,43,51],[18,22,26,34],[27,,29,33],[44,,46,50],[61,,63,67]])})),fL.apply(this,arguments)}var Qie=function(r,e){return r&&(e.chainType===nn.evm?Ufe(r):r)};function ese(r){return dL.apply(this,arguments)}function dL(){return dL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:n=[],i=!0,s=!1,o=void 0,ce.prev=2,a=e[Symbol.iterator]();case 4:if(i=(u=a.next()).done){ce.next=30;break}return l=u.value,g=l.network,y=l.address,ce.next=9,Fi.getNetworkListByChainType({chainType:g});case 9:for(A=ce.sent,I=!0,P=!1,D=void 0,ce.prev=11,U=A[Symbol.iterator]();!(I=(V=U.next()).done);I=!0)J=V.value,n.push({address:y,binanceChainId:J.binanceChainId});ce.next=19;break;case 15:ce.prev=15,ce.t0=ce.catch(11),P=!0,D=ce.t0;case 19:ce.prev=19,ce.prev=20,!I&&U.return!=null&&U.return();case 22:if(ce.prev=22,!P){ce.next=25;break}throw D;case 25:return ce.finish(22);case 26:return ce.finish(19);case 27:i=!0,ce.next=4;break;case 30:ce.next=36;break;case 32:ce.prev=32,ce.t1=ce.catch(2),s=!0,o=ce.t1;case 36:ce.prev=36,ce.prev=37,!i&&a.return!=null&&a.return();case 39:if(ce.prev=39,!s){ce.next=42;break}throw o;case 42:return ce.finish(39);case 43:return ce.finish(36);case 44:return ce.abrupt("return",n);case 45:case"end":return ce.stop()}},r,null,[[2,32,36,44],[11,15,19,27],[20,,22,26],[37,,39,43]])})),dL.apply(this,arguments)}function M5e(r,e){return hL.apply(this,arguments)}function hL(){return hL=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return i=e.id,s=e.metadata.keyring.type,o=e.metadata.name,g.next=5,C5e(e);case 5:return a=g.sent,g.prev=6,g.next=9,hn.Wallet.importKeyWalletCreate({keyId:i,keyType:P6(s),publicKeyHex:n,walletName:o.slice(0,32),chainGroupName:a});case 9:g.next=18;break;case 11:if(g.prev=11,g.t0=g.catch(6),!g.t0.message.includes("Key id is duplicated")){g.next=17;break}g.next=18;break;case 17:throw g.t0;case 18:return u=Date.now(),g.next=21,Er.update(e.id,{lastSyncedAtV2:u});case 21:e.metadata.lastSyncedAtV2=u;case 22:case"end":return g.stop()}},r,null,[[6,11]])})),hL.apply(this,arguments)}var L5e=7*1e3;function D5e(r){return pL.apply(this,arguments)}function pL(){return pL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return n=e.walletItem,i=n.id,s=n.metadata.keyring.type,V.next=5,zt.set(Qy,[]);case 5:o=Date.now(),a=Date.now(),u=P6(s),l=See(n),g=kSe(l);case 10:if(!(a-o<=L5e)){V.next=30;break}return V.next=13,hn.Wallet.balanceScan({keyList:[{keyId:i,keyType:u}]});case 13:if(y=V.sent,A=y.data||[],I=A.find(function(J){return J.keyId===i}),!I?.isInitialized){V.next=18;break}return V.abrupt("return",!0);case 18:if(P=I?.chainInitializedMap,!(P&&g.length)){V.next=25;break}return D=tse(P,n),V.next=23,zt.set(Qy,D.map(function(J){return no(J)}));case 23:if(!g.every(function(J){return D.includes(J)})){V.next=25;break}return V.abrupt("return",!1);case 25:return V.next=27,tc(1*1e3);case 27:a=Date.now(),V.next=10;break;case 30:return V.next=32,zt.set(Qy,[]);case 32:return V.abrupt("return",!1);case 33:case"end":return V.stop()}},r)})),pL.apply(this,arguments)}var U5e=function(r){var e=r.walletItem,n=r.callback,i=e.id,s=e.metadata.keyring.type,o=P6(s),a=Date.now(),u=Date.now(),l=function(){var g=(0,k.A)(b().mark(function y(){var A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:A=[];case 1:if(!(u-a<=6e4)){re.next=24;break}return re.next=4,hn.Wallet.balanceScan({keyList:[{keyId:i,keyType:o}]});case 4:if(I=re.sent,P=I.data||[],D=P.find(function(ce){return ce.keyId===i}),!D?.isInitialized){re.next=11;break}return re.next=10,n({allDone:!0});case 10:return re.abrupt("return");case 11:if(U=D?.chainInitializedMap,!U){re.next=19;break}if(V=tse(U,e),V.sort(),(0,H.isEqual)(A,V)){re.next=19;break}return A=V,re.next=19,n({allDone:!1,importedChainIds:V});case 19:return re.next=21,tc(2e3);case 21:u=Date.now(),re.next=1;break;case 24:case"end":return re.stop()}},y)}));return function(){return g.apply(this,arguments)}}();l()},tse=function(r,e){var n=Object.keys(r),i=[],s=dh(e),o=!0,a=!1,u=void 0;try{for(var l=n[Symbol.iterator](),g;!(o=(g=l.next()).done);o=!0){var y=g.value;if(r[y]){var A=!0,I=!1,P=void 0;try{for(var D=s[Symbol.iterator](),U;!(A=(U=D.next()).done);A=!0){var V=U.value;if(y.includes(V)){var J=ur(y.split("_".concat(V,"_")),2),re=J[0],ce=J[1];if(ce){i.push(ce);break}}}}catch(Re){I=!0,P=Re}finally{try{!A&&D.return!=null&&D.return()}finally{if(I)throw P}}}}}catch(Re){a=!0,u=Re}finally{try{!o&&l.return!=null&&l.return()}finally{if(a)throw u}}return i},gL=new WeakSet,W1=new WeakSet,Rf=new WeakSet,rse=new WeakSet,yL=new WeakSet,nse=new WeakSet,ise=new WeakSet,sse=new WeakSet,ose=new WeakSet,ase=new WeakSet,N6=new WeakSet,F5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),gL),B(F(s),W1),B(F(s),Rf),B(F(s),rse),B(F(s),yL),B(F(s),nse),B(F(s),ise),B(F(s),sse),B(F(s),ose),B(F(s),ase),B(F(s),N6),s.name="wallet",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,ase,j5e).call(o);case 2:o.subscribe(Ul,function(){setTimeout(function(){K(o,Rf,pd).call(o)},0)});case 3:case"end":return l.stop()}},a)}))()},i.createNewVaultAndGenerateMnemonic=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,li.createNewVaultAndGenerateMnemonic(o);case 2:return l=y.sent,y.next=5,K(a,Rf,pd).call(a);case 5:return y.next=7,a.selectWallet(l);case 7:return y.next=9,mh.completeOnboarding();case 9:return y.next=11,Ii.updateDefaultExtraOpenToken();case 11:return y.abrupt("return",l);case 12:case"end":return y.stop()}},u)}))()},i.createNewVaultAndImportPrivateKeys=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,li.createNewVaultAndImportPrivateKeys(o,a,u);case 2:return y=I.sent,I.next=5,K(l,Rf,pd).call(l,{hasImportWallet:!0,importWalletId:y[0],importWalletType:di.privateKey});case 5:return I.next=7,l.selectWallet(y[0]);case 7:return I.next=9,mh.completeOnboarding();case 9:return I.next=11,Ii.updateDefaultExtraOpenToken();case 11:return I.abrupt("return",y);case 12:case"end":return I.stop()}},g)}))()},i.createNewVaultAndImportMnemonic=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.prev=0,A.next=3,li.createNewVaultAndImportMnemonic(o,a);case 3:return g=A.sent,A.next=6,K(u,Rf,pd).call(u,{hasImportWallet:!0,importWalletId:g,importWalletType:di.hd});case 6:return A.next=8,u.selectWallet(g);case 8:return A.next=10,mh.completeOnboarding();case 10:return A.next=12,Ii.updateDefaultExtraOpenToken();case 12:return A.abrupt("return",g);case 13:return A.prev=13,A.next=16,zt.set(Qy,[]);case 16:return A.finish(13);case 17:case"end":return A.stop()}},l,null,[[0,,13,17]])}))()},i.createNewVaultAndImportMPC=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.prev=0,A.next=3,li.createNewVaultAndImportMPC(o,a);case 3:return A.next=5,K(l,Rf,pd).call(l,{hasImportWallet:!0,skipWaitBalance:!0});case 5:return A.next=7,l.selectWallet(u);case 7:return A.next=9,mh.completeOnboarding();case 9:return A.next=11,Ii.updateDefaultExtraOpenToken();case 11:return A.abrupt("return",u);case 12:return A.prev=12,A.next=15,zt.set(Qy,[]);case 15:return A.finish(12);case 16:case"end":return A.stop()}},g,null,[[0,,12,16]])}))()},i.addNewAccountForWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,li.addNewAccountForWallet(o);case 2:return l=y.sent,y.next=5,K(a,Rf,pd).call(a);case 5:return y.abrupt("return",l);case 6:case"end":return y.stop()}},u)}))()},i.generateNewMnemonicWallet=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,li.generateNewMnemonicWallet();case 2:return u=g.sent,g.next=5,K(o,Rf,pd).call(o);case 5:return g.abrupt("return",u);case 6:case"end":return g.stop()}},a)}))()},i.importMnemonicWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.prev=0,D.next=3,li.peakMnemonicAddress(o);case 3:return l=D.sent,D.next=6,li.getDuplicateAddressWalletIds(l);case 6:if(g=D.sent,y=void 0,!g?.length){D.next=12;break}return D.next=11,a.getWalletItemByWalletId(g[0]);case 11:y=D.sent;case 12:return D.next=14,li.importMnemonicWallet(o);case 14:return A=D.sent,D.next=17,K(a,Rf,pd).call(a,{hasImportWallet:!0,importWalletId:A,importWalletType:di.hd});case 17:return D.next=19,a.selectWallet(A);case 19:if(!y){D.next=25;break}return D.next=22,a.getWalletItemByWalletId(A);case 22:return I=D.sent,D.next=25,qi.transferPermission(y,I);case 25:return D.abrupt("return",A);case 26:return D.prev=26,D.next=29,zt.set(Qy,[]);case 29:return D.finish(26);case 30:case"end":return D.stop()}},u,null,[[0,,26,30]])}))()},i.importPrivateKeyWallet=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.prev=0,A.next=3,li.importPrivateKeyWallet(o,a);case 3:return g=A.sent,A.next=6,K(u,Rf,pd).call(u,{hasImportWallet:!0,importWalletId:g,importWalletType:di.privateKey});case 6:return A.next=8,u.selectWallet(g);case 8:return A.abrupt("return",g);case 9:return A.prev=9,A.next=12,zt.set(Qy,[]);case 12:return A.finish(9);case 13:case"end":return A.stop()}},l,null,[[0,,9,13]])}))()},i.importMPCWallet=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.prev=0,y.next=3,li.importMPCKeyring(o);case 3:return y.next=5,K(u,Rf,pd).call(u,{hasImportWallet:!0,skipWaitBalance:!0});case 5:return y.abrupt("return",a);case 6:return y.prev=6,y.next=9,zt.set(Qy,[]);case 9:return y.finish(6);case 10:case"end":return y.stop()}},l,null,[[0,,6,10]])}))()},i.selectAccount=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,jt.get(o);case 2:if(l=I.sent,l){I.next=5;break}throw new Error("Account ".concat(o," metadata not found"));case 5:return I.next=7,a.getWalletItemByAccountId(o);case 7:if(g=I.sent,y=g?.id,y){I.next=11;break}throw new Error("Account ".concat(o," wallet not found"));case 11:return I.next=13,zt.set(v2,o);case 13:return I.next=15,zt.set(w2,y);case 15:return I.next=17,jt.update(o,{lastSelected:Date.now()});case 17:return I.next=19,Er.update(y,{lastSelected:Date.now()});case 19:return I.next=21,qi.changeAllConnectedWallet(g);case 21:case"end":return I.stop()}},u)}))()},i.reOrderWalletList=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:l=0,g=0;case 2:if(!(g<o.length)){ce.next=10;break}return y=o[g],ce.next=6,Er.update(y.id,{order:g+1});case 6:y.metadata.keyring.type===di.mpc&&(l=g+1);case 7:g++,ce.next=2;break;case 10:if(!l){ce.next=36;break}A=li.getAllMpcKeyrings(),I=!0,P=!1,D=void 0,ce.prev=13,U=A[Symbol.iterator]();case 15:if(I=(V=U.next()).done){ce.next=22;break}return J=V.value,ce.next=19,Er.update(J.walletId,{order:l});case 19:I=!0,ce.next=15;break;case 22:ce.next=28;break;case 24:ce.prev=24,ce.t0=ce.catch(13),P=!0,D=ce.t0;case 28:ce.prev=28,ce.prev=29,!I&&U.return!=null&&U.return();case 31:if(ce.prev=31,!P){ce.next=34;break}throw D;case 34:return ce.finish(31);case 35:return ce.finish(28);case 36:return ce.next=38,K(a,W1,L2).call(a);case 38:case"end":return ce.stop()}},u,null,[[13,24,28,36],[29,,31,35]])}))()},i.selectWallet=function(o){return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(o){A.next=6;break}return A.next=3,zt.set(v2,null);case 3:return A.next=5,zt.set(w2,null);case 5:return A.abrupt("return");case 6:return A.next=8,zt.get(Ku);case 8:if(u=A.sent,l=u.find(function(I){return I.id===o}),l){A.next=12;break}throw new Error("Wallet ".concat(o," not found"));case 12:if(l.accounts.length){A.next=14;break}throw new Error("Wallet ".concat(o," has no account"));case 14:return A.next=16,Ls();case 16:if(g=A.sent,!g){A.next=22;break}return A.next=20,zt.set(v2,null);case 20:A.next=24;break;case 22:return A.next=24,zt.set(v2,l.accounts[0].id);case 24:return A.next=26,zt.set(w2,o);case 26:return A.next=28,Fi.changeNetworkForSelectWalletIfNeeded(l);case 28:return A.next=30,Er.update(o,{lastSelected:Date.now()});case 30:return A.next=32,qi.changeAllConnectedWallet(l);case 32:case"end":return A.stop()}},a)}))()},i.changeAccountName=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(!(a.length>20)){J.next=2;break}throw new Error("Wallet name should be less than 20 characters");case 2:return J.next=4,u.getWalletItemByAccountId(o);case 4:if(g=J.sent,g){J.next=7;break}throw new Error("Account ".concat(o," wallet not found"));case 7:y=!0,A=!1,I=void 0,J.prev=8,P=g.accounts[Symbol.iterator]();case 10:if(y=(D=P.next()).done){J.next=17;break}if(U=D.value,!(U.metadata.name===a&&U.id!==o)){J.next=14;break}throw new Error("The account name already exists");case 14:y=!0,J.next=10;break;case 17:J.next=23;break;case 19:J.prev=19,J.t0=J.catch(8),A=!0,I=J.t0;case 23:J.prev=23,J.prev=24,!y&&P.return!=null&&P.return();case 26:if(J.prev=26,!A){J.next=29;break}throw I;case 29:return J.finish(26);case 30:return J.finish(23);case 31:return J.next=33,jt.update(o,{name:a,nameLastUpdatedAt:Date.now()});case 33:return J.next=35,K(u,W1,L2).call(u);case 35:case"end":return J.stop()}},l,null,[[8,19,23,31],[24,,26,30]])}))()},i.changeWalletName=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(!(a.length>20)){I.next=2;break}throw new Error("Wallet name should be less than 20 characters");case 2:if(u?.skipDuplicate){I.next=8;break}return I.next=5,K(l,gL,use).call(l,a,o);case 5:if(y=I.sent,!y){I.next=8;break}throw new Error("The wallet name already exists");case 8:return I.next=10,Er.update(o,{name:a,nameLastUpdatedAt:Date.now()});case 10:return I.next=12,K(l,W1,L2).call(l);case 12:case"end":return I.stop()}},g)}))()},i.verifyWalletMnemonicBackup=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Er.get(o);case 2:if(g=I.sent,g){I.next=5;break}throw new Error("Wallet ".concat(o," metadata not found"));case 5:return I.next=7,li.verifyWalletMnemonic(o,a);case 7:if(y=I.sent,!y){I.next=16;break}return I.next=11,Er.upsert(o,gn(Mr({},g),{lastBackedUpAt:Date.now()}));case 11:return I.next=13,K(u,W1,L2).call(u);case 13:return I.abrupt("return",!0);case 16:return I.abrupt("return",!1);case 17:case"end":return I.stop()}},l)}))()},i.getNextAvailableWalletName=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(l=o.type,l!==di.privateKey){A.next=8;break}return A.next=4,li.getPublicAddress(o.walletId,o.accounts[0],o.supportedNetworkAndAddressTypeList[0].networkType,o.supportedNetworkAndAddressTypeList[0].addressType);case 4:return g=A.sent,A.abrupt("return",_Se(g));case 8:if(!(l===di.hd||l===di.mpc)){A.next=12;break}return A.abrupt("return",a.getNextAvailableWalletNameForHDWallet());case 12:throw Error("Unsupported keyring type");case 13:case"end":return A.stop()}},u)}))()},i.getNextAvailableWalletNameForHDWallet=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:u="Wallet",l=1;case 2:if(!(l<=100)){I.next=12;break}return g=String(l).padStart(2,"0"),y="".concat(u," ").concat(g),I.next=7,K(o,gL,use).call(o,y);case 7:if(I.sent){I.next=9;break}return I.abrupt("return",y);case 9:++l,I.next=2;break;case 12:return I.abrupt("return","".concat(u," - ").concat(Pc()));case 13:case"end":return I.stop()}},a)}))()},i.removeWallet=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=3,u.getWalletItemByWalletId(a);case 3:return A=D.sent,D.next=6,qi.revokePermissionForWalletItem(A,null);case 6:return D.next=8,li.removeKeyring(o,a);case 8:if(I=D.sent.remainCount,(A==null||(g=A.metadata)===null||g===void 0||(y=g.keyring)===null||y===void 0?void 0:y.type)!==di.mpc){D.next=12;break}return D.next=12,Ci.onMPCWalletRemoved(a);case 12:return D.next=14,K(u,N6,kL).call(u,a);case 14:return D.next=16,K(u,Rf,pd).call(u);case 16:if(I!==0){D.next=21;break}return D.next=19,mh.resetOnboarding();case 19:return D.next=21,zt.set(Ku,[]);case 21:return D.abrupt("return",{remainCount:I});case 22:case"end":return D.stop()}},l)}))()},i.resetPassword=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,qi.revokeAll();case 2:return U.next=4,zt.get(Ku);case 4:return u=U.sent,U.next=7,li.resetPassword();case 7:l=!0,g=!1,y=void 0,U.prev=8,A=u[Symbol.iterator]();case 10:if(l=(I=A.next()).done){U.next=23;break}return P=I.value,U.prev=12,U.next=15,K(o,N6,kL).call(o,P.id);case 15:U.next=20;break;case 17:U.prev=17,U.t0=U.catch(12),console.error(U.t0);case 20:l=!0,U.next=10;break;case 23:U.next=29;break;case 25:U.prev=25,U.t1=U.catch(8),g=!0,y=U.t1;case 29:U.prev=29,U.prev=30,!l&&A.return!=null&&A.return();case 32:if(U.prev=32,!g){U.next=35;break}throw y;case 35:return U.finish(32);case 36:return U.finish(29);case 37:return U.prev=37,U.next=40,Ci.onAllMPCWalletRemoved();case 40:U.next=45;break;case 42:U.prev=42,U.t2=U.catch(37),console.error(U.t2);case 45:return U.next=47,zt.set(Ku,[]);case 47:return U.next=49,mh.resetOnboarding();case 49:return U.next=51,Er.table.clear();case 51:return U.next=53,jt.table.clear();case 53:case"end":return U.stop()}},a,null,[[8,25,29,37],[12,17],[30,,32,36],[37,42]])}))()},i.getCurrentSelectedWallet=function(){return(0,k.A)(b().mark(function o(){var a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(w2);case 2:if(a=y.sent,a){y.next=5;break}return y.abrupt("return",null);case 5:return y.next=7,zt.get(Ku);case 7:if(u=y.sent,l=u.find(function(A){return A.id===a}),l){y.next=11;break}return y.abrupt("return",null);case 11:return y.abrupt("return",l);case 12:case"end":return y.stop()}},o)}))()},i.getCurrentSelectedAccount=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,zt.get(v2);case 2:if(u=A.sent,u){A.next=5;break}return A.abrupt("return",null);case 5:return A.next=7,o.getCurrentSelectedWallet();case 7:if(l=A.sent,l){A.next=10;break}return A.abrupt("return",null);case 10:if(g=l.accounts.find(function(I){return I.id===u}),g){A.next=13;break}return A.abrupt("return",null);case 13:return A.abrupt("return",g);case 14:case"end":return A.stop()}},a)}))()},i.getWalletList=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.get(Ku);case 2:return a=l.sent,l.abrupt("return",a);case 4:case"end":return l.stop()}},o)}))()},i.getMpcWalletList=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.get(v1);case 2:return a=l.sent,l.abrupt("return",a);case 4:case"end":return l.stop()}},o)}))()},i.getWalletItemByWalletId=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(Ku);case 2:return u=g.sent,g.abrupt("return",u.find(function(y){return y.id===o}));case 4:case"end":return g.stop()}},a)}))()},i.getAddressByAccountId=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=3,u.getWalletItemByAccountId(o);case 3:if(y=D.sent,y){D.next=6;break}throw Error("Account ".concat(o," not found for wallet"));case 6:if(A=y.accounts.find(function(U){return U.id===o}),A){D.next=9;break}throw Error("Account ".concat(o," not found in wallet ").concat(y.id));case 9:if(I=(g=A.addressList.find(function(U){return U.network===a}))===null||g===void 0?void 0:g.address,I){D.next=12;break}throw Error("Address not found for account ".concat(o," on network ").concat(a));case 12:return D.abrupt("return",I);case 13:case"end":return D.stop()}},l)}))()},i.getWalletItemByAccountId=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(Ku);case 2:return u=g.sent,g.abrupt("return",pC(o,u));case 4:case"end":return g.stop()}},a)}))()},i.getDefaultWalletAddress=function(o){var a=o.walletId,u=o.supportedNetworkType,l=this;return(0,k.A)(b().mark(function g(){var y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(y=null,!a){P.next=7;break}return P.next=4,l.getWalletItemByWalletId(a);case 4:y=P.sent,P.next=10;break;case 7:return P.next=9,l.getCurrentSelectedWallet();case 9:y=P.sent;case 10:if(y){P.next=12;break}return P.abrupt("return",null);case 12:return A=dh(y,u)[0],P.abrupt("return",A??null);case 14:case"end":return P.stop()}},g)}))()},i.getMpcWallet=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.get(Ku);case 2:return a=l.sent,l.abrupt("return",a.find(function(g){return g.metadata.keyring.type===di.mpc}));case 4:case"end":return l.stop()}},o)}))()},i.getWalletItemByAddress=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,zt.get(Ku);case 2:return l=P.sent,P.next=5,Fi.getFullNetworkByNetworkId(a);case 5:if(g=P.sent,g){P.next=8;break}return P.abrupt("return",null);case 8:return y=Wl(o),A=l.find(function(D){var U=dh(D),V=!0,J=!1,re=void 0;try{for(var ce=U[Symbol.iterator](),Re;!(V=(Re=ce.next()).done);V=!0){var De=Re.value;if(y===Wl(De))return!0}}catch(Ue){J=!0,re=Ue}finally{try{!V&&ce.return!=null&&ce.return()}finally{if(J)throw re}}return!1}),P.abrupt("return",A||null);case 11:case"end":return P.stop()}},u)}))()},i.updateIcon=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Er.update(o,{walletIcon:a});case 2:return y.next=4,K(u,W1,L2).call(u);case 4:case"end":return y.stop()}},l)}))()},i.checkIsMpcAddress=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,u.getMpcWallet();case 2:if(g=J.sent,g){J.next=5;break}return J.abrupt("return",!1);case 5:y=!0,A=!1,I=void 0,J.prev=6,P=g.accounts[0].addressList[Symbol.iterator]();case 8:if(y=(D=P.next()).done){J.next=15;break}if(U=D.value,Wl(U.address)!==Wl(o)){J.next=12;break}return J.abrupt("return",!0);case 12:y=!0,J.next=8;break;case 15:J.next=21;break;case 17:J.prev=17,J.t0=J.catch(6),A=!0,I=J.t0;case 21:J.prev=21,J.prev=22,!y&&P.return!=null&&P.return();case 24:if(J.prev=24,!A){J.next=27;break}throw I;case 27:return J.finish(24);case 28:return J.finish(21);case 29:return J.abrupt("return",!1);case 30:case"end":return J.stop()}},l,null,[[6,17,21,29],[22,,24,28]])}))()},i.checkMnemonicAddressRisk=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,li.peakMnemonicAddress(o);case 2:return u=I.sent,I.next=5,ese(u);case 5:return l=I.sent,I.next=8,hn.Wallet.addressRiskCheck({addressChainIds:l});case 8:return g=I.sent,y=g.data,I.abrupt("return",y.filter(function(P){return P.isRisk}).map(function(P){return no(P.binanceChainId)}));case 11:case"end":return I.stop()}},a)}))()},i.splitWalletIdsToQueryArg=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,a.getWalletList();case 2:return l=V.sent,g=TSe(o,l),y=g.filter(function(J){return J.metadata.keyring.type===di.mpc}),A=y.map(function(J){return J.id}),I=o.filter(function(J){return!A.includes(J)}),P=A.length?A.join(","):void 0,D=I.length?I.join(","):void 0,V.abrupt("return",{mpcWalletIds:P,walletIds:D});case 10:case"end":return V.stop()}},u)}))()},i.checkPrivateKeyAddressRisk=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,li.peakPrivateKeyAddress(o,a);case 2:return l=P.sent,P.next=5,ese([l]);case 5:return g=P.sent,P.next=8,hn.Wallet.addressRiskCheck({addressChainIds:g});case 8:return y=P.sent,A=y.data,P.abrupt("return",A.filter(function(D){return D.isRisk}).map(function(D){return no(D.binanceChainId)}));case 11:case"end":return P.stop()}},u)}))()},i.onMetaChange=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,W1,L2).call(o);case 2:case"end":return l.stop()}},a)}))()},i.fakeImport=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(!Si){V.next=2;break}return V.abrupt("return");case 2:return u=o.address,l=o.publicKeyHex,g=o.chainType,V.next=5,zt.get(Ku);case 5:return y=V.sent,A=Fm(),I=ef(),V.next=10,jt.upsert(I,{name:"AccountForDebug",importTime:Date.now()});case 10:return P={name:"WalletForDebug",importTime:Date.now(),keyring:{type:di.privateKey},lastBackedUpAt:Date.now()},V.next=13,Er.upsert(A,P);case 13:return y.push({id:A,metadata:P,accounts:[{id:I,metadata:{name:"AccountForDebug",importTime:Date.now()},addressList:[{network:g,address:u,publicKeyHex:l}]}]}),D=Array.from(y),V.next=17,O6.syncAllWalletsIfNeeded(D);case 17:return V.next=19,zt.set(Ku,D);case 19:case"end":return V.stop()}},a)}))()},i.getAllExitsMpcMetas=function(){return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return a=li.getAllMpcKeyrings().map(function(y){return y.walletId}),g.next=3,Promise.all(a.map(function(y){return Er.get(y)}));case 3:return u=g.sent,g.abrupt("return",u.filter(function(y){return!!y}));case 5:case"end":return g.stop()}},o)}))()},i.clearRemovedOldWalletItem=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.set(see,null);case 2:case"end":return u.stop()}},o)}))()},i.onWalletsChanged=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,K(a,Rf,pd).call(a,o);case 2:case"end":return g.stop()}},u)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[Fi]}}]),n}(Yr);function use(r,e){return mL.apply(this,arguments)}function mL(){return mL=(0,k.A)(b().mark(function r(e,n){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,zt.get(Ku);case 2:if(i=a.sent,s=i.find(function(u){return u.metadata.keyring.type!==di.mpc&&u.metadata.name===e}),s){a.next=6;break}return a.abrupt("return",!1);case 6:if(!(n&&s.id===n)){a.next=8;break}return a.abrupt("return",!1);case 8:return a.abrupt("return",!0);case 9:case"end":return a.stop()}},r)})),mL.apply(this,arguments)}function L2(){return bL.apply(this,arguments)}function bL(){return bL=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=zt.get(_1),i.next=3,K(this,yL,cse).call(this,e);case 3:case"end":return i.stop()}},r,this)})),bL.apply(this,arguments)}function pd(){return vL.apply(this,arguments)}function vL(){return vL=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A=arguments;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return e=A.length>0&&A[0]!==void 0?A[0]:{},n=e?.hasImportWallet,s=(i=e?.skipWaitBalance)!==null&&i!==void 0?i:!1,o=e.importWalletId,a=e.importWalletType,u=zt.get(_1),P.next=8,K(this,rse,W5e).call(this,u);case 8:if(!(n&&!s&&o&&a)){P.next=22;break}return P.next=11,this.getWalletItemByWalletId(o);case 11:if(l=P.sent,!l){P.next=20;break}return P.t0=ur,P.next=16,Promise.all([D5e({walletItem:l}),H1.fetchDefiList()]);case 16:P.t1=P.sent,g=(0,P.t0)(P.t1,1),y=g[0],y||U5e({walletItem:l,callback:(0,k.A)(b().mark(function D(){return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Ii.refreshToken();case 2:return V.next=4,tc(2*1e3);case 4:case"end":return V.stop()}},D)}))});case 20:P.next=25;break;case 22:if(!(n&&s)){P.next=25;break}return P.next=25,H1.fetchDefiList({noRefresh:!0});case 25:return P.next=27,ta.refreshApproveCount();case 27:return P.next=29,Ii.refreshToken();case 29:return P.next=31,H1.fetchDefiList({noRefresh:!0});case 31:case"end":return P.stop()}},r,this)})),vL.apply(this,arguments)}function W5e(r){return wL.apply(this,arguments)}function wL(){return wL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se;return b().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:if(e.length){je.next=2;break}return je.abrupt("return");case 2:return je.next=4,Er.toMap();case 4:return n=je.sent,je.next=7,jt.toMap();case 7:if(i=je.sent,s=e.filter(function($e){return!n[$e.walletId]}),o=Array.from(TD),!o.length){je.next=36;break}TD.clear(),a=!0,u=!1,l=void 0,je.prev=13,g=o[Symbol.iterator]();case 15:if(a=(y=g.next()).done){je.next=22;break}return A=y.value,je.next=19,K(this,N6,kL).call(this,A);case 19:a=!0,je.next=15;break;case 22:je.next=28;break;case 24:je.prev=24,je.t0=je.catch(13),u=!0,l=je.t0;case 28:je.prev=28,je.prev=29,!a&&g.return!=null&&g.return();case 31:if(je.prev=31,!u){je.next=34;break}throw l;case 34:return je.finish(31);case 35:return je.finish(28);case 36:I=!0,P=!1,D=void 0,je.prev=37,U=s[Symbol.iterator]();case 39:if(I=(V=U.next()).done){je.next=46;break}return J=V.value,je.next=43,K(this,ise,z5e).call(this,J);case 43:I=!0,je.next=39;break;case 46:je.next=52;break;case 48:je.prev=48,je.t1=je.catch(37),P=!0,D=je.t1;case 52:je.prev=52,je.prev=53,!I&&U.return!=null&&U.return();case 55:if(je.prev=55,!P){je.next=58;break}throw D;case 58:return je.finish(55);case 59:return je.finish(52);case 60:re=!0,ce=!1,Re=void 0,je.prev=61,De=e[Symbol.iterator]();case 63:if(re=(Ue=De.next()).done){je.next=73;break}if(Ve=Ue.value,pe=Ve.accounts,Se=pe.filter(function($e){return!i[$e]}),!(Se.length>0)){je.next=70;break}return je.next=70,K(this,sse,$5e).call(this,Ve,Se);case 70:re=!0,je.next=63;break;case 73:je.next=79;break;case 75:je.prev=75,je.t2=je.catch(61),ce=!0,Re=je.t2;case 79:je.prev=79,je.prev=80,!re&&De.return!=null&&De.return();case 82:if(je.prev=82,!ce){je.next=85;break}throw Re;case 85:return je.finish(82);case 86:return je.finish(79);case 87:return je.next=89,K(this,yL,cse).call(this,e);case 89:case"end":return je.stop()}},r,this,[[13,24,28,36],[29,,31,35],[37,48,52,60],[53,,55,59],[61,75,79,87],[80,,82,86]])})),wL.apply(this,arguments)}function cse(r){return AL.apply(this,arguments)}function AL(){return AL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=this,l.next=3,Promise.all(e.map(function(g){return K(n,nse,H5e).call(n,g)}));case 3:return i=l.sent,l.next=6,K(this,ose,V5e).call(this,i);case 6:return s=l.sent,l.next=9,zt.get(Fl);case 9:return o=l.sent,l.prev=10,l.next=13,O6.syncAllWalletsIfNeeded(s);case 13:s=l.sent,l.next=19;break;case 16:l.prev=16,l.t0=l.catch(10),console.error(l.t0);case 19:return a=s.filter(function(g){return g.metadata.keyring.type!==di.mpc||!o?!0:g.id===o}),l.next=22,zt.set(Ku,a);case 22:case"end":return l.stop()}},r,this,[[10,16]])})),AL.apply(this,arguments)}function H5e(r){return _L.apply(this,arguments)}function _L(){return _L=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return n=e.walletId,A.next=3,jt.toMap();case 3:return i=A.sent,A.next=6,Er.toMap();case 6:return s=A.sent,A.next=9,li.getAddressListForWallet(n);case 9:return o=A.sent,A.next=12,Promise.all(o.map(function(){var I=(0,k.A)(b().mark(function P(D){var U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return U=D.accountId,V=D.addressList,re.abrupt("return",{id:U,addressList:V,metadata:i[U]});case 2:case"end":return re.stop()}},P)}));return function(P){return I.apply(this,arguments)}}()));case 12:return a=A.sent,A.next=15,Ls();case 15:if(u=A.sent,l=a,u||(l=a.slice(0,1)),g=s[n],g){A.next=21;break}throw new Error("Wallet ".concat(n," metadata not found"));case 21:return A.abrupt("return",{id:n,accounts:l,metadata:g});case 22:case"end":return A.stop()}},r)})),_L.apply(this,arguments)}function z5e(r){return EL.apply(this,arguments)}function EL(){return EL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return n=e.walletId,i=e.type,A.next=3,this.getNextAvailableWalletName(e);case 3:if(s=A.sent,o=Date.now(),a={name:s,importTime:o,keyring:{type:i},lastBackedUpAt:o},i!==di.mpc){A.next=14;break}return A.next=9,this.getAllExitsMpcMetas();case 9:u=A.sent,l=(0,H.min)(u.map(function(I){return I.importTime})),g=(0,H.min)(u.map(function(I){return I.order||0})),g&&(a.order=g),l&&(a.importTime=l);case 14:return V1.has(n)&&(a.lastBackedUpAt=o),A.next=17,Er.upsert(n,a);case 17:case"end":return A.stop()}},r,this)})),EL.apply(this,arguments)}function $5e(r,e){return TL.apply(this,arguments)}function TL(){return TL=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re;return b().wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:i=e.accounts,s=new Set,o=!0,a=!1,u=void 0,Ue.prev=3,l=i[Symbol.iterator]();case 5:if(o=(g=l.next()).done){Ue.next=14;break}return y=g.value,Ue.next=9,jt.get(y);case 9:A=Ue.sent,A&&s.add(A.name);case 11:o=!0,Ue.next=5;break;case 14:Ue.next=20;break;case 16:Ue.prev=16,Ue.t0=Ue.catch(3),a=!0,u=Ue.t0;case 20:Ue.prev=20,Ue.prev=21,!o&&l.return!=null&&l.return();case 23:if(Ue.prev=23,!a){Ue.next=26;break}throw u;case 26:return Ue.finish(23);case 27:return Ue.finish(20);case 28:I=function(){for(var Ve=1;Ve<1e3;++Ve){var pe=String(Ve).padStart(2,"0"),Se="Account ".concat(pe);if(!s.has(Se))return Se}return"Account - ".concat(Pc())},P=!0,D=!1,U=void 0,Ue.prev=30,V=n[Symbol.iterator]();case 32:if(P=(J=V.next()).done){Ue.next=41;break}return re=J.value,ce=I(),Re={name:ce,importTime:Date.now()},Ue.next=38,jt.upsert(re,Re);case 38:P=!0,Ue.next=32;break;case 41:Ue.next=47;break;case 43:Ue.prev=43,Ue.t1=Ue.catch(30),D=!0,U=Ue.t1;case 47:Ue.prev=47,Ue.prev=48,!P&&V.return!=null&&V.return();case 50:if(Ue.prev=50,!D){Ue.next=53;break}throw U;case 53:return Ue.finish(50);case 54:return Ue.finish(47);case 55:case"end":return Ue.stop()}},r,null,[[3,16,20,28],[21,,23,27],[30,43,47,55],[48,,50,54]])})),TL.apply(this,arguments)}function V5e(r){return SL.apply(this,arguments)}function SL(){return SL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:for(n=9999,e.sort(function(A,I){return A.metadata.order===I.metadata.order?A.metadata.importTime-I.metadata.importTime:(A.metadata.order||n)-(I.metadata.order||n)}),i=!0,s=!1,o=void 0,y.prev=3,a=e[Symbol.iterator]();!(i=(u=a.next()).done);i=!0)l=u.value,l.accounts.sort(function(A,I){return A.metadata.order===I.metadata.order?A.metadata.importTime-I.metadata.importTime:(A.metadata.order||n)-(I.metadata.order||n)});y.next=11;break;case 7:y.prev=7,y.t0=y.catch(3),s=!0,o=y.t0;case 11:y.prev=11,y.prev=12,!i&&a.return!=null&&a.return();case 14:if(y.prev=14,!s){y.next=17;break}throw o;case 17:return y.finish(14);case 18:return y.finish(11);case 19:return y.abrupt("return",structuredClone(e));case 20:case"end":return y.stop()}},r,null,[[3,7,11,19],[12,,14,18]])})),SL.apply(this,arguments)}function j5e(){return IL.apply(this,arguments)}function IL(){return IL=(0,k.A)(b().mark(function r(){var e,n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,zt.get(Ku);case 2:return e=s.sent,s.prev=3,s.next=6,O6.syncAllWalletsIfNeeded(e);case 6:if(n=s.sent,n===e){s.next=10;break}return s.next=10,zt.set(Ku,n);case 10:s.next=15;break;case 12:s.prev=12,s.t0=s.catch(3),console.error(s.t0);case 15:case"end":return s.stop()}},r,null,[[3,12]])})),IL.apply(this,arguments)}function kL(r){return RL.apply(this,arguments)}function RL(){return RL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(Ku);case 2:if(n=g.sent,i=n.find(function(y){return y.id===e}),!i){g.next=25;break}return g.next=7,zt.get(w2);case 7:if(s=g.sent,s!==e){g.next=13;break}if(o=n.find(function(y){return y.id!==e}),!o){g.next=13;break}return g.next=13,this.selectWallet(o.id);case 13:return a=i.accounts,u=a.map(function(y){return y.id}),g.next=17,jt.table.bulkDelete(u);case 17:return g.prev=17,g.next=20,O6.syncDelWallet(i);case 20:g.next=25;break;case 22:g.prev=22,g.t0=g.catch(17),console.error(g.t0);case 25:return g.next=27,Er.delete(e);case 27:case"end":return g.stop()}},r,this,[[17,22]])})),RL.apply(this,arguments)}var vn=new F5e;_e("wallet",{selectAccount:vn.selectAccount.bind(vn),reOrderWalletList:vn.reOrderWalletList.bind(vn),selectWallet:vn.selectWallet.bind(vn),changeAccountName:vn.changeAccountName.bind(vn),changeWalletName:vn.changeWalletName.bind(vn),verifyWalletMnemonicBackup:vn.verifyWalletMnemonicBackup.bind(vn),removeWallet:vn.removeWallet.bind(vn),getNextAvailableWalletNameForHDWallet:vn.getNextAvailableWalletNameForHDWallet.bind(vn),createNewVaultAndGenerateMnemonic:vn.createNewVaultAndGenerateMnemonic.bind(vn),createNewVaultAndImportMnemonic:vn.createNewVaultAndImportMnemonic.bind(vn),createNewVaultAndImportPrivateKeys:vn.createNewVaultAndImportPrivateKeys.bind(vn),addNewAccountForWallet:vn.addNewAccountForWallet.bind(vn),generateNewMnemonicWallet:vn.generateNewMnemonicWallet.bind(vn),importMnemonicWallet:vn.importMnemonicWallet.bind(vn),importPrivateKeyWallet:vn.importPrivateKeyWallet.bind(vn),resetPassword:vn.resetPassword.bind(vn),checkMnemonicAddressRisk:vn.checkMnemonicAddressRisk.bind(vn),checkPrivateKeyAddressRisk:vn.checkPrivateKeyAddressRisk.bind(vn),updateIcon:vn.updateIcon.bind(vn),getWalletList:vn.getWalletList.bind(vn),getMpcWalletList:vn.getMpcWalletList.bind(vn),clearRemovedOldWalletItem:vn.clearRemovedOldWalletItem.bind(vn)});var K5e=30*1e3,CL=new WeakMap,M6=new WeakMap,G5e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="defi",de(F(s),CL,{writable:!0,value:2}),de(F(s),M6,{writable:!0,value:!1}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.fetchDefiList({fetchAll:!0});case 2:O2.registerEvent("DEFI_CHANGE_EVENT",function(){o.fetchDefiList({fetchAll:!0})});case 3:case"end":return l.stop()}},a)}))()},i.fetchDefiList=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.fetchAll,u=a===void 0?!1:a,l=o.noRefresh,g=l===void 0?!1:l,y=this;return(0,k.A)(b().mark(function A(){var I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn;return b().wrap(function(Xr){for(;;)switch(Xr.prev=Xr.next){case 0:if(!X(y,M6)){Xr.next=3;break}return console.warn("[DefiController] DeFi fetch already in progress, skipping"),Xr.abrupt("return");case 3:return he(y,M6,!0),Xr.prev=4,Xr.next=7,vn.getWalletList();case 7:if(I=Xr.sent,console.log("[DefiController] wallet list",I),I.length!==0){Xr.next=12;break}return console.warn("[DefiController] No wallets found, skipping DeFi fetch"),Xr.abrupt("return");case 12:if(!u){Xr.next=17;break}P=I.map(function(Tn){return Tn.id}),Xr.next=24;break;case 17:return Xr.next=19,vn.getCurrentSelectedWallet();case 19:if(D=Xr.sent,D){Xr.next=23;break}return console.warn("[DefiController] No current wallet selected, skipping DeFi fetch"),Xr.abrupt("return");case 23:P=[D.id];case 24:return U=Date.now(),console.log("[DefiController] Starting DeFi fetch for ".concat(P.length," wallet(s)")),Xr.next=28,Ci.checkMpcWalletActive();case 28:return V=Xr.sent,Xr.next=31,A1({input:P,chunkSize:1,fn:function(){var Tn=(0,k.A)(b().mark(function Bn(ni){var en,si,ei,Ia,wi,ho,Zo,qa,ya,Fa,Xu,_h;return b().wrap(function(xs){for(;;)switch(xs.prev=xs.next){case 0:en=[],si=!0,ei=!1,Ia=void 0,xs.prev=2,wi=ni[Symbol.iterator]();case 4:if(si=(ho=wi.next()).done){xs.next=34;break}return Zo=ho.value,xs.next=8,vn.getWalletItemByWalletId(Zo);case 8:if(qa=xs.sent,ya=qa?.metadata.keyring.type===di.mpc,Fa=null,!(ya&&!V)){xs.next=14;break}return console.log("[DefiController] Skipping logged out MPC wallet: ".concat(Zo)),xs.abrupt("continue",31);case 14:Xu=1;case 15:if(!(Xu<=X(y,CL))){xs.next=30;break}return xs.prev=16,xs.next=19,wee((0,k.A)(b().mark(function Fn(){return b().wrap(function(Pm){for(;;)switch(Pm.prev=Pm.next){case 0:return Pm.next=2,hn.Defi.getDefiPositionListWithKeyIds({walletIds:ya?void 0:[Zo],mpcKeyId:ya?Zo:void 0,noRefresh:g});case 2:return Pm.abrupt("return",Pm.sent);case 3:case"end":return Pm.stop()}},Fn)})),K5e);case 19:return _h=xs.sent,Fa=_h.data,xs.abrupt("break",30);case 24:xs.prev=24,xs.t0=xs.catch(16),Xu===X(y,CL)&&console.error("[DefiController] Failed to fetch defi for wallet ".concat(Zo," after ").concat(Xu," attempts:"),xs.t0);case 27:Xu++,xs.next=15;break;case 30:Fa&&en.push({walletId:Zo,data:Fa});case 31:si=!0,xs.next=4;break;case 34:xs.next=40;break;case 36:xs.prev=36,xs.t1=xs.catch(2),ei=!0,Ia=xs.t1;case 40:xs.prev=40,xs.prev=41,!si&&wi.return!=null&&wi.return();case 43:if(xs.prev=43,!ei){xs.next=46;break}throw Ia;case 46:return xs.finish(43);case 47:return xs.finish(40);case 48:return xs.abrupt("return",en);case 49:case"end":return xs.stop()}},Bn,null,[[2,36,40,48],[16,24],[41,,43,47]])}));return function(Bn){return Tn.apply(this,arguments)}}(),merge:function(Tn){return Tn.flat()},callInSequence:!0});case 31:return J=Xr.sent,console.log("[DefiController] DeFi fetch completed for ".concat(J.length,"/").concat(P.length," wallet(s) in ").concat(Date.now()-U,"ms")),Xr.next=35,zt.get(hC);case 35:for(re=Xr.sent,ce=new Map(re),Re=new Set(I.filter(function(Tn){return!(Tn.metadata.keyring.type===di.mpc&&!V)}).map(function(Tn){return Tn.id})),De=!0,Ue=!1,Ve=void 0,Xr.prev=39,pe=ce.keys()[Symbol.iterator]();!(De=(Se=pe.next()).done);De=!0)Ce=Se.value,Re.has(Ce)||(console.log("[DefiController] Removing DeFi data for deleted or logged out wallet: ".concat(Ce)),ce.delete(Ce));Xr.next=47;break;case 43:Xr.prev=43,Xr.t0=Xr.catch(39),Ue=!0,Ve=Xr.t0;case 47:Xr.prev=47,Xr.prev=48,!De&&pe.return!=null&&pe.return();case 50:if(Xr.prev=50,!Ue){Xr.next=53;break}throw Ve;case 53:return Xr.finish(50);case 54:return Xr.finish(47);case 55:for(je=!0,$e=!1,Qe=void 0,Xr.prev=56,nt=J[Symbol.iterator]();!(je=(Ne=nt.next()).done);je=!0)Me=Ne.value,ct=Me.walletId,mt=Me.data,ce.set(ct,mt.deFiProtocolVOList);Xr.next=64;break;case 60:Xr.prev=60,Xr.t1=Xr.catch(56),$e=!0,Qe=Xr.t1;case 64:Xr.prev=64,Xr.prev=65,!je&&nt.return!=null&&nt.return();case 67:if(Xr.prev=67,!$e){Xr.next=70;break}throw Qe;case 70:return Xr.finish(67);case 71:return Xr.finish(64);case 72:return Xr.next=74,zt.set(hC,ce);case 74:return Bt=Array.from(ce.values()).flat(),Xr.next=77,zt.set(mee,Bt);case 77:for(er=new ti(0),cr=!0,pr=!1,Dr=void 0,Xr.prev=79,Rr=ce.values()[Symbol.iterator]();!(cr=(Pr=Rr.next()).done);cr=!0)on=Pr.value,xn=on.reduce(function(Tn,Bn){return Tn.plus(Bn.protocolTotalValue||0)},new ti(0)),er=er.plus(xn);Xr.next=87;break;case 83:Xr.prev=83,Xr.t2=Xr.catch(79),pr=!0,Dr=Xr.t2;case 87:Xr.prev=87,Xr.prev=88,!cr&&Rr.return!=null&&Rr.return();case 90:if(Xr.prev=90,!pr){Xr.next=93;break}throw Dr;case 93:return Xr.finish(90);case 94:return Xr.finish(87);case 95:return Xr.next=97,zt.set(bee,er.toString());case 97:Xr.next=102;break;case 99:Xr.prev=99,Xr.t3=Xr.catch(4),console.error("[DefiController] fetchDefiList error:",Xr.t3);case 102:return Xr.prev=102,he(y,M6,!1),Xr.finish(102);case 105:case"end":return Xr.stop()}},A,null,[[4,99,102,105],[39,43,47,55],[48,,50,54],[56,60,64,72],[65,,67,71],[79,83,87,95],[88,,90,94]])}))()},i.clearMpcWalletCache=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe;return b().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return u=Array.isArray(o)?o:[o],Ce.next=3,zt.get(hC);case 3:for(l=Ce.sent,g=new Map(l),y=!0,A=!1,I=void 0,Ce.prev=6,P=u[Symbol.iterator]();!(y=(D=P.next()).done);y=!0)U=D.value,g.has(U)&&g.delete(U);Ce.next=14;break;case 10:Ce.prev=10,Ce.t0=Ce.catch(6),A=!0,I=Ce.t0;case 14:Ce.prev=14,Ce.prev=15,!y&&P.return!=null&&P.return();case 17:if(Ce.prev=17,!A){Ce.next=20;break}throw I;case 20:return Ce.finish(17);case 21:return Ce.finish(14);case 22:return Ce.next=24,zt.set(hC,g);case 24:return V=Array.from(g.values()).flat(),Ce.next=27,zt.set(mee,V);case 27:for(J=new ti(0),re=!0,ce=!1,Re=void 0,Ce.prev=29,De=g.values()[Symbol.iterator]();!(re=(Ue=De.next()).done);re=!0)Ve=Ue.value,pe=Ve.reduce(function(je,$e){return je.plus($e.protocolTotalValue||0)},new ti(0)),J=J.plus(pe);Ce.next=37;break;case 33:Ce.prev=33,Ce.t1=Ce.catch(29),ce=!0,Re=Ce.t1;case 37:Ce.prev=37,Ce.prev=38,!re&&De.return!=null&&De.return();case 40:if(Ce.prev=40,!ce){Ce.next=43;break}throw Re;case 43:return Ce.finish(40);case 44:return Ce.finish(37);case 45:return Ce.next=47,zt.set(bee,J.toString());case 47:case"end":return Ce.stop()}},a,null,[[6,10,14,22],[15,,17,21],[29,33,37,45],[38,,40,44]])}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[O2]}}]),n}(Yr),H1=new G5e,q5e=function(r){var e=r.wcResult,n=r.signType,i=r.isBroadcast,s=r.networkType;if(s===nn.solana)return JSON.parse(e);if(s===nn.sui){var o=JSON.parse(e),a=o.signature,u=o.transactionBytes;return{signature:a,transaction:u}}if(s===nn.tron&&n===Hs.SendTransaction&&i){var l=JSON.parse(e).txid;return{txHash:l}}return n===Hs.SignMessage?{signature:e}:i?{txHash:e}:{transaction:e}},Z5e=function(r,e){var n={_pt:Y5e("publicKeyHex=".concat(e))};return hA(r,n)};function Y5e(r){var e=mke(r);return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var X5e=tn(36533).Buffer,J5e=function(r,e){var n=b2.PrivateKey.fromHex(r),i=(0,b2.decrypt)(n.secret,yf(e)),s=X5e.from(i).toString(),o=JSON.parse(s);return gn(Mr({},o),{userAccessKey:eBe(o.userAccessKey)})},Q5e=function(){var r=new b2.PrivateKey;return{privateKey:r.toHex(),publicKey:r.publicKey.toHex(!0)}},eBe=function(r){return{publicKey:XM(r.publicKey),privateKey:XM(r.privateKey).slice(0,64)}};function xL(r){if(r===nn.solana||r===nn.sui||r===nn.ton)return"eddsa";if(r==nn.evm||r===nn.tron)return"ecdsa";throw Error("Unsupported network type")}function tBe(r){var e=xL(r);return e==="ecdsa"?"secp256k1":"ed25519"}var rBe=function(r){var e=ys(r);return e.slice(0,4)+e.slice(e.length-4,e.length)};function z1(r,e){return BL.apply(this,arguments)}function BL(){return BL=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return i=mo(du(n)),s=JSON.stringify(e),o=iBe(s),y.next=5,nBe(o);case 5:return a=y.sent,u=Ba.sign(a,i),l=ys(Jo(u)),y.abrupt("return",l);case 9:case"end":return y.stop()}},r)})),BL.apply(this,arguments)}function nBe(r){return OL.apply(this,arguments)}function OL(){return OL=(0,k.A)(b().mark(function r(e){var n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n=new TextEncoder().encode(e),a.next=3,crypto.subtle.digest("SHA-256",n);case 3:return i=a.sent,s=Jo(new Uint8Array(i)),a.abrupt("return",ys(s));case 6:case"end":return a.stop()}},r)})),OL.apply(this,arguments)}function iBe(r){var e=JSON.parse(r),n={};Object.keys(e).sort().forEach(function(s){n[s]=e[s]});var i=JSON.stringify(n);return i}var PL=tn(36533).Buffer;function sBe(r){return NL.apply(this,arguments)}function NL(){return NL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return n=e.keyShareData,i=n.keyDataId,s=n.publicKey,o=n.userAccessKey,a=0,u={keyDataId:i,publicKeyHex:s,userAccessKeyHex:o.publicKey,signnodeIndex:a},A.next=6,z1(u,o.privateKey);case 6:return l=A.sent,A.next=9,hn.MPCWallet.preSignList({keyDataId:i,publicKeyHex:s,userAccessKeyHex:o.publicKey,signnodeIndex:a,signatureHex:l});case 9:return g=A.sent,A.abrupt("return",g.data.preSignatures);case 11:case"end":return A.stop()}},r)})),NL.apply(this,arguments)}function Rrt(r){return ML.apply(this,arguments)}function ML(){return ML=_async_to_generator(regeneratorRuntime.mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De;return regeneratorRuntime.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return n=e.keyShareData,i=e.message,s=e.partyId,o=e.presignResult,a=e.algorithm,u=e.clientAddress,l=e.extensionMpcOrderId,g=e.signType,y={algorithm:a,keyDataId:n.keyDataId,message:i,presignatureId:o?.preSignSessionId,publicKeyHex:n.publicKey,userAccessKeyHex:n.userAccessKey.publicKey},Ve.next=4,getSignature(y,n.userAccessKey.privateKey);case 4:if(A=Ve.sent,I=getMpcSignExtraCtx(l),P=I?.isCustomNetwork,D=I?.isSwapSign,!D){Ve.next=14;break}return Ve.next=11,API.Swap.sign({quoteId:l,publicKeyHex:y.publicKeyHex,algorithm:y.algorithm,keyDataId:y.keyDataId,userAccessKeyHex:y.userAccessKeyHex,signatureHex:A,presignatureId:o?.preSignSessionId,dataHex:i,threshold:1,clientPartyIds:[s],clientAddresses:[u]});case 11:return U=Ve.sent,V=U.data,J=V.sessionId,re=V.peerAddresses,ce=V.peerPartyIds,Ve.abrupt("return",{sessionID:J,peerAddresses:re,peerPartyIDs:ce});case 14:return Re=P?API.MPCWallet.customNetworkSign:API.MPCWallet.sign,Ve.next=17,Re({sessionId:generateRandomId(),publicKeyHex:y.publicKeyHex,algorithm:y.algorithm,keyDataId:y.keyDataId,clientAddress:u,userAccessKeyHex:y.userAccessKeyHex,signatureHex:A,presignatureId:o?.preSignSessionId,message:i,threshold:1,clientPartyID:s,extensionMpcOrderId:l,type:g});case 17:return De=Ve.sent,Ve.abrupt("return",De.data);case 19:case"end":return Ve.stop()}},r)})),ML.apply(this,arguments)}function oBe(r){return LL.apply(this,arguments)}function LL(){return LL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return n=e.keyShareData,i=e.message,s=e.partyId,o=e.presignResult,a=e.extensionMpcOrderId,u=e.signType,l=lse(n.keyData),g=n.userAccessKey.publicKey,y=String(Math.floor(Date.now()/1e3)),A={data:[{dataHex:i,presignatureId:o.preSignSessionId}],keyDataId:n.keyDataId,clientParticipants:[{partyId:s,shareId:l}],publicKeyHex:n.publicKey,userAccessKeyHex:g,timestamp:y},De.next=7,z1(A,n.userAccessKey.privateKey);case 7:if(I=De.sent,P=Ike(a),D=P?.isCustomNetwork,U=P?.isSwapSign,V=0,!U){De.next=17;break}return De.next=15,hn.Swap.batchSign(gn(Mr({},A),{quoteId:a,signatureHex:I,userAccessKeyHex:g,signnodeIndex:V,network:n.algorithm}));case 15:return J=De.sent,De.abrupt("return",J.data.resultList[0]);case 17:return re=D?hn.MPCWallet.customNetworkBatchSign:hn.MPCWallet.batchSign,De.next=20,re(gn(Mr({},A),{extensionMpcOrderId:a,type:u,signatureHex:I,userAccessKeyHex:g,signnodeIndex:V,network:n.algorithm}));case 20:return ce=De.sent,De.abrupt("return",ce.data.resultList[0]);case 22:case"end":return De.stop()}},r)})),LL.apply(this,arguments)}function aBe(r){var e=XM(r.signature_recovery),n=(0,S_.concatSig)(PL.from(bl(BigInt(e)+BigInt(27))),PL.from(yf(r.r)),PL.from(yf(r.s)));if(r.signType==="message")return n;var i=n.slice(0,n.length-2)+"0"+String(Number(e));return i}function lse(r){var e=yf(D2(r)),n=bke(e),i=n.match(/"ShareID"\s*:\s*(\d+)/);if(!i)throw new Error("ShareID field not found in keyData JSON");return i[1]}function D2(r){r=r.replaceAll(`
|
||
`,"");var e=r.length%4;return e===2?r+"==":e===3?r+"=":r}var $l=tn(38660),uBe=10*60*1e3,fse=new Map,cBe=function(r){var e=r.expiredAt-Date.now();return e>=uBe},lBe=function(r){return parseInt(r)*1e3},fBe=function(){"use strict";function r(){(0,G.A)(this,r)}return r.exchange=function(n){return(0,k.A)(b().mark(function i(){var s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(s=n.keyDataId,o=fse.get(s),!(o&&cBe(o))){y.next=5;break}return console.debug("[MpcSignKeyExchanger] Cache hit for keyDataId:",s),y.abrupt("return",o.result);case 5:return console.debug("[MpcSignKeyExchanger] Cache miss, calling API for keyDataId:",s),y.next=8,r.doKeyExchange(n);case 8:return a=y.sent,u=a.result,l=a.expiredAt,fse.set(s,{result:u,expiredAt:l}),y.abrupt("return",u);case 13:case"end":return y.stop()}},i)}))()},r.doKeyExchange=function(n){return(0,k.A)(b().mark(function i(){var s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return s=tf(32),o=n.userAccessKey,a=n.keyData,u=n.keyDataId,l=n.publicKey,Ve.next=4,$L();case 4:return g=Ve.sent,y=0,A=new $l.g_,I=A.publicKey(),P=ys(Jo(I)),D=lse(a),U={sessionId:s,publicKeyHex:l,keyDataId:u,signnodeIndex:y,ecdhPublicKeyHex:P,timestamp:String(Math.floor(Date.now()/1e3))},Ve.next=13,z1(U,o.privateKey);case 13:return V=Ve.sent,Ve.next=16,hn.MPCWallet.asyncKeyExchange(gn(Mr({},U),{signatureHex:V}));case 16:return J=Ve.sent,re=J.data.content.ecdhPublicKeyHex,ce=J.data.content.shareId,Re=J.data.content.expiredAt,De=A.ecdh(mo(re)),console.debug("[MpcSignKeyExchanger] keyExchange done",Date.now()),Ve.abrupt("return",{result:{serverShareId:ce,sharedSecret:De,clientShareId:D,selfPartyId:g,signnodeIndex:y,exchanger:A},expiredAt:lBe(Re)});case 23:case"end":return Ve.stop()}},i)}))()},r}(),dBe=function(){"use strict";function r(){(0,G.A)(this,r)}var e=r.prototype;return e.doPresignStart=function(i){return(0,k.A)(b().mark(function s(){var o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne;return b().wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return o=i.keyShareData,a=i.keyExchangeResult,u=i.config,l=i.partyManager,g=i.sessionId,y=o.userAccessKey,A=o.keyData,I=o.keyDataId,P=o.publicKey,D=o.curve,U=a.serverShareId,V=a.sharedSecret,J=a.clientShareId,re=a.selfPartyId,ce=a.signnodeIndex,Re=[re,"signnode"],De=[J,U],Ue=yf(D2(A)),console.log("[AsyncPresigner]: doPresignStart",Date.now(),{sessionId:g,selfPartyId:re}),ct.next=9,l.ecdsaAsyncPresign(re,"secp256k1",Ue,1,Re,De,g,null,[],null);case 9:if(Ve=ct.sent,console.log("[AsyncPresigner]: doPresignStart",Date.now(),"done",{sessionId:g,selfPartyId:re}),!(Ve.type!=="need_more_messages"||!Ve.outputMessages)){ct.next=13;break}throw new Error("Unexpected result from ".concat(u.algorithmPrefix,"AsyncPresign step 1: ").concat(Ve.type));case 13:return pe=Ve.outputMessages.map(function(mt){return ys(Jo((0,$l.Xq)(mt,V)))}),Se={sessionId:g,algorithm:u.algorithm,network:u.network,publicKeyHex:P,keyDataId:I,signnodeIndex:ce,clientParticipants:[{partyId:re,shareId:J}],timestamp:String(Math.floor(Date.now()/1e3))},ct.next=17,z1(Se,y.privateKey);case 17:return Ce=ct.sent,ct.next=20,hn.MPCWallet.asyncPresignStart(gn(Mr({},Se),{encryptedOutputHexes:pe,userAccessKeyHex:y.publicKey,signatureHex:Ce}));case 20:return je=ct.sent,console.debug("[AsyncPresigner]:".concat(u.algorithmPrefix,"AsyncPresign presign/start done"),Date.now()),$e=je.data.outputs.flatMap(function(mt){return mt.encryptedOutputHexes.map(function(Bt){return(0,$l.HK)(mo(Bt),V)})}),Qe=$e.slice(0,2),nt=$e.slice(2),ct.next=27,l.ecdsaAsyncPresign(re,"secp256k1",Ue,1,Re,De,g,null,Qe,null);case 27:if(Ne=ct.sent,!(Ne.type!=="intermediate"||!Ne.dumpData)){ct.next=30;break}throw new Error("Unexpected result from ".concat(u.algorithmPrefix,"AsyncPresign step 2: ").concat(Ne.type));case 30:return i.tracker.track("start_done"),ct.abrupt("return",{dumpData:Ne.dumpData,serverOutputsForProgress:nt});case 32:case"end":return ct.stop()}},s)}))()},e.doPresignProgress=function(i,s){return(0,k.A)(b().mark(function o(){var a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt;return b().wrap(function(er){for(;;)switch(er.prev=er.next){case 0:return a=i.keyShareData,u=i.keyExchangeResult,l=i.config,g=i.partyManager,y=i.sessionId,A=i.tracker,I=a.userAccessKey,P=a.keyData,D=u.serverShareId,U=u.sharedSecret,V=u.clientShareId,J=u.selfPartyId,re=u.signnodeIndex,ce=[J,"signnode"],Re=[V,D],De=yf(D2(P)),console.log("[AsyncPresigner:doPresignProgress] Round 2 Step 1",{sessionId:y}),er.next=9,g.ecdsaAsyncPresign(J,"secp256k1",De,1,ce,Re,y,null,[],s.dumpData);case 9:if(Ue=er.sent,!(Ue.type==="final"&&Ue.presignData)){er.next=12;break}return er.abrupt("return",{presignData:Ue.presignData});case 12:if(!(Ue.type!=="need_more_messages"||!Ue.outputMessages)){er.next=14;break}throw new Error("Unexpected result from Round 2 Step 1: ".concat(Ue.type));case 14:return Ve=Ue.outputMessages,console.log("[AsyncPresigner:doPresignProgress] Round 2 Step 2",{sessionId:y,s2Count:s.serverOutputsForProgress.length}),er.next=18,g.ecdsaAsyncPresign(J,"secp256k1",De,1,ce,Re,y,null,s.serverOutputsForProgress,null);case 18:if(pe=er.sent,!(pe.type==="final"&&pe.presignData)){er.next=21;break}return er.abrupt("return",{presignData:pe.presignData});case 21:if(Se=pe.dumpData||Ue.dumpData,Se){er.next=24;break}throw new Error("Round 2 did not produce dumpData for Round 3");case 24:return console.log("[AsyncPresigner:doPresignProgress] Round 3 Step 1",{sessionId:y}),er.next=27,g.ecdsaAsyncPresign(J,"secp256k1",De,1,ce,Re,y,null,[],Se);case 27:if(Ce=er.sent,!(Ce.type==="final"&&Ce.presignData)){er.next=30;break}return er.abrupt("return",{presignData:Ce.presignData});case 30:if(!(Ce.type!=="need_more_messages"||!Ce.outputMessages)){er.next=32;break}throw new Error("Unexpected result from Round 3 Step 1: ".concat(Ce.type));case 32:return je=Ce.outputMessages,$e=(0,Li.A)(Ve).concat((0,Li.A)(je)),console.log("[AsyncPresigner:doPresignProgress] Sending outputs to progress API",{sessionId:y,c2Count:Ve.length,c3Count:je.length,totalCount:$e.length}),Qe=$e.map(function(cr){return ys(Jo((0,$l.Xq)(cr,U)))}),nt={sessionId:y,network:l.network,signnodeIndex:re,timestamp:String(Math.floor(Date.now()/1e3))},er.next=39,z1(nt,I.privateKey);case 39:return Ne=er.sent,er.next=42,hn.MPCWallet.asyncPresignProgress(gn(Mr({},nt),{encryptedOutputHexes:Qe,userAccessKeyHex:I.publicKey,signatureHex:Ne}));case 42:return Me=er.sent,console.debug("[AsyncPresigner]:".concat(l.algorithmPrefix,"AsyncPresign presign/progress done"),Date.now()),ct=Me.data.outputs.flatMap(function(cr){return cr.encryptedOutputHexes.map(function(pr){return(0,$l.HK)(mo(pr),U)})}),console.log("[AsyncPresigner:doPresignProgress] Final step, feeding S3",{sessionId:y,s3Count:ct.length}),er.next=48,g.ecdsaAsyncPresign(J,"secp256k1",De,1,ce,Re,y,null,ct,null);case 48:if(mt=er.sent,!(mt.type!=="final"||!mt.presignData)){er.next=51;break}throw new Error("Unexpected result from final step: ".concat(mt.type));case 51:return A.track("progress_done"),er.abrupt("return",{presignData:mt.presignData});case 53:case"end":return er.stop()}},o)}))()},r}(),hBe=function(){"use strict";function r(){(0,G.A)(this,r)}var e=r.prototype;return e.doPresignStart=function(i){return(0,k.A)(b().mark(function s(){var o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt;return b().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return a=i.keyShareData,u=i.keyExchangeResult,l=i.config,g=i.partyManager,y=i.sessionId,A=a.userAccessKey,I=a.keyData,P=a.keyDataId,D=a.publicKey,U=a.curve,V=u.serverShareId,J=u.sharedSecret,re=u.clientShareId,ce=u.selfPartyId,Re=u.signnodeIndex,De=[ce,"signnode"],Ue=[re,V],Ve=yf(D2(I)),console.log("[AsyncPresigner]: frost doPresignStart",Date.now(),{sessionId:y,selfPartyId:ce}),Me.next=10,g.frostAsyncPresign(ce,Ve,1,De,Ue,y,null,"ed25519",[],null);case 10:if(pe=Me.sent,console.log("[AsyncPresigner]: frost doPresignStart result1",Date.now(),{sessionId:y,selfPartyId:ce,type:pe.type,outputCount:(o=pe.outputMessages)===null||o===void 0?void 0:o.length}),!(pe.type!=="need_more_messages"||!pe.outputMessages)){Me.next=14;break}throw new Error("Unexpected result from ".concat(l.algorithmPrefix,"AsyncPresign step 1: ").concat(pe.type));case 14:return Se=pe.outputMessages.map(function(ct){return ys(Jo((0,$l.Xq)(ct,J)))}),Ce={sessionId:y,algorithm:l.algorithm,network:l.network,publicKeyHex:D,keyDataId:P,signnodeIndex:Re,clientParticipants:[{partyId:ce,shareId:re}],timestamp:String(Math.floor(Date.now()/1e3))},Me.next=18,z1(Ce,A.privateKey);case 18:return je=Me.sent,Me.next=21,hn.MPCWallet.asyncPresignStart(gn(Mr({},Ce),{encryptedOutputHexes:Se,userAccessKeyHex:A.publicKey,signatureHex:je}));case 21:return $e=Me.sent,console.debug("[AsyncPresigner]:".concat(l.algorithmPrefix,"AsyncPresign presign/start done"),Date.now()),Qe=$e.data.outputs.flatMap(function(ct){return ct.encryptedOutputHexes.map(function(mt){return(0,$l.HK)(mo(mt),J)})}),console.log("[AsyncPresigner]: frost received S1",{sessionId:y,s1Count:Qe.length}),Me.next=27,g.frostAsyncPresign(ce,Ve,1,De,Ue,y,null,"ed25519",Qe,null);case 27:if(nt=Me.sent,!(nt.type!=="intermediate"||!nt.dumpData)){Me.next=30;break}throw new Error("Unexpected result from ".concat(l.algorithmPrefix,"AsyncPresign step 2: ").concat(nt.type));case 30:return i.tracker.track("start_done"),Me.abrupt("return",{dumpData:nt.dumpData,serverOutputsForProgress:[]});case 32:case"end":return Me.stop()}},s)}))()},e.doPresignProgress=function(i,s){return(0,k.A)(b().mark(function o(){var a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt;return b().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return a=i.keyShareData,u=i.keyExchangeResult,l=i.config,g=i.partyManager,y=i.sessionId,A=i.tracker,I=a.userAccessKey,P=a.keyData,D=a.curve,U=u.serverShareId,V=u.sharedSecret,J=u.clientShareId,re=u.selfPartyId,ce=u.signnodeIndex,Re=[re,"signnode"],De=[J,U],Ue=yf(D2(P)),console.log("[AsyncPresigner:doPresignProgress] frost Round 2 - restore and produce C2",{sessionId:y}),Me.next=9,g.frostAsyncPresign(re,Ue,1,Re,De,y,null,"ed25519",[],s.dumpData);case 9:if(Ve=Me.sent,!(Ve.type==="final"&&Ve.presignData)){Me.next=13;break}return A.track("progress_done"),Me.abrupt("return",{presignData:Ve.presignData});case 13:if(!(Ve.type!=="need_more_messages"||!Ve.outputMessages)){Me.next=15;break}throw new Error("Unexpected result from frost Round 2: ".concat(Ve.type));case 15:return pe=Ve.outputMessages,console.log("[AsyncPresigner:doPresignProgress] frost sending C2 to progress API",{sessionId:y,c2Count:pe.length}),Se=pe.map(function(ct){return ys(Jo((0,$l.Xq)(ct,V)))}),Ce={sessionId:y,network:l.network,signnodeIndex:ce,timestamp:String(Math.floor(Date.now()/1e3))},Me.next=21,z1(Ce,I.privateKey);case 21:return je=Me.sent,Me.next=24,hn.MPCWallet.asyncPresignProgress(gn(Mr({},Ce),{encryptedOutputHexes:Se,userAccessKeyHex:I.publicKey,signatureHex:je}));case 24:return $e=Me.sent,console.debug("[AsyncPresigner]:".concat(l.algorithmPrefix,"AsyncPresign presign/progress done"),Date.now()),Qe=$e.data.outputs.flatMap(function(ct){return ct.encryptedOutputHexes.map(function(mt){return(0,$l.HK)(mo(mt),V)})}),console.log("[AsyncPresigner:doPresignProgress] frost received S2, feeding to SDK",{sessionId:y,s2Count:Qe.length}),Me.next=30,g.frostAsyncPresign(re,Ue,1,Re,De,y,null,"ed25519",Qe,null);case 30:if(nt=Me.sent,!(nt.type!=="final"||!nt.presignData)){Me.next=33;break}throw new Error("Unexpected result from frost final step: ".concat(nt.type));case 33:return A.track("progress_done"),Me.abrupt("return",{presignData:nt.presignData});case 35:case"end":return Me.stop()}},o)}))()},r}();function pBe(r){switch(r){case"ecdsa":return new dBe;case"frost":return new hBe;default:throw new Error("Unknown presign algorithm: ".concat(r))}}var dse=function(){"use strict";function r(n){(0,G.A)(this,r),this.keyExchangeResult=null,this.keyShareData=n.keyShareData,this.config=n.config,this.tracker=n.tracker,this.partyManager=n.partyManager,this.sessionId=n.sessionId}var e=r.prototype;return e.presign=function(){var i=this;return(0,k.A)(b().mark(function s(){var o,a,u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return i.tracker.track("start"),A.next=3,fBe.exchange(i.keyShareData);case 3:return o=A.sent,i.keyExchangeResult=o,i.tracker.track("key_exchange_done"),console.log("[AsyncPresigner]:".concat(i.config.algorithmPrefix,"AsyncPresign keyExchange done"),Date.now()),a=pBe(i.config.algorithm),u={keyShareData:i.keyShareData,keyExchangeResult:i.keyExchangeResult,config:i.config,partyManager:i.partyManager,sessionId:i.sessionId,tracker:i.tracker},A.next=11,a.doPresignStart(u);case 11:return l=A.sent,A.next=14,a.doPresignProgress(u,l);case 14:return g=A.sent.presignData,i.tracker.track("done"),console.debug("[AsyncPresigner]:".concat(i.config.algorithmPrefix,"AsyncPresign done"),Date.now()),A.abrupt("return",{preSignSessionId:i.sessionId,preSignData:xb(g),preSignTime:Date.now(),keyDataId:i.keyShareData.keyDataId});case 18:case"end":return A.stop()}},s)}))()},r}(),gBe={eventLogMap:{}},L6=Nr(gBe).eventLogMapBgAtom,hse=1e4,yBe=1e3,mBe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="log",s.logs=[],s}var i=n.prototype;return i.addLog=function(o){return this.logs.push(o),this.logs.length>hse&&(this.logs=this.logs.slice(-hse)),Promise.resolve()},i.exportLogs=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,ll();case 2:return u=g.sent,g.abrupt("return",{logs:o.logs.slice(-yBe),extensionId:u});case 4:case"end":return g.stop()}},a)}))()},i.eventLogSent=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,zt.get(L6);case 2:for(u=U.sent,l=!0,g=!1,y=void 0,U.prev=4,A=o[Symbol.iterator]();!(l=(I=A.next()).done);l=!0)P=I.value,delete u[P];U.next=12;break;case 8:U.prev=8,U.t0=U.catch(4),g=!0,y=U.t0;case 12:U.prev=12,U.prev=13,!l&&A.return!=null&&A.return();case 15:if(U.prev=15,!g){U.next=18;break}throw y;case 18:return U.finish(15);case 19:return U.finish(12);case 20:return U.next=22,zt.set(L6,Mr({},u));case 22:case"end":return U.stop()}},a,null,[[4,8,12,20],[13,,15,19]])}))()},i.trackEvent=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(L6);case 2:return u=y.sent,l=xh(),o.arg=o.arg||{},o.arg.df_8=Date.now(),u[l]=o,y.next=9,zt.set(L6,Mr({},u));case 9:case"end":return y.stop()}},a)}))()},n}(Yr),Cf=new mBe;_e("log",{addLog:Cf.addLog.bind(Cf),exportLogs:Cf.exportLogs.bind(Cf),eventLogSent:Cf.eventLogSent.bind(Cf)}),globalThis.logController=Cf;var bBe=function(){"use strict";function r(n){(0,G.A)(this,r),this.algorithmPrefix=n.algorithmPrefix,this.phase=n.phase,this.startTime=n.startTime,this.sessionId=n.sessionId,console.debug("[MpcSignTracker]:constructor",{algorithmPrefix:this.algorithmPrefix,phase:this.phase,startTime:this.startTime,sessionId:this.sessionId})}var e=r.prototype;return e.setSessionId=function(i){this.sessionId=i,console.debug("[MpcSignTracker]:setSessionId",i)},e.track=function(i,s){var o="extension_screen_view_mpc_sign_v2_".concat(this.algorithmPrefix,"_").concat(this.phase,"_").concat(i),a=String(Date.now()-this.startTime);console.debug("[MpcSignTracker]:track",{eventName:o,step:i,elapsed:a});var u;Cf.trackEvent({type:"pageView",eventName:o,arg:Mr({df_11:(u=this.sessionId)!==null&&u!==void 0?u:"",df_12:i==="start"?"0":a},s)})},r}();function DL(r){return new bBe(r)}var vBe=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:o=0;case 2:if(!(o<i)){u.next=15;break}return u.prev=3,u.next=6,n();case 6:return u.abrupt("return",u.sent);case 9:u.prev=9,u.t0=u.catch(3),s=u.t0;case 12:o++,u.next=2;break;case 15:throw s;case 16:case"end":return u.stop()}},e,null,[[3,9]])}));return function(n,i){return r.apply(this,arguments)}}(),wBe=function(){var r=(0,k.A)(b().mark(function e(n,i){var s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=i.partyId,o=i.signSessionId,u.prev=1,u.next=4,vBe(n,2);case 4:return u.abrupt("return",u.sent);case 7:return u.prev=7,u.t0=u.catch(1),u.prev=9,u.next=12,Cf.trackEvent({type:"pageView",eventName:"extension_screen_view_mpc_sign_error",arg:{df_10:s,df_11:o}});case 12:u.next=16;break;case 14:u.prev=14,u.t1=u.catch(9);case 16:throw u.t0;case 17:case"end":return u.stop()}},e,null,[[1,7],[9,14]])}));return function(n,i){return r.apply(this,arguments)}}(),ABe={algorithmPrefix:"ecdsa",signFn:function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return i=n.partyManager,s=n.signSessionId,o=n.dummyPartyId,a=n.peers,u=n.messageHex,l=n.keyDataBytes,g=n.threshold,y=n.presignDataBytes,A=n.shareIds,I=n.preloadOutputData,P=n.curve,V.next=3,i.ecdsaAsyncSign(s,o,a,mo(u),P??"secp256k1",l,g,y,void 0,void 0,A,I);case 3:return D=V.sent,V.abrupt("return",D);case 5:case"end":return V.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),processSignature:function(r,e){return aBe({r:xb(r.r),s:xb(r.s),signature_recovery:xb(r.signature_recovery),signature:xb(r.signature),signType:e})}},_Be={algorithmPrefix:"eddsa",signFn:function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return i=n.partyManager,s=n.signSessionId,o=n.dummyPartyId,a=n.peers,u=n.messageHex,l=n.keyDataBytes,g=n.threshold,y=n.presignDataBytes,A=n.shareIds,I=n.preloadOutputData,U.next=3,i.frostAsyncSign(s,o,a,mo(u),l,g,y,void 0,void 0,A,I,"eddsa");case 3:return P=U.sent,U.abrupt("return",P);case 5:case"end":return U.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),processSignature:function(r){return du(Jo(r.signature))}};function pse(r,e,n){return UL.apply(this,arguments)}function UL(){return UL=(0,k.A)(b().mark(function r(e,n,i){var s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je;return b().wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return s=n.keyShareData,o=n.messageHex,a=n.presignResult,u=n.signOrderId,l=n.signType,g=i.getPartyManager,y=i.getDummyPartyId,A=e.algorithmPrefix,I=e.presignFn,P=e.signFn,D=e.processSignature,U=Date.now(),V=tf(12),J=DL({algorithmPrefix:A,phase:"sign",startTime:U,sessionId:V}),console.debug("[mpcSignCore:mpcSign:".concat(A,"] start"),V,Date.now()),J.track("start"),re=s.keyData,ce=s.curve,Re=g(),Qe.next=12,y();case 12:if(De=Qe.sent,console.debug("[mpcSignCore:mpcSign:".concat(A,"] party created"),De,Date.now()),J.track("party_created",{df_10:De}),Ue=a,Ue){Qe.next=20;break}return Qe.next=19,I({keyShareData:s});case 19:Ue=Qe.sent;case 20:if(Ue){Qe.next=22;break}throw new Error("Presign failed");case 22:return Qe.next=24,oBe({keyShareData:s,message:o,partyId:De,presignResult:Ue,extensionMpcOrderId:u,signType:l});case 24:if(Ve=Qe.sent,console.debug("[mpcSignCore:mpcSign:".concat(A,"] batchSignApi done"),Date.now()),J.track("batch_api_done",{df_10:De}),Ve.status==="success"){Qe.next=29;break}throw new Error("Batch sign failed: ".concat(Ve.error||Ve.errorCode||"unknown error"));case 29:if(pe=Ve.outputs.find(function(nt){return nt.partyId===De}),pe){Qe.next=32;break}throw new Error("No output found for partyId: ".concat(De));case 32:return Qe.next=34,wBe((0,k.A)(b().mark(function nt(){var Ne;return b().wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return Cf.trackEvent({type:"pageView",eventName:"extension_screen_view_mpc_sign_start",arg:{df_10:De,df_11:V}}),ct.next=3,P({partyManager:Re,signSessionId:V,dummyPartyId:De,peers:Ve.peers,messageHex:o,keyDataBytes:yf(D2(re)),threshold:1,presignDataBytes:yf(Ue.preSignData),shareIds:Ve.shareIds,preloadOutputData:[mo(pe.outputHex)],curve:ce});case 3:return Ne=ct.sent,Cf.trackEvent({type:"pageView",eventName:"extension_screen_view_mpc_sign_success",arg:{df_10:De,df_11:V}}),ct.abrupt("return",Ne);case 6:case"end":return ct.stop()}},nt)})),{signSessionId:V,partyId:De});case 34:return Se=Qe.sent,console.debug("[mpcSignCore:mpcSign:".concat(A,"] signSuccess"),Date.now()),J.track("sign_success",{df_10:De}),Ce=(0,$l.Op)(Se.signature),console.debug("[mpcSignCore:mpcSign:".concat(A,"] parsed Res"),Date.now(),Ce),je=D(Ce,l),console.debug("[mpcSignCore:mpcSign:".concat(A,"] done"),V),J.track("done"),Qe.abrupt("return",je);case 43:case"end":return Qe.stop()}},r)})),UL.apply(this,arguments)}function gse(r){return FL.apply(this,arguments)}function FL(){return FL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return n=e.keyShareData,i=LT(),s=tf(32),o=DL({algorithmPrefix:"ecdsa",phase:"async_presign",startTime:Date.now(),sessionId:s}),a={algorithmPrefix:"ecdsa",algorithm:"ecdsa",network:"ecdsa",curve:n.curve},u=new dse({keyShareData:n,config:a,tracker:o,partyManager:i,sessionId:s}),g.abrupt("return",u.presign());case 7:case"end":return g.stop()}},r)})),FL.apply(this,arguments)}function yse(r){return WL.apply(this,arguments)}function WL(){return WL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return n=e.keyShareData,i=LT(),s=tf(32),o=DL({algorithmPrefix:"eddsa",phase:"async_presign",startTime:Date.now(),sessionId:s}),a={algorithmPrefix:"eddsa",algorithm:"frost",network:"eddsa",signatureVariant:"eddsa"},u=new dse({keyShareData:n,config:a,tracker:o,partyManager:i,sessionId:s}),g.abrupt("return",u.presign());case 7:case"end":return g.stop()}},r)})),WL.apply(this,arguments)}function EBe(r){return HL.apply(this,arguments)}function HL(){return HL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.keyShareData,i=e.messageHex,s=e.presignResult,o=e.signOrderId,a=e.signType,l.abrupt("return",pse(gn(Mr({},ABe),{presignFn:gse}),{keyShareData:n,messageHex:i,presignResult:s,signOrderId:o,signType:a},{getPartyManager:LT,getDummyPartyId:$L}));case 2:case"end":return l.stop()}},r)})),HL.apply(this,arguments)}function TBe(r){return zL.apply(this,arguments)}function zL(){return zL=(0,k.A)(b().mark(function r(e){var n,i,s,o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.keyShareData,i=e.messageHex,s=e.presignResult,o=e.signOrderId,a=e.signType,l.abrupt("return",pse(gn(Mr({},_Be),{presignFn:yse}),{keyShareData:n,messageHex:i,presignResult:s,signOrderId:o,signType:a},{getPartyManager:LT,getDummyPartyId:$L}));case 2:case"end":return l.stop()}},r)})),zL.apply(this,arguments)}var SBe=JSON.stringify({strategy:"ecdh",config:"{}"}),LT=(0,H.once)(function(){return new $l.qx}),$L=function(){var r=(0,k.A)(b().mark(function e(){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=tf(32),i=LT(),o.next=4,i.createParty(n,"",SBe);case 4:return o.abrupt("return",n);case 5:case"end":return o.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),mse=function(){"use strict";function r(n){(0,G.A)(this,r),this.queue=[],this.storageKey="local:".concat(n),this.loadFromStorage()}var e=r.prototype;return e.loadFromStorage=function(){var i=this;return(0,k.A)(b().mark(function s(){var o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,ee.getItem(i.storageKey);case 2:o=u.sent,o&&(i.queue=o);case 4:case"end":return u.stop()}},s)}))()},e.saveToStorage=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,ee.setItem(i.storageKey,i.queue);case 2:case"end":return a.stop()}},s)}))()},e.push=function(i){var s=this;return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s.queue.push(i),u.next=3,s.saveToStorage();case 3:case"end":return u.stop()}},o)}))()},e.shift=function(){var i=this;return(0,k.A)(b().mark(function s(){var o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return o=i.queue.shift(),u.next=3,i.saveToStorage();case 3:return u.abrupt("return",o);case 4:case"end":return u.stop()}},s)}))()},e.clear=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return i.queue=[],a.next=3,i.saveToStorage();case 3:case"end":return a.stop()}},s)}))()},e.filterAndSave=function(i){var s=this;return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(a=s.queue.filter(i),a.length!==s.queue.length){l.next=3;break}return l.abrupt("return");case 3:return s.queue=a,l.next=6,s.saveToStorage();case 6:case"end":return l.stop()}},o)}))()},(0,L.A)(r,[{key:"length",get:function(){return this.queue.length}}]),r}(),IBe=new In,kBe=20,RBe=30*24*60*60*1e3-10*60*1e3,CBe=24*3600*1e3,bse=function(r){"use strict";N(n,r);var e=te(n);function n(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;(0,G.A)(this,n);var a;return a=e.call(this,{getRefreshInterval:o?xBe(s):function(){return CBe},waitBeforeStart:!0}),a.queue=s,a.enabled=o,a.fetchPresign=function(){return Promise.resolve()},a.filterQueueItem=function(u){return!0},a.onAfterRefresh=null,a}var i=n.prototype;return i.refreshFn=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,o.fetchPresignResult();case 2:if(u=g.sent,!u){g.next=15;break}return g.next=6,o.queue.push(u);case 6:if(!o.onAfterRefresh){g.next=15;break}return g.prev=7,g.next=10,o.onAfterRefresh();case 10:g.next=15;break;case 12:g.prev=12,g.t0=g.catch(7),console.error("[PreSignRefreshScheduler] onAfterRefresh error:",g.t0);case 15:case"end":return g.stop()}},a,null,[[7,12]])}))()},i.fetchPresignResult=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",IBe.runExclusive(function(){return o.fetchPresign()}));case 1:case"end":return l.stop()}},a)}))()},i.checkLoop=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(o.enabled){l.next=2;break}return l.abrupt("return",!1);case 2:return l.next=4,o.checkQueueItems();case 4:return l.abrupt("return",o.queue.length<kBe);case 5:case"end":return l.stop()}},a)}))()},i.preLoop=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.checkQueueItems();case 2:case"end":return l.stop()}},a)}))()},i.setFetchPresignFn=function(o){this.fetchPresign=o},i.setFilterQueueItem=function(o){this.filterQueueItem=o},i.setOnAfterRefresh=function(o){this.onAfterRefresh=o},i.getValue=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,o.checkQueueItems();case 2:return g.next=4,o.queue.shift();case 4:return u=g.sent,g.abrupt("return",u);case 6:case"end":return g.stop()}},a)}))()},i.filterAndSaveQueue=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,a.queue.filterAndSave(o);case 2:case"end":return g.stop()}},u)}))()},i.clear=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.queue.clear();case 2:case"end":return l.stop()}},a)}))()},i.checkQueueItems=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.queue.filterAndSave(o.filterQueueItem);case 2:case"end":return l.stop()}},a)}))()},n}(uC),xBe=function(r){return function(){return r.length?r.length<5?30*1e3-5*1e3+(0,H.random)(0,10*1e3):r.length<10?60*1e3-10*1e3+(0,H.random)(0,20*1e3):2*60*1e3-10*1e3+(0,H.random)(0,20*1e3):500}},D6=new Map,U6=new Map,vse=function(r){if(D6.has(r))return D6.get(r);var e=new bse(new mse("ecdsaPresignRet:".concat(r)));return D6.set(r,e),e},wse=function(r){if(U6.has(r))return U6.get(r);var e=new bse(new mse("eddsaPresignRet:".concat(r)));return U6.set(r,e),e},Ase=function(){return(0,Li.A)(D6.values().toArray()).concat((0,Li.A)(U6.values().toArray()))},BBe="AUTO_LOGOUT_MPC_TIMER",OBe="PRESIGN_IDLE_TIMER",_se=60*60*1e3,F6="importEncPk",W6=new WeakMap,rl=new WeakMap,Ese=new WeakMap,VL=new WeakMap,jL=new WeakMap,_m=new WeakMap,KL=new WeakSet,GL=new WeakSet,Tse=new WeakSet,Sse=new WeakSet,qL=new WeakSet,DT=new WeakSet,bh=new WeakSet,Ise=new WeakSet,ZL=new WeakSet,YL=new WeakSet,UT=new WeakSet,nl=new WeakSet,kse=new WeakSet,H6=new WeakSet,Rse=new WeakSet,z6=new WeakSet,U2=new WeakSet,PBe=new WeakSet,$6=new WeakSet,FT=new WeakSet,XL=new WeakSet,Cse=new WeakSet,xse=new WeakSet,NBe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;s=e.apply(this,arguments),B(F(s),KL),B(F(s),GL),B(F(s),Tse),B(F(s),Sse),B(F(s),qL),B(F(s),DT),B(F(s),bh),B(F(s),Ise),B(F(s),ZL),B(F(s),YL),B(F(s),UT),B(F(s),nl),B(F(s),kse),B(F(s),H6),B(F(s),Rse),B(F(s),z6),B(F(s),U2),B(F(s),PBe),B(F(s),$6),B(F(s),FT),B(F(s),XL),B(F(s),Cse),B(F(s),xse),s.name="mpcWallet",de(F(s),W6,{writable:!0,value:null}),de(F(s),rl,{writable:!0,value:null}),de(F(s),Ese,{writable:!0,value:new cee(K(s,Ise,DBe).bind(F(s)),_se)}),de(F(s),VL,{writable:!0,value:new cee(function(){return s.pollLoginStatus()},5*1e3)}),de(F(s),jL,{writable:!0,value:0}),de(F(s),_m,{writable:!0,value:null}),s.checkMpcWalletActive=K(F(s),nl,Vl);var o=F(s);return s.pollLoginStatus=SS((0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,UT,j6).call(o);case 2:case"end":return l.stop()}},a)})),5*1e3),s.filterPreisignQueueItem=function(a){return function(u){if(!u)return!1;var l=u.preSignTime,g=u.keyDataId;if(!l||!g)return!1;var y=K(s,U2,WT).call(F(s),a);if(!y)return!0;if(l+RBe<Date.now())return!1;var A=y.keyShares.map(function(I){return I.keyDataId});return A.includes(g)}},s.getAllMPCInfo=(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.t0=ur,ce.next=3,Promise.all([hn.MPCWallet.getAllMPCSimpleInfo(),hn.MPCWallet.getImportedMPCWallet()]);case 3:return ce.t1=ce.sent,u=(0,ce.t0)(ce.t1,2),l=u[0],g=u[1],y=g.data.walletInfoList.map(function(Re){return Re.keyId}),ce.next=10,zt.get(Fl);case 10:return A=ce.sent,I=l.data.walletInfoList.map(function(Re){var De=A===Re.keyId,Ue=y.includes(Re.keyId);return gn(Mr({},Re),{isActive:De,isLogin:Ue})}),P=(0,H.keyBy)(I,function(Re){return Re.keyId}),D=I.filter(function(Re){return Re.isActive}),U=y.map(function(Re){return P[Re]}).filter(function(Re){return Re&&!Re.isActive&&Re.isLogin}),V=I.filter(function(Re){return!Re.isLogin}),J=D.concat(U).concat(V),ce.abrupt("return",J);case 18:case"end":return ce.stop()}},a)})),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return he(o,W6,wo.registerTimer({timerName:BBe,getTimeoutMinutes:(0,k.A)(b().mark(function A(){return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.abrupt("return",24*60);case 1:case"end":return P.stop()}},A)})),onTimeout:K(o,qL,Pse).bind(o),checkReset:(0,k.A)(b().mark(function A(){var I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,K(o,nl,Vl).call(o);case 2:if(I=U.sent,I){U.next=5;break}return U.abrupt("return",!1);case 5:return U.next=7,vn.getCurrentSelectedWallet();case 7:return P=U.sent,U.abrupt("return",!!P&&P.metadata.keyring.type===di.mpc);case 9:case"end":return U.stop()}},A)})),onReset:function(){he(o,jL,Date.now())}})),wo.registerTimer({timerName:OBe,getTimeoutMinutes:(0,k.A)(b().mark(function A(){return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.abrupt("return",1);case 1:case"end":return P.stop()}},A)})),onTimeout:function(){console.debug("!- [MPCWalletController]:presign idle timeout, start presign");var A=Ase();A.forEach(function(I){return I.startLoop()})},onReset:function(){console.debug("!- [MPCWalletController]:presign idle reset, stop presign");var A=Ase();A.forEach(function(I){return I.stopLoop()})}}),X(o,Ese).startLoop(),y.next=5,K(o,YL,Mse).call(o);case 5:return y.next=7,K(o,$6,mD).call(o,"ecdsa");case 7:return u=y.sent,u&&u.startLoop(),y.next=11,K(o,$6,mD).call(o,"eddsa");case 11:l=y.sent,l&&l.startLoop(),wo.onHasUIConnected((0,k.A)(b().mark(function A(){return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:console.debug("!- [MPCWalletController]:onHasUIConnected"),X(o,VL).startLoop();case 2:case"end":return P.stop()}},A)}))),wo.onAllUIDisconnected((0,k.A)(b().mark(function A(){return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return console.debug("!- [MPCWalletController]:onAllUIDisconnected"),X(o,VL).stopLoop(),P.next=4,o.cancelLogin();case 4:return P.next=6,o.removePendingMPCImport();case 6:case"end":return P.stop()}},A)})));case 15:case"end":return y.stop()}},a)}))()},i.getQRCode=function(o){var a=o.isFirstLogin,u=o.isAddMore,l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return he(l,rl,null),Re.next=3,zt.set(b0,{status:su.qrCodeLoading});case 3:return y="",A=0,I="",P="",Re.next=9,K(l,xse,HBe).call(l);case 9:if(D=Re.sent,!u){Re.next=28;break}return P=Cg(),y=Cg(),Re.next=15,hn.MPCWallet.importMoreMPC({publicKeyHex:"",serialNum:y});case 15:return U=Re.sent,Re.prev=16,Re.next=19,hn.MPCWallet.pushTxToApp({scene:"ADD_KEYLESS",version:"v1",taskId:P,taskData:JSON.stringify({serialNum:y,publicKeyHex:"",expireAt:U.data})});case 19:Re.next=24;break;case 21:Re.prev=21,Re.t0=Re.catch(16),console.error(Re.t0);case 24:A=Number(U.data),console.log(JSON.stringify({serialNum:y,expireAt:A},null,2)),Re.next=36;break;case 28:return Re.next=30,hn.MPCWallet.generateQRCode({publicKeyHex:"",isFirstLogin:a});case 30:V=Re.sent,J=V.data,y=J.qrCodeId,I=Z5e(J.qrCodeUrl,D),A=J.expireAt,console.log(JSON.stringify({qrCodeId:y,publicKeyHex:D}),null,2);case 36:return re={status:su.valid,expiredAt:A*1e3,qrcodeContent:I,qrCodeId:y,pairCode:rBe(D),taskId:P,isAddMore:u},Re.next=39,zt.set(b0,re);case 39:case"end":return Re.stop()}},g,null,[[16,21]])}))()},i.resetQRCode=function(){var o=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).withoutRevoke,a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,a.cancelLogin({withoutRevoke:o});case 2:return g.next=4,zt.set(b0,{status:su.qrCodeLoading});case 4:case"end":return g.stop()}},u)}))()},i.cancelLogin=function(){var o=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).withoutRevoke,a=this;return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.prev=0,A.next=3,zt.get(b0);case 3:if(l=A.sent,!(!l||!l.qrCodeId)){A.next=7;break}return console.debug("[cancelLogin] no qrCodeId"),A.abrupt("return");case 7:if(!X(a,rl)){A.next=9;break}return A.abrupt("return");case 9:if(!l.isAddMore){A.next=17;break}return A.next=12,hn.MPCWallet.cancelAddMore(l.qrCodeId);case 12:if(!(l.taskId&&!o)){A.next=15;break}return A.next=15,hn.MPCWallet.revokeTaskMessage({scene:"ADD_KEYLESS",version:"v1",taskId:l.taskId});case 15:A.next=25;break;case 17:return A.next=19,K(a,nl,Vl).call(a);case 19:if(g=A.sent,!g){A.next=23;break}return console.debug("[cancelLogin] current wallet is active. Not canceling login"),A.abrupt("return");case 23:return A.next=25,hn.MPCWallet.cancelLogin(l.qrCodeId);case 25:return A.next=27,zt.set(b0,null);case 27:A.next=32;break;case 29:A.prev=29,A.t0=A.catch(0),console.error(A.t0);case 32:case"end":return A.stop()}},u,null,[[0,29]])}))()},i.removePendingMPCImport=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,K(o,nl,Vl).call(o);case 2:return u=y.sent,y.next=5,mh.checkHasCompletedOnboarding();case 5:if(l=y.sent,!(u&&!l&&X(o,rl))){y.next=12;break}return he(o,rl,null),y.next=10,K(o,KL,Bse).call(o);case 10:return y.next=12,zt.set(ud,null);case 12:case"end":return y.stop()}},a)}))()},i.confirmAutoLogout=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.set(ud,Ho.logoutConfirmed);case 2:case"end":return u.stop()}},o)}))()},i.pollQRCodeStatus=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J,re,ce,Re;return b().wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,zt.get(b0);case 2:if(l=Ue.sent,!(!l&&!o)){Ue.next=5;break}throw Error("No qrCodeId to poll");case 5:if(o=o||l.qrCodeId,g=l?.status,g!==su.success){Ue.next=10;break}return console.debug("[pollQRCodeStatus] already success"),Ue.abrupt("return");case 10:return y=l?.isAddMore,A=function(){var Ve=(0,k.A)(b().mark(function pe(){var Se,Ce,je;return b().wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Se=Date.now(),Qe.next=3,zt.get(b0);case 3:if(Ce=Qe.sent,Ce?.status!==su.expired){Qe.next=6;break}return Qe.abrupt("return",!0);case 6:return je=Ce&&Se>=Ce.expiredAt,Qe.abrupt("return",je);case 8:case"end":return Qe.stop()}},pe)}));return function(){return Ve.apply(this,arguments)}}(),Ue.next=14,A();case 14:if(I=Ue.sent,!I){Ue.next=24;break}if(g!==su.scanned){Ue.next=21;break}return Ue.next=19,K(a,bh,C0).call(a,su.importFailed);case 19:Ue.next=23;break;case 21:return Ue.next=23,K(a,bh,C0).call(a,su.expired);case 23:return Ue.abrupt("return");case 24:if(Ue.prev=24,P="",D=!1,U=null,!y){Ue.next=36;break}return Ue.next=31,hn.MPCWallet.pollAddMore(o);case 31:V=Ue.sent.data,U=V.walletInfoList,P=V.importStatus,Ue.next=43;break;case 36:return Ue.next=38,hn.MPCWallet.pollQRCode(o);case 38:J=Ue.sent,re=J.data,P=re.connectionStatus,D=re.qrIsScanned,U=re.walletInfoList;case 43:if(!(U&&U.length)){Ue.next=47;break}return Ue.next=46,K(a,Sse,LBe).call(a,{infoList:U,sid:o});case 46:return Ue.abrupt("return");case 47:if(!(P==="AUTH_REFUSE"||P==="REFUSE")){Ue.next=52;break}return Ue.next=50,K(a,bh,C0).call(a,su.userCancel);case 50:Ue.next=73;break;case 52:if(!(P==="DELTED"||P==="INACTIVE"||P==="AUTH_ERROR"||P==="ERROR")){Ue.next=57;break}return Ue.next=55,K(a,bh,C0).call(a,su.importFailed);case 55:Ue.next=73;break;case 57:return Ue.next=59,A();case 59:if(ce=Ue.sent,!ce){Ue.next=70;break}if(!(g===su.scanned||D)){Ue.next=66;break}return Ue.next=64,K(a,bh,C0).call(a,su.importFailed);case 64:Ue.next=68;break;case 66:return Ue.next=68,K(a,bh,C0).call(a,su.expired);case 68:Ue.next=73;break;case 70:if(!D){Ue.next=73;break}return Ue.next=73,K(a,bh,C0).call(a,su.scanned);case 73:Ue.next=87;break;case 75:return Ue.prev=75,Ue.t0=Ue.catch(24),console.error(Ue.t0),Ue.next=80,A();case 80:if(Re=Ue.sent,!(aC(Ue.t0,["351218","351403"])||Re)){Ue.next=85;break}return Ue.next=84,K(a,bh,C0).call(a,su.expired);case 84:return Ue.abrupt("return");case 85:return Ue.next=87,K(a,bh,C0).call(a,su.importFailed);case 87:case"end":return Ue.stop()}},u,null,[[24,75]])}))()},i.requestMoreMPC=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",o.getQRCode({isAddMore:!0,isFirstLogin:!1}));case 1:case"end":return l.stop()}},a)}))()},i.sendRequestMoreMPCAgain=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(b0);case 2:if(u=g.sent,!u){g.next=11;break}return g.prev=4,g.next=7,o.cancelLogin();case 7:g.next=11;break;case 9:g.prev=9,g.t0=g.catch(4);case 11:return g.next=13,o.getQRCode({isAddMore:!0,isFirstLogin:!1});case 13:case"end":return g.stop()}},a,null,[[4,9]])}))()},i.importMPCWallet=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(X(o,rl)){I.next=2;break}throw Error("No keyshare to import");case 2:return u=X(o,rl).activeId,l=X(o,rl).keyshares.map(function(P){return P.keyId}),g=!1,l.includes(u)||(u=l[0],g=!0),I.next=8,vn.importMPCWallet(X(o,rl).keyshares,u);case 8:if(y=I.sent,he(o,rl,null),!g){I.next=13;break}return I.next=13,o.changeActiveMPCWallet(y);case 13:return I.next=15,K(o,ZL,Nse).call(o);case 15:return I.abrupt("return",y);case 16:case"end":return I.stop()}},a)}))()},i.createNewValutAndImportMPC=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(X(a,rl)){y.next=2;break}throw Error("No keyshare to import");case 2:return y.next=4,vn.createNewVaultAndImportMPC(o,X(a,rl).keyshares,X(a,rl).activeId);case 4:if(l=y.sent,!X(a,_m)){y.next=8;break}return y.next=8,li.storeInSafeStore(F6,X(a,_m));case 8:return he(a,rl,null),y.next=11,K(a,ZL,Nse).call(a);case 11:return y.abrupt("return",l);case 12:case"end":return y.stop()}},u)}))()},i.checkWalletStatus=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,K(o,UT,j6).call(o);case 2:return g.next=4,zt.get(ud);case 4:if(u=g.sent,u){g.next=7;break}return g.abrupt("return",sp.deleted);case 7:g.t0=u,g.next=g.t0===Ho.active?10:g.t0===Ho.autoLogout||g.t0===Ho.manualLogout||g.t0===Ho.logoutConfirmed||g.t0===Ho.mpLogout||g.t0===Ho.absoluteExpireLogout?11:g.t0===Ho.deleted||g.t0===Ho.passiveDeleted||g.t0===Ho.deleteConfirmed?12:13;break;case 10:return g.abrupt("return",sp.active);case 11:return g.abrupt("return",sp.logout);case 12:return g.abrupt("return",sp.deleted);case 13:throw Error("Unknow status for wallet",u);case 14:case"end":return g.stop()}},a)}))()},i.preSignForNetwork=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:case"end":return u.stop()}},o)}))()},i.createMPCAppApproval=function(o){var a=o.approvalId,u=o.arg,l=o.approvalType,g=o.generateTaskData,y=o.intervalRefresh,A=this;return(0,k.A)(b().mark(function I(){var P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on;return b().wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return P=l===Hs.MPCAppDexSign,D=Pc(),console.debug("[MPCWalletController:createMPCAppApproval] start"),U=u.isBroadcast,V=u.signContext,J=u.signType,re=V.networkId,ce=V.origin,Re=V.networkType,De=V.accountId,Ue=Za(re),Ar.next=8,vn.getAddressByAccountId(De,Re);case 8:return Ve=Ar.sent,pe=function(){var Xr=(0,k.A)(b().mark(function Tn(Bn){return b().wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return Bn&&(D=Pc()),en.next=3,hn.MPCWallet.saveTxToApp({txId:D,origRequestJson:"{}",binanceChainId:Ue,address:Ve,dappInfo:null});case 3:return en.abrupt("return",D);case 4:case"end":return en.stop()}},Tn)}));return function(Bn){return Xr.apply(this,arguments)}}(),Se=l===Hs.MPCAppDexSign?"DEX_SIGN":J===Hs.SignMessage?"SIGN_MSG":"SIGN_TX",Ce=function(){var Xr=(0,k.A)(b().mark(function Tn(Bn){var ni,en,si,ei,Ia;return b().wrap(function(ho){for(;;)switch(ho.prev=ho.next){case 0:return ho.next=2,g({txId:D,generateNewTxId:Bn});case 2:return ni=ho.sent,en=Cg(),si=ni.version||"v1",ho.next=7,hn.MPCWallet.pushTxToApp({scene:Se,version:si,taskId:en,taskData:JSON.stringify(ni)});case 7:return ei=ho.sent,Ia=ei.data.expireTime,ho.abrupt("return",{expireAt:Ia,taskId:en});case 10:case"end":return ho.stop()}},Tn)}));return function(Bn){return Xr.apply(this,arguments)}}(),Ar.t0=ur,Ar.next=15,Promise.all([Ce(!1),pe(!1)]);case 15:return Ar.t1=Ar.sent,je=(0,Ar.t0)(Ar.t1,1),$e=je[0],Qe=$e.expireAt,nt=$e.taskId,console.debug("[MPCWalletController:createMPCAppApproval]after saveTxToApp"),Ne=function(){var Xr=(0,k.A)(b().mark(function Tn(Bn,ni){var en,si,ei,Ia,wi,ho,Zo;return b().wrap(function(ya){for(;;)switch(ya.prev=ya.next){case 0:if(console.debug("[MPCWalletController]:refreshFn",Bn),!Bn){ya.next=4;break}return ya.next=4,pe(!0);case 4:return ya.next=6,Ce(Bn);case 6:return en=ya.sent,si=en.expireAt,ei=en.taskId,ya.next=11,Zn.getApprovalRequestById(ni);case 11:return Ia=ya.sent,wi=Ia.requestData,Zo=(ho=wi.pushTaskIds)!==null&&ho!==void 0?ho:[],Bn&&(wi.expireAt=si),ya.next=18,Zn.changeRequestDataWithRefresh(ni,gn(Mr({},wi),{pushTaskIds:(0,Li.A)(Zo).concat([ei]),status:v0.pending}),Ne.bind(null,!1));case 18:case"end":return ya.stop()}},Tn)}));return function(Bn,ni){return Xr.apply(this,arguments)}}(),Me=gn(Mr({},u),{txId:D,isBroadcast:U,signContext:V,signType:J,expireAt:Qe,status:v0.pending,pushTaskIds:[nt]}),Ar.next=25,Zn.upsertApproval({approvalId:a,origin:ce,type:l??Hs.MPCAppSign,requestData:Me,source:V.signSource,onRefresh:Ne.bind(null,!1),onlyCancel:!0});case 25:return a=Ar.sent,Ar.next=28,Zn.checkStatus(a);case 28:ct=Ar.sent,mt=!1;case 30:if(ct!==_c.Pending){Ar.next=98;break}return Ar.next=33,K(A,nl,Vl).call(A);case 33:if(Bt=Ar.sent,Bt){Ar.next=38;break}return Ar.next=37,Zn.rejectApproval(a);case 37:return Ar.abrupt("break",98);case 38:return Ar.next=40,Zn.getApprovalRequestById(a);case 40:if(er=Ar.sent,cr=er.requestData,!(cr.status===v0.expired||cr.status===v0.userCancel)){Ar.next=46;break}return Ar.next=45,tc(1e3);case 45:return Ar.abrupt("continue",30);case 46:if(!y){Ar.next=49;break}return Ar.next=49,y({pushToApp:Ce.bind(null,!1)});case 49:return Ar.prev=49,Ar.next=52,hn.MPCWallet.pollTxResult(D);case 52:if(pr=Ar.sent,Dr=pr.data,!Dr.wcResult){Ar.next=61;break}return Ar.next=57,Zn.changeRequestData(a,gn(Mr({},cr),{wcResult:Dr.wcResult,status:v0.success}));case 57:return P?Zn.setExtraReturn(a,{orderId:Dr.wcResult}):Zn.setExtraReturn(a,q5e({wcResult:Dr.wcResult,isBroadcast:U,signType:J,networkType:Re})),Ar.next=60,Zn.acceptApproval(a);case 60:return Ar.abrupt("break",98);case 61:if(!(Date.now()>=cr.expireAt)){Ar.next=73;break}return Ar.next=64,Zn.changeRequestDataWithRefresh(a,gn(Mr({},cr),{status:v0.expired}),Ne.bind(null,!0));case 64:return Ar.prev=64,Ar.next=67,hn.MPCWallet.cancelTx(D);case 67:Ar.next=72;break;case 69:Ar.prev=69,Ar.t2=Ar.catch(64),console.error(Ar.t2);case 72:return Ar.abrupt("continue",30);case 73:if(!["TX_FAIL","TX_APP_CANCEL","TX_CANCEL"].includes(Dr.status)){Ar.next=77;break}return Ar.next=76,Zn.changeRequestDataWithRefresh(a,gn(Mr({},cr),{status:v0.userCancel}),Ne.bind(null,!0));case 76:return Ar.abrupt("continue",30);case 77:Ar.next=89;break;case 79:if(Ar.prev=79,Ar.t3=Ar.catch(49),!aC(Ar.t3,aee)){Ar.next=88;break}return Ar.next=84,Zn.changeRequestDataWithRefresh(a,gn(Mr({},cr),{status:v0.userCancel}),Ne.bind(null,!0));case 84:return mt=!0,Ar.abrupt("continue",30);case 88:throw Ar.t3;case 89:return Ar.prev=89,Ar.next=92,Zn.checkStatus(a);case 92:return ct=Ar.sent,Ar.next=95,tc(1*1e3);case 95:return Ar.finish(89);case 96:Ar.next=30;break;case 98:return Ar.next=100,Zn.checkStatus(a);case 100:if(ct=Ar.sent,!(ct===_c.Rejected&&!mt)){Ar.next=118;break}return Ar.next=104,Zn.getApprovalRequestById(a);case 104:return Rr=Ar.sent,Pr=Rr.requestData,on=Pr.pushTaskIds,Ar.prev=107,Ar.next=110,hn.MPCWallet.cancelTx(D);case 110:if(!on){Ar.next=113;break}return Ar.next=113,Promise.all(on.map(function(Xr){return hn.MPCWallet.revokeTaskMessage({scene:Se,version:"v1",taskId:Xr})}));case 113:Ar.next=118;break;case 115:Ar.prev=115,Ar.t4=Ar.catch(107),console.error(Ar.t4);case 118:return Ar.abrupt("return",a);case 119:case"end":return Ar.stop()}},I,null,[[49,79,89,96],[64,69],[107,115]])}))()},i.wrapMPCSignCheck=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Ci.checkWalletStatus();case 2:if(g=ce.sent,g){ce.next=7;break}return ce.next=6,Zn.rejectApproval(o);case 6:return ce.abrupt("return");case 7:return ce.next=9,Zn.getApproval(o);case 9:return y=ce.sent,A=a.signContext,ce.next=13,vn.getWalletItemByAccountId(A.accountId);case 13:I=ce.sent;case 14:if(!(I&&y?.status===_c.Pending)){ce.next=34;break}if(P=y?.onlyCancel,P){ce.next=24;break}return ce.next=19,K(u,kse,UBe).call(u,I.id);case 19:if(D=ce.sent,D){ce.next=24;break}return ce.next=23,Zn.rejectApproval(o);case 23:return ce.abrupt("return");case 24:return ce.next=26,Promise.race([tc(200),Zn.waitForApproval(o)]);case 26:return ce.next=28,Zn.getApproval(o);case 28:return y=ce.sent,ce.next=31,vn.getWalletItemByAccountId(A.accountId);case 31:I=ce.sent,ce.next=14;break;case 34:if(I){ce.next=38;break}return ce.next=37,Zn.rejectApproval(o);case 37:return ce.abrupt("return");case 38:return ce.next=40,Ci.checkWalletStatus();case 40:if(U=ce.sent,U){ce.next=45;break}return ce.next=44,Zn.rejectApproval(o);case 44:return ce.abrupt("return");case 45:if(V=y?.onlyCancel,!V){ce.next=48;break}return ce.abrupt("return");case 48:return ce.next=50,Zn.waitForApproval(o);case 50:if(J=ce.sent,J){ce.next=53;break}return ce.abrupt("return");case 53:case"end":return ce.stop()}},l)}))()},i.mpcSign=function(o){var a=o.walletId,u=o.network,l=o.data,g=o.signOrderId,y=o.signType,A=this;return(0,k.A)(b().mark(function I(){var P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return console.debug("[MPCWalletController:mpcSign] start"),P=xL(u),D=null,ce.next=5,K(A,$6,mD).call(A,P);case 5:if(U=ce.sent,!U){ce.next=10;break}return ce.next=9,U.getValue();case 9:D=ce.sent;case 10:if(console.debug("[MPCWalletController:mpcSign] presignResult",D),V=K(A,U2,WT).call(A,a),V){ce.next=14;break}throw Error("Cannot get keyshare when sign");case 14:if(J=V.keyShares.find(function(Re){return Re.algorithm===P}),J){ce.next=17;break}throw Error("Unknown algorithm: ".concat(P));case 17:if(P!=="ecdsa"){ce.next=21;break}return ce.abrupt("return",EBe({keyShareData:J,messageHex:l,presignResult:D,signOrderId:g,signType:y}));case 21:return ce.abrupt("return",TBe({keyShareData:J,messageHex:l,presignResult:D,signOrderId:g,signType:y}));case 22:case"end":return ce.stop()}},I)}))()},i.logout=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return console.debug("[MPCWalletController:logout]"),l.next=3,K(o,nl,Vl).call(o);case 3:if(!l.sent){l.next=6;break}return l.next=6,zt.set(ud,Ho.manualLogout);case 6:return l.next=8,K(o,DT,V6).call(o);case 8:case"end":return l.stop()}},a)}))()},i.onAllMPCWalletRemoved=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.logout();case 2:return l.next=4,zt.set(v1,[]);case 4:case"end":return l.stop()}},a)}))()},i.changeActiveMPCWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.MPCWallet.switchMPCLogin(o);case 2:return g.prev=2,g.next=5,K(a,FT,K6).call(a,o);case 5:g.next=10;break;case 7:g.prev=7,g.t0=g.catch(2),console.error(g.t0);case 10:case"end":return g.stop()}},u,null,[[2,7]])}))()},i.onMPCWalletRemoved=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return g=a.skipChangeActive,U.next=3,zt.get(Fl);case 3:if(y=U.sent,A={keyIds:[o]},y!==o){U.next=15;break}return U.next=8,zt.get(v1);case 8:if(I=U.sent,P=I.find(function(V){return V.keyId!==o&&V.isLogin}),P){U.next=14;break}return U.next=13,u.onAllMPCWalletRemoved();case 13:return U.abrupt("return");case 14:A.activeKeyId=P.keyId;case 15:if(a.skipCallLogout){U.next=23;break}return U.prev=16,U.next=19,hn.MPCWallet.singleLogout(A);case 19:U.next=23;break;case 21:U.prev=21,U.t0=U.catch(16);case 23:return U.next=25,li.removeMPCKeyshare(o);case 25:if(!(A.activeKeyId&&!g)){U.next=28;break}return U.next=28,K(u,FT,K6).call(u,A.activeKeyId);case 28:return U.next=30,u.updateAllMPCInfo();case 30:case"end":return U.stop()}},l,null,[[16,21]])}))()},i.getAndCheckMpcWalletStatus=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,vn.getMpcWallet();case 2:if(u=y.sent,u){y.next=5;break}return y.abrupt("return",null);case 5:return y.next=7,K(o,nl,Vl).call(o);case 7:if(l=y.sent,l){y.next=10;break}return y.abrupt("return",null);case 10:return y.abrupt("return",u);case 11:case"end":return y.stop()}},a)}))()},i.preparePresignScheduler=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return g=a==="ecdsa"?vse(o):wse(o),g.setFetchPresignFn(function(){return K(u,z6,pD).call(u,a,o)}),g.setFilterQueueItem(u.filterPreisignQueueItem(o)),g.setOnAfterRefresh((0,k.A)(b().mark(function I(){return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,K(u,H6,fD).call(u,o,a,g);case 2:case"end":return D.stop()}},I)}))),A.abrupt("return",g);case 5:case"end":return A.stop()}},l)}))()},i.updateAllMPCInfo=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je;return b().wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Qe.next=2,K(o,nl,Vl).call(o);case 2:if(u=Qe.sent,u){Qe.next=5;break}return Qe.abrupt("return");case 5:return Qe.next=7,o.getAllMPCInfo();case 7:return l=Qe.sent,Qe.next=10,zt.get(Ul);case 10:if(g=Qe.sent,y=li.getAllMpcKeyrings(),A=l.filter(function(nt){return nt.isLogin}).map(function(nt){return nt.keyId}),I=y.filter(function(nt){return!!nt.keyshare}).map(function(nt){return nt.walletId}),P=I.filter(function(nt){return!A.includes(nt)}),D=A.filter(function(nt){return!I.includes(nt)}),!P.length){Qe.next=41;break}U=!0,V=!1,J=void 0,Qe.prev=18,re=P[Symbol.iterator]();case 20:if(U=(ce=re.next()).done){Qe.next=27;break}return Re=ce.value,Qe.next=24,o.onMPCWalletRemoved(Re,{skipCallLogout:!0,skipChangeActive:!0});case 24:U=!0,Qe.next=20;break;case 27:Qe.next=33;break;case 29:Qe.prev=29,Qe.t0=Qe.catch(18),V=!0,J=Qe.t0;case 33:Qe.prev=33,Qe.prev=34,!U&&re.return!=null&&re.return();case 36:if(Qe.prev=36,!V){Qe.next=39;break}throw J;case 39:return Qe.finish(36);case 40:return Qe.finish(33);case 41:if(!(D.length&&!g)){Qe.next=50;break}return Qe.prev=42,Qe.next=45,hn.MPCWallet.singleLogout({keyIds:D});case 45:Qe.next=50;break;case 47:Qe.prev=47,Qe.t1=Qe.catch(42),console.error(Qe.t1);case 50:return De=l.filter(function(nt){return!D.includes(nt.keyId)}),Qe.next=53,zt.set(v1,De);case 53:Ue=!0,Ve=!1,pe=void 0,Qe.prev=54,Se=l[Symbol.iterator]();case 56:if(Ue=(Ce=Se.next()).done){Qe.next=64;break}if(je=Ce.value,!je.isLogin){Qe.next=61;break}return Qe.next=61,vn.changeWalletName(je.keyId,je.walletName,{skipDuplicate:!0});case 61:Ue=!0,Qe.next=56;break;case 64:Qe.next=70;break;case 66:Qe.prev=66,Qe.t2=Qe.catch(54),Ve=!0,pe=Qe.t2;case 70:Qe.prev=70,Qe.prev=71,!Ue&&Se.return!=null&&Se.return();case 73:if(Qe.prev=73,!Ve){Qe.next=76;break}throw pe;case 76:return Qe.finish(73);case 77:return Qe.finish(70);case 78:return Qe.next=80,vn.onMetaChange();case 80:case"end":return Qe.stop()}},a,null,[[18,29,33,41],[34,,36,40],[42,47],[54,66,70,78],[71,,73,77]])}))()},i.getMPCAddress=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(oee);case 2:return u=g.sent,g.abrupt("return",u[o]||[]);case 4:case"end":return g.stop()}},a)}))()},i.removeSingle=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,li.removeKeyring(o,a);case 2:return g=I.sent,y=g.remainCount,I.next=6,u.onMPCWalletRemoved(a,{});case 6:return I.abrupt("return",{remainCount:y});case 7:case"end":return I.stop()}},l)}))()},i.initLoginStatus=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,YL,Mse).call(o);case 2:case"end":return l.stop()}},a)}))()},i.testPresign=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(Fl);case 2:return u=y.sent,y.next=5,K(o,z6,pD).call(o,"ecdsa",u);case 5:return l=y.sent,console.log(l),y.abrupt("return",l);case 8:case"end":return y.stop()}},a)}))()},i.testEddsaPresign=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(Fl);case 2:return u=g.sent,g.abrupt("return",K(o,z6,pD).call(o,"eddsa",u));case 4:case"end":return g.stop()}},a)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[wo,vn]}}]),n}(Yr);function Bse(){return JL.apply(this,arguments)}function JL(){return JL=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,zt.get(ud);case 2:if(e=i.sent,!(e===Ho.deleteConfirmed||e===Ho.passiveDeleted||e===Ho.deleted)){i.next=5;break}return i.abrupt("return");case 5:return i.prev=5,i.next=8,hn.MPCWallet.delSession();case 8:i.next=13;break;case 10:return i.prev=10,i.t0=i.catch(5),i.abrupt("return");case 13:case"end":return i.stop()}},r,null,[[5,10]])})),JL.apply(this,arguments)}function Ose(){return QL.apply(this,arguments)}function QL(){return QL=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return console.debug("[MPCWalletController:logoutFromApp]"),i.next=3,K(this,nl,Vl).call(this);case 3:if(e=i.sent,!e){i.next=7;break}return i.next=7,zt.set(ud,Ho.mpLogout);case 7:return i.next=9,K(this,DT,V6).call(this);case 9:case"end":return i.stop()}},r,this)})),QL.apply(this,arguments)}function MBe(){return eD.apply(this,arguments)}function eD(){return eD=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return console.debug("[MPCWalletController]:logoutOfAbsExpire"),i.next=3,K(this,nl,Vl).call(this);case 3:if(e=i.sent,!e){i.next=7;break}return i.next=7,zt.set(ud,Ho.absoluteExpireLogout);case 7:return i.next=9,K(this,DT,V6).call(this);case 9:case"end":return i.stop()}},r,this)})),eD.apply(this,arguments)}function LBe(r){return tD.apply(this,arguments)}function tD(){return tD=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return n=e.infoList,i=e.sid,console.debug("[onConfirmedAuth]:".concat(i)),ce.next=5,K(this,XL,Lse).call(this);case 5:if(o=ce.sent,o){ce.next=8;break}throw Error("PK lost for qrcode:".concat(i));case 8:if(a=n.map(function(Re){var De=Re.encryptedKeyShares,Ue=Re.keyId,Ve=De.map(function(pe){return J5e(o,pe)});return{keyShares:Ve,keyId:Ue}}),l=(u=(s=n.find(function(Re){return Re.isActive}))===null||s===void 0?void 0:s.keyId)!==null&&u!==void 0?u:"",g=l,!l){ce.next=17;break}return ce.next=15,zt.set(Fl,l);case 15:ce.next=20;break;case 17:return ce.next=19,zt.get(Fl);case 19:g=ce.sent;case 20:for(he(this,rl,{keyshares:a,activeId:g}),y={},A=!0,I=!1,P=void 0,ce.prev=23,D=n[Symbol.iterator]();!(A=(U=D.next()).done);A=!0)V=U.value,y[V.keyId]=V.addressList;ce.next=31;break;case 27:ce.prev=27,ce.t0=ce.catch(23),I=!0,P=ce.t0;case 31:ce.prev=31,ce.prev=32,!A&&D.return!=null&&D.return();case 34:if(ce.prev=34,!I){ce.next=37;break}throw P;case 37:return ce.finish(34);case 38:return ce.finish(31);case 39:return ce.next=41,zt.get(iM);case 41:return J=ce.sent,ce.next=44,zt.set(iM,Mr({},J,y));case 44:return X(this,W6)&&X(this,W6).call(this),ce.next=47,zt.set(ud,Ho.active);case 47:return ce.next=49,K(this,bh,C0).call(this,su.success);case 49:case"end":return ce.stop()}},r,this,[[23,27,31,39],[32,,34,38]])})),tD.apply(this,arguments)}function Pse(){return rD.apply(this,arguments)}function rD(){return rD=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return console.debug("[MPCWalletController:onAutoLogout]"),i.next=3,K(this,nl,Vl).call(this);case 3:if(e=i.sent,e){i.next=7;break}return console.debug("[onAutoLogout] not active"),i.abrupt("return");case 7:return i.next=9,zt.set(ud,Ho.autoLogout);case 9:return i.next=11,K(this,DT,V6).call(this);case 11:case"end":return i.stop()}},r,this)})),rD.apply(this,arguments)}function V6(){return nD.apply(this,arguments)}function nD(){return nD=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,li.removeAllMPCKeyshare();case 2:return i.next=4,vn.getMpcWallet();case 4:return e=i.sent,i.next=7,qi.revokePermissionForWalletItem(e,null);case 7:return i.next=9,K(this,KL,Bse).call(this);case 9:return i.next=11,Ii.refreshTokenDebounced();case 11:return i.next=13,ta.refreshRiskyApproveCount();case 13:if(!e){i.next=20;break}return i.next=16,H1.clearMpcWalletCache([e.id]);case 16:return i.next=18,zt.set(v1,[{keyId:e.id,walletName:e.metadata.name,isActive:!0,isLogin:!0,dbCreateTime:e.metadata.importTime}]);case 18:i.next=22;break;case 20:return i.next=22,zt.set(v1,[]);case 22:return i.next=24,K(this,Cse,WBe).call(this);case 24:case"end":return i.stop()}},r,this)})),nD.apply(this,arguments)}function C0(r){return iD.apply(this,arguments)}function iD(){return iD=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,zt.get(b0);case 2:if(n=s.sent,n){s.next=5;break}return s.abrupt("return");case 5:return s.next=7,zt.set(b0,gn(Mr({},n),{status:e}));case 7:case"end":return s.stop()}},r)})),iD.apply(this,arguments)}function DBe(){return sD.apply(this,arguments)}function sD(){return sD=(0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,zt.get(ud);case 2:if(e=o.sent,e===Ho.active){o.next=5;break}return o.abrupt("return");case 5:if(n=X(this,jL),i=Date.now(),!(i-n>_se)){o.next=10;break}return console.debug("[refreshAuthFn] last active time is too long, not refreshing auth"),o.abrupt("return");case 10:return o.prev=10,o.next=13,hn.MPCWallet.refreshAuthStatus();case 13:o.next=17;break;case 15:o.prev=15,o.t0=o.catch(10);case 17:case"end":return o.stop()}},r,this,[[10,15]])})),sD.apply(this,arguments)}function Nse(){return oD.apply(this,arguments)}function oD(){return oD=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,zt.get(Fl);case 3:if(e=i.sent,e){i.next=6;break}return i.abrupt("return");case 6:return i.next=8,K(this,FT,K6).call(this,e);case 8:return i.next=10,this.updateAllMPCInfo();case 10:return i.next=12,this.preparePresignScheduler(e,"ecdsa");case 12:return i.next=14,this.preparePresignScheduler(e,"eddsa");case 14:i.next=19;break;case 16:i.prev=16,i.t0=i.catch(0),console.error(i.t0);case 19:case"end":return i.stop()}},r,this,[[0,16]])})),oD.apply(this,arguments)}function Mse(){return aD.apply(this,arguments)}function aD(){return aD=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",K(this,UT,j6).call(this,!0));case 1:case"end":return n.stop()}},r,this)})),aD.apply(this,arguments)}function j6(){return uD.apply(this,arguments)}function uD(){return uD=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De=arguments;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return e=De.length>0&&De[0]!==void 0?De[0]:!1,n=this,i=function(){return e?!0:K(n,nl,Vl).call(n)},Ve.next=5,i();case 5:if(s=Ve.sent,s){Ve.next=8;break}return Ve.abrupt("return");case 8:return Ve.prev=8,Ve.next=11,hn.MPCWallet.pollLoginStatus();case 11:if(o=Ve.sent,a=o.data,u=a.status,l=a.hasSession,g=a.sessionAbsoluteExpire,y=a.sessionIdleExpire,A=a.walletId,I=a.keyId,P=Date.now(),u!=="ACTIVE"){Ve.next=40;break}if(!e){Ve.next=24;break}return Ve.next=24,zt.set(ud,Ho.active);case 24:return Ve.next=26,zt.get(Fl);case 26:if(D=Ve.sent,U=I||A,!(U&&D!==U)){Ve.next=39;break}return Ve.next=31,vn.getWalletItemByWalletId(D);case 31:return V=Ve.sent,Ve.next=34,vn.getCurrentSelectedWallet();case 34:return J=Ve.sent,re=J?.id,Ve.next=38,zt.set(see,V?gn(Mr({},V),{selectedWalletId:re}):null);case 38:K(this,FT,K6).call(this,U,{selectOnlyNeed:!0});case 39:return Ve.abrupt("return");case 40:return Ve.next=42,i();case 42:if(ce=Ve.sent,ce){Ve.next=45;break}return Ve.abrupt("return");case 45:if(!(l===!1||g&&P>=g)){Ve.next=49;break}return Ve.next=48,K(this,Tse,MBe).call(this);case 48:return Ve.abrupt("return");case 49:if(!(y&&P>=y)){Ve.next=53;break}return Ve.next=52,K(this,qL,Pse).call(this);case 52:return Ve.abrupt("return");case 53:if(!(u==="INACTIVE"||u==="DELTED")){Ve.next=57;break}return Ve.next=56,K(this,GL,Ose).call(this);case 56:return Ve.abrupt("return");case 57:Ve.next=69;break;case 59:return Ve.prev=59,Ve.t0=Ve.catch(8),Ve.next=63,i();case 63:if(Re=Ve.sent,Re){Ve.next=66;break}return Ve.abrupt("return");case 66:if(!aC(Ve.t0,aee)){Ve.next=69;break}return Ve.next=69,K(this,GL,Ose).call(this);case 69:case"end":return Ve.stop()}},r,this,[[8,59]])})),uD.apply(this,arguments)}function Vl(){return cD.apply(this,arguments)}function cD(){return cD=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,zt.get(ud);case 2:return e=i.sent,i.abrupt("return",e===Ho.active);case 4:case"end":return i.stop()}},r)})),cD.apply(this,arguments)}function UBe(r){return lD.apply(this,arguments)}function lD(){return lD=(0,k.A)(b().mark(function r(e){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,K(this,nl,Vl).call(this);case 2:if(n=o.sent,n){o.next=5;break}return o.abrupt("return",!1);case 5:return o.next=7,zt.get(Fl);case 7:return i=o.sent,o.abrupt("return",i===e);case 9:case"end":return o.stop()}},r,this)})),lD.apply(this,arguments)}function fD(r,e,n){return dD.apply(this,arguments)}function dD(){return dD=(0,k.A)(b().mark(function r(e,n,i){var s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=K(this,U2,WT).call(this,e),s){g.next=3;break}return g.abrupt("return");case 3:if(o=s.keyShares.find(function(y){return y.algorithm===n}),o){g.next=6;break}return g.abrupt("return");case 6:return g.next=8,sBe({keyShareData:o});case 8:return a=g.sent,u=new Set(a.map(function(y){return y.preSignatureId})),g.next=12,i.filterAndSaveQueue(function(y){return!y||y.keyDataId!==o.keyDataId?!1:u.has(y.preSignSessionId)});case 12:case"end":return g.stop()}},r,this)})),dD.apply(this,arguments)}function FBe(r){return hD.apply(this,arguments)}function hD(){return hD=(0,k.A)(b().mark(function r(e){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,K(this,H6,fD).call(this,e,"ecdsa",vse(e));case 2:return i.next=4,K(this,H6,fD).call(this,e,"eddsa",wse(e));case 4:case"end":return i.stop()}},r,this)})),hD.apply(this,arguments)}function pD(r,e){return gD.apply(this,arguments)}function gD(){return gD=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(Ul);case 2:if(i=g.sent,!i){g.next=5;break}return g.abrupt("return",null);case 5:return g.next=7,zt.get(Fl);case 7:if(s=g.sent,s===n){g.next=10;break}return g.abrupt("return",null);case 10:return g.next=12,K(this,UT,j6).call(this);case 12:return g.next=14,K(this,nl,Vl).call(this);case 14:if(o=g.sent,o){g.next=17;break}return g.abrupt("return",null);case 17:if(a=K(this,U2,WT).call(this,n),a){g.next=21;break}return console.debug("[presignWithAlgorithm] no keyshare"),g.abrupt("return",null);case 21:if(u=a.keyShares.find(function(y){return y.algorithm===e}),u){g.next=25;break}return console.debug("[presignWithAlgorithm] no keyshareData"),g.abrupt("return",null);case 25:if(e!=="ecdsa"){g.next=29;break}return g.abrupt("return",gse({keyShareData:u}));case 29:if(e!=="eddsa"){g.next=33;break}return g.abrupt("return",yse({keyShareData:u}));case 33:return console.debug("[presignWithAlgorithm] unknown algorithm",e),g.abrupt("return",null);case 35:case"end":return g.stop()}},r,this)})),gD.apply(this,arguments)}function WT(r){var e=li.getMpcKeyring(r);return e?e.keyshare:(console.debug("[getKeyshare]:no mpcKeyring"),null)}function Crt(){return yD.apply(this,arguments)}function yD(){return yD=_async_to_generator(regeneratorRuntime.mark(function r(){var e;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,store.get(activeMPCWalletIdBgAtom);case 2:if(e=i.sent,e){i.next=5;break}return i.abrupt("return",null);case 5:return i.abrupt("return",_class_private_method_get(this,U2,WT).call(this,e));case 6:case"end":return i.stop()}},r,this)})),yD.apply(this,arguments)}function mD(r){return bD.apply(this,arguments)}function bD(){return bD=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,zt.get(Fl);case 2:if(n=s.sent,n){s.next=5;break}return s.abrupt("return",null);case 5:return s.abrupt("return",this.preparePresignScheduler(n,e));case 6:case"end":return s.stop()}},r,this)})),bD.apply(this,arguments)}function K6(r){return vD.apply(this,arguments)}function vD(){return vD=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u=arguments;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return n=u.length>1&&u[1]!==void 0?u[1]:{},g.next=3,zt.get(Fl);case 3:if(i=g.sent,i===e){g.next=24;break}return g.next=7,zt.get(w2);case 7:if(s=g.sent,!i){g.next=14;break}return g.next=11,vn.getWalletItemByWalletId(i);case 11:return o=g.sent,g.next=14,qi.revokePermissionForWalletItem(o,null);case 14:return g.next=16,zt.set(Fl,e);case 16:return g.next=18,vn.onMetaChange();case 18:return g.next=20,oM((0,k.A)(b().mark(function y(){var A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,vn.getWalletItemByWalletId(e);case 2:return A=P.sent,P.abrupt("return",!!A);case 4:case"end":return P.stop()}},y)})));case 20:if(a=n.selectOnlyNeed?i===s:!0,!a){g.next=24;break}return g.next=24,vn.selectWallet(e);case 24:return g.next=26,this.preparePresignScheduler(e,"ecdsa");case 26:return g.next=28,this.preparePresignScheduler(e,"eddsa");case 28:return g.next=30,Ii.refreshTokenBalance({});case 30:return g.next=32,K(this,Rse,FBe).call(this,e);case 32:return g.next=34,ta.updateApproveCountForWalletId(e);case 34:return g.next=36,this.updateAllMPCInfo();case 36:case"end":return g.stop()}},r,this)})),vD.apply(this,arguments)}function Lse(){return wD.apply(this,arguments)}function wD(){return wD=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(X(this,_m)){n.next=8;break}return n.t0=he,n.t1=this,n.t2=_m,n.next=6,li.getSafeStore(F6);case 6:n.t3=n.sent,(0,n.t0)(n.t1,n.t2,n.t3);case 8:return n.abrupt("return",X(this,_m));case 9:case"end":return n.stop()}},r,this)})),wD.apply(this,arguments)}function WBe(){return AD.apply(this,arguments)}function AD(){return AD=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return he(this,_m,null),n.next=3,li.removeSafeStore(F6);case 3:case"end":return n.stop()}},r,this)})),AD.apply(this,arguments)}function HBe(){return _D.apply(this,arguments)}function _D(){return _D=(0,k.A)(b().mark(function r(){var e,n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,K(this,XL,Lse).call(this);case 2:return e=a.sent,e||(n=Q5e(),e=n.privateKey,he(this,_m,e)),a.next=6,mh.checkHasCompletedOnboarding();case 6:if(i=a.sent,!i){a.next=10;break}return a.next=10,li.storeInSafeStore(F6,e);case 10:return s=b2.PrivateKey.fromHex(e),a.abrupt("return",s.publicKey.toHex(!0));case 12:case"end":return a.stop()}},r,this)})),_D.apply(this,arguments)}var Ci=new NBe;_e("mpcWallet",{confirmAutoLogout:Ci.confirmAutoLogout.bind(Ci),logout:Ci.logout.bind(Ci),getQRCode:Ci.getQRCode.bind(Ci),cancelLogin:Ci.cancelLogin.bind(Ci),resetQRCode:Ci.resetQRCode.bind(Ci),removePendingMPCImport:Ci.removePendingMPCImport.bind(Ci),pollQRCodeStatus:Ci.pollQRCodeStatus.bind(Ci),importMPCWallet:Ci.importMPCWallet.bind(Ci),createNewValutAndImportMPC:Ci.createNewValutAndImportMPC.bind(Ci),changeActiveMPCWallet:Ci.changeActiveMPCWallet.bind(Ci),requestMoreMPC:Ci.requestMoreMPC.bind(Ci),sendRequestMoreMPCAgain:Ci.sendRequestMoreMPCAgain.bind(Ci),updateAllMPCInfo:Ci.updateAllMPCInfo.bind(Ci),getMPCAddress:Ci.getMPCAddress.bind(Ci),removeSingle:Ci.removeSingle.bind(Ci),pollLoginStatus:Ci.pollLoginStatus.bind(Ci)}),globalThis.mpcWalletController=Ci;var Em=new WeakMap,G6=new WeakMap,zBe=function(){"use strict";function r(n){var i=n.keyshare,s=n.accountIds;(0,G.A)(this,r),this.type=di.mpc,this.walletId=null,de(this,Em,{writable:!0,value:null}),de(this,G6,{writable:!0,value:[]}),he(this,G6,s),he(this,Em,i)}var e=r.prototype;return e.clearKeyshare=function(){console.log("[MPCKeyring] clearKeyshare"),he(this,Em,null)},e.changeToNewKeyshare=function(i){var s=this;return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:he(s,Em,i);case 1:case"end":return u.stop()}},o)}))()},e.getAccountIds=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",X(i,G6));case 1:case"end":return a.stop()}},s)}))()},e.getSupportedNetworkAndAddressTypeList=function(){return(0,k.A)(b().mark(function i(){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",[{networkType:nn.evm,addressType:$s.EVM_EOA},{networkType:nn.solana,addressType:$s.SOL_2},{networkType:nn.tron,addressType:$s.TRON},{networkType:nn.sui,addressType:$s.SUI},{networkType:nn.ton,addressType:$s.TON}]);case 1:case"end":return o.stop()}},i)}))()},e.getAccountAddress=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,zt.get(oee);case 2:if(u=A.sent,l=(u||{})[o.walletId]||[],g=l.find(function(I){return I.network===s}),g){A.next=7;break}return A.abrupt("return","");case 7:return A.abrupt("return",g.address);case 8:case"end":return A.stop()}},a)}))()},e.exportAccount=function(i,s){throw new Error("Method not implemented.")},e.signMessage=function(i,s,o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,Ci.mpcSign({walletId:l.walletId,network:s,data:o,signOrderId:u,signType:"message"});case 2:if(y=P.sent,s!==nn.solana){P.next=7;break}return P.abrupt("return",Aw.encode(mo(ys(y))));case 7:if(s!==nn.sui){P.next=17;break}return P.next=10,l.getPublicKeyHex(i,s);case 10:if(A=P.sent,A){P.next=13;break}throw Error("Get public key failed for sui in mpc signMessage");case 13:return console.debug("[MPCKeyring sui signMessage]",y,A),P.abrupt("return",yG(mo(y),mo(A)));case 17:return P.abrupt("return",y);case 18:case"end":return P.stop()}},g)}))()},e.signTx=function(i,s,o,a,u){var l=this;return(0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",Ci.mpcSign({walletId:l.walletId,network:s,data:o,signOrderId:u,signType:"transaction"}));case 1:case"end":return A.stop()}},g)}))()},e.getPublicKeyHex=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(u=xL(s),X(o,Em)){y.next=3;break}return y.abrupt("return",null);case 3:if(l=X(o,Em).keyShares.find(function(A){return A.algorithm===u}),l){y.next=6;break}return y.abrupt("return",null);case 6:return y.abrupt("return",ys(l.publicKey));case 7:case"end":return y.stop()}},a)}))()},e.checkDuplicate=function(i){return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",!1);case 1:case"end":return a.stop()}},s)}))()},e.serialize=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",{accountIds:X(i,G6),keyshare:null});case 1:case"end":return a.stop()}},s)}))()},e.destroy=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:he(i,Em,null);case 1:case"end":return a.stop()}},s)}))()},r.deserialize=function(i){return(0,k.A)(b().mark(function s(){var o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=i.accountIds,a=i.keyshare,l.abrupt("return",new r({accountIds:o,keyshare:a}));case 2:case"end":return l.stop()}},s)}))()},(0,L.A)(r,[{key:"keyshare",get:function(){return X(this,Em)}}]),r}(),x0=new WeakMap,cg=new WeakMap,lg=new WeakMap,fg=new WeakMap,dg=new WeakMap,hg=new WeakMap,q6=new WeakSet,Dse=function(){"use strict";function r(n){var i=n.privateKey,s=n.accountId,o=s===void 0?null:s,a=n.networkType,u=n.addressType;(0,G.A)(this,r),B(this,q6),this.type=di.privateKey,this.walletId=null,de(this,x0,{writable:!0,value:null}),de(this,cg,{writable:!0,value:null}),de(this,lg,{writable:!0,value:null}),de(this,fg,{writable:!0,value:null}),de(this,dg,{writable:!0,value:null}),de(this,hg,{writable:!0,value:null}),this.addressType=null,he(this,x0,o),this.network=a,a===nn.evm&&he(this,cg,new m3(i)),a===nn.solana&&he(this,lg,new z3(i)),a===nn.tron&&he(this,fg,new VP(i)),a===nn.sui&&he(this,dg,new ZO(i)),a===nn.ton&&he(this,hg,new o8(i)),this.addressType=u??null}var e=r.prototype;return e.addAccount=function(){throw new Error("Method not implemented.")},e.getAccountAddress=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(s===o.network){l.next=2;break}throw new Error("Network type does not match");case 2:if(i===X(o,x0)){l.next=4;break}throw new Error("Account ID does not match");case 4:if(s!==nn.evm){l.next=8;break}return l.abrupt("return",X(o,cg).getAddress());case 8:if(s!==nn.solana){l.next=12;break}return l.abrupt("return",X(o,lg).getAddress());case 12:if(s!==nn.tron){l.next=16;break}return l.abrupt("return",X(o,fg).getAddress());case 16:if(s!==nn.sui){l.next=20;break}return l.abrupt("return",X(o,dg).getAddress());case 20:if(s!==nn.ton){l.next=24;break}return l.abrupt("return",X(o,hg).getAddress());case 24:throw new Error("Network type not supported");case 25:case"end":return l.stop()}},a)}))()},e.getPublicKeyHex=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(s===o.network){l.next=2;break}throw new Error("Network type does not match");case 2:if(i===X(o,x0)){l.next=4;break}throw new Error("Account ID does not match");case 4:if(s!==nn.evm){l.next=8;break}return l.abrupt("return",X(o,cg).getPublicKeyHex());case 8:if(s!==nn.solana){l.next=12;break}return l.abrupt("return",X(o,lg).getPublicKeyHex());case 12:if(s!==nn.tron){l.next=16;break}return l.abrupt("return",X(o,fg).getPublicKeyHex());case 16:if(s!==nn.sui){l.next=20;break}return l.abrupt("return",X(o,dg).getPublicKeyHex());case 20:if(s!==nn.ton){l.next=24;break}return l.abrupt("return",X(o,hg).getPublicKeyHex());case 24:throw new Error("Network type not supported");case 25:case"end":return l.stop()}},a)}))()},e.getSupportedNetworkAndAddressTypeList=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",[{networkType:i.network,addressType:i.addressType}]);case 1:case"end":return a.stop()}},s)}))()},e.getAccountIds=function(){var i=this;return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(X(i,x0)){a.next=4;break}return a.abrupt("return",[]);case 4:return a.abrupt("return",[X(i,x0)]);case 5:case"end":return a.stop()}},s)}))()},e.getAddressForNetwork=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(s===o.network){l.next=2;break}throw new Error("Network type does not match");case 2:if(s!==nn.evm){l.next=6;break}return l.abrupt("return",X(o,cg).getAddress());case 6:if(s!==nn.solana){l.next=10;break}return l.abrupt("return",X(o,lg).getAddress());case 10:if(s!==nn.tron){l.next=14;break}return l.abrupt("return",X(o,fg).getAddress());case 14:if(s!==nn.sui){l.next=18;break}return l.abrupt("return",X(o,dg).getAddress());case 18:if(s!==nn.ton){l.next=22;break}return l.abrupt("return",X(o,hg).getAddress());case 22:throw new Error("Network type not supported");case 23:case"end":return l.stop()}},a)}))()},e.signMessage=function(i,s,o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(s===u.network){y.next=2;break}throw new Error("Network type does not match");case 2:if(i===X(u,x0)){y.next=4;break}throw new Error("Account ID does not match");case 4:if(s!==nn.evm){y.next=8;break}return y.abrupt("return",X(u,cg).signMessage(o,a));case 8:if(s!==nn.solana){y.next=12;break}return y.abrupt("return",X(u,lg).signMessage(o));case 12:if(s!==nn.tron){y.next=16;break}return y.abrupt("return",X(u,fg).signMessage(o));case 16:if(s!==nn.sui){y.next=20;break}return y.abrupt("return",X(u,dg).signMessage(o));case 20:if(s!==nn.ton){y.next=24;break}return y.abrupt("return",X(u,hg).signMessage(o));case 24:throw new Error("Network type not supported");case 25:case"end":return y.stop()}},l)}))()},e.signTx=function(i,s,o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(s===u.network){y.next=2;break}throw new Error("Network type does not match");case 2:if(i===X(u,x0)){y.next=4;break}throw new Error("Account ID does not match");case 4:if(s!==nn.evm){y.next=8;break}return y.abrupt("return",X(u,cg).signTransaction(o,a));case 8:if(s!==nn.solana){y.next=12;break}return y.abrupt("return",X(u,lg).signTransaction(o));case 12:if(s!==nn.tron){y.next=16;break}return y.abrupt("return",X(u,fg).signTransaction(o));case 16:if(s!==nn.sui){y.next=20;break}return y.abrupt("return",X(u,dg).signTransaction(o));case 20:if(s!==nn.ton){y.next=24;break}return y.abrupt("return",X(u,hg).signTransaction(o));case 24:throw new Error("Network type not supported");case 25:case"end":return y.stop()}},l)}))()},e.removeAccount=function(i){return(0,k.A)(b().mark(function s(){return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return a.stop()}},s)}))()},e.exportAccount=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(s===o.network){l.next=2;break}throw new Error("Network type does not match");case 2:if(i===X(o,x0)){l.next=4;break}throw new Error("Account ID does not match");case 4:return l.abrupt("return",K(o,q6,ED).call(o));case 5:case"end":return l.stop()}},a)}))()},e.checkDuplicate=function(i,s){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,K(o,q6,ED).call(o);case 2:if(u=g.sent,u=Use(u),i=Use(i),!s){g.next=7;break}return g.abrupt("return",i===u&&s===o.network);case 7:return g.abrupt("return",i===u);case 8:case"end":return g.stop()}},a)}))()},e.addAcount=function(){return(0,k.A)(b().mark(function i(){return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return o.stop()}},i)}))()},e.serialize=function(){var i=this;return(0,k.A)(b().mark(function s(){var o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,K(i,q6,ED).call(i);case 2:return o=u.sent,u.abrupt("return",{accountId:X(i,x0),privateKey:o,network:i.network});case 4:case"end":return u.stop()}},s)}))()},r.deserialize=function(i){return(0,k.A)(b().mark(function s(){var o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(o=i.accountId,a=i.privateKey,u=i.network,u){g.next=3;break}throw new Error("Network type is required for deserialization");case 3:return g.abrupt("return",new r({privateKey:a,accountId:o,networkType:u}));case 4:case"end":return g.stop()}},s)}))()},r}();function ED(){if(X(this,cg))return X(this,cg).exportPrivateKey();if(X(this,lg))return X(this,lg).exportPrivateKey();if(X(this,fg))return X(this,fg).exportPrivateKey();if(X(this,dg))return X(this,dg).exportPrivateKey();if(X(this,hg))return X(this,hg).exportPrivateKey();throw Error("No private key to export")}var Use=function(r){return r.startsWith("0x")?r.slice(2):r};function $Be(r){r.startsWith("0x")&&(r=r.slice(2));var e=[];return m3.isValidPk(r)&&e.push(nn.evm),z3.isValidPk(r)&&e.push(nn.solana),VP.isValidPk(r)&&e.push(nn.tron),ZO.isValidPk(r)&&e.push(nn.sui),o8.isValidPk(r)&&e.push(nn.ton),e}var VBe=function(r){var e=r.privateKey,n=r.publicKeyHex,i=r.curve,s=r.config,o=s.attestationForKeyShareA,a=s.attestationPCR0s,u=s.publicKeyForKeyShareB,l=s.spsVersion,g=s.expireAt,y=s.proofKeyPublicKeyHex,A=s.userPublicKeyHex,I=jBe({attestationForKeyShareA:o,attestationPCR0s:a}),P=KBe({privateKey:e,publicKeyHex:n,publicKeyForKeyShareA:I,publicKeyForKeyShareB:u,expireAt:g,curve:i,proofKeyPublicKeyHex:y});return gn(Mr({},P),{chain:i==="secp256k1"?"evm":"sol",spsVersion:l,binanceChainId:i==="secp256k1"?"56":"CT_501",userPublicKeyHex:A})},jBe=function(r){var e=r.attestationForKeyShareA,n=r.attestationPCR0s,i=(0,$l.yy)(BigInt(Date.now()),e);if(i.pcr0&&!n.includes(i.pcr0))throw Error("pcr0 not in attestationPCR0s");return i.public_key},KBe=function(r){var e=r.privateKey,n=r.publicKeyHex,i=r.publicKeyForKeyShareA,s=r.publicKeyForKeyShareB,o=r.expireAt,a=r.curve,u=r.proofKeyPublicKeyHex,l=ys(Jo(e));a==="ed25519"&&(l=l.slice(0,64),a="ed25519_seed");var g=(0,$l.Dh)(a,l,2),y=g.split(","),A=ur(y,2),I=A[0],P=A[1],D={public_key:ys(n),key_share:ys(I),expired_at:o,proof_public_key:ys(u)},U=(0,b2.encrypt)(i,HC(JSON.stringify(D))),V=(0,b2.encrypt)(s,HC(P));return{encryptedKeyShareAData:Jo(ire(U)),encryptedKeyShareB:xb(ire(V)),publicKey:i}},GBe=function(r){return r?Mg(r):null},qBe=function(r){return Lg(r)},vh=tn(44953),ZBe=function(r){return function(){var e=(0,k.A)(b().mark(function n(i,s,o,a){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",(0,vh.encrypt)(i,s,o,a,{algorithm:"PBKDF2",params:{iterations:r}}));case 1:case"end":return l.stop()}},n)}));return function(n,i,s,o){return e.apply(this,arguments)}}()},YBe=function(r){return function(){var e=(0,k.A)(b().mark(function n(i,s,o){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,vh.encryptWithDetail)(i,s,o,{algorithm:"PBKDF2",params:{iterations:r}}));case 1:case"end":return u.stop()}},n)}));return function(n,i,s){return e.apply(this,arguments)}}()},XBe=function(r){return function(){var e=(0,k.A)(b().mark(function n(i,s,o,a){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",(0,vh.keyFromPassword)(i,s,o,a??{algorithm:"PBKDF2",params:{iterations:r}}));case 1:case"end":return l.stop()}},n)}));return function(n,i,s,o){return e.apply(this,arguments)}}()},JBe=function(r){return function(e){return(0,vh.isVaultUpdated)(e,{algorithm:"PBKDF2",params:{iterations:r}})}},QBe=function(r){return{encrypt:ZBe(r),encryptWithKey:vh.encryptWithKey,encryptWithDetail:YBe(r),decrypt:vh.decrypt,decryptWithKey:vh.decryptWithKey,decryptWithDetail:vh.decryptWithDetail,keyFromPassword:XBe(r),isVaultUpdated:JBe(r),importKey:vh.importKey,exportKey:vh.exportKey,generateSalt:vh.generateSalt}},ms;(function(r){r.NoKeyring="KeyringController - No keyring found",r.KeyringNotFound="KeyringController - Keyring not found.",r.UnsafeDirectKeyringAccess="KeyringController - Returning keyring instances is unsafe",r.WrongPasswordType="KeyringController - Password must be of type string.",r.InvalidEmptyPassword="KeyringController - Password cannot be empty.",r.PasswordTooLong="KeyringController - Password must be less than 20 characters.",r.PaswordError="KeyringController - Password is incorrect.",r.NoFirstAccount="KeyringController - First Account not found.",r.DuplicatedAccount="KeyringController - The account you are trying to import is a duplicate",r.VaultError="KeyringController - Cannot unlock without a previous vault.",r.VaultDataError="KeyringController - The decrypted vault has an unexpected shape.",r.UnsupportedEncryptionKeyExport="KeyringController - The encryptor does not support encryption key export.",r.UnsupportedGenerateRandomMnemonic="KeyringController - The current keyring does not support the method generateRandomMnemonic.",r.UnsupportedExportWallet="KeyringController - The keyring does not support the method exportWallet.",r.UnsupportedExportAccount="`KeyringController - The keyring for the current address does not support the method exportAccount",r.UnsupportedRemoveAccount="`KeyringController - The keyring for the current address does not support the method removeAccount",r.UnsupportedSignTransaction="KeyringController - The keyring for the current address does not support the method signTransaction.",r.UnsupportedSignMessage="KeyringController - The keyring for the current address does not support the method signMessage.",r.UnsupportedSignPersonalMessage="KeyringController - The keyring for the current address does not support the method signPersonalMessage.",r.UnsupportedGetEncryptionPublicKey="KeyringController - The keyring for the current address does not support the method getEncryptionPublicKey.",r.UnsupportedDecryptMessage="KeyringController - The keyring for the current address does not support the method decryptMessage.",r.UnsupportedSignTypedMessage="KeyringController - The keyring for the current address does not support the method signTypedMessage.",r.UnsupportedGetAppKeyAddress="KeyringController - The keyring for the current address does not support the method getAppKeyAddress.",r.UnsupportedExportAppKeyForAddress="KeyringController - The keyring for the current address does not support the method exportAppKeyForAddress.",r.UnsupportedPrepareUserOperation="KeyringController - The keyring for the current address does not support the method prepareUserOperation.",r.UnsupportedPatchUserOperation="KeyringController - The keyring for the current address does not support the method patchUserOperation.",r.UnsupportedSignUserOperation="KeyringController - The keyring for the current address does not support the method signUserOperation.",r.UnsupportedVerifyMnemonic="KeyringController - The keyring does not support the method verifyMnemonic.",r.UnsupportedAddAccount="KeyringController - The keyring does not support the method addAccount.",r.NoAccountOnKeychain="KeyringController - The keychain doesn't have accounts.",r.MissingCredentials="KeyringController - Cannot persist vault without password and encryption key",r.MissingVaultData="KeyringController - Cannot persist vault without vault information",r.ExpiredCredentials="KeyringController - Encryption key and salt provided are expired",r.NoKeyringBuilder="KeyringController - No keyringBuilder found for keyring",r.DataType="KeyringController - Incorrect data type provided",r.NoHdKeyring="KeyringController - No HD Keyring found",r.ControllerLockRequired="KeyringController - attempt to update vault during a non mutually exclusive operation",r.MissingWalletId="KeyringController - Missing walletId",r.VerifyMnemonicInputError="KeyringController - VerifyMnemonicInputError"})(ms||(ms={}));var HT,eOe=(HT={},vt(HT,di.hd,eM),vt(HT,di.privateKey,Dse),vt(HT,di.mpc,zBe),HT),zT="local:keyring-vault",$1="local:keyshare-v2",F2="local:safestorage",V1=new Set,TD=new Set,SD=new WeakMap,Fse=new WeakMap,B0=new WeakMap,Ms=new WeakMap,Z6=new WeakMap,jl=new WeakMap,pg=new WeakMap,il=new WeakMap,$T=new WeakSet,Wse=new WeakSet,ID=new WeakSet,kD=new WeakSet,RD=new WeakSet,CD=new WeakSet,xf=new WeakSet,Y6=new WeakSet,X6=new WeakSet,xD=new WeakSet,BD=new WeakSet,Hse=new WeakSet,j1=new WeakSet,zse=new WeakSet,$se=new WeakSet,Vse=new WeakSet,Tm=new WeakSet,J6=new WeakSet,VT=new WeakSet,jse=new WeakSet,tOe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),de(F(s),il,{get:rOe,set:nOe}),B(F(s),$T),B(F(s),Wse),B(F(s),ID),B(F(s),kD),B(F(s),RD),B(F(s),CD),B(F(s),xf),B(F(s),Y6),B(F(s),X6),B(F(s),xD),B(F(s),BD),B(F(s),Hse),B(F(s),j1),B(F(s),zse),B(F(s),$se),B(F(s),Vse),B(F(s),Tm),B(F(s),J6),B(F(s),VT),B(F(s),jse),s.name="keyring",de(F(s),SD,{writable:!0,value:new In}),de(F(s),Fse,{writable:!0,value:new In}),de(F(s),B0,{writable:!0,value:QBe(6e5)}),de(F(s),Ms,{writable:!0,value:[]}),de(F(s),Z6,{writable:!0,value:null}),de(F(s),jl,{writable:!0,value:{}}),de(F(s),pg,{writable:!0,value:{}}),s}var i=n.prototype;return i.init=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:case"end":return u.stop()}},o)}))()},i.createNewVaultAndGenerateMnemonic=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.abrupt("return",K(a,xf,gd).call(a,(0,k.A)(b().mark(function y(){var A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(A=X(a,Ms).length,A){D.next=8;break}return D.next=4,K(a,$T,Q6).call(a,o,[{type:di.hd}]);case 4:return I=D.sent,D.abrupt("return",I[0]);case 8:return D.abrupt("return",X(a,Ms)[0].walletId);case 9:case"end":return D.stop()}},y)}))));case 1:case"end":return g.stop()}},u)}))()},i.createNewVaultAndImportPrivateKeys=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",K(l,xf,gd).call(l,(0,k.A)(b().mark(function I(){var P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return jT(o),De.next=3,K(l,$T,Q6).call(l,o,(0,Li.A)(u.map(function(Ue){return{type:di.privateKey,data:{privateKey:Ue,network:a}}})));case 3:for(P=De.sent,D=!0,U=!1,V=void 0,De.prev=5,J=P[Symbol.iterator]();!(D=(re=J.next()).done);D=!0)ce=re.value,V1.add(ce);De.next=13;break;case 9:De.prev=9,De.t0=De.catch(5),U=!0,V=De.t0;case 13:De.prev=13,De.prev=14,!D&&J.return!=null&&J.return();case 16:if(De.prev=16,!U){De.next=19;break}throw V;case 19:return De.finish(16);case 20:return De.finish(13);case 21:return De.abrupt("return",P);case 22:case"end":return De.stop()}},I,null,[[5,9,13,21],[14,,16,20]])}))));case 1:case"end":return A.stop()}},g)}))()},i.createNewVaultAndImportMnemonic=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.abrupt("return",K(u,xf,gd).call(u,(0,k.A)(b().mark(function A(){var I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return jT(o),D.next=3,K(u,$T,Q6).call(u,o,[{type:di.hd,data:{mnemonic:a}}]);case 3:return I=D.sent,V1.add(I[0]),D.abrupt("return",I[0]);case 6:case"end":return D.stop()}},A)}))));case 1:case"end":return y.stop()}},l)}))()},i.createNewVaultAndImportMPC=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.abrupt("return",K(u,xf,gd).call(u,(0,k.A)(b().mark(function A(){var I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se;return b().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:for(jT(o),I=!0,P=!1,D=void 0,je.prev=2,U=a[Symbol.iterator]();!(I=(V=U.next()).done);I=!0)J=V.value,X(u,jl)[J.keyId]=J;je.next=10;break;case 6:je.prev=6,je.t0=je.catch(2),P=!0,D=je.t0;case 10:je.prev=10,je.prev=11,!I&&U.return!=null&&U.return();case 13:if(je.prev=13,!P){je.next=16;break}throw D;case 16:return je.finish(13);case 17:return je.finish(10);case 18:return re=a.map(function($e){return{type:di.mpc,data:{keyshare:$e},walletId:$e.keyId}}),je.next=21,K(u,$T,Q6).call(u,o,re);case 21:for(ce=je.sent,Re=!0,De=!1,Ue=void 0,je.prev=23,Ve=ce[Symbol.iterator]();!(Re=(pe=Ve.next()).done);Re=!0)Se=pe.value,V1.add(Se);je.next=31;break;case 27:je.prev=27,je.t1=je.catch(23),De=!0,Ue=je.t1;case 31:je.prev=31,je.prev=32,!Re&&Ve.return!=null&&Ve.return();case 34:if(je.prev=34,!De){je.next=37;break}throw Ue;case 37:return je.finish(34);case 38:return je.finish(31);case 39:return je.abrupt("return",ce);case 40:case"end":return je.stop()}},A,null,[[2,6,10,18],[11,,13,17],[23,27,31,39],[32,,34,38]])}))));case 1:case"end":return y.stop()}},l)}))()},i.submitPassword=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(Ul);case 2:if(l=y.sent,l){y.next=5;break}return y.abrupt("return");case 5:return y.abrupt("return",K(a,VT,e4).call(a,(0,k.A)(b().mark(function A(){return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.t0=he,P.t1=a,P.t2=Ms,P.next=5,K(a,Wse,iOe).call(a,o);case 5:P.t3=P.sent,(0,P.t0)(P.t1,P.t2,P.t3),K(a,ID,Kse).call(a);case 8:case"end":return P.stop()}},A)}))));case 6:case"end":return y.stop()}},u)}))()},i.changePassword=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,u.verifyPasswordOrThrow(o);case 2:return y.abrupt("return",K(u,xf,gd).call(u,(0,k.A)(b().mark(function A(){var I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,zt.get(Ul);case 2:if(I=D.sent,!I){D.next=5;break}throw new Error(ms.MissingCredentials);case 5:jT(a),he(u,il,a);case 7:case"end":return D.stop()}},A)}))));case 3:case"end":return y.stop()}},l)}))()},i.verifyPasswordAndReturn=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,ee.getItem(zT);case 2:if(l=y.sent,l){y.next=5;break}throw new Error(ms.VaultError);case 5:return y.prev=5,y.next=8,X(a,B0).decrypt(o,l);case 8:return y.abrupt("return",!0);case 11:return y.prev=11,y.t0=y.catch(5),y.abrupt("return",!1);case 14:case"end":return y.stop()}},u,null,[[5,11]])}))()},i.verifyPasswordOrThrow=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,a.verifyPasswordAndReturn(o);case 2:if(l=y.sent,l){y.next=5;break}throw new Error(ms.PaswordError);case 5:case"end":return y.stop()}},u)}))()},i.verifyWalletMnemonic=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(g=X(u,Ms).find(function(J){return J.walletId===o}),g){V.next=3;break}throw new Error(ms.NoKeyring);case 3:if(g.type===di.hd){V.next=5;break}throw new Error(ms.UnsupportedVerifyMnemonic);case 5:if(!(a.length<3)){V.next=7;break}throw new Error(ms.VerifyMnemonicInputError);case 7:if(y=new Set(a.map(function(J){var re=J.index;return re})),y.size===a.length){V.next=10;break}throw new Error(ms.VerifyMnemonicInputError);case 10:return A=g,V.next=13,A.exportMnemonic();case 13:return I=V.sent,P=I.split(" "),D=a.every(function(J){var re=J.word,ce=J.index;return P[ce]===re}),V.abrupt("return",D);case 17:case"end":return V.stop()}},l)}))()},i.setLocked=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",K(o,VT,e4).call(o,(0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return he(o,il,null),A.next=3,K(o,Y6,UD).call(o);case 3:return A.next=5,zt.set(Ul,!0);case 5:zt.set(_1,[]);case 6:case"end":return A.stop()}},g)}))));case 1:case"end":return l.stop()}},a)}))()},i.exportWallet=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,u.verifyPasswordOrThrow(o);case 2:if(g=X(u,Ms).find(function(D){return D.walletId===a}),g){P.next=5;break}throw new Error(ms.NoKeyring);case 5:if(g.type===di.hd){P.next=7;break}throw new Error(ms.UnsupportedExportWallet);case 7:return y=g,P.next=10,y.exportMnemonic();case 10:return A=P.sent,P.abrupt("return",A);case 12:case"end":return P.stop()}},l)}))()},i.exportAccount=function(o){var a=o.password,u=o.walletId,l=o.accountId,g=o.networkType,y=this;return(0,k.A)(b().mark(function A(){var I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,y.verifyPasswordOrThrow(a);case 2:if(I=X(y,Ms).find(function(V){return V.walletId===u}),I){U.next=5;break}throw new Error(ms.NoKeyring);case 5:if(I.exportAccount){U.next=7;break}throw new Error(ms.UnsupportedExportAccount);case 7:return U.next=9,I.exportAccount(l,g);case 9:return P=U.sent,U.abrupt("return",P);case 11:case"end":return U.stop()}},A)}))()},i.splitKeyshare=function(o){var a=o.walletId,u=o.accountId,l=o.networkType,g=o.config,y=this;return(0,k.A)(b().mark(function A(){var I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:if(I=X(y,Ms).find(function(ce){return ce.walletId===a}),I){re.next=3;break}throw new Error(ms.NoKeyring);case 3:if(!(!I.exportAccount||!I.getPublicKeyHex)){re.next=5;break}throw new Error(ms.UnsupportedExportAccount);case 5:return re.next=7,I.exportAccount(u,l);case 7:return P=re.sent,re.next=10,I.getPublicKeyHex(u,l);case 10:if(D=re.sent,D){re.next=13;break}throw new Error("PublicKeyHex is empty for split keyshare");case 13:if(U=tBe(l),l!==nn.evm){re.next=19;break}V=m3.decodePK(P),re.next=24;break;case 19:if(l!==nn.solana){re.next=23;break}V=z3.decodePK(P),re.next=24;break;case 23:throw Error("Unsupported network type ".concat(l));case 24:return re.abrupt("return",VBe({privateKey:V,publicKeyHex:D,curve:U,config:g}));case 25:case"end":return re.stop()}},A)}))()},i.getPublicAddress=function(o,a,u,l){var g=this;return(0,k.A)(b().mark(function y(){var A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(A=X(g,Ms).find(function(U){return U.walletId===o}),A){D.next=3;break}throw new Error(ms.KeyringNotFound);case 3:return D.next=5,A.getAccountAddress(a,u,l);case 5:return I=D.sent,D.abrupt("return",I);case 7:case"end":return D.stop()}},y)}))()},i.getAddressListForWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(l=X(a,Ms).find(function(P){return P.walletId===o}),l){I.next=3;break}throw new Error(ms.KeyringNotFound);case 3:return I.next=5,l.getAccountIds();case 5:return g=I.sent,I.next=8,l.getSupportedNetworkAndAddressTypeList();case 8:return y=I.sent,I.abrupt("return",Promise.all(g.map(function(){var P=(0,k.A)(b().mark(function D(U){var V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Promise.all(y.map(function(){var ce=(0,k.A)(b().mark(function Re(De){var Ue,Ve,pe,Se,Ce,je;return b().wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Ue=De.networkType,Ve=De.addressType,Qe.next=3,li.getPublicAddress(o,U,Ue,Ve);case 3:return pe=Qe.sent,Qe.next=6,li.getPublicKeyHex(o,U,Ue);case 6:return Se=Qe.sent,Ce={address:pe,network:Ue,publicKeyHex:Se||void 0},Qe.next=10,K(li,zse,oOe).call(li,o,U,Ue);case 10:return je=Qe.sent,je&&Object.assign(Ce,je),Qe.abrupt("return",Ce);case 13:case"end":return Qe.stop()}},Re)}));return function(Re){return ce.apply(this,arguments)}}()));case 2:return V=re.sent,re.abrupt("return",{accountId:U,addressList:V});case 4:case"end":return re.stop()}},D)}));return function(D){return P.apply(this,arguments)}}())));case 10:case"end":return I.stop()}},u)}))()},i.addNewAccountForWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Ls();case 2:if(l=y.sent,l){y.next=5;break}throw new Error(ms.UnsupportedAddAccount);case 5:return y.abrupt("return",K(a,xf,gd).call(a,(0,k.A)(b().mark(function A(){var I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(I=X(a,Ms).find(function(V){return V.walletId===o}),I){U.next=3;break}throw new Error(ms.KeyringNotFound);case 3:if(I.addAccount){U.next=5;break}throw new Error(ms.UnsupportedAddAccount);case 5:return U.next=7,I.addAccount();case 7:return P=U.sent,U.abrupt("return",P);case 9:case"end":return U.stop()}},A)}))));case 6:case"end":return y.stop()}},u)}))()},i.generateNewMnemonicWallet=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",K(o,xf,gd).call(o,(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return y=Fm(),I.next=3,K(o,j1,W2).call(o,{type:di.hd,walletId:y});case 3:return I.abrupt("return",y);case 4:case"end":return I.stop()}},g)}))));case 1:case"end":return l.stop()}},a)}))()},i.importMnemonicWallet=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,a.peakMnemonicAddress(o);case 2:return l=y.sent,y.abrupt("return",K(a,xf,gd).call(a,(0,k.A)(b().mark(function A(){var I,P,D,U,V,J,re,ce,Re;return b().wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,a.getDuplicateAddressWalletIds(l);case 2:if(I=Ue.sent,!I.length){Ue.next=29;break}P=!0,D=!1,U=void 0,Ue.prev=5,V=I[Symbol.iterator]();case 7:if(P=(J=V.next()).done){Ue.next=15;break}return re=J.value,TD.add(re),Ue.next=12,K(a,xD,Yse).call(a,re);case 12:P=!0,Ue.next=7;break;case 15:Ue.next=21;break;case 17:Ue.prev=17,Ue.t0=Ue.catch(5),D=!0,U=Ue.t0;case 21:Ue.prev=21,Ue.prev=22,!P&&V.return!=null&&V.return();case 24:if(Ue.prev=24,!D){Ue.next=27;break}throw U;case 27:return Ue.finish(24);case 28:return Ue.finish(21);case 29:return ce=Fm(),Re=ef(),Ue.next=33,K(a,j1,W2).call(a,{type:di.hd,data:{mnemonic:o,accountIds:[Re]},walletId:ce});case 33:return V1.add(ce),Ue.abrupt("return",ce);case 35:case"end":return Ue.stop()}},A,null,[[5,17,21,29],[22,,24,28]])}))));case 4:case"end":return y.stop()}},u)}))()},i.importPrivateKeyWallet=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,u.peakPrivateKeyAddress(o,a);case 2:return g=A.sent,A.abrupt("return",K(u,xf,gd).call(u,(0,k.A)(b().mark(function I(){var P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,u.getDuplicateAddressWalletIds([g]);case 2:if(P=J.sent,!P.length){J.next=5;break}return J.abrupt("return",P[0]);case 5:return D=ef(),U=Fm(),J.next=9,K(u,j1,W2).call(u,{type:di.privateKey,data:{privateKey:o,network:a,accountId:D},walletId:U});case 9:return V1.add(U),J.abrupt("return",U);case 11:case"end":return J.stop()}},I)}))));case 4:case"end":return A.stop()}},l)}))()},i.importMPCKeyring=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return console.debug("[KeyringController:importMPCKeyring]"),g.abrupt("return",K(a,xf,gd).call(a,(0,k.A)(b().mark(function y(){var A,I,P,D,U,V,J,re,ce,Re;return b().wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:A=[],I=!0,P=!1,D=void 0,Ue.prev=2,U=o[Symbol.iterator]();case 4:if(I=(V=U.next()).done){Ue.next=20;break}if(J=V.value,X(a,jl)[J.keyId]=J,re=J.keyId,A.push(re),ce=X(a,Ms).find(function(Ve){return Ve.type===di.mpc&&Ve.walletId===re}),!ce){Ue.next=13;break}return ce.changeToNewKeyshare(J),Ue.abrupt("continue",17);case 13:return Re="a-".concat(re),Ue.next=16,K(a,j1,W2).call(a,{type:di.mpc,data:{keyshare:J,accountIds:[Re]},walletId:re});case 16:V1.add(re);case 17:I=!0,Ue.next=4;break;case 20:Ue.next=26;break;case 22:Ue.prev=22,Ue.t0=Ue.catch(2),P=!0,D=Ue.t0;case 26:Ue.prev=26,Ue.prev=27,!I&&U.return!=null&&U.return();case 29:if(Ue.prev=29,!P){Ue.next=32;break}throw D;case 32:return Ue.finish(29);case 33:return Ue.finish(26);case 34:return Ue.abrupt("return",A);case 35:case"end":return Ue.stop()}},y,null,[[2,22,26,34],[27,,29,33]])}))));case 2:case"end":return g.stop()}},u)}))()},i.guessPrivateKeyNetworkType=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",$Be(o));case 1:case"end":return l.stop()}},a)}))()},i.removeKeyring=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,zt.get(v1);case 2:return g=I.sent,y=g.filter(function(P){return P.isLogin}),I.abrupt("return",K(u,xf,gd).call(u,(0,k.A)(b().mark(function P(){var D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,u.verifyPasswordOrThrow(o);case 2:return V.next=4,K(u,xD,Yse).call(u,a);case 4:return D=X(u,Ms).filter(function(J){return J.type===di.mpc?!!y.some(function(re){return re.keyId===J.walletId}):!0}).length,V.abrupt("return",{remainCount:D});case 6:case"end":return V.stop()}},P)}))));case 5:case"end":return I.stop()}},l)}))()},i.removeMPCKeyshare=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return console.debug("[Keyringcontroller]: removeMPCKeyshare"),delete X(a,jl)[o],A.next=4,ee.getItem($1);case 4:return l=A.sent,l=l||{},delete l[o],A.next=9,ee.setItem($1,l);case 9:return g=a.getMpcKeyring(o),g&&g.clearKeyshare(),A.abrupt("return",!0);case 12:case"end":return A.stop()}},u)}))()},i.removeAllMPCKeyshare=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return he(o,jl,{}),U.next=3,ee.setItem($1,{});case 3:for(u=o.getAllMpcKeyrings(),l=!0,g=!1,y=void 0,U.prev=5,A=u[Symbol.iterator]();!(l=(I=A.next()).done);l=!0)P=I.value,P.clearKeyshare();U.next=13;break;case 9:U.prev=9,U.t0=U.catch(5),g=!0,y=U.t0;case 13:U.prev=13,U.prev=14,!l&&A.return!=null&&A.return();case 16:if(U.prev=16,!g){U.next=19;break}throw y;case 19:return U.finish(16);case 20:return U.finish(13);case 21:return U.abrupt("return",!0);case 22:case"end":return U.stop()}},a,null,[[5,9,13,21],[14,,16,20]])}))()},i.resetPassword=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",K(o,VT,e4).call(o,(0,k.A)(b().mark(function g(){return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",K(o,J6,ZD).call(o,(0,k.A)(b().mark(function I(){var P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:P=X(o,Ms),D=!0,U=!1,V=void 0,De.prev=2,J=P[Symbol.iterator]();case 4:if(D=(re=J.next()).done){De.next=11;break}return ce=re.value,De.next=8,K(o,X6,WD).call(o,ce);case 8:D=!0,De.next=4;break;case 11:De.next=17;break;case 13:De.prev=13,De.t0=De.catch(2),U=!0,V=De.t0;case 17:De.prev=17,De.prev=18,!D&&J.return!=null&&J.return();case 20:if(De.prev=20,!U){De.next=23;break}throw V;case 23:return De.finish(20);case 24:return De.finish(17);case 25:return he(o,Ms,[]),he(o,jl,{}),zt.set(_1,[]),De.next=30,ee.setItem(zT,"");case 30:return De.next=32,ee.setItem($1,{});case 32:return De.next=34,ee.setItem(F2,{});case 34:he(o,il,null);case 35:case"end":return De.stop()}},I,null,[[2,13,17,25],[18,,20,24]])}))));case 1:case"end":return A.stop()}},g)}))));case 1:case"end":return l.stop()}},a)}))()},i.checkDuplicatePrivateKey=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V;return b().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:g=X(u,Ms).filter(function(ce){return ce.type===di.privateKey}),y=!0,A=!1,I=void 0,re.prev=2,P=g[Symbol.iterator]();case 4:if(y=(D=P.next()).done){re.next=15;break}if(U=D.value,!U.checkDuplicate){re.next=12;break}return re.next=9,U.checkDuplicate(o,a);case 9:if(V=re.sent,!V){re.next=12;break}return re.abrupt("return",!0);case 12:y=!0,re.next=4;break;case 15:re.next=21;break;case 17:re.prev=17,re.t0=re.catch(2),A=!0,I=re.t0;case 21:re.prev=21,re.prev=22,!y&&P.return!=null&&P.return();case 24:if(re.prev=24,!A){re.next=27;break}throw I;case 27:return re.finish(24);case 28:return re.finish(21);case 29:return re.abrupt("return",!1);case 30:case"end":return re.stop()}},l,null,[[2,17,21,29],[22,,24,28]])}))()},i.checkDuplicateMnemonic=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:l=X(a,Ms).filter(function(re){return re.type===di.hd}),g=!0,y=!1,A=void 0,J.prev=2,I=l[Symbol.iterator]();case 4:if(g=(P=I.next()).done){J.next=15;break}if(D=P.value,!D.checkDuplicate){J.next=12;break}return J.next=9,D.checkDuplicate(o);case 9:if(U=J.sent,!U){J.next=12;break}return J.abrupt("return",!0);case 12:g=!0,J.next=4;break;case 15:J.next=21;break;case 17:J.prev=17,J.t0=J.catch(2),y=!0,A=J.t0;case 21:J.prev=21,J.prev=22,!g&&I.return!=null&&I.return();case 24:if(J.prev=24,!y){J.next=27;break}throw A;case 27:return J.finish(24);case 28:return J.finish(21);case 29:return J.abrupt("return",!1);case 30:case"end":return J.stop()}},u,null,[[2,17,21,29],[22,,24,28]])}))()},i.peakMnemonicAddress=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return u=new eM,l=ef(),De.next=4,u.restoreFromMnemonic(o,[l]);case 4:return De.next=6,u.getSupportedNetworkAndAddressTypeList();case 6:g=De.sent,y=[],A=!0,I=!1,P=void 0,De.prev=9,D=g[Symbol.iterator]();case 11:if(A=(U=D.next()).done){De.next=20;break}return V=U.value,J=V.networkType,re=V.addressType,De.next=15,u.getAccountAddress(l,J,re);case 15:ce=De.sent,y.push({network:J,address:ce,addressType:re});case 17:A=!0,De.next=11;break;case 20:De.next=26;break;case 22:De.prev=22,De.t0=De.catch(9),I=!0,P=De.t0;case 26:De.prev=26,De.prev=27,!A&&D.return!=null&&D.return();case 29:if(De.prev=29,!I){De.next=32;break}throw P;case 32:return De.finish(29);case 33:return De.finish(26);case 34:return De.abrupt("return",y);case 35:case"end":return De.stop()}},a,null,[[9,22,26,34],[27,,29,33]])}))()},i.peakPrivateKeyAddress=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return l=ef(),g=new Dse({privateKey:o,accountId:l,networkType:a}),I.next=4,g.getAddressForNetwork(l,a);case 4:return y=I.sent,I.abrupt("return",{address:y,network:a});case 6:case"end":return I.stop()}},u)}))()},i.signMessage=function(o){var a=o.message,u=o.accountId,l=o.walletId,g=o.networkType,y=o.chainId,A=o.signOrderId,I=this;return(0,k.A)(b().mark(function P(){var D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(D=X(I,Ms).find(function(re){return re.walletId===l}),D){J.next=3;break}throw new Error(ms.KeyringNotFound);case 3:return J.next=5,D.signMessage(u,g,a,y,A);case 5:return U=J.sent,J.abrupt("return",U);case 7:case"end":return J.stop()}},P)}))()},i.signTx=function(o){var a=o.transaction,u=o.accountId,l=o.walletId,g=o.networkType,y=o.chainId,A=o.signOrderId,I=this;return(0,k.A)(b().mark(function P(){var D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(D=X(I,Ms).find(function(re){return re.walletId===l}),D){J.next=3;break}throw new Error(ms.KeyringNotFound);case 3:return J.next=5,D.signTx(u,g,a,y,A);case 5:return U=J.sent,J.abrupt("return",U);case 7:case"end":return J.stop()}},P)}))()},i.getMpcKeyring=function(o){return X(this,Ms).find(function(a){return a.type===di.mpc&&a.walletId===o})},i.getAllMpcKeyrings=function(){return X(this,Ms).filter(function(o){return o.type===di.mpc})},i.storeInSafeStore=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,K(u,xf,gd).call(u,(0,k.A)(b().mark(function A(){return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:X(u,pg)[o]=a;case 1:case"end":return P.stop()}},A)})));case 2:case"end":return y.stop()}},l)}))()},i.removeSafeStore=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return delete X(a,pg)[o],y.next=3,ee.getItem(F2);case 3:return l=y.sent,l=l||{},delete l[o],y.next=8,ee.setItem(F2,l);case 8:case"end":return y.stop()}},u)}))()},i.getSafeStore=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.abrupt("return",X(a,pg)[o]);case 1:case"end":return g.stop()}},u)}))()},i.getPublicKeyHex=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(y=X(l,Ms).find(function(P){return P.walletId===o}),y){I.next=3;break}throw new Error(ms.KeyringNotFound);case 3:if(!y.getPublicKeyHex){I.next=7;break}return I.abrupt("return",y.getPublicKeyHex(a,u));case 7:return I.abrupt("return",void 0);case 8:case"end":return I.stop()}},g)}))()},i.getDuplicateAddressWalletIds=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:l=X(a,Ms),g=[],y=!0,A=!1,I=void 0,Re.prev=3,P=l[Symbol.iterator]();case 5:if(y=(D=P.next()).done){Re.next=16;break}return U=D.value,Re.next=9,a.getAddressListForWallet(U.walletId);case 9:V=Re.sent,J=(0,H.flatten)(V.map(function(De){return De.addressList})),re=o.some(function(De){return J.some(function(Ue){return Ue.address===De.address&&Ue.network===De.network})}),re&&g.push(U.walletId);case 13:y=!0,Re.next=5;break;case 16:Re.next=22;break;case 18:Re.prev=18,Re.t0=Re.catch(3),A=!0,I=Re.t0;case 22:Re.prev=22,Re.prev=23,!y&&P.return!=null&&P.return();case 25:if(Re.prev=25,!A){Re.next=28;break}throw I;case 28:return Re.finish(25);case 29:return Re.finish(22);case 30:return Re.abrupt("return",g);case 31:case"end":return Re.stop()}},u,null,[[3,18,22,30],[23,,25,29]])}))()},n}(Yr);function rOe(){return X(this,Z6)?qBe(X(this,Z6)):null}function nOe(r){he(this,Z6,GBe(r))}function Q6(r,e){return OD.apply(this,arguments)}function OD(){return OD=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(K(this,Tm,K1).call(this),typeof e=="string"){I.next=3;break}throw new TypeError(ms.WrongPasswordType);case 3:return he(this,il,e),I.next=6,K(this,Y6,UD).call(this);case 6:i=[],s=!0,o=!1,a=void 0,I.prev=8,u=n[Symbol.iterator]();case 10:if(s=(l=u.next()).done){I.next=19;break}return g=l.value,y=g.walletId||Fm(),I.next=15,K(this,j1,W2).call(this,{type:g.type,data:g.data,walletId:y});case 15:i.push(y);case 16:s=!0,I.next=10;break;case 19:I.next=25;break;case 21:I.prev=21,I.t0=I.catch(8),o=!0,a=I.t0;case 25:I.prev=25,I.prev=26,!s&&u.return!=null&&u.return();case 28:if(I.prev=28,!o){I.next=31;break}throw a;case 31:return I.finish(28);case 32:return I.finish(25);case 33:if(X(this,Ms).length){I.next=35;break}throw new Error(ms.NoFirstAccount);case 35:return I.next=37,K(this,ID,Kse).call(this);case 37:return I.abrupt("return",i);case 38:case"end":return I.stop()}},r,this,[[8,21,25,33],[26,,28,32]])})),OD.apply(this,arguments)}function iOe(r){return PD.apply(this,arguments)}function PD(){return PD=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=this,s.abrupt("return",K(this,J6,ZD).call(this,function(){var o=(0,k.A)(b().mark(function a(u){var l,g,y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return l=u.releaseLock,Re.next=3,ee.getItem(zT);case 3:if(g=Re.sent,g){Re.next=6;break}throw new Error(ms.VaultError);case 6:if(typeof e=="string"){Re.next=8;break}throw new TypeError(ms.WrongPasswordType);case 8:return Re.next=10,ee.getItem($1);case 10:if(Re.t0=Re.sent,Re.t0){Re.next=13;break}Re.t0={};case 13:return y=Re.t0,Re.next=16,X(n,B0).decrypt(e,g);case 16:return A=Re.sent,Re.next=19,ee.getItem(F2);case 19:if(Re.t1=Re.sent,Re.t1){Re.next=22;break}Re.t1={};case 22:if(I=Re.t1,!y){Re.next=35;break}Re.t2=b().keys(y);case 25:if((Re.t3=Re.t2()).done){Re.next=35;break}if(P=Re.t3.value,Object.hasOwn(y,P)){Re.next=29;break}return Re.abrupt("continue",25);case 29:return D=y[P],Re.next=32,X(n,B0).decrypt(e,D);case 32:X(n,jl)[P]=Re.sent,Re.next=25;break;case 35:if(!I){Re.next=47;break}Re.t4=b().keys(I);case 37:if((Re.t5=Re.t4()).done){Re.next=47;break}if(U=Re.t5.value,Object.hasOwn(I,U)){Re.next=41;break}return Re.abrupt("continue",37);case 41:return V=I[U],Re.next=44,X(n,B0).decrypt(e,V);case 44:X(n,pg)[U]=Re.sent,Re.next=37;break;case 47:if(he(n,il,e),lOe(A)){Re.next=50;break}throw new Error(ms.VaultDataError);case 50:return Re.next=52,K(n,BD,Xse).call(n,A);case 52:return Re.next=54,K(n,RD,qse).call(n);case 54:if(J=Re.sent,zt.set(_1,J),re=X(n,il)&&X(n,B0).isVaultUpdated&&!X(n,B0).isVaultUpdated(g),!re){Re.next=61;break}return l(),Re.next=61,K(n,kD,Gse).call(n);case 61:return Re.abrupt("return",X(n,Ms));case 62:case"end":return Re.stop()}},a)}));return function(a){return o.apply(this,arguments)}}()));case 2:case"end":return s.stop()}},r,this)})),PD.apply(this,arguments)}function Kse(){return ND.apply(this,arguments)}function ND(){return ND=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return K(this,Tm,K1).call(this),n.next=3,zt.set(Ul,!1);case 3:case"end":return n.stop()}},r,this)})),ND.apply(this,arguments)}function Gse(){var r=this;return K(this,J6,ZD).call(this,(0,k.A)(b().mark(function e(){var n,i,s,o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(X(r,il)){l.next=2;break}throw new Error(ms.MissingCredentials);case 2:return jT(X(r,il)),l.next=5,K(r,CD,Zse).call(r);case 5:if(n=l.sent,X(r,Ms).length!==0){l.next=20;break}return zt.set(_1,[]),l.next=10,ee.setItem(zT,"");case 10:return l.next=12,ee.setItem($1,{});case 12:return l.next=14,ee.setItem(F2,{});case 14:return he(r,il,null),he(r,jl,{}),he(r,pg,{}),l.abrupt("return",!0);case 20:return l.next=22,X(r,B0).encrypt(X(r,il),n);case 22:if(i=l.sent,i){l.next=25;break}throw new Error(ms.MissingVaultData);case 25:return l.next=27,K(r,$se,aOe).call(r);case 27:return s=l.sent,l.next=30,K(r,RD,qse).call(r);case 30:return o=l.sent,l.next=33,K(r,Vse,uOe).call(r);case 33:return a=l.sent,zt.set(_1,o),l.next=37,ee.setItem(zT,i);case 37:return l.next=39,ee.setItem($1,s);case 39:return l.next=41,ee.setItem(F2,a);case 41:return l.abrupt("return",!0);case 42:case"end":return l.stop()}},e)})))}function qse(){return MD.apply(this,arguments)}function MD(){return MD=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.all(X(this,Ms).map(fOe)));case 1:case"end":return n.stop()}},r,this)})),MD.apply(this,arguments)}function Zse(){return LD.apply(this,arguments)}function LD(){return LD=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Promise.all(X(this,Ms).map(function(){var s=(0,k.A)(b().mark(function o(a){var u,l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,a.serialize();case 2:if(u=A.sent,l=a.type,g=a.walletId,g){A.next=7;break}throw Error(ms.MissingWalletId);case 7:return A.abrupt("return",{type:l,data:u,walletId:g});case 8:case"end":return A.stop()}},o)}));return function(o){return s.apply(this,arguments)}}()));case 2:return e=i.sent,i.abrupt("return",e);case 4:case"end":return i.stop()}},r,this)})),LD.apply(this,arguments)}function gd(r){return DD.apply(this,arguments)}function DD(){return DD=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=this,s.abrupt("return",K(this,VT,e4).call(this,function(){var o=(0,k.A)(b().mark(function a(u){var l,g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return l=u.releaseLock,A.next=3,e({releaseLock:l});case 3:return g=A.sent,A.next=6,K(n,kD,Gse).call(n);case 6:return A.abrupt("return",g);case 7:case"end":return A.stop()}},a)}));return function(a){return o.apply(this,arguments)}}()));case 2:case"end":return s.stop()}},r,this)})),DD.apply(this,arguments)}function UD(){return FD.apply(this,arguments)}function FD(){return FD=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:K(this,Tm,K1).call(this),e=!0,n=!1,i=void 0,l.prev=2,s=X(this,Ms)[Symbol.iterator]();case 4:if(e=(o=s.next()).done){l.next=11;break}return a=o.value,l.next=8,K(this,X6,WD).call(this,a);case 8:e=!0,l.next=4;break;case 11:l.next=17;break;case 13:l.prev=13,l.t0=l.catch(2),n=!0,i=l.t0;case 17:l.prev=17,l.prev=18,!e&&s.return!=null&&s.return();case 20:if(l.prev=20,!n){l.next=23;break}throw i;case 23:return l.finish(20);case 24:return l.finish(17);case 25:he(this,Ms,[]);case 26:case"end":return l.stop()}},r,this,[[2,13,17,25],[18,,20,24]])})),FD.apply(this,arguments)}function WD(r){return HD.apply(this,arguments)}function HD(){return HD=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=3,(n=e.destroy)===null||n===void 0?void 0:n.call(e);case 3:case"end":return s.stop()}},r)})),HD.apply(this,arguments)}function Yse(r){return zD.apply(this,arguments)}function zD(){return zD=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(K(this,Tm,K1).call(this),n=X(this,Ms).find(function(o){return o.walletId===e}),n){s.next=4;break}throw new Error(ms.KeyringNotFound);case 4:return s.next=6,K(this,X6,WD).call(this,n);case 6:he(this,Ms,X(this,Ms).filter(function(o){return o.walletId!==e}));case 7:case"end":return s.stop()}},r,this)})),zD.apply(this,arguments)}function Xse(r){return $D.apply(this,arguments)}function $D(){return $D=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,K(this,Y6,UD).call(this);case 2:n=!0,i=!1,s=void 0,g.prev=3,o=e[Symbol.iterator]();case 5:if(n=(a=o.next()).done){g.next=12;break}return u=a.value,g.next=9,K(this,Hse,sOe).call(this,u);case 9:n=!0,g.next=5;break;case 12:g.next=18;break;case 14:g.prev=14,g.t0=g.catch(3),i=!0,s=g.t0;case 18:g.prev=18,g.prev=19,!n&&o.return!=null&&o.return();case 21:if(g.prev=21,!i){g.next=24;break}throw s;case 24:return g.finish(21);case 25:return g.finish(18);case 26:case"end":return g.stop()}},r,this,[[3,14,18,26],[19,,21,25]])})),$D.apply(this,arguments)}function sOe(r){return VD.apply(this,arguments)}function VD(){return VD=(0,k.A)(b().mark(function r(e){var n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return K(this,Tm,K1).call(this),a.prev=1,n=e.type,i=e.walletId,s=e.data,a.next=5,K(this,j1,W2).call(this,{type:n,walletId:i,data:s});case 5:return a.abrupt("return",a.sent);case 8:return a.prev=8,a.t0=a.catch(1),a.abrupt("return",null);case 11:case"end":return a.stop()}},r,this,[[1,8]])})),VD.apply(this,arguments)}function W2(r){return jD.apply(this,arguments)}function jD(){return jD=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(n=e.type,i=e.walletId,s=e.data,K(this,Tm,K1).call(this),o=eOe[n],o){P.next=5;break}throw new Error("".concat(ms.NoKeyringBuilder,". Keyring type: ").concat(n));case 5:if(u=s,!(n===di.hd&&(!$m(s)||!s.mnemonic))){P.next=13;break}return a=new eM,P.next=11,a.generateRandomMnemonic();case 11:P.next=17;break;case 13:return n===di.privateKey?!((l=s)===null||l===void 0)&&l.accountId||(g=ef(),u=Mr({accountId:g},s)):n===di.mpc&&(!((y=s)===null||y===void 0)&&y.accountIds||(A=ef(),u=Mr({accountIds:[A]},s)),s.keyshare||(u.keyshare=X(this,jl)[i])),P.next=16,o.deserialize(u);case 16:a=P.sent;case 17:return a.walletId=i,X(this,Ms).push(a),P.abrupt("return",a);case 20:case"end":return P.stop()}},r,this)})),jD.apply(this,arguments)}function oOe(r,e,n){return KD.apply(this,arguments)}function KD(){return KD=(0,k.A)(b().mark(function r(e,n,i){var s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=X(this,Ms).find(function(l){return l.walletId===e}),s){u.next=3;break}throw new Error(ms.KeyringNotFound);case 3:if(s.type===di.hd){u.next=5;break}return u.abrupt("return",null);case 5:return o=s,u.abrupt("return",o.getDerivationInfo(n,i));case 7:case"end":return u.stop()}},r,this)})),KD.apply(this,arguments)}function aOe(){return GD.apply(this,arguments)}function GD(){return GD=(0,k.A)(b().mark(function r(){var e,n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e={},a.t0=b().keys(X(this,jl));case 2:if((a.t1=a.t0()).done){a.next=13;break}if(n=a.t1.value,Object.hasOwn(X(this,jl),n)){a.next=6;break}return a.abrupt("continue",2);case 6:return i=X(this,jl)[n],a.next=9,X(this,B0).encrypt(X(this,il),i);case 9:s=a.sent,e[n]=s,a.next=2;break;case 13:return a.abrupt("return",e);case 14:case"end":return a.stop()}},r,this)})),GD.apply(this,arguments)}function uOe(){return qD.apply(this,arguments)}function qD(){return qD=(0,k.A)(b().mark(function r(){var e,n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e={},a.t0=b().keys(X(this,pg));case 2:if((a.t1=a.t0()).done){a.next=13;break}if(n=a.t1.value,Object.hasOwn(X(this,pg),n)){a.next=6;break}return a.abrupt("continue",2);case 6:return i=X(this,pg)[n],a.next=9,X(this,B0).encrypt(X(this,il),i);case 9:s=a.sent,e[n]=s,a.next=2;break;case 13:return a.abrupt("return",e);case 14:case"end":return a.stop()}},r,this)})),qD.apply(this,arguments)}function K1(){if(!X(this,SD).isLocked())throw new Error(ms.ControllerLockRequired)}function ZD(r){return YD.apply(this,arguments)}function YD(){return YD=(0,k.A)(b().mark(function r(e){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return K(this,Tm,K1).call(this),i.abrupt("return",l7(X(this,Fse),e));case 2:case"end":return i.stop()}},r,this)})),YD.apply(this,arguments)}function e4(r){return XD.apply(this,arguments)}function XD(){return XD=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=this,s.abrupt("return",K(this,jse,cOe).call(this,function(){var o=(0,k.A)(b().mark(function a(u){var l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return l=u.releaseLock,P.next=3,K(n,CD,Zse).call(n);case 3:return g=P.sent,y=X(n,il),A=X(n,jl),P.prev=6,P.next=9,e({releaseLock:l});case 9:return P.abrupt("return",P.sent);case 12:return P.prev=12,P.t0=P.catch(6),he(n,jl,A),P.next=17,K(n,BD,Xse).call(n,g);case 17:throw he(n,il,y),P.t0;case 19:case"end":return P.stop()}},a,null,[[6,12]])}));return function(a){return o.apply(this,arguments)}}()));case 2:case"end":return s.stop()}},r,this)})),XD.apply(this,arguments)}function cOe(r){return JD.apply(this,arguments)}function JD(){return JD=(0,k.A)(b().mark(function r(e){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",l7(X(this,SD),e));case 1:case"end":return i.stop()}},r,this)})),JD.apply(this,arguments)}function jT(r){if(typeof r!="string")throw new Error(ms.WrongPasswordType);if(!r||!r.length)throw new Error(ms.InvalidEmptyPassword);if(r.length>20)throw new Error(ms.PasswordTooLong)}function lOe(r){return typeof r=="object"&&Array.isArray(r)&&r.every(function(e){return e.type&&Zm(e.data)})}function fOe(r){return QD.apply(this,arguments)}function QD(){return QD=(0,k.A)(b().mark(function r(e){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,e.getAccountIds();case 2:return n=o.sent,o.next=5,e.getSupportedNetworkAndAddressTypeList();case 5:return i=o.sent,o.abrupt("return",{type:e.type,walletId:e.walletId,accounts:n,supportedNetworkAndAddressTypeList:i});case 7:case"end":return o.stop()}},r)})),QD.apply(this,arguments)}var li=new tOe;_e("keyring",{submitPassword:li.submitPassword.bind(li),verifyPassword:li.verifyPasswordAndReturn.bind(li),changePassword:li.changePassword.bind(li),setLocked:li.setLocked.bind(li),exportWallet:li.exportWallet.bind(li),exportAccount:li.exportAccount.bind(li),guessPrivateKeyNetworkType:li.guessPrivateKeyNetworkType.bind(li),checkDuplicatePrivateKey:li.checkDuplicatePrivateKey.bind(li),checkDuplicateMnemonic:li.checkDuplicateMnemonic.bind(li),peakMnemonicAddress:li.peakMnemonicAddress.bind(li),peakPrivateKeyAddress:li.peakPrivateKeyAddress.bind(li)});var dOe=1e3*60,hOe=new Nh(5*60*1e3),pOe=5*60*1e3,KT=new WeakMap,t4=new WeakMap,eU=new WeakMap,tU=new WeakMap,rU=new WeakMap,nU=new WeakMap,iU=new WeakMap,sU=new WeakMap,oU=new WeakMap,aU=new WeakMap,uU=new WeakSet,cU=new WeakSet,Jse=new WeakSet,Qse=new WeakSet,eoe=new WeakSet,gOe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),uU),B(F(s),cU),B(F(s),Jse),B(F(s),Qse),B(F(s),eoe),s.name="extension",de(F(s),KT,{writable:!0,value:0}),de(F(s),t4,{writable:!0,value:null}),de(F(s),eU,{writable:!0,value:[]}),de(F(s),tU,{writable:!0,value:[]}),de(F(s),rU,{writable:!0,value:[]}),de(F(s),nU,{writable:!0,value:0}),de(F(s),iU,{writable:!0,value:null}),de(F(s),sU,{writable:!0,value:null}),de(F(s),oU,{writable:!0,value:{}}),de(F(s),aU,{writable:!0,value:[]}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,ll();case 2:return y.next=4,zt.set(Nn,!0);case 4:return y.next=6,Bh();case 6:return u=y.sent,y.next=9,zt.set(Gs,u.replace("/bapi/defi",""));case 9:return y.next=11,W4();case 11:return l=y.sent,y.next=14,zt.set(zs,l);case 14:return o.subscribe(Fo,function(){var A=(0,k.A)(b().mark(function I(P){var D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:D=P.autoLockTimeMinutes,D!==X(o,KT)&&(he(o,KT,D),K(o,cU,roe).call(o));case 2:case"end":return V.stop()}},I)}));return function(I){return A.apply(this,arguments)}}()),o.subscribe(cl,function(){var A=(0,k.A)(b().mark(function I(P){return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:K(o,eoe,bOe).call(o,P);case 1:case"end":return U.stop()}},I)}));return function(I){return A.apply(this,arguments)}}()),navigator&&navigator.connection&&navigator.connection.addEventListener&&navigator.connection.addEventListener("change",function(){var A=(0,k.A)(b().mark(function I(P){var D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,tc(100);case 2:console.debug("[ExtensionController:onNetworkChanged]",navigator.onLine),K(o,uU,toe).call(o),D=0;case 5:if(!(D<3)){V.next=13;break}return V.next=8,tc(200);case 8:console.debug("[ExtensionController:onNetworkChanged][timeout]",D,navigator.onLine),K(o,uU,toe).call(o);case 10:++D,V.next=5;break;case 13:case"end":return V.stop()}},I)}));return function(I){return A.apply(this,arguments)}}()),y.prev=17,y.next=20,hn.Extension.reportExtensionId();case 20:y.next=24;break;case 22:y.prev=22,y.t0=y.catch(17);case 24:return y.prev=24,y.next=27,o.updateApolloConfig();case 27:y.next=32;break;case 29:y.prev=29,y.t1=y.catch(24),console.error(y.t1);case 32:o.registerOnUiActiveEvent(function(){hOe.execute(function(){return K(o,Jse,yOe).call(o)})});case 33:case"end":return y.stop()}},a,null,[[17,22],[24,29]])}))()},i.registerTimer=function(o){var a=o.timerName,u=o.getTimeoutMinutes,l=o.onTimeout,g=o.checkReset,y=o.onReset,A=function(P){P.name===a&&(l&&l(),chrome.alarms.clear(a))},I=function(){var P=(0,k.A)(b().mark(function D(){var U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return y&&y(),chrome.alarms.clear(a),chrome.alarms.onAlarm.removeListener(A),J.next=5,u();case 5:if(U=J.sent,U){J.next=9;break}return console.debug("[ExtensionController:resetTimerFn]:".concat(a," timeoutToSet is 0, not setting alarm")),J.abrupt("return");case 9:chrome.alarms.create(a,{delayInMinutes:U,periodInMinutes:U}),chrome.alarms.onAlarm.addListener(A);case 11:case"end":return J.stop()}},D)}));return function(){return P.apply(this,arguments)}}();return X(this,eU).push({checkReset:g,resetTimerFn:I}),I},i.onHasUIConnected=function(o){X(this,tU).push(o);var a=zt.get(cl);console.debug("[onHasUIConnected:currentUiCount]:".concat(a)),a>0&&o()},i.updateApolloConfig=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.updateOneConfig("homePageTokenListWithKeyIdsQueryLimit");case 2:return l.next=4,o.updateOneConfig("defiPositionListQueryLimit");case 4:case"end":return l.stop()}},a)}))()},i.onAllUIDisconnected=function(o){X(this,rU).push(o)},i.markBackgroundFinishInit=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.set(Vi,!0);case 2:case"end":return u.stop()}},o)}))()},i.setLastActiveTime=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re;return b().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:for(K(o,cU,roe).call(o),u=!0,l=!1,g=void 0,Re.prev=2,y=function(De,Ue){var Ve=Ue.value,pe=Ve.checkReset,Se=Ve.resetTimerFn,Ce=pe?pe():Promise.resolve(!0);Ce.then(function(je){je&&Se()})},A=X(o,eU)[Symbol.iterator]();!(u=(I=A.next()).done);u=!0)y(A,I);Re.next=11;break;case 7:Re.prev=7,Re.t0=Re.catch(2),l=!0,g=Re.t0;case 11:Re.prev=11,Re.prev=12,!u&&A.return!=null&&A.return();case 14:if(Re.prev=14,!l){Re.next=17;break}throw g;case 17:return Re.finish(14);case 18:return Re.finish(11);case 19:for(P=!0,D=!1,U=void 0,Re.prev=20,V=X(o,aU)[Symbol.iterator]();!(P=(J=V.next()).done);P=!0)re=J.value,re();Re.next=28;break;case 24:Re.prev=24,Re.t1=Re.catch(20),D=!0,U=Re.t1;case 28:Re.prev=28,Re.prev=29,!P&&V.return!=null&&V.return();case 31:if(Re.prev=31,!D){Re.next=34;break}throw U;case 34:return Re.finish(31);case 35:return Re.finish(28);case 36:case"end":return Re.stop()}},a,null,[[2,7,11,19],[12,,14,18],[20,24,28,36],[29,,31,35]])}))()},i.registerOnUiActiveEvent=function(o){X(this,aU).push(o)},i.syncFVideoId=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:he(u,iU,o),he(u,sU,a||null);case 2:case"end":return y.stop()}},l)}))()},i.updateOneConfig=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=3,hn.Extension.getApolloConfig(o);case 3:g=I.sent,y=(l=g.data)===null||l===void 0?void 0:l.configValue,(0,H.isNil)(y)||(X(a,oU)[o]=y);case 6:case"end":return I.stop()}},u)}))()},i.getApolloConfig=function(o){return X(this,oU)[o]},i.getSwapBannerConfig=function(){return(0,k.A)(b().mark(function o(){var a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(ro);case 2:return a=y.sent,u=a.extensionSwapBannerStartTime,l=a.extensionSwapBannerEndTime,y.abrupt("return",{startTime:u&&parseInt(u,10)||void 0,endTime:l&&parseInt(l,10)||void 0,link:a.extensionSwapBannerLink});case 6:case"end":return y.stop()}},o)}))()},(0,L.A)(n,[{key:"fvideoId",get:function(){return X(this,iU)}},{key:"fvideoToken",get:function(){return X(this,sU)}}]),n}(Yr);function toe(){return lU.apply(this,arguments)}function lU(){return lU=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!(!navigator||!(0,H.isBoolean)(navigator.onLine))){n.next=2;break}return n.abrupt("return");case 2:if(!navigator.onLine){n.next=7;break}return n.next=5,zt.set(rs,!1);case 5:n.next=9;break;case 7:return n.next=9,zt.set(rs,!0);case 9:case"end":return n.stop()}},r)})),lU.apply(this,arguments)}function roe(){return fU.apply(this,arguments)}function fU(){return fU=(0,k.A)(b().mark(function r(){var e,n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(e=this,X(this,t4)&&clearTimeout(X(this,t4)),X(this,KT)){s.next=4;break}return s.abrupt("return");case 4:if(n=Number(X(this,KT)),n){s.next=7;break}return s.abrupt("return");case 7:he(this,t4,setTimeout(function(){return K(e,Qse,mOe).call(e)},n*dOe));case 8:case"end":return s.stop()}},r,this)})),fU.apply(this,arguments)}function yOe(){return dU.apply(this,arguments)}function dU(){return dU=(0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,hn.Extension.getSystemTimestamp();case 3:if(e=o.sent,n=Number(e.data)*1e3,!Number.isNaN(n)){o.next=7;break}return o.abrupt("return");case 7:return i=Math.abs(Date.now()-n),o.next=10,zt.set(to,i>pOe);case 10:o.next=14;break;case 12:o.prev=12,o.t0=o.catch(0);case 14:case"end":return o.stop()}},r,null,[[0,12]])})),dU.apply(this,arguments)}function mOe(){li.setLocked()}function bOe(r){var e=X(this,nU);if(he(this,nU,r),!e&&r){var n=!0,i=!1,s=void 0;try{for(var o=X(this,tU)[Symbol.iterator](),a;!(n=(a=o.next()).done);n=!0){var u=a.value;u()}}catch(D){i=!0,s=D}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}}else if(!r&&e){var l=!0,g=!1,y=void 0;try{for(var A=X(this,rU)[Symbol.iterator](),I;!(l=(I=A.next()).done);l=!0){var P=I.value;P()}}catch(D){g=!0,y=D}finally{try{!l&&A.return!=null&&A.return()}finally{if(g)throw y}}}}var wo=new gOe;_e("extension",{setLastActiveTime:wo.setLastActiveTime.bind(wo),syncFVideoId:wo.syncFVideoId.bind(wo),getSwapBannerConfig:wo.getSwapBannerConfig.bind(wo)});var gg;(function(r){r.Chrome="Chrome",r.Firefox="Firefox",r.Edge="Edge",r.Opera="Opera",r.Brave="Brave"})(gg||(gg={}));var r4;(function(r){r.popup="popup",r.background="background",r.fullscreen="fullscreen",r.contentscript="contentscript"})(r4||(r4={}));var xrt=function(r){if(r||(r=self.location.href),!r)return EnvironmentType.background;var e=new URL(r);return e.pathname==="/index.html#/popup"?EnvironmentType.popup:["/index.html"].includes(e.pathname)?EnvironmentType.fullscreen:EnvironmentType.background},vOe=function(){var r=null;if(!r)return gg.Chrome;var e=r.userAgent;return e.includes("Firefox")?gg.Firefox:"brave"in navigator?gg.Brave:e.includes("Edg/")?gg.Edge:e.includes("OPR")?gg.Opera:gg.Chrome},noe=cC(),Brt=noe.promise,wOe=noe.resolve,ioe=cC(),AOe=ioe.promise,_Oe=ioe.resolve,EOe=function(r,e){var n,i,s;return{tabId:(n=r.sender)===null||n===void 0||(i=n.tab)===null||i===void 0?void 0:i.id,origin:(s=r.sender)===null||s===void 0?void 0:s.origin,providerCallContext:e.providerCallContext}},TOe=function(r){var e,n;return{tabId:r==null||(e=r.sender)===null||e===void 0||(n=e.tab)===null||n===void 0?void 0:n.id}},soe=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function(){var n=(0,k.A)(b().mark(function i(s,o){var a,u,l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(a=s.moduleName,u=s.funcName,l=s.args,g=r(a),g){U.next=4;break}throw new Error("module ".concat(a," not found"));case 4:if(y=g[u],y){U.next=7;break}throw new Error("func ".concat(u," not found"));case 7:if(A=l,!e){U.next=16;break}return I=EOe(o,s),A=[I].concat((0,Li.A)(l)),U.next=13,y.apply(void 0,(0,Li.A)(A));case 13:return U.abrupt("return",U.sent);case 16:return P=TOe(o),U.next=19,y.apply(void 0,(0,Li.A)(A).concat([P]));case 19:return U.abrupt("return",U.sent);case 20:case"end":return U.stop()}},i)}));return function(i,s){return n.apply(this,arguments)}}()},ooe=function(r){return function(){var e=(0,k.A)(b().mark(function n(i,s){var o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(o=s.messageId,o){y.next=4;break}return console.log("missing message id"),y.abrupt("return");case 4:return y.prev=4,y.next=7,r(s,i);case 7:a=y.sent,u={type:ar.functionCallResult,returnValue:a,target:s.callFrom,messageId:o},et(i,u),y.next=17;break;case 12:y.prev=12,y.t0=y.catch(4),console.error(y.t0),l={type:ar.functionCallResult,error:y.t0.message,target:s.callFrom,messageId:o},et(i,l);case 17:case"end":return y.stop()}},n,null,[[4,12]])}));return function(n,i){return e.apply(this,arguments)}}()},SOe=soe(ge),IOe=soe(we,!0),kOe=ooe(SOe),ROe=ooe(IOe),COe=chrome,n4,xOe=(n4={},vt(n4,r4.fullscreen,!0),vt(n4,r4.popup,!0),n4);function BOe(r){return hU.apply(this,arguments)}function hU(){return hU=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:i=e.name,console.log("connectRemote",i),s=!1,o=vOe(),a=!((n=e.sender)===null||n===void 0)&&n.url?new URL(e.sender.url):null,o===gg.Firefox?s=xOe[i]:s=a?.origin==="chrome-extension://".concat(COe.runtime.id),s?(Xt.add(e),e.onMessage.addListener(OOe(e)),e.onDisconnect.addListener(function(){Xt.remove(e),Su()}),AOe.then((0,k.A)(b().mark(function y(){return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return console.log("initBackgroundPromise resolved"),I.next=3,or(e);case 3:case"end":return I.stop()}},y)}))),setTimeout(function(){Ro()},0)):(WC.add({origin:a?.origin,port:e,tab:(u=e.sender)===null||u===void 0?void 0:u.tab}),e.onMessage.addListener(POe(e)),e.onDisconnect.addListener(function(){console.log("onDisconnect2222",i),WC.remove(e)}));case 8:case"end":return g.stop()}},r)})),hU.apply(this,arguments)}function OOe(r){return function(){var e=(0,k.A)(b().mark(function n(i){var s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:s=i.type,o=i.messageId,s===ar.uiFunctionCall?kOe(r,i):(console.log("unknown message type:"),console.log(i));case 2:case"end":return u.stop()}},n)}));return function(n){return e.apply(this,arguments)}}()}function POe(r){return function(){var e=(0,k.A)(b().mark(function n(i){var s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:s=i.type,s===ar.contentscriptFunctionCall?ROe(r,i):(console.log("unknown message type:"),console.log(i));case 2:case"end":return a.stop()}},n)}));return function(n){return e.apply(this,arguments)}}()}var NOe=function(){var r=(0,k.A)(b().mark(function e(){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Promise.all([MOe()]);case 2:case"end":return i.stop()}},e)}));return function(){return r.apply(this,arguments)}}(),MOe=function(){var r=(0,k.A)(b().mark(function e(){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,(0,$l.Ay)(chrome.runtime.getURL("/resource/tss_mpc_sdk_rs_bg.wasm"));case 3:console.log("[loadTssMpcSdk] load tss mpc sdk done"),i.next=10;break;case 6:i.prev=6,i.t0=i.catch(0),console.log("load tss mpc sdk failed"),console.error(i.t0);case 10:case"end":return i.stop()}},e,null,[[0,6]])}));return function(){return r.apply(this,arguments)}}(),LOe=function(){"use strict";function r(){(0,G.A)(this,r),this._handlers={}}var e=r.prototype;return e.addEventListener=function(i,s){this._handlers[i]=this._handlers[i]||[],this._handlers[i].push(s)},e.on=function(i,s){console.debug("[GlobalEventProxy]",i);var o=this._handlers[i]||[],a=!0,u=!1,l=void 0;try{for(var g=o[Symbol.iterator](),y;!(a=(y=g.next()).done);a=!0){var A=y.value;A(s)}}catch(I){u=!0,l=I}finally{try{!a&&g.return!=null&&g.return()}finally{if(u)throw l}}},r}(),pU=new LOe;self.addEventListener("online",function(r){return pU.on("online",r)}),self.addEventListener("offline",function(r){return pU.on("offline",r)}),globalThis.globalEventProxy=pU;var DOe={addressBookList:[]},UOe=Nr(DOe).addressBookListBgAtom,FOe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="addressBook",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:o.syncAddressBook();case 1:case"end":return l.stop()}},a)}))()},i.syncAddressBook=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Cn.toArray();case 2:return a=l.sent,l.next=5,zt.set(UOe,(0,H.sortBy)(a,function(g){return-g.createTime}));case 5:case"end":return l.stop()}},o)}))()},i.upsertAddressBookItem=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,li.verifyPasswordOrThrow(a);case 2:if(g=o.address,y=o.id,!y){D.next=8;break}return D.next=7,Cn.get(y);case 7:A=D.sent;case 8:return A?(delete o.createTime,o=Mr({},A,o)):o=gn(Mr({},o),{createTime:Date.now()}),I=y||Bg(),D.next=12,Cn.upsert(I,gn(Mr({},o),{id:I,updateTime:Date.now(),address:Wl(g)}));case 12:return D.next=14,u.syncAddressBook();case 14:return D.abrupt("return",I);case 15:case"end":return D.stop()}},l)}))()},i.removeAddressBookItem=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Cn.delete(o);case 2:return g.next=4,a.syncAddressBook();case 4:case"end":return g.stop()}},u)}))()},n}(Yr),GT=new FOe;_e("addressBook",{upsertAddressBookItem:GT.upsertAddressBookItem.bind(GT),removeAddressBookItem:GT.removeAddressBookItem.bind(GT)});var WOe={safetyCheckClick:[],multipleKeylessGuideDismissed:!1},aoe=Nr(WOe,{persistKeys:["safetyCheckClick","multipleKeylessGuideDismissed"]}),gU=aoe.safetyCheckClickBgAtom,uoe=aoe.multipleKeylessGuideDismissedBgAtom,HOe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="safetyCheckClick",s}var i=n.prototype;return i.trackClick=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,zt.get(gU);case 2:return u=y.sent,l=new Set((0,Li.A)(u).concat([o])),y.next=6,zt.set(gU,Array.from(l));case 6:return y.abrupt("return",Array.from(l));case 7:case"end":return y.stop()}},a)}))()},i.getSafetyCheckClick=function(){return(0,k.A)(b().mark(function o(){var a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.get(gU);case 2:return a=l.sent,l.abrupt("return",Array.from(a));case 4:case"end":return l.stop()}},o)}))()},i.dismissMultipleKeylessGuide=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.set(uoe,!0);case 2:case"end":return u.stop()}},o)}))()},i.getMultipleKeylessGuideDismissed=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,zt.get(uoe);case 2:return u.abrupt("return",u.sent);case 3:case"end":return u.stop()}},o)}))()},n}(Yr),yg=new HOe;_e("safetyCheckClick",{trackClick:yg.trackClick.bind(yg),getSafetyCheckClick:yg.getSafetyCheckClick.bind(yg),setMultipleKeylessGuideDismissed:yg.dismissMultipleKeylessGuide.bind(yg),getMultipleKeylessGuideDismissed:yg.getMultipleKeylessGuideDismissed.bind(yg)});var zOe={currentCurrency:{symbol:"$",rate:1},currencySettingList:[]},coe=Nr(zOe),$Oe=coe.currentCurrencyBgAtom,VOe=coe.currencySettingListBgAtom,loe={symbol:"$",rate:1},yU=new WeakMap,foe=new WeakSet,i4=new WeakSet,jOe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),foe),B(F(s),i4),s.name="currency",de(F(s),yU,{writable:!0,value:{}}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,K(o,foe,KOe).call(o);case 2:return l.next=4,K(o,i4,bU).call(o);case 4:o.subscribe(ku,function(g){K(o,i4,bU).call(o,g)});case 5:case"end":return l.stop()}},a)}))()},n}(Yr);function KOe(){return mU.apply(this,arguments)}function mU(){return mU=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,hn.Currency.getCurrencyList();case 2:for(e=ce.sent,n=e.data,i=[],s={},o=!1,a=!0,u=!1,l=void 0,ce.prev=8,g=n[Symbol.iterator]();!(a=(y=g.next()).done);a=!0)A=y.value,I=A.pair,P=A.symbol,D=A.rate,U=A.imageUrl,V=A.fullName,J=I.split("_")[0],J==="USD"?o||(o=!0,i.push({fiat:J,symbol:P,imageUrl:U,rate:1,fullName:V})):(s[J]={symbol:P,rate:D},i.push({fiat:J,symbol:P,imageUrl:U,rate:D,fullName:V}));ce.next=16;break;case 12:ce.prev=12,ce.t0=ce.catch(8),u=!0,l=ce.t0;case 16:ce.prev=16,ce.prev=17,!a&&g.return!=null&&g.return();case 19:if(ce.prev=19,!u){ce.next=22;break}throw l;case 22:return ce.finish(19);case 23:return ce.finish(16);case 24:return s.USD=loe,he(this,yU,s),ce.next=28,zt.set(VOe,i);case 28:return ce.next=30,K(this,i4,bU).call(this);case 30:case"end":return ce.stop()}},r,this,[[8,12,16,24],[17,,19,23]])})),mU.apply(this,arguments)}function bU(r){return vU.apply(this,arguments)}function vU(){return vU=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(e){s.next=4;break}return s.next=3,zt.get(ku);case 3:e=s.sent;case 4:return n=X(this,yU)[e]||loe,s.next=7,zt.set($Oe,n);case 7:case"end":return s.stop()}},r,this)})),vU.apply(this,arguments)}var GOe=new jOe,qOe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="extensionUpgrade",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.fetchUpgradeConfig();case 2:o.subscribe(cl,function(g){g>0&&o.fetchUpgradeConfig()});case 3:case"end":return l.stop()}},a)}))()},i.fetchUpgradeConfig=function(){return(0,k.A)(b().mark(function o(){var a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,console.debug("Fetch extension upgrade config..."),g.next=4,hn.Extension.getUpgradeConfig();case 4:return a=g.sent,u=a.data||{},g.next=8,zt.set(ro,u);case 8:g.next=13;break;case 10:g.prev=10,g.t0=g.catch(0),console.error(g.t0);case 13:case"end":return g.stop()}},o,null,[[0,10]])}))()},n}(Yr),ZOe=new qOe,doe=chrome;function hoe(r){return wU.apply(this,arguments)}function wU(){return wU=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(doe.sidePanel){s.next=3;break}return console.warn("[PanelBehavior] SidePanel API not available"),s.abrupt("return");case 3:return s.prev=3,n=e==="sidePanel",s.next=7,doe.sidePanel.setPanelBehavior({openPanelOnActionClick:n});case 7:console.debug("[PanelBehavior] Updated: openPanelOnActionClick=".concat(n)),s.next=13;break;case 10:s.prev=10,s.t0=s.catch(3),console.error("[PanelBehavior] Failed to update behavior:",s.t0);case 13:case"end":return s.stop()}},r,null,[[3,10]])})),wU.apply(this,arguments)}var YOe=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="panelBehavior",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!chrome.sidePanel){y.next=17;break}return y.prev=1,y.next=4,chrome.sidePanel.setOptions({enabled:!0});case 4:return y.next=6,Bi.getPreference("viewMode");case 6:return u=y.sent,y.next=9,hoe(u);case 9:console.debug("[PanelBehaviorController] SidePanel enabled successfully"),y.next=15;break;case 12:y.prev=12,y.t0=y.catch(1),console.error("[PanelBehaviorController] Failed to enable sidePanel:",y.t0);case 15:y.next=18;break;case 17:console.warn("[PanelBehaviorController] SidePanel API not available (Chrome < 114)");case 18:l=na("viewMode"),o.subscribe(l,function(){var A=(0,k.A)(b().mark(function I(P){return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return console.debug("[PanelBehaviorController] viewMode changed to:",P),U.next=3,hoe(P);case 3:case"end":return U.stop()}},I)}));return function(I){return A.apply(this,arguments)}}());case 20:case"end":return y.stop()}},a,null,[[1,12]])}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[Bi]}}]),n}(Yr),XOe=new YOe;function JOe(r){return!!r.isNativeCoin}function QOe(r){return JOe(r)?r.coin==="SOL"&&r.network==="SOL"?"So11111111111111111111111111111111111111111":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee":r.contractAddress?r.contractAddress:""}function poe(r){var e=4129,n=0,i=Ui.Buffer.alloc(r.length+2);i.set(r);var s=!0,o=!1,a=void 0;try{for(var u=i[Symbol.iterator](),l;!(s=(l=u.next()).done);s=!0)for(var g=l.value,y=128;y>0;)n<<=1,g&y&&(n+=1),y>>=1,n>65535&&(n&=65535,n^=e)}catch(A){o=!0,a=A}finally{try{!s&&u.return!=null&&u.return()}finally{if(o)throw a}}return Ui.Buffer.from([Math.floor(n/256),n%256])}function e8e(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e&&!r.startsWith("UQ")||!e&&!r.startsWith("EQ"))return r;r=r.replace(/-/g,"+").replace(/_/g,"/");var n=17,i=81,s=Ui.Buffer.from(r,"base64");if(s.length!==36)throw new Error("Unknown address type: byte length is not equal to 36");var o=s.subarray(0,34),a=s.subarray(34,36),u=poe(o);if(!(u[0]===a[0]&&u[1]===a[1]))throw new Error("Invalid checksum: "+r);s[0]=e?n:i,o[0]=s[0];var l=poe(o);return s[34]=l[0],s[35]=l[1],s.toString("base64").replace(/\+/g,"-").replace(/\//g,"_")}function t8e(r,e,n){return e==="CT_607"?e8e(r,n==="eq"):r}var r8e=rf((0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.t0=ur,o.next=3,Promise.all([hn.Asset.fetchNetworkCoinAll(),hn.Asset.fetchAllAsset()]);case 3:return o.t1=o.sent,e=(0,o.t0)(o.t1,2),n=e[0],i=e[1],o.abrupt("return",{networkCoinAll:n.data,allAssets:i.data});case 8:case"end":return o.stop()}},r)})),{cacheTime:15*60*1e3});function goe(r,e){return"".concat(r,"-").concat(e)}var n8e=rf((0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Fi.getNetworkList();case 2:return e=g.sent,g.next=5,r8e();case 5:return n=g.sent,i=n.networkCoinAll,s=n.allAssets,o=(0,H.keyBy)(e.filter(function(y){return y.networkOnBinance}),function(y){return y.networkOnBinance}),a=s.reduce(function(y,A){return A.test===0&&(y[A.assetCode]=!0),y},{}),u={},i.forEach(function(y){a[y.coin]&&y.networkList.forEach(function(A){if(o[A.network]){var I=QOe(A);if(!I)return;var P=goe(A.network,I);u[P]=A}})}),g.abrupt("return",u);case 13:case"end":return g.stop()}},r)})),{cacheTime:60*1e3});function i8e(r){var e=r.networkItem,n=r.contractAddress,i=t8e(n,e.binanceChainId,"eq");return goe(e.networkOnBinance,i)}var s8e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return i=n.walletAddress,s=n.tokenMeta,o=n.customChain,a=n.value,u=n.isMax,l=n.to,g=s.tokenAddresses,y=g[0],A=y.decimals,I=y.contractAddress,P=y.nativeAddressFlag,D=ti(a).times(Math.pow(10,A)).toFixed(0,ti.ROUND_DOWN),U={coin_id:"-1"},P||(U.contract_address=I,U.token_decimals=A,U.token_type="erc20"),J.abrupt("return",{jsonrpc:"2.0",method:"preview_transfer",params:{asset:U,operation:P?"coin":"token",from:i,amount:D,to:l,is_max:u},id:1});case 7:case"end":return J.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),o8e=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return i=n.binanceChainId,s=n.wcId,o=n.twIndex,a=n.from,u=n.to,l=n.decimals,g=n.contractAddress,y=n.isNativeToken,A=n.value,I={asset:a8e(s,o),operation:y?"coin":"token",from:s==="bip122:000000000000000000651ef99cb9fcbe"?"bitcoincash:".concat(a):a,to:u,amount:ti(A).times(Math.pow(10,l)).toFixed(0,ti.ROUND_DOWN),is_max:n.isMax,meta:n.meta||null},n.publicKey&&(I.public_key=n.publicKey),I.operation==="token"&&(I.asset.contract_address=g,I.asset.token_type=n.type||"erc20",I.asset.token_decimals=n.decimals),D.abrupt("return",{method:"preview_transfer",params:I,jsonrpc:"2.0",address:a,isSilent:!1,binanceChainId:i,id:1});case 5:case"end":return D.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),a8e=function(r,e){return{coin_id:e.toString(),chain_id:r.split(":")[1],chain_type:u8e(r)}},u8e=function(r){return r.startsWith("eip155")?"evm":r.startsWith("cosmos")?"cosmos":""},c8e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="sendToken",s}var i=n.prototype;return i.init=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:case"end":return u.stop()}},o)}))()},i.sendToken=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe;return b().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return u=o.accountId,l=o.networkId,g=o.to,y=o.tokenId,A=o.value,I=o.isMax,Ce.next=3,Fi.getFullNetworkByNetworkId(l);case 3:if(P=Ce.sent,P){Ce.next=6;break}throw Error("Network not found for networkId: ".concat(l));case 6:return Ce.next=8,Ii.getTokenMetaByTokenId(y);case 8:if(D=Ce.sent,D){Ce.next=11;break}throw Error("Token not found for tokenId: ".concat(y));case 11:if(U=D.tokenAddresses.find(function(je){return je.networkId===l}),U){Ce.next=14;break}throw Error("Token address not found for tokenId: ".concat(y," and networkId: ").concat(l));case 14:return Ce.next=16,vn.getWalletItemByAccountId(u);case 16:return V=Ce.sent,Ce.next=19,vn.getAddressByAccountId(u,P.chainType);case 19:if(J=Ce.sent,re={origin:"",networkType:P.chainType,accountId:u,networkId:l,signSource:Go.send,address:J,isSendMax:o.isMax},!za(l)){Ce.next=30;break}return ce=P,Ce.next=25,s8e({walletAddress:J,tokenMeta:D,customChain:ce,value:A,isMax:I,to:g});case 25:return Re=Ce.sent,Ce.next=28,kf.sendTransaction(re,Re);case 28:Ce.next=38;break;case 30:return De=P,Ue=De.binanceChainId,Ve=De.customTokenType,Ce.next=35,o8e({binanceChainId:Ue,wcId:De.wcId,twIndex:De.twIndex,from:J,to:g,value:A,contractAddress:U.contractAddress,decimals:U.decimals,isNativeToken:U.nativeAddressFlag,isMax:I,type:Ve});case 35:return pe=Ce.sent,Ce.next=38,kf.sendTransaction(re,pe);case 38:return Ce.next=40,Dn.upsert(xh(),{address:g,networkId:l,chainType:P.chainType,walletId:V?.id,senderAddress:J,createTime:Date.now()});case 40:case"end":return Ce.stop()}},a)}))()},i.getRecentSendAddressList=function(o){var a=o.networkId,u=o.senderAddress;return(0,k.A)(b().mark(function l(){var g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Fi.getFullNetworkByNetworkId(a);case 2:if(g=D.sent,y=g?.chainType,y){D.next=6;break}return D.abrupt("return",[]);case 6:return D.next=8,Dn.table.where({senderAddress:u,chainType:y}).toArray();case 8:return A=D.sent,I=(0,H.uniqBy)(A,function(U){return U.address}),I=(0,H.sortBy)(I,function(U){return-U.createTime}),D.abrupt("return",I);case 12:case"end":return D.stop()}},l)}))()},i.getBinanceDepositAddress=function(o){var a=o.networkId,u=o.tokenId;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:if(!za(a)){De.next=3;break}return De.abrupt("return",null);case 3:return De.next=5,Ci.checkMpcWalletActive();case 5:if(y=De.sent,y){De.next=8;break}return De.abrupt("return",null);case 8:return De.next=10,Fi.getNetworkByNetworkId(a);case 10:if(A=De.sent,!(!A||!A.networkOnBinance)){De.next=13;break}return De.abrupt("return",null);case 13:return De.next=15,Ii.getTokenMetaByTokenId(u);case 15:if(I=De.sent,P=(g=I.tokenAddresses.find(function(Ue){return Ue.networkId===a}))===null||g===void 0?void 0:g.contractAddress,P){De.next=19;break}return De.abrupt("return",null);case 19:return D=i8e({networkItem:A,contractAddress:P}),De.next=22,n8e();case 22:if(U=De.sent,V=U[D],V){De.next=26;break}return De.abrupt("return",null);case 26:return J=V.coin,re=V.network,De.prev=27,De.next=30,hn.Asset.getDepositAddress({coin:J,network:re});case 30:return ce=De.sent,De.abrupt("return",ce.data.address);case 34:return De.prev=34,De.t0=De.catch(27),De.abrupt("return",null);case 37:case"end":return De.stop()}},l,null,[[27,34]])}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[vn]}}]),n}(Yr),G1=new c8e;_e("sendToken",{sendToken:G1.sendToken.bind(G1),getRecentSendAddressList:G1.getRecentSendAddressList.bind(G1),getBinanceDepositAddress:G1.getBinanceDepositAddress.bind(G1)});const q1={SIGN_BY_EIP_712:"SIGN_BY_EIP_712",SIGN_BY_TRANSACTION:"SIGN_BY_TRANSACTION",SIGN_BY_DIGEST:"SIGN_BY_DIGEST"},Z1={PLACE_ORDER:"PLACE_ORDER",PLACE_INTENT_ORDER:"PLACE_INTENT_ORDER",PLACE_FLASH_ORDER:"PLACE_FLASH_ORDER"},qT={PRE_PLACE_ORDER:"PRE_PLACE_ORDER",PRE_PLACE_NORMAL_ORDER:"PRE_PLACE_ORDER"},mg={SWAP_TX_REPORT_BROADCAST:"SWAP_TX_REPORT_BROADCAST",BRIDGE_TX_REPORT_BROADCAST:"BRIDGE_TX_REPORT_BROADCAST",APPROVE_TX_REPORT_BROADCAST:"APPROVE_TX_REPORT_BROADCAST",WRAP_TX_REPORT_BROADCAST:"WRAP_TX_REPORT_BROADCAST",FRONTEND_BROADCAST:"FRONTEND_BROADCAST"},s4={FETCH_CALLDATA_BY_SWAP:"FETCH_CALLDATA_BY_SWAP"},Y1={FETCH_GAS_BY_GAS_ACCOUNT_WITH_TRANSACTION:"FETCH_GAS_BY_GAS_ACCOUNT_WITH_TRANSACTION",FETCH_GAS_BY_GAS_ACCOUNT_WITHOUT_TRANSACTION:"FETCH_GAS_BY_GAS_ACCOUNT_WITHOUT_TRANSACTION"},yd={FETCH_DIGEST_BY_PRESET:"FETCH_DIGEST_BY_PRESET",FETCH_DIGEST_BY_GAS_ACCOUNT:"FETCH_DIGEST_BY_GAS_ACCOUNT",FETCH_DIGEST_BY_FLASH:"FETCH_DIGEST_BY_FLASH"},yoe={SWAP_QUOTE:"SWAP_QUOTE"},Ort=null,wu={SWAP:"SWAP",INTENT:"INTENT",APPROVE:"APPROVE",WRAP:"WRAP",BRIDGE:"BRIDGE"},Prt=null,ZT={FETCH_ORDER_ID_BY_SERVER:"FETCH_ORDER_ID_BY_SERVER",FETCH_ORDER_ID_BY_LOCAL:"FETCH_ORDER_ID_BY_LOCAL"},H2={COMPILE_TRANSACTION:"COMPILE_TRANSACTION",LOCAL_COMPILE_TRANSACTION:"LOCAL_COMPILE_TRANSACTION"};var z2;function Nrt(r){z2={...z2,...r}}function YT(r){return{lang:r?.lang??z2?.lang,message:r?.message,abortEarly:r?.abortEarly??z2?.abortEarly,abortPipeEarly:r?.abortPipeEarly??z2?.abortPipeEarly}}function Mrt(){z2=void 0}var XT;function Lrt(r,e){XT||(XT=new Map),XT.set(e,r)}function l8e(r){return XT?.get(r)}function Drt(r){XT?.delete(r)}var JT;function Urt(r,e){JT||(JT=new Map),JT.set(e,r)}function f8e(r){return JT?.get(r)}function Frt(r){JT?.delete(r)}var X1;function Wrt(r,e,n){X1||(X1=new Map),X1.get(r)||X1.set(r,new Map),X1.get(r).set(n,e)}function d8e(r,e){return X1?.get(r)?.get(e)}function Hrt(r,e){X1?.get(r)?.delete(e)}function Sa(r){const e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}function zr(r,e,n,i,s){const o=s&&"input"in s?s.input:n.value,a=s?.expected??r.expects??null,u=s?.received??Sa(o),l={kind:r.kind,type:r.type,input:o,expected:a,received:u,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${u}`,requirement:r.requirement,path:s?.path,issues:s?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},g=r.kind==="schema",y=s?.message??r.message??d8e(r.reference,l.lang)??(g?f8e(l.lang):null)??i.message??l8e(l.lang);y!==void 0&&(l.message=typeof y=="function"?y(l):y),g&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}var AU;function o4(r){return AU||(AU=new TextEncoder),AU.encode(r).length}var _U;function a4(r){_U||(_U=new Intl.Segmenter);const e=_U.segment(r);let n=0;for(const i of e)n++;return n}function EU(r,e){if("pipe"in r){const n=[];for(let i=r.pipe.length-1;i>=0;i--){const s=r.pipe[i];if(s.kind==="schema"&&"pipe"in s)n.push(s);else if(s.kind==="metadata"&&s.type===e)return s[e]}for(const i of n){const s=EU(i,e);if(s!==void 0)return s}}}function $n(r){return{version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},YT())}}}var QT;function u4(r,e){QT||(QT=new Map),QT.get(r)||QT.set(r,new Intl.Segmenter(r,{granularity:"word"}));const n=QT.get(r).segment(e);let i=0;for(const s of n)s.isWordLike&&i++;return i}var h8e=/\D/gu;function moe(r){const e=r.replace(h8e,"");let n=e.length,i=1,s=0;for(;n;){const o=+e[--n];i^=1,s+=i?[0,2,4,6,8,1,3,5,7,9][o]:o}return s%10===0}function $2(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function wh(r,e){const n=[...new Set(r)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function zrt(r,e){const n={};for(const i of r)n[i]=e;return n}function $rt(r){const e={};for(const n of r)Object.assign(e,n.entries);return e}function boe(r){if(r.path){let e="";for(const n of r.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}function Vrt(r,e){return e.kind===r}function jrt(r,e){return e.type===r}function Krt(r){return r instanceof Sm}var Sm=class extends null{constructor(r){super(r[0].message),this.name="ValiError",this.issues=r}};function p8e(r){return{kind:"transformation",type:"args",reference:p8e,async:!1,schema:r,"~run"(e,n){const i=e.value;return e.value=(...s)=>{const o=this.schema["~run"]({value:s},n);if(o.issues)throw new Sm(o.issues);return i(...o.value)},e}}}function g8e(r){return{kind:"transformation",type:"args",reference:g8e,async:!1,schema:r,"~run"(e,n){const i=e.value;return e.value=async(...s)=>{const o=await r["~run"]({value:s},n);if(o.issues)throw new Sm(o.issues);return i(...o.value)},e}}}function y8e(){return{kind:"transformation",type:"await",reference:y8e,async:!0,async"~run"(r){return r.value=await r.value,r}}}var m8e=/^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu,b8e=/^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u,v8e=/^[a-z][\da-z]*$/u,w8e=/^[+-]?(?:\d*\.)?\d+$/u,A8e=/^\d+$/u,_8e=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu,E8e=/^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}))*)+$/u,T8e=/^(?:0[hx])?[\da-fA-F]+$/u,S8e=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u,I8e=/^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u,k8e=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u,R8e=/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,C8e=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,x8e=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,B8e=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u,O8e=/^(?:0\d|1\d|2[0-3]):[0-5]\d$/u,P8e=/^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,N8e=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u,M8e=/^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u,L8e=/^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$/iu,D8e=/^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu,U8e=/^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$|^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu,F8e=/^[\w-]+$/u,W8e=/^(?:0o)?[0-7]+$/u,H8e=/^[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])?)*$/,z8e=/^[\da-z]+(?:[-_][\da-z]+)*$/u,$8e=/^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u,V8e=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function j8e(r){return{kind:"validation",type:"base64",reference:j8e,async:!1,expects:null,requirement:m8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"Base64",e,n),e}}}function K8e(r){return{kind:"validation",type:"bic",reference:K8e,async:!1,expects:null,requirement:b8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"BIC",e,n),e}}}function V2(r){return{kind:"transformation",type:"brand",reference:V2,async:!1,name:r,"~run"(e){return e}}}function G8e(r,e){return{kind:"validation",type:"bytes",reference:G8e,async:!1,expects:`${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=o4(n.value);s!==this.requirement&&zr(this,"bytes",n,i,{received:`${s}`})}return n}}}function q8e(r,e){return{kind:"validation",type:"check",reference:q8e,async:!1,expects:null,requirement:r,message:e,"~run"(n,i){return n.typed&&!this.requirement(n.value)&&zr(this,"input",n,i),n}}}function Z8e(r,e){return{kind:"validation",type:"check",reference:Z8e,async:!0,expects:null,requirement:r,message:e,async"~run"(n,i){return n.typed&&!await this.requirement(n.value)&&zr(this,"input",n,i),n}}}function Y8e(r,e){return{kind:"validation",type:"check_items",reference:Y8e,async:!1,expects:null,requirement:r,message:e,"~run"(n,i){if(n.typed)for(let s=0;s<n.value.length;s++){const o=n.value[s];this.requirement(o,s,n.value)||zr(this,"item",n,i,{input:o,path:[{type:"array",origin:"value",input:n.value,key:s,value:o}]})}return n}}}function X8e(r,e){return{kind:"validation",type:"check_items",reference:X8e,async:!0,expects:null,requirement:r,message:e,async"~run"(n,i){if(n.typed){const s=await Promise.all(n.value.map(this.requirement));for(let o=0;o<n.value.length;o++)if(!s[o]){const a=n.value[o];zr(this,"item",n,i,{input:a,path:[{type:"array",origin:"value",input:n.value,key:o,value:a}]})}}return n}}}var J8e=/^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u,Q8e=/[- ]/gu,ePe=null;function tPe(r){return{kind:"validation",type:"credit_card",reference:tPe,async:!1,expects:null,requirement(e){let n;return J8e.test(e)&&(n=e.replace(Q8e,""))&&ePe.some(i=>i.test(n))&&moe(n)},message:r,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&zr(this,"credit card",e,n),e}}}function rPe(r){return{kind:"validation",type:"cuid2",reference:rPe,async:!1,expects:null,requirement:v8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"Cuid2",e,n),e}}}function nPe(r){return{kind:"validation",type:"decimal",reference:nPe,async:!1,expects:null,requirement:w8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"decimal",e,n),e}}}function iPe(r){return{kind:"metadata",type:"description",reference:iPe,description:r}}function sPe(r){return{kind:"validation",type:"digits",reference:sPe,async:!1,expects:null,requirement:A8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"digits",e,n),e}}}function oPe(r){return{kind:"validation",type:"email",reference:oPe,expects:null,async:!1,requirement:_8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"email",e,n),e}}}function aPe(r){return{kind:"validation",type:"emoji",reference:aPe,async:!1,expects:null,requirement:E8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"emoji",e,n),e}}}function uPe(r){return{kind:"validation",type:"empty",reference:uPe,async:!1,expects:"0",message:r,"~run"(e,n){return e.typed&&e.value.length>0&&zr(this,"length",e,n,{received:`${e.value.length}`}),e}}}function cPe(r,e){return{kind:"validation",type:"ends_with",reference:cPe,async:!1,expects:`"${r}"`,requirement:r,message:e,"~run"(n,i){return n.typed&&!n.value.endsWith(this.requirement)&&zr(this,"end",n,i,{received:`"${n.value.slice(-this.requirement.length)}"`}),n}}}function lPe(r,e){return{kind:"validation",type:"entries",reference:lPe,async:!1,expects:`${r}`,requirement:r,message:e,"~run"(n,i){if(!n.typed)return n;const s=Object.keys(n.value).length;return n.typed&&s!==this.requirement&&zr(this,"entries",n,i,{received:`${s}`}),n}}}function fPe(r,e){return{kind:"validation",type:"every_item",reference:fPe,async:!1,expects:null,requirement:r,message:e,"~run"(n,i){return n.typed&&!n.value.every(this.requirement)&&zr(this,"item",n,i),n}}}function dPe(r,e){const n=Sa(r);return{kind:"validation",type:"excludes",reference:dPe,async:!1,expects:`!${n}`,requirement:r,message:e,"~run"(i,s){return i.typed&&i.value.includes(this.requirement)&&zr(this,"content",i,s,{received:n}),i}}}function hPe(r){return{kind:"transformation",type:"filter_items",reference:hPe,async:!1,operation:r,"~run"(e){return e.value=e.value.filter(this.operation),e}}}function pPe(r){return{kind:"transformation",type:"find_item",reference:pPe,async:!1,operation:r,"~run"(e){return e.value=e.value.find(this.operation),e}}}function gPe(r){return{kind:"validation",type:"finite",reference:gPe,async:!1,expects:null,requirement:Number.isFinite,message:r,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&zr(this,"finite",e,n),e}}}function yPe(r){return{kind:"transformation",type:"flavor",reference:yPe,async:!1,name:r,"~run"(e){return e}}}function mPe(r,e){return{kind:"validation",type:"graphemes",reference:mPe,async:!1,expects:`${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=a4(n.value);s!==this.requirement&&zr(this,"graphemes",n,i,{received:`${s}`})}return n}}}function bPe(r,e){return{kind:"validation",type:"gt_value",reference:bPe,async:!1,expects:`>${r instanceof Date?r.toJSON():Sa(r)}`,requirement:r,message:e,"~run"(n,i){return n.typed&&!(n.value>this.requirement)&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}var vPe=null;function wPe(r,e){return{kind:"validation",type:"hash",reference:wPe,expects:null,async:!1,requirement:RegExp(r.map(n=>`^[a-f0-9]{${vPe[n]}}$`).join("|"),"iu"),message:e,"~run"(n,i){return n.typed&&!this.requirement.test(n.value)&&zr(this,"hash",n,i),n}}}function APe(r){return{kind:"validation",type:"hexadecimal",reference:APe,async:!1,expects:null,requirement:T8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"hexadecimal",e,n),e}}}function _Pe(r){return{kind:"validation",type:"hex_color",reference:_Pe,async:!1,expects:null,requirement:S8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"hex color",e,n),e}}}function EPe(r){return{kind:"validation",type:"imei",reference:EPe,async:!1,expects:null,requirement(e){return I8e.test(e)&&moe(e)},message:r,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&zr(this,"IMEI",e,n),e}}}function TPe(r,e){const n=Sa(r);return{kind:"validation",type:"includes",reference:TPe,async:!1,expects:n,requirement:r,message:e,"~run"(i,s){return i.typed&&!i.value.includes(this.requirement)&&zr(this,"content",i,s,{received:`!${n}`}),i}}}function SPe(r){return{kind:"validation",type:"integer",reference:SPe,async:!1,expects:null,requirement:Number.isInteger,message:r,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&zr(this,"integer",e,n),e}}}function IPe(r){return{kind:"validation",type:"ip",reference:IPe,async:!1,expects:null,requirement:C8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"IP",e,n),e}}}function kPe(r){return{kind:"validation",type:"ipv4",reference:kPe,async:!1,expects:null,requirement:k8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"IPv4",e,n),e}}}function RPe(r){return{kind:"validation",type:"ipv6",reference:RPe,async:!1,expects:null,requirement:R8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"IPv6",e,n),e}}}function CPe(r){return{kind:"validation",type:"iso_date",reference:CPe,async:!1,expects:null,requirement:x8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"date",e,n),e}}}function xPe(r){return{kind:"validation",type:"iso_date_time",reference:xPe,async:!1,expects:null,requirement:B8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"date-time",e,n),e}}}function BPe(r){return{kind:"validation",type:"iso_time",reference:BPe,async:!1,expects:null,requirement:O8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"time",e,n),e}}}function OPe(r){return{kind:"validation",type:"iso_time_second",reference:OPe,async:!1,expects:null,requirement:P8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"time-second",e,n),e}}}function PPe(r){return{kind:"validation",type:"iso_timestamp",reference:PPe,async:!1,expects:null,requirement:N8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"timestamp",e,n),e}}}function NPe(r){return{kind:"validation",type:"iso_week",reference:NPe,async:!1,expects:null,requirement:M8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"week",e,n),e}}}function MPe(r,e){return{kind:"validation",type:"length",reference:MPe,async:!1,expects:`${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.length!==this.requirement&&zr(this,"length",n,i,{received:`${n.value.length}`}),n}}}function LPe(r,e){return{kind:"validation",type:"lt_value",reference:LPe,async:!1,expects:`<${r instanceof Date?r.toJSON():Sa(r)}`,requirement:r,message:e,"~run"(n,i){return n.typed&&!(n.value<this.requirement)&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}function DPe(r){return{kind:"validation",type:"mac",reference:DPe,async:!1,expects:null,requirement:U8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"MAC",e,n),e}}}function UPe(r){return{kind:"validation",type:"mac48",reference:UPe,async:!1,expects:null,requirement:L8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"48-bit MAC",e,n),e}}}function FPe(r){return{kind:"validation",type:"mac64",reference:FPe,async:!1,expects:null,requirement:D8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"64-bit MAC",e,n),e}}}function WPe(r){return{kind:"transformation",type:"map_items",reference:WPe,async:!1,operation:r,"~run"(e){return e.value=e.value.map(this.operation),e}}}function HPe(r,e){return{kind:"validation",type:"max_bytes",reference:HPe,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=o4(n.value);s>this.requirement&&zr(this,"bytes",n,i,{received:`${s}`})}return n}}}function zPe(r,e){return{kind:"validation",type:"max_entries",reference:zPe,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(n,i){if(!n.typed)return n;const s=Object.keys(n.value).length;return n.typed&&s>this.requirement&&zr(this,"entries",n,i,{received:`${s}`}),n}}}function $Pe(r,e){return{kind:"validation",type:"max_graphemes",reference:$Pe,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=a4(n.value);s>this.requirement&&zr(this,"graphemes",n,i,{received:`${s}`})}return n}}}function VPe(r,e){return{kind:"validation",type:"max_length",reference:VPe,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.length>this.requirement&&zr(this,"length",n,i,{received:`${n.value.length}`}),n}}}function jPe(r,e){return{kind:"validation",type:"max_size",reference:jPe,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.size>this.requirement&&zr(this,"size",n,i,{received:`${n.value.size}`}),n}}}function KPe(r,e){return{kind:"validation",type:"max_value",reference:KPe,async:!1,expects:`<=${r instanceof Date?r.toJSON():Sa(r)}`,requirement:r,message:e,"~run"(n,i){return n.typed&&!(n.value<=this.requirement)&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}function GPe(r,e,n){return{kind:"validation",type:"max_words",reference:GPe,async:!1,expects:`<=${e}`,locales:r,requirement:e,message:n,"~run"(i,s){if(i.typed){const o=u4(this.locales,i.value);o>this.requirement&&zr(this,"words",i,s,{received:`${o}`})}return i}}}function qPe(r){return{kind:"metadata",type:"metadata",reference:qPe,metadata:r}}function ZPe(r,e){return{kind:"validation",type:"mime_type",reference:ZPe,async:!1,expects:wh(r.map(n=>`"${n}"`),"|"),requirement:r,message:e,"~run"(n,i){return n.typed&&!this.requirement.includes(n.value.type)&&zr(this,"MIME type",n,i,{received:`"${n.value.type}"`}),n}}}function YPe(r,e){return{kind:"validation",type:"min_bytes",reference:YPe,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=o4(n.value);s<this.requirement&&zr(this,"bytes",n,i,{received:`${s}`})}return n}}}function XPe(r,e){return{kind:"validation",type:"min_entries",reference:XPe,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(n,i){if(!n.typed)return n;const s=Object.keys(n.value).length;return n.typed&&s<this.requirement&&zr(this,"entries",n,i,{received:`${s}`}),n}}}function JPe(r,e){return{kind:"validation",type:"min_graphemes",reference:JPe,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=a4(n.value);s<this.requirement&&zr(this,"graphemes",n,i,{received:`${s}`})}return n}}}function QPe(r,e){return{kind:"validation",type:"min_length",reference:QPe,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.length<this.requirement&&zr(this,"length",n,i,{received:`${n.value.length}`}),n}}}function eNe(r,e){return{kind:"validation",type:"min_size",reference:eNe,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.size<this.requirement&&zr(this,"size",n,i,{received:`${n.value.size}`}),n}}}function tNe(r,e){return{kind:"validation",type:"min_value",reference:tNe,async:!1,expects:`>=${r instanceof Date?r.toJSON():Sa(r)}`,requirement:r,message:e,"~run"(n,i){return n.typed&&!(n.value>=this.requirement)&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}function rNe(r,e,n){return{kind:"validation",type:"min_words",reference:rNe,async:!1,expects:`>=${e}`,locales:r,requirement:e,message:n,"~run"(i,s){if(i.typed){const o=u4(this.locales,i.value);o<this.requirement&&zr(this,"words",i,s,{received:`${o}`})}return i}}}function nNe(r,e){return{kind:"validation",type:"multiple_of",reference:nNe,async:!1,expects:`%${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value%this.requirement!=0&&zr(this,"multiple",n,i),n}}}function iNe(r){return{kind:"validation",type:"nanoid",reference:iNe,async:!1,expects:null,requirement:F8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"Nano ID",e,n),e}}}function sNe(r){return{kind:"validation",type:"non_empty",reference:sNe,async:!1,expects:"!0",message:r,"~run"(e,n){return e.typed&&e.value.length===0&&zr(this,"length",e,n,{received:"0"}),e}}}function oNe(r){return{kind:"transformation",type:"normalize",reference:oNe,async:!1,form:r,"~run"(e){return e.value=e.value.normalize(this.form),e}}}function aNe(r,e){return{kind:"validation",type:"not_bytes",reference:aNe,async:!1,expects:`!${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=o4(n.value);s===this.requirement&&zr(this,"bytes",n,i,{received:`${s}`})}return n}}}function uNe(r,e){return{kind:"validation",type:"not_entries",reference:uNe,async:!1,expects:`!${r}`,requirement:r,message:e,"~run"(n,i){if(!n.typed)return n;const s=Object.keys(n.value).length;return n.typed&&s===this.requirement&&zr(this,"entries",n,i,{received:`${s}`}),n}}}function cNe(r,e){return{kind:"validation",type:"not_graphemes",reference:cNe,async:!1,expects:`!${r}`,requirement:r,message:e,"~run"(n,i){if(n.typed){const s=a4(n.value);s===this.requirement&&zr(this,"graphemes",n,i,{received:`${s}`})}return n}}}function lNe(r,e){return{kind:"validation",type:"not_length",reference:lNe,async:!1,expects:`!${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.length===this.requirement&&zr(this,"length",n,i,{received:`${n.value.length}`}),n}}}function fNe(r,e){return{kind:"validation",type:"not_size",reference:fNe,async:!1,expects:`!${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.size===this.requirement&&zr(this,"size",n,i,{received:`${n.value.size}`}),n}}}function dNe(r,e){return{kind:"validation",type:"not_value",reference:dNe,async:!1,expects:r instanceof Date?`!${r.toJSON()}`:`!${Sa(r)}`,requirement:r,message:e,"~run"(n,i){return n.typed&&this.requirement<=n.value&&this.requirement>=n.value&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}function hNe(r,e){return{kind:"validation",type:"not_values",reference:hNe,async:!1,expects:`!${wh(r.map(n=>n instanceof Date?n.toJSON():Sa(n)),"|")}`,requirement:r,message:e,"~run"(n,i){return n.typed&&this.requirement.some(s=>s<=n.value&&s>=n.value)&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}function pNe(r,e,n){return{kind:"validation",type:"not_words",reference:pNe,async:!1,expects:`!${e}`,locales:r,requirement:e,message:n,"~run"(i,s){if(i.typed){const o=u4(this.locales,i.value);o===this.requirement&&zr(this,"words",i,s,{received:`${o}`})}return i}}}function gNe(r){return{kind:"validation",type:"octal",reference:gNe,async:!1,expects:null,requirement:W8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"octal",e,n),e}}}function yNe(r,e){return{kind:"transformation",type:"parse_json",reference:yNe,config:r,message:e,async:!1,"~run"(n,i){try{n.value=JSON.parse(n.value,this.config?.reviver)}catch(s){if(s instanceof Error)zr(this,"JSON",n,i,{received:`"${s.message}"`}),n.typed=!1;else throw s}return n}}}function voe(r,e){if(r.issues)for(const n of e)for(const i of r.issues){let s=!1;const o=Math.min(n.length,i.path?.length??0);for(let a=0;a<o;a++)if(n[a]!==i.path[a].key&&(n[a]!=="$"||i.path[a].type!=="array")){s=!0;break}if(!s)return!1}return!0}function mNe(r,e,n){return{kind:"validation",type:"partial_check",reference:mNe,async:!1,expects:null,paths:r,requirement:e,message:n,"~run"(i,s){return(i.typed||voe(i,r))&&!this.requirement(i.value)&&zr(this,"input",i,s),i}}}function bNe(r,e,n){return{kind:"validation",type:"partial_check",reference:bNe,async:!0,expects:null,paths:r,requirement:e,message:n,async"~run"(i,s){return(i.typed||voe(i,r))&&!await this.requirement(i.value)&&zr(this,"input",i,s),i}}}function vNe(r){return{kind:"validation",type:"raw_check",reference:vNe,async:!1,expects:null,"~run"(e,n){return r({dataset:e,config:n,addIssue:i=>zr(this,i?.label??"input",e,n,i)}),e}}}function wNe(r){return{kind:"validation",type:"raw_check",reference:wNe,async:!0,expects:null,async"~run"(e,n){return await r({dataset:e,config:n,addIssue:i=>zr(this,i?.label??"input",e,n,i)}),e}}}function ANe(r){return{kind:"transformation",type:"raw_transform",reference:ANe,async:!1,"~run"(e,n){const i=r({dataset:e,config:n,addIssue:s=>zr(this,s?.label??"input",e,n,s),NEVER:null});return e.issues?e.typed=!1:e.value=i,e}}}function _Ne(r){return{kind:"transformation",type:"raw_transform",reference:_Ne,async:!0,async"~run"(e,n){const i=await r({dataset:e,config:n,addIssue:s=>zr(this,s?.label??"input",e,n,s),NEVER:null});return e.issues?e.typed=!1:e.value=i,e}}}function ENe(){return{kind:"transformation",type:"readonly",reference:ENe,async:!1,"~run"(r){return r}}}function TNe(r,e){return{kind:"transformation",type:"reduce_items",reference:TNe,async:!1,operation:r,initial:e,"~run"(n){return n.value=n.value.reduce(this.operation,this.initial),n}}}function SNe(r,e){return{kind:"validation",type:"regex",reference:SNe,async:!1,expects:`${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&!this.requirement.test(n.value)&&zr(this,"format",n,i),n}}}function INe(r){return{kind:"transformation",type:"returns",reference:INe,async:!1,schema:r,"~run"(e,n){const i=e.value;return e.value=(...s)=>{const o=this.schema["~run"]({value:i(...s)},n);if(o.issues)throw new Sm(o.issues);return o.value},e}}}function kNe(r){return{kind:"transformation",type:"returns",reference:kNe,async:!1,schema:r,"~run"(e,n){const i=e.value;return e.value=async(...s)=>{const o=await this.schema["~run"]({value:await i(...s)},n);if(o.issues)throw new Sm(o.issues);return o.value},e}}}function RNe(r){return{kind:"validation",type:"rfc_email",reference:RNe,expects:null,async:!1,requirement:H8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"email",e,n),e}}}function CNe(r){return{kind:"validation",type:"safe_integer",reference:CNe,async:!1,expects:null,requirement:Number.isSafeInteger,message:r,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&zr(this,"safe integer",e,n),e}}}function xNe(r,e){return{kind:"validation",type:"size",reference:xNe,async:!1,expects:`${r}`,requirement:r,message:e,"~run"(n,i){return n.typed&&n.value.size!==this.requirement&&zr(this,"size",n,i,{received:`${n.value.size}`}),n}}}function BNe(r){return{kind:"validation",type:"slug",reference:BNe,async:!1,expects:null,requirement:z8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"slug",e,n),e}}}function ONe(r,e){return{kind:"validation",type:"some_item",reference:ONe,async:!1,expects:null,requirement:r,message:e,"~run"(n,i){return n.typed&&!n.value.some(this.requirement)&&zr(this,"item",n,i),n}}}function PNe(r){return{kind:"transformation",type:"sort_items",reference:PNe,async:!1,operation:r,"~run"(e){return e.value=e.value.sort(this.operation),e}}}function NNe(r,e){return{kind:"validation",type:"starts_with",reference:NNe,async:!1,expects:`"${r}"`,requirement:r,message:e,"~run"(n,i){return n.typed&&!n.value.startsWith(this.requirement)&&zr(this,"start",n,i,{received:`"${n.value.slice(0,this.requirement.length)}"`}),n}}}function MNe(r,e){return{kind:"transformation",type:"stringify_json",reference:MNe,message:e,config:r,async:!1,"~run"(n,i){try{const s=JSON.stringify(n.value,this.config?.replacer,this.config?.space);s===void 0&&(zr(this,"JSON",n,i),n.typed=!1),n.value=s}catch(s){if(s instanceof Error)zr(this,"JSON",n,i,{received:`"${s.message}"`}),n.typed=!1;else throw s}return n}}}function LNe(r){return{kind:"metadata",type:"title",reference:LNe,title:r}}function DNe(){return{kind:"transformation",type:"to_lower_case",reference:DNe,async:!1,"~run"(r){return r.value=r.value.toLowerCase(),r}}}function UNe(r){return{kind:"transformation",type:"to_max_value",reference:UNe,async:!1,requirement:r,"~run"(e){return e.value=e.value>this.requirement?this.requirement:e.value,e}}}function FNe(r){return{kind:"transformation",type:"to_min_value",reference:FNe,async:!1,requirement:r,"~run"(e){return e.value=e.value<this.requirement?this.requirement:e.value,e}}}function WNe(){return{kind:"transformation",type:"to_upper_case",reference:WNe,async:!1,"~run"(r){return r.value=r.value.toUpperCase(),r}}}function HNe(r){return{kind:"transformation",type:"transform",reference:HNe,async:!1,operation:r,"~run"(e){return e.value=this.operation(e.value),e}}}function zNe(r){return{kind:"transformation",type:"transform",reference:zNe,async:!0,operation:r,async"~run"(e){return e.value=await this.operation(e.value),e}}}function $Ne(){return{kind:"transformation",type:"trim",reference:$Ne,async:!1,"~run"(r){return r.value=r.value.trim(),r}}}function VNe(){return{kind:"transformation",type:"trim_end",reference:VNe,async:!1,"~run"(r){return r.value=r.value.trimEnd(),r}}}function jNe(){return{kind:"transformation",type:"trim_start",reference:jNe,async:!1,"~run"(r){return r.value=r.value.trimStart(),r}}}function KNe(r){return{kind:"validation",type:"ulid",reference:KNe,async:!1,expects:null,requirement:$8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"ULID",e,n),e}}}function GNe(r){return{kind:"validation",type:"url",reference:GNe,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:r,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&zr(this,"URL",e,n),e}}}function qNe(r){return{kind:"validation",type:"uuid",reference:qNe,async:!1,expects:null,requirement:V8e,message:r,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&zr(this,"UUID",e,n),e}}}function ZNe(r,e){return{kind:"validation",type:"value",reference:ZNe,async:!1,expects:r instanceof Date?r.toJSON():Sa(r),requirement:r,message:e,"~run"(n,i){return n.typed&&!(this.requirement<=n.value&&this.requirement>=n.value)&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}function YNe(r,e){return{kind:"validation",type:"values",reference:YNe,async:!1,expects:`${wh(r.map(n=>n instanceof Date?n.toJSON():Sa(n)),"|")}`,requirement:r,message:e,"~run"(n,i){return n.typed&&!this.requirement.some(s=>s<=n.value&&s>=n.value)&&zr(this,"value",n,i,{received:n.value instanceof Date?n.value.toJSON():Sa(n.value)}),n}}}function XNe(r,e,n){return{kind:"validation",type:"words",reference:XNe,async:!1,expects:`${e}`,locales:r,requirement:e,message:n,"~run"(i,s){if(i.typed){const o=u4(this.locales,i.value);o!==this.requirement&&zr(this,"words",i,s,{received:`${o}`})}return i}}}function Grt(r,e){const n=r["~run"]({value:e},{abortEarly:!0}).issues;if(n)throw new Sm(n)}function qrt(r,e){return{...r,get"~standard"(){return $n(this)},"~run"(n,i){return r["~run"](n,{...i,...e})}}}function md(r,e,n){return typeof r.fallback=="function"?r.fallback(e,n):r.fallback}function Zrt(r,e){return{...r,fallback:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=r["~run"](n,i);return s.issues?{typed:!0,value:md(this,s,i)}:s}}}function Yrt(r,e){return{...r,fallback:e,async:!0,get"~standard"(){return $n(this)},async"~run"(n,i){const s=await r["~run"](n,i);return s.issues?{typed:!0,value:await md(this,s,i)}:s}}}function Xrt(r){const e={};for(const n of r)if(n.path){const i=boe(n);i?(e.nested||(e.nested={}),e.nested[i]?e.nested[i].push(n.message):e.nested[i]=[n.message]):e.other?e.other.push(n.message):e.other=[n.message]}else e.root?e.root.push(n.message):e.root=[n.message];return e}function Jrt(r,e){return{...r,"~run"(n,i){const s=n.issues&&[...n.issues];if(n=r["~run"](n,i),n.issues){for(const o of n.issues)if(!s?.includes(o)){let a=n.value;for(const u of e){const l=a[u],g={type:"unknown",origin:"value",input:a,key:u,value:l};if(o.path?o.path.push(g):o.path=[g],!l)break;a=l}}}return n}}}function Qrt(r,e){return{...r,async:!0,async"~run"(n,i){const s=n.issues&&[...n.issues];if(n=await r["~run"](n,i),n.issues){for(const o of n.issues)if(!s?.includes(o)){let a=n.value;for(const u of e){const l=a[u],g={type:"unknown",origin:"value",input:a,key:u,value:l};if(o.path?o.path.push(g):o.path=[g],!l)break;a=l}}}return n}}}function Au(r,e,n){return typeof r.default=="function"?r.default(e,n):r.default}function woe(r){if("entries"in r){const e={};for(const n in r.entries)e[n]=woe(r.entries[n]);return e}return"items"in r?r.items.map(woe):Au(r)}async function Aoe(r){return"entries"in r?Object.fromEntries(await Promise.all(Object.entries(r.entries).map(async([e,n])=>[e,await Aoe(n)]))):"items"in r?Promise.all(r.items.map(Aoe)):Au(r)}function ent(r){return EU(r,"description")}function _oe(r){if("entries"in r){const e={};for(const n in r.entries)e[n]=_oe(r.entries[n]);return e}return"items"in r?r.items.map(_oe):md(r)}async function Eoe(r){return"entries"in r?Object.fromEntries(await Promise.all(Object.entries(r.entries).map(async([e,n])=>[e,await Eoe(n)]))):"items"in r?Promise.all(r.items.map(Eoe)):md(r)}function tnt(r){const e={};function n(i){if("pipe"in i)for(const s of i.pipe)s.kind==="schema"&&"pipe"in s?n(s):s.kind==="metadata"&&s.type==="metadata"&&Object.assign(e,s.metadata)}return n(r),e}function rnt(r){return EU(r,"title")}function nnt(r,e){return!r["~run"]({value:e},{abortEarly:!0}).issues}function Ua(){return{kind:"schema",type:"any",reference:Ua,expects:"any",async:!1,get"~standard"(){return $n(this)},"~run"(r){return r.typed=!0,r}}}function es(r,e){return{kind:"schema",type:"array",reference:es,expects:"Array",async:!1,item:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];for(let o=0;o<s.length;o++){const a=s[o],u=this.item["~run"]({value:a},i);if(u.issues){const l={type:"array",origin:"value",input:s,key:o,value:a};for(const g of u.issues)g.path?g.path.unshift(l):g.path=[l],n.issues?.push(g);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}u.typed||(n.typed=!1),n.value.push(u.value)}}else zr(this,"type",n,i);return n}}}function JNe(r,e){return{kind:"schema",type:"array",reference:JNe,expects:"Array",async:!0,item:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];const o=await Promise.all(s.map(a=>this.item["~run"]({value:a},i)));for(let a=0;a<o.length;a++){const u=o[a];if(u.issues){const l={type:"array",origin:"value",input:s,key:a,value:s[a]};for(const g of u.issues)g.path?g.path.unshift(l):g.path=[l],n.issues?.push(g);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}u.typed||(n.typed=!1),n.value.push(u.value)}}else zr(this,"type",n,i);return n}}}function QNe(r){return{kind:"schema",type:"bigint",reference:QNe,expects:"bigint",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return typeof e.value=="bigint"?e.typed=!0:zr(this,"type",e,n),e}}}function eMe(r){return{kind:"schema",type:"blob",reference:eMe,expects:"Blob",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return e.value instanceof Blob?e.typed=!0:zr(this,"type",e,n),e}}}function Wi(r){return{kind:"schema",type:"boolean",reference:Wi,expects:"boolean",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:zr(this,"type",e,n),e}}}function tMe(r,e){return{kind:"schema",type:"custom",reference:tMe,expects:"unknown",async:!1,check:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){return this.check(n.value)?n.typed=!0:zr(this,"type",n,i),n}}}function rMe(r,e){return{kind:"schema",type:"custom",reference:rMe,expects:"unknown",async:!0,check:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){return await this.check(n.value)?n.typed=!0:zr(this,"type",n,i),n}}}function nMe(r){return{kind:"schema",type:"date",reference:nMe,expects:"Date",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return e.value instanceof Date?isNaN(e.value)?zr(this,"type",e,n,{received:'"Invalid Date"'}):e.typed=!0:zr(this,"type",e,n),e}}}function _u(r,e){const n=[];for(const i in r)(`${+i}`!==i||typeof r[i]!="string"||!Object.is(r[r[i]],+i))&&n.push(r[i]);return{kind:"schema",type:"enum",reference:_u,expects:wh(n.map(Sa),"|"),async:!1,enum:r,options:n,message:e,get"~standard"(){return $n(this)},"~run"(i,s){return this.options.includes(i.value)?i.typed=!0:zr(this,"type",i,s),i}}}function iMe(r,e){return{kind:"schema",type:"exact_optional",reference:iMe,expects:r.expects,async:!1,wrapped:r,default:e,get"~standard"(){return $n(this)},"~run"(n,i){return this.wrapped["~run"](n,i)}}}function sMe(r,e){return{kind:"schema",type:"exact_optional",reference:sMe,expects:r.expects,async:!0,wrapped:r,default:e,get"~standard"(){return $n(this)},async"~run"(n,i){return this.wrapped["~run"](n,i)}}}function oMe(r){return{kind:"schema",type:"file",reference:oMe,expects:"File",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return e.value instanceof File?e.typed=!0:zr(this,"type",e,n),e}}}function aMe(r){return{kind:"schema",type:"function",reference:aMe,expects:"Function",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return typeof e.value=="function"?e.typed=!0:zr(this,"type",e,n),e}}}function TU(r,e){return{kind:"schema",type:"instance",reference:TU,expects:r.name,async:!1,class:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value instanceof this.class?n.typed=!0:zr(this,"type",n,i),n}}}function c4(r,e){if(typeof r==typeof e){if(r===e||r instanceof Date&&e instanceof Date&&+r==+e)return{value:r};if(r&&e&&r.constructor===Object&&e.constructor===Object){for(const n in e)if(n in r){const i=c4(r[n],e[n]);if(i.issue)return i;r[n]=i.value}else r[n]=e[n];return{value:r}}if(Array.isArray(r)&&Array.isArray(e)&&r.length===e.length){for(let n=0;n<r.length;n++){const i=c4(r[n],e[n]);if(i.issue)return i;r[n]=i.value}return{value:r}}}return{issue:!0}}function eS(r,e){return{kind:"schema",type:"intersect",reference:eS,expects:wh(r.map(n=>n.expects),"&"),async:!1,options:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){if(this.options.length){const s=n.value;let o;n.typed=!0;for(const a of this.options){const u=a["~run"]({value:s},i);if(u.issues&&(n.issues?n.issues.push(...u.issues):n.issues=u.issues,i.abortEarly)){n.typed=!1;break}u.typed||(n.typed=!1),n.typed&&(o?o.push(u.value):o=[u.value])}if(n.typed){n.value=o[0];for(let a=1;a<o.length;a++){const u=c4(n.value,o[a]);if(u.issue){zr(this,"type",n,i,{received:"unknown"});break}n.value=u.value}}}else zr(this,"type",n,i);return n}}}function uMe(r,e){return{kind:"schema",type:"intersect",reference:uMe,expects:wh(r.map(n=>n.expects),"&"),async:!0,options:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){if(this.options.length){const s=n.value;let o;n.typed=!0;const a=await Promise.all(this.options.map(u=>u["~run"]({value:s},i)));for(const u of a){if(u.issues&&(n.issues?n.issues.push(...u.issues):n.issues=u.issues,i.abortEarly)){n.typed=!1;break}u.typed||(n.typed=!1),n.typed&&(o?o.push(u.value):o=[u.value])}if(n.typed){n.value=o[0];for(let u=1;u<o.length;u++){const l=c4(n.value,o[u]);if(l.issue){zr(this,"type",n,i,{received:"unknown"});break}n.value=l.value}}}else zr(this,"type",n,i);return n}}}function cMe(r){return{kind:"schema",type:"lazy",reference:cMe,expects:"unknown",async:!1,getter:r,get"~standard"(){return $n(this)},"~run"(e,n){return this.getter(e.value)["~run"](e,n)}}}function lMe(r){return{kind:"schema",type:"lazy",reference:lMe,expects:"unknown",async:!0,getter:r,get"~standard"(){return $n(this)},async"~run"(e,n){return(await this.getter(e.value))["~run"](e,n)}}}function qu(r,e){return{kind:"schema",type:"literal",reference:qu,expects:Sa(r),async:!1,literal:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value===this.literal?n.typed=!0:zr(this,"type",n,i),n}}}function fMe(r,e){return{kind:"schema",type:"loose_object",reference:fMe,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(const o in this.entries){const a=this.entries[o];if(o in s||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const u=o in s?s[o]:Au(a),l=a["~run"]({value:u},i);if(l.issues){const g={type:"object",origin:"value",input:s,key:o,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],n.issues?.push(y);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[o]=l.value}else if(a.fallback!==void 0)n.value[o]=md(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(zr(this,"key",n,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]}),i.abortEarly))break}if(!n.issues||!i.abortEarly)for(const o in s)$2(s,o)&&!(o in this.entries)&&(n.value[o]=s[o])}else zr(this,"type",n,i);return n}}}function dMe(r,e){return{kind:"schema",type:"loose_object",reference:dMe,expects:"Object",async:!0,entries:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};const o=await Promise.all(Object.entries(this.entries).map(async([a,u])=>{if(a in s||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=a in s?s[a]:await Au(u);return[a,l,u,await u["~run"]({value:l},i)]}return[a,s[a],u,null]}));for(const[a,u,l,g]of o)if(g){if(g.issues){const y={type:"object",origin:"value",input:s,key:a,value:u};for(const A of g.issues)A.path?A.path.unshift(y):A.path=[y],n.issues?.push(A);if(n.issues||(n.issues=g.issues),i.abortEarly){n.typed=!1;break}}g.typed||(n.typed=!1),n.value[a]=g.value}else if(l.fallback!==void 0)n.value[a]=await md(l);else if(l.type!=="exact_optional"&&l.type!=="optional"&&l.type!=="nullish"&&(zr(this,"key",n,i,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:s,key:a,value:u}]}),i.abortEarly))break;if(!n.issues||!i.abortEarly)for(const a in s)$2(s,a)&&!(a in this.entries)&&(n.value[a]=s[a])}else zr(this,"type",n,i);return n}}}function hMe(r,e){return{kind:"schema",type:"loose_tuple",reference:hMe,expects:"Array",async:!1,items:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];for(let o=0;o<this.items.length;o++){const a=s[o],u=this.items[o]["~run"]({value:a},i);if(u.issues){const l={type:"array",origin:"value",input:s,key:o,value:a};for(const g of u.issues)g.path?g.path.unshift(l):g.path=[l],n.issues?.push(g);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}u.typed||(n.typed=!1),n.value.push(u.value)}if(!n.issues||!i.abortEarly)for(let o=this.items.length;o<s.length;o++)n.value.push(s[o])}else zr(this,"type",n,i);return n}}}function pMe(r,e){return{kind:"schema",type:"loose_tuple",reference:pMe,expects:"Array",async:!0,items:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];const o=await Promise.all(this.items.map(async(a,u)=>{const l=s[u];return[u,l,await a["~run"]({value:l},i)]}));for(const[a,u,l]of o){if(l.issues){const g={type:"array",origin:"value",input:s,key:a,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],n.issues?.push(y);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value.push(l.value)}if(!n.issues||!i.abortEarly)for(let a=this.items.length;a<s.length;a++)n.value.push(s[a])}else zr(this,"type",n,i);return n}}}function gMe(r,e,n){return{kind:"schema",type:"map",reference:gMe,expects:"Map",async:!1,key:r,value:e,message:n,get"~standard"(){return $n(this)},"~run"(i,s){const o=i.value;if(o instanceof Map){i.typed=!0,i.value=new Map;for(const[a,u]of o){const l=this.key["~run"]({value:a},s);if(l.issues){const y={type:"map",origin:"key",input:o,key:a,value:u};for(const A of l.issues)A.path?A.path.unshift(y):A.path=[y],i.issues?.push(A);if(i.issues||(i.issues=l.issues),s.abortEarly){i.typed=!1;break}}const g=this.value["~run"]({value:u},s);if(g.issues){const y={type:"map",origin:"value",input:o,key:a,value:u};for(const A of g.issues)A.path?A.path.unshift(y):A.path=[y],i.issues?.push(A);if(i.issues||(i.issues=g.issues),s.abortEarly){i.typed=!1;break}}(!l.typed||!g.typed)&&(i.typed=!1),i.value.set(l.value,g.value)}}else zr(this,"type",i,s);return i}}}function yMe(r,e,n){return{kind:"schema",type:"map",reference:yMe,expects:"Map",async:!0,key:r,value:e,message:n,get"~standard"(){return $n(this)},async"~run"(i,s){const o=i.value;if(o instanceof Map){i.typed=!0,i.value=new Map;const a=await Promise.all([...o].map(([u,l])=>Promise.all([u,l,this.key["~run"]({value:u},s),this.value["~run"]({value:l},s)])));for(const[u,l,g,y]of a){if(g.issues){const A={type:"map",origin:"key",input:o,key:u,value:l};for(const I of g.issues)I.path?I.path.unshift(A):I.path=[A],i.issues?.push(I);if(i.issues||(i.issues=g.issues),s.abortEarly){i.typed=!1;break}}if(y.issues){const A={type:"map",origin:"value",input:o,key:u,value:l};for(const I of y.issues)I.path?I.path.unshift(A):I.path=[A],i.issues?.push(I);if(i.issues||(i.issues=y.issues),s.abortEarly){i.typed=!1;break}}(!g.typed||!y.typed)&&(i.typed=!1),i.value.set(g.value,y.value)}}else zr(this,"type",i,s);return i}}}function mMe(r){return{kind:"schema",type:"nan",reference:mMe,expects:"NaN",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return Number.isNaN(e.value)?e.typed=!0:zr(this,"type",e,n),e}}}function bMe(r){return{kind:"schema",type:"never",reference:bMe,expects:"never",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return zr(this,"type",e,n),e}}}function vMe(r,e){return{kind:"schema",type:"non_nullable",reference:vMe,expects:"!null",async:!1,wrapped:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value!==null&&(n=this.wrapped["~run"](n,i)),n.value===null&&zr(this,"type",n,i),n}}}function wMe(r,e){return{kind:"schema",type:"non_nullable",reference:wMe,expects:"!null",async:!0,wrapped:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){return n.value!==null&&(n=await this.wrapped["~run"](n,i)),n.value===null&&zr(this,"type",n,i),n}}}function AMe(r,e){return{kind:"schema",type:"non_nullish",reference:AMe,expects:"(!null & !undefined)",async:!1,wrapped:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value===null||n.value===void 0||(n=this.wrapped["~run"](n,i)),(n.value===null||n.value===void 0)&&zr(this,"type",n,i),n}}}function _Me(r,e){return{kind:"schema",type:"non_nullish",reference:_Me,expects:"(!null & !undefined)",async:!0,wrapped:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){return n.value===null||n.value===void 0||(n=await this.wrapped["~run"](n,i)),(n.value===null||n.value===void 0)&&zr(this,"type",n,i),n}}}function Toe(r,e){return{kind:"schema",type:"non_optional",reference:Toe,expects:"!undefined",async:!1,wrapped:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value!==void 0&&(n=this.wrapped["~run"](n,i)),n.value===void 0&&zr(this,"type",n,i),n}}}function Soe(r,e){return{kind:"schema",type:"non_optional",reference:Soe,expects:"!undefined",async:!0,wrapped:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){return n.value!==void 0&&(n=await this.wrapped["~run"](n,i)),n.value===void 0&&zr(this,"type",n,i),n}}}function kc(r){return{kind:"schema",type:"null",reference:kc,expects:"null",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return e.value===null?e.typed=!0:zr(this,"type",e,n),e}}}function sn(r,e){return{kind:"schema",type:"nullable",reference:sn,expects:`(${r.expects} | null)`,async:!1,wrapped:r,default:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value===null&&(this.default!==void 0&&(n.value=Au(this,n,i)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function EMe(r,e){return{kind:"schema",type:"nullable",reference:EMe,expects:`(${r.expects} | null)`,async:!0,wrapped:r,default:e,get"~standard"(){return $n(this)},async"~run"(n,i){return n.value===null&&(this.default!==void 0&&(n.value=await Au(this,n,i)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function TMe(r,e){return{kind:"schema",type:"nullish",reference:TMe,expects:`(${r.expects} | null | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return $n(this)},"~run"(n,i){return(n.value===null||n.value===void 0)&&(this.default!==void 0&&(n.value=Au(this,n,i)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function SMe(r,e){return{kind:"schema",type:"nullish",reference:SMe,expects:`(${r.expects} | null | undefined)`,async:!0,wrapped:r,default:e,get"~standard"(){return $n(this)},async"~run"(n,i){return(n.value===null||n.value===void 0)&&(this.default!==void 0&&(n.value=await Au(this,n,i)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function fn(r){return{kind:"schema",type:"number",reference:fn,expects:"number",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:zr(this,"type",e,n),e}}}function qr(r,e){return{kind:"schema",type:"object",reference:qr,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(const o in this.entries){const a=this.entries[o];if(o in s||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const u=o in s?s[o]:Au(a),l=a["~run"]({value:u},i);if(l.issues){const g={type:"object",origin:"value",input:s,key:o,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],n.issues?.push(y);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[o]=l.value}else if(a.fallback!==void 0)n.value[o]=md(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(zr(this,"key",n,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]}),i.abortEarly))break}}else zr(this,"type",n,i);return n}}}function IMe(r,e){return{kind:"schema",type:"object",reference:IMe,expects:"Object",async:!0,entries:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};const o=await Promise.all(Object.entries(this.entries).map(async([a,u])=>{if(a in s||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=a in s?s[a]:await Au(u);return[a,l,u,await u["~run"]({value:l},i)]}return[a,s[a],u,null]}));for(const[a,u,l,g]of o)if(g){if(g.issues){const y={type:"object",origin:"value",input:s,key:a,value:u};for(const A of g.issues)A.path?A.path.unshift(y):A.path=[y],n.issues?.push(A);if(n.issues||(n.issues=g.issues),i.abortEarly){n.typed=!1;break}}g.typed||(n.typed=!1),n.value[a]=g.value}else if(l.fallback!==void 0)n.value[a]=await md(l);else if(l.type!=="exact_optional"&&l.type!=="optional"&&l.type!=="nullish"&&(zr(this,"key",n,i,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:s,key:a,value:u}]}),i.abortEarly))break}else zr(this,"type",n,i);return n}}}function kMe(r,e,n){return{kind:"schema",type:"object_with_rest",reference:kMe,expects:"Object",async:!1,entries:r,rest:e,message:n,get"~standard"(){return $n(this)},"~run"(i,s){const o=i.value;if(o&&typeof o=="object"){i.typed=!0,i.value={};for(const a in this.entries){const u=this.entries[a];if(a in o||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=a in o?o[a]:Au(u),g=u["~run"]({value:l},s);if(g.issues){const y={type:"object",origin:"value",input:o,key:a,value:l};for(const A of g.issues)A.path?A.path.unshift(y):A.path=[y],i.issues?.push(A);if(i.issues||(i.issues=g.issues),s.abortEarly){i.typed=!1;break}}g.typed||(i.typed=!1),i.value[a]=g.value}else if(u.fallback!==void 0)i.value[a]=md(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(zr(this,"key",i,s,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:o,key:a,value:o[a]}]}),s.abortEarly))break}if(!i.issues||!s.abortEarly){for(const a in o)if($2(o,a)&&!(a in this.entries)){const u=this.rest["~run"]({value:o[a]},s);if(u.issues){const l={type:"object",origin:"value",input:o,key:a,value:o[a]};for(const g of u.issues)g.path?g.path.unshift(l):g.path=[l],i.issues?.push(g);if(i.issues||(i.issues=u.issues),s.abortEarly){i.typed=!1;break}}u.typed||(i.typed=!1),i.value[a]=u.value}}}else zr(this,"type",i,s);return i}}}function RMe(r,e,n){return{kind:"schema",type:"object_with_rest",reference:RMe,expects:"Object",async:!0,entries:r,rest:e,message:n,get"~standard"(){return $n(this)},async"~run"(i,s){const o=i.value;if(o&&typeof o=="object"){i.typed=!0,i.value={};const[a,u]=await Promise.all([Promise.all(Object.entries(this.entries).map(async([l,g])=>{if(l in o||(g.type==="exact_optional"||g.type==="optional"||g.type==="nullish")&&g.default!==void 0){const y=l in o?o[l]:await Au(g);return[l,y,g,await g["~run"]({value:y},s)]}return[l,o[l],g,null]})),Promise.all(Object.entries(o).filter(([l])=>$2(o,l)&&!(l in this.entries)).map(async([l,g])=>[l,g,await this.rest["~run"]({value:g},s)]))]);for(const[l,g,y,A]of a)if(A){if(A.issues){const I={type:"object",origin:"value",input:o,key:l,value:g};for(const P of A.issues)P.path?P.path.unshift(I):P.path=[I],i.issues?.push(P);if(i.issues||(i.issues=A.issues),s.abortEarly){i.typed=!1;break}}A.typed||(i.typed=!1),i.value[l]=A.value}else if(y.fallback!==void 0)i.value[l]=await md(y);else if(y.type!=="exact_optional"&&y.type!=="optional"&&y.type!=="nullish"&&(zr(this,"key",i,s,{input:void 0,expected:`"${l}"`,path:[{type:"object",origin:"key",input:o,key:l,value:g}]}),s.abortEarly))break;if(!i.issues||!s.abortEarly)for(const[l,g,y]of u){if(y.issues){const A={type:"object",origin:"value",input:o,key:l,value:g};for(const I of y.issues)I.path?I.path.unshift(A):I.path=[A],i.issues?.push(I);if(i.issues||(i.issues=y.issues),s.abortEarly){i.typed=!1;break}}y.typed||(i.typed=!1),i.value[l]=y.value}}else zr(this,"type",i,s);return i}}}function un(r,e){return{kind:"schema",type:"optional",reference:un,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value===void 0&&(this.default!==void 0&&(n.value=Au(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function Ioe(r,e){return{kind:"schema",type:"optional",reference:Ioe,expects:`(${r.expects} | undefined)`,async:!0,wrapped:r,default:e,get"~standard"(){return $n(this)},async"~run"(n,i){return n.value===void 0&&(this.default!==void 0&&(n.value=await Au(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function SU(r,e){return{kind:"schema",type:"picklist",reference:SU,expects:wh(r.map(Sa),"|"),async:!1,options:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){return this.options.includes(n.value)?n.typed=!0:zr(this,"type",n,i),n}}}function CMe(r){return{kind:"schema",type:"promise",reference:CMe,expects:"Promise",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return e.value instanceof Promise?e.typed=!0:zr(this,"type",e,n),e}}}function tS(r,e,n){return{kind:"schema",type:"record",reference:tS,expects:"Object",async:!1,key:r,value:e,message:n,get"~standard"(){return $n(this)},"~run"(i,s){const o=i.value;if(o&&typeof o=="object"){i.typed=!0,i.value={};for(const a in o)if($2(o,a)){const u=o[a],l=this.key["~run"]({value:a},s);if(l.issues){const y={type:"object",origin:"key",input:o,key:a,value:u};for(const A of l.issues)A.path=[y],i.issues?.push(A);if(i.issues||(i.issues=l.issues),s.abortEarly){i.typed=!1;break}}const g=this.value["~run"]({value:u},s);if(g.issues){const y={type:"object",origin:"value",input:o,key:a,value:u};for(const A of g.issues)A.path?A.path.unshift(y):A.path=[y],i.issues?.push(A);if(i.issues||(i.issues=g.issues),s.abortEarly){i.typed=!1;break}}(!l.typed||!g.typed)&&(i.typed=!1),l.typed&&(i.value[l.value]=g.value)}}else zr(this,"type",i,s);return i}}}function xMe(r,e,n){return{kind:"schema",type:"record",reference:xMe,expects:"Object",async:!0,key:r,value:e,message:n,get"~standard"(){return $n(this)},async"~run"(i,s){const o=i.value;if(o&&typeof o=="object"){i.typed=!0,i.value={};const a=await Promise.all(Object.entries(o).filter(([u])=>$2(o,u)).map(([u,l])=>Promise.all([u,l,this.key["~run"]({value:u},s),this.value["~run"]({value:l},s)])));for(const[u,l,g,y]of a){if(g.issues){const A={type:"object",origin:"key",input:o,key:u,value:l};for(const I of g.issues)I.path=[A],i.issues?.push(I);if(i.issues||(i.issues=g.issues),s.abortEarly){i.typed=!1;break}}if(y.issues){const A={type:"object",origin:"value",input:o,key:u,value:l};for(const I of y.issues)I.path?I.path.unshift(A):I.path=[A],i.issues?.push(I);if(i.issues||(i.issues=y.issues),s.abortEarly){i.typed=!1;break}}(!g.typed||!y.typed)&&(i.typed=!1),g.typed&&(i.value[g.value]=y.value)}}else zr(this,"type",i,s);return i}}}function BMe(r,e){return{kind:"schema",type:"set",reference:BMe,expects:"Set",async:!1,value:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(s instanceof Set){n.typed=!0,n.value=new Set;for(const o of s){const a=this.value["~run"]({value:o},i);if(a.issues){const u={type:"set",origin:"value",input:s,key:null,value:o};for(const l of a.issues)l.path?l.path.unshift(u):l.path=[u],n.issues?.push(l);if(n.issues||(n.issues=a.issues),i.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.add(a.value)}}else zr(this,"type",n,i);return n}}}function OMe(r,e){return{kind:"schema",type:"set",reference:OMe,expects:"Set",async:!0,value:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(s instanceof Set){n.typed=!0,n.value=new Set;const o=await Promise.all([...s].map(async a=>[a,await this.value["~run"]({value:a},i)]));for(const[a,u]of o){if(u.issues){const l={type:"set",origin:"value",input:s,key:null,value:a};for(const g of u.issues)g.path?g.path.unshift(l):g.path=[l],n.issues?.push(g);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}u.typed||(n.typed=!1),n.value.add(u.value)}}else zr(this,"type",n,i);return n}}}function PMe(r,e){return{kind:"schema",type:"strict_object",reference:PMe,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(const o in this.entries){const a=this.entries[o];if(o in s||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const u=o in s?s[o]:Au(a),l=a["~run"]({value:u},i);if(l.issues){const g={type:"object",origin:"value",input:s,key:o,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],n.issues?.push(y);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[o]=l.value}else if(a.fallback!==void 0)n.value[o]=md(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(zr(this,"key",n,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]}),i.abortEarly))break}if(!n.issues||!i.abortEarly){for(const o in s)if(!(o in this.entries)){zr(this,"key",n,i,{input:o,expected:"never",path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]});break}}}else zr(this,"type",n,i);return n}}}function NMe(r,e){return{kind:"schema",type:"strict_object",reference:NMe,expects:"Object",async:!0,entries:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};const o=await Promise.all(Object.entries(this.entries).map(async([a,u])=>{if(a in s||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=a in s?s[a]:await Au(u);return[a,l,u,await u["~run"]({value:l},i)]}return[a,s[a],u,null]}));for(const[a,u,l,g]of o)if(g){if(g.issues){const y={type:"object",origin:"value",input:s,key:a,value:u};for(const A of g.issues)A.path?A.path.unshift(y):A.path=[y],n.issues?.push(A);if(n.issues||(n.issues=g.issues),i.abortEarly){n.typed=!1;break}}g.typed||(n.typed=!1),n.value[a]=g.value}else if(l.fallback!==void 0)n.value[a]=await md(l);else if(l.type!=="exact_optional"&&l.type!=="optional"&&l.type!=="nullish"&&(zr(this,"key",n,i,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:s,key:a,value:u}]}),i.abortEarly))break;if(!n.issues||!i.abortEarly){for(const a in s)if(!(a in this.entries)){zr(this,"key",n,i,{input:a,expected:"never",path:[{type:"object",origin:"key",input:s,key:a,value:s[a]}]});break}}}else zr(this,"type",n,i);return n}}}function MMe(r,e){return{kind:"schema",type:"strict_tuple",reference:MMe,expects:"Array",async:!1,items:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];for(let o=0;o<this.items.length;o++){const a=s[o],u=this.items[o]["~run"]({value:a},i);if(u.issues){const l={type:"array",origin:"value",input:s,key:o,value:a};for(const g of u.issues)g.path?g.path.unshift(l):g.path=[l],n.issues?.push(g);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}u.typed||(n.typed=!1),n.value.push(u.value)}!(n.issues&&i.abortEarly)&&this.items.length<s.length&&zr(this,"type",n,i,{input:s[this.items.length],expected:"never",path:[{type:"array",origin:"value",input:s,key:this.items.length,value:s[this.items.length]}]})}else zr(this,"type",n,i);return n}}}function LMe(r,e){return{kind:"schema",type:"strict_tuple",reference:LMe,expects:"Array",async:!0,items:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];const o=await Promise.all(this.items.map(async(a,u)=>{const l=s[u];return[u,l,await a["~run"]({value:l},i)]}));for(const[a,u,l]of o){if(l.issues){const g={type:"array",origin:"value",input:s,key:a,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],n.issues?.push(y);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value.push(l.value)}!(n.issues&&i.abortEarly)&&this.items.length<s.length&&zr(this,"type",n,i,{input:s[this.items.length],expected:"never",path:[{type:"array",origin:"value",input:s,key:this.items.length,value:s[this.items.length]}]})}else zr(this,"type",n,i);return n}}}function pt(r){return{kind:"schema",type:"string",reference:pt,expects:"string",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:zr(this,"type",e,n),e}}}function DMe(r){return{kind:"schema",type:"symbol",reference:DMe,expects:"symbol",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return typeof e.value=="symbol"?e.typed=!0:zr(this,"type",e,n),e}}}function UMe(r,e){return{kind:"schema",type:"tuple",reference:UMe,expects:"Array",async:!1,items:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];for(let o=0;o<this.items.length;o++){const a=s[o],u=this.items[o]["~run"]({value:a},i);if(u.issues){const l={type:"array",origin:"value",input:s,key:o,value:a};for(const g of u.issues)g.path?g.path.unshift(l):g.path=[l],n.issues?.push(g);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}u.typed||(n.typed=!1),n.value.push(u.value)}}else zr(this,"type",n,i);return n}}}function FMe(r,e){return{kind:"schema",type:"tuple",reference:FMe,expects:"Array",async:!0,items:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){const s=n.value;if(Array.isArray(s)){n.typed=!0,n.value=[];const o=await Promise.all(this.items.map(async(a,u)=>{const l=s[u];return[u,l,await a["~run"]({value:l},i)]}));for(const[a,u,l]of o){if(l.issues){const g={type:"array",origin:"value",input:s,key:a,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],n.issues?.push(y);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value.push(l.value)}}else zr(this,"type",n,i);return n}}}function WMe(r,e,n){return{kind:"schema",type:"tuple_with_rest",reference:WMe,expects:"Array",async:!1,items:r,rest:e,message:n,get"~standard"(){return $n(this)},"~run"(i,s){const o=i.value;if(Array.isArray(o)){i.typed=!0,i.value=[];for(let a=0;a<this.items.length;a++){const u=o[a],l=this.items[a]["~run"]({value:u},s);if(l.issues){const g={type:"array",origin:"value",input:o,key:a,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],i.issues?.push(y);if(i.issues||(i.issues=l.issues),s.abortEarly){i.typed=!1;break}}l.typed||(i.typed=!1),i.value.push(l.value)}if(!i.issues||!s.abortEarly)for(let a=this.items.length;a<o.length;a++){const u=o[a],l=this.rest["~run"]({value:u},s);if(l.issues){const g={type:"array",origin:"value",input:o,key:a,value:u};for(const y of l.issues)y.path?y.path.unshift(g):y.path=[g],i.issues?.push(y);if(i.issues||(i.issues=l.issues),s.abortEarly){i.typed=!1;break}}l.typed||(i.typed=!1),i.value.push(l.value)}}else zr(this,"type",i,s);return i}}}function HMe(r,e,n){return{kind:"schema",type:"tuple_with_rest",reference:HMe,expects:"Array",async:!0,items:r,rest:e,message:n,get"~standard"(){return $n(this)},async"~run"(i,s){const o=i.value;if(Array.isArray(o)){i.typed=!0,i.value=[];const[a,u]=await Promise.all([Promise.all(this.items.map(async(l,g)=>{const y=o[g];return[g,y,await l["~run"]({value:y},s)]})),Promise.all(o.slice(this.items.length).map(async(l,g)=>[g+this.items.length,l,await this.rest["~run"]({value:l},s)]))]);for(const[l,g,y]of a){if(y.issues){const A={type:"array",origin:"value",input:o,key:l,value:g};for(const I of y.issues)I.path?I.path.unshift(A):I.path=[A],i.issues?.push(I);if(i.issues||(i.issues=y.issues),s.abortEarly){i.typed=!1;break}}y.typed||(i.typed=!1),i.value.push(y.value)}if(!i.issues||!s.abortEarly)for(const[l,g,y]of u){if(y.issues){const A={type:"array",origin:"value",input:o,key:l,value:g};for(const I of y.issues)I.path?I.path.unshift(A):I.path=[A],i.issues?.push(I);if(i.issues||(i.issues=y.issues),s.abortEarly){i.typed=!1;break}}y.typed||(i.typed=!1),i.value.push(y.value)}}else zr(this,"type",i,s);return i}}}function koe(r){return{kind:"schema",type:"undefined",reference:koe,expects:"undefined",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return e.value===void 0?e.typed=!0:zr(this,"type",e,n),e}}}function zMe(r,e){return{kind:"schema",type:"undefinedable",reference:zMe,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return $n(this)},"~run"(n,i){return n.value===void 0&&(this.default!==void 0&&(n.value=Au(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function $Me(r,e){return{kind:"schema",type:"undefinedable",reference:$Me,expects:`(${r.expects} | undefined)`,async:!0,wrapped:r,default:e,get"~standard"(){return $n(this)},async"~run"(n,i){return n.value===void 0&&(this.default!==void 0&&(n.value=await Au(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}}}function l4(r){let e;if(r)for(const n of r)e?e.push(...n.issues):e=n.issues;return e}function ra(r,e){return{kind:"schema",type:"union",reference:ra,expects:wh(r.map(n=>n.expects),"|"),async:!1,options:r,message:e,get"~standard"(){return $n(this)},"~run"(n,i){let s,o,a;for(const u of this.options){const l=u["~run"]({value:n.value},i);if(l.typed)if(l.issues)o?o.push(l):o=[l];else{s=l;break}else a?a.push(l):a=[l]}if(s)return s;if(o){if(o.length===1)return o[0];zr(this,"type",n,i,{issues:l4(o)}),n.typed=!0}else{if(a?.length===1)return a[0];zr(this,"type",n,i,{issues:l4(a)})}return n}}}function VMe(r,e){return{kind:"schema",type:"union",reference:VMe,expects:wh(r.map(n=>n.expects),"|"),async:!0,options:r,message:e,get"~standard"(){return $n(this)},async"~run"(n,i){let s,o,a;for(const u of this.options){const l=await u["~run"]({value:n.value},i);if(l.typed)if(l.issues)o?o.push(l):o=[l];else{s=l;break}else a?a.push(l):a=[l]}if(s)return s;if(o){if(o.length===1)return o[0];zr(this,"type",n,i,{issues:l4(o)}),n.typed=!0}else{if(a?.length===1)return a[0];zr(this,"type",n,i,{issues:l4(a)})}return n}}}function jMe(){return{kind:"schema",type:"unknown",reference:jMe,expects:"unknown",async:!1,get"~standard"(){return $n(this)},"~run"(r){return r.typed=!0,r}}}function KMe(r,e,n){return{kind:"schema",type:"variant",reference:KMe,expects:"Object",async:!1,key:r,options:e,message:n,get"~standard"(){return $n(this)},"~run"(i,s){const o=i.value;if(o&&typeof o=="object"){let a,u=0,l=this.key,g=[];const y=(A,I)=>{for(const P of A.options){if(P.type==="variant")y(P,new Set(I).add(P.key));else{let D=!0,U=0;for(const V of I){const J=P.entries[V];if(V in o?J["~run"]({typed:!1,value:o[V]},{abortEarly:!0}).issues:J.type!=="exact_optional"&&J.type!=="optional"&&J.type!=="nullish"){D=!1,l!==V&&(u<U||u===U&&V in o&&!(l in o))&&(u=U,l=V,g=[]),l===V&&g.push(P.entries[V].expects);break}U++}if(D){const V=P["~run"]({value:o},s);(!a||!a.typed&&V.typed)&&(a=V)}}if(a&&!a.issues)break}};if(y(this,new Set([this.key])),a)return a;zr(this,"type",i,s,{input:o[l],expected:wh(g,"|"),path:[{type:"object",origin:"value",input:o,key:l,value:o[l]}]})}else zr(this,"type",i,s);return i}}}function GMe(r,e,n){return{kind:"schema",type:"variant",reference:GMe,expects:"Object",async:!0,key:r,options:e,message:n,get"~standard"(){return $n(this)},async"~run"(i,s){const o=i.value;if(o&&typeof o=="object"){let a,u=0,l=this.key,g=[];const y=async(A,I)=>{for(const P of A.options){if(P.type==="variant")await y(P,new Set(I).add(P.key));else{let D=!0,U=0;for(const V of I){const J=P.entries[V];if(V in o?(await J["~run"]({typed:!1,value:o[V]},{abortEarly:!0})).issues:J.type!=="exact_optional"&&J.type!=="optional"&&J.type!=="nullish"){D=!1,l!==V&&(u<U||u===U&&V in o&&!(l in o))&&(u=U,l=V,g=[]),l===V&&g.push(P.entries[V].expects);break}U++}if(D){const V=await P["~run"]({value:o},s);(!a||!a.typed&&V.typed)&&(a=V)}}if(a&&!a.issues)break}};if(await y(this,new Set([this.key])),a)return a;zr(this,"type",i,s,{input:o[l],expected:wh(g,"|"),path:[{type:"object",origin:"value",input:o,key:l,value:o[l]}]})}else zr(this,"type",i,s);return i}}}function qMe(r){return{kind:"schema",type:"void",reference:qMe,expects:"void",async:!1,message:r,get"~standard"(){return $n(this)},"~run"(e,n){return e.value===void 0?e.typed=!0:zr(this,"type",e,n),e}}}function int(r,e){return SU(Object.keys(r.entries),e)}function snt(r,e){return{...r,get"~standard"(){return $n(this)},"~run"(n,i){return r["~run"](n,{...i,message:e})}}}function ont(r,e){const n={...r.entries};for(const i of e)delete n[i];return{...r,entries:n,get"~standard"(){return $n(this)}}}function ZMe(r,e,n){const i=r["~run"]({value:e},YT(n));if(i.issues)throw new Sm(i.issues);return i.value}async function YMe(r,e,n){const i=await r["~run"]({value:e},YT(n));if(i.issues)throw new Sm(i.issues);return i.value}function ant(r,e){const n=i=>ZMe(r,i,e);return n.schema=r,n.config=e,n}function unt(r,e){const n=i=>YMe(r,i,e);return n.schema=r,n.config=e,n}function cnt(r,e){const n={};for(const i in r.entries)n[i]=!e||e.includes(i)?un(r.entries[i]):r.entries[i];return{...r,entries:n,get"~standard"(){return $n(this)}}}function lnt(r,e){const n={};for(const i in r.entries)n[i]=!e||e.includes(i)?Ioe(r.entries[i]):r.entries[i];return{...r,entries:n,get"~standard"(){return $n(this)}}}function f4(r,e){const n={};for(const i of e)n[i]=r.entries[i];return{...r,entries:n,get"~standard"(){return $n(this)}}}function rS(...r){return{...r[0],pipe:r,get"~standard"(){return $n(this)},"~run"(e,n){for(const i of r)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=i["~run"](e,n))}return e}}}function fnt(...r){return{...r[0],pipe:r,async:!0,get"~standard"(){return $n(this)},async"~run"(e,n){for(const i of r)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=await i["~run"](e,n))}return e}}}function dnt(r,e,n){const i=Array.isArray(e)?e:void 0,s=Array.isArray(e)?n:e,o={};for(const a in r.entries)o[a]=!i||i.includes(a)?Toe(r.entries[a],s):r.entries[a];return{...r,entries:o,get"~standard"(){return $n(this)}}}function hnt(r,e,n){const i=Array.isArray(e)?e:void 0,s=Array.isArray(e)?n:e,o={};for(const a in r.entries)o[a]=!i||i.includes(a)?Soe(r.entries[a],s):r.entries[a];return{...r,entries:o,get"~standard"(){return $n(this)}}}function Eu(r,e,n){const i=r["~run"]({value:e},YT(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}async function XMe(r,e,n){const i=await r["~run"]({value:e},YT(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}function pnt(r,e){const n=i=>Eu(r,i,e);return n.schema=r,n.config=e,n}function gnt(r,e){const n=i=>XMe(r,i,e);return n.schema=r,n.config=e,n}function uu(r){let e="";for(const n of r){e&&(e+=`
|
||
`),e+=`\xD7 ${n.message}`;const i=boe(n);i&&(e+=`
|
||
\u2192 at ${i}`)}return e}function ynt(r){return r.wrapped}const O0=rS(pt(),V2("ScaledAmount")),Ao=rS(pt(),V2("RawAmount")),_o=rS(pt(),V2("AtomicAmount")),JMe=rS(pt(),V2("ScaledPrice")),IU=rS(pt(),V2("RawPrice")),J1=r=>r,P0=r=>r,qo=r=>r,mnt=r=>r,bnt=r=>r,vnt=sn(O0),Roe=sn(_o),QMe=sn(Ao),wnt=sn(JMe),Ant=sn(IU);var e9e={normalSwapMaxRecommendSlippage:"20",bridgeSwapMaxRecommendSlippage:"20"},t9e={swapAggregatorConfig:null,maxRecommendSlippage:e9e,currentQuoteForDialog:null},kU=Nr(t9e,{persistKeys:["maxRecommendSlippage"]}),r9e=kU.swapAggregatorConfigBgAtom,n9e=kU.maxRecommendSlippageBgAtom,RU=kU.currentQuoteForDialogBgAtom,nS="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",i9e="So11111111111111111111111111111111111111111",_nt=null,Ent=8,Tnt=5,Snt="swap-sheet-exit",Int="20",CU;(function(r){r.ALL="$$all",r.FAVORITE="$$favorite",r.MY_POSITION="$$my-position"})(CU||(CU={}));var knt=Object.values(CU),Rnt=null,s9e=function(){"use strict";function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=this;(0,G.A)(this,r),this.map={},Object.keys(n).forEach(function(s){var o={},a={};n[s].forEach(function(u){var l=ur(u,2),g=l[0],y=l[1];o[g]=y,a[y]=g}),i.map[s]={km:o,vm:a}})}var e=r.prototype;return e.getSwapContractAddress=function(i,s){var o;return((o=this.map[i])===null||o===void 0?void 0:o.vm[s])||s},e.getUniversalContractAddress=function(i,s){var o;return((o=this.map[i])===null||o===void 0?void 0:o.km[s])||s},r}(),bg=new s9e({CT_501:[["sol",i9e]],CT_784:[["0x2::sui::sui",nS]],CT_0:[["btc",nS]],CT_195:[["trx",nS]]}),o9e=19,Coe;(function(r){r.INSTANT="instant",r.STRATEGY="strategy"})(Coe||(Coe={}));var iS;(function(r){r.SWAP="swap",r.BRIDGE="bridge",r.CEX="cex"})(iS||(iS={}));var xoe;(function(r){r.FROM="FROM",r.TO="TO"})(xoe||(xoe={}));var Boe;(function(r){r[r.SWAP=iS.SWAP]="SWAP",r[r.BRIDGE=iS.BRIDGE]="BRIDGE",r[r.CEX=iS.CEX]="CEX",r.FLASH_BUY="flash-buy",r.QUICK_BUY="quick-buy",r.PRO_LIMIT_ORDER="pro-limit-order",r.PRO_MARKET_ORDER="pro-market-order",r.BINANCE_EXCLUSIVE_DISCLAIMERS="binance-exclusive-disclaimers",r.SIGN_CONFIRM="sign-confirm"})(Boe||(Boe={}));var Ooe;(function(r){r.best_price="swap-price-comparison-best-rate",r.fast_route="swap-price-comparison-fastest",r.zero_gas="swap-zero-gas"})(Ooe||(Ooe={}));var Poe;(function(r){r.best_price="Best Rate",r.fast_route="Fastest",r.zero_gas="0 Gas"})(Poe||(Poe={}));var Noe;(function(r){r[r.CHECK_APPROVE=0]="CHECK_APPROVE",r[r.APPROVED=1]="APPROVED",r[r.NOT_APPROVED=2]="NOT_APPROVED",r[r.APPROVING=3]="APPROVING"})(Noe||(Noe={}));var Moe;(function(r){r.BinanceBridge="BinanceBridge",r.Inch="Inch",r.Quant="Quant",r.LIFI="Lifi",r.RANGO="Rango",r.JUPITER="Jupiter",r.SwapCoffee="SwapCoffee",r.Pancake="Pancake",r.LiquidMesh="LiquidMesh",r.Cetus="Cetus",r.InchFusion="InchFusion"})(Moe||(Moe={}));var j2;(function(r){r[r.SWAP_LESS_REQUIRED_AMOUNT=1]="SWAP_LESS_REQUIRED_AMOUNT",r[r.BRIDGE_LESS_REQUIRED_AMOUNT=2]="BRIDGE_LESS_REQUIRED_AMOUNT",r[r.QUOTE_FETCH_FAILED=3]="QUOTE_FETCH_FAILED",r[r.QUOTE_FETCH_TIME_OUT=4]="QUOTE_FETCH_TIME_OUT",r[r.QUOTE_FETCH_NO_LIQUIDITY=5]="QUOTE_FETCH_NO_LIQUIDITY",r[r.SERVICE_RATE_LIMIT=6]="SERVICE_RATE_LIMIT",r[r.CEX_LESS_REQUIRED_AMOUNT=7]="CEX_LESS_REQUIRED_AMOUNT",r[r.FOUR_MEME_PAIR_ERROR=8]="FOUR_MEME_PAIR_ERROR",r[r.QUOTE_NETWORK_ERR=9]="QUOTE_NETWORK_ERR",r[r.SWAP_EXCEED_REQUIRED_AMOUNT=10]="SWAP_EXCEED_REQUIRED_AMOUNT",r[r.BRIDGE_EXCEED_REQUIRED_AMOUNT=11]="BRIDGE_EXCEED_REQUIRED_AMOUNT",r[r.INVALID_TRADE_TIME=12]="INVALID_TRADE_TIME",r[r.INVALID_TRADE_TOKEN=13]="INVALID_TRADE_TOKEN",r[r.MIN_AMOUNT_LIMIT=14]="MIN_AMOUNT_LIMIT",r[r.INVALID_CEX_TOKEN=15]="INVALID_CEX_TOKEN"})(j2||(j2={}));var Loe;(function(r){r.TOKEN_PRICE_NOT_FOUND="TOKEN_PRICE_NOT_FOUND",r.SLIPPAGE_TOO_LOW="SLIPPAGE_TOO_LOW",r.GAS_FEE_TOO_LOW="GAS_FEE_TOO_LOW"})(Loe||(Loe={}));var Doe;(function(r){r.TIME_OUT="305003",r.REQUIRE_MIN_AMOUNT_LIMIT="305011",r.REQUIRE_MAX_AMOUNT_LIMIT="305012",r.NO_LIQUIDITY="305024",r.SERVICE_RATE_LIMIT="305023",r.SERVICE_RATE_LIMIT_INTERNAL="305026",r.SYSTEM_ERROR="100001001",r.FOUR_MEME_PAIR_ERROR="305028",r.INVALID_TRADE_TIME="316008",r.INVALID_TRADE_TOKEN="316009",r.MIN_AMOUNT_LIMIT="315008"})(Doe||(Doe={}));var Uoe;(function(r){r[r.FROM_TO=0]="FROM_TO",r[r.TO_FROM=1]="TO_FROM"})(Uoe||(Uoe={}));var Foe;(function(r){r[r.APPROVE_ALL=0]="APPROVE_ALL",r[r.APPROVE_FROM_AMOUNT=1]="APPROVE_FROM_AMOUNT"})(Foe||(Foe={}));var Woe;(function(r){r.NORMAL_SWAP="NORMAL_SWAP",r.NORMAL_SWAP_BN_PAY="NORMAL_SWAP_BN_PAY",r.MARKET_ORDER_SWAP="MARKET_ORDER_SWAP",r.EVENT_ORDER_SWAP="EVENT_ORDER_SWAP",r.EVENT_ORDER_TP_SL_SWAP="EVENT_ORDER_TP_SL_SWAP",r.QUICK_SHEET_SWAP="QUICK_SHEET_SWAP",r.FUSION_SWAP="FUSION_SWAP",r.WEB_DEX_SPS_SIGN="WEB_DEX_SPS_SIGN",r.WEB_DEX_EVENT_ORDER="WEB_DEX_EVENT_ORDER",r.WEB_DEX_EXTENSION_ORDER="WEB_DEX_EXTENSION_ORDER",r.FLASH_SWAP="FLASH_SWAP"})(Woe||(Woe={}));var Cnt="ANTI_MEV",Hoe;(function(r){r.NOMAL="NOMAL",r.EVM_STANDARD="EVM_STANDARD",r.EVM_FAST="EVM_FAST",r.EVM_TURBO="EVM_TURBO",r.EVM_STANDARD_ANTI_MEV="EVM_STANDARD_ANTI_MEV",r.EVM_FAST_ANTI_MEV="EVM_FAST_ANTI_MEV",r.EVM_TURBO_ANTI_MEV="EVM_TURBO_ANTI_MEV",r.SOL_STANDARD="SOL_STANDARD",r.SOL_FAST="SOL_FAST",r.SOL_TURBO="SOL_TURBO",r.SOL_STANDARD_ANTI_MEV="SOL_STANDARD_ANTI_MEV",r.SOL_FAST_ANTI_MEV="SOL_FAST_ANTI_MEV",r.SOL_TURBO_ANTI_MEV="SOL_TURBO_ANTI_MEV"})(Hoe||(Hoe={}));var sS="SOL",a9e="SUI",u9e="TRON",c9e="TON",xnt=null,Bnt=null,Ont=null,Pnt=null,zoe;(function(r){r.PENDING="PENDING",r.SUCCESS="SUCCESS",r.FAILED="FAILED"})(zoe||(zoe={}));var $oe;(function(r){r.Pending="PROCESS",r.Success="SUCCESS",r.Failed="FAILURE",r.Timeout="TIMEOUT"})($oe||($oe={}));var Voe;(function(r){r.Spot="SPOT",r.Funding="FUNDING"})(Voe||(Voe={}));var Nnt="cex-pay-type",oS;(function(r){r.RECOMMEND="RECOMMEND",r.CUSTOM="CUSTOM"})(oS||(oS={}));var Mnt="115792089237316195423570985008687907853269984665640564039457584007913129639935",Lnt=null,Dnt=null,joe;(function(r){r.None="none",r.Low="low",r.Middle="middle",r.High="high"})(joe||(joe={}));var Unt=null,Fnt=null,Koe;(function(r){r.OPEN_ORDERS="OPEN_ORDERS",r.ORDER_HISTORY="ORDER_HISTORY",r.POSITIONS="POSITIONS"})(Koe||(Koe={}));var Wnt="80000",Goe={SWAP:"swap",QUICK_SWAP:"quickSwap",PRO_MARKET:"proMarket",PRO_LIMIT:"proLimit",FLASH:"flash",BRIDGE:"bridge",CEX:"cex",SIGNAL:"signal",MY_POSITION:"myPosition",MEME_RUSH_NEW:"memeRushNew",MEME_RUSH_FINALIZING:"memeRushFinalizing",MEME_RUSH_MIGRATED:"memeRushMigrated"},l9e=[RSe],sl;(function(r){r.WORKING="WORKING",r.TRIGGERED="TRIGGERED",r.FINISHED="FINISHED",r.CANCELED="CANCELED",r.EXPIRED="EXPIRED",r.FAILED="FAILED",r.PENDING="PENDING",r.PARTIAL="PARTIAL"})(sl||(sl={}));var vg,Hnt=(vg={},vt(vg,sl.WORKING,"active"),vt(vg,sl.TRIGGERED,"status-processing"),vt(vg,sl.FINISHED,"status-success"),vt(vg,sl.CANCELED,"cancelled"),vt(vg,sl.EXPIRED,"expired"),vt(vg,sl.FAILED,"status-failed"),vt(vg,sl.PENDING,"pending"),vg),znt=[sl.WORKING,sl.PENDING],$nt=[sl.FINISHED,sl.CANCELED,sl.EXPIRED,sl.FAILED],f9e=[{upper:100,threshold:-1},{upper:500,threshold:-.5},{upper:1/0,threshold:-.2}],d9e=[{upper:100,threshold:-15},{upper:500,threshold:-10},{upper:1/0,threshold:-5}];const qoe={error:0,warn:1,info:2,debug:3,trace:4};var h9e={rE:"0.0.47"};const Zoe=void 0;function p9e(){const r=h9e.rE;return Zoe?`v${r}-${Zoe}`:`v${r}`}let aS={level:"info",enabled:!0};class Kl{constructor(e={}){this.context=e}static create(e={}){return new Kl(e)}static configure(e){aS={...aS,...e}}static getConfig(){return{...aS}}child(e){return new Kl({...this.context,...e})}shouldLog(e){return aS.enabled?qoe[e]<=qoe[aS.level]:!1}format(e,n,i){const s=new Date().toLocaleTimeString("en-US",{hour12:!1}),o=[];o.push(`[${s}]`),o.push(`[${e.toUpperCase()}]`),o.push(`[${p9e()}]`),this.context.traceId&&o.push(`[${this.context.traceId.slice(0,8)}]`),this.context.phase&&o.push(`[${this.context.phase}]`),this.context.txId&&o.push(`[${this.context.txId}]`),o.push(n);let a=o.join(" ");return i!==void 0&&(typeof i=="object"?a+=`
|
||
\u2192 `+JSON.stringify(i,null,2).split(`
|
||
`).join(`
|
||
\u2192 `):a+=`
|
||
\u2192 `+String(i)),a}log(e,n,i){if(!this.shouldLog(e))return;const s=this.format(e,n,i);switch(e){case"error":console.error(s);break;case"warn":console.warn(s);break;default:console.log(s)}}error(e,n){this.log("error",e,n)}warn(e,n){this.log("warn",e,n)}info(e,n){this.log("info",e,n)}debug(e,n){this.log("debug",e,n)}trace(e,n){this.log("trace",e,n)}separator(){this.shouldLog("info")&&console.log(`
|
||
`+"\u2500".repeat(70)+`
|
||
`)}summary(e){this.shouldLog("info")&&console.log(`
|
||
`+e+`
|
||
`)}static getGlobal(){return Kl.globalLogger}}Kl.globalLogger=new Kl;const ki=(r,e)=>{Kl.getGlobal().info(r,e)},Vnt=(r,e)=>{Logger.getGlobal().warn(r,e)};class Eo extends Error{constructor(e){super(e.message),this.name="Dex-SDK-Error",this.code=e.code,this.data=e.data,this.cause=e.cause}toJSON(){return{name:this.name,code:this.code,message:this.message,data:this.data,cause:this.cause}}}const fs={SCHEMA_ERROR:"SCHEMA_ERROR",SIGN_ERROR:"SIGN_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR",BUILD_TRANSACTION_ERROR:"BUILD_TRANSACTION_ERROR",QUOTE_ERROR:"QUOTE_ERROR",QUOTE_LESS_REQUIRE_AMOUNT:"QUOTE_LESS_REQUIRE_AMOUNT",QUOTE_EXCEED_REQUIRE_AMOUNT:"QUOTE_EXCEED_REQUIRE_AMOUNT",QUOTE_INVALID_TRADE_TIME:"QUOTE_INVALID_TRADE_TIME",QUOTE_INVALID_TRADE_TOKEN:"QUOTE_INVALID_TRADE_TOKEN",QUOTE_MIN_AMOUNT_LIMIT:"QUOTE_MIN_AMOUNT_LIMIT",QUOTE_STOCK_TOKEN_OVER_AMOUNT_LIMIT:"QUOTE_STOCK_TOKEN_OVER_AMOUNT_LIMIT",QUOTE_STOCK_TOKEN_MULTIPLIER_NOT_MATCH:"QUOTE_STOCK_TOKEN_MULTIPLIER_NOT_MATCH",QUOTE_FETCH_FAILED:"QUOTE_FETCH_FAILED",QUOTE_SERVICE_RATE_LIMIT:"QUOTE_SERVICE_RATE_LIMIT",QUOTE_FETCH_TIME_OUT:"QUOTE_FETCH_TIME_OUT",QUOTE_FETCH_NO_LIQUIDITY:"QUOTE_FETCH_NO_LIQUIDITY",QUOTE_FOUR_MEME_PAIR_ERROR:"QUOTE_FOUR_MEME_PAIR_ERROR",PENDING_NONCE_CHECK_ERROR:"PENDING_NONCE_CHECK_ERROR",BACKEND_BROADCAST_ERROR:"BACKEND_BROADCAST_ERROR"};var Yoe;(function(r){r[r.FOUR_MEME_PAIR_ERROR=8]="FOUR_MEME_PAIR_ERROR",r[r.QUOTE_NETWORK_ERR=9]="QUOTE_NETWORK_ERR"})(Yoe||(Yoe={}));const Gl={APPROVE:"approve#0",SWAP:"swap#0"},Rc={APPROVE_AND_SWAP:"APPROVE_AND_SWAP",SWAP_ONLY:"SWAP_ONLY",ERROR:"ERROR"};function Xoe(r,e){return{value:"0x0",data:new am(["function approve(address spender,uint256 amount) returns (bool)"]).encodeFunctionData("approve",[r,e])}}const g9e=({walletAddress:r,tokenAddress:e,spender:n,amount:i})=>({from:r,to:e,...Xoe(n,i)}),Ti={FETCH_CALLDATA:"FETCH_CALLDATA",FETCH_GAS:"FETCH_GAS",FETCH_DIGEST:"FETCH_DIGEST",FETCH_ORDER_ID:"FETCH_ORDER_ID",SIGN:"SIGN",PRE_PLACE_ORDER:"PRE_PLACE_ORDER",COMPILE:"COMPILE",BROADCAST:"BROADCAST",PLACE_ORDER:"PLACE_ORDER"};function y9e(r){return{step:Ti.FETCH_GAS,kind:Y1.FETCH_GAS_BY_GAS_ACCOUNT_WITH_TRANSACTION,input:r}}function m9e(r){return{step:Ti.FETCH_GAS,kind:Y1.FETCH_GAS_BY_GAS_ACCOUNT_WITHOUT_TRANSACTION,input:r}}function jnt(r){return{step:STEP.FETCH_DIGEST,kind:FetchDigestType.FETCH_DIGEST_BY_PRESET,input:r}}function Knt(r){return{step:STEP.FETCH_DIGEST,kind:FetchDigestType.FETCH_DIGEST_BY_FLASH,input:r}}function Joe(r){return{step:Ti.FETCH_DIGEST,kind:yd.FETCH_DIGEST_BY_GAS_ACCOUNT,input:r}}function b9e(r){return{txId:Gl.APPROVE,kind:wu.APPROVE,steps:[y9e({transaction:{kind:"evm",transaction:g9e({walletAddress:r.fromWalletAddress,tokenAddress:r.fromTokenAddress,spender:r.quote.router||"",amount:r.finalApprovalAmount})},fromBinanceChainId:r.fromBinanceChainId,fromWalletAddress:r.fromWalletAddress,fromWalletId:r.params.fromWalletId,requestId:r.requestId,walletType:r.params.walletType,approveAmount:r.finalApprovalAmount}),Joe({quoteId:r.quoteId,walletType:r.params.walletType,fromWalletId:r.params.fromWalletId,fromBinanceChainId:r.fromBinanceChainId,approveAmount:r.finalApprovalAmount,publicKeys:r.params.publicKeys,extra:{source:r.params.source,...r.params.clientOrderId?{clientOrderId:r.params.clientOrderId}:{}}})]}}function v9e(r){return{step:Ti.FETCH_CALLDATA,kind:s4.FETCH_CALLDATA_BY_SWAP,input:r}}function w9e(r){return{txId:Gl.SWAP,kind:wu.SWAP,steps:[v9e({quote:r.quote,slippage:r.params.slippage,nativeTokenSymbol:r.params.nativeTokenSymbol,fromTokenSymbol:r.params.fromTokenSymbol,toTokenSymbol:r.params.toTokenSymbol,transferTax:r.params.transferTax,requestId:r.requestId,fromTokenAddress:r.fromTokenAddress,toTokenAddress:r.toTokenAddress,fromTokenMultiplier:r.fromTokenMultiplier,toTokenMultiplier:r.toTokenMultiplier,extraField:{isRecommendSlippage:r.params.isRecommendSlippage}}),m9e({fromBinanceChainId:r.fromBinanceChainId,fromWalletAddress:r.fromWalletAddress,fromWalletId:r.params.fromWalletId,requestId:r.requestId,walletType:r.params.walletType}),Joe({quoteId:r.quoteId,walletType:r.params.walletType,fromWalletId:r.params.fromWalletId,fromBinanceChainId:r.fromBinanceChainId,approveAmount:r.finalApprovalAmount,publicKeys:r.params.publicKeys,extra:{source:r.params.source,...r.params.clientOrderId?{clientOrderId:r.params.clientOrderId}:{}}})]}}function A9e(r){return{variant:r.includeApprove?Rc.APPROVE_AND_SWAP:Rc.SWAP_ONLY}}const K2="CT_501",xU="CT_195",_9e="CT_784",Gnt="CT_607",Qoe="1",BU="56",E9e="8453",T9e="137",S9e="42161",I9e="81457",k9e="10",R9e="59144",C9e="34443",x9e="43114",B9e="9745",O9e="143",P9e={FROM:"FROM",TO:"TO"},G2={BUY:"BUY",SELL:"SELL"},qnt=null,Znt=null,Ynt=null,OU={APPROVE_ALL:0,APPROVE_FROM_AMOUNT:1},PU="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",N9e="So11111111111111111111111111111111111111111",Xnt=5e3,M9e=[Qoe,BU,E9e,T9e,S9e,I9e,k9e,R9e,C9e,x9e,B9e,O9e],L9e="best_price",D9e=zi.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),U9e=qo(zi.from(D9e).toString()),eae=Math.pow(10,36);var F9e=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,NU=Math.ceil,bd=Math.floor,ql="[BigNumber Error] ",tae=ql+"Number primitive has more than 15 significant digits: ",Ah=1e14,ts=14,MU=9007199254740991,LU=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Im=1e7,Tu=1e9;function rae(r){var e,n,i,s=re.prototype={constructor:re,toString:null,valueOf:null},o=new re(1),a=20,u=4,l=-7,g=21,y=-1e7,A=1e7,I=!1,P=1,D=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},V="0123456789abcdefghijklmnopqrstuvwxyz",J=!0;function re(pe,Se){var Ce,je,$e,Qe,nt,Ne,Me,ct,mt=this;if(!(mt instanceof re))return new re(pe,Se);if(Se==null){if(pe&&pe._isBigNumber===!0){mt.s=pe.s,!pe.c||pe.e>A?mt.c=mt.e=null:pe.e<y?mt.c=[mt.e=0]:(mt.e=pe.e,mt.c=pe.c.slice());return}if((Ne=typeof pe=="number")&&pe*0==0){if(mt.s=1/pe<0?(pe=-pe,-1):1,pe===~~pe){for(Qe=0,nt=pe;nt>=10;nt/=10,Qe++);Qe>A?mt.c=mt.e=null:(mt.e=Qe,mt.c=[pe]);return}ct=String(pe)}else{if(!F9e.test(ct=String(pe)))return i(mt,ct,Ne);mt.s=ct.charCodeAt(0)==45?(ct=ct.slice(1),-1):1}(Qe=ct.indexOf("."))>-1&&(ct=ct.replace(".","")),(nt=ct.search(/e/i))>0?(Qe<0&&(Qe=nt),Qe+=+ct.slice(nt+1),ct=ct.substring(0,nt)):Qe<0&&(Qe=ct.length)}else{if(ha(Se,2,V.length,"Base"),Se==10&&J)return mt=new re(pe),Ue(mt,a+mt.e+1,u);if(ct=String(pe),Ne=typeof pe=="number"){if(pe*0!=0)return i(mt,ct,Ne,Se);if(mt.s=1/pe<0?(ct=ct.slice(1),-1):1,re.DEBUG&&ct.replace(/^0\.0*|\./,"").length>15)throw Error(tae+pe)}else mt.s=ct.charCodeAt(0)===45?(ct=ct.slice(1),-1):1;for(Ce=V.slice(0,Se),Qe=nt=0,Me=ct.length;nt<Me;nt++)if(Ce.indexOf(je=ct.charAt(nt))<0){if(je=="."){if(nt>Qe){Qe=Me;continue}}else if(!$e&&(ct==ct.toUpperCase()&&(ct=ct.toLowerCase())||ct==ct.toLowerCase()&&(ct=ct.toUpperCase()))){$e=!0,nt=-1,Qe=0;continue}return i(mt,String(pe),Ne,Se)}Ne=!1,ct=n(ct,Se,10,mt.s),(Qe=ct.indexOf("."))>-1?ct=ct.replace(".",""):Qe=ct.length}for(nt=0;ct.charCodeAt(nt)===48;nt++);for(Me=ct.length;ct.charCodeAt(--Me)===48;);if(ct=ct.slice(nt,++Me)){if(Me-=nt,Ne&&re.DEBUG&&Me>15&&(pe>MU||pe!==bd(pe)))throw Error(tae+mt.s*pe);if((Qe=Qe-nt-1)>A)mt.c=mt.e=null;else if(Qe<y)mt.c=[mt.e=0];else{if(mt.e=Qe,mt.c=[],nt=(Qe+1)%ts,Qe<0&&(nt+=ts),nt<Me){for(nt&&mt.c.push(+ct.slice(0,nt)),Me-=ts;nt<Me;)mt.c.push(+ct.slice(nt,nt+=ts));nt=ts-(ct=ct.slice(nt)).length}else nt-=Me;for(;nt--;ct+="0");mt.c.push(+ct)}}else mt.c=[mt.e=0]}re.clone=rae,re.ROUND_UP=0,re.ROUND_DOWN=1,re.ROUND_CEIL=2,re.ROUND_FLOOR=3,re.ROUND_HALF_UP=4,re.ROUND_HALF_DOWN=5,re.ROUND_HALF_EVEN=6,re.ROUND_HALF_CEIL=7,re.ROUND_HALF_FLOOR=8,re.EUCLID=9,re.config=re.set=function(pe){var Se,Ce;if(pe!=null)if(typeof pe=="object"){if(pe.hasOwnProperty(Se="DECIMAL_PLACES")&&(Ce=pe[Se],ha(Ce,0,Tu,Se),a=Ce),pe.hasOwnProperty(Se="ROUNDING_MODE")&&(Ce=pe[Se],ha(Ce,0,8,Se),u=Ce),pe.hasOwnProperty(Se="EXPONENTIAL_AT")&&(Ce=pe[Se],Ce&&Ce.pop?(ha(Ce[0],-Tu,0,Se),ha(Ce[1],0,Tu,Se),l=Ce[0],g=Ce[1]):(ha(Ce,-Tu,Tu,Se),l=-(g=Ce<0?-Ce:Ce))),pe.hasOwnProperty(Se="RANGE"))if(Ce=pe[Se],Ce&&Ce.pop)ha(Ce[0],-Tu,-1,Se),ha(Ce[1],1,Tu,Se),y=Ce[0],A=Ce[1];else if(ha(Ce,-Tu,Tu,Se),Ce)y=-(A=Ce<0?-Ce:Ce);else throw Error(ql+Se+" cannot be zero: "+Ce);if(pe.hasOwnProperty(Se="CRYPTO"))if(Ce=pe[Se],Ce===!!Ce)if(Ce)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))I=Ce;else throw I=!Ce,Error(ql+"crypto unavailable");else I=Ce;else throw Error(ql+Se+" not true or false: "+Ce);if(pe.hasOwnProperty(Se="MODULO_MODE")&&(Ce=pe[Se],ha(Ce,0,9,Se),P=Ce),pe.hasOwnProperty(Se="POW_PRECISION")&&(Ce=pe[Se],ha(Ce,0,Tu,Se),D=Ce),pe.hasOwnProperty(Se="FORMAT"))if(Ce=pe[Se],typeof Ce=="object")U=Ce;else throw Error(ql+Se+" not an object: "+Ce);if(pe.hasOwnProperty(Se="ALPHABET"))if(Ce=pe[Se],typeof Ce=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(Ce))J=Ce.slice(0,10)=="0123456789",V=Ce;else throw Error(ql+Se+" invalid: "+Ce)}else throw Error(ql+"Object expected: "+pe);return{DECIMAL_PLACES:a,ROUNDING_MODE:u,EXPONENTIAL_AT:[l,g],RANGE:[y,A],CRYPTO:I,MODULO_MODE:P,POW_PRECISION:D,FORMAT:U,ALPHABET:V}},re.isBigNumber=function(pe){if(!pe||pe._isBigNumber!==!0)return!1;if(!re.DEBUG)return!0;var Se,Ce,je=pe.c,$e=pe.e,Qe=pe.s;e:if({}.toString.call(je)=="[object Array]"){if((Qe===1||Qe===-1)&&$e>=-Tu&&$e<=Tu&&$e===bd($e)){if(je[0]===0){if($e===0&&je.length===1)return!0;break e}if(Se=($e+1)%ts,Se<1&&(Se+=ts),String(je[0]).length==Se){for(Se=0;Se<je.length;Se++)if(Ce=je[Se],Ce<0||Ce>=Ah||Ce!==bd(Ce))break e;if(Ce!==0)return!0}}}else if(je===null&&$e===null&&(Qe===null||Qe===1||Qe===-1))return!0;throw Error(ql+"Invalid BigNumber: "+pe)},re.maximum=re.max=function(){return Re(arguments,-1)},re.minimum=re.min=function(){return Re(arguments,1)},re.random=function(){var pe=9007199254740992,Se=Math.random()*pe&2097151?function(){return bd(Math.random()*pe)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Ce){var je,$e,Qe,nt,Ne,Me=0,ct=[],mt=new re(o);if(Ce==null?Ce=a:ha(Ce,0,Tu),nt=NU(Ce/ts),I)if(crypto.getRandomValues){for(je=crypto.getRandomValues(new Uint32Array(nt*=2));Me<nt;)Ne=je[Me]*131072+(je[Me+1]>>>11),Ne>=9e15?($e=crypto.getRandomValues(new Uint32Array(2)),je[Me]=$e[0],je[Me+1]=$e[1]):(ct.push(Ne%1e14),Me+=2);Me=nt/2}else if(crypto.randomBytes){for(je=crypto.randomBytes(nt*=7);Me<nt;)Ne=(je[Me]&31)*281474976710656+je[Me+1]*1099511627776+je[Me+2]*4294967296+je[Me+3]*16777216+(je[Me+4]<<16)+(je[Me+5]<<8)+je[Me+6],Ne>=9e15?crypto.randomBytes(7).copy(je,Me):(ct.push(Ne%1e14),Me+=7);Me=nt/7}else throw I=!1,Error(ql+"crypto unavailable");if(!I)for(;Me<nt;)Ne=Se(),Ne<9e15&&(ct[Me++]=Ne%1e14);for(nt=ct[--Me],Ce%=ts,nt&&Ce&&(Ne=LU[ts-Ce],ct[Me]=bd(nt/Ne)*Ne);ct[Me]===0;ct.pop(),Me--);if(Me<0)ct=[Qe=0];else{for(Qe=-1;ct[0]===0;ct.splice(0,1),Qe-=ts);for(Me=1,Ne=ct[0];Ne>=10;Ne/=10,Me++);Me<ts&&(Qe-=ts-Me)}return mt.e=Qe,mt.c=ct,mt}}(),re.sum=function(){for(var pe=1,Se=arguments,Ce=new re(Se[0]);pe<Se.length;)Ce=Ce.plus(Se[pe++]);return Ce},n=function(){var pe="0123456789";function Se(Ce,je,$e,Qe){for(var nt,Ne=[0],Me,ct=0,mt=Ce.length;ct<mt;){for(Me=Ne.length;Me--;Ne[Me]*=je);for(Ne[0]+=Qe.indexOf(Ce.charAt(ct++)),nt=0;nt<Ne.length;nt++)Ne[nt]>$e-1&&(Ne[nt+1]==null&&(Ne[nt+1]=0),Ne[nt+1]+=Ne[nt]/$e|0,Ne[nt]%=$e)}return Ne.reverse()}return function(Ce,je,$e,Qe,nt){var Ne,Me,ct,mt,Bt,er,cr,pr,Dr=Ce.indexOf("."),Rr=a,Pr=u;for(Dr>=0&&(mt=D,D=0,Ce=Ce.replace(".",""),pr=new re(je),er=pr.pow(Ce.length-Dr),D=mt,pr.c=Se(wg(wd(er.c),er.e,"0"),10,$e,pe),pr.e=pr.c.length),cr=Se(Ce,je,$e,nt?(Ne=V,pe):(Ne=pe,V)),ct=mt=cr.length;cr[--mt]==0;cr.pop());if(!cr[0])return Ne.charAt(0);if(Dr<0?--ct:(er.c=cr,er.e=ct,er.s=Qe,er=e(er,pr,Rr,Pr,$e),cr=er.c,Bt=er.r,ct=er.e),Me=ct+Rr+1,Dr=cr[Me],mt=$e/2,Bt=Bt||Me<0||cr[Me+1]!=null,Bt=Pr<4?(Dr!=null||Bt)&&(Pr==0||Pr==(er.s<0?3:2)):Dr>mt||Dr==mt&&(Pr==4||Bt||Pr==6&&cr[Me-1]&1||Pr==(er.s<0?8:7)),Me<1||!cr[0])Ce=Bt?wg(Ne.charAt(1),-Rr,Ne.charAt(0)):Ne.charAt(0);else{if(cr.length=Me,Bt)for(--$e;++cr[--Me]>$e;)cr[Me]=0,Me||(++ct,cr=[1].concat(cr));for(mt=cr.length;!cr[--mt];);for(Dr=0,Ce="";Dr<=mt;Ce+=Ne.charAt(cr[Dr++]));Ce=wg(Ce,ct,Ne.charAt(0))}return Ce}}(),e=function(){function pe(je,$e,Qe){var nt,Ne,Me,ct,mt=0,Bt=je.length,er=$e%Im,cr=$e/Im|0;for(je=je.slice();Bt--;)Me=je[Bt]%Im,ct=je[Bt]/Im|0,nt=cr*Me+ct*er,Ne=er*Me+nt%Im*Im+mt,mt=(Ne/Qe|0)+(nt/Im|0)+cr*ct,je[Bt]=Ne%Qe;return mt&&(je=[mt].concat(je)),je}function Se(je,$e,Qe,nt){var Ne,Me;if(Qe!=nt)Me=Qe>nt?1:-1;else for(Ne=Me=0;Ne<Qe;Ne++)if(je[Ne]!=$e[Ne]){Me=je[Ne]>$e[Ne]?1:-1;break}return Me}function Ce(je,$e,Qe,nt){for(var Ne=0;Qe--;)je[Qe]-=Ne,Ne=je[Qe]<$e[Qe]?1:0,je[Qe]=Ne*nt+je[Qe]-$e[Qe];for(;!je[0]&&je.length>1;je.splice(0,1));}return function(je,$e,Qe,nt,Ne){var Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn,Ar,Xr,Tn,Bn,ni,en=je.s==$e.s?1:-1,si=je.c,ei=$e.c;if(!si||!si[0]||!ei||!ei[0])return new re(!je.s||!$e.s||(si?ei&&si[0]==ei[0]:!ei)?NaN:si&&si[0]==0||!ei?en*0:en/0);for(Dr=new re(en),Rr=Dr.c=[],ct=je.e-$e.e,en=Qe+ct+1,Ne||(Ne=Ah,ct=vd(je.e/ts)-vd($e.e/ts),en=en/ts|0),mt=0;ei[mt]==(si[mt]||0);mt++);if(ei[mt]>(si[mt]||0)&&ct--,en<0)Rr.push(1),Bt=!0;else{for(Xr=si.length,Bn=ei.length,mt=0,en+=2,er=bd(Ne/(ei[0]+1)),er>1&&(ei=pe(ei,er,Ne),si=pe(si,er,Ne),Bn=ei.length,Xr=si.length),Ar=Bn,Pr=si.slice(0,Bn),on=Pr.length;on<Bn;Pr[on++]=0);ni=ei.slice(),ni=[0].concat(ni),Tn=ei[0],ei[1]>=Ne/2&&Tn++;do{if(er=0,Me=Se(ei,Pr,Bn,on),Me<0){if(xn=Pr[0],Bn!=on&&(xn=xn*Ne+(Pr[1]||0)),er=bd(xn/Tn),er>1)for(er>=Ne&&(er=Ne-1),cr=pe(ei,er,Ne),pr=cr.length,on=Pr.length;Se(cr,Pr,pr,on)==1;)er--,Ce(cr,Bn<pr?ni:ei,pr,Ne),pr=cr.length,Me=1;else er==0&&(Me=er=1),cr=ei.slice(),pr=cr.length;if(pr<on&&(cr=[0].concat(cr)),Ce(Pr,cr,on,Ne),on=Pr.length,Me==-1)for(;Se(ei,Pr,Bn,on)<1;)er++,Ce(Pr,Bn<on?ni:ei,on,Ne),on=Pr.length}else Me===0&&(er++,Pr=[0]);Rr[mt++]=er,Pr[0]?Pr[on++]=si[Ar]||0:(Pr=[si[Ar]],on=1)}while((Ar++<Xr||Pr[0]!=null)&&en--);Bt=Pr[0]!=null,Rr[0]||Rr.splice(0,1)}if(Ne==Ah){for(mt=1,en=Rr[0];en>=10;en/=10,mt++);Ue(Dr,Qe+(Dr.e=mt+ct*ts-1)+1,nt,Bt)}else Dr.e=ct,Dr.r=+Bt;return Dr}}();function ce(pe,Se,Ce,je){var $e,Qe,nt,Ne,Me;if(Ce==null?Ce=u:ha(Ce,0,8),!pe.c)return pe.toString();if($e=pe.c[0],nt=pe.e,Se==null)Me=wd(pe.c),Me=je==1||je==2&&(nt<=l||nt>=g)?h4(Me,nt):wg(Me,nt,"0");else if(pe=Ue(new re(pe),Se,Ce),Qe=pe.e,Me=wd(pe.c),Ne=Me.length,je==1||je==2&&(Se<=Qe||Qe<=l)){for(;Ne<Se;Me+="0",Ne++);Me=h4(Me,Qe)}else if(Se-=nt+(je===2&&Qe>nt),Me=wg(Me,Qe,"0"),Qe+1>Ne){if(--Se>0)for(Me+=".";Se--;Me+="0");}else if(Se+=Qe-Ne,Se>0)for(Qe+1==Ne&&(Me+=".");Se--;Me+="0");return pe.s<0&&$e?"-"+Me:Me}function Re(pe,Se){for(var Ce,je,$e=1,Qe=new re(pe[0]);$e<pe.length;$e++)je=new re(pe[$e]),(!je.s||(Ce=Q1(Qe,je))===Se||Ce===0&&Qe.s===Se)&&(Qe=je);return Qe}function De(pe,Se,Ce){for(var je=1,$e=Se.length;!Se[--$e];Se.pop());for($e=Se[0];$e>=10;$e/=10,je++);return(Ce=je+Ce*ts-1)>A?pe.c=pe.e=null:Ce<y?pe.c=[pe.e=0]:(pe.e=Ce,pe.c=Se),pe}i=function(){var pe=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Se=/^([^.]+)\.$/,Ce=/^\.([^.]+)$/,je=/^-?(Infinity|NaN)$/,$e=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Qe,nt,Ne,Me){var ct,mt=Ne?nt:nt.replace($e,"");if(je.test(mt))Qe.s=isNaN(mt)?null:mt<0?-1:1;else{if(!Ne&&(mt=mt.replace(pe,function(Bt,er,cr){return ct=(cr=cr.toLowerCase())=="x"?16:cr=="b"?2:8,!Me||Me==ct?er:Bt}),Me&&(ct=Me,mt=mt.replace(Se,"$1").replace(Ce,"0.$1")),nt!=mt))return new re(mt,ct);if(re.DEBUG)throw Error(ql+"Not a"+(Me?" base "+Me:"")+" number: "+nt);Qe.s=null}Qe.c=Qe.e=null}}();function Ue(pe,Se,Ce,je){var $e,Qe,nt,Ne,Me,ct,mt,Bt=pe.c,er=LU;if(Bt){e:{for($e=1,Ne=Bt[0];Ne>=10;Ne/=10,$e++);if(Qe=Se-$e,Qe<0)Qe+=ts,nt=Se,Me=Bt[ct=0],mt=bd(Me/er[$e-nt-1]%10);else if(ct=NU((Qe+1)/ts),ct>=Bt.length)if(je){for(;Bt.length<=ct;Bt.push(0));Me=mt=0,$e=1,Qe%=ts,nt=Qe-ts+1}else break e;else{for(Me=Ne=Bt[ct],$e=1;Ne>=10;Ne/=10,$e++);Qe%=ts,nt=Qe-ts+$e,mt=nt<0?0:bd(Me/er[$e-nt-1]%10)}if(je=je||Se<0||Bt[ct+1]!=null||(nt<0?Me:Me%er[$e-nt-1]),je=Ce<4?(mt||je)&&(Ce==0||Ce==(pe.s<0?3:2)):mt>5||mt==5&&(Ce==4||je||Ce==6&&(Qe>0?nt>0?Me/er[$e-nt]:0:Bt[ct-1])%10&1||Ce==(pe.s<0?8:7)),Se<1||!Bt[0])return Bt.length=0,je?(Se-=pe.e+1,Bt[0]=er[(ts-Se%ts)%ts],pe.e=-Se||0):Bt[0]=pe.e=0,pe;if(Qe==0?(Bt.length=ct,Ne=1,ct--):(Bt.length=ct+1,Ne=er[ts-Qe],Bt[ct]=nt>0?bd(Me/er[$e-nt]%er[nt])*Ne:0),je)for(;;)if(ct==0){for(Qe=1,nt=Bt[0];nt>=10;nt/=10,Qe++);for(nt=Bt[0]+=Ne,Ne=1;nt>=10;nt/=10,Ne++);Qe!=Ne&&(pe.e++,Bt[0]==Ah&&(Bt[0]=1));break}else{if(Bt[ct]+=Ne,Bt[ct]!=Ah)break;Bt[ct--]=0,Ne=1}for(Qe=Bt.length;Bt[--Qe]===0;Bt.pop());}pe.e>A?pe.c=pe.e=null:pe.e<y&&(pe.c=[pe.e=0])}return pe}function Ve(pe){var Se,Ce=pe.e;return Ce===null?pe.toString():(Se=wd(pe.c),Se=Ce<=l||Ce>=g?h4(Se,Ce):wg(Se,Ce,"0"),pe.s<0?"-"+Se:Se)}return s.absoluteValue=s.abs=function(){var pe=new re(this);return pe.s<0&&(pe.s=1),pe},s.comparedTo=function(pe,Se){return Q1(this,new re(pe,Se))},s.decimalPlaces=s.dp=function(pe,Se){var Ce,je,$e,Qe=this;if(pe!=null)return ha(pe,0,Tu),Se==null?Se=u:ha(Se,0,8),Ue(new re(Qe),pe+Qe.e+1,Se);if(!(Ce=Qe.c))return null;if(je=(($e=Ce.length-1)-vd(this.e/ts))*ts,$e=Ce[$e])for(;$e%10==0;$e/=10,je--);return je<0&&(je=0),je},s.dividedBy=s.div=function(pe,Se){return e(this,new re(pe,Se),a,u)},s.dividedToIntegerBy=s.idiv=function(pe,Se){return e(this,new re(pe,Se),0,1)},s.exponentiatedBy=s.pow=function(pe,Se){var Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt=this;if(pe=new re(pe),pe.c&&!pe.isInteger())throw Error(ql+"Exponent not an integer: "+Ve(pe));if(Se!=null&&(Se=new re(Se)),Ne=pe.e>14,!Bt.c||!Bt.c[0]||Bt.c[0]==1&&!Bt.e&&Bt.c.length==1||!pe.c||!pe.c[0])return mt=new re(Math.pow(+Ve(Bt),Ne?pe.s*(2-d4(pe)):+Ve(pe))),Se?mt.mod(Se):mt;if(Me=pe.s<0,Se){if(Se.c?!Se.c[0]:!Se.s)return new re(NaN);je=!Me&&Bt.isInteger()&&Se.isInteger(),je&&(Bt=Bt.mod(Se))}else{if(pe.e>9&&(Bt.e>0||Bt.e<-1||(Bt.e==0?Bt.c[0]>1||Ne&&Bt.c[1]>=24e7:Bt.c[0]<8e13||Ne&&Bt.c[0]<=9999975e7)))return Qe=Bt.s<0&&d4(pe)?-0:0,Bt.e>-1&&(Qe=1/Qe),new re(Me?1/Qe:Qe);D&&(Qe=NU(D/ts+2))}for(Ne?(Ce=new re(.5),Me&&(pe.s=1),ct=d4(pe)):($e=Math.abs(+Ve(pe)),ct=$e%2),mt=new re(o);;){if(ct){if(mt=mt.times(Bt),!mt.c)break;Qe?mt.c.length>Qe&&(mt.c.length=Qe):je&&(mt=mt.mod(Se))}if($e){if($e=bd($e/2),$e===0)break;ct=$e%2}else if(pe=pe.times(Ce),Ue(pe,pe.e+1,1),pe.e>14)ct=d4(pe);else{if($e=+Ve(pe),$e===0)break;ct=$e%2}Bt=Bt.times(Bt),Qe?Bt.c&&Bt.c.length>Qe&&(Bt.c.length=Qe):je&&(Bt=Bt.mod(Se))}return je?mt:(Me&&(mt=o.div(mt)),Se?mt.mod(Se):Qe?Ue(mt,D,u,nt):mt)},s.integerValue=function(pe){var Se=new re(this);return pe==null?pe=u:ha(pe,0,8),Ue(Se,Se.e+1,pe)},s.isEqualTo=s.eq=function(pe,Se){return Q1(this,new re(pe,Se))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(pe,Se){return Q1(this,new re(pe,Se))>0},s.isGreaterThanOrEqualTo=s.gte=function(pe,Se){return(Se=Q1(this,new re(pe,Se)))===1||Se===0},s.isInteger=function(){return!!this.c&&vd(this.e/ts)>this.c.length-2},s.isLessThan=s.lt=function(pe,Se){return Q1(this,new re(pe,Se))<0},s.isLessThanOrEqualTo=s.lte=function(pe,Se){return(Se=Q1(this,new re(pe,Se)))===-1||Se===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(pe,Se){var Ce,je,$e,Qe,nt=this,Ne=nt.s;if(pe=new re(pe,Se),Se=pe.s,!Ne||!Se)return new re(NaN);if(Ne!=Se)return pe.s=-Se,nt.plus(pe);var Me=nt.e/ts,ct=pe.e/ts,mt=nt.c,Bt=pe.c;if(!Me||!ct){if(!mt||!Bt)return mt?(pe.s=-Se,pe):new re(Bt?nt:NaN);if(!mt[0]||!Bt[0])return Bt[0]?(pe.s=-Se,pe):new re(mt[0]?nt:u==3?-0:0)}if(Me=vd(Me),ct=vd(ct),mt=mt.slice(),Ne=Me-ct){for((Qe=Ne<0)?(Ne=-Ne,$e=mt):(ct=Me,$e=Bt),$e.reverse(),Se=Ne;Se--;$e.push(0));$e.reverse()}else for(je=(Qe=(Ne=mt.length)<(Se=Bt.length))?Ne:Se,Ne=Se=0;Se<je;Se++)if(mt[Se]!=Bt[Se]){Qe=mt[Se]<Bt[Se];break}if(Qe&&($e=mt,mt=Bt,Bt=$e,pe.s=-pe.s),Se=(je=Bt.length)-(Ce=mt.length),Se>0)for(;Se--;mt[Ce++]=0);for(Se=Ah-1;je>Ne;){if(mt[--je]<Bt[je]){for(Ce=je;Ce&&!mt[--Ce];mt[Ce]=Se);--mt[Ce],mt[je]+=Ah}mt[je]-=Bt[je]}for(;mt[0]==0;mt.splice(0,1),--ct);return mt[0]?De(pe,mt,ct):(pe.s=u==3?-1:1,pe.c=[pe.e=0],pe)},s.modulo=s.mod=function(pe,Se){var Ce,je,$e=this;return pe=new re(pe,Se),!$e.c||!pe.s||pe.c&&!pe.c[0]?new re(NaN):!pe.c||$e.c&&!$e.c[0]?new re($e):(P==9?(je=pe.s,pe.s=1,Ce=e($e,pe,0,3),pe.s=je,Ce.s*=je):Ce=e($e,pe,0,P),pe=$e.minus(Ce.times(pe)),!pe.c[0]&&P==1&&(pe.s=$e.s),pe)},s.multipliedBy=s.times=function(pe,Se){var Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr=this,on=Pr.c,xn=(pe=new re(pe,Se)).c;if(!on||!xn||!on[0]||!xn[0])return!Pr.s||!pe.s||on&&!on[0]&&!xn||xn&&!xn[0]&&!on?pe.c=pe.e=pe.s=null:(pe.s*=Pr.s,!on||!xn?pe.c=pe.e=null:(pe.c=[0],pe.e=0)),pe;for(je=vd(Pr.e/ts)+vd(pe.e/ts),pe.s*=Pr.s,Me=on.length,Bt=xn.length,Me<Bt&&(pr=on,on=xn,xn=pr,$e=Me,Me=Bt,Bt=$e),$e=Me+Bt,pr=[];$e--;pr.push(0));for(Dr=Ah,Rr=Im,$e=Bt;--$e>=0;){for(Ce=0,er=xn[$e]%Rr,cr=xn[$e]/Rr|0,nt=Me,Qe=$e+nt;Qe>$e;)ct=on[--nt]%Rr,mt=on[nt]/Rr|0,Ne=cr*ct+mt*er,ct=er*ct+Ne%Rr*Rr+pr[Qe]+Ce,Ce=(ct/Dr|0)+(Ne/Rr|0)+cr*mt,pr[Qe--]=ct%Dr;pr[Qe]=Ce}return Ce?++je:pr.splice(0,1),De(pe,pr,je)},s.negated=function(){var pe=new re(this);return pe.s=-pe.s||null,pe},s.plus=function(pe,Se){var Ce,je=this,$e=je.s;if(pe=new re(pe,Se),Se=pe.s,!$e||!Se)return new re(NaN);if($e!=Se)return pe.s=-Se,je.minus(pe);var Qe=je.e/ts,nt=pe.e/ts,Ne=je.c,Me=pe.c;if(!Qe||!nt){if(!Ne||!Me)return new re($e/0);if(!Ne[0]||!Me[0])return Me[0]?pe:new re(Ne[0]?je:$e*0)}if(Qe=vd(Qe),nt=vd(nt),Ne=Ne.slice(),$e=Qe-nt){for($e>0?(nt=Qe,Ce=Me):($e=-$e,Ce=Ne),Ce.reverse();$e--;Ce.push(0));Ce.reverse()}for($e=Ne.length,Se=Me.length,$e-Se<0&&(Ce=Me,Me=Ne,Ne=Ce,Se=$e),$e=0;Se;)$e=(Ne[--Se]=Ne[Se]+Me[Se]+$e)/Ah|0,Ne[Se]=Ah===Ne[Se]?0:Ne[Se]%Ah;return $e&&(Ne=[$e].concat(Ne),++nt),De(pe,Ne,nt)},s.precision=s.sd=function(pe,Se){var Ce,je,$e,Qe=this;if(pe!=null&&pe!==!!pe)return ha(pe,1,Tu),Se==null?Se=u:ha(Se,0,8),Ue(new re(Qe),pe,Se);if(!(Ce=Qe.c))return null;if($e=Ce.length-1,je=$e*ts+1,$e=Ce[$e]){for(;$e%10==0;$e/=10,je--);for($e=Ce[0];$e>=10;$e/=10,je++);}return pe&&Qe.e+1>je&&(je=Qe.e+1),je},s.shiftedBy=function(pe){return ha(pe,-MU,MU),this.times("1e"+pe)},s.squareRoot=s.sqrt=function(){var pe,Se,Ce,je,$e,Qe=this,nt=Qe.c,Ne=Qe.s,Me=Qe.e,ct=a+4,mt=new re("0.5");if(Ne!==1||!nt||!nt[0])return new re(!Ne||Ne<0&&(!nt||nt[0])?NaN:nt?Qe:1/0);if(Ne=Math.sqrt(+Ve(Qe)),Ne==0||Ne==1/0?(Se=wd(nt),(Se.length+Me)%2==0&&(Se+="0"),Ne=Math.sqrt(+Se),Me=vd((Me+1)/2)-(Me<0||Me%2),Ne==1/0?Se="5e"+Me:(Se=Ne.toExponential(),Se=Se.slice(0,Se.indexOf("e")+1)+Me),Ce=new re(Se)):Ce=new re(Ne+""),Ce.c[0]){for(Me=Ce.e,Ne=Me+ct,Ne<3&&(Ne=0);;)if($e=Ce,Ce=mt.times($e.plus(e(Qe,$e,ct,1))),wd($e.c).slice(0,Ne)===(Se=wd(Ce.c)).slice(0,Ne))if(Ce.e<Me&&--Ne,Se=Se.slice(Ne-3,Ne+1),Se=="9999"||!je&&Se=="4999"){if(!je&&(Ue($e,$e.e+a+2,0),$e.times($e).eq(Qe))){Ce=$e;break}ct+=4,Ne+=4,je=1}else{(!+Se||!+Se.slice(1)&&Se.charAt(0)=="5")&&(Ue(Ce,Ce.e+a+2,1),pe=!Ce.times(Ce).eq(Qe));break}}return Ue(Ce,Ce.e+a+1,u,pe)},s.toExponential=function(pe,Se){return pe!=null&&(ha(pe,0,Tu),pe++),ce(this,pe,Se,1)},s.toFixed=function(pe,Se){return pe!=null&&(ha(pe,0,Tu),pe=pe+this.e+1),ce(this,pe,Se)},s.toFormat=function(pe,Se,Ce){var je,$e=this;if(Ce==null)pe!=null&&Se&&typeof Se=="object"?(Ce=Se,Se=null):pe&&typeof pe=="object"?(Ce=pe,pe=Se=null):Ce=U;else if(typeof Ce!="object")throw Error(ql+"Argument not an object: "+Ce);if(je=$e.toFixed(pe,Se),$e.c){var Qe,nt=je.split("."),Ne=+Ce.groupSize,Me=+Ce.secondaryGroupSize,ct=Ce.groupSeparator||"",mt=nt[0],Bt=nt[1],er=$e.s<0,cr=er?mt.slice(1):mt,pr=cr.length;if(Me&&(Qe=Ne,Ne=Me,Me=Qe,pr-=Qe),Ne>0&&pr>0){for(Qe=pr%Ne||Ne,mt=cr.substr(0,Qe);Qe<pr;Qe+=Ne)mt+=ct+cr.substr(Qe,Ne);Me>0&&(mt+=ct+cr.slice(Qe)),er&&(mt="-"+mt)}je=Bt?mt+(Ce.decimalSeparator||"")+((Me=+Ce.fractionGroupSize)?Bt.replace(new RegExp("\\d{"+Me+"}\\B","g"),"$&"+(Ce.fractionGroupSeparator||"")):Bt):mt}return(Ce.prefix||"")+je+(Ce.suffix||"")},s.toFraction=function(pe){var Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr=this,pr=cr.c;if(pe!=null&&(Ne=new re(pe),!Ne.isInteger()&&(Ne.c||Ne.s!==1)||Ne.lt(o)))throw Error(ql+"Argument "+(Ne.isInteger()?"out of range: ":"not an integer: ")+Ve(Ne));if(!pr)return new re(cr);for(Se=new re(o),ct=Ce=new re(o),je=Me=new re(o),er=wd(pr),Qe=Se.e=er.length-cr.e-1,Se.c[0]=LU[(nt=Qe%ts)<0?ts+nt:nt],pe=!pe||Ne.comparedTo(Se)>0?Qe>0?Se:ct:Ne,nt=A,A=1/0,Ne=new re(er),Me.c[0]=0;mt=e(Ne,Se,0,1),$e=Ce.plus(mt.times(je)),$e.comparedTo(pe)!=1;)Ce=je,je=$e,ct=Me.plus(mt.times($e=ct)),Me=$e,Se=Ne.minus(mt.times($e=Se)),Ne=$e;return $e=e(pe.minus(Ce),je,0,1),Me=Me.plus($e.times(ct)),Ce=Ce.plus($e.times(je)),Me.s=ct.s=cr.s,Qe=Qe*2,Bt=e(ct,je,Qe,u).minus(cr).abs().comparedTo(e(Me,Ce,Qe,u).minus(cr).abs())<1?[ct,je]:[Me,Ce],A=nt,Bt},s.toNumber=function(){return+Ve(this)},s.toPrecision=function(pe,Se){return pe!=null&&ha(pe,1,Tu),ce(this,pe,Se,2)},s.toString=function(pe){var Se,Ce=this,je=Ce.s,$e=Ce.e;return $e===null?je?(Se="Infinity",je<0&&(Se="-"+Se)):Se="NaN":(pe==null?Se=$e<=l||$e>=g?h4(wd(Ce.c),$e):wg(wd(Ce.c),$e,"0"):pe===10&&J?(Ce=Ue(new re(Ce),a+$e+1,u),Se=wg(wd(Ce.c),Ce.e,"0")):(ha(pe,2,V.length,"Base"),Se=n(wg(wd(Ce.c),$e,"0"),10,pe,je,!0)),je<0&&Ce.c[0]&&(Se="-"+Se)),Se},s.valueOf=s.toJSON=function(){return Ve(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,r!=null&&re.set(r),re}function vd(r){var e=r|0;return r>0||r===e?e:e-1}function wd(r){for(var e,n,i=1,s=r.length,o=r[0]+"";i<s;){for(e=r[i++]+"",n=ts-e.length;n--;e="0"+e);o+=e}for(s=o.length;o.charCodeAt(--s)===48;);return o.slice(0,s+1||1)}function Q1(r,e){var n,i,s=r.c,o=e.c,a=r.s,u=e.s,l=r.e,g=e.e;if(!a||!u)return null;if(n=s&&!s[0],i=o&&!o[0],n||i)return n?i?0:-u:a;if(a!=u)return a;if(n=a<0,i=l==g,!s||!o)return i?0:!s^n?1:-1;if(!i)return l>g^n?1:-1;for(u=(l=s.length)<(g=o.length)?l:g,a=0;a<u;a++)if(s[a]!=o[a])return s[a]>o[a]^n?1:-1;return l==g?0:l>g^n?1:-1}function ha(r,e,n,i){if(r<e||r>n||r!==bd(r))throw Error(ql+(i||"Argument")+(typeof r=="number"?r<e||r>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function d4(r){var e=r.c.length-1;return vd(r.e/ts)==e&&r.c[e]%2!=0}function h4(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function wg(r,e,n){var i,s;if(e<0){for(s=n+".";++e;s+=n);r=s+r}else if(i=r.length,++e>i){for(s=n,e-=i;--e;s+=n);r+=s}else e<i&&(r=r.slice(0,e)+"."+r.slice(e));return r}var km=rae();const Zu=km,Cc=(r,e)=>{let n=e;return e==="ether"?n=18:e==="gwei"&&(n=9),new km(r).multipliedBy(new km(10).exponentiatedBy(n))};function W9e(r,e){const n=qo(Cc(e.rawFromTokenAmount,e.fromTokenDecimals).toFixed()),i=e.approveMode===OU.APPROVE_ALL?U9e:n;return{params:r,quote:e,fromBinanceChainId:e.fromBinanceChainId,fromWalletAddress:e.fromWalletAddress,fromTokenAddress:e.fromTokenAddress,toTokenAddress:e.toTokenAddress,requestId:e.requestId,rawFromTokenAmount:e.rawFromTokenAmount,fromTokenDecimals:e.fromTokenDecimals,quoteId:e.quoteId,finalApprovalAmount:i,includeApprove:M9e.includes(e.fromBinanceChainId)&&!r.approved,fromTokenMultiplier:r.fromTokenMultiplier??"1",toTokenMultiplier:r.toTokenMultiplier??"1"}}const nae=({params:r,quote:e})=>{try{ki("generateExtensionTransactionList start",{params:r,quote:e});const n=W9e(r,e),i=A9e(n),s=w9e(n),o=n.includeApprove?b9e(n):void 0;return ki("generateExtensionTransactionList end \u2705",o?[o,s]:[s]),i.variant===Rc.APPROVE_AND_SWAP&&o?{variant:i.variant,data:[o,s],error:null}:{variant:Rc.SWAP_ONLY,data:[s],error:null}}catch(n){return ki("generateExtensionTransactionList error \u274C",n),{variant:Rc.ERROR,data:[],error:new Eo({code:fs.UNKNOWN_ERROR,message:"generateExtensionTransactionList failed",cause:n?.message})}}};function Jnt(r){return{step:STEP.FETCH_ORDER_ID,kind:FetchOrderIdType.FETCH_ORDER_ID_BY_SERVER,input:r}}function iae(r){return{step:Ti.FETCH_ORDER_ID,kind:ZT.FETCH_ORDER_ID_BY_LOCAL,input:r}}function sae(r){return{step:Ti.SIGN,kind:q1.SIGN_BY_DIGEST,input:r}}function Qnt(r){return{step:STEP.SIGN,kind:SignType.SIGN_BY_TRANSACTION,input:r}}function eit(r){return{step:STEP.SIGN,kind:SignType.SIGN_BY_EIP_712,input:r}}function oae(r){return{step:Ti.COMPILE,kind:H2.COMPILE_TRANSACTION,input:r}}function tit(r){return{step:STEP.COMPILE,kind:CompileType.LOCAL_COMPILE_TRANSACTION,input:r}}const ev={BACKEND_ONLY:"BACKEND_ONLY",FRONTEND_ONLY:"FRONTEND_ONLY",BOTH:"BOTH"};function DU(r){return{step:Ti.BROADCAST,kind:ev.BACKEND_ONLY,input:r}}function H9e(r){return{step:STEP.BROADCAST,kind:BroadcastStepKind.FRONTEND_ONLY,input:r}}function z9e(r){return{step:STEP.BROADCAST,kind:BroadcastStepKind.BOTH,input:r}}function rit(r){if(r.backendBroadcast&&r.frontendBroadcast)return z9e({backendBroadcast:r.backendBroadcast,frontendBroadcast:r.frontendBroadcast});if(r.backendBroadcast)return DU({backendBroadcast:r.backendBroadcast});if(r.frontendBroadcast)return H9e({frontendBroadcast:r.frontendBroadcast});throw new Error("makeBroadcastStepByOptions: at least one of backendBroadcast/frontendBroadcast is required")}const aae=(r,e)=>{if(!r)return;const{estimateOriginalResult:n,...i}=r;return{feeObj:i,...e?.walletType&&{walletType:e.walletType}}};var Ad;(function(r){r.STANDARD="standard",r.FAST="fast",r.TURBO="turbo"})(Ad||(Ad={}));var Zl;(function(r){r.High="High",r.Medium="Medium",r.Low="Low",r.Custom="Custom"})(Zl||(Zl={}));const N0={LEGACY_FEE_TEMPLATE:"LegacyFeeTemplate",SIMPLE_FEE_TEMPLATE:"SimpleFeeTemplate",EIP1559_FEE_TEMPLATE:"Eip1559FeeTemplate",FREE_FEE_TEMPLATE:"FreeFeeTemplate",SOLANA_FEE_TEMPLATE:"SolanaFeeTemplate"},p4={[Zl.High]:Ad.TURBO,[Zl.Medium]:Ad.FAST,[Zl.Low]:Ad.STANDARD,[Zl.Custom]:Ad.TURBO};var ol;(function(r){r.NOMAL="NOMAL",r.EVM_STANDARD="EVM_STANDARD",r.EVM_FAST="EVM_FAST",r.EVM_TURBO="EVM_TURBO",r.EVM_STANDARD_ANTI_MEV="EVM_STANDARD_ANTI_MEV",r.EVM_FAST_ANTI_MEV="EVM_FAST_ANTI_MEV",r.EVM_TURBO_ANTI_MEV="EVM_TURBO_ANTI_MEV",r.SOL_STANDARD="SOL_STANDARD",r.SOL_FAST="SOL_FAST",r.SOL_TURBO="SOL_TURBO",r.SOL_STANDARD_ANTI_MEV="SOL_STANDARD_ANTI_MEV",r.SOL_FAST_ANTI_MEV="SOL_FAST_ANTI_MEV",r.SOL_TURBO_ANTI_MEV="SOL_TURBO_ANTI_MEV"})(ol||(ol={}));const $9e={[Zl.High]:"instant",[Zl.Medium]:"fast",[Zl.Low]:"standard",[Zl.Custom]:"customize"},g4={CURRENT_WALLET:"currentWallet",GAS_ACCOUNT:"gasAccount"};function uae(r){return r.startsWith("eip155:")}const V9e=(r,e,n,i)=>{if(uae(i?.wcId)){if(n===Ad.STANDARD)return e?ol.EVM_STANDARD_ANTI_MEV:ol.EVM_STANDARD;if(n===Ad.FAST)return e?ol.EVM_FAST_ANTI_MEV:ol.EVM_FAST;if(n===Ad.TURBO)return e?ol.EVM_TURBO_ANTI_MEV:ol.EVM_TURBO}if(r===K2){if(n===Ad.STANDARD)return e?ol.SOL_STANDARD_ANTI_MEV:ol.SOL_STANDARD;if(n===Ad.FAST)return e?ol.SOL_FAST_ANTI_MEV:ol.SOL_FAST;if(n===Ad.TURBO)return e?ol.SOL_TURBO_ANTI_MEV:ol.SOL_TURBO}return ol.NOMAL},j9e=(r,e=0,n)=>{if(r==="0"||!r||r==="NaN")return"0";const i=new Zu(r).dividedBy(new Zu(10).exponentiatedBy(e)),[s,o]=i.toFixed().split(".");let a=o||Array(e+1).join("0");for(;o&&o.endsWith("0");)a=a.substring(0,o.length-1);return n&&n>0&&(a=a.slice(0,n)),(s+(a?"."+a:"")).replace(/\.0+$/,"")},UU=(r,e)=>new Zu(100-Number(r)).times(e).div(100).toFixed();var q2=tn(35412);const tv=(r,e,n)=>P0(j9e(r,e,n)),nit=(r,e)=>asAtomicAmount(fastParseUnits(r,e).toFixed(0)),cae=(r,e)=>P0(UU(r,e)),rv=(r,e)=>J1(e==="1"?r:(0,q2.toOndoShareAmount)(r,e)),K9e=(r,e)=>P0(e==="1"?r:(0,q2.toOndoTokenAmount)(r,e));function lae(r,e){return{enable:e.params.mev,tipsPayer:r.fromWalletAddress,tipsReceiver:e.params.tipsDetail?.tipAccount||"",tipsAmount:qo(Cc(e.params.tipsDetail?.amount?.[p4[e.params.gasLevel]]||"0",e.params.nativeTokenDecimals).toFixed(0))}}function G9e(r,e,n,i){return{fromTokenAddress:r.fromTokenAddress,fromTokenSymbol:e.params.fromTokenSymbol,fromNetworkId:r.fromNetworkId,slippage:e.params.slippage,toTokenSymbol:e.params.toTokenSymbol,toTokenAddress:r.toTokenAddress,toNetworkId:r.toNetworkId,feeDetail:r.feeDetail,vendorId:r.vendor,subVendorId:r.subVendorId,networkFee:tv(i,e.params.nativeTokenDecimals),nativeTokenDecimals:e.params.nativeTokenDecimals,bridgeFee:r.bridgeFee||P0("0"),fromTokenSymbolOnChain:e.params.fromTokenSymbolOnChain,fromTokenAmount:r.rawFromTokenAmount,fromBinanceChainId:r.fromBinanceChainId,toBinanceChainId:r.toBinanceChainId,toTokenAmount:n,toTokenSymbolOnChain:e.params.toTokenSymbolOnChain,fromChainInfo:e.params.fromNetwork,toChainInfo:e.params.fromNetwork,fromWalletAddress:r.fromWalletAddress,toWalletAddress:r.toWalletAddress,quoteId:r.quoteId,estimatedTime:r.estimatedTime,uniQuoteId:r.uniQuoteId,slippageMode:e.params.slippageMode,swapGasLevel:V9e(r.fromBinanceChainId,e.params.mev,p4[e.params.gasLevel],e.params.fromNetwork),requestId:r.requestId,orderSource:e.params.orderSource,side:e.params.side,extra:{},securityCheckId:e.params.securityCheckId,proofKeyPublicKey:e.params.proofKeyPublicKey,timestampSignature:e.params.timestampSignature,timestamp:e.params.timestamp,walletType:e.params.walletType,walletFrom:e.params.walletFrom,userPublicKeyHex:e.params.userPublicKeyHex}}function q9e(r,e,n,i,s,o){const a=lae(r,e),u=e.params.gasDetail[p4[e.params.gasLevel]].tags;return{backendBroadcast:{kind:"SWAP_TX_REPORT_BROADCAST",input:{feeValue:i,fromTokenAddress:r.fromTokenAddress,fromTokenAmount:r.rawFromTokenAmount,fromTokenDecimals:r.fromTokenDecimals,fromTokenSymbol:e.params.fromTokenSymbol,toTokenAddress:r.toTokenAddress,toTokenAmount:n,toTokenDecimals:r.toTokenDecimals,toTokenSymbol:e.params.toTokenSymbol,toBinanceChainId:r.toBinanceChainId,toWalletAddress:r.toWalletAddress,to:s.kind==="evm"||s.kind==="tron"?s.transaction.to:"",data:s.kind==="evm"||s.kind==="tron"?s.transaction.data:"",requestId:r.requestId,mevConfig:a,isGasFree:e.params.isGasFree,bep414PolicyId:e.params.bep414PolicyId,fromBinanceChainId:r.fromBinanceChainId,fromWalletAddress:r.fromWalletAddress,nativeTokenAddress:e.params.nativeTokenAddress,nativeTokenDecimals:e.params.nativeTokenDecimals,source:e.params.source,tags:u,baseTransaction:s,extData:aae(o.feeInfo,{walletType:e.params.walletType})}}}}function Z9e(r,e,n,i,s,o){const a=lae(r,e);return{backendBroadcast:{kind:"APPROVE_TX_REPORT_BROADCAST",input:{approvalAddress:e.approvalAddress,approvalAmount:i,fromBinanceChainId:r.fromBinanceChainId,fromWalletAddress:r.fromWalletAddress,nativeTokenAddress:e.params.nativeTokenAddress,nativeTokenDecimals:e.params.nativeTokenDecimals,source:e.params.source,bep414PolicyId:e.params.bep414PolicyId,isGasFree:e.params.isGasFree,mevConfig:a,requestId:r.requestId,fromTokenDecimals:r.fromTokenDecimals,fromTokenSymbol:e.params.fromTokenSymbol,fromTokenAddress:r.fromTokenAddress,feeValue:n,baseTransaction:s,extData:aae(o.feeInfo,{walletType:e.params.walletType})}}}}function Y9e(r,e,n){return{txId:Gl.APPROVE,kind:wu.APPROVE,steps:[iae({orderId:r.digest.orderId}),sae({binanceChainId:n.fromBinanceChainId,userAddress:n.fromWalletAddress,digest:r.digest.digest,extra:{quoteId:n.quoteId}}),oae({quoteId:n.quoteId,gasAccount:{type:r.gasAccount.type},mev:n.params.mev,publicKeys:n.params.publicKeys||[],unsignedTx:r.digest.unsignedTx,txType:r.digest.txType}),DU(Z9e(e,n,r.feeAmount,r.approveAmount,r.baseTransaction,r.gasAccount))]}}function X9e(r){return{step:Ti.PRE_PLACE_ORDER,kind:qT.PRE_PLACE_NORMAL_ORDER,input:r}}function J9e(r){return{step:Ti.PLACE_ORDER,kind:Z1.PLACE_ORDER,input:r}}function iit(r){return{step:STEP.PLACE_ORDER,kind:PlaceOrderType.PLACE_INTENT_ORDER,input:r}}function sit(r){return{step:STEP.PLACE_ORDER,kind:PlaceOrderType.PLACE_FLASH_ORDER,input:r}}function fae(r,e,n){return{txId:Gl.SWAP,kind:wu.SWAP,steps:[iae({orderId:r.digest.orderId}),sae({binanceChainId:n.fromBinanceChainId,userAddress:n.fromWalletAddress,digest:r.digest.digest,extra:{quoteId:n.quoteId}}),X9e(G9e(e,n,r.toTokenAmount,r.feeAmount)),oae({quoteId:n.quoteId,gasAccount:{type:r.gasAccount.type},mev:n.params.mev,publicKeys:n.params.publicKeys||[],unsignedTx:r.digest.unsignedTx,txType:r.digest.txType}),DU(q9e(e,n,r.toTokenAmount,r.feeAmount,r.baseTransaction,r.gasAccount)),J9e({})]}}function Q9e(r){return{variant:r.approve?Rc.APPROVE_AND_SWAP:Rc.SWAP_ONLY}}function dae(r,e="Assertion failed"){if(!r)throw new Error(e)}function Mi(r,e="Value must not be null or undefined"){if(r==null)throw new Error(e)}function uS(r,e,n){const i=r[e];if(i)return i[n]}function hae(r,e){Mi(r,e)}function pae(r,e){return r.kind===e}function oit(r,e,n){const i={};for(const[s,o]of Object.entries(n))i[s]=uS(r,e,o);return i}function ait(r,e,n,i){const s=uS(r,e,n);if(s&&pae(s,i))return s}function e7e(r,e,n){if(Mi(r,n),!pae(r,e))throw new Error(`${n}: expected kind ${e}, got ${r.kind}`)}function uit(r,e,n,i){const s=uS(r,e,n),o=i||`Step output ${n} is required for tx ${e}`;return hae(s,o),s}function cS(r,e,n,i,s){const o=uS(r,e,n),a=s||`Step output ${n} with kind ${i} is required for tx ${e}`;return e7e(o,i,a),o}function t7e(r,e,n){const s=cS(e,r.txId,Ti.FETCH_GAS,Y1.FETCH_GAS_BY_GAS_ACCOUNT_WITH_TRANSACTION,`finalizeExtensionTransactionList: missing gas output for txId=${r.txId}`).output.find(g=>g.type===g4.CURRENT_WALLET);Mi(s,`current wallet gasAccount is required for item ${r.txId}`);const o=cS(e,r.txId,Ti.FETCH_DIGEST,yd.FETCH_DIGEST_BY_GAS_ACCOUNT,`finalizeExtensionTransactionList: missing digest output for txId=${r.txId}`).output;Mi(o.digest?.[0],"approve digest array must have at least one element");const a=r.steps.find(g=>g.step===Ti.FETCH_GAS);Mi(a,"fetchGas step is required");const u=a.input.transaction,l=o.approveAmount??a.input.approveAmount;return Mi(l,"approveAmount is required"),{buildTxId:r.txId,baseTransaction:u,approveAmount:qo(l),gasAccount:s,feeAmount:qo(s.feeInfo.feeAmount.toString()),digest:{orderId:o.orderId,digest:o.digest[0],unsignedTx:o.unsignedTx,txType:o.txType}}}function r7e(r,e,n){const i=cS(e,r.txId,Ti.FETCH_CALLDATA,s4.FETCH_CALLDATA_BY_SWAP,`finalizeExtensionTransactionList: missing calldata output for txId=${r.txId}`).output,o=cS(e,r.txId,Ti.FETCH_GAS,Y1.FETCH_GAS_BY_GAS_ACCOUNT_WITHOUT_TRANSACTION,`finalizeExtensionTransactionList: missing gas output for txId=${r.txId}`).output.find(u=>u.type===g4.CURRENT_WALLET);Mi(o,`current wallet gasAccount is required for item ${r.txId}`);const a=cS(e,r.txId,Ti.FETCH_DIGEST,yd.FETCH_DIGEST_BY_GAS_ACCOUNT,`finalizeExtensionTransactionList: missing digest output for txId=${r.txId}`).output;return Mi(a.digest?.[0],"swap digest array must have at least one element"),{buildTxId:r.txId,baseTransaction:i.baseTransaction,toTokenAmount:i.rawToTokenAmount,gasAccount:o,feeAmount:qo(o.feeInfo.feeAmount.toString()),digest:{orderId:a.orderId,digest:a.digest[0],unsignedTx:a.unsignedTx,txType:a.txType}}}function n7e(r,e){return{params:e,quote:r,fromBinanceChainId:r.fromBinanceChainId,fromWalletAddress:r.fromWalletAddress,quoteId:r.quoteId,approvalAddress:r.router||""}}function i7e(r,e,n,i){try{ki("finalizeExtensionTransactionList: start",{transactionList:r,params:i});const s=n7e(n,i),o={};for(const l of r)switch(l.kind){case wu.SWAP:{o.swap=r7e(l,e,s);break}case wu.APPROVE:{o.approve=t7e(l,e,s);break}default:throw new Error("finalizeExtensionTransactionList: Unsupported transaction kind")}if(!o.swap)throw new Error("finalizeExtensionTransactionList: swap plan is required");const a=Q9e(o);if(a.variant===Rc.APPROVE_AND_SWAP&&o.approve){const l=Y9e(o.approve,n,s),g=fae(o.swap,n,s);return ki("finalizeExtensionTransactionList: end \u2705 (approveAndSwap)",{approveTx:l,swapTx:g}),{variant:a.variant,data:[l,g],error:null}}const u=fae(o.swap,n,s);return ki("finalizeExtensionTransactionList: end \u2705 (swapOnly)",{swapTx:u}),{variant:Rc.SWAP_ONLY,data:[u],error:null}}catch(s){return ki("finalizeExtensionTransactionList: error \u274C",s),{variant:Rc.ERROR,data:[],error:new Eo({code:fs.UNKNOWN_ERROR,message:"finalizeExtensionTransactionList failed",cause:s?.message})}}}var s7e=tn(89136),gae=tn.n(s7e),Cs;(function(r){r.STANDARD="standard",r.FAST="fast",r.TURBO="turbo"})(Cs||(Cs={}));var lS,cit=(lS={},vt(lS,Cs.STANDARD,"low"),vt(lS,Cs.FAST,"medium"),vt(lS,Cs.TURBO,"high"),lS),lit={low:Cs.STANDARD,medium:Cs.FAST,high:Cs.TURBO},yae;(function(r){r.Jito="jito",r.Txmesh="txmesh"})(yae||(yae={}));var mae;(function(r){r.Mev="mev.protection",r.Vendors="multi.broadcast.vendors",r.BroadcastNodes="frontend.broadcast.nodes"})(mae||(mae={}));var bae;(function(r){r.BUY="BUY",r.SELL="SELL"})(bae||(bae={}));var vae;(function(r){r.AUTO="auto",r.CUSTOM="custom"})(vae||(vae={}));var wae;(function(r){r.AUTO="auto",r.OFF="off",r.ON="on"})(wae||(wae={}));var Aae;(function(r){r.INTERACT_THIRD_PARTY_APPLICATION="INTERACT_THIRD_PARTY_APPLICATION",r.SWAP_TRADE_FEE_NOTIFICATION_READ="SWAP_TRADE_FEE_NOTIFICATION_READ"})(Aae||(Aae={}));var _ae;(function(r){r.FROM="FROM",r.TO="TO"})(_ae||(_ae={}));var Eae;(function(r){r.NORMAL="NORMAL",r.EIP7702="EIP7702"})(Eae||(Eae={}));var Tae;(function(r){r.ENTER_AMOUNT="ENTER_AMOUNT",r.INSUFFICIENT_BALANCE="INSUFFICIENT_BALANCE",r.APPROVE="APPROVE",r.APPROVING="APPROVING",r.FINDING_THE_BEST_PROVIDER="FINDING_THE_BEST_PROVIDER",r.GET_QUOTE="GET_QUOTE",r.SWAP="SWAP",r.ORDER_CROSS_CHAIN="ORDER_CROSS_CHAIN",r.APPROVE_AND_SWAP="APPROVE_AND_SWAP",r.INSUFFICIENT_GAS_FEE="INSUFFICIENT_GAS_FEE"})(Tae||(Tae={}));var Sae;(function(r){r.ALERT="ALERT",r.POPUP="POPUP"})(Sae||(Sae={}));var Iae;(function(r){r.BEGINNER="csi_swap_alert_for_beginner",r.TO_LIQUIDITY_RISK="csi_swap_alert_for_to_liquidity_risk",r.FLASH_BUY_FIRST_USE="w3w_fe_flash_buy_first_use",r.BINANCE_EXCLUSIVE_DISCLAIMERS="w3w_fe_binance_exclusive_disclaimers"})(Iae||(Iae={}));var kae;(function(r){r.PENDING="PENDING",r.CONFIRMED="CONFIRMED",r.CANCELLED="CANCELLED",r.INIT="INIT"})(kae||(kae={}));var Rae;(function(r){r.SELL="SELL",r.BUY="BUY",r.SWAP="SWAP",r.INIT="INIT"})(Rae||(Rae={}));var FU=function(r,e,n){if(r==="0")return"0";if(!e||isNaN(e))return new ti(r).toString();for(var i=Number(e),s=new ti(r).dividedBy(new ti(10).exponentiatedBy(i)),o=ur(s.toFixed().split("."),2),a=o[0],u=o[1],l=u||Array(i+1).join("0");u&&u.endsWith("0");)l=l.substring(0,u.length-1);return n&&n>0&&(l=l.slice(0,n)),(a+(l?"."+l:"")).replace(/\.0+$/,"")},fit=function(r,e){return new BigNumber(r).multipliedBy(new BigNumber(10).exponentiatedBy(e))},dit=function(r,e,n){var i=isEvmChain(r);if(i){if(n===GasLevel.STANDARD)return e?SwapGasLevel.EVM_STANDARD_ANTI_MEV:SwapGasLevel.EVM_STANDARD;if(n===GasLevel.FAST)return e?SwapGasLevel.EVM_FAST_ANTI_MEV:SwapGasLevel.EVM_FAST;if(n===GasLevel.TURBO)return e?SwapGasLevel.EVM_TURBO_ANTI_MEV:SwapGasLevel.EVM_TURBO}if(r===SOLANA_BINANCE_CHAIN_ID){if(n===GasLevel.STANDARD)return e?SwapGasLevel.SOL_STANDARD_ANTI_MEV:SwapGasLevel.SOL_STANDARD;if(n===GasLevel.FAST)return e?SwapGasLevel.SOL_FAST_ANTI_MEV:SwapGasLevel.SOL_FAST;if(n===GasLevel.TURBO)return e?SwapGasLevel.SOL_TURBO_ANTI_MEV:SwapGasLevel.SOL_TURBO}return SwapGasLevel.NOMAL},Z2,WU=(Z2={},vt(Z2,ds.High,Cs.TURBO),vt(Z2,ds.Medium,Cs.FAST),vt(Z2,ds.Low,Cs.STANDARD),vt(Z2,ds.Custom,Cs.TURBO),Z2),hit=function(r){return WU[r]},pit=function(r){return Object.keys(WU).find(function(e){return WU[e]===r})},Y2,git=(Y2={},vt(Y2,ds.High,"instant"),vt(Y2,ds.Medium,"fast"),vt(Y2,ds.Low,"standard"),vt(Y2,ds.Custom,"customize"),Y2);function yit(r,e,n){var i=n.bridgeFee,s=n.tips,o=n.mevStatus,a=n.selectedLevel,u=cloneDeep(r);return i&&o7e(u,e,i),s&&o&&a7e(u,s,a),u}function o7e(r,e,n){var i=r.feeInfo.feeTemplate,s=tokenAmountToWei(n.amount,e.nativeTokenDecimals);if(i===GasAccountFeeTemplates.LegacyFeeTemplate||i===GasAccountFeeTemplates.Eip1559FeeTemplate){var o=r.feeInfo;o.lowFeeAmount=new BigNumber(o.lowFeeAmount||0).plus(s).toNumber(),o.mediumFeeAmount=new BigNumber(o.mediumFeeAmount||0).plus(s).toNumber(),o.highFeeAmount=new BigNumber(o.highFeeAmount||0).plus(s).toNumber(),o.feeAmount=new BigNumber(o.feeAmount||0).plus(s).toNumber(),o.lowDisplayFeeAmount=new BigNumber(o.lowDisplayFeeAmount||0).plus(s).toNumber(),o.mediumDisplayFeeAmount=new BigNumber(o.mediumDisplayFeeAmount||0).plus(s).toNumber(),o.highDisplayFeeAmount=new BigNumber(o.highDisplayFeeAmount||0).plus(s).toNumber()}else if(i===GasAccountFeeTemplates.SolanaFeeTemplate){var a=r.feeInfo;a.lowFeeAmount=new BigNumber(a.lowFeeAmount||0).plus(s).toNumber(),a.mediumFeeAmount=new BigNumber(a.mediumFeeAmount||0).plus(s).toNumber(),a.highFeeAmount=new BigNumber(a.highFeeAmount||0).plus(s).toNumber(),a.feeAmount=new BigNumber(a.feeAmount||0).plus(s).toNumber()}}function a7e(r,e,n){var i=r.feeInfo.feeTemplate,s=new BigNumber(e.amount[GasLevel.STANDARD]||"0"),o=new BigNumber(e.amount[GasLevel.FAST]||"0"),a=new BigNumber(e.amount[GasLevel.TURBO]||"0"),u=gasAccountLevelToGasFee(n),l=new BigNumber(e.amount[u]||"0");if(i===GasAccountFeeTemplates.LegacyFeeTemplate||i===GasAccountFeeTemplates.Eip1559FeeTemplate){var g=r.feeInfo;g.lowFeeAmount=new BigNumber(g.lowFeeAmount||0).plus(s).toNumber(),g.mediumFeeAmount=new BigNumber(g.mediumFeeAmount||0).plus(o).toNumber(),g.highFeeAmount=new BigNumber(g.highFeeAmount||0).plus(a).toNumber(),g.feeAmount=new BigNumber(g.feeAmount||0).plus(l).toNumber(),g.lowDisplayFeeAmount=new BigNumber(g.lowDisplayFeeAmount||0).plus(s).toNumber(),g.mediumDisplayFeeAmount=new BigNumber(g.mediumDisplayFeeAmount||0).plus(o).toNumber(),g.highDisplayFeeAmount=new BigNumber(g.highDisplayFeeAmount||0).plus(a).toNumber()}else if(i===GasAccountFeeTemplates.SolanaFeeTemplate){var y=r.feeInfo;y.lowFeeAmount=new BigNumber(y.lowFeeAmount||0).plus(s).toNumber(),y.mediumFeeAmount=new BigNumber(y.mediumFeeAmount||0).plus(o).toNumber(),y.highFeeAmount=new BigNumber(y.highFeeAmount||0).plus(a).toNumber(),y.feeAmount=new BigNumber(y.feeAmount||0).plus(l).toNumber()}}function mit(r){var e=r.batchGasAccountList,n=r.currentGasAccountType,i=r.fromNetwork,s=r.bridgeFee,o=r.tips,a=r.mevStatus,u=r.selectedLevel,l=r.customInfo,g=e.map(function(P){return P.filter(function(D){return D.feeInfo.feeTemplate===n})}),y=g.map(function(P,D){return D===g.length-1&&P.length>0?P.map(function(U){return mergeFee(U,i,{bridgeFee:s,tips:o,mevStatus:a,selectedLevel:u})}):P}),A=y.flat(),I=Cae(A,u,l);return{batchGasAccountList:y,mergedGasAccount:I}}function Cae(r,e,n){if(r.length===0)throw new Error("No gas accounts provided for merging");if(r.length===1)return r[0];if(!c7e(r))throw new Error("Gas accounts have different fee templates and cannot be merged");var i=gae()(r[0]),s=i.feeInfo.feeTemplate,o=new ti(0),a=new ti(0),u=new ti(0),l=new ti(0),g=new ti(0),y=new ti(0),A=new ti(0),I=new ti(0),P=new ti(0),D,U,V=!0,J=!1,re=void 0;try{for(var ce=r[Symbol.iterator](),Re;!(V=(Re=ce.next()).done);V=!0){var De=Re.value,Ue=De.feeInfo;if(s===Mo.LegacyFeeTemplate||s===Mo.Eip1559FeeTemplate){var Ve,pe=Ue;if(o=o.plus(pe.feeAmount||0),a=a.plus(pe.l1DataFee||0),u=u.plus(pe.gasLimit||0),l=l.plus(pe.lowFeeAmount||0),g=g.plus(pe.lowDisplayFeeAmount||0),y=y.plus(pe.mediumFeeAmount||0),A=A.plus(pe.mediumDisplayFeeAmount||0),I=I.plus(pe.highFeeAmount||0),P=P.plus(pe.highDisplayFeeAmount||0),((Ve=pe.customGasLimitRange)===null||Ve===void 0?void 0:Ve.length)===2){var Se=ur(pe.customGasLimitRange,2),Ce=Se[0],je=Se[1];D=(D??0)+Ce,U=(U??0)+je}}else if(s===Mo.SolanaFeeTemplate){var $e=Ue;o=o.plus($e.feeAmount||0),l=l.plus($e.lowFeeAmount||0),y=y.plus($e.mediumFeeAmount||0),I=I.plus($e.highFeeAmount||0)}}}catch(er){J=!0,re=er}finally{try{!V&&ce.return!=null&&ce.return()}finally{if(J)throw re}}if(s===Mo.LegacyFeeTemplate||s===Mo.Eip1559FeeTemplate){var Qe=i.feeInfo;if(Qe.feeAmount=o.toNumber(),Qe.l1DataFee=a.toNumber(),Qe.gasLimit=u.toNumber(),Qe.lowFeeAmount=l.toNumber(),Qe.lowDisplayFeeAmount=g.toNumber(),Qe.mediumFeeAmount=y.toNumber(),Qe.mediumDisplayFeeAmount=A.toNumber(),Qe.highFeeAmount=I.toNumber(),Qe.highDisplayFeeAmount=P.toNumber(),s===Mo.LegacyFeeTemplate){var nt=Qe;r.length>1?nt.customGasLimit=u.toNumber():e===ds.Custom&&n?.customGasLimit!==void 0&&(nt.customGasLimit=n.customGasLimit),e===ds.Custom&&n?.customGasPrice!==void 0&&(nt.customGasPrice=n.customGasPrice)}else if(s===Mo.Eip1559FeeTemplate){var Ne=Qe;r.length>1?Ne.customGasLimit=u.toNumber():e===ds.Custom&&n?.customGasLimit!==void 0&&(Ne.customGasLimit=n.customGasLimit),e===ds.Custom&&n?.customBaseFeePerGas!==void 0&&(Ne.customBaseFeePerGas=n.customBaseFeePerGas),e===ds.Custom&&n?.customPriorityFeePerGas!==void 0&&(Ne.customPriorityFeePerGas=n.customPriorityFeePerGas)}D!==void 0&&U!==void 0&&(Qe.customGasLimitRange=[D,U])}else if(s===Mo.SolanaFeeTemplate){var Me=i.feeInfo;Me.feeAmount=o.toNumber(),Me.lowFeeAmount=l.toNumber(),Me.mediumFeeAmount=y.toNumber(),Me.highFeeAmount=I.toNumber(),e===ds.Custom&&n&&n.customPriorityFee!==void 0&&(Me.customPriorityFee=n.customPriorityFee)}var ct=l7e(i,e),mt=i.feeInfo;mt.feeAmount=Number(ct.feeAmount);var Bt=r.filter(function(er){return er.feeInfo.succeedEstimateGas===!1});return Bt.length===0?mt.succeedEstimateGas=!0:(mt.succeedEstimateGas=!1,mt.errorMapping=Bt[0].feeInfo.errorMapping,mt.estimateOriginalResult=Bt[0].feeInfo.estimateOriginalResult),i}function u7e(r,e){if(e.length===0||!r)return e;var n=r.feeInfo.feeTemplate;if(n!==Mo.LegacyFeeTemplate&&n!==Mo.Eip1559FeeTemplate)return e;var i=r.feeInfo,s=new ti(i.customGasLimit||i.gasLimit),o=new ti(0),a=!0,u=!1,l=void 0;try{for(var g=e[Symbol.iterator](),y;!(a=(y=g.next()).done);a=!0){var A=y.value,I=A.feeInfo;o=o.plus(I.gasLimit||0)}}catch(P){u=!0,l=P}finally{try{!a&&g.return!=null&&g.return()}finally{if(u)throw l}}return o.isZero()?e:e.map(function(P){var D=gae()(P),U=D.feeInfo,V=new ti(U.gasLimit||0),J=V.div(o),re=s.times(J).integerValue(ti.ROUND_FLOOR);return U.customGasLimit=re.toNumber(),U.feeTemplate===Mo.Eip1559FeeTemplate?(U.customBaseFeePerGas=i.customBaseFeePerGas,U.customPriorityFeePerGas=i.customPriorityFeePerGas):U.customGasPrice=i.customGasPrice,U.selectedLevel=r.feeInfo.selectedLevel,D})}function c7e(r){if(r.length<=1)return!0;var e=r[0].feeInfo.feeTemplate;return r.every(function(n){return n.feeInfo.feeTemplate===e})}function l7e(r,e){var n=r.feeInfo.feeTemplate;return n===Mo.LegacyFeeTemplate?f7e(r.feeInfo,e):n===Mo.Eip1559FeeTemplate?d7e(r.feeInfo,e):n===Mo.SolanaFeeTemplate?h7e(r.feeInfo,e):{raw:"0",feeAmount:"0"}}function f7e(r,e){var n;switch(e){case ds.Low:n=new ti(r.lowFeeAmount||0);break;case ds.Medium:n=new ti(r.mediumFeeAmount||0);break;case ds.High:n=new ti(r.highFeeAmount||0);break;case ds.Custom:{var i=new ti(r.customGasPrice||r.mediumGasPrice||0),s=new ti(r.customGasLimit||r.gasLimit||0);n=i.times(s);break}default:n=new ti(r.feeAmount||0)}return{raw:n.toFixed(),feeAmount:n.toFixed()}}function d7e(r,e){var n;switch(e){case ds.Low:n=new ti(r.lowFeeAmount||0);break;case ds.Medium:n=new ti(r.mediumFeeAmount||0);break;case ds.High:n=new ti(r.highFeeAmount||0);break;case ds.Custom:{var i=new ti(r.customBaseFeePerGas||r.mediumBaseFeePerGas||0),s=new ti(r.customPriorityFeePerGas||r.mediumPriorityFeePerGas||0),o=new ti(r.customGasLimit||r.gasLimit||0);n=i.plus(s).times(o);break}default:n=new ti(r.feeAmount||0)}return{raw:n.toFixed(),feeAmount:n.toFixed()}}function h7e(r,e){var n;switch(e){case ds.Low:n=new ti(r.lowFeeAmount||0);break;case ds.Medium:n=new ti(r.mediumFeeAmount||0);break;case ds.High:n=new ti(r.highFeeAmount||0);break;case ds.Custom:n=new ti(r.customFeeAmount||r.feeAmount||0);break;default:n=new ti(r.feeAmount||0)}return{raw:n.toFixed(),feeAmount:n.toFixed()}}var p7e=function(r){var e=r.metadata.keyring.type;switch(e){case di.mpc:return"MPC";case di.hd:return"SEED_PHRASE";case di.privateKey:return"PRIVATE_KEY";default:throw new Error("Unsupported keyring type: ".concat(e))}},y4=function(){var r=(0,k.A)(b().mark(function e(n,i){var s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,vn.getWalletItemByAddress(n,i);case 2:if(s=a.sent,s){a.next=5;break}throw new Error("Wallet item not found");case 5:return a.abrupt("return",p7e(s));case 6:case"end":return a.stop()}},e)}));return function(n,i){return r.apply(this,arguments)}}(),HU=function(r,e){return HU=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},HU(r,e)};function bit(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");HU(r,e);function n(){this.constructor=r}r.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var xae=function(){return xae=Object.assign||function(e){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},xae.apply(this,arguments)};function vit(r,e){var n={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(n[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(n[i[s]]=r[i[s]]);return n}function wit(r,e,n,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,n,i);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function Ait(r,e){return function(n,i){e(n,i,r)}}function _it(r,e,n,i,s,o){function a(J){if(J!==void 0&&typeof J!="function")throw new TypeError("Function expected");return J}for(var u=i.kind,l=u==="getter"?"get":u==="setter"?"set":"value",g=!e&&r?i.static?r:r.prototype:null,y=e||(g?Object.getOwnPropertyDescriptor(g,i.name):{}),A,I=!1,P=n.length-1;P>=0;P--){var D={};for(var U in i)D[U]=U==="access"?{}:i[U];for(var U in i.access)D.access[U]=i.access[U];D.addInitializer=function(J){if(I)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(J||null))};var V=(0,n[P])(u==="accessor"?{get:y.get,set:y.set}:y[l],D);if(u==="accessor"){if(V===void 0)continue;if(V===null||typeof V!="object")throw new TypeError("Object expected");(A=a(V.get))&&(y.get=A),(A=a(V.set))&&(y.set=A),(A=a(V.init))&&s.unshift(A)}else(A=a(V))&&(u==="field"?s.unshift(A):y[l]=A)}g&&Object.defineProperty(g,i.name,y),I=!0}function Eit(r,e,n){for(var i=arguments.length>2,s=0;s<e.length;s++)n=i?e[s].call(r,n):e[s].call(r);return i?n:void 0}function Tit(r){return typeof r=="symbol"?r:"".concat(r)}function Sit(r,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function Iit(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function kit(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})}function Rit(r,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,s,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(g){return function(y){return l([g,y])}}function l(g){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,g[0]&&(n=0)),n;)try{if(i=1,s&&(o=g[0]&2?s.return:g[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,g[1])).done)return o;switch(s=0,o&&(g=[g[0]&2,o.value]),g[0]){case 0:case 1:o=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,s=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!o||g[1]>o[0]&&g[1]<o[3])){n.label=g[1];break}if(g[0]===6&&n.label<o[1]){n.label=o[1],o=g;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(g);break}o[2]&&n.ops.pop(),n.trys.pop();continue}g=e.call(r,n)}catch(y){g=[6,y],s=0}finally{i=o=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}var Bae=Object.create?function(r,e,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(r,i,s)}:function(r,e,n,i){i===void 0&&(i=n),r[i]=e[n]};function Cit(r,e){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Bae(e,r,n)}function Oae(r){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&r[e],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g7e(r,e){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),s,o=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(u){a={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function xit(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(g7e(arguments[e]));return r}function Bit(){for(var r=0,e=0,n=arguments.length;e<n;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,s++)i[s]=o[a];return i}function Oit(r,e,n){if(n||arguments.length===2)for(var i=0,s=e.length,o;i<s;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return r.concat(o||Array.prototype.slice.call(e))}function m4(r){return this instanceof m4?(this.v=r,this):new m4(r)}function Pit(r,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(r,e||[]),s,o=[];return s={},u("next"),u("throw"),u("return",a),s[Symbol.asyncIterator]=function(){return this},s;function a(P){return function(D){return Promise.resolve(D).then(P,A)}}function u(P,D){i[P]&&(s[P]=function(U){return new Promise(function(V,J){o.push([P,U,V,J])>1||l(P,U)})},D&&(s[P]=D(s[P])))}function l(P,D){try{g(i[P](D))}catch(U){I(o[0][3],U)}}function g(P){P.value instanceof m4?Promise.resolve(P.value.v).then(y,A):I(o[0][2],P)}function y(P){l("next",P)}function A(P){l("throw",P)}function I(P,D){P(D),o.shift(),o.length&&l(o[0][0],o[0][1])}}function Nit(r){var e,n;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,o){e[s]=r[s]?function(a){return(n=!n)?{value:m4(r[s](a)),done:!1}:o?o(a):a}:o}}function Mit(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],n;return e?e.call(r):(r=typeof Oae=="function"?Oae(r):r[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=r[o]&&function(a){return new Promise(function(u,l){a=r[o](a),s(u,l,a.done,a.value)})}}function s(o,a,u,l){Promise.resolve(l).then(function(g){o({value:g,done:u})},a)}}function Lit(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}var y7e=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};function Dit(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var n in r)n!=="default"&&Object.prototype.hasOwnProperty.call(r,n)&&Bae(e,r,n);return y7e(e,r),e}function Uit(r){return r&&r.__esModule?r:{default:r}}function X2(r,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:e.get(r)}function m7e(r,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,n):s?s.value=n:e.set(r,n),n}function Fit(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function Wit(r,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(o){return Promise.reject(o)}}),r.stack.push({value:e,dispose:i,async:n})}else n&&r.stack.push({async:!0});return e}var b7e=null;function Hit(r){function e(i){r.error=r.hasError?new b7e(i,r.error,"An error was suppressed during disposal."):i,r.hasError=!0}function n(){for(;r.stack.length;){var i=r.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(n,function(o){return e(o),n()})}catch(o){e(o)}}if(r.hasError)throw r.error}return n()}const zit=null;var zU=function(r,e){return zU=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},zU(r,e)};function $it(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zU(r,e);function n(){this.constructor=r}r.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Pae=function(){return Pae=Object.assign||function(e){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Pae.apply(this,arguments)};function Vit(r,e){var n={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(n[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(n[i[s]]=r[i[s]]);return n}function jit(r,e,n,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,n,i);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(o=(s<3?a(o):s>3?a(e,n,o):a(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function Kit(r,e){return function(n,i){e(n,i,r)}}function Git(r,e,n,i,s,o){function a(J){if(J!==void 0&&typeof J!="function")throw new TypeError("Function expected");return J}for(var u=i.kind,l=u==="getter"?"get":u==="setter"?"set":"value",g=!e&&r?i.static?r:r.prototype:null,y=e||(g?Object.getOwnPropertyDescriptor(g,i.name):{}),A,I=!1,P=n.length-1;P>=0;P--){var D={};for(var U in i)D[U]=U==="access"?{}:i[U];for(var U in i.access)D.access[U]=i.access[U];D.addInitializer=function(J){if(I)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(J||null))};var V=(0,n[P])(u==="accessor"?{get:y.get,set:y.set}:y[l],D);if(u==="accessor"){if(V===void 0)continue;if(V===null||typeof V!="object")throw new TypeError("Object expected");(A=a(V.get))&&(y.get=A),(A=a(V.set))&&(y.set=A),(A=a(V.init))&&s.unshift(A)}else(A=a(V))&&(u==="field"?s.unshift(A):y[l]=A)}g&&Object.defineProperty(g,i.name,y),I=!0}function qit(r,e,n){for(var i=arguments.length>2,s=0;s<e.length;s++)n=i?e[s].call(r,n):e[s].call(r);return i?n:void 0}function Zit(r){return typeof r=="symbol"?r:"".concat(r)}function Yit(r,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function Xit(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function fS(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})}function Jit(r,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,s,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(g){return function(y){return l([g,y])}}function l(g){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,g[0]&&(n=0)),n;)try{if(i=1,s&&(o=g[0]&2?s.return:g[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,g[1])).done)return o;switch(s=0,o&&(g=[g[0]&2,o.value]),g[0]){case 0:case 1:o=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,s=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!o||g[1]>o[0]&&g[1]<o[3])){n.label=g[1];break}if(g[0]===6&&n.label<o[1]){n.label=o[1],o=g;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(g);break}o[2]&&n.ops.pop(),n.trys.pop();continue}g=e.call(r,n)}catch(y){g=[6,y],s=0}finally{i=o=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}var Nae=Object.create?function(r,e,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(r,i,s)}:function(r,e,n,i){i===void 0&&(i=n),r[i]=e[n]};function Qit(r,e){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Nae(e,r,n)}function Mae(r){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&r[e],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function v7e(r,e){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),s,o=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(u){a={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function est(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(v7e(arguments[e]));return r}function tst(){for(var r=0,e=0,n=arguments.length;e<n;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,s++)i[s]=o[a];return i}function rst(r,e,n){if(n||arguments.length===2)for(var i=0,s=e.length,o;i<s;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return r.concat(o||Array.prototype.slice.call(e))}function b4(r){return this instanceof b4?(this.v=r,this):new b4(r)}function nst(r,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(r,e||[]),s,o=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",a),s[Symbol.asyncIterator]=function(){return this},s;function a(P){return function(D){return Promise.resolve(D).then(P,A)}}function u(P,D){i[P]&&(s[P]=function(U){return new Promise(function(V,J){o.push([P,U,V,J])>1||l(P,U)})},D&&(s[P]=D(s[P])))}function l(P,D){try{g(i[P](D))}catch(U){I(o[0][3],U)}}function g(P){P.value instanceof b4?Promise.resolve(P.value.v).then(y,A):I(o[0][2],P)}function y(P){l("next",P)}function A(P){l("throw",P)}function I(P,D){P(D),o.shift(),o.length&&l(o[0][0],o[0][1])}}function ist(r){var e,n;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,o){e[s]=r[s]?function(a){return(n=!n)?{value:b4(r[s](a)),done:!1}:o?o(a):a}:o}}function sst(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],n;return e?e.call(r):(r=typeof Mae=="function"?Mae(r):r[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=r[o]&&function(a){return new Promise(function(u,l){a=r[o](a),s(u,l,a.done,a.value)})}}function s(o,a,u,l){Promise.resolve(l).then(function(g){o({value:g,done:u})},a)}}function ost(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}var w7e=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e},$U=function(r){return $U=Object.getOwnPropertyNames||function(e){var n=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[n.length]=i);return n},$U(r)};function ast(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var n=$U(r),i=0;i<n.length;i++)n[i]!=="default"&&Nae(e,r,n[i]);return w7e(e,r),e}function ust(r){return r&&r.__esModule?r:{default:r}}function cst(r,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:e.get(r)}function lst(r,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,n):s?s.value=n:e.set(r,n),n}function fst(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function dst(r,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(o){return Promise.reject(o)}}),r.stack.push({value:e,dispose:i,async:n})}else n&&r.stack.push({async:!0});return e}var A7e=null;function hst(r){function e(o){r.error=r.hasError?new A7e(o,r.error,"An error was suppressed during disposal."):o,r.hasError=!0}var n,i=0;function s(){for(;n=r.stack.pop();)try{if(!n.async&&i===1)return i=0,r.stack.push(n),Promise.resolve().then(s);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(o).then(s,function(a){return e(a),s()})}else i|=1}catch(a){e(a)}if(i===1)return r.hasError?Promise.reject(r.error):Promise.resolve();if(r.hasError)throw r.error}return s()}function pst(r,e){return typeof r=="string"&&/^\.\.?\//.test(r)?r.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,s,o,a){return i?e?".jsx":".js":s&&(!o||!a)?n:s+o+"."+a.toLowerCase()+"js"}):r}const gst=null;var _7e=tn(3749);function E7e(r){const e={};for(let o=0;o<=255;o++){let a=o.toString(16);a.length<2&&(a="0"+a),e[a]=o}r=r.toLowerCase();const n=r.length;if(n%2!==0)throw"hex string must have length a multiple of 2";const i=n/2,s=new Uint8Array(i);for(let o=0;o<i;o++){const a=o*2,u=r.substring(a,a+2);if(!Object.prototype.hasOwnProperty.call(e,u))throw new Error("invalid hex character "+u);s[o]=e[u]}return s}const Lae="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",VU={};for(let r=0;r<Lae.length;r++)VU[Lae.charAt(r)]=r;const T7e=58,S7e="41",I7e=/^(41)/;function k7e(r){return typeof r=="string"&&!isNaN(parseInt(r,16))&&/^(0x|)[a-fA-F0-9]+$/.test(r)}function R7e(r){return r>="A"&&r<="F"||r>="a"&&r<="f"||r>="0"&&r<="9"?1:0}function C7e(r){let e;if(r>="A"&&r<="F"?e=r.charCodeAt(0)-65+10:r>="a"&&r<="f"?e=r.charCodeAt(0)-97+10:r>="0"&&r<="9"&&(e=r.charCodeAt(0)-48),typeof e=="number")return e;throw new Error("The passed hex char is not a valid hex char")}function x7e(r,e=!1){let n=r.length;e&&n%2&&(r=`0${r}`,n++);const i=[];let s=0,o=0,a=0;for(let u=0;u<n;u++){const l=r.charAt(u);if(R7e(l))s<<=4,s+=C7e(l),o++,o%2===0&&(i[a++]=s,s=0);else throw new Error("The passed hex char is not a valid hex string")}return i}function B7e(r){if(r<0||r>255)throw new Error("Input must be a byte");const e="0123456789ABCDEF";let n="";return n+=e.charAt(r>>4),n+=e.charAt(r&15),n}function Dae(r){let e="";for(let n=0;n<r.length;n++)e+=B7e(r[n]);return e}function Uae(r){const e=Dae(r),n=E7e(e),i=(0,_7e.sha256)(n).replace(/^0x/,"");return x7e(i)}function O7e(r){if(r.length===0)return[];let e,n;const i=[0];for(e=0;e<r.length;e++){const s=r[e];if(!(s in VU))throw new Error("Non-base58 character");for(n=0;n<i.length;n++)i[n]*=T7e;i[0]+=VU[s];let o=0;for(n=0;n<i.length;++n)i[n]+=o,o=i[n]>>8,i[n]&=255;for(;o;)i.push(o&255),o>>=8}for(e=0;r[e]==="1"&&e<r.length-1;e++)i.push(0);return i.reverse()}function P7e(r){if(typeof r!="string"||r.length<=4)return!1;let e=O7e(r);if(r.length<=4)return!1;const i=e.length-4,s=e.slice(i);e=e.slice(0,i);const o=Uae(e),u=Uae(o).slice(0,4);if(s[0]===u[0]&&s[1]===u[1]&&s[2]===u[2]&&s[3]===u[3])return e;throw new Error("Invalid address provided")}function nv(r){return k7e(r)?r.toLowerCase().replace(/^0x/,S7e):Dae(P7e(r)).toLowerCase()}const N7e=zi.from(Zee).toString(),M7e="CT_195";class dS{constructor({rpc$:e}){this.fullNode={request:n=>fS(this,void 0,void 0,function*(){const i=yield this.rpc$({binanceChainId:M7e,httpMethod:n.httpMethod||"POST",path:n.path,body:n.body});if(i.error)throw new Error(i.error);return i})},this.rpc$=e}static encodeParameter(e){const n=e.map(s=>s.type),i=e.map(s=>s.type==="address"?nv(s.value).replace(I7e,"0x"):s.value);return new kC().encode(n,i).replace(/^(0x)/,"")}sendTrx(e){return fS(this,arguments,void 0,function*({toAddress:n,ownerAddress:i,amount:s}){const o={to_address:nv(n),owner_address:nv(i),amount:Zu(s).toNumber()};return this.fullNode.request({path:"/wallet/createtransaction",body:o})})}triggerSmartContract(e){return fS(this,arguments,void 0,function*({ownerAddress:n,contractAddress:i,feeLimit:s,functionSelector:o,parameter:a=[],data:u,callValue:l}){var g,y;const A={owner_address:nv(n),contract_address:nv(i),fee_limit:Zu(s??15e7).toNumber(),call_value:Zu(l||"0").toNumber()};u?A.data=u:(A.function_selector=o,A.parameter=dS.encodeParameter(a));const I=yield this.fullNode.request({path:"/wallet/triggersmartcontract",body:A});if(!((g=I?.result)===null||g===void 0)&&g.result)return I;throw new Error(((y=I.result)===null||y===void 0?void 0:y.message)||"[tron] Failed to trigger smart contract")})}getAllowance(e){return fS(this,arguments,void 0,function*({spender:n,tokenAddress:i,owner:s}){var o,a;const u={contract_address:nv(i),owner_address:nv(s),function_selector:"allowance(address,address)",parameter:dS.encodeParameter([{type:"address",value:s},{type:"address",value:n}])},l=yield this.fullNode.request({path:"/wallet/triggerconstantcontract",body:u});if(!((o=l.result)===null||o===void 0)&&o.result)return Zu(l.constant_result[0],16).toFixed();throw new Error(((a=l.result)===null||a===void 0?void 0:a.message)||"[tron] Failed to get allowance")})}buildApproveTransaction(e){return fS(this,arguments,void 0,function*({spender:n,contractAddress:i,owner:s,amount:o=N7e}){return(yield this.triggerSmartContract({ownerAddress:s,contractAddress:i,functionSelector:"approve(address,uint256)",parameter:[{type:"address",value:n},{type:"uint256",value:o}]})).transaction})}}let jU=null;const yst=r=>{jU=new dS({rpc$:r})},mst=()=>{if(!jU)throw new Error("Tron client not initialized");return jU};var hS;(function(r){r.ETH_GET_TRANSACTION_COUNT="eth_getTransactionCount",r.ETH_CALL="eth_call",r.TRON_CLIENT="tron_client",r.COMMON_RPC="common_rpc"})(hS||(hS={}));let v4;const L7e=r=>{v4||(v4=new dS({rpc$:async({binanceChainId:e,httpMethod:n,path:i,body:s})=>r.walletAdaptor.rpcRequest({method:hS.TRON_CLIENT,params:{binanceChainId:e,httpMethod:n,path:i,body:s},binanceChainId:e})}))},D7e=r=>{L7e(r)};async function pS(r){try{return{data:await r.fn(),error:null}}catch(e){return e instanceof Eo?{data:null,error:e}:(console.error(`[${r.name}] Caught non-SDKError:`,e),{data:null,error:new Eo({code:fs.UNKNOWN_ERROR,message:e?.message||"Unknown error",cause:e?.stack||e?.toString?.()||e})})}}var Fae;(function(r){r.STANDARD="standard",r.FAST="fast",r.TURBO="turbo"})(Fae||(Fae={}));var Wae;(function(r){r[r.SWAP_LESS_REQUIRED_AMOUNT=1]="SWAP_LESS_REQUIRED_AMOUNT",r[r.BRIDGE_LESS_REQUIRED_AMOUNT=2]="BRIDGE_LESS_REQUIRED_AMOUNT",r[r.QUOTE_FETCH_FAILED=3]="QUOTE_FETCH_FAILED",r[r.QUOTE_FETCH_TIME_OUT=4]="QUOTE_FETCH_TIME_OUT",r[r.QUOTE_FETCH_NO_LIQUIDITY=5]="QUOTE_FETCH_NO_LIQUIDITY",r[r.SERVICE_RATE_LIMIT=6]="SERVICE_RATE_LIMIT",r[r.CEX_LESS_REQUIRED_AMOUNT=7]="CEX_LESS_REQUIRED_AMOUNT",r[r.FOUR_MEME_PAIR_ERROR=8]="FOUR_MEME_PAIR_ERROR",r[r.QUOTE_NETWORK_ERR=9]="QUOTE_NETWORK_ERR",r[r.SWAP_EXCEED_REQUIRED_AMOUNT=10]="SWAP_EXCEED_REQUIRED_AMOUNT",r[r.BRIDGE_EXCEED_REQUIRED_AMOUNT=11]="BRIDGE_EXCEED_REQUIRED_AMOUNT",r[r.INVALID_TRADE_TIME=12]="INVALID_TRADE_TIME",r[r.INVALID_TRADE_TOKEN=13]="INVALID_TRADE_TOKEN",r[r.MIN_AMOUNT_LIMIT=14]="MIN_AMOUNT_LIMIT"})(Wae||(Wae={}));const bst=5;var gS;(function(r){r.BinanceBridge="BinanceBridge",r.Inch="Inch",r.Quant="Quant",r.LIFI="Lifi",r.RANGO="Rango",r.JUPITER="Jupiter",r.SwapCoffee="SwapCoffee",r.Pancake="Pancake",r.LiquidMesh="LiquidMesh",r.Cetus="Cetus",r.InchFusion="InchFusion",r.CowSwap="CowSwap"})(gS||(gS={}));var w4;(function(r){r.TIME_OUT="305003",r.REQUIRE_MIN_AMOUNT_LIMIT="305011",r.REQUIRE_MAX_AMOUNT_LIMIT="305012",r.NO_LIQUIDITY="305024",r.SERVICE_RATE_LIMIT="305023",r.SERVICE_RATE_LIMIT_INTERNAL="305026",r.SYSTEM_ERROR="100001001",r.FOUR_MEME_PAIR_ERROR="305028",r.INVALID_TRADE_TIME="316008",r.INVALID_TRADE_TOKEN="316009",r.STOCK_TOKEN_OVER_AMOUNT_LIMIT="316011",r.MIN_AMOUNT_LIMIT="315008"})(w4||(w4={}));const A4={AMM:"AMM",RFQ:"RFQ"},KU={SPLIT_ORDER_WARNING:"315010"},Hae={SPLIT_ORDER_WARNING:1},zae=[{warning:Hae.SPLIT_ORDER_WARNING,code:KU.SPLIT_ORDER_WARNING,paramsFunc:r=>({splitOrderWarningAmount:r?.splitOrderWarningAmount||""})}],U7e=(r,e)=>{if(!r.warningCode)return null;for(let n=0;n<zae.length;n++){const i=zae[n];if(r.warningCode===i.code){const s=i.paramsFunc,o=s?s(r.warningParams,e):null;return{type:i.warning,params:o}}}return null},F7e=qr({slippage:un(pt()),fromAddress:pt(),fromTokenAddress:pt(),fromNetworkId:pt(),fromBinanceChainId:pt(),fromTokenAmount:O0,toAddress:pt(),toTokenAddress:pt(),toBinanceChainId:pt(),toNetworkId:pt(),toTokenAmount:O0,maxRecommendSlippage:un(pt()),fromTokenSymbol:pt(),toTokenSymbol:pt(),nativeTokenDecimals:fn()}),W7e=qr({slippage:un(pt()),fromAddress:pt(),fromCoinAddress:pt(),fromNetwork:pt(),fromBinanceChainId:pt(),fromCoinAmount:_o,toAddress:pt(),toCoinAddress:pt(),toBinanceChainId:pt(),toNetwork:pt(),toCoinAmount:_o,maxRecommendSlippage:un(pt())}),J2=qr({id:sn(fn()),direction:sn(pt()),ratePercent:sn(fn()),rateCoinAmount:sn(fn()),rateFiatValue:sn(fn()),defaultRatePercent:sn(fn()),feeReceiver:sn(pt()),name:sn(pt()),rateCoinAmountAfterOnChain:sn(pt()),ratePercentMul10000:sn(fn())}),H7e=qr({vendor:_u(gS),vendorName:pt(),subVendorName:pt(),subVendorId:pt(),uniQuoteId:pt(),quoteId:pt(),fromCoinAddress:pt(),toCoinAddress:pt(),fromNetworkId:pt(),toNetworkId:pt(),fromCoinAmount:_o,toCoinAmount:_o,bridgeFee:Roe,estimatedGasLimit:sn(pt()),expireTime:sn(fn()),estimatedTime:sn(fn()),router:sn(pt()),extra:sn(pt()),tags:sn(es(pt())),code:sn(_u(w4)),error:sn(qr({minRequireAmount:un(pt()),minRequireToAmount:un(pt()),maxRequireAmount:un(pt()),memePairsMap:tS(pt(),es(pt())),fusionMinFromUsdAmount:un(ra([pt(),kc()])),ondoTokenSymbol:un(ra([pt(),kc()])),ondoMaxSingleOrderLimit:un(ra([pt(),kc()])),ondoMarketStatus:un(ra([pt(),kc()])),ondoReasonCode:un(ra([pt(),kc()])),ondoReasonMsg:un(ra([pt(),kc()])),ondoNextOpenTime:un(ra([pt(),kc()]))})),feeDetail:J2,minReceive:Roe,approveMode:_u(OU),quoteMode:_u(A4),warningCode:sn(_u(KU)),warningParams:sn(qr({splitOrderWarningAmount:un(pt())}))}),$ae=qr({vendor:_u(gS),vendorName:pt(),subVendorName:pt(),subVendorId:pt(),uniQuoteId:pt(),quoteId:pt(),fromTokenAddress:pt(),toTokenAddress:pt(),fromNetworkId:pt(),toNetworkId:pt(),fromTokenAmount:O0,toTokenAmount:O0,bridgeFee:QMe,estimatedGasLimit:sn(pt()),expireTime:sn(fn()),estimatedTime:sn(fn()),router:sn(pt()),extra:sn(pt()),tags:sn(es(pt())),code:sn(_u(w4)),error:sn(qr({minRequireAmount:un(pt()),minRequireToAmount:un(pt()),maxRequireAmount:un(pt()),memePairsMap:tS(pt(),es(pt())),fusionMinFromUsdAmount:un(ra([pt(),kc()])),ondoTokenSymbol:un(ra([pt(),kc()])),ondoMaxSingleOrderLimit:un(ra([pt(),kc()])),ondoMarketStatus:un(ra([pt(),kc()])),ondoReasonCode:un(ra([pt(),kc()])),ondoReasonMsg:un(ra([pt(),kc()])),ondoNextOpenTime:un(ra([pt(),kc()]))})),feeDetail:J2,minReceive:O0,approveMode:_u(OU),toBinanceChainId:pt(),estimatedTimeInMins:fn(),requestId:pt(),toTokenAmountDiff:pt(),toTokenAmountPercentDiff:pt(),fromTokenDecimals:fn(),toTokenDecimals:fn(),fromBinanceChainId:pt(),fromWalletAddress:pt(),toWalletAddress:pt(),quoteMode:_u(A4),warningCode:sn(_u(KU)),warningParams:sn(qr({splitOrderWarningAmount:un(pt())})),warning:sn(qr({type:_u(Hae),params:sn(qr({splitOrderWarningAmount:un(pt())}))})),rawFromTokenAmount:Ao,rawToTokenAmount:Ao,rawMinReceive:Ao}),vst=qr({slippage:pt(),isNeedRemind:sn(Wi()),remindContext:sn(pt())}),wst=qr({...F7e.entries,mev:Wi(),isTransferTax:Wi(),fromTokenDecimals:fn(),toTokenDecimals:fn(),extra:un(Ua()),fromTokenMultiplier:un(pt()),toTokenMultiplier:un(pt()),fromTokenBalance:un(O0)}),z7e=qr({...W7e.entries,mev:un(Wi()),isTransferTax:Wi(),extra:un(Ua()),fromTokenMultiplier:un(pt()),fromTokenShare:un(pt()),toTokenMultiplier:un(pt()),toTokenShare:un(pt())}),Ast=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({quoteList:es(H7e),slippage:qr({slippage:pt(),isNeedRemind:sn(Wi()),remindContext:sn(pt())}),gasDetails:kc()}),success:Wi()}),$7e=(r,e,n)=>{const{extra:i,...s}=e,o=Eu(z7e,s);if(!o.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchSwapQuote api error",cause:uu(o.issues)});return r.request({method:"POST",url:"/bapi/defi/v3/private/wallet-direct/swap/aggregator/swap/get-quote",data:{...o.output,...i},options:n})},V7e=[{errorCode:fs.QUOTE_INVALID_TRADE_TIME,code:"316008",func:r=>({ondoTokenSymbol:r?.ondoTokenSymbol,ondoReasonCode:r?.ondoReasonCode,ondoReasonMsg:r?.ondoReasonMsg,ondoNextOpenTime:r?.ondoNextOpenTime})},{errorCode:fs.QUOTE_INVALID_TRADE_TOKEN,code:"316009",func:r=>({ondoTokenSymbol:r?.ondoTokenSymbol})},{errorCode:fs.QUOTE_STOCK_TOKEN_OVER_AMOUNT_LIMIT,code:"316011",func:r=>({ondoTokenSymbol:r?.ondoTokenSymbol,ondoMaxSingleOrderLimit:r?.ondoMaxSingleOrderLimit,ondoMarketStatus:r?.ondoMarketStatus})},{errorCode:fs.QUOTE_MIN_AMOUNT_LIMIT,code:"315008",func:r=>({fusionMinFromUsdAmount:r?.fusionMinFromUsdAmount})},{errorCode:fs.QUOTE_STOCK_TOKEN_MULTIPLIER_NOT_MATCH,code:"351220"},{errorCode:fs.QUOTE_STOCK_TOKEN_MULTIPLIER_NOT_MATCH,code:"351221"},{errorCode:fs.QUOTE_STOCK_TOKEN_MULTIPLIER_NOT_MATCH,code:"351222"},{errorCode:fs.QUOTE_FOUR_MEME_PAIR_ERROR,code:"305028",func:(r,e)=>{const n=r?.memePairsMap||{},i=Object.keys(n)[0]||"",s=i===e.fromTokenAddress?e.fromTokenSymbol:e.toTokenSymbol,o=n[i]?.[0]||"";return{symbol1:s,symbol2:o}}},{errorCode:fs.QUOTE_SERVICE_RATE_LIMIT,code:"305023"},{errorCode:fs.QUOTE_FETCH_FAILED,code:"305026"},{errorCode:fs.QUOTE_FETCH_TIME_OUT,code:"305003"},{errorCode:fs.QUOTE_FETCH_NO_LIQUIDITY,code:"305024"},{errorCode:fs.QUOTE_FETCH_NO_LIQUIDITY,code:"100001001"}],j7e=(r,e)=>{const n=r.reduce((s,o)=>o.code?{...s,[o.code]:o.error||{}}:s,{}),i=V7e.find(s=>n[s.code]);if(i){const{code:s,func:o}=i;return{code:i.errorCode,params:o&&n[s]&&o(n[s],e)}}return{code:fs.QUOTE_FETCH_NO_LIQUIDITY}},K7e=(r,e,n,i)=>{let s=[],o=10;const a=r.toTokenMultiplier??"1",u=g=>!g.code&&!isNaN(Number(g.fromCoinAmount))&&!isNaN(Number(g.toCoinAmount))&&Number(g.fromCoinAmount)>0&&Number(g.toCoinAmount)>0,l=e.find(g=>u(g)&&(g.tags??[]).some(y=>y===L9e));for(const g of e){if(!u(g))continue;const y=tv(g.fromCoinAmount,r.fromTokenDecimals),A=tv(g.toCoinAmount,r.toTokenDecimals),I=g.minReceive?tv(g.minReceive,r.toTokenDecimals):cae(r.slippage?+r.slippage*100:n.slippage,A),P=rv(y,r.fromTokenMultiplier??"1"),D=rv(A,a),U=rv(I,a);let V="0",J="0";if(l){const Re=tv(l.toCoinAmount,r.toTokenDecimals),De=rv(Re,a);V=km(De).minus(D).toFixed(),J=km(V).div(De).toFixed()}const re=P0(new km(g.bridgeFee||"0").dividedBy(new km(10).exponentiatedBy(r.nativeTokenDecimals)).decimalPlaces(8,0).toFixed()),ce={...g,bridgeFee:re,fromWalletAddress:r.fromAddress,toWalletAddress:r.toAddress,fromBinanceChainId:r.fromBinanceChainId,toBinanceChainId:r.toBinanceChainId,fromTokenAmount:P,toTokenAmount:D,fromTokenAddress:g.vendor===gS.InchFusion?g.fromCoinAddress:r.fromTokenAddress,toTokenAddress:r.toTokenAddress,estimatedTimeInMins:g.estimatedTime&&Math.ceil(g.estimatedTime/60)||1,requestId:i,minReceive:U,toTokenAmountDiff:V,toTokenAmountPercentDiff:J,fromTokenDecimals:r.fromTokenDecimals,toTokenDecimals:r.toTokenDecimals,warningCode:g.warningCode,warningParams:g.warningParams,warning:null,rawFromTokenAmount:y,rawToTokenAmount:A,rawMinReceive:I};ce.warning=U7e(ce),s.push(ce),g.expireTime&&g.expireTime<o&&(o=g.expireTime)}if(s.length===0){const g={fromTokenSymbol:r.fromTokenSymbol,toTokenSymbol:r.toTokenSymbol,fromTokenAddress:r.fromTokenAddress,toTokenAddress:r.toTokenAddress,fromTokenDecimals:r.fromTokenDecimals,toTokenDecimals:r.toTokenDecimals},y=j7e(e,g);throw new Eo({code:y.code,message:"quote error",data:y.params})}return{quotes:s,slippage:n,expireTime:o}};class G7e{constructor(e={}){this.map={},Object.keys(e).forEach(n=>{const i={},s={};e[n].forEach(([o,a])=>{i[o]=a,s[a]=o}),this.map[n]={km:i,vm:s}})}getSwapContractAddress(e,n){return this.map[e]?.vm[n]||n}getUniversalContractAddress(e,n){return this.map[e]?.km[n]||n}}const Q2=new G7e({CT_501:[["sol",N9e]],CT_784:[["0x2::sui::sui",PU]],CT_0:[["btc",PU]],CT_195:[["trx",PU]]}),Vae={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let GU;const q7e=new Uint8Array(16);function Z7e(){if(!GU){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");GU=crypto.getRandomValues.bind(crypto)}return GU(q7e)}const Yu=[];for(let r=0;r<256;++r)Yu.push((r+256).toString(16).slice(1));function jae(r,e=0){return(Yu[r[e+0]]+Yu[r[e+1]]+Yu[r[e+2]]+Yu[r[e+3]]+"-"+Yu[r[e+4]]+Yu[r[e+5]]+"-"+Yu[r[e+6]]+Yu[r[e+7]]+"-"+Yu[r[e+8]]+Yu[r[e+9]]+"-"+Yu[r[e+10]]+Yu[r[e+11]]+Yu[r[e+12]]+Yu[r[e+13]]+Yu[r[e+14]]+Yu[r[e+15]]).toLowerCase()}function Est(r,e=0){const n=jae(r,e);if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}const Tst=null;function Y7e(r,e,n){if(Vae.randomUUID&&!e&&!r)return Vae.randomUUID();r=r||{};const i=r.random??r.rng?.()??Z7e();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let s=0;s<16;++s)e[n+s]=i[s];return e}return jae(i)}const yS=Y7e;function X7e(r){const{shareAmount:e,balance:n,decimals:i,multiplier:s}=r,o=P0((0,q2.toOndoTokenAmount)(e,s)),a=Zu(o).minus(n),u=a.gt(0);if(a.gt(0)){const l=Zu(1).div(Zu(10).pow(i));if(a.lte(l))return{tokenAmount:n,shareAmount:J1((0,q2.toOndoShareAmount)(n,s)),isUsingBalance:!0,multiplier:s,isExceedingBalance:!1}}return{tokenAmount:o,shareAmount:e,isUsingBalance:!1,multiplier:s,isExceedingBalance:u}}const J7e=async(r,e)=>{ki("fetchSwapQuote start:",e);const{fromTokenDecimals:n,toTokenDecimals:i,fromTokenBalance:s,...o}=e,{fromTokenMultiplier:a="1",toTokenMultiplier:u="1",fromTokenAmount:l,toTokenAmount:g}=o;let y,A=P0((0,q2.toOndoTokenAmount)(g,u)),I=l;if(s){const J=X7e({shareAmount:J1(l),balance:K9e(s,a),multiplier:a,decimals:n});I=J.shareAmount,y=J.tokenAmount}else y=P0((0,q2.toOndoTokenAmount)(l,a));const P={...o,fromCoinAddress:Q2.getSwapContractAddress(e.fromBinanceChainId,e.fromTokenAddress),toCoinAddress:Q2.getSwapContractAddress(e.toBinanceChainId,e.toTokenAddress),fromNetwork:e.fromNetworkId,toNetwork:e.toNetworkId,fromCoinAmount:qo(Cc(y,n).toFixed()),toCoinAmount:qo(Cc(A,i).toFixed()),fromTokenMultiplier:a,fromTokenShare:I,toTokenMultiplier:u,toTokenShare:g},D=yS(),U=await $7e(r.serverAdaptor,P,{headers:{"x-w3w-request-id":D}}),V=K7e(e,U.data.quoteList,{...U.data.slippage,slippage:Zu(U.data.slippage.slippage).multipliedBy(100).toString()},D);return ki("fetchSwapQuote end \u2705",V),V},Q7e=async(r,e)=>{switch(e.kind){case yoe.SWAP_QUOTE:return J7e(r,e.input);default:throw new Error("fetchQuote: Unsupported quote kind")}},eLe={[Qoe]:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",[BU]:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"};function tLe(r,e){return{value:"0x0",data:new am(["function allowance(address owner,address spender) returns (uint256)"]).encodeFunctionData("allowance",[e,r])}}const rLe=(r,e,n)=>uae(e)||r===xU?n:"",nLe=async(r,e)=>{ki("checkApprove start \u2705",e);const{fromTokenAddress:n,fromTokenAmount:i,fromTokenDecimals:s,fromBinanceChainId:o,router:a,wcId:u,fromWalletAddress:l,isNativeToken:g,quoteMode:y}=e,A=rLe(o,u,a),I={isApproveUnlimited:!1,approved:!0,allowance:"0"};if(!A||g&&y!==A4.RFQ)return ki("checkApprove return default result \u2705"),I;let P=n;if(y===A4.RFQ&&g){const D=eLe[o];if(!D)return ki("checkApprove: missing wrap address for chain \u274C",o),I;P=D}try{if(o===xU){const J=await v4.getAllowance({tokenAddress:n,spender:A,owner:l}),re={...I,approved:Zu(Cc(i,s)).lte(J),allowance:J,isApproveUnlimited:Zu(J).gte(eae)};return ki("checkApprove end \u2705",re),re}const U=(await r.walletAdaptor.rpcRequest({method:hS.ETH_CALL,params:[{from:l,to:P,...tLe(A,l)},"latest"],binanceChainId:o})).result,V={allowance:U,approved:Zu(Cc(i,s)).lte(U),isApproveUnlimited:Zu(U).gte(eae)};return ki("checkApprove end \u2705",V),V}catch(D){return ki("checkApprove error \u274C",D),{...I,approved:!1}}},Kae={PENDING:"init",SUBMITTED:"submitted",CONFIRMED:"confirmed",FAILED:"failed",REPLACED:"replaced",SUBMIT_FAIL:"submit_fail",PARTIAL_SUCCESS:"partial_success",EXPIRE_FAIL:"expire_fail"};var qU;(function(r){r.DEFAULT="normal",r.CANCEL="cancel",r.SPEED_UP="speedup"})(qU||(qU={}));const Rm={APPROVE:"approve",SWAP:"swap",BRIDGE:"bridge",CONTRACT_CALL:"contract_call"};var eA;(function(r){r.SWAP="swap",r.BRIDGE="bridge",r.APPROVE="approve",r.CONTRACT_CALL="contract_call"})(eA||(eA={}));var tA;(function(r){r.Mev="mev.protection",r.Vendors="multi.broadcast.vendors",r.BroadcastNodes="frontend.broadcast.nodes"})(tA||(tA={}));const Sst=qr({isCheckNonce:un(Wi()),isCheckSimilar:un(Wi())}),iLe=qr({fromBinanceChainId:pt(),fromWalletAddress:pt()}),sLe=qr({fromWalletAddress:pt(),fromBinanceChainId:pt(),toWalletAddress:pt(),toBinanceChainId:pt(),fromTokenSymbol:pt(),toTokenSymbol:pt(),txType:_u(Rm),fromTokenAddress:pt(),toTokenAddress:pt(),fromTokenAmount:Ao,toTokenAmount:Ao,fromTokenDecimals:fn(),toTokenDecimals:fn(),to:un(pt()),data:un(pt())}),oLe=qr({binanceChainId:pt(),address:pt()}),Ist=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({pendingTotal:fn(),pendingDistinct:fn(),confirmedNonce:fn(),pendingNonce:fn(),hitRule:Wi()}),success:Wi()}),kst=qr({checkNonceInput:un(iLe),checkSimilarInput:un(sLe)}),Gae=(r,e,n)=>{const i=Eu(oLe,e);if(!i.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"pendingNonceCheck api error",cause:uu(i.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/tx/pending-check",data:i.output,options:n})},aLe=async(r,e)=>(ki("pendingNonceCheck start",{params:e}),Gae(r.serverAdaptor,{binanceChainId:e.fromBinanceChainId,address:e.fromWalletAddress})),qae=qr({send:es(qr({address:pt(),binanceChainId:pt(),contractAddress:pt(),amount:_o,decimals:fn(),tokenSymbol:pt()})),receive:es(qr({address:pt(),binanceChainId:pt(),contractAddress:pt(),amount:_o,decimals:fn(),tokenSymbol:pt()})),contractCall:qr({to:pt(),toLabel:pt(),input:pt()})}),Zae=qr({send:es(qr({address:pt(),binanceChainId:pt(),contractAddress:pt(),amount:_o,decimals:fn(),tokenSymbol:pt()})),receive:koe(),contractCall:qr({to:pt(),toLabel:pt(),input:pt()})}),Yae=qr({approve:qr({binanceChainId:pt(),contractAddress:pt(),tokenSymbol:pt(),decimals:fn(),to:pt(),amount:_o})}),Xae=qr({contractCall:qr({to:pt(),toLabel:pt(),input:pt()})}),uLe=qr({orderList:es(qr({binanceChainId:pt(),feeValue:_o,feeTokenAddress:pt(),address:pt(),feeTokenDecimals:fn(),status:pt(),actionType:pt(),from:pt(),source:pt(),signedTransaction:pt(),to:pt(),txType:pt(),subType:pt(),broadcastOption:un(pt()),instructions:ra([qae,Zae,Yae,Xae]),nonce:un(fn()),rawData:un(pt()),extData:un(qr({feeObj:un(Ua()),quoteId:un(pt()),walletType:un(pt())})),orderId:pt()}))}),Rst=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({results:es(qr({txHash:pt(),orderId:pt(),txStatus:pt(),success:Wi(),error:sn(pt()),errorCode:sn(pt()),errorParams:sn(pt())}))}),success:Wi()}),Cst=qr({quote:$ae,fromTokenSymbol:pt(),toTokenSymbol:pt()}),cLe=qr({txType:_u(Rm),binanceChainId:pt(),address:pt(),instructions:ra([qae,Zae,Yae,Xae])}),Bst=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({item:qr({binanceTxId:pt(),txType:pt(),txHash:pt(),txTime:fn(),networkId:pt(),binanceChainId:pt(),address:pt(),subType:pt(),status:pt(),actionType:pt(),rawData:pt(),nonce:fn()})}),success:Wi()}),lLe=(r,e,n)=>{const i=Eu(cLe,e);if(!i.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"checkSimilarTransaction api error",cause:uu(i.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/tx/pending-similar-check",data:i.output,options:n})},fLe=async(r,e)=>{ki("similarCheck start",{params:e});const{fromBinanceChainId:n,txType:i,fromWalletAddress:s,fromTokenAddress:o,toTokenAddress:a,fromTokenAmount:u,toTokenAmount:l,fromTokenDecimals:g,fromTokenSymbol:y,toTokenSymbol:A,toTokenDecimals:I,to:P,data:D,toBinanceChainId:U}=e;let V;switch(i){case Rm.SWAP:V={send:[{address:s,binanceChainId:n,contractAddress:o,amount:qo(Cc(u,g).toFixed()),decimals:g,tokenSymbol:y}],receive:[{address:s,binanceChainId:n,contractAddress:a,amount:qo(Cc(l,I).toFixed()),decimals:I,tokenSymbol:A}],contractCall:{to:P||"",toLabel:"",input:D||""}};break;case Rm.BRIDGE:V={send:[{address:s,binanceChainId:n,contractAddress:o,amount:qo(Cc(u,g).toFixed()),decimals:g,tokenSymbol:y}],receive:[{address:s,binanceChainId:U,contractAddress:a,amount:qo(Cc(l,I).toFixed()),decimals:I,tokenSymbol:A}],contractCall:{to:P||"",toLabel:"",input:D||""}};break;default:throw new Error("invalid txType")}return lLe(r.serverAdaptor,{binanceChainId:n,address:s,txType:i,instructions:V})},dLe=async(r,e,n)=>{const{isCheckNonce:i,isCheckSimilar:s}=e,{checkNonceInput:o,checkSimilarInput:a}=n,u=[];if(i&&o&&u.push({key:"nonce",promise:aLe(r,o)}),s&&a&&u.push({key:"similar",promise:fLe(r,a)}),u.length===0)return;const l=await Promise.allSettled(u.map(D=>D.promise)),g=Object.fromEntries(l.map((D,U)=>[u[U].key,D])),y=g.nonce,A=g.similar;let I={success:!0},P={success:!0};return y&&y.status==="fulfilled"?I={success:!0,data:y.value.data}:I={success:!1},A&&A.status==="fulfilled"?P={success:!0,data:A.value.data}:P={success:!1},{checkNonceResult:I,checkSimilarResult:P}},ZU=qr({from:pt(),to:pt(),value:_o,data:pt(),nonce:un(pt()),gasLimit:un(pt()),gasPrice:un(pt()),feeAmount:un(Ao),priorityFeePerGas:un(pt()),baseFeePerGas:un(pt())}),YU=qr({serializedMessage:TU(Uint8Array),address:pt(),digest:un(pt()),base64Tx:un(pt())}),XU=qr({data:pt(),sender:un(pt()),gasUsed:un(qr({computationCost:pt(),nonRefundableStorageFee:pt(),storageCost:pt(),storageRebate:pt()})),gasFee:un(pt()),gasBudget:un(fn()),recipientAddress:un(pt()),asset:un(pt())}),JU=qr({from:pt(),to:pt(),data:pt(),value:sn(_o),sendAmount:un(_o),asset:un(pt()),feeLimit:un(pt()),feeAmount:un(Ao)}),QU=qr({typedData:pt()}),Ost=ra([ZU,YU,XU,JU,QU]),hLe=ra([qr({kind:qu("evm"),transaction:ZU}),qr({kind:qu("solana"),transaction:YU}),qr({kind:qu("sui"),transaction:XU}),qr({kind:qu("tron"),transaction:JU}),qr({kind:qu("eip712"),transaction:QU})]),Pst=ra([f4(ZU,["from","to","data","value"]),f4(YU,["serializedMessage","address"]),f4(XU,["data"]),f4(JU,["from","to","data","value"]),QU]),Nst=null,Mst=qr({quote:$ae,slippage:pt(),fromTokenSymbol:pt(),toTokenSymbol:pt(),nativeTokenSymbol:pt(),transferTax:pt(),requestId:pt(),fromTokenAddress:pt(),toTokenAddress:pt(),fromTokenMultiplier:un(pt()),toTokenMultiplier:un(pt()),extraField:un(Ua())}),Lst=qr({baseTransaction:hLe,fromTokenAmount:O0,rawFromTokenAmount:Ao,toTokenAmount:O0,rawToTokenAmount:Ao,quoteId:pt(),minReceive:O0,rawMinReceive:Ao}),pLe=qr({side:pt(),quoteId:pt(),slippage:pt(),vendor:pt(),fromCoin:pt(),fromCoinAddress:pt(),toCoinAddress:pt(),fromCoinAmount:_o,toCoin:pt(),toCoinAmount:_o,fromNetwork:pt(),toNetwork:pt(),fromBinanceChainId:pt(),toBinanceChainId:pt(),fromWalletAddress:pt(),toWalletAddress:pt(),extra:sn(pt()),feeDetail:J2,requestId:pt(),nativeTokenSymbol:pt(),transferTax:pt(),extraField:un(Ua())}),Dst=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({fromCoinAmount:_o,toCoinAmount:_o,quoteId:pt(),minReceive:sn(_o),calldataFromAmount:_o,calldataToAmount:_o,evmTransaction:sn(qr({to:pt(),value:_o,data:pt()})),solTransaction:sn(qr({swapTransaction:pt(),serializedMessage:TU(Uint8Array)})),moveTransaction:sn(qr({data:pt()})),tronTransaction:sn(qr({to:pt(),data:pt(),value:_o})),eip712Transaction:sn(qr({typedData:pt()}))}),success:Wi()}),gLe=async(r,e,n)=>{const i=Kl.getGlobal(),s=Date.now();i.debug("API \u2192 fetchCalldataBySwap$ (request)",{quoteId:e.quoteId,fromChain:e.fromBinanceChainId,toChain:e.toBinanceChainId});const{extraField:o,...a}=e,u=Eu(pLe,a);if(!u.success){const l=new Eo({code:fs.SCHEMA_ERROR,message:"fetchCalldataBySwap api error",cause:uu(u.issues)});throw i.error("API \u2192 fetchCalldataBySwap$ (schema error)",{issues:uu(u.issues)}),l}try{const l=await r.request({method:"POST",url:"/bapi/defi/v2/private/wallet-direct/swap/aggregator/swap",data:{...u.output,...o},options:n}),g=Date.now()-s;return i.debug(`API \u2192 fetchCalldataBySwap$ (response: ${g}ms)`,{success:l.success}),l}catch(l){const g=Date.now()-s;throw i.error(`API \u2192 fetchCalldataBySwap$ (failed: ${g}ms)`,{error:l?.message||String(l)}),l}};function yLe(r){const{slippage:e,fromTokenSymbol:n,toTokenSymbol:i,requestId:s,nativeTokenSymbol:o,transferTax:a,quote:u,fromTokenAddress:l,toTokenAddress:g,extraField:y}=r,{fromTokenDecimals:A,fromBinanceChainId:I,toBinanceChainId:P,fromWalletAddress:D,toWalletAddress:U,toTokenDecimals:V,rawFromTokenAmount:J,rawToTokenAmount:re,quoteId:ce,vendor:Re,extra:De,feeDetail:Ue}=u;return{side:P9e.TO,quoteId:ce,slippage:e,vendor:Re,fromCoin:n,fromCoinAddress:Q2.getSwapContractAddress(I,l),toCoinAddress:Q2.getSwapContractAddress(P,g),fromCoinAmount:qo(Cc(J,A).toFixed()),toCoin:i,toCoinAmount:qo(Cc(re,V).toFixed()),fromNetwork:u.fromNetworkId,toNetwork:u.toNetworkId,fromBinanceChainId:I,toBinanceChainId:P,fromWalletAddress:D,toWalletAddress:U,extra:De,feeDetail:Ue,requestId:s,nativeTokenSymbol:o,transferTax:a,extraField:y}}var mLe=tn(36533).Buffer;const bLe=(r,e)=>{const{fromWalletAddress:n}=e;switch(!0){case!!r.solTransaction:return{kind:"solana",transaction:{serializedMessage:r.solTransaction.swapTransaction?mLe.from(r.solTransaction.swapTransaction,"base64"):r.solTransaction.serializedMessage,address:n}};case!!r.evmTransaction:return{kind:"evm",transaction:{to:r.evmTransaction.to,data:r.evmTransaction.data,from:n,value:qo(FSe(zi.from(r.evmTransaction.value||"0x00")))}};case("tronTransaction"in r&&!!r.tronTransaction):return{kind:"tron",transaction:{from:n,to:r.tronTransaction.to,data:r.tronTransaction.data,value:r.tronTransaction.value}};case("moveTransaction"in r&&!!r.moveTransaction):return{kind:"sui",transaction:{data:r.moveTransaction.data,sender:n}};case("eip712Transaction"in r&&!!r.eip712Transaction):return{kind:"eip712",transaction:{typedData:r.eip712Transaction.typedData}};default:throw new Error("buildTransaction: Unsupported chain")}};function vLe(r,e){const{slippage:n,quote:i,fromTokenMultiplier:s="1",toTokenMultiplier:o="1"}=e,{fromWalletAddress:a,toTokenDecimals:u,rawFromTokenAmount:l}=i,g=bLe(r,{fromWalletAddress:a}),y=P0(l),A=tv(r.toCoinAmount,u),I=rv(A,o),P=r.minReceive?tv(r.minReceive,u):cae(n,A),D=r.minReceive?rv(P,o):J1(UU(n,I));return{baseTransaction:g,fromTokenAmount:rv(y,s),rawFromTokenAmount:y,toTokenAmount:I,rawToTokenAmount:A,minReceive:D,rawMinReceive:P,quoteId:r.quoteId}}async function wLe(r,e){const n=e.item.input;ki("fetchCalldataBySwap start",n);try{const i=yLe(n),s=await gLe(r.serverAdaptor,i,{headers:{"x-w3w-request-id":n.requestId}}),o=vLe(s.data,n),a={kind:s4.FETCH_CALLDATA_BY_SWAP,output:o};return ki("fetchCalldataBySwap end \u2705",a),a}catch(i){ki("fetchCalldataBySwap error \u274C",i);const s=i instanceof Error?i.message:String(i);throw new Eo({code:fs.BUILD_TRANSACTION_ERROR,message:"build transaction error",cause:s,data:{key:"tx-err-rpc",defaultMsg:"The current network is unstable. Please check your connection and try submitting the transaction again."}})}}const ALe=async(r,e,n)=>{const i={};for(const s of n)switch(s.item.kind){case s4.FETCH_CALLDATA_BY_SWAP:i[s.txId]=await wLe(r.adaptor,s);break;default:throw new Error("Unsupported fetch calldata type")}return i},_4=qr({errorMapping:un(qr({found:Wi(),mappingDefaultMsg:sn(pt()),mappingMsg:sn(pt()),mappingCode:sn(pt())})),succeedEstimateGas:un(Wi()),estimateOriginalResult:un(sn(pt())),bep414PolicyId:un(pt())}),_Le=eS([_4,qr({l1DataFee:un(fn()),feeToken:pt(),lowGasPrice:fn(),lowFeeAmount:fn(),lowDisplayFeeAmount:fn(),feeType:pt(),feeTemplate:qu(N0.LEGACY_FEE_TEMPLATE),mediumFeeAmount:fn(),mediumDisplayFeeAmount:fn(),highGasPrice:fn(),highFeeAmount:fn(),highDisplayFeeAmount:fn(),feeAmount:fn(),gasLimit:fn(),mediumGasPrice:fn(),selectedLevel:_u(Zl),customGasPrice:fn(),customGasPriceRange:es(fn()),customGasLimit:fn(),customGasLimitRange:es(fn()),succeedEstimateGas:un(Wi())})]),ELe=eS([_4,qr({l1DataFee:un(fn()),feeToken:pt(),lowBaseFeePerGas:fn(),lowPriorityFeePerGas:fn(),lowGasPrice:fn(),lowFeeAmount:fn(),lowDisplayFeeAmount:fn(),feeType:pt(),feeTemplate:qu(N0.EIP1559_FEE_TEMPLATE),mediumFeeAmount:fn(),mediumDisplayFeeAmount:fn(),mediumBaseFeePerGas:fn(),mediumPriorityFeePerGas:fn(),mediumGasPrice:fn(),highGasPrice:fn(),highBaseFeePerGas:fn(),highPriorityFeePerGas:fn(),highFeeAmount:fn(),highDisplayFeeAmount:fn(),feeAmount:fn(),gasLimit:fn(),selectedLevel:_u(Zl),customBaseFeePerGas:fn(),customBaseFeePerGasRange:es(fn()),customPriorityFeePerGas:fn(),customPriorityFeeRange:es(fn()),customGasLimit:fn(),customGasLimitRange:es(fn()),succeedEstimateGas:un(Wi())})]),TLe=eS([_4,qr({feeType:pt(),feeAmount:fn(),feeToken:pt(),feeTemplate:qu(N0.SOLANA_FEE_TEMPLATE),baseAmount:fn(),rentAmount:fn(),computeUnitLimit:fn(),computeUnitPrice:fn(),lowComputeUnitPrice:fn(),mediumComputeUnitPrice:fn(),highComputeUnitPrice:fn(),lowTipAmount:fn(),mediumTipAmount:fn(),highTipAmount:fn(),tipAmount:fn(),lowFeeAmount:fn(),mediumFeeAmount:fn(),highFeeAmount:fn(),customFeeAmount:fn(),selectedLevel:_u(Zl),customPriorityFee:fn(),customPriorityFeeRange:es(fn())})]),SLe=eS([_4,qr({succeedEstimateGas:un(Wi()),feeLimit:fn(),feeToken:pt(),feeType:pt(),feeAmount:fn(),feeTemplate:qu(N0.SIMPLE_FEE_TEMPLATE)})]),ILe=qr({available:Wi(),balance:Ao,balanceIconUrl:pt(),balanceSymbol:pt(),balanceUsdPrice:IU,costTokenDecimals:fn(),costTokenSymbol:pt(),costTokenUsdPrice:IU,costWithdrawFee:Ao,feeInfo:ra([_Le,ELe,TLe,SLe]),name:pt(),paymentAsset:sn(pt()),reason:sn(pt()),sponsorIcon:sn(pt()),sponsorName:sn(pt()),sufficientBalance:sn(Wi()),type:pt(),uniqueKey:pt()}),kLe=qr({type:pt(),list:es(qr({binanceChainId:pt(),walletId:pt(),transaction:pt(),broadcast:Wi(),requestId:pt(),address:pt(),walletType:un(pt()),transactionConfig:un(qr({nonce:un(fn()),refreshComputeUnit:un(Wi()),"mev.protection":un(Wi())})),supportedFeeTemplates:es(SU(Object.values(N0)))}))}),Wst=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({gasAccountBatch:es(qr({gasAccountList:es(ILe)}))}),success:Wi()}),RLe=async(r,e,n)=>{const i=Kl.getGlobal(),s=Date.now();i.debug("API \u2192 fetchGasAccount$ (request)",{type:e.type,count:e.list.length});const o=Eu(kLe,e);if(!o.success){const a=new Eo({code:fs.SCHEMA_ERROR,message:"fetchGasAccount api error",cause:uu(o.issues)});throw i.error("API \u2192 fetchGasAccount$ (schema error)",{issues:uu(o.issues)}),a}try{const a=await r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/buw/gas/account/batch",data:o.output,options:n}),u=Date.now()-s;return i.debug(`API \u2192 fetchGasAccount$ (response: ${u}ms)`,{success:a.success,accountCount:a.data?.gasAccountBatch?.length}),a}catch(a){const u=Date.now()-s;throw i.error(`API \u2192 fetchGasAccount$ (failed: ${u}ms)`,{error:a?.message||String(a)}),a}};function Jae(r,e,n){const{fromBinanceChainId:i,fromWalletAddress:s,fromWalletId:o,requestId:a,walletType:u}=r,l={requestId:a||yS(),binanceChainId:i,walletId:o,address:s,transaction:e,broadcast:!0,supportedFeeTemplates:[N0.LEGACY_FEE_TEMPLATE,N0.EIP1559_FEE_TEMPLATE,N0.SOLANA_FEE_TEMPLATE,N0.SIMPLE_FEE_TEMPLATE,N0.FREE_FEE_TEMPLATE],transactionConfig:{"mev.protection":n}};return u&&(l.walletType=u),i===K2&&(l.transactionConfig={...l.transactionConfig,refreshComputeUnit:!0}),l}const CLe=r=>JSON.stringify({id:1,jsonrpc:"2.0",method:"eth_sendTransaction",params:[{from:r.from,to:r.to,value:r.value,data:r.data}]}),xLe=({transaction:r})=>JSON.stringify({id:1,jsonrpc:"2.0",method:"solana_signTransaction",params:{transaction:r}}),BLe=r=>JSON.stringify({id:1,jsonrpc:"2.0",method:"sui_signTransaction",params:{sender:r.sender,txBytes:r.data}}),OLe=async r=>{const{transaction:e}=await v4.triggerSmartContract({ownerAddress:r.from,contractAddress:r.to,data:r.data,callValue:r.value});return JSON.stringify({id:1,jsonrpc:"2.0",method:"tron_signAndSendTransaction",params:e})};var PLe=tn(36533).Buffer;async function Qae(r){switch(r.kind){case"solana":{const{serializedMessage:e}=r.transaction;return Mi(e,"serializedMessage is required"),xLe({transaction:PLe.from(e).toString("base64")})}case"evm":return CLe(r.transaction);case"tron":return OLe({...r.transaction,value:r.transaction.value??"0"});case"sui":return Mi(r.transaction.sender,"sui sender is required"),BLe({data:r.transaction.data,sender:r.transaction.sender});default:throw new Error("buildTransactionForGasAccount: Unsupported transaction kind")}}function NLe(r,e){const{transaction:n,spender:i}=r.item.input;if(!i||n.kind!=="evm")return n;const{data:s,value:o}=Xoe(i,qo(e));return{kind:"evm",transaction:{...n.transaction,data:s,value:o}}}async function MLe(r,e){const n=e.approveAmount?NLe(r,e.approveAmount):r.item.input.transaction;return Jae(r.item.input,await Qae(n),e.mev)}function LLe(r,e){const n=uS(r,e,Ti.FETCH_CALLDATA);hae(n,`${e}: ${Ti.FETCH_GAS}(${Y1.FETCH_GAS_BY_GAS_ACCOUNT_WITHOUT_TRANSACTION}) requires ${Ti.FETCH_CALLDATA}`);const i=n.output.baseTransaction;return Mi(i,`${e}: baseTransaction is required`),i}async function DLe(r,e,n){const i=LLe(r,e.txId);return Jae(e.item.input,await Qae(i),n.mev)}function ULe(r,e){const n={};return r.forEach((i,s)=>{const o=e[s]?.gasAccountList??[];n[i.txId]={kind:i.item.kind,output:o}}),n}function FLe(r){return{mev:r?.fetchGas?.mev??!1,approveAmount:r?.fetchGas?.approveAmount}}const WLe=async(r,e,n)=>{const i=FLe(r.stepParams);if(n.length===0)return{};const s=await Promise.all(n.map(async a=>{switch(a.item.kind){case Y1.FETCH_GAS_BY_GAS_ACCOUNT_WITH_TRANSACTION:return MLe(a,i);case Y1.FETCH_GAS_BY_GAS_ACCOUNT_WITHOUT_TRANSACTION:return DLe(e.outputMap,a,i);default:throw new Error("Unsupported fetch gas type")}})),o=await RLe(r.adaptor.serverAdaptor,{type:"APPROVE-WITH",list:s});return ULe(n,o.data.gasAccountBatch)},Hst=qr({fromBinanceChainId:pt(),fromWalletAddress:pt(),fromWalletId:pt(),fromTokenDecimals:fn(),fromTokenAddress:pt(),fromTokenSymbol:pt(),fromTokenAmount:_o,toTokenAddress:pt(),toTokenDecimals:fn(),toTokenSymbol:pt(),nonce:fn(),slippage:un(pt()),maxRecommendSlippage:un(pt()),gasLevel:_u(Zl),requestId:pt(),priorityFee:sn(pt()),gasPrice:sn(pt()),mev:Wi(),extra:un(Ua())}),eue=qr({tipAmount:sn(fn()),solBaseFee:sn(fn()),cuLimit:sn(fn()),maxPriorityFeePerGas:sn(fn()),cuPrice:sn(fn()),evmGasLimit:sn(fn()),maxFeePerGas:sn(fn()),gasPrice:sn(fn())}),tue=qr({type:pt(),digest:pt(),signatures:sn(pt()),txHash:sn(pt()),broadcastConfigs:pt(),unsignedTx:pt(),broadcastNodes:es(pt()),spsRequest:pt(),newEvmTx:sn(qr({from:pt(),to:pt(),data:pt(),value:fn(),nonce:fn(),gasLimit:fn(),gasPrice:fn(),maxFeePerGas:sn(fn()),maxPriorityFeePerGas:sn(fn())})),feeDetail:eue,newSolTx:sn(qr({base64Tx:pt()}))}),HLe=qr({orderId:pt(),binanceChainId:pt(),userAddress:pt(),txData:es(tue),pendingSimilarOrder:sn(qr({item:qr({binanceTxId:pt(),txType:pt(),txHash:pt(),txTime:fn(),binanceChainId:pt(),signer:pt(),address:pt(),subType:pt(),typeKey:sn(pt()),status:pt(),actionType:sn(pt()),txFee:qr({binanceChainId:pt(),feeTokenAddress:pt(),feeTokenSymbol:sn(pt()),feeValue:_o,feeTokenDecimals:sn(fn())}),from:pt(),to:pt(),isEvm:Wi(),isMev:Wi(),binancePayOrderId:sn(pt()),failReason:sn(pt()),vendorId:pt(),slippage:pt(),slippageMode:pt(),estimatedAmount:Ao,minReceive:Ao,callType:pt(),isSas:Wi(),extData:qr({deviceInfo:pt()}),errorCode:sn(pt()),errorKey:sn(pt())})}))}),zLe=qr({binanceChainId:pt(),userAddress:pt(),walletId:pt(),nonce:fn(),requestId:pt(),fromToken:pt(),fromTokenDecimals:fn(),fromTokenSymbol:pt(),toToken:pt(),toTokenDecimals:fn(),toTokenSymbol:pt(),amount:_o,slippage:un(pt()),maxRecommendSlippage:un(pt()),gasDefault:pt(),priorityFee:sn(pt()),gasPrice:sn(pt()),mevOn:Wi(),extra:un(Ua())}),$st=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:HLe,success:Wi()}),$Le=(r,e,n)=>{const{extra:i,...s}=e,o=Eu(zLe,s);if(!o.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchDigestByFlash api error",cause:uu(o.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/flash-swap/calldata",data:{...o.output,...i},options:n})},rue=(r,e)=>{switch(r){case K2:return e==="sol"||e==="So11111111111111111111111111111111111111111"?"So11111111111111111111111111111111111111112":e;default:return e}};function VLe(r){const{fromBinanceChainId:e,fromWalletAddress:n,fromWalletId:i,fromTokenAddress:s,fromTokenAmount:o,toTokenAddress:a,gasLevel:u,mev:l,...g}=r;return{...g,fromToken:rue(e,s),toToken:rue(e,a),binanceChainId:e,userAddress:n,walletId:i,amount:o,gasDefault:$9e[u],mevOn:l}}function jLe(r){return Mi(r,"fetchDigestByFlash: fetch digest failed"),{kind:yd.FETCH_DIGEST_BY_FLASH,output:r}}const KLe=async(r,e)=>{ki("fetchDigestByFlash: start",{input:e});const n=VLe(e),i=await $Le(r.serverAdaptor,n,{headers:{"x-w3w-request-id":e.requestId}}),s=jLe(i.data);return ki("fetchDigestByFlash: end \u2705",s),s},Vst=qr({enable:Wi(),tipsPayer:pt(),tipsReceiver:pt(),tipsAmount:_o}),jst=qr({wcId:pt(),transactionType:pt()}),Kst=qr({"frontend.broadcast.nodes":es(pt())}),Gst=es(qr({tag:pt(),value:pt()})),GLe=qr({"mev.protection":Wi(),refreshComputeUnit:un(Wi())}),qst=qr({quoteId:pt(),walletType:pt(),fromWalletId:pt(),fromBinanceChainId:pt(),approveAmount:un(_o),publicKeys:un(es(pt())),extra:un(Ua())}),qLe=qr({unsignedTx:pt(),digest:es(pt()),callType:pt(),txType:pt(),jsonRpc:pt(),orderId:pt(),approveAmount:un(_o)}),Zst=null,ZLe=qr({quoteId:pt(),walletType:pt(),fromWalletId:pt(),publicKeys:un(es(pt())),transactions:es(qr({approveAmount:un(_o),fee:pt(),gasAccountType:pt(),transactionConfig:GLe,txType:pt()})),extra:un(Ua())}),Yst=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({transactions:es(qLe)}),success:Wi()}),YLe=async(r,e,n)=>{const i=Kl.getGlobal(),s=Date.now();i.debug("API \u2192 fetchDigestByGasAccount$ (request)",{quoteId:e.quoteId,walletType:e.walletType,transactionsCount:e.transactions?.length});const{extra:o,...a}=e,u=Eu(ZLe,a);if(!u.success){const l=uu(u.issues);throw i.error("API \u2192 fetchDigestByGasAccount$ (schema error)",{issues:l,paramsPreview:{quoteId:a.quoteId,walletType:a.walletType,transactionsCount:a.transactions?.length}}),new Eo({code:fs.SCHEMA_ERROR,message:"fetchDigestByGasAccount api error",cause:l})}try{const l=await r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/buw/transaction/build-transaction",data:{...u.output,...o},options:n}),g=Date.now()-s;return i.debug(`API \u2192 fetchDigestByGasAccount$ (response: ${g}ms)`,{success:l.success,transactionsCount:l.data?.transactions?.length}),l}catch(l){const g=Date.now()-s;throw i.error(`API \u2192 fetchDigestByGasAccount$ (failed: ${g}ms)`,{error:l?.message||String(l)}),l}};function nue(r,e){return r[e]?.[Ti.FETCH_GAS]?.output.find(i=>i.type===g4.CURRENT_WALLET)}function XLe(r,e){return r===K2?{"mev.protection":e,refreshComputeUnit:!0}:{"mev.protection":e}}function JLe(r,e,n){const i=r[0];Mi(i,"FETCH_DIGEST_BY_GAS_ACCOUNT: batchItems is required");const{quoteId:s,walletType:o,fromWalletId:a,publicKeys:u,extra:l,approveAmount:g,fromBinanceChainId:y}=i.item.input,A=r.find(U=>U.txKind===wu.SWAP);Mi(A,"FETCH_DIGEST_BY_GAS_ACCOUNT: swap tx is required");const I=r.find(U=>U.txKind===wu.APPROVE),P=n.swapGasAccount??nue(e,A.txId);Mi(P,"FETCH_DIGEST_BY_GAS_ACCOUNT: swapGasAccount is required");const D=[{fee:JSON.stringify(P.feeInfo),gasAccountType:P.type,transactionConfig:XLe(y,n.mev),txType:wu.SWAP}];if(I){const U=n.approveGasAccount??nue(e,I.txId);Mi(U,"FETCH_DIGEST_BY_GAS_ACCOUNT: approveGasAccount is required"),D.push({approveAmount:n.approveAmount??g,fee:JSON.stringify(U.feeInfo),gasAccountType:U.type,transactionConfig:{"mev.protection":n.mev},txType:wu.APPROVE})}return{quoteId:s,walletType:o,fromWalletId:a,transactions:D,publicKeys:u,extra:l}}function QLe(r,e,n){const i={},s=r.find(u=>u.txKind===wu.SWAP);Mi(s,"FETCH_DIGEST_BY_GAS_ACCOUNT: swap tx is required");const o=e.find(u=>u.txType===wu.SWAP);Mi(o,"FETCH_DIGEST_BY_GAS_ACCOUNT: swap digest missing"),i[s.txId]={kind:yd.FETCH_DIGEST_BY_GAS_ACCOUNT,output:o};const a=r.find(u=>u.txKind===wu.APPROVE);if(a){const u=e.find(g=>g.txType===wu.APPROVE);Mi(u,"FETCH_DIGEST_BY_GAS_ACCOUNT: approve digest missing"),i[a.txId]={kind:yd.FETCH_DIGEST_BY_GAS_ACCOUNT,output:u};const l=n.approveAmount??a.item.input.approveAmount;l&&(i[a.txId]={kind:yd.FETCH_DIGEST_BY_GAS_ACCOUNT,output:{...u,approveAmount:qo(l)}})}return i}const eDe=async(r,e,n,i)=>{if(ki("fetchDigestByGasAccount: start",{batchItems:e,params:i}),e.length===0)return ki("fetchDigestByGasAccount: end (no items)"),{};const s=JLe(e,n.outputMap,i),o=await YLe(r.serverAdaptor,s);Mi(o.data,"FETCH_DIGEST_BY_GAS_ACCOUNT: fetch digest failed");const a=QLe(e,o.data.transactions,i);return ki("fetchDigestByGasAccount: end \u2705",a),a},Xst=qr({fromWalletAddress:un(pt()),fromBinanceChainId:un(pt()),nativeTokenDecimals:un(fn())}),tDe=qr({broadcastConfigs:pt(),unsignedTx:pt(),digest:pt(),newEvmTx:sn(pt()),newSolTx:qr({base64Tx:pt()}),broadcastNodes:es(pt()),spsRequest:pt(),feeAmount:fn()}),rDe=es(qr({address:pt(),binanceChainId:pt(),feeSetting:qr({level:pt(),customFeeAmount:pt()}),mode:pt(),enableSimulation:Wi(),solTx:qr({base64Tx:pt()})})),Jst=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:es(tDe),success:Wi()}),nDe=(r,e,n)=>{const i=Eu(rDe,e);if(!i.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchDigestByPreset api error",cause:uu(i.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/wallet-kit/transaction/build/batch/v2",data:i.output,options:n})};var iDe=tn(36533).Buffer;function sDe(r,e,n){const{fromWalletAddress:i,fromBinanceChainId:s,nativeTokenDecimals:o}=r,{mev:a,tipsDetail:u,gasLevel:l}=n;Mi(i,"fetchDigestByPreset: fromWalletAddress is required"),Mi(s,"fetchDigestByPreset: fromBinanceChainId is required"),Mi(o,"fetchDigestByPreset: nativeTokenDecimals is required");const g={address:i,binanceChainId:s,enableSimulation:!1,mode:a?"ANTI_MEV":"FASTEST"},y=e.calldataOutput.output.baseTransaction;switch(y.kind){case"evm":throw new Error("fetchDigestByPreset: Unsupported chain");case"solana":{let A=n.customFeeAmount;if(!A){Mi(e.gasOutput,"fetchDigestByPreset: gasOutput is required");const P=e.gasOutput.output.find(D=>D.type===g4.CURRENT_WALLET);Mi(P,"gasOutput is required"),A=P.feeInfo.feeAmount.toString()}if(a){Mi(u,"fetchDigestByPreset: tipsDetail is required"),Mi(l,"fetchDigestByPreset: gasLevel is required");const P=Cc(u.amount[p4[l]],o).toFixed(0);A=km(A).plus(P).toFixed(0)}const I=y.transaction.serializedMessage?iDe.from(y.transaction.serializedMessage).toString("base64"):"";return[{...g,feeSetting:{level:"CUSTOM",customFeeAmount:A},solTx:{base64Tx:I}}]}default:throw new Error("fetchDigestByPreset: Unsupported chain")}}function oDe(r){const e=r[0];return Mi(e,"fetchDigestByPreset: fetch digest failed"),{kind:yd.FETCH_DIGEST_BY_PRESET,output:e}}const aDe=async(r,e,n,i)=>{ki("fetchDigestByPreset: start",{input:e,dependencies:n,params:i});const s=sDe(e,n,i),o=await nDe(r.serverAdaptor,s),a=oDe(o.data);return ki("fetchDigestByPreset end \u2705",a),a};function uDe(r,e){const n=r[e]?.[Ti.FETCH_CALLDATA],i=r[e]?.[Ti.FETCH_GAS];return Mi(n,`${e}: ${yd.FETCH_DIGEST_BY_PRESET} requires ${Ti.FETCH_CALLDATA}`),{calldataOutput:n,gasOutput:i}}function iue(r){return r.item.step===Ti.FETCH_DIGEST&&r.item.kind===yd.FETCH_DIGEST_BY_GAS_ACCOUNT}function cDe(r){return r?.fetchDigest??{mev:!1}}const lDe=async(r,e,n)=>{const i={},s=cDe(r.stepParams);if(n.length===0)return i;const o=n.filter(iue);o.length>0&&Object.assign(i,await eDe(r.adaptor,o,{outputMap:e.outputMap},s));for(const a of n)if(!iue(a))switch(a.item.kind){case yd.FETCH_DIGEST_BY_PRESET:i[a.txId]=await aDe(r.adaptor,a.item.input,uDe(e.outputMap,a.txId),s);break;case yd.FETCH_DIGEST_BY_FLASH:i[a.txId]=await KLe(r.adaptor,a.item.input);break;default:throw new Error("Unsupported fetch digest type")}return i},fDe={[Ti.FETCH_CALLDATA]:ALe,[Ti.FETCH_GAS]:WLe,[Ti.FETCH_DIGEST]:lDe};class sue{constructor(e,n,i){this.steps=new Map,this.phaseStartTime=Date.now(),this.traceId=e,this.phase=n,this.scenario=i}makeKey(e,n){return`${e}:${n}`}startStep(e,n,i){const s=this.makeKey(e,n);this.steps.set(s,{phase:this.phase,txId:e,step:n,kind:i,status:"running",startTime:Date.now()})}completeStep(e,n,i){const s=this.makeKey(e,n),o=this.steps.get(s);o&&(o.status="success",o.endTime=Date.now(),o.duration=o.endTime-(o.startTime||0),i&&(o.output=i))}failStep(e,n,i){const s=this.makeKey(e,n),o=this.steps.get(s);if(!o){this.steps.set(s,{phase:this.phase,txId:e,step:n,kind:"unknown",status:"failed",startTime:Date.now(),endTime:Date.now(),duration:0,error:i});return}o.status="failed",o.endTime=Date.now(),o.duration=o.endTime-(o.startTime||0),o.error=i}skipStep(e,n,i){const s=this.makeKey(e,n);this.steps.set(s,{phase:this.phase,txId:e,step:n,kind:i||"skipped",status:"skipped"})}getSteps(){return Array.from(this.steps.values())}getStep(e,n){const i=this.makeKey(e,n);return this.steps.get(i)}hasFailed(){return this.getSteps().some(e=>e.status==="failed")}getFailedSteps(){return this.getSteps().filter(e=>e.status==="failed")}getSuccessSteps(){return this.getSteps().filter(e=>e.status==="success")}getSummary(){const e=Date.now(),n=this.getSteps();return{traceId:this.traceId,phase:this.phase,scenario:this.scenario,status:this.hasFailed()?"failed":"success",totalDuration:e-this.phaseStartTime,startTime:this.phaseStartTime,endTime:e,steps:n,error:this.getFailedSteps()[0]?.error}}getStepsByTx(){const e=new Map;for(const n of this.getSteps())e.has(n.txId)||e.set(n.txId,[]),e.get(n.txId).push(n);return e}}class rA{static formatStartSummary(e,n,i,s){const o=[];if(o.push("\u2554"+"\u2550".repeat(70)+"\u2557"),o.push("\u2551 \u{1F680} "+this.pad(`DexSDK ${n} Phase Start`,65)+"\u2551"),o.push("\u255F"+"\u2500".repeat(70)+"\u2562"),o.push("\u2551 "+this.pad(`TraceId: ${e}`,67)+"\u2551"),i&&o.push("\u2551 "+this.pad(`Scenario: ${i}`,67)+"\u2551"),o.push("\u2551 "+this.pad(`Time: ${new Date().toLocaleString()}`,67)+"\u2551"),s.length>0){o.push("\u255F"+"\u2500".repeat(70)+"\u2562"),o.push("\u2551 "+this.pad("\u{1F4CB} Plan Overview:",67)+"\u2551");for(const u of s){const l=u.steps.map(A=>`${A.step}[${A.kind}]`).join(" \u2192 "),g=`\u2022 [${u.txId}] \u2192 ${l}`;this.wrapText(g,65).forEach((A,I)=>{const P=I===0?"\u2551 ":"\u2551 ";o.push(P+this.pad(A,70-(I===0?5:7))+"\u2551")})}}return o.push("\u255A"+"\u2550".repeat(70)+"\u255D"),o.join(`
|
||
`)}static formatFinalSummary(e){const n=[],s=e.status==="success",o=s?"\u2705":"\u274C",a=s?"SUCCESS":"FAILED";n.push("\u2554"+"\u2550".repeat(70)+"\u2557"),n.push("\u2551 "+o+" "+this.pad(`DexSDK ${e.phase} - ${a}`,65)+"\u2551"),n.push("\u255F"+"\u2500".repeat(70)+"\u2562");const u=this.formatDuration(e.totalDuration),l=e.steps.filter(A=>A.status==="success").length,g=e.steps.filter(A=>A.status!=="skipped").length;n.push("\u2551 "+this.pad(`TraceId: ${e.traceId} Duration: ${u} Completed: ${l}/${g}`,67)+"\u2551"),n.push("\u255F"+"\u2500".repeat(70)+"\u2562"),n.push("\u2551 "+this.pad("\u{1F4CA} Execution Timeline:",67)+"\u2551"),n.push("\u2551 "+this.pad("",67)+"\u2551");const y=this.groupStepsByTx(e.steps);for(const[A,I]of y.entries()){n.push("\u2551 "+this.pad(`[${A}]`,67)+"\u2551");for(const P of I){const D=this.getStatusIcon(P.status),U=P.duration?`${P.duration}ms`:"-",V=this.createProgressBar(P,12),J=P.status==="failed"?"\u26A0\uFE0F FAILED":"",re=P.kind?`[${P.kind}]`:"",ce=` ${D} ${this.padEnd(P.step,20)} ${this.padEnd(U,8)} ${V} ${re} ${J}`;n.push("\u2551 "+this.pad(ce,67)+"\u2551")}n.push("\u2551 "+this.pad("",67)+"\u2551")}if(!s&&e.error){n.push("\u255F"+"\u2500".repeat(70)+"\u2562"),n.push("\u2551 "+this.pad("\u26A0\uFE0F Error Details:",67)+"\u2551");const A=e.steps.find(I=>I.status==="failed");if(A&&(n.push("\u2551 "+this.pad(`Step: ${A.step} (${A.kind})`,65)+"\u2551"),n.push("\u2551 "+this.pad(`TxId: ${A.txId}`,65)+"\u2551")),e.error.code&&n.push("\u2551 "+this.pad(`Code: ${e.error.code}`,65)+"\u2551"),e.error.message){const I=this.truncate(e.error.message,50);n.push("\u2551 "+this.pad(`Message: ${I}`,65)+"\u2551")}n.push("\u2551 "+this.pad("",67)+"\u2551"),n.push("\u2551 "+this.pad("\u{1F4A1} Debug Tips:",67)+"\u2551"),n.push("\u2551 "+this.pad('\u2022 Set logLevel to "debug" to see API details',65)+"\u2551"),n.push("\u2551 "+this.pad("\u2022 Check the failed step error above",65)+"\u2551")}return s&&(n.push("\u255F"+"\u2500".repeat(70)+"\u2562"),n.push("\u2551 "+this.pad("\u{1F4E6} Output Summary:",67)+"\u2551"),n.push("\u2551 "+this.pad(`\u2022 ${l} transactions processed successfully`,65)+"\u2551"),n.push("\u2551 "+this.pad("\u2022 Ready for next phase",65)+"\u2551")),n.push("\u255A"+"\u2550".repeat(70)+"\u255D"),n.join(`
|
||
`)}static formatExecutionTree(e){const n=[],i=this.groupStepsByTx(e.steps);n.push(`
|
||
${e.scenario||""} ${e.phase} Flow [TraceId: ${e.traceId.slice(0,8)}]`);let s=0;const o=i.size;for(const[a,u]of i.entries()){s++;const l=s===o,g=l?"\u2514\u2500":"\u251C\u2500";n.push(`${g} [${a}]`),u.forEach((y,A)=>{const I=A===u.length-1,P=l?" ":"\u2502 ",D=I?"\u2514\u2500":"\u251C\u2500",U=this.getStatusIcon(y.status),V=y.duration?` (${y.duration}ms)`:"",J=y.kind?` [${y.kind}]`:"";n.push(`${P}${D} ${U} ${y.step}${J}${V}`)})}return n.join(`
|
||
`)}static getStatusIcon(e){switch(e){case"success":return"\u2705";case"failed":return"\u274C";case"running":return"\u{1F504}";case"skipped":return"\u23ED\uFE0F";default:return"\u23F8\uFE0F"}}static createProgressBar(e,n){if(e.status==="skipped")return"\u2502"+"\u2591".repeat(n)+"\u2502";if(e.status==="failed"){const i=Math.floor(n*.4);return"\u2502"+"\u2588".repeat(i)+"\u2591".repeat(n-i)+"\u2502"}return e.status==="success"?"\u2502"+"\u2588".repeat(n)+"\u2502":"\u2502"+"\u2588".repeat(n/2)+"\u2591".repeat(n/2)+"\u2502"}static formatDuration(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}static pad(e,n){return e.length>=n?e.slice(0,n):e+" ".repeat(n-e.length)}static padEnd(e,n){return e.length>=n?e.slice(0,n):e+" ".repeat(n-e.length)}static truncate(e,n){return e.length<=n?e:e.slice(0,n-3)+"..."}static wrapText(e,n){if(e.length<=n)return[e];const i=[];let s=e;for(;s.length>0;){if(s.length<=n){i.push(s);break}let o=n;const a=s.lastIndexOf(" \u2192 ",n);a>n*.5&&(o=a+3),i.push(s.slice(0,o)),s=s.slice(o).trim()}return i}static groupStepsByTx(e){const n=new Map;for(const i of e)n.has(i.txId)||n.set(i.txId,[]),n.get(i.txId).push(i);return n}}function dDe(r){if(r.length===0)return;const e=String(r[0].txId);if(e.includes("#"))return"Extension";if(e==="FLASH_SWAP")return"Flash";if(e==="INTENT_SWAP")return"Intent";if(e==="APPROVE"||e==="SWAP")return"ProMarket"}const hDe=[Ti.FETCH_CALLDATA,Ti.FETCH_GAS,Ti.FETCH_DIGEST];function pDe(r,e){return!!e?.includes(r)}async function gDe(r,e,n,i){const s=yS(),o=dDe(n),a=Kl.create({traceId:s,phase:"Build",scenario:o}),u=new sue(s,"Build",o),l=n.map(P=>({txId:P.txId,steps:P.steps.map(D=>({step:D.step,kind:D.kind}))})),g=rA.formatStartSummary(s,"Build",o,l);a.summary(g);const y={...i?.initialOutputMap},A={planList:n,outputMap:y};async function I(P){var D,U;const V=re=>i?.runSteps?pDe(P,i.runSteps):y?.[re]?.[P]==null,J=[];for(const re of n){y[D=re.txId]??(y[D]={}),(U=y[re.txId]).kind??(U.kind=re.kind);const ce=re.steps.find(Re=>Re.step===P);if(ce){if(!V(re.txId)){u.skipStep(re.txId,P,"already completed");continue}J.push({txId:re.txId,txKind:re.kind,item:ce}),u.startStep(re.txId,P,ce.kind),a.debug(`[${re.txId}] ${P} \u2192 start`,{kind:ce.kind})}}if(J.length!==0)try{const re=e[P],ce=await re(r,A,J);for(const[Re,De]of Object.entries(ce))y[Re]??(y[Re]={}),y[Re][P]=De,u.completeStep(Re,P,De),a.info(`[${Re}] ${P} \u2192 \u2705 success`)}catch(re){for(const ce of J)u.failStep(ce.txId,P,re),a.error(`[${ce.txId}] ${P} \u2192 \u274C failed`,{error:re?.message||String(re),code:re?.code});throw re}}try{for(const U of hDe)await I(U);const P=u.getSummary(),D=rA.formatFinalSummary(P);a.summary(D)}catch(P){const D=u.getSummary(),U=rA.formatFinalSummary(D);throw a.summary(U),P}return{outputMap:y}}function yDe(r){return{kind:ZT.FETCH_ORDER_ID_BY_LOCAL,output:{orderId:r.orderId}}}const Qst=qr({}),eot=qr({orderId:pt()}),mDe=es(qr({requestId:pt(),source:pt()})),tot=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:sn(tS(pt(),pt())),success:Wi()}),bDe=(r,e,n)=>{const i=Eu(mDe,e);if(!i.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchOrderIdByServer api error",cause:uu(i.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/aggregator/batch-tx-id",data:i.output,options:n})};function vDe(r){return r.map(({requestId:e})=>({requestId:e,source:"client"}))}function wDe(r,e){const n={};for(const i of r){const s=e[i.requestId];Mi(s,`fetchOrderIdByServer: missing orderId for requestId=${i.requestId}`),n[i.txId]={kind:ZT.FETCH_ORDER_ID_BY_SERVER,output:{orderId:s}}}return n}async function ADe(r,e){if(ki("fetchOrderIdByServer: start",{size:e.length}),e.length===0)return{};const n=vDe(e),i=await bDe(r.serverAdaptor,n);Mi(i.data,"fetchOrderIdByServer: generate server order id failed");const s=wDe(e,i.data);return ki("fetchOrderIdByServer: end \u2705",{size:e.length}),s}const _De=async(r,e,n)=>{const i={},s=[];for(const o of n){const{txId:a,item:u}=o;switch(u.kind){case ZT.FETCH_ORDER_ID_BY_LOCAL:{i[a]=yDe(u.input);break}case ZT.FETCH_ORDER_ID_BY_SERVER:{s.push({txId:a,requestId:yS()});break}default:throw new Error("handleFetchOrderId: Unsupported kind")}}return s.length>0&&Object.assign(i,await ADe(r.adaptor,s)),i};var Cm;(function(r){r.ECDSA="ecdsa",r.ED25519="ed25519",r.SCHNORR="schnorr"})(Cm||(Cm={}));var nA;(function(r){r.SIGN_DIRECT="signDirect"})(nA||(nA={}));const rot=null,EDe={[K2]:Cm.ED25519,[BU]:Cm.ECDSA,[xU]:Cm.ECDSA,[_9e]:Cm.ED25519};function oue(r){return EDe[r]??Cm.ECDSA}async function TDe(r,e,n){try{ki("signByDigest: start",{input:e,signParams:n});const{binanceChainId:i,userAddress:s,digest:o,extra:a}=e,{totalSignTimes:u,currentSignTime:l,signToken:g}=n,y=await r.walletAdaptor.sign({method:nA.SIGN_DIRECT,params:{walletAddress:s,binanceChainId:i,signCurve:oue(i),data:o,extra:{...typeof a=="object"&&a?a:{},totalSignTimes:u,currentSignTime:l,signToken:g||"",messageForRisk:{network:i}}}});if(y.result.length===0||!y.result[0])throw new Error("sign result is empty");return ki("signByDigest: end",{signResult:y}),{kind:q1.SIGN_BY_DIGEST,output:{signResult:y.result,nextSignToken:y.token}}}catch(i){const s=i instanceof Error?i.message:String(i);throw ki("signByDigest: error \u274C",{error:i}),new Eo({code:fs.SIGN_ERROR,message:s,cause:s})}}const SDe="hash/5.4.0";var IDe=function(r,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(y){try{g(i.next(y))}catch(A){a(A)}}function l(y){try{g(i.throw(y))}catch(A){a(A)}}function g(y){y.done?o(y.value):s(y.value).then(u,l)}g((i=i.apply(r,e||[])).next())})};const pa=new Yn(SDe),aue=new Uint8Array(32);aue.fill(0);const kDe=zi.from(-1),uue=zi.from(0),cue=zi.from(1),RDe=zi.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function CDe(r){const e=fo(r),n=e.length%32;return n?T1([e,aue.slice(n)]):ks(e)}const xDe=Xp(cue.toHexString(),32),BDe=Xp(uue.toHexString(),32),lue={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},eF=["name","version","chainId","verifyingContract","salt"];function fue(r){return function(e){return typeof e!="string"&&pa.throwArgumentError(`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}const ODe={name:fue("name"),version:fue("version"),chainId:function(r){try{return zi.from(r).toString()}catch{}return pa.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",r)},verifyingContract:function(r){try{return Gu(r).toLowerCase()}catch{}return pa.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){try{const e=fo(r);if(e.length!==32)throw new Error("bad length");return ks(e)}catch{}return pa.throwArgumentError('invalid domain value "salt"',"domain.salt",r)}};function tF(r){{const e=r.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",i=parseInt(e[2]||"256");(i%8!==0||i>256||e[2]&&e[2]!==String(i))&&pa.throwArgumentError("invalid numeric width","type",r);const s=RDe.mask(n?i-1:i),o=n?s.add(cue).mul(kDe):uue;return function(a){const u=zi.from(a);return(u.lt(o)||u.gt(s))&&pa.throwArgumentError(`value out-of-bounds for ${r}`,"value",a),Xp(u.toTwos(256).toHexString(),32)}}}{const e=r.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return(n===0||n>32||e[1]!==String(n))&&pa.throwArgumentError("invalid bytes width","type",r),function(i){return fo(i).length!==n&&pa.throwArgumentError(`invalid length for ${r}`,"value",i),CDe(i)}}}switch(r){case"address":return function(e){return Xp(Gu(e),32)};case"bool":return function(e){return e?xDe:BDe};case"bytes":return function(e){return Qp(e)};case"string":return function(e){return E2(e)}}return null}function due(r,e){return`${r}(${e.map(({name:n,type:i})=>i+" "+n).join(",")})`}class _d{constructor(e){bi(this,"types",Object.freeze(_2(e))),bi(this,"_encoderCache",{}),bi(this,"_types",{});const n={},i={},s={};Object.keys(e).forEach(u=>{n[u]={},i[u]=[],s[u]={}});for(const u in e){const l={};e[u].forEach(g=>{l[g.name]&&pa.throwArgumentError(`duplicate variable name ${JSON.stringify(g.name)} in ${JSON.stringify(u)}`,"types",e),l[g.name]=!0;const y=g.type.match(/^([^\x5b]*)(\x5b|$)/)[1];y===u&&pa.throwArgumentError(`circular type reference to ${JSON.stringify(y)}`,"types",e),!tF(y)&&(i[y]||pa.throwArgumentError(`unknown type ${JSON.stringify(y)}`,"types",e),i[y].push(u),n[u][y]=!0)})}const o=Object.keys(i).filter(u=>i[u].length===0);o.length===0?pa.throwArgumentError("missing primary type","types",e):o.length>1&&pa.throwArgumentError(`ambiguous primary types or unused types: ${o.map(u=>JSON.stringify(u)).join(", ")}`,"types",e),bi(this,"primaryType",o[0]);function a(u,l){l[u]&&pa.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),l[u]=!0,Object.keys(n[u]).forEach(g=>{i[g]&&(a(g,l),Object.keys(l).forEach(y=>{s[y][g]=!0}))}),delete l[u]}a(this.primaryType,{});for(const u in s){const l=Object.keys(s[u]);l.sort(),this._types[u]=due(u,e[u])+l.map(g=>due(g,e[g])).join("")}}getEncoder(e){let n=this._encoderCache[e];return n||(n=this._encoderCache[e]=this._getEncoder(e)),n}_getEncoder(e){{const s=tF(e);if(s)return s}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const s=n[1],o=this.getEncoder(s),a=parseInt(n[3]);return u=>{a>=0&&u.length!==a&&pa.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",u);let l=u.map(o);return this._types[s]&&(l=l.map(Qp)),Qp(T1(l))}}const i=this.types[e];if(i){const s=E2(this._types[e]);return o=>{const a=i.map(({name:u,type:l})=>{const g=this.getEncoder(l)(o[u]);return this._types[l]?Qp(g):g});return a.unshift(s),T1(a)}}return pa.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const n=this._types[e];return n||pa.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Qp(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,i){if(tF(e))return i(e,n);const s=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(s){const a=s[1],u=parseInt(s[3]);return u>=0&&n.length!==u&&pa.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",n),n.map(l=>this._visit(a,l,i))}const o=this.types[e];return o?o.reduce((a,{name:u,type:l})=>(a[u]=this._visit(l,n[u],i),a),{}):pa.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new _d(e)}static getPrimaryType(e){return _d.from(e).primaryType}static hashStruct(e,n,i){return _d.from(n).hashStruct(e,i)}static hashDomain(e){const n=[];for(const i in e){const s=lue[i];s||pa.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(i)}`,"domain",e),n.push({name:i,type:s})}return n.sort((i,s)=>eF.indexOf(i.name)-eF.indexOf(s.name)),_d.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,i){return T1(["0x1901",_d.hashDomain(e),_d.from(n).hash(i)])}static hash(e,n,i){return Qp(_d.encode(e,n,i))}static resolveNames(e,n,i,s){return IDe(this,void 0,void 0,function*(){e=S1(e);const o={};e.verifyingContract&&!Qo(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const a=_d.from(n);a.visit(i,(u,l)=>(u==="address"&&!Qo(l,20)&&(o[l]="0x"),l));for(const u in o)o[u]=yield s(u);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),i=a.visit(i,(u,l)=>u==="address"&&o[l]?o[l]:l),{domain:e,value:i}})}static getPayload(e,n,i){_d.hashDomain(e);const s={},o=[];eF.forEach(l=>{const g=e[l];g!=null&&(s[l]=ODe[l](g),o.push({name:l,type:lue[l]}))});const a=_d.from(n),u=S1(n);return u.EIP712Domain?pa.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",n):u.EIP712Domain=o,a.encode(i),{types:u,domain:s,primaryType:a.primaryType,message:a.visit(i,(l,g)=>{if(l.match(/^bytes(\d*)/))return ks(fo(g));if(l.match(/^u?int/))return zi.from(g).toString();switch(l){case"address":return g.toLowerCase();case"bool":return!!g;case"string":return typeof g!="string"&&pa.throwArgumentError("invalid string","value",g),g}return pa.throwArgumentError("unsupported type","type",l)})}}}const hue=r=>r.startsWith("0x")?r:`0x${r}`;async function PDe(r,e,n){const{typedData:i,fromBinanceChainId:s,fromWalletAddress:o}=e,{totalSignTimes:a,currentSignTime:u,signToken:l}=n,{domain:g,types:y,message:A,values:I}=JSON.parse(i),P=A??I;if(!P)throw new Error("signByEip712: typedData must contain message or values");const D=Object.keys(y).filter(J=>J!=="EIP712Domain").reduce((J,re)=>(J[re]=y[re],J),{}),U=_d.encode(g,D,P),V=await r.sign({method:nA.SIGN_DIRECT,params:{walletAddress:o,binanceChainId:s,signCurve:oue(s),data:nT(U),extra:{totalSignTimes:a,currentSignTime:u,signToken:l||"",messageForRisk:{network:s}}}});if(V.result.length===0||!V.result[0])throw new Error("signByEip712: sign result is empty");return{kind:q1.SIGN_BY_EIP_712,output:{signResult:[hue(V.result[0])],nextSignToken:V.token}}}function NDe(r){return r==null}const pue=NDe,MDe=async(r,e,n)=>{const{data:i}=await Gae(r.serverAdaptor,{binanceChainId:e,address:n});if(!i||pue(i.pendingNonce))throw new Eo({code:fs.PENDING_NONCE_CHECK_ERROR,message:"pending nonce check error"});return i.pendingNonce+1};async function LDe(r,e,n){const{fromBinanceChainId:i,fromWalletAddress:s,transaction:o}=e,{totalSignTimes:a,currentSignTime:u,signToken:l}=n;let g=n.nonce;pue(g)&&(g=await MDe(r,i,s));const y={...o.transaction,nonce:g},A=await r.walletAdaptor.sign({method:nA.SIGN_DIRECT,params:{walletAddress:s,binanceChainId:i,signCurve:Cm.ECDSA,data:nT(ate(y)),extra:{totalSignTimes:a,currentSignTime:u,signToken:l||"",messageForRisk:{network:i}}}});if(A.result.length===0||!A.result[0])throw new Error("signEVMTransaction: sign result is empty");return{signResult:A.result,nextSignToken:A.token,nonce:g,signableTransaction:{kind:"evm",transaction:y}}}async function DDe(r,e,n){const{fromBinanceChainId:i,fromWalletAddress:s,transaction:o}=e;switch(o.kind){case"evm":{const a=await LDe(r,{fromBinanceChainId:i,fromWalletAddress:s,transaction:o},n);return{kind:q1.SIGN_BY_TRANSACTION,output:a}}default:throw new Error(`signByTransaction: Unsupported transaction kind: ${String(o.kind)}`)}}function UDe(r,e){return{totalSignTimes:r,currentSignTime:1,nextNonce:e}}function FDe(r){return{totalSignTimes:r.totalSignTimes,currentSignTime:r.currentSignTime,signToken:r.nextSignToken,nonce:r.nextNonce}}function WDe(r,e){typeof e.nonce=="number"&&(r.nextNonce=e.nonce+1),e.nextSignToken&&(r.nextSignToken=e.nextSignToken),r.currentSignTime+=1}const HDe=async(r,e,n)=>{const i={};if(n.length===0)return i;const s=UDe(n.length,r.stepParams?.sign?.nonce);for(const o of n){const a=FDe(s),u=o.item.kind;let l;switch(u){case q1.SIGN_BY_DIGEST:l=await TDe(r.adaptor,o.item.input,a);break;case q1.SIGN_BY_TRANSACTION:l=await DDe(r.adaptor,o.item.input,a);break;case q1.SIGN_BY_EIP_712:l=await PDe(r.adaptor.walletAdaptor,o.item.input,a);break;default:throw new Error(`handleSign: Unsupported kind: ${String(u)}`)}WDe(s,l.output),i[o.txId]=l}return i},not=qr({quoteId:pt(),gasAccount:qr({type:pt()}),mev:Wi(),publicKeys:es(pt()),unsignedTx:pt(),txType:pt()}),iot=qr({signedTransaction:pt(),txHash:pt()}),zDe=qr({quoteId:pt(),transactions:es(qr({publicKeys:es(pt()),transactionConfig:tS(pt(),Ua()),gasAccountType:pt(),signatures:es(pt()),txType:pt(),unsignedTx:pt()})),extra:un(Ua())}),sot=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:qr({signs:es(qr({signedTransaction:pt(),txHash:pt()}))}),success:Wi()}),$De=(r,e,n)=>{const{extra:i,...s}=e,o=Eu(zDe,s);if(!o.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchCompileTransaction api error",cause:uu(o.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/buw/transaction/compile-with-signatures",data:o.output,options:n})},oot=null;function VDe(r,e){const n=r[e]?.[Ti.SIGN]?.output?.signResult;return Mi(n,`compileTransaction: signResult is required for ${e}`),n}function jDe(r,e){const n=r[0];Mi(n,"compileTransaction: batchItems is required");const i=n.item.input.quoteId;return Mi(i,"compileTransaction: quoteId is required"),{quoteId:i,transactions:r.map(({txId:s,item:o})=>({publicKeys:o.input.publicKeys,transactionConfig:{"mev.protection":o.input.mev},gasAccountType:o.input.gasAccount.type,signatures:VDe(e,s),txType:o.input.txType,unsignedTx:o.input.unsignedTx}))}}function KDe(r,e){if(e.length!==r.length)throw new Eo({code:fs.UNKNOWN_ERROR,message:`compileTransaction: signs length mismatch, req=${r.length}, res=${e.length}`});const n={};for(let i=0;i<r.length;i+=1){const s=r[i],o=e[i];!s||!o||(n[s.txId]={kind:H2.COMPILE_TRANSACTION,output:{signedTransaction:o.signedTransaction,txHash:o.txHash}})}return n}async function GDe(r,e,n){if(ki("compileTransaction: start",{size:e.length}),e.length===0)return{};const i=jDe(e,n.outputMap),o=(await $De(r.serverAdaptor,i)).data;if(!o)throw ki("compileTransaction: failed \u274C"),new Eo({code:fs.UNKNOWN_ERROR,message:"compileTransaction failed"});const a=KDe(e,o.signs??[]);return ki("compileTransaction: end \u2705",{size:e.length}),a}function gue(r){return r.item.kind===H2.COMPILE_TRANSACTION}var aot=1,uot=2,cot=3,lot=4,fot=5,dot=6,hot=7,pot=8,got=9,qDe=10,ZDe=null,YDe=null,XDe=null,JDe=null,QDe=null,yot=null,mot=null,bot=null,vot=null,eUe=null,tUe=null,wot=null,rUe=null,Aot=null,nUe=null,iUe=null,_ot=null,sUe=null,oUe=null,Eot=null,aUe=null,Tot=null,yue=null,uUe=null,Sot=28e5,Iot=2800001,kot=2800002,Rot=2800003,Cot=2800004,xot=2800005,Bot=2800006,Oot=2800007,Pot=2800008,Not=2800009,Mot=2800010,Lot=2800011,Dot=323e4,Uot=32300001,Fot=3230002,Wot=3230003,Hot=3230004,zot=361e4,$ot=3610001,Vot=3610002,jot=3610003,Kot=3610004,Got=3610005,qot=3610006,Zot=3610007,Yot=3611e3,Xot=3704e3,Jot=3704001,Qot=3704002,eat=3704003,tat=3704004,rat=4128e3,nat=4128001,iat=4128002,cUe=4615e3,sat=4615001,oat=4615002,aat=4615003,uat=4615004,cat=4615005,lat=4615006,fat=4615007,dat=4615008,hat=4615009,pat=4615010,gat=4615011,yat=4615012,mat=4615013,bat=4615014,vat=4615015,wat=4615016,Aat=4615017,_at=4615018,Eat=4615019,Tat=4615020,Sat=4615021,Iat=4615022,kat=4615023,Rat=4615024,Cat=4615025,lUe=4615026,xat=4615027,Bat=4615028,Oat=4615029,Pat=4615030,Nat=4615031,Mat=4615032,Lat=4615033,Dat=4615034,Uat=4615035,Fat=4615036,Wat=4615037,Hat=4615038,zat=4615039,$at=4615040,Vat=4615041,jat=4615042,Kat=4615043,Gat=4615044,qat=4615045,Zat=4615046,Yat=4615047,Xat=4615048,Jat=4615049,Qat=4615050,eut=4615051,tut=4615052,rut=4615053,nut=4615054,iut=5508e3,sut=5508001,out=5508002,aut=5508003,uut=5508004,cut=5508005,lut=5508006,fut=5508007,dut=5508008,hut=5508009,put=5508010,gut=5508011,yut=5607e3,mut=5607001,but=5607002,vut=5607003,wut=5607004,Aut=5607005,_ut=5607006,Eut=5607007,Tut=5607008,Sut=5607009,Iut=5607010,kut=5607011,Rut=5607012,Cut=5607013,xut=5607014,But=5607015,Out=5607016,Put=5607017,Nut=5663e3,Mut=5663001,Lut=5663002,Dut=5663003,Uut=5663004,Fut=5663005,Wut=5663006,Hut=5663007,zut=5663008,$ut=5663009,Vut=5663010,jut=5663011,Kut=5663012,Gut=5663013,qut=5663014,Zut=5663015,fUe=5663016,dUe=5663017,Yut=5663018,Xut=5663019,Jut=5663020,hUe=5663021,Qut=5663022,pUe=705e4,ect=7050001,tct=7050002,rct=7050003,nct=7050004,ict=7050005,sct=7050006,oct=7050007,act=7050008,uct=7050009,cct=7050010,lct=7050011,fct=7050012,dct=7050013,hct=7050014,pct=7050015,gct=7050016,yct=7050017,mct=7050018,bct=7050019,vct=7050020,wct=7050021,Act=7050022,_ct=7050023,Ect=7050024,Tct=7050025,Sct=7050026,Ict=7050027,kct=7050028,Rct=7050029,gUe=7050030,yUe=7050031,Cct=7050032,xct=7050033,Bct=7050034,mUe=7050035,Oct=7050036,Pct=7618e3,Nct=7618001,Mct=7618002,Lct=7618003,bUe=8078e3,vUe=8078001,Dct=8078002,Uct=8078003,Fct=8078004,Wct=8078005,Hct=8078006,wUe=8078007,zct=8078008,$ct=8078009,Vct=8078010,AUe=8078011,mue=8078012,_Ue=8078013,EUe=8078014,jct=8078015,Kct=8078016,Gct=8078017,qct=8078018,Zct=8078019,Yct=8078020,Xct=8078021,Jct=8078022,Qct=8078023,elt=81e5,tlt=8100001,rlt=8100002,nlt=8100003,ilt=819e4,slt=8190001,olt=8190002,alt=8190003,ult=8190004,clt=99e5,llt=9900001,flt=9900002,dlt=9900003,hlt=9900004,plt=9900005,glt=9900006;function bue(r){return Array.isArray(r)?"%5B"+r.map(bue).join("%2C%20")+"%5D":typeof r=="bigint"?`${r}n`:encodeURIComponent(String(r!=null&&Object.getPrototypeOf(r)===null?{...r}:r))}function TUe([r,e]){return`${r}=${bue(e)}`}function SUe(r){const e=Object.entries(r).map(TUe).join("&");return btoa(e)}var IUe=null,Ag="i",M0="t";function ylt(r,e={}){const n=IUe[r];if(n.length===0)return"";let i;function s(a){if(i[M0]===2){const u=n.slice(i[Ag]+1,a);o.push(u in e?`${e[u]}`:`$${u}`)}else i[M0]===1&&o.push(n.slice(i[Ag],a))}const o=[];return n.split("").forEach((a,u)=>{if(u===0){i={[Ag]:0,[M0]:n[0]==="\\"?0:n[0]==="$"?2:1};return}let l;switch(i[M0]){case 0:l={[Ag]:u,[M0]:1};break;case 1:a==="\\"?l={[Ag]:u,[M0]:0}:a==="$"&&(l={[Ag]:u,[M0]:2});break;case 2:a==="\\"?l={[Ag]:u,[M0]:0}:a==="$"?l={[Ag]:u,[M0]:2}:a.match(/\w/)||(l={[Ag]:u,[M0]:1});break}l&&(i!==l&&s(u),i=l)}),s(),o.join("")}function kUe(r,e={}){{let n=`Solana error #${r}; Decode this error by running \`npx @solana/errors decode -- ${r}`;return Object.keys(e).length&&(n+=` '${SUe(e)}'`),`${n}\``}}function mlt(r,e){return r instanceof Error&&r.name==="SolanaError"?e!==void 0?r.context.__code===e:!0:!1}var al=class extends Error{cause=this.cause;context;constructor(...[r,e]){let n,i;e&&Object.entries(Object.getOwnPropertyDescriptors(e)).forEach(([o,a])=>{o==="cause"?i={cause:a.value}:(n===void 0&&(n={__code:r}),Object.defineProperty(n,o,a))});const s=kUe(r,n);super(s,i),this.context=Object.freeze(n===void 0?{__code:r}:n),this.name="SolanaError"}};function vue(...r){"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...r)}function wue({errorCodeBaseOffset:r,getErrorContext:e,orderedErrorNames:n,rpcEnumError:i},s){let o,a;typeof i=="string"?o=i:(o=Object.keys(i)[0],a=i[o]);const u=n.indexOf(o),l=r+u,g=e(l,o,a),y=new al(l,g);return vue(y,s),y}var RUe=null;function Aue(r,e){const n=Number(r);return wue({errorCodeBaseOffset:4615001,getErrorContext(i,s,o){return i===cUe?{errorName:s,index:n,...o!==void 0?{instructionErrorContext:o}:null}:i===lUe?{code:Number(o),index:n}:{index:n}},orderedErrorNames:RUe,rpcEnumError:e},Aue)}var CUe=null;function _ue(r){return typeof r=="object"&&"InstructionError"in r?Aue(...r.InstructionError):wue({errorCodeBaseOffset:7050001,getErrorContext(e,n,i){if(e===pUe)return{errorName:n,...i!==void 0?{transactionErrorContext:i}:null};if(e===gUe)return{index:Number(i)};if(e===yUe||e===mUe)return{accountIndex:Number(i.account_index)}},orderedErrorNames:CUe,rpcEnumError:r},_ue)}function xUe(r){let e;if(BUe(r)){const{code:n,data:i,message:s}=r,o=Number(n);if(o===yue){const{err:a,...u}=i,l=a?{cause:_ue(a)}:null;e=new al(yue,{...u,...l})}else{let a;switch(o){case YDe:case XDe:case QDe:case JDe:case ZDe:case rUe:case uUe:case aUe:case tUe:case nUe:case iUe:case sUe:case oUe:case eUe:a={__serverMessage:s};break;default:typeof i=="object"&&!Array.isArray(i)&&(a=i)}e=new al(o,a)}}else{const n=typeof r=="object"&&r!==null&&"message"in r&&typeof r.message=="string"?r.message:"Malformed JSON-RPC error with no message attribute";e=new al(qDe,{error:r,message:n})}return vue(e,xUe),e}function BUe(r){return typeof r=="object"&&r!==null&&"code"in r&&"message"in r&&(typeof r.code=="number"||typeof r.code=="bigint")&&typeof r.message=="string"}var blt=r=>{const e=r.filter(o=>o.length);if(e.length===0)return r.length?r[0]:new Uint8Array;if(e.length===1)return e[0];const n=e.reduce((o,a)=>o+a.length,0),i=new Uint8Array(n);let s=0;return e.forEach(o=>{i.set(o,s),s+=o.length}),i};function OUe(r,e){if(r.length>=e)return r;const n=new Uint8Array(e).fill(0);return n.set(r),n}var PUe=(r,e)=>OUe(r.length<=e?r:r.slice(0,e),e);function NUe(r,e,n){const i=n===0&&r.length===e.length?r:r.slice(n,n+e.length);return MUe(i,e)}function MUe(r,e){return r.length===e.length&&r.every((n,i)=>n===e[i])}function iv(r,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(r)}function xc(r){return Object.freeze({...r,encode:e=>{const n=new Uint8Array(iv(e,r));return r.write(e,n,0),n}})}function cu(r){return Object.freeze({...r,decode:(e,n=0)=>r.read(e,n)[0]})}function LUe(r){return Object.freeze({...r,decode:(e,n=0)=>r.read(e,n)[0],encode:e=>{const n=new Uint8Array(iv(e,r));return r.write(e,n,0),n}})}function ga(r){return"fixedSize"in r&&typeof r.fixedSize=="number"}function Eue(r){if(!ga(r))throw new SolanaError(SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH)}function Tue(r){return!ga(r)}function vlt(r){if(!Tue(r))throw new SolanaError(SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH)}function xm(r,e){if(ga(r)!==ga(e))throw new SolanaError(SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH);if(ga(r)&&ga(e)&&r.fixedSize!==e.fixedSize)throw new SolanaError(SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH,{decoderFixedSize:e.fixedSize,encoderFixedSize:r.fixedSize});if(!ga(r)&&!ga(e)&&r.maxSize!==e.maxSize)throw new SolanaError(SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH,{decoderMaxSize:e.maxSize,encoderMaxSize:r.maxSize});return{...e,...r,decode:e.decode,encode:r.encode,read:e.read,write:r.write}}function DUe(r,e){const n=(i,s,o)=>{const a=r.encode(i);if(Sue(a,e)>=0)throw new SolanaError(SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL,{encodedBytes:a,hexEncodedBytes:E4(a),hexSentinel:E4(e),sentinel:e});return s.set(a,o),o+=a.length,s.set(e,o),o+=e.length,o};return ga(r)?xc({...r,fixedSize:r.fixedSize+e.length,write:n}):xc({...r,...r.maxSize!=null?{maxSize:r.maxSize+e.length}:{},getSizeFromValue:i=>r.getSizeFromValue(i)+e.length,write:n})}function UUe(r,e){const n=(i,s)=>{const o=s===0?i:i.slice(s),a=Sue(o,e);if(a===-1)throw new SolanaError(SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES,{decodedBytes:o,hexDecodedBytes:E4(o),hexSentinel:E4(e),sentinel:e});const u=o.slice(0,a);return[r.decode(u),s+u.length+e.length]};return ga(r)?cu({...r,fixedSize:r.fixedSize+e.length,read:n}):cu({...r,...r.maxSize!=null?{maxSize:r.maxSize+e.length}:{},read:n})}function wlt(r,e){return xm(DUe(r,e),UUe(r,e))}function Sue(r,e){return r.findIndex((n,i,s)=>e.length===1?n===e[0]:NUe(s,e,i))}function E4(r){return r.reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function FUe(r,e,n=0){if(e.length-n<=0)throw new al(bUe,{codecDescription:r})}function rF(r,e,n,i=0){const s=n.length-i;if(s<e)throw new al(vUe,{bytesLength:s,codecDescription:r,expected:e})}function T4(r,e,n){if(e<0||e>n)throw new al(EUe,{bytesLength:n,codecDescription:r,offset:e})}function WUe(r,e){const n=(a,u,l)=>{const g=r.encode(a);return l=e.write(g.length,u,l),u.set(g,l),l+g.length};if(ga(e)&&ga(r))return xc({...r,fixedSize:e.fixedSize+r.fixedSize,write:n});const i=ga(e)?e.fixedSize:e.maxSize??null,s=ga(r)?r.fixedSize:r.maxSize??null,o=i!==null&&s!==null?i+s:null;return xc({...r,...o!==null?{maxSize:o}:{},getSizeFromValue:a=>{const u=iv(a,r);return iv(u,e)+u},write:n})}function HUe(r,e){const n=(a,u)=>{const[l,g]=e.read(a,u),y=Number(l);return u=g,(u>0||a.length>y)&&(a=a.slice(u,u+y)),rF("addDecoderSizePrefix",y,a),[r.decode(a),u+y]};if(ga(e)&&ga(r))return cu({...r,fixedSize:e.fixedSize+r.fixedSize,read:n});const i=ga(e)?e.fixedSize:e.maxSize??null,s=ga(r)?r.fixedSize:r.maxSize??null,o=i!==null&&s!==null?i+s:null;return cu({...r,...o!==null?{maxSize:o}:{},read:n})}function Alt(r,e){return xm(WUe(r,e),HUe(r,e))}function _lt(r){return cu({...r,read(e,n){const[i,s]=r.read(e,n);if(e.length>s)throw new SolanaError(SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY,{expectedLength:s,numExcessBytes:e.length-s});return[i,s]}})}function Iue(r,e){return xc({fixedSize:e,write:(n,i,s)=>{const o=r.encode(n),a=o.length>e?o.slice(0,e):o;return i.set(a,s),s+e}})}function nF(r,e){return cu({fixedSize:e,read:(n,i)=>{rF("fixCodecSize",e,n,i),(i>0||n.length>e)&&(n=n.slice(i,i+e)),ga(r)&&(n=PUe(n,r.fixedSize));const[s]=r.read(n,0);return[s,i+e]}})}function Elt(r,e){return xm(Iue(r,e),nF(r,e))}function iF(r,e){return xc({...r,write:(n,i,s)=>{const o=g=>kue(g,i.length),a=e.preOffset?e.preOffset({bytes:i,preOffset:s,wrapBytes:o}):s;T4("offsetEncoder",a,i.length);const u=r.write(n,i,a),l=e.postOffset?e.postOffset({bytes:i,newPreOffset:a,postOffset:u,preOffset:s,wrapBytes:o}):u;return T4("offsetEncoder",l,i.length),l}})}function sF(r,e){return cu({...r,read:(n,i)=>{const s=g=>kue(g,n.length),o=e.preOffset?e.preOffset({bytes:n,preOffset:i,wrapBytes:s}):i;T4("offsetDecoder",o,n.length);const[a,u]=r.read(n,o),l=e.postOffset?e.postOffset({bytes:n,newPreOffset:o,postOffset:u,preOffset:i,wrapBytes:s}):u;return T4("offsetDecoder",l,n.length),[a,l]}})}function Tlt(r,e){return xm(iF(r,e),sF(r,e))}function kue(r,e){return e===0?0:(r%e+e)%e}function oF(r,e){if(ga(r)){const n=e(r.fixedSize);if(n<0)throw new SolanaError(SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH,{bytesLength:n,codecDescription:"resizeEncoder"});return xc({...r,fixedSize:n})}return xc({...r,getSizeFromValue:n=>{const i=e(r.getSizeFromValue(n));if(i<0)throw new SolanaError(SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH,{bytesLength:i,codecDescription:"resizeEncoder"});return i}})}function aF(r,e){if(ga(r)){const n=e(r.fixedSize);if(n<0)throw new al(_Ue,{bytesLength:n,codecDescription:"resizeDecoder"});return cu({...r,fixedSize:n})}return r}function Slt(r,e){return xm(oF(r,e),aF(r,e))}function zUe(r,e){return iF(oF(r,n=>n+e),{preOffset:({preOffset:n})=>n+e})}function $Ue(r,e){return iF(oF(r,n=>n+e),{postOffset:({postOffset:n})=>n+e})}function VUe(r,e){return sF(aF(r,n=>n+e),{preOffset:({preOffset:n})=>n+e})}function Rue(r,e){return sF(aF(r,n=>n+e),{postOffset:({postOffset:n})=>n+e})}function Ilt(r,e){return xm(zUe(r,e),VUe(r,e))}function klt(r,e){return xm($Ue(r,e),Rue(r,e))}function Cue(r,e,n,i,s=0){for(;n<--i;){const o=r[n];e[n+s]=r[i],e[i+s]=o,n++}n===i&&(e[n+s]=r[n])}function jUe(r){return Eue(r),xc({...r,write:(e,n,i)=>{const s=r.write(e,n,i);return Cue(n,n,i,i+r.fixedSize),s}})}function KUe(r){return Eue(r),cu({...r,read:(e,n)=>{const i=e.slice();return Cue(e,i,n,n+r.fixedSize),r.read(i,n)}})}function Rlt(r){return xm(jUe(r),KUe(r))}function xue(r,e){return xc({...Tue(r)?{...r,getSizeFromValue:n=>r.getSizeFromValue(e(n))}:r,write:(n,i,s)=>r.write(e(n),i,s)})}function Bue(r,e){return cu({...r,read:(n,i)=>{const[s,o]=r.read(n,i);return[e(s,n,i),o]}})}function Clt(r,e,n){return LUe({...xue(r,e),read:n?Bue(r,n).read:r.read})}function Oue(r,e,n=e){if(!e.match(new RegExp(`^[${r}]*$`)))throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE,{alphabet:r,base:r.length,value:n})}var uF=r=>createEncoder({getSizeFromValue:e=>{const[n,i]=Nue(e,r[0]);if(!i)return e.length;const s=Mue(i,r);return n.length+Math.ceil(s.toString(16).length/2)},write(e,n,i){if(Oue(r,e),e==="")return i;const[s,o]=Nue(e,r[0]);if(!o)return n.set(new Uint8Array(s.length).fill(0),i),i+s.length;let a=Mue(o,r);const u=[];for(;a>0n;)u.unshift(Number(a%256n)),a/=256n;const l=[...Array(s.length).fill(0),...u];return n.set(l,i),i+l.length}}),cF=r=>cu({read(e,n){const i=n===0?e:e.slice(n);if(i.length===0)return["",0];let s=i.findIndex(l=>l!==0);s=s===-1?i.length:s;const o=r[0].repeat(s);if(s===i.length)return[o,e.length];const a=i.slice(s).reduce((l,g)=>l*256n+BigInt(g),0n),u=GUe(a,r);return[o+u,e.length]}}),Pue=r=>combineCodec(uF(r),cF(r));function Nue(r,e){const[n,i]=r.split(new RegExp(`((?!${e}).*)`));return[n,i]}function Mue(r,e){const n=BigInt(e.length);let i=0n;for(const s of r)i*=n,i+=BigInt(e.indexOf(s));return i}function GUe(r,e){const n=BigInt(e.length),i=[];for(;r>0n;)i.unshift(e[Number(r%n)]),r/=n;return i.join("")}var lF="0123456789",xlt=()=>uF(lF),Blt=()=>cF(lF),Olt=()=>Pue(lF),Lue=null;function fF(r){if(r>=48&&r<=57)return r-48;if(r>=65&&r<=70)return r-55;if(r>=97&&r<=102)return r-87}var qUe=()=>createEncoder({getSizeFromValue:r=>Math.ceil(r.length/2),write(r,e,n){const i=r.length,s=i/2;if(i===1){const a=r.charCodeAt(0),u=fF(a);if(u===void 0)throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE,{...Lue,value:r});return e.set([u],n),1+n}const o=new Uint8Array(s);for(let a=0,u=0;a<s;a++){const l=r.charCodeAt(u++),g=r.charCodeAt(u++),y=fF(l),A=fF(g);if(y===void 0||A===void 0&&!Number.isNaN(g))throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE,{...Lue,value:r});o[a]=Number.isNaN(g)?y:y<<4|(A??0)}return e.set(o,n),o.length+n}}),ZUe=()=>createDecoder({read(r,e){return[r.slice(e).reduce((i,s)=>i+s.toString(16).padStart(2,"0"),""),r.length]}}),Plt=()=>combineCodec(qUe(),ZUe()),dF="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Nlt=()=>uF(dF),Due=()=>cF(dF),Mlt=()=>Pue(dF),YUe=(r,e)=>createEncoder({getSizeFromValue:n=>Math.floor(n.length*e/8),write(n,i,s){if(Oue(r,n),n==="")return s;const o=[...n].map(u=>r.indexOf(u)),a=Uue(o,e,8,!1);return i.set(a,s),a.length+s}}),XUe=(r,e)=>createDecoder({read(n,i=0){const s=i===0?n:n.slice(i);return s.length===0?["",n.length]:[Uue([...s],8,e,!0).map(a=>r[a]).join(""),n.length]}}),Llt=(r,e)=>combineCodec(YUe(r,e),XUe(r,e));function Uue(r,e,n,i){const s=[];let o=0,a=0;const u=(1<<n)-1;for(const l of r)for(o=o<<e|l,a+=e;a>=n;)a-=n,s.push(o>>a&u);return i&&a>0&&s.push(o<<n-a&u),s}var Fue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wue=()=>xc({getSizeFromValue:r=>{try{return atob(r).length}catch{throw new al(mue,{alphabet:Fue,base:64,value:r})}},write(r,e,n){try{const i=atob(r).split("").map(s=>s.charCodeAt(0));return e.set(i,n),i.length+n}catch{throw new al(mue,{alphabet:Fue,base:64,value:r})}}}),Hue=()=>cu({read(r,e=0){const n=r.slice(e);return[btoa(String.fromCharCode(...n)),r.length]}}),Dlt=()=>combineCodec(Wue(),Hue()),JUe=r=>r.replace(/\u0000/g,""),Ult=(r,e)=>r.padEnd(e,"\0"),QUe=globalThis.TextDecoder,zue=globalThis.TextEncoder,eFe=()=>{let r;return createEncoder({getSizeFromValue:e=>(r||=new zue).encode(e).length,write:(e,n,i)=>{const s=(r||=new zue).encode(e);return n.set(s,i),i+s.length}})},tFe=()=>{let r;return createDecoder({read(e,n){const i=(r||=new QUe).decode(e.slice(n));return[JUe(i),e.length]}})},Flt=()=>combineCodec(eFe(),tFe()),hF,pF;function gF(){return hF||(hF=getBase58Encoder()),hF}function rFe(){return pF||(pF=Due()),pF}function nFe(r){if(r.length<32||r.length>44)return!1;const e=gF();try{return e.encode(r).byteLength===32}catch{return!1}}function $ue(r){if(r.length<32||r.length>44)throw new SolanaError(SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE,{actualLength:r.length});const i=gF().encode(r).byteLength;if(i!==32)throw new SolanaError(SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH,{actualLength:i})}function iFe(r){return $ue(r),r}function Vue(){return transformEncoder(fixEncoderSize(gF(),32),r=>iFe(r))}function yF(){return nF(rFe(),32)}function mF(){return combineCodec(Vue(),yF())}function Wlt(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}var sFe=37095705934669439343138083508754565189542113879843219016388785533085940283555n,ul=57896044618658097711785492504343953926634992332820282019728792003956564819949n,jue=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function Ed(r){const e=r%ul;return e>=0n?e:ul+e}function L0(r,e){let n=r;for(;e-- >0n;)n*=n,n%=ul;return n}function oFe(r){const n=r*r%ul*r%ul,i=L0(n,2n)*n%ul,s=L0(i,1n)*r%ul,o=L0(s,5n)*s%ul,a=L0(o,10n)*o%ul,u=L0(a,20n)*a%ul,l=L0(u,40n)*u%ul,g=L0(l,80n)*l%ul,y=L0(g,80n)*l%ul,A=L0(y,10n)*o%ul;return L0(A,2n)*r%ul}function aFe(r,e){const n=Ed(e*e*e),i=Ed(n*n*e),s=oFe(r*i);let o=Ed(r*n*s);const a=Ed(e*o*o),u=o,l=Ed(o*jue),g=a===r,y=a===Ed(-r),A=a===Ed(-r*jue);return g&&(o=u),(y||A)&&(o=l),(Ed(o)&1n)===1n&&(o=Ed(-o)),!g&&!y?null:o}function uFe(r,e){const n=Ed(r*r),i=Ed(n-1n),s=Ed(sFe*n+1n),o=aFe(i,s);if(o===null)return!1;const a=(e&128)!==0;return!(o===0n&&a)}function cFe(r){const e=r.toString(16);return e.length===1?`0${e}`:e}function lFe(r){const n=`0x${r.reduce((i,s,o)=>`${cFe(o===31?s&-129:s)}${i}`,"")}`;return BigInt(n)}function Kue(r){if(r.byteLength!==32)return!1;const e=lFe(r);return uFe(e,r[31])}function fFe(r){const e=mF().encode(r);return Kue(e)===!1}function dFe(r){if(!fFe(r))throw new SolanaError(SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS)}function Hlt(r){return dFe(r),r}function zlt(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="string"&&typeof r[1]=="number"&&r[1]>=0&&r[1]<=255&&nFe(r[0])}function $lt(r){if(!(Array.isArray(r)&&r.length===2&&typeof r[0]=="string"&&typeof r[1]=="number"))throw new SolanaError(SOLANA_ERROR__ADDRESSES__MALFORMED_PDA);if(r[1]<0||r[1]>255)throw new SolanaError(SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE,{bump:r[1]});$ue(r[0])}var S4=32,Gue=16,I4=null;async function hFe({programAddress:r,seeds:e}){if(assertDigestCapabilityIsAvailable(),e.length>Gue)throw new SolanaError(SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED,{actual:e.length,maxSeeds:Gue});let n;const i=e.reduce((l,g,y)=>{const A=typeof g=="string"?(n||=new TextEncoder).encode(g):g;if(A.byteLength>S4)throw new SolanaError(SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED,{actual:A.byteLength,index:y,maxSeedLength:S4});return l.push(...A),l},[]),s=mF(),o=s.encode(r),a=await crypto.subtle.digest("SHA-256",new Uint8Array([...i,...o,...I4])),u=new Uint8Array(a);if(Kue(u))throw new SolanaError(SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE);return s.decode(u)}async function Vlt({programAddress:r,seeds:e}){let n=255;for(;n>0;)try{return[await hFe({programAddress:r,seeds:[...e,new Uint8Array([n])]}),n]}catch(i){if(isSolanaError(i,SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE))n--;else throw i}throw new SolanaError(SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED)}async function jlt({baseAddress:r,programAddress:e,seed:n}){const{encode:i,decode:s}=mF(),o=typeof n=="string"?new TextEncoder().encode(n):n;if(o.byteLength>S4)throw new SolanaError(SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED,{actual:o.byteLength,index:0,maxSeedLength:S4});const a=i(e);if(a.length>=I4.length&&bytesEqual(a.slice(-I4.length),new Uint8Array(I4)))throw new SolanaError(SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER);const u=await crypto.subtle.digest("SHA-256",new Uint8Array([...i(r),...o,...a])),l=new Uint8Array(u);return s(l)}async function Klt(r){if(assertKeyExporterIsAvailable(),r.type!=="public"||r.algorithm.name!=="Ed25519")throw new SolanaError(SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY);const e=await crypto.subtle.exportKey("raw",r);return yF().decode(new Uint8Array(e))}async function Glt(r){const e=Vue().encode(r);return await crypto.subtle.importKey("raw",e,{name:"Ed25519"},!0,["verify"])}function que(r,e,n,i){if(i<e||i>n)throw new al(AUe,{codecDescription:r,max:n,min:e,value:i})}var qlt=null;function Zue(r){return r?.endian!==1}function Td(r){return xc({fixedSize:r.size,write(e,n,i){r.range&&que(r.name,r.range[0],r.range[1],e);const s=new ArrayBuffer(r.size);return r.set(new DataView(s),e,Zue(r.config)),n.set(new Uint8Array(s),i),i+r.size}})}function Sd(r){return cu({fixedSize:r.size,read(e,n=0){FUe(r.name,e,n),rF(r.name,r.size,e,n);const i=new DataView(pFe(e,n,r.size));return[r.get(i,Zue(r.config)),n+r.size]}})}function pFe(r,e,n){const i=r.byteOffset+(e??0),s=n??r.byteLength;return r.buffer.slice(i,i+s)}var gFe=(r={})=>Td({config:r,name:"f32",set:(e,n,i)=>e.setFloat32(0,Number(n),i),size:4}),yFe=(r={})=>Sd({config:r,get:(e,n)=>e.getFloat32(0,n),name:"f32",size:4}),Zlt=(r={})=>combineCodec(gFe(r),yFe(r)),mFe=(r={})=>Td({config:r,name:"f64",set:(e,n,i)=>e.setFloat64(0,Number(n),i),size:8}),bFe=(r={})=>Sd({config:r,get:(e,n)=>e.getFloat64(0,n),name:"f64",size:8}),Ylt=(r={})=>combineCodec(mFe(r),bFe(r)),vFe=(r={})=>Td({config:r,name:"i128",range:[-BigInt("0x7fffffffffffffffffffffffffffffff")-1n,BigInt("0x7fffffffffffffffffffffffffffffff")],set:(e,n,i)=>{const s=i?8:0,o=i?0:8,a=0xffffffffffffffffn;e.setBigInt64(s,BigInt(n)>>64n,i),e.setBigUint64(o,BigInt(n)&a,i)},size:16}),wFe=(r={})=>Sd({config:r,get:(e,n)=>{const i=n?8:0,s=n?0:8,o=e.getBigInt64(i,n),a=e.getBigUint64(s,n);return(o<<64n)+a},name:"i128",size:16}),Xlt=(r={})=>combineCodec(vFe(r),wFe(r)),AFe=(r={})=>Td({config:r,name:"i16",range:[-+"0x7fff"-1,+"0x7fff"],set:(e,n,i)=>e.setInt16(0,Number(n),i),size:2}),_Fe=(r={})=>Sd({config:r,get:(e,n)=>e.getInt16(0,n),name:"i16",size:2}),Jlt=(r={})=>combineCodec(AFe(r),_Fe(r)),EFe=(r={})=>Td({config:r,name:"i32",range:[-+"0x7fffffff"-1,+"0x7fffffff"],set:(e,n,i)=>e.setInt32(0,Number(n),i),size:4}),TFe=(r={})=>Sd({config:r,get:(e,n)=>e.getInt32(0,n),name:"i32",size:4}),Qlt=(r={})=>combineCodec(EFe(r),TFe(r)),SFe=(r={})=>Td({config:r,name:"i64",range:[-BigInt("0x7fffffffffffffff")-1n,BigInt("0x7fffffffffffffff")],set:(e,n,i)=>e.setBigInt64(0,BigInt(n),i),size:8}),IFe=(r={})=>Sd({config:r,get:(e,n)=>e.getBigInt64(0,n),name:"i64",size:8}),eft=(r={})=>combineCodec(SFe(r),IFe(r)),kFe=()=>Td({name:"i8",range:[-+"0x7f"-1,+"0x7f"],set:(r,e)=>r.setInt8(0,Number(e)),size:1}),RFe=()=>Sd({get:r=>r.getInt8(0),name:"i8",size:1}),tft=()=>combineCodec(kFe(),RFe()),Yue=()=>xc({getSizeFromValue:r=>r<=127?1:r<=16383?2:3,maxSize:3,write:(r,e,n)=>{que("shortU16",0,65535,r);const i=[0];for(let s=0;;s+=1){const o=Number(r)>>s*7;if(o===0)break;const a=127&o;i[s]=a,s>0&&(i[s-1]|=128)}return e.set(i,n),n+i.length}}),bF=()=>cu({maxSize:3,read:(r,e)=>{let n=0,i=0;for(;++i;){const s=i-1,o=r[e+s],a=127&o;if(n|=a<<s*7,!(o&128))break}return[n,e+i]}}),rft=()=>combineCodec(Yue(),bF()),CFe=(r={})=>Td({config:r,name:"u128",range:[0n,BigInt("0xffffffffffffffffffffffffffffffff")],set:(e,n,i)=>{const s=i?8:0,o=i?0:8,a=0xffffffffffffffffn;e.setBigUint64(s,BigInt(n)>>64n,i),e.setBigUint64(o,BigInt(n)&a,i)},size:16}),xFe=(r={})=>Sd({config:r,get:(e,n)=>{const i=n?8:0,s=n?0:8,o=e.getBigUint64(i,n),a=e.getBigUint64(s,n);return(o<<64n)+a},name:"u128",size:16}),nft=(r={})=>combineCodec(CFe(r),xFe(r)),BFe=(r={})=>Td({config:r,name:"u16",range:[0,+"0xffff"],set:(e,n,i)=>e.setUint16(0,Number(n),i),size:2}),OFe=(r={})=>Sd({config:r,get:(e,n)=>e.getUint16(0,n),name:"u16",size:2}),ift=(r={})=>combineCodec(BFe(r),OFe(r)),Xue=(r={})=>Td({config:r,name:"u32",range:[0,+"0xffffffff"],set:(e,n,i)=>e.setUint32(0,Number(n),i),size:4}),Jue=(r={})=>Sd({config:r,get:(e,n)=>e.getUint32(0,n),name:"u32",size:4}),sft=(r={})=>combineCodec(Xue(r),Jue(r)),PFe=(r={})=>Td({config:r,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,n,i)=>e.setBigUint64(0,BigInt(n),i),size:8}),NFe=(r={})=>Sd({config:r,get:(e,n)=>e.getBigUint64(0,n),name:"u64",size:8}),oft=(r={})=>combineCodec(PFe(r),NFe(r)),MFe=()=>Td({name:"u8",range:[0,+"0xff"],set:(r,e)=>r.setUint8(0,Number(e)),size:1}),Que=()=>Sd({get:r=>r.getUint8(0),name:"u8",size:1}),aft=()=>combineCodec(MFe(),Que());function ece(r,e,n){if(e!==n)throw new al(wUe,{actual:n,codecDescription:r,expected:e})}function LFe(r){return r.reduce((e,n)=>e===null||n===null?null:Math.max(e,n),0)}function Bm(r){return r.reduce((e,n)=>e===null||n===null?null:e+n,0)}function iA(r){return ga(r)?r.fixedSize:null}function sv(r){return ga(r)?r.fixedSize:r.maxSize??null}function k4(r,e={}){const n=e.size??Xue(),i=R4(n,iA(r)),s=R4(n,sv(r))??void 0;return xc({...i!==null?{fixedSize:i}:{getSizeFromValue:o=>(typeof n=="object"?iv(o.length,n):0)+[...o].reduce((u,l)=>u+iv(l,r),0),maxSize:s},write:(o,a,u)=>(typeof n=="number"&&ece("array",n,o.length),typeof n=="object"&&(u=n.write(o.length,a,u)),o.forEach(l=>{u=r.write(l,a,u)}),u)})}function mS(r,e={}){const n=e.size??Jue(),i=iA(r),s=R4(n,i),o=R4(n,sv(r))??void 0;return cu({...s!==null?{fixedSize:s}:{maxSize:o},read:(a,u)=>{const l=[];if(typeof n=="object"&&a.slice(u).length===0)return[l,u];if(n==="remainder"){for(;u<a.length;){const[A,I]=r.read(a,u);u=I,l.push(A)}return[l,u]}const[g,y]=typeof n=="number"?[n,u]:n.read(a,u);u=y;for(let A=0;A<g;A+=1){const[I,P]=r.read(a,u);u=P,l.push(I)}return[l,u]}})}function uft(r,e={}){return combineCodec(k4(r,e),mS(r,e))}function R4(r,e){return typeof r!="number"?null:r===0?0:e===null?null:e*r}function DFe(r,e={}){const i=(typeof e=="boolean"?{backward:e}:e).backward??!1;return createEncoder({fixedSize:r,write(s,o,a){const u=[];for(let l=0;l<r;l+=1){let g=0;for(let y=0;y<8;y+=1){const A=Number(s[l*8+y]??0);g|=A<<(i?y:7-y)}i?u.unshift(g):u.push(g)}return o.set(u,a),r}})}function UFe(r,e={}){const i=(typeof e=="boolean"?{backward:e}:e).backward??!1;return createDecoder({fixedSize:r,read(s,o){assertByteArrayHasEnoughBytesForCodec("bitArray",r,s,o);const a=[];let u=s.slice(o,o+r);return u=i?u.reverse():u,u.forEach(l=>{for(let g=0;g<8;g+=1)i?(a.push(!!(l&1)),l>>=1):(a.push(!!(l&128)),l<<=1)}),[a,o+r]}})}function cft(r,e={}){return combineCodec(DFe(r,e),UFe(r,e))}function tce(r={}){return transformEncoder(r.size??getU8Encoder(),e=>e?1:0)}function rce(r={}){return transformDecoder(r.size??getU8Decoder(),e=>Number(e)===1)}function lft(r={}){return combineCodec(tce(r),rce(r))}function vF(){return xc({getSizeFromValue:r=>r.length,write:(r,e,n)=>(e.set(r,n),n+r.length)})}function wF(){return cu({read:(r,e)=>{const n=r.slice(e);return[n,e+n.length]}})}function fft(){return combineCodec(vF(),wF())}var FFe=()=>createDecoder({read(r,e){return[r.slice(e).reduce((i,s)=>i+s.toString(16).padStart(2,"0"),""),r.length]}});function nce(r){return createEncoder({fixedSize:r.length,write:(e,n,i)=>(n.set(r,i),i+r.length)})}function ice(r){return createDecoder({fixedSize:r.length,read:(e,n)=>{const i=FFe();if(!containsBytes(e,r,n))throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_CONSTANT,{constant:r,data:e,hexConstant:i.decode(r),hexData:i.decode(e),offset:n});return[void 0,n+r.length]}})}function dft(r){return combineCodec(nce(r),ice(r))}function ov(r){const e=Bm(r.map(iA)),n=Bm(r.map(sv))??void 0;return createEncoder({...e===null?{getSizeFromValue:i=>r.map((s,o)=>getEncodedSize(i[o],s)).reduce((s,o)=>s+o,0),maxSize:n}:{fixedSize:e},write:(i,s,o)=>(ece("tuple",r.length,i.length),r.forEach((a,u)=>{o=a.write(i[u],s,o)}),o)})}function Om(r){const e=Bm(r.map(iA)),n=Bm(r.map(sv))??void 0;return cu({...e===null?{maxSize:n}:{fixedSize:e},read:(i,s)=>{const o=[];return r.forEach(a=>{const[u,l]=a.read(i,s);o.push(u),s=l}),[o,s]}})}function hft(r){return combineCodec(ov(r),Om(r))}function AF(r,e){const n=sce(r),i=(o,a,u)=>{const l=e(o);return EF(r,l),r[l].write(o,a,u)};if(n!==null)return createEncoder({fixedSize:n,write:i});const s=oce(r);return createEncoder({...s!==null?{maxSize:s}:{},getSizeFromValue:o=>{const a=e(o);return EF(r,a),getEncodedSize(o,r[a])},write:i})}function _F(r,e){const n=sce(r),i=(o,a)=>{const u=e(o,a);return EF(r,u),r[u].read(o,a)};if(n!==null)return createDecoder({fixedSize:n,read:i});const s=oce(r);return createDecoder({...s!==null?{maxSize:s}:{},read:i})}function pft(r,e,n){return combineCodec(AF(r,e),_F(r,n))}function EF(r,e){if(typeof r[e]>"u")throw new SolanaError(SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE,{maxRange:r.length-1,minRange:0,variant:e})}function sce(r){if(r.length===0)return 0;if(!isFixedSize(r[0]))return null;const e=r[0].fixedSize;return r.every(i=>isFixedSize(i)&&i.fixedSize===e)?e:null}function oce(r){return LFe(r.map(e=>sv(e)))}function WFe(r,e={}){const n=e.discriminator??"__kind",i=e.size??getU8Encoder();return AF(r.map(([,s],o)=>transformEncoder(ov([i,s]),a=>[o,a])),s=>zFe(r,s[n]))}function HFe(r,e={}){const n=e.discriminator??"__kind",i=e.size??getU8Decoder();return _F(r.map(([s,o])=>transformDecoder(Om([i,o]),([,a])=>({[n]:s,...a}))),(s,o)=>Number(i.read(s,o)[0]))}function gft(r,e={}){return combineCodec(WFe(r,e),HFe(r,e))}function zFe(r,e){const n=r.findIndex(([i])=>e===i);if(n<0)throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT,{value:e,variants:r.map(([i])=>i)});return n}function ace(r){const e=[...new Set(Object.values(r).filter(a=>typeof a=="number"))].sort(),n=Object.fromEntries(Object.entries(r).slice(e.length)),i=Object.keys(n),s=Object.values(n),o=[...new Set([...i,...s.filter(a=>typeof a=="string")])];return{enumKeys:i,enumRecord:n,enumValues:s,numericalValues:e,stringValues:o}}function $Fe({enumKeys:r,enumValues:e,variant:n}){const i=uce(e,s=>s===n);return i>=0?i:r.findIndex(s=>s===n)}function VFe({discriminator:r,enumKeys:e,enumValues:n,useValuesAsDiscriminators:i}){return i?uce(n,s=>s===r):r>=0&&r<e.length?r:-1}function uce(r,e){let n=r.length;for(;n--;)if(e(r[n],n,r))return n;return-1}function cce(r){if(r.length===0)return"";let e=[r[0],r[0]];const n=[];for(let i=1;i<r.length;i++){const s=r[i];e[1]+1===s?e[1]=s:(n.push(e[0]===e[1]?`${e[0]}`:`${e[0]}-${e[1]}`),e=[s,s])}return n.push(e[0]===e[1]?`${e[0]}`:`${e[0]}-${e[1]}`),n.join(", ")}function jFe(r,e={}){const n=e.size??getU8Encoder(),i=e.useValuesAsDiscriminators??!1,{enumKeys:s,enumValues:o,numericalValues:a,stringValues:u}=ace(r);if(i&&o.some(l=>typeof l=="string"))throw new SolanaError(SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS,{stringValues:o.filter(l=>typeof l=="string")});return transformEncoder(n,l=>{const g=$Fe({enumKeys:s,enumValues:o,variant:l});if(g<0)throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT,{formattedNumericalValues:cce(a),numericalValues:a,stringValues:u,variant:l});return i?o[g]:g})}function KFe(r,e={}){const n=e.size??getU8Decoder(),i=e.useValuesAsDiscriminators??!1,{enumKeys:s,enumValues:o,numericalValues:a}=ace(r);if(i&&o.some(u=>typeof u=="string"))throw new SolanaError(SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS,{stringValues:o.filter(u=>typeof u=="string")});return transformDecoder(n,u=>{const l=Number(u),g=VFe({discriminator:l,enumKeys:s,enumValues:o,useValuesAsDiscriminators:i});if(g<0){const y=i?a:[...Array(s.length).keys()];throw new SolanaError(SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE,{discriminator:l,formattedValidDiscriminators:cce(y),validDiscriminators:y})}return o[g]})}function yft(r,e={}){return combineCodec(jFe(r,e),KFe(r,e))}function GFe(r,e){return transformEncoder(ov([...e,r]),n=>[...e.map(()=>{}),n])}function qFe(r,e){return transformDecoder(Om([...e,r]),n=>n[n.length-1])}function mft(r,e){return combineCodec(GFe(r,e),qFe(r,e))}function ZFe(r,e){return transformEncoder(ov([r,...e]),n=>[n,...e.map(()=>{})])}function YFe(r,e){return transformDecoder(Om([r,...e]),n=>n[0])}function bft(r,e){return combineCodec(ZFe(r,e),YFe(r,e))}function XFe(r,e={}){const n=e.size??getU8Encoder();return transformEncoder(n,i=>{const s=r.indexOf(i);if(s<0)throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT,{value:i,variants:r});return s})}function JFe(r,e={}){const n=e.size??getU8Decoder();return transformDecoder(n,i=>{if(i<0||i>=r.length)throw new SolanaError(SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE,{discriminator:i,maxRange:r.length-1,minRange:0});return r[Number(i)]})}function vft(r,e={}){return combineCodec(XFe(r,e),JFe(r,e))}function QFe(r,e,n={}){return transformEncoder(k4(ov([r,e]),n),i=>[...i.entries()])}function eWe(r,e,n={}){return transformDecoder(mS(Om([r,e]),n),i=>new Map(i))}function wft(r,e,n={}){return combineCodec(QFe(r,e,n),eWe(r,e,n))}function C4(){return createEncoder({fixedSize:0,write:(r,e,n)=>n})}function x4(){return createDecoder({fixedSize:0,read:(r,e)=>[void 0,e]})}function Aft(){return combineCodec(C4(),x4())}function tWe(r,e={}){const n=e.prefix===null?transformEncoder(C4(),s=>{}):tce({size:e.prefix??getU8Encoder()}),i=e.noneValue==="zeroes"?(assertIsFixedSize(r),fixEncoderSize(C4(),r.fixedSize)):e.noneValue?nce(e.noneValue):C4();return AF([transformEncoder(ov([n,i]),s=>[!1,void 0]),transformEncoder(ov([n,r]),s=>[!0,s])],s=>+(s!==null))}function rWe(r,e={}){const n=e.prefix===null?transformDecoder(x4(),()=>!1):rce({size:e.prefix??getU8Decoder()}),i=e.noneValue==="zeroes"?(assertIsFixedSize(r),fixDecoderSize(x4(),r.fixedSize)):e.noneValue?ice(e.noneValue):x4();return _F([transformDecoder(Om([n,i]),()=>null),transformDecoder(Om([n,r]),([,s])=>s)],(s,o)=>{if(e.prefix===null&&!e.noneValue)return+(o<s.length);if(e.prefix===null&&e.noneValue!=null){const a=e.noneValue==="zeroes"?new Uint8Array(i.fixedSize).fill(0):e.noneValue;return containsBytes(s,a,o)?0:1}return Number(n.read(s,o)[0])})}function _ft(r,e={}){return combineCodec(tWe(r,e),rWe(r,e))}function nWe(r,e={}){return transformEncoder(k4(r,e),n=>[...n])}function iWe(r,e={}){return transformDecoder(mS(r,e),n=>new Set(n))}function Eft(r,e={}){return combineCodec(nWe(r,e),iWe(r,e))}function lce(r){const e=r.map(([,s])=>s),n=Bm(e.map(iA)),i=Bm(e.map(sv))??void 0;return xc({...n===null?{getSizeFromValue:s=>r.map(([o,a])=>iv(s[o],a)).reduce((o,a)=>o+a,0),maxSize:i}:{fixedSize:n},write:(s,o,a)=>(r.forEach(([u,l])=>{a=l.write(s[u],o,a)}),a)})}function fce(r){const e=r.map(([,s])=>s),n=Bm(e.map(iA)),i=Bm(e.map(sv))??void 0;return cu({...n===null?{maxSize:i}:{fixedSize:n},read:(s,o)=>{const a={};return r.forEach(([u,l])=>{const[g,y]=l.read(s,o);o=y,a[u]=g}),[a,o]}})}function Tft(r){return combineCodec(lce(r),fce(r))}function sWe(r){return"lifetimeConstraint"in r&&typeof r.lifetimeConstraint.blockhash=="string"&&typeof r.lifetimeConstraint.lastValidBlockHeight=="bigint"&&isBlockhash(r.lifetimeConstraint.blockhash)}function Sft(r){if(!sWe(r))throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME)}function oWe(r,e){return"lifetimeConstraint"in e&&e.lifetimeConstraint&&"blockhash"in e.lifetimeConstraint&&e.lifetimeConstraint.blockhash===r.blockhash&&e.lifetimeConstraint.lastValidBlockHeight===r.lastValidBlockHeight?e:Object.freeze({...e,lifetimeConstraint:Object.freeze(r)})}function aWe(r,e,n=e){if(!e.match(new RegExp(`^[${r}]*$`)))throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE,{alphabet:r,base:r.length,value:n})}var uWe=r=>createEncoder({getSizeFromValue:e=>{const[n,i]=dce(e,r[0]);if(!i)return e.length;const s=hce(i,r);return n.length+Math.ceil(s.toString(16).length/2)},write(e,n,i){if(aWe(r,e),e==="")return i;const[s,o]=dce(e,r[0]);if(!o)return n.set(new Uint8Array(s.length).fill(0),i),i+s.length;let a=hce(o,r);const u=[];for(;a>0n;)u.unshift(Number(a%256n)),a/=256n;const l=[...Array(s.length).fill(0),...u];return n.set(l,i),i+l.length}}),cWe=r=>createDecoder({read(e,n){const i=n===0?e:e.slice(n);if(i.length===0)return["",0];let s=i.findIndex(l=>l!==0);s=s===-1?i.length:s;const o=r[0].repeat(s);if(s===i.length)return[o,e.length];const a=i.slice(s).reduce((l,g)=>l*256n+BigInt(g),0n),u=lWe(a,r);return[o+u,e.length]}});function dce(r,e){const[n,i]=r.split(new RegExp(`((?!${e}).*)`));return[n,i]}function hce(r,e){const n=BigInt(e.length);let i=0n;for(const s of r)i*=n,i+=BigInt(e.indexOf(s));return i}function lWe(r,e){const n=BigInt(e.length),i=[];for(;r>0n;)i.unshift(e[Number(r%n)]),r/=n;return i.join("")}var pce="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",fWe=()=>uWe(pce),dWe=()=>cWe(pce),TF;function hWe(){if(!TF){const r=getArrayEncoder(getU8Encoder(),{size:getShortU16Encoder()});TF=getStructEncoder([["lookupTableAddress",getAddressEncoder()],["writableIndexes",r],["readonlyIndexes",r]])}return TF}var SF;function pWe(){if(!SF){const r=getArrayDecoder(getU8Decoder(),{size:getShortU16Decoder()});SF=getStructDecoder([["lookupTableAddress",getAddressDecoder()],["writableIndexes",r],["readonlyIndexes",r]])}return SF}var IF;function kF(){return IF||(IF=getU8Encoder()),IF}var RF;function CF(){return RF||(RF=getU8Decoder()),RF}function gWe(){return getStructEncoder([["numSignerAccounts",kF()],["numReadonlySignerAccounts",kF()],["numReadonlyNonSignerAccounts",kF()]])}function yWe(){return getStructDecoder([["numSignerAccounts",CF()],["numReadonlySignerAccounts",CF()],["numReadonlyNonSignerAccounts",CF()]])}var xF;function mWe(){return xF||(xF=transformEncoder(getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",getArrayEncoder(getU8Encoder(),{size:getShortU16Encoder()})],["data",addEncoderSizePrefix(getBytesEncoder(),getShortU16Encoder())]]),r=>r.accountIndices!==void 0&&r.data!==void 0?r:{...r,accountIndices:r.accountIndices??[],data:r.data??new Uint8Array(0)})),xF}var BF;function bWe(){return BF||(BF=transformDecoder(getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",getArrayDecoder(getU8Decoder(),{size:getShortU16Decoder()})],["data",addDecoderSizePrefix(getBytesDecoder(),getShortU16Decoder())]]),r=>{if(r.accountIndices.length&&r.data.byteLength)return r;const{accountIndices:e,data:n,...i}=r;return{...i,...e.length?{accountIndices:e}:null,...n.byteLength?{data:n}:null}})),BF}var gce=0,OF=128;function yce(){return createEncoder({getSizeFromValue:r=>r==="legacy"?0:1,maxSize:1,write:(r,e,n)=>{if(r==="legacy")return n;if(r<0||r>127)throw new SolanaError(SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE,{actualVersion:r});if(r>gce)throw new SolanaError(SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED,{unsupportedVersion:r});return e.set([r|OF],n),n+1}})}function PF(){return cu({maxSize:1,read:(r,e)=>{const n=r[e];if(n&OF){const i=n^OF;if(i>gce)throw new al(hUe,{unsupportedVersion:i});return[i,e+1]}else return["legacy",e]}})}function Ift(){return combineCodec(yce(),PF())}function mce(){return getStructEncoder(vce())}function bce(){return transformEncoder(getStructEncoder([...vce(),["addressTableLookups",wWe()]]),r=>r.version==="legacy"?r:{...r,addressTableLookups:r.addressTableLookups??[]})}function vce(){const r=getUnionEncoder([getConstantEncoder(new Uint8Array(32)),fixEncoderSize(fWe(),32)],e=>e===void 0?0:1);return[["version",yce()],["header",gWe()],["staticAccounts",getArrayEncoder(getAddressEncoder(),{size:getShortU16Encoder()})],["lifetimeToken",r],["instructions",getArrayEncoder(mWe(),{size:getShortU16Encoder()})]]}function vWe(){return[["version",PF()],["header",yWe()],["staticAccounts",getArrayDecoder(getAddressDecoder(),{size:getShortU16Decoder()})],["lifetimeToken",fixDecoderSize(dWe(),32)],["instructions",getArrayDecoder(bWe(),{size:getShortU16Decoder()})],["addressTableLookups",AWe()]]}function wWe(){return getArrayEncoder(hWe(),{size:getShortU16Encoder()})}function AWe(){return getArrayDecoder(pWe(),{size:getShortU16Decoder()})}function _We(){return createEncoder({getSizeFromValue:r=>r.version==="legacy"?mce().getSizeFromValue(r):bce().getSizeFromValue(r),write:(r,e,n)=>r.version==="legacy"?mce().write(r,e,n):bce().write(r,e,n)})}function EWe(){return transformDecoder(getStructDecoder(vWe()),({addressTableLookups:r,...e})=>e.version==="legacy"||!r?.length?e:{...e,addressTableLookups:r})}function kft(){return combineCodec(_We(),EWe())}function wce(r,e,n){r[e]=n(r[e]??{role:AccountRole.READONLY})}var Ga=Symbol("AddressMapTypeProperty");function TWe(r,e){const n={[r]:{[Ga]:0,role:AccountRole.WRITABLE_SIGNER}},i=new Set;for(const s of e){wce(n,s.programAddress,a=>{if(i.add(s.programAddress),Ga in a){if(isWritableRole(a.role))switch(a[Ga]){case 0:throw new SolanaError(SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES,{programAddress:s.programAddress});default:throw new SolanaError(SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE,{programAddress:s.programAddress})}if(a[Ga]===2)return a}return{[Ga]:2,role:AccountRole.READONLY}});let o;if(s.accounts)for(const a of s.accounts)wce(n,a.address,u=>{const{address:l,...g}=a;if(Ga in u)switch(u[Ga]){case 0:return u;case 1:{const y=mergeRoles(u.role,g.role);if("lookupTableAddress"in g){if(u.lookupTableAddress!==g.lookupTableAddress&&(o||=getAddressComparator())(g.lookupTableAddress,u.lookupTableAddress)<0)return{[Ga]:1,...g,role:y}}else if(isSignerRole(g.role))return{[Ga]:2,role:y};return u.role!==y?{...u,role:y}:u}case 2:{const y=mergeRoles(u.role,g.role);if(i.has(a.address)){if(isWritableRole(g.role))throw new SolanaError(SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE,{programAddress:a.address});return u.role!==y?{...u,role:y}:u}else return"lookupTableAddress"in g&&!isSignerRole(u.role)?{...g,[Ga]:1,role:y}:u.role!==y?{...u,role:y}:u}}return"lookupTableAddress"in g?{...g,[Ga]:1}:{...g,[Ga]:2}})}return n}function SWe(r){let e;return Object.entries(r).sort(([i,s],[o,a])=>{if(s[Ga]!==a[Ga]){if(s[Ga]===0)return-1;if(a[Ga]===0)return 1;if(s[Ga]===2)return-1;if(a[Ga]===2)return 1}const u=isSignerRole(s.role);if(u!==isSignerRole(a.role))return u?-1:1;const l=isWritableRole(s.role);return l!==isWritableRole(a.role)?l?-1:1:(e||=getAddressComparator(),s[Ga]===1&&a[Ga]===1&&s.lookupTableAddress!==a.lookupTableAddress?e(s.lookupTableAddress,a.lookupTableAddress):e(i,o))}).map(([i,s])=>({address:i,...s}))}function IWe(r){const e={};for(const n of r){if(!("lookupTableAddress"in n))continue;const i=e[n.lookupTableAddress]||={readonlyIndexes:[],writableIndexes:[]};n.role===AccountRole.WRITABLE?i.writableIndexes.push(n.addressIndex):i.readonlyIndexes.push(n.addressIndex)}return Object.keys(e).sort(getAddressComparator()).map(n=>({lookupTableAddress:n,...e[n]}))}function kWe(r){let e=0,n=0,i=0;for(const s of r){if("lookupTableAddress"in s)break;const o=isWritableRole(s.role);isSignerRole(s.role)?(i++,o||n++):o||e++}return{numReadonlyNonSignerAccounts:e,numReadonlySignerAccounts:n,numSignerAccounts:i}}function RWe(r){const e={};for(const[n,i]of r.entries())e[i.address]=n;return e}function CWe(r,e){const n=RWe(e);return r.map(({accounts:i,data:s,programAddress:o})=>({programAddressIndex:n[o],...i?{accountIndices:i.map(({address:a})=>n[a])}:null,...s?{data:s}:null}))}function xWe(r){return"nonce"in r?r.nonce:r.blockhash}function BWe(r){const e=r.findIndex(i=>"lookupTableAddress"in i);return(e===-1?r:r.slice(0,e)).map(({address:i})=>i)}function Rft(r){const e=TWe(r.feePayer.address,r.instructions),n=SWe(e),i=r.lifetimeConstraint;return{...r.version!=="legacy"?{addressTableLookups:IWe(n)}:null,...i?{lifetimeToken:xWe(i)}:null,header:kWe(n),instructions:CWe(r.instructions,n),staticAccounts:BWe(n),version:r.version}}function OWe(r,e,n){for(const[i,s]of Object.entries(n))for(let o=0;o<s.length;o++)if(r===s[o])return{address:r,addressIndex:o,lookupTableAddress:i,role:e}}function Cft(r,e){const n=new Set(r.instructions.map(a=>a.programAddress)),i=new Set(Object.values(e).flatMap(a=>a).filter(a=>!n.has(a))),s=[];let o=!1;for(const a of r.instructions){if(!a.accounts){s.push(a);continue}const u=[];let l=!1;for(const g of a.accounts){if("lookupTableAddress"in g||!i.has(g.address)||isSignerRole(g.role)){u.push(g);continue}const y=OWe(g.address,g.role,e);u.push(Object.freeze(y)),l=!0,o=!0}s.push(Object.freeze(l?{...a,accounts:u}:a))}return Object.freeze(o?{...r,instructions:s}:r)}function PWe(r){return Object.freeze({instructions:Object.freeze([]),version:r.version})}var Ace="SysvarRecentB1ockHashes11111111111111111111",_ce="11111111111111111111111111111111";function Ece(r,e){return{accounts:[{address:r,role:AccountRole.WRITABLE},{address:Ace,role:AccountRole.READONLY},{address:e,role:AccountRole.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:_ce}}function NF(r){return r.programAddress===_ce&&r.data!=null&&NWe(r.data)&&r.accounts?.length===3&&r.accounts[0].address!=null&&r.accounts[0].role===AccountRole.WRITABLE&&r.accounts[1].address===Ace&&r.accounts[1].role===AccountRole.READONLY&&r.accounts[2].address!=null&&isSignerRole(r.accounts[2].role)}function NWe(r){return r.byteLength===4&&r[0]===4&&r[1]===0&&r[2]===0&&r[3]===0}function Tce(r){return"lifetimeConstraint"in r&&typeof r.lifetimeConstraint.nonce=="string"&&r.instructions[0]!=null&&NF(r.instructions[0])}function xft(r){if(!Tce(r))throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME)}function MWe(r,e,n){return r.accounts[0].address===e&&r.accounts[2].address===n}function LWe({nonce:r,nonceAccountAddress:e,nonceAuthorityAddress:n},i){let s;const o=i.instructions[0];if(o&&NF(o))if(MWe(o,e,n)){if(Tce(i)&&i.lifetimeConstraint.nonce===r)return i;s=[o,...i.instructions.slice(1)]}else s=[Object.freeze(Ece(e,n)),...i.instructions.slice(1)];else s=[Object.freeze(Ece(e,n)),...i.instructions];return Object.freeze({...i,instructions:Object.freeze(s),lifetimeConstraint:Object.freeze({nonce:r})})}function DWe(r,e){if("feePayer"in e&&r===e.feePayer?.address&&UWe(e.feePayer))return e;const n={...e,feePayer:Object.freeze({address:r})};return Object.freeze(n),n}function UWe(r){return!!r&&"address"in r&&typeof r.address=="string"&&Object.keys(r).length===1}function FWe(r,e){return WWe([r],e)}function WWe(r,e){return Object.freeze({...e,instructions:Object.freeze([...e.instructions,...r])})}function Bft(r,e){return HWe([r],e)}function HWe(r,e){return Object.freeze({...e,instructions:Object.freeze([...r,...e.instructions])})}function zWe(r){const{header:e}=r,n=e.numSignerAccounts-e.numReadonlySignerAccounts,i=r.staticAccounts.length-e.numSignerAccounts-e.numReadonlyNonSignerAccounts,s=[];let o=0;for(let a=0;a<n;a++)s.push({address:r.staticAccounts[o],role:AccountRole.WRITABLE_SIGNER}),o++;for(let a=0;a<e.numReadonlySignerAccounts;a++)s.push({address:r.staticAccounts[o],role:AccountRole.READONLY_SIGNER}),o++;for(let a=0;a<i;a++)s.push({address:r.staticAccounts[o],role:AccountRole.WRITABLE}),o++;for(let a=0;a<e.numReadonlyNonSignerAccounts;a++)s.push({address:r.staticAccounts[o],role:AccountRole.READONLY}),o++;return s}function $We(r,e){const i=r.map(a=>a.lookupTableAddress).filter(a=>e[a]===void 0);if(i.length>0)throw new SolanaError(SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING,{lookupTableAddresses:i});const s=[],o=[];for(const a of r){const u=e[a.lookupTableAddress],l=a.readonlyIndexes,g=a.writableIndexes,y=Math.max(...l,...g);if(y>=u.length)throw new SolanaError(SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE,{highestKnownIndex:u.length-1,highestRequestedIndex:y,lookupTableAddress:a.lookupTableAddress});const A=l.map(P=>({address:u[P],addressIndex:P,lookupTableAddress:a.lookupTableAddress,role:AccountRole.READONLY}));s.push(...A);const I=g.map(P=>({address:u[P],addressIndex:P,lookupTableAddress:a.lookupTableAddress,role:AccountRole.WRITABLE}));o.push(...I)}return[...o,...s]}function VWe(r,e){const n=e[r.programAddressIndex]?.address;if(!n)throw new SolanaError(SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND,{index:r.programAddressIndex});const i=r.accountIndices?.map(o=>e[o]),{data:s}=r;return Object.freeze({programAddress:n,...i&&i.length?{accounts:Object.freeze(i)}:{},...s&&s.length?{data:s}:{}})}function jWe(r,e,n){if(!e||!NF(e))return{blockhash:r,lastValidBlockHeight:n??2n**64n-1n};{const i=e.accounts[0].address;assertIsAddress(i);const s=e.accounts[2].address;return assertIsAddress(s),{nonce:r,nonceAccountAddress:i,nonceAuthorityAddress:s}}}function Oft(r,e){const n=r.staticAccounts[0];if(!n)throw new SolanaError(SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING);const i=zWe(r),s="addressTableLookups"in r&&r.addressTableLookups!==void 0&&r.addressTableLookups.length>0?$We(r.addressTableLookups,e?.addressesByLookupTableAddress??{}):[],o=[...i,...s],a=r.instructions.map(g=>VWe(g,o)),u=a[0],l=jWe(r.lifetimeToken,u,e?.lastValidBlockHeight);return pipe(PWe({version:r.version}),g=>DWe(n,g),g=>a.reduce((y,A)=>FWe(A,y),g),g=>"blockhash"in l?oWe(l,g):LWe(l,g))}function KWe(r){const e=Object.values(r);if(e.length===0)throw new al(fUe);return e.map(n=>n||new Uint8Array(64).fill(0))}function GWe(){return xue(k4(Iue(vF(),64),{size:Yue()}),KWe)}function MF(){return lce([["signatures",GWe()],["messageBytes",vF()]])}function Sce(){return Bue(fce([["signatures",mS(nF(wF(),64),{size:bF()})],["messageBytes",wF()]]),qWe)}function Pft(){return combineCodec(MF(),Sce())}function qWe(r){const{messageBytes:e,signatures:n}=r,i=Om([PF(),Rue(Que(),2),mS(yF(),{size:bF()})]),[s,o,a]=i.decode(e),u=a.slice(0,o);if(u.length!==n.length)throw new al(dUe,{numRequiredSignatures:o,signaturesLength:n.length,signerAddresses:u});const l={};return u.forEach((g,y)=>{const A=n[y];A.every(I=>I===0)?l[g]=null:l[g]=A}),{messageBytes:e,signatures:Object.freeze(l)}}var ZWe="11111111111111111111111111111111";function YWe(r,e){return e[r.programAddressIndex]===ZWe&&r.data!=null&&XWe(r.data)&&r.accountIndices?.length===3}function XWe(r){return r.byteLength===4&&r[0]===4&&r[1]===0&&r[2]===0&&r[3]===0}async function Nft(r){const e=r.instructions[0],{staticAccounts:n}=r;if(e&&YWe(e,n)){const i=n[e.accountIndices[0]];if(!i)throw new SolanaError(SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE,{nonce:r.lifetimeToken});return{nonce:r.lifetimeToken,nonceAccountAddress:i}}else return{blockhash:r.lifetimeToken,lastValidBlockHeight:0xffffffffffffffffn}}function JWe(r){return"lifetimeConstraint"in r&&"blockhash"in r.lifetimeConstraint&&typeof r.lifetimeConstraint.blockhash=="string"&&typeof r.lifetimeConstraint.lastValidBlockHeight=="bigint"&&isBlockhash(r.lifetimeConstraint.blockhash)}function Mft(r){if(!JWe(r))throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME)}function QWe(r){return"lifetimeConstraint"in r&&"nonce"in r.lifetimeConstraint&&typeof r.lifetimeConstraint.nonce=="string"&&typeof r.lifetimeConstraint.nonceAccountAddress=="string"&&isAddress(r.lifetimeConstraint.nonceAccountAddress)}function Lft(r){if(!QWe(r))throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME)}function eHe(r){const e=compileTransactionMessage(r),n=getCompiledTransactionMessageEncoder().encode(e),i=e.staticAccounts.slice(0,e.header.numSignerAccounts),s={};for(const a of i)s[a]=null;let o;return isTransactionMessageWithBlockhashLifetime(r)?o={blockhash:r.lifetimeConstraint.blockhash,lastValidBlockHeight:r.lifetimeConstraint.lastValidBlockHeight}:isTransactionMessageWithDurableNonceLifetime(r)&&(o={nonce:r.lifetimeConstraint.nonce,nonceAccountAddress:r.instructions[0].accounts[0].address}),Object.freeze({...o?{lifetimeConstraint:o}:void 0,messageBytes:n,signatures:Object.freeze(s)})}var LF;function Dft(r){LF||(LF=getBase58Decoder());const e=Object.values(r.signatures)[0];if(!e)throw new SolanaError(SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING);return LF.decode(e)}async function tHe(r,e){let n,i;if(await Promise.all(r.map(async s=>{const o=await getAddressFromPublicKey(s.publicKey),a=e.signatures[o];if(a===void 0){i||=new Set,i.add(o);return}if(i)return;const u=await signBytes(s.privateKey,e.messageBytes);a!==null&&bytesEqual(u,a)||(n||={},n[o]=u)})),i&&i.size>0){const s=Object.keys(e.signatures);throw new SolanaError(SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION,{expectedAddresses:s,unexpectedAddresses:[...i]})}return n?Object.freeze({...e,signatures:Object.freeze({...e.signatures,...n})}):e}async function Uft(r,e){const n=await tHe(r,e);return Ice(n),Object.freeze(n),n}function rHe(r){return Object.entries(r.signatures).every(([e,n])=>!!n)}function Ice(r){const e=[];if(Object.entries(r.signatures).forEach(([n,i])=>{i||e.push(n)}),e.length>0)throw new SolanaError(SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING,{addresses:e})}function nHe(r){const e=MF().encode(r);return Hue().decode(e)}var Fft=1280,Wft=null,sA=null;function DF(r){return MF().getSizeFromValue(r)}function iHe(r){return DF(r)<=sA}function sHe(r){const e=DF(r);if(e>sA)throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT,{transactionSize:e,transactionSizeLimit:sA})}function Hft(r){return rHe(r)&&iHe(r)}function zft(r){Ice(r),sHe(r)}function kce(r){return DF(eHe(r))}function $ft(r){return kce(r)<=sA}function Vft(r){const e=kce(r);if(e>sA)throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT,{transactionSize:e,transactionSizeLimit:sA})}var oHe=tn(36533).Buffer;const aHe=(r,e,n)=>{const i=Uint8Array.from(oHe.from(e,"hex")),o=Wue().encode(r),u=Sce().decode(o),l={...u,signatures:{...u.signatures,[n]:i}},g=nHe(l),A=Due().decode(i);return{signedTransaction:g,txHash:A}};function uHe(r,e){const n=r[e]?.[Ti.SIGN];return Mi(n,"localCompileTransaction: sign output is required"),Mi(n.output.signResult,"localCompileTransaction: signResult is required"),{signOutput:n,signResult:n.output.signResult}}function cHe(r,e){const n="signableTransaction"in e.signOutput.output?e.signOutput.output.signableTransaction.transaction:r.signableTransaction.transaction,i=ate(n,hue(e.signResult[0]));return{signedTransaction:i,txHash:nT(i)}}var lHe=tn(36533).Buffer;function fHe(r,e,n){try{ki("localCompileTransaction: start",{txId:r,input:e});const i=uHe(n.outputMap,r),{signableTransaction:s}=e;switch(s.kind){case"solana":{const{serializedMessage:o,address:a,base64Tx:u}=s.transaction;Mi(u||o,"base64Tx or serializedMessage is required");const l=u??(Mi(o,"serializedMessage is required when base64Tx is absent"),lHe.from(o).toString("base64")),g=aHe(l,i.signResult[0],a);return ki("localCompileTransaction: end \u2705",g),{kind:H2.LOCAL_COMPILE_TRANSACTION,output:g}}case"evm":{const o=cHe(e,i);return ki("localCompileTransaction: end \u2705 (EVM)",o),{kind:H2.LOCAL_COMPILE_TRANSACTION,output:o}}default:throw new Error("localCompileTransaction: Unsupported chain")}}catch(i){throw ki("localCompileTransaction: error \u274C",{error:i}),new Eo({code:fs.UNKNOWN_ERROR,message:"localCompileTransaction failed",cause:i instanceof Error?i.message:String(i)})}}function dHe(r){return r.item.kind===H2.LOCAL_COMPILE_TRANSACTION}const hHe=async(r,e,n)=>{const i={},s=n.filter(gue);s.length>0&&Object.assign(i,await GDe(r.adaptor,s,{outputMap:e.outputMap}));for(const o of n)if(!gue(o)){if(dHe(o)){i[o.txId]=fHe(o.txId,o.item.input,{outputMap:e.outputMap});continue}throw new Error(`handleCompile: Unsupported kind: ${String(o.item.kind)}`)}return i};function pHe(r,e){const n=r[e];Mi(n,`${e}: outputMap[txId] is required`);const i=n?.[Ti.FETCH_ORDER_ID]?.output?.orderId;return Mi(i,`${e}: orderId is required`),{orderId:i}}const Rce=qr({sellOffRatio:fn(),sellPriceMultiplier:fn(),side:pt(),strategyName:pt(),walletAddress:pt(),walletChainId:pt(),walletId:pt()}),jft=qr({fromTokenAddress:pt(),fromTokenSymbol:pt(),fromNetworkId:pt(),slippage:pt(),toTokenSymbol:pt(),toTokenAddress:pt(),toNetworkId:pt(),feeDetail:J2,vendorId:pt(),subVendorId:pt(),networkFee:Ao,bridgeFee:Ao,fromTokenSymbolOnChain:pt(),fromTokenAmount:Ao,fromBinanceChainId:pt(),toBinanceChainId:pt(),toTokenAmount:Ao,toTokenSymbolOnChain:pt(),fromChainInfo:qr({wcId:pt(),transactionType:pt()}),toChainInfo:qr({wcId:pt(),transactionType:pt()}),fromWalletAddress:pt(),toWalletAddress:pt(),quoteId:pt(),nativeTokenDecimals:fn(),estimatedTime:sn(fn()),uniQuoteId:pt(),slippageMode:pt(),swapGasLevel:pt(),securityCheckId:pt(),requestId:pt(),orderSource:pt(),sellStrategy:un(Rce),side:un(ra([qu(G2.BUY),qu(G2.SELL)])),extra:Ua(),proofKeyPublicKey:un(pt()),timestampSignature:un(pt()),timestamp:un(pt()),walletType:un(pt()),walletFrom:un(pt()),userPublicKeyHex:un(pt()),presetId:un(pt())}),gHe=qr({depositFee:Ao,bridgeFee:Ao,fromAmount:Ao,fromCoin:pt(),fromCoinOnChain:pt(),fromContractAddress:pt(),fromNetwork:pt(),fromWalletAddress:pt(),minReceive:Ao,slippage:pt(),slippageMode:pt(),toAmount:Ao,toCoin:pt(),toCoinOnChain:pt(),toContractAddress:pt(),toNetwork:pt(),toWalletAddress:pt(),fromNetworkId:pt(),toNetworkId:pt(),quoteId:pt(),vendorId:pt(),subVendorId:pt(),estimatedTime:sn(fn()),uniQuoteId:pt(),fromBinanceChainId:pt(),toBinanceChainId:pt(),feeDetail:J2,orderId:pt(),orderSource:pt(),gasLevel:pt(),depositTxId:pt(),requestId:pt(),sellStrategy:un(Rce),side:un(ra([qu(G2.BUY),qu(G2.SELL)])),presetId:un(pt()),extra:un(Ua()),proofKeyPublicKey:un(pt()),timestampSignature:un(pt()),timestamp:un(pt()),walletType:un(pt()),walletFrom:un(pt()),userPublicKeyHex:un(pt())}),Kft=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:sn(Ua()),success:Wi()}),Gft=qr({success:Wi()}),yHe=(r,e,n)=>{const{extra:i,...s}=e,o=Eu(gHe,s);if(!o.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchPrePlaceOrder api error",cause:uu(o.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/swap/pre-dex-order",data:{...o.output,...i},options:n})};function Cce(r){const{fromTokenAddress:e,fromTokenSymbol:n,fromNetworkId:i,slippage:s,toTokenSymbol:o,toTokenAddress:a,toNetworkId:u,feeDetail:l,vendorId:g,networkFee:y,bridgeFee:A,fromTokenSymbolOnChain:I,fromTokenAmount:P,fromBinanceChainId:D,toBinanceChainId:U,toTokenAmount:V,toTokenSymbolOnChain:J,fromWalletAddress:re,toWalletAddress:ce,quoteId:Re,subVendorId:De,estimatedTime:Ue,uniQuoteId:Ve,fromChainInfo:pe,toChainInfo:Se,slippageMode:Ce,swapGasLevel:je,orderSource:$e,securityCheckId:Qe,side:nt,extra:Ne,presetId:Me}=r;return{depositFee:y,bridgeFee:A,fromAmount:P,fromCoin:n,fromCoinOnChain:I,fromContractAddress:Q2.getSwapContractAddress(D,e),fromNetwork:i,fromWalletAddress:pe.wcId.startsWith("eip155:")?re.toLowerCase():re,minReceive:Zu(UU(s,V)).decimalPlaces(8,Zu.ROUND_DOWN).toFixed(),slippage:s,slippageMode:Ce,toAmount:V,toCoin:o,toCoinOnChain:J,toContractAddress:Q2.getSwapContractAddress(U,a),toNetwork:u,toWalletAddress:Se.wcId.startsWith("eip155:")?ce.toLowerCase():ce,fromNetworkId:i,toNetworkId:u,quoteId:Re,vendorId:g,subVendorId:De,estimatedTime:Ue,uniQuoteId:Ve,fromBinanceChainId:D,toBinanceChainId:U,feeDetail:l,orderSource:$e,gasLevel:je,requestId:Qe,side:nt,presetId:Me,extra:Ne}}function mHe(r,e){return{...Cce(r),orderId:e.orderId,depositTxId:"",sellStrategy:r.sellStrategy,proofKeyPublicKey:r.proofKeyPublicKey,timestampSignature:r.timestampSignature,timestamp:r.timestamp,walletType:r.walletType,walletFrom:r.walletFrom,userPublicKeyHex:r.userPublicKeyHex}}function bHe(r){return{success:r.success}}async function vHe(r,e,n,i){ki("prePlaceNormalOrder: start",{txId:e});const s=mHe(n,i),o=await yHe(r,s,{headers:{"x-w3w-request-id":n.requestId}}),a=bHe(o);return ki("prePlaceNormalOrder: end \u2705",{txId:e,output:a}),{kind:qT.PRE_PLACE_NORMAL_ORDER,output:a}}const wHe=async(r,e,n)=>{ki("handlePrePlaceOrder: start",{size:n.length});const i={};for(const s of n){const{txId:o,item:a}=s;switch(a.kind){case qT.PRE_PLACE_NORMAL_ORDER:{const u=pHe(e.outputMap,o);i[o]=await vHe(r.adaptor.serverAdaptor,o,a.input,u);break}default:throw new Error(`handlePrePlaceOrder: Unsupported kind: ${a.kind}`)}}return ki("handlePrePlaceOrder: end \u2705"),i},AHe=async(r,e,n)=>{const i=Kl.getGlobal(),s=Date.now();i.debug("API \u2192 fetchTxReport$ (request)",{orderCount:e.orderList?.length,firstOrderId:e.orderList?.[0]?.orderId,extDataType:typeof e.orderList?.[0]?.extData,feeObjType:typeof e.orderList?.[0]?.extData?.feeObj});const o=Eu(uLe,e);if(!o.success){const a=uu(o.issues),u=e.orderList?.[0];throw i.error("API \u2192 fetchTxReport$ (schema error)",{issues:a,paramsPreview:{orderListLength:e.orderList?.length,firstOrderKeys:u?Object.keys(u):[],extData:u?.extData,feeObjKeys:u?.extData?.feeObj?Object.keys(u.extData.feeObj):[]}}),new Eo({code:fs.SCHEMA_ERROR,message:"fetchTxReport api error",cause:a})}try{const a=await r.request({method:"POST",url:"/bapi/defi/v2/private/wallet-direct/tx-report",data:o.output,options:n}),u=Date.now()-s;return i.debug(`API \u2192 fetchTxReport$ (response: ${u}ms)`,{success:a.success,resultsCount:a.data?.results?.length}),a}catch(a){const u=Date.now()-s;throw i.error(`API \u2192 fetchTxReport$ (failed: ${u}ms)`,{error:a?.message||String(a)}),a}};function _He(r){const e={approve:{binanceChainId:r.fromBinanceChainId,contractAddress:r.fromTokenAddress,tokenSymbol:r.fromTokenSymbol,decimals:r.fromTokenDecimals,to:r.approvalAddress,amount:qo(r.approvalAmount)}};return{to:r.fromTokenAddress,txType:Rm.APPROVE,subType:eA.APPROVE,instructions:e,feeValue:qo(r.feeValue)}}function EHe(r){const e={send:[{address:r.fromWalletAddress,binanceChainId:r.fromBinanceChainId,contractAddress:r.fromTokenAddress,amount:qo(Cc(r.fromTokenAmount,r.fromTokenDecimals).toFixed()),decimals:r.fromTokenDecimals,tokenSymbol:r.fromTokenSymbol}],receive:void 0,contractCall:{to:r.to||"",toLabel:"",input:r.data||""}};return{to:r.to||"",txType:Rm.BRIDGE,subType:eA.BRIDGE,instructions:e,extData:r.extData,feeValue:qo(r.feeValue)}}function THe(r){const e={send:[{address:r.fromWalletAddress,binanceChainId:r.fromBinanceChainId,contractAddress:r.fromTokenAddress,amount:qo(Cc(r.fromTokenAmount,r.fromTokenDecimals).toFixed()),decimals:r.fromTokenDecimals,tokenSymbol:r.fromTokenSymbol}],receive:[{address:r.toWalletAddress,binanceChainId:r.toBinanceChainId,contractAddress:r.toTokenAddress,amount:qo(Cc(r.toTokenAmount,r.toTokenDecimals).toFixed()),decimals:r.toTokenDecimals,tokenSymbol:r.toTokenSymbol}],contractCall:{to:r.to||"",toLabel:"",input:r.data||""}};return{to:r.to||"",txType:Rm.SWAP,subType:eA.SWAP,instructions:e,extData:r.extData,feeValue:qo(r.feeValue)}}function SHe(r){return{to:r.fromTokenAddress||"",txType:Rm.CONTRACT_CALL,subType:eA.CONTRACT_CALL,instructions:{contractCall:{to:r.fromTokenAddress||"",toLabel:"",input:r.data||""}},feeValue:qo(r.feeValue)}}function IHe(r){switch(r.kind){case mg.SWAP_TX_REPORT_BROADCAST:return THe(r.input);case mg.BRIDGE_TX_REPORT_BROADCAST:return EHe(r.input);case mg.APPROVE_TX_REPORT_BROADCAST:return _He(r.input);case mg.WRAP_TX_REPORT_BROADCAST:return SHe(r.input);default:throw new Error("buildBackendReport: Unsupported kind")}}const kHe=qr({"frontend.broadcast.nodes":es(pt())}),qft=qr({broadcastConfigs:pt(),unsignedTx:pt(),digest:pt(),newSolTx:qr({base64Tx:pt()}),fromBinanceChainId:pt(),fromWalletAddress:pt(),requestId:pt(),orderId:un(pt())}),Zft=qr({kind:qu(mg.FRONTEND_BROADCAST),output:qr({txHash:un(pt()),orderId:un(pt()),error:un(pt())})}),RHe=r=>r!==null&&typeof r<"u";function xce(r,e){const n=r[e]?.[Ti.COMPILE]?.output?.signedTransaction;return Mi(n,`broadcast: signedTransaction is required, txId=${e}`),n}function UF(r,e,n){const i=r[e],s=n??i?.[Ti.FETCH_ORDER_ID]?.output?.orderId??i?.orderId;return Mi(s,`broadcast: orderId is required, txId=${e}`),s}function CHe(r,e){const n=r[e]?.[Ti.SIGN]?.output;if(n&&"nonce"in n&&RHe(n.nonce))return n.nonce}function xHe(r,e,n){return{signedTransaction:xce(r,e),orderId:UF(r,e,n),nonce:CHe(r,e)}}function Bce(r){const e=JSON.parse(r);if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Expected object");const n=Eu(kHe,e);if(!n.success)throw new Error(uu(n.issues));return e}function BHe(r,e){try{return Bce(r)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Error(`invalid broadcastConfigs json: ${i}, txId=${e}`)}}function OHe(r){if(r)try{return Bce(r)}catch{return}}function PHe(r,e,n){return{signedTransaction:xce(r,e),broadcastConfig:BHe(n.broadcastConfigs,e),fromBinanceChainId:n.fromBinanceChainId,fromWalletAddress:n.fromWalletAddress,requestId:n.requestId,orderIdFallback:n.orderId}}function NHe(r,e){if(!e||typeof e!="object"||!("kind"in e)||e.kind!=="evm"||!("transaction"in e)||!e.transaction||typeof e.transaction!="object")return;const n=e.transaction;return JSON.stringify({jsonrpc:"2.0",method:"eth_sendTransaction",params:[{from:r,to:n.to,value:n.value,data:n.data}],id:1})}function MHe(r){const e=r.input.input,n=r.frontendBroadcastConfig?.[tA.BroadcastNodes];if(n&&n.length>0)return r.frontendBroadcastConfig;const i={};return e.mevConfig.enable&&(i[tA.Mev]=!0),e.isGasFree&&(i["gas.account.type"]="Bep414",i["bep414.policy.id"]=e.bep414PolicyId),(r.input.kind===mg.SWAP_TX_REPORT_BROADCAST||r.input.kind===mg.BRIDGE_TX_REPORT_BROADCAST)&&"tags"in e&&e.tags&&(i["keter.tags"]=e.tags),Object.keys(i).length>0?i:void 0}function LHe(r,e){if("extData"in r&&r.extData)return r.extData;if("extData"in e&&e.extData)return e.extData}function DHe(r,e){const n=e.map(i=>{const s=i.input.input,o=IHe(i.input),a=xHe(r,i.txId),u=MHe(i);let l=o.nonce,g=o.rawData;return typeof a.nonce=="number"&&(l=a.nonce,"baseTransaction"in s&&(g=NHe(s.fromWalletAddress,s.baseTransaction)??g)),{binanceChainId:s.fromBinanceChainId,feeValue:o.feeValue,feeTokenAddress:s.nativeTokenAddress,address:s.fromWalletAddress,feeTokenDecimals:s.nativeTokenDecimals,status:Kae.PENDING,actionType:qU.DEFAULT,from:s.fromWalletAddress,source:s.source,signedTransaction:a.signedTransaction,to:o.to,txType:o.txType,subType:o.subType,broadcastOption:u?JSON.stringify(u):void 0,instructions:o.instructions,nonce:l,rawData:g,extData:LHe(o,s),orderId:a.orderId}});return{requestId:e[0]?.input.input.requestId??"",orderList:n}}function UHe(r,e,n){const i=new Map;for(const o of e)i.set(UF(r,o.txId),o.txId);const s=new Map;for(const o of n){const a=i.get(o.orderId);a&&s.set(a,{txId:a,orderId:o.orderId,txHash:o.txHash,txStatus:o.txStatus,error:o.error??void 0,errorCode:o.errorCode??void 0,errorParams:o.errorParams??void 0})}return s}async function FHe(r,e,n){if(ki("executeBackendChannel: start",{size:n.length}),n.length===0)return new Map;try{const{requestId:i,orderList:s}=DHe(e,n),o=await AHe(r,{orderList:s},{headers:{"x-w3w-request-id":i}});if(!o.success)throw new Error(o.message||"tx report failed");const a=UHe(e,n,o.data?.results??[]);return ki("executeBackendChannel: end \u2705",{size:n.length}),a}catch(i){if(i instanceof Eo)throw i;const s=i instanceof Error?i.message:String(i);throw new Error(`Backend broadcast failed: ${s}`)}}const WHe=qr({orderId:pt(),binanceChainId:pt(),txHash:pt(),address:pt(),status:pt()}),Yft=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:pt(),success:Wi()}),HHe=(r,e,n)=>{const i=Eu(WHe,e);if(!i.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchTxModify api error",cause:uu(i.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/tx-modify",data:i.output,options:n})},zHe=r=>new Promise((e,n)=>{let i=0;const s=r.length;r.forEach(o=>{o.then(e).catch(()=>{i++,i===s&&n(new Error("All promises rejected"))})})});async function $He(r,e,n){const i=await zHe(n.map(o=>r.request({method:"POST",url:o,data:JSON.stringify({id:1,jsonrpc:"2.0",method:"sendTransaction",params:[e,{encoding:"base64"}]}),options:{privateRequest:!0}})));let s;try{s=JSON.parse(i?.data||"{}")?.result}catch{s=void 0}return{success:i?.status===200&&!!s,txHash:s,error:i?.errMsg}}async function VHe(r,e){try{switch(e.binanceChainId){case K2:{const n=e.frontendBroadcastConfig[tA.BroadcastNodes];if(!n?.length)return{error:"no broadcast nodes"};const i=await $He(r,e.signedTransaction,n);return i.success&&i.txHash?{txHash:i.txHash}:{error:i.error||"broadcast solana transaction failed"}}default:return{error:`multiBroadcast: unsupported chain: ${e.binanceChainId}`}}}catch(n){return{error:n instanceof Error?n.message:String(n)}}}async function jHe(r,e,n){const i=new Map;return n.length===0||await Promise.all(n.map(async s=>{try{const o=PHe(e,s.txId,s.input),a=o.broadcastConfig[tA.BroadcastNodes];if(!a||a.length===0){i.set(s.txId,{txId:s.txId});return}const u=await VHe(r,{signedTransaction:o.signedTransaction,binanceChainId:o.fromBinanceChainId,frontendBroadcastConfig:o.broadcastConfig});if(!u.txHash){i.set(s.txId,{txId:s.txId,error:u.error||"frontend broadcast failed"});return}if(i.set(s.txId,{txId:s.txId,txHash:u.txHash}),o.requestId&&o.fromWalletAddress){const l=UF(e,s.txId,o.orderIdFallback);HHe(r,{orderId:l,binanceChainId:o.fromBinanceChainId,txHash:u.txHash,address:o.fromWalletAddress,status:Kae.SUBMITTED},{headers:{"x-w3w-request-id":o.requestId}}).catch(()=>{})}}catch(o){i.set(s.txId,{txId:s.txId,error:o instanceof Error?o.message:String(o)})}})),i}function KHe(r){return r.item.kind===ev.BACKEND_ONLY}function GHe(r){return{txId:r.txId,input:r.item.input.backendBroadcast}}function qHe(r,e){return{kind:ev.BACKEND_ONLY,output:{backend:{kind:r.kind,output:{txHash:e?.txHash,orderId:e?.orderId,txStatus:e?.txStatus,error:e?.error,errorCode:e?.errorCode,errorParams:e?.errorParams}}}}}function ZHe(r){return r.item.kind===ev.FRONTEND_ONLY}function YHe(r){return{txId:r.txId,input:r.item.input.frontendBroadcast}}function XHe(r,e){return{kind:ev.FRONTEND_ONLY,output:{frontend:{kind:mg.FRONTEND_BROADCAST,output:{txHash:e?.txHash,error:e?.error}}}}}function JHe(r){return r.item.kind===ev.BOTH}function QHe(r){return{backend:{txId:r.txId,input:r.item.input.backendBroadcast,frontendBroadcastConfig:OHe(r.item.input.frontendBroadcast.broadcastConfigs)},frontend:{txId:r.txId,input:r.item.input.frontendBroadcast}}}function eze(r,e,n,i){return{kind:ev.BOTH,output:{backend:{kind:r.kind,output:{txHash:n?.txHash,orderId:n?.orderId,txStatus:n?.txStatus,error:n?.error,errorCode:n?.errorCode,errorParams:n?.errorParams}},frontend:{kind:mg.FRONTEND_BROADCAST,output:{txHash:i?.txHash,error:i?.error}}}}}function Oce(r){if(r?.error)throw new Eo({code:fs.BACKEND_BROADCAST_ERROR,message:r.error,data:r})}const tze=async(r,e,n)=>{ki("handleBroadcast: start",{size:n.length});const i=n.filter(KHe),s=n.filter(ZHe),a=n.filter(JHe).map(QHe),u=[...i.map(GHe),...a.map(I=>I.backend)],l=[...s.map(YHe),...a.map(I=>I.frontend)],[g,y]=await Promise.all([u.length?FHe(r.adaptor.serverAdaptor,e.outputMap,u):Promise.resolve(new Map),l.length?jHe(r.adaptor.serverAdaptor,e.outputMap,l):Promise.resolve(new Map)]),A={};for(const I of n)switch(I.item.kind){case"BACKEND_ONLY":{const P=g.get(I.txId);Oce(P),A[I.txId]=qHe(I.item.input.backendBroadcast,P);break}case"FRONTEND_ONLY":{A[I.txId]=XHe(I.item.input.frontendBroadcast,y.get(I.txId));break}case"BOTH":{const P=g.get(I.txId);Oce(P),A[I.txId]=eze(I.item.input.backendBroadcast,I.item.input.frontendBroadcast,P,y.get(I.txId));break}default:throw new Error("handleBroadcast: Unsupported kind")}return ki("handleBroadcast: end \u2705",{size:n.length}),A},Xft=qr({}),rze=qr({depositFee:Ao,bridgeFee:Ao,fromAmount:Ao,fromCoin:pt(),fromCoinOnChain:pt(),fromContractAddress:pt(),fromNetwork:pt(),fromWalletAddress:pt(),minReceive:Ao,slippage:pt(),slippageMode:pt(),toAmount:Ao,toCoin:pt(),toCoinOnChain:pt(),toContractAddress:pt(),toNetwork:pt(),toWalletAddress:pt(),fromNetworkId:pt(),toNetworkId:pt(),quoteId:pt(),vendorId:pt(),subVendorId:pt(),estimatedTime:sn(fn()),uniQuoteId:pt(),fromBinanceChainId:pt(),toBinanceChainId:pt(),feeDetail:J2,orderId:pt(),orderSource:pt(),gasLevel:pt(),side:un(ra([qu(G2.BUY),qu(G2.SELL)])),presetId:un(pt()),depositTxId:pt(),requestId:pt(),extra:un(Ua())}),Jft=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:sn(Ua()),success:Wi()}),Qft=qr({success:Wi()}),nze=(r,e,n)=>{const{extra:i,...s}=e,o=Eu(rze,s);if(!o.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchPlaceOrder api error",cause:uu(o.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/swap/place-dex-order",data:{...o.output,...i},options:n})};function FF(r){return{success:r.success}}function ize(r,e){return{...Cce(r),orderId:e.orderId,depositTxId:e.depositTxId}}function sze(r,e){return r.find(n=>String(n?.txId)===String(e))}function B4(r,e){for(const n of r)if(n?.kind===e)return String(n.txId);return null}function oze(r,e){const n=r?.steps;if(Array.isArray(n))return n.find(i=>i?.step===e)}function Pce(r,e){const n=r[e];Mi(n,`${e}: output is required before placeOrder`);const i=n?.[Ti.FETCH_ORDER_ID]?.output?.orderId;return Mi(i,`${e}: orderId is required`),i}function WF(r,e){return r[e]?.[Ti.COMPILE]?.output?.txHash??null}function Nce(r,e,n){const i=r[e];Mi(i,`${n}: output is required`);const s=i?.[Ti.SIGN];Mi(s,`${n}: sign step output is required`);const o=s.output?.signResult;return dae(Array.isArray(o)&&o.length>0,`${n}: signResult is required`),o}function aze(r,e,n){const i=sze(r,n);Mi(i,`${n}: tx plan is required`);const s=oze(i,Ti.PRE_PLACE_ORDER);return Mi(s,`${n}: prePlaceOrder step is required for PLACE_ORDER`),dae(s.kind===qT.PRE_PLACE_NORMAL_ORDER,`${n}: prePlaceOrder kind must be ${qT.PRE_PLACE_NORMAL_ORDER}`),{orderId:Pce(e,n),depositTxId:WF(e,n)??"",prePlaceOrderInput:s.input}}async function uze(r,e,n,i){ki("placeNormalOrder: start",{txId:i});const s=aze(e,n,i),o=ize(s.prePlaceOrderInput,s),a=await nze(r,o,{headers:{"x-w3w-request-id":s.prePlaceOrderInput.requestId}}),u=FF(a);return ki("placeNormalOrder: end \u2705",{txId:i,output:u}),{kind:Z1.PLACE_ORDER,output:u}}const edt=qr({quoteId:pt(),uniQuoteId:pt(),requestId:pt(),vendorId:pt(),orderSource:pt()}),cze=qr({swapWrappedTxHash:sn(pt()),approvalTxHash:sn(pt()),signedTypedData:pt(),quoteId:pt(),uniQuoteId:pt(),orderId:pt(),vendorId:pt(),orderSource:pt()}),tdt=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:sn(Ua()),success:Wi()}),rdt=qr({success:Wi()}),lze=(r,e,n)=>{const i=Eu(cze,e);if(!i.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchPlaceIntentOrder api error",cause:uu(i.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/swap/place-rfq-order",data:i.output,options:n})};function fze(r,e,n){const i=e[n];Mi(i,`${n}: output is required before placeIntentOrder`);const s=i?.[Ti.SIGN]?.output?.signResult,o=Array.isArray(s)?s[0]:void 0;Mi(o,`${n}: signedTypedData is required`);const a=B4(r,wu.WRAP),u=B4(r,wu.APPROVE);return{orderId:Pce(e,n),signedTypedData:o,swapWrappedTxHash:a?WF(e,a):null,approvalTxHash:u?WF(e,u):null}}function dze(r,e){return{signedTypedData:e.signedTypedData,quoteId:r.quoteId,uniQuoteId:r.uniQuoteId,orderId:e.orderId,swapWrappedTxHash:e.swapWrappedTxHash,approvalTxHash:e.approvalTxHash,vendorId:r.vendorId,orderSource:r.orderSource}}async function hze(r,e,n,i,s){ki("placeIntentOrder: start",{txId:i});const o=fze(e,n,i),a=dze(s,o),u=await lze(r,a,{headers:{"x-w3w-request-id":s.requestId}}),l=FF(u);return ki("placeIntentOrder: end \u2705",{txId:i,output:l}),{kind:Z1.PLACE_INTENT_ORDER,output:l}}const ndt=qr({orderId:pt(),txData:es(tue),requestId:pt(),fromBinanceChainId:pt(),fromWalletAddress:pt(),extra:un(Ua())}),pze=qr({orderId:pt(),binanceChainId:pt(),userAddress:pt(),requestId:pt(),txData:es(qr({type:pt(),digest:pt(),txHash:sn(pt()),broadcastConfigs:pt(),unsignedTx:pt(),signatures:es(pt()),newEvmTx:sn(qr({from:pt(),to:pt(),data:pt(),value:fn(),nonce:fn(),gasLimit:fn(),gasPrice:sn(fn()),maxFeePerGas:sn(fn()),maxPriorityFeePerGas:sn(fn())})),newSolTx:sn(qr({base64Tx:pt()})),feeDetail:eue})),extra:un(Ua())}),idt=qr({code:pt(),message:sn(pt()),messageDetail:sn(pt()),data:sn(Ua()),success:Wi()}),sdt=qr({success:Wi()}),gze=(r,e,n)=>{const{extra:i,...s}=e,o=Eu(pze,s);if(!o.success)throw new Eo({code:fs.SCHEMA_ERROR,message:"fetchPlaceFlashOrder api error",cause:uu(o.issues)});return r.request({method:"POST",url:"/bapi/defi/v1/private/wallet-direct/flash-swap/place-order",data:{...o.output,...i},options:n})};function yze(r,e,n){const i=B4(r,wu.APPROVE),s=B4(r,wu.SWAP);return{txData:n.txData.map(a=>{if(a.type==="approve")return Mi(i,"placeFlashOrder: approve tx is required"),{txDataItem:a,signatures:Nce(e,i,`approve(${i})`)};if(a.type==="swap")return Mi(s,"placeFlashOrder: swap tx is required"),{txDataItem:a,signatures:Nce(e,s,`swap(${s})`)}}).filter(a=>!!a)}}function mze(r,e){return{orderId:r.orderId,binanceChainId:r.fromBinanceChainId,userAddress:r.fromWalletAddress,requestId:r.requestId,txData:e.txData.map(({txDataItem:n,signatures:i})=>({...n,signatures:i})),extra:r.extra}}async function bze(r,e,n,i,s){ki("placeFlashOrder: start",{txId:i});const o=yze(e,n,s),a=mze(s,o),u=await gze(r,a,{headers:{"x-w3w-request-id":s.requestId}}),l=FF(u);return ki("placeFlashOrder: end \u2705",{txId:i,output:l}),{kind:Z1.PLACE_FLASH_ORDER,output:l}}const vze=async(r,e,n)=>{const i=r.adaptor.serverAdaptor,s=e.planList,o=e.outputMap;ki("handlePlaceOrder: start",{size:n.length});const a={};for(const u of n){const{txId:l,item:g}=u,y=g.kind;switch(y){case Z1.PLACE_ORDER:a[l]=await uze(i,s,o,l);break;case Z1.PLACE_INTENT_ORDER:a[l]=await hze(i,s,o,l,g.input);break;case Z1.PLACE_FLASH_ORDER:a[l]=await bze(i,s,o,l,g.input);break;default:throw new Error(`${l}: Unsupported place order kind: ${y}`)}}return ki("handlePlaceOrder: end \u2705",{size:n.length}),a},wze={[Ti.FETCH_ORDER_ID]:_De,[Ti.SIGN]:HDe,[Ti.COMPILE]:hHe,[Ti.PRE_PLACE_ORDER]:wHe,[Ti.BROADCAST]:tze,[Ti.PLACE_ORDER]:vze};function Aze(r){if(r.length===0)return;const e=String(r[0].txId);if(e.includes("#"))return"Extension";if(e==="FLASH_SWAP")return"Flash";if(e==="INTENT_SWAP")return"Intent";if(e==="APPROVE"||e==="SWAP")return"ProMarket"}const _ze=[Ti.FETCH_ORDER_ID,Ti.SIGN,Ti.COMPILE,Ti.PRE_PLACE_ORDER,Ti.BROADCAST,Ti.PLACE_ORDER];function Eze(r,e){return!!e?.includes(r)}async function Tze(r,e,n,i){const s=yS(),o=Aze(n),a=Kl.create({traceId:s,phase:"Submit",scenario:o}),u=new sue(s,"Submit",o),l=n.map(P=>({txId:P.txId,steps:P.steps.map(D=>({step:D.step,kind:D.kind}))})),g=rA.formatStartSummary(s,"Submit",o,l);a.summary(g);const y={...i?.initialOutputMap??{}},A={planList:n,outputMap:y};async function I(P){var D,U,V,J;const re=Re=>i?.runSteps?Eze(P,i.runSteps):y?.[Re]?.[P]==null,ce=[];for(const Re of n){(D=y)[U=Re.txId]??(D[U]={}),(V=y[Re.txId]).kind??(V.kind=Re.kind);const De=Re.steps.find(Ue=>Ue.step===P);if(De){if(!re(Re.txId)){u.skipStep(Re.txId,P,"already completed");continue}ce.push({txId:Re.txId,txKind:Re.kind,item:De}),u.startStep(Re.txId,P,De.kind),a.debug(`[${Re.txId}] ${P} \u2192 start`,{kind:De.kind})}}if(ce.length!==0)try{const Re=e[P],De=await Re(r,A,ce);for(const[Ue,Ve]of Object.entries(De))(J=y)[Ue]??(J[Ue]={}),y[Ue][P]=Ve,u.completeStep(Ue,P,Ve),a.info(`[${Ue}] ${P} \u2192 \u2705 success`)}catch(Re){for(const De of ce)u.failStep(De.txId,P,Re),a.error(`[${De.txId}] ${P} \u2192 \u274C failed`,{error:Re?.message||String(Re),code:Re?.code,cause:Re?.cause});throw Re}}try{for(const U of _ze)await I(U);const P=u.getSummary(),D=rA.formatFinalSummary(P);a.summary(D)}catch(P){const D=u.getSummary(),U=rA.formatFinalSummary(D);throw a.summary(U),P}return{outputMap:y}}var _g;class Sze{constructor(e,n){_g.set(this,void 0),m7e(this,_g,e,"f"),D7e(X2(this,_g,"f")),n?.logLevel&&Kl.configure({level:n.logLevel})}async fetchQuote(e){return pS({name:"fetchQuote",fn:()=>Q7e(X2(this,_g,"f"),e)})}async buildTransactionList(e,n,i){return pS({name:"buildTransactionList",fn:async()=>{const s={adaptor:X2(this,_g,"f"),stepParams:{fetchGas:{mev:n.mev,approveAmount:n.approveAmount},fetchDigest:{mev:n.mev,tipsDetail:n.tipsDetail,gasLevel:n.gasLevel,customFeeAmount:n.customFeeAmount,approveGasAccount:n.approveGasAccount,swapGasAccount:n.swapGasAccount,approveAmount:n.approveAmount}}},{outputMap:o}=await gDe(s,fDe,e,{runSteps:i?.runSteps,initialOutputMap:i?.initialOutputMap});return o}})}async submitTransactionList(e,n,i){return pS({name:"submitTransactionList",fn:async()=>{const s={adaptor:X2(this,_g,"f"),requestId:void 0,stepParams:{}},{outputMap:o}=await Tze(s,wze,e,{initialOutputMap:n?.outputMap,runSteps:i?.runSteps});return o}})}async checkApprove(e){return pS({name:"checkApprove",fn:()=>nLe(X2(this,_g,"f"),e)})}async check(e,n){return pS({name:"check",fn:()=>dLe(X2(this,_g,"f"),e,n)})}}_g=new WeakMap;var HF={},Ize=function(r,e){HF[r]=e},kze=function(r){var e;return(e=HF[r])!==null&&e!==void 0?e:null},Rze=function(r){delete HF[r]},D0,Cze=(D0={},vt(D0,"/bapi/defi/v3/private/wallet-direct/swap/aggregator/swap/get-quote","/bapi/defi/v1/public/wallet-direct/extension-wallet/swap/aggregator/swap/get-quote"),vt(D0,"/bapi/defi/v2/private/wallet-direct/swap/aggregator/swap","/bapi/defi/v1/public/wallet-direct/extension-wallet/swap/aggregator/swap"),vt(D0,"/bapi/defi/v1/private/wallet-direct/buw/gas/account/batch","/bapi/defi/v1/public/wallet-direct/extension-wallet/gas/account/batch"),vt(D0,"/bapi/defi/v1/private/wallet-direct/buw/transaction/build-transaction","/bapi/defi/v1/public/wallet-direct/extension-wallet/swap/aggregator/build-transaction"),vt(D0,"/bapi/defi/v1/private/wallet-direct/swap/pre-dex-order","/bapi/defi/v1/public/wallet-direct/extension-wallet/swap/pre-dex-order"),vt(D0,"/bapi/defi/v1/private/wallet-direct/swap/place-dex-order","/bapi/defi/v1/public/wallet-direct/extension-wallet/swap/place-dex-order"),vt(D0,"/bapi/defi/v1/private/wallet-direct/buw/transaction/compile-with-signatures","/bapi/defi/v1/public/wallet-direct/extension-wallet/swap/aggregator/compile-transaction"),vt(D0,"/bapi/defi/v2/private/wallet-direct/tx-report","/bapi/defi/v1/public/wallet-direct/extension-wallet/tx-report"),D0),oA=new Sze({serverAdaptor:{request:function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:i=n.method,s=n.data,o=n.url,a=n.options,l=Cze[o]||o,y.t0=i,y.next=y.t0==="POST"?6:y.t0==="GET"?10:14;break;case 6:return y.next=8,Zt(l,s,a);case 8:return u=y.sent,y.abrupt("break",15);case 10:return y.next=12,Ph(l,s,a);case 12:return u=y.sent,y.abrupt("break",15);case 14:throw new Error("Unsupported HTTP method: ".concat(i));case 15:return y.abrupt("return",u);case 16:case"end":return y.stop()}},e)}));return function(e){return r.apply(this,arguments)}}()},walletAdaptor:{rpcRequest:function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:i=n.method,s=n.params,o=n.binanceChainId,a=no(o),V.t0=i,V.next=V.t0===hS.TRON_CLIENT?5:18;break;case 5:if(u=s.httpMethod,l=u===void 0?"POST":u,g=s.path,y=s.body,A=cm.getRpcUrl(a),A){V.next=9;break}throw new Error("[DexSDK] Tron RPC node URL not found");case 9:return V.next=11,fetch("".concat(A).concat(g??""),{method:l,headers:{"Content-Type":"application/json"},body:y?JSON.stringify(y):void 0});case 11:if(I=V.sent,I.ok){V.next=14;break}throw new Error("[DexSDK] Tron RPC request failed: ".concat(I.status," ").concat(I.statusText));case 14:return V.next=16,I.json();case 16:return P=V.sent,V.abrupt("return",P);case 18:return V.next=20,cm.sendJsonRPC(a,{jsonrpc:"2.0",id:1,method:i,params:s});case 20:return D=V.sent,V.abrupt("return",{result:D});case 22:case"end":return V.stop()}},e)}));return function(e){return r.apply(this,arguments)}}(),sign:function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:i=n.method,s=n.params,V.t0=i,V.next=V.t0===nA.SIGN_DIRECT?4:21;break;case 4:if(o=s,a=o.data,u=o.binanceChainId,l=o.extra.quoteId,g=kze(l),g){V.next=9;break}throw new Error("[DexSDK] Sign context not found. Ensure swap approval flow is active.");case 9:return y=g.accountId,A=g.networkType,V.next=12,vn.getWalletItemByAccountId(y);case 12:if(I=V.sent,I){V.next=15;break}throw new Error("[DexSDK] Wallet not found for the current account.");case 15:return P=l,JM(P,{isCustomNetwork:!1,isSwapSign:!0}),V.next=19,li.signTx({transaction:a,accountId:y,walletId:I.id,networkType:A,chainId:u,signOrderId:P});case 19:return D=V.sent,V.abrupt("return",{result:[D],token:void 0});case 21:throw new Error("Unsupported sign method: ".concat(i));case 22:case"end":return V.stop()}},e)}));return function(e){return r.apply(this,arguments)}}()}},{logLevel:"debug"});const odt=null;var xze=function(r){var e;return(e=j2[r])!==null&&e!==void 0?e:j2.QUOTE_FETCH_FAILED},Bze=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr;return b().wrap(function(Pr){for(;;)switch(Pr.prev=Pr.next){case 0:if(s=n.requestData,s){Pr.next=4;break}throw new Error("Request data is missing");case 4:return o=s.signContext,a=s.swapParams,u=s.antiMEV,l=s.gasAccountInfo,Pr.next=7,vn.getWalletItemByAccountId(o.accountId);case 7:if(g=Pr.sent,g){Pr.next=10;break}throw new Error("Wallet item not found");case 10:return Pr.next=12,Fi.getFullNetworkByNetworkId(o.networkId);case 12:if(y=Pr.sent,y){Pr.next=15;break}throw new Error("Network not found");case 15:if(A=y,I=dh(g,A.chainType)[0],I){Pr.next=19;break}throw new Error("Wallet address not found");case 19:return Pr.next=21,y4(I,A.id);case 21:if(P=Pr.sent,D=[],U=O7.includes(A.chainType),!U){Pr.next=31;break}return Pr.next=27,li.getPublicKeyHex(g.id,o.accountId,A.chainType);case 27:if(V=Pr.sent,V){Pr.next=30;break}throw Error("Get public key failed");case 30:D.push(V);case 31:if(De={params:{fromWalletId:a.fromWalletId,fromNetwork:{wcId:A.wcId,transactionType:A.transactionType},approved:(J=a.approved)!==null&&J!==void 0?J:!1,slippage:a.slippage,fromTokenSymbol:a.fromToken.symbol,toTokenSymbol:a.toToken.symbol,nativeTokenSymbol:A.nativeToken,transferTax:(re=a.fromTokenTax)!==null&&re!==void 0?re:"0",nativeTokenDecimals:(ce=A.nativeTokenDecimals)!==null&&ce!==void 0?ce:18,isRecommendSlippage:a.slippageMode===oS.RECOMMEND,source:(Re=a.source_1)!==null&&Re!==void 0?Re:"ext-swap",publicKeys:D,walletType:P,clientOrderId:Cg()},quote:gn(Mr({},a.quote),{fromWalletAddress:I,toWalletAddress:I})},Ue=nae(De),Ue.variant!==Rc.ERROR){Pr.next=36;break}throw Ue.error;case 36:return Ve={mev:u??!1,swapGasAccount:l,approveAmount:(i=s.approvalInfo)===null||i===void 0?void 0:i.amount},Pr.next=39,oA.buildTransactionList(Ue.data,Ve,{runSteps:[Ti.FETCH_CALLDATA,Ti.FETCH_GAS]});case 39:if(pe=Pr.sent,console.log("Build transaction list result:",pe),Se=pe.data,Se){Pr.next=44;break}throw pe.error;case 44:return Ue.variant===Rc.APPROVE_AND_SWAP&&(je=Se[Gl.APPROVE]),Ce=Se[Gl.SWAP],je&&(nt=Ce==null||($e=Ce.FETCH_GAS)===null||$e===void 0?void 0:$e.output[0],Ne=je==null||(Qe=je.FETCH_GAS)===null||Qe===void 0?void 0:Qe.output[0],nt&&Ne&&(Me=u7e(l,[nt,Ne]),Ve.swapGasAccount=Me[0],Ve.approveGasAccount=Me[1])),Pr.next=50,oA.buildTransactionList(Ue.data,Ve,{runSteps:[Ti.FETCH_DIGEST],initialOutputMap:Se});case 50:if(ct=Pr.sent,!ct.error){Pr.next=53;break}throw pe.error;case 53:if(mt=i7e(Ue.data,ct.data,De.quote,gn(Mr({},De.params),{fromTokenSymbolOnChain:De.params.fromTokenSymbol,toTokenSymbolOnChain:De.params.toTokenSymbol,slippageMode:a.slippageMode===oS.RECOMMEND?"auto":"custom",mev:u??!1,isGasFree:!1,orderSource:"extension",securityCheckId:s.requestId,gasLevel:"Medium",nativeTokenAddress:A.nativeTokenAddress,nativeTokenDecimals:A.nativeTokenDecimals,side:"BUY",bep414PolicyId:"",gasDetail:{fast:{tags:[]}}})),mt.variant!==Rc.ERROR){Pr.next=56;break}throw mt.error||new Error("Failed to finalize transaction list");case 56:return Bt=s.swapParams.quote.quoteId,Pr.prev=57,Ize(Bt,o),Pr.next=61,oA.submitTransactionList(mt.data);case 61:if(er=Pr.sent,!(er.error||!er.data)){Pr.next=64;break}throw er.error||new Error("Submit transaction failed");case 64:if(console.log("Submit transaction result:",er),cr=er.data,mt.variant===Rc.APPROVE_AND_SWAP?cr[Gl.APPROVE]:cr[Gl.SWAP],pr=er.data[Gl.SWAP].FETCH_ORDER_ID.output.orderId,Dr=er.data[Gl.SWAP].BROADCAST.output.backend.output.error,!Dr){Pr.next=71;break}throw new Error("Swap order failed: ".concat(Dr));case 71:return Pr.abrupt("return",{orderId:pr});case 72:return Pr.prev=72,Rze(Bt),Pr.finish(72);case 75:case"end":return Pr.stop()}},e,null,[[57,,72,75]])}));return function(n){return r.apply(this,arguments)}}(),Mce=function(){var r=(0,k.A)(b().mark(function e(n){var i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Fi.getNetworkList();case 2:return i=a.sent,s=(0,H.keyBy)(i,function(u){return u.binanceChainId}),a.abrupt("return",n.map(function(u){return s[u]}).filter(Boolean).map(function(u){var l=u.binanceChainId,g=u.networkIdOnBinance;return{networkId:g,binanceChainId:l}}));case 5:case"end":return a.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),zF=null;function adt(r,e){var n=_sliced_to_array(r.split("."),2),i=n[0],s=n[1];if(!s)return BigNumber(r).toFormat(zF);var o=s.replace(/^0+/,"").length;if(e>=o)return BigNumber(r).toFormat(zF);var a=s.slice(0,e-o).replace(/0+$/,"");return BigNumber("".concat(i,".").concat(a)).toFormat(zF)}var udt=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r==null)return"--";var i=new BigNumber(r);if(!i.isFinite())return"--";if(i.isZero())return"0%";if(i.isLessThan(.01)&&n)return"<0.01%";var s=i.decimalPlaces(e).toString();return"".concat(s,"%")};function cdt(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"middlePrecision",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e==="highPrecision"?14:e==="middlePrecision"?8:4,s=BigNumber(r),o=s.decimalPlaces(i,BigNumber.ROUND_DOWN).toFixed();if(o==="0"&&s.gt(0))return"<".concat(BigNumber("0.".concat("0".repeat(i-1),"1")).toFormat(NUM_FORMAT));if(n){var a=e==="lowPrecision"?4:5;return formatDecimalValidNumCount(o,a)}return BigNumber(o).toFormat(NUM_FORMAT)}function ldt(r,e){var n=new BigNumber(r);if(n.isZero())return"0.00";if(n.gte(1))return n.decimalPlaces(2,BigNumber.ROUND_DOWN).toFormat(NUM_FORMAT);var i=e==="highPrecision"?8:5,s=n.decimalPlaces(i,BigNumber.ROUND_DOWN).toFixed();return s==="0"&&n.gt(0)?"<".concat(new BigNumber("0.".concat("0".repeat(i-1),"1")).toFormat(NUM_FORMAT)):formatDecimalValidNumCount(s,5)}function fdt(r,e){var n=new BigNumber(r);if(n.gte(10))return n.decimalPlaces(2,BigNumber.ROUND_DOWN).toFormat(NUM_FORMAT);if(n.gte(1))return n.decimalPlaces(5,BigNumber.ROUND_DOWN).toFormat(NUM_FORMAT);var i=e==="highPrecision"?15:9,s=n.decimalPlaces(i,BigNumber.ROUND_DOWN).toFixed();if(s==="0"&&n.gt(0)){var o=new BigNumber("0.".concat("0".repeat(i-1),"1"));return"<".concat(o.toFormat(NUM_FORMAT))}return formatDecimalValidNumCount(s,5)}var $F=1e3,Lce=null,Dce=null,Uce=null,Oze=null;function ddt(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.decimalPlaces,i=n===void 0?2:n,s=e.variant,o=e.roundingMode,a=new BigNumber(r);if(a.isZero())return"0";if(a.lt("0.01"))return"<".concat(new BigNumber("0.01").toFormat(NUM_FORMAT));if(s==="percentNumber"&&a.lt(10*$F))return a.decimalPlaces(i,o).toFormat(NUM_FORMAT);var u=a,l="";return a.gt(Oze)?">".concat(new BigNumber(1e3).toFormat(NUM_FORMAT),"T"):(a.gte(Uce)?(l="T",u=a.dividedBy(Uce)):a.gte(Dce)?(l="B",u=a.dividedBy(Dce)):a.gte(Lce)?(l="M",u=a.dividedBy(Lce)):a.gte($F)&&(l="K",u=a.dividedBy($F)),u.decimalPlaces(i,o).toFormat(NUM_FORMAT)+l)}function Pze(r,e){var n=new BigNumber(0);return!r||!e&&e!==0?n:new BigNumber(r).dividedBy(new BigNumber(10).pow(e))}function hdt(r,e,n){if(!n)return"";var i=Pze(r,e).multipliedBy(n);return formatFiatValue(i,"lowPrecision")}var Nze=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n=new ti(r),i=0;if(n.isLessThan(1)){var s=n.toString(10).match(/0\.(0*)/);i=s?s[1].length:0}var o=e+i;return n.decimalPlaces(o,ti.ROUND_DOWN).toFixed()},Fce=Math.pow(10,-(o9e-1)),Mze="<".concat(Nze(Fce,1)),pdt=function(r,e){var n=new BigNumber(100-Number(r)).times(e).div(100).decimalPlaces(8,BigNumber.ROUND_DOWN);return n.isNaN()?"":n.toFixed()},gdt=function(r){return new BigNumber(r).isNaN()?"":new BigNumber(r).isEqualTo(0)?"0":new BigNumber(r).isLessThan(Fce)?Mze:new BigNumber(r).isGreaterThan(Math.pow(10,MAX_DECIMALS_FOR_INPUT-1))?r.split(".")[0]:r.includes(".")?new BigNumber(r.slice(0,MAX_DECIMALS_FOR_INPUT+1)).toFixed():r},ydt=function(r,e){return new BigNumber(100-Number(r)).times(e).div(100).toFixed()},mdt=function(r,e){return r===""||!r?e||"":formatAmount(r,"highPrecision")},bdt=function(r){var e=r.fromTokenAmount,n=r.toTokenAmount,i=r.fromTokenSymbol,s=r.toTokenSymbol,o=r.rateDirection;if(e&&n&&s&&i){var a=function(g,y){var A=new BigNumber(g).dividedBy(y);return formatAmount(A.toFixed(),"highPrecision")};if(o===RateDirection.FROM_TO){var u=a(n,e);return{leftSymbol:i,price:u,rightSymbol:s}}else{var l=a(e,n);return{leftSymbol:s,price:l,rightSymbol:i}}}return{leftSymbol:"",price:"",rightSymbol:""}},vdt=function(r,e){var n=swapNativeTokenAddressTransformMap.getSwapContractAddress(r,e),i=swapNativeTokenAddressTransformMap.getUniversalContractAddress(r,e);return isNativeTokenU(e)||isNativeTokenU(n)||isNativeTokenU(i)},wdt=function(r){var e=r.isComplete,n=r.price;if(!e)return!0;var i=Number(n);return!(isNaN(i)||i<=0)},Adt=function(r,e,n){return r===SwapProvider.BinanceBridge||r===SwapProvider.Quant||r===SwapProvider.Inch?n:!n||e===n?e:"".concat(e," (").concat(n,")")};function _dt(r){return r===SwapProvider.Inch?"1inch":r.toLowerCase().replace(/\s/g,"")}var Edt=function(r){var e=0,n=0,i=!0,s=!1,o=void 0;try{for(var a=r.split("").entries()[Symbol.iterator](),u;!(i=(u=a.next()).done);i=!0){var l=_sliced_to_array(u.value,2),g=l[0],y=l[1];if(/^[0-9]$/.test(y)&&(e+=1),n=g,e>=MAX_DECIMALS_FOR_INPUT)break}}catch(A){s=!0,o=A}finally{try{!i&&a.return!=null&&a.return()}finally{if(s)throw o}}return n===r.length-1?r:"".concat(r.slice(0,n+1),"...")},Tdt=function(r){var e=r.input,n=r.maxDecimals,i=r.setValue,s=e||"",o=s.startsWith(".")?"0"+s:s,a=function(){var u=o?.trim();if(BigNumber(u).isNaN()||u==="")return"";var l=_sliced_to_array(u.split("."),2),g=l[0],y=l[1],A=y?"".concat(y.slice(0,n)):"";return"".concat(g).concat(u.includes(".")?".":"").concat(A)}();BigNumber(o).isNaN()?i(""):setTimeout(function(){i(o),setTimeout(function(){i(a)},0)},0)},Sdt=function(r,e){var n=Date.now(),i=r-n;if(i<=0)return null;var s=Math.floor(i/1e3),o=Math.floor(s/60),a=Math.floor(o/60),u=Math.floor(a/24);if(s<60)return e("ends-in-minute",{defaultValue:"Ends in {{count}} minutes",count:"<".concat(s)});if(o<60)return e("ends-in-minute",{defaultValue:"Ends in {{count}} minutes",count:o});if(a<24){var l=o%60;return e("ends-in-hour-minute",{defaultValue:"Ends in {{hours}} hours {{minutes}} minutes",hours:a,minutes:l})}else{var g=a%24;return e("ends-in-day-hour",{defaultValue:"Ends in {{days}} days {{hours}} hours",days:u,hours:g})}},Idt=function(r){var e=r.spread,n=r.fromTokenFiatValue,i=r.quoteSpreadLimitConfig;if(!i)return SpreadThresholdLevel.None;var s=i.valueRanges,o=i.limitFactor;if(!s||!o)return SpreadThresholdLevel.None;var a=s.map(function(pe,Se){return Se===0?[[0,Number(pe.x)],[Number(pe.y),Number(pe.y)]]:[[Number(s[Se-1].x),Number(pe.x)],[Number(s[Se-1].y),Number(pe.y)]]});a.push([[Number(s[s.length-1].x),1/0],[Number(s[s.length-1].y),Number(s[s.length-1].y)]]);var u=-e/100*n,l=!0,g=!1,y=void 0;try{for(var A=a[Symbol.iterator](),I;!(l=(I=A.next()).done);l=!0){var P=_sliced_to_array(I.value,2),D=_sliced_to_array(P[0],2),U=D[0],V=D[1],J=_sliced_to_array(P[1],2),re=J[0],ce=J[1];if(n>=U&&n<=V){var Re,De=n===U?re:re+(ce-re)*(n-U)/(V-U),Ue=[{range:[0,De*Number(o.low)],level:SpreadThresholdLevel.None},{range:[De*Number(o.low),De*Number(o.middle)],level:SpreadThresholdLevel.Low},{range:[De*Number(o.middle),De*Number(o.high)],level:SpreadThresholdLevel.Middle},{range:[De*Number(o.high),1/0],level:SpreadThresholdLevel.High}],Ve=((Re=Ue.find(function(pe){return pe.range[0]<=u&&pe.range[1]>=u}))===null||Re===void 0?void 0:Re.level)||SpreadThresholdLevel.None;return Ve}}}catch(pe){g=!0,y=pe}finally{try{!l&&A.return!=null&&A.return()}finally{if(g)throw y}}return SpreadThresholdLevel.None};function Lze(r,e){var n=new ti(r),i=new ti(e);return n.isZero()||i.isZero()?0:+i.minus(n).div(n).multipliedBy(100).toFixed(2)}var Wce=function(r,e,n){var i=new ti(e),s=!0,o=!1,a=void 0;try{for(var u=n[Symbol.iterator](),l;!(s=(l=u.next()).done);s=!0){var g=l.value,y=g.upper,A=g.threshold;if(i.lt(y))return r<=A}}catch(I){o=!0,a=I}finally{try{!s&&u.return!=null&&u.return()}finally{if(o)throw a}}return!1},Hce;(function(r){r.SensitiveEvents="Sensitive Events",r.KOL="KOL",r.CommunityRecognitionLevel="Community Recognition Level",r.LaunchPlatform="Launch Platform",r.ComplianceRelatedToken="Compliance Related Token",r.SocialEvents="Social Events",r.Twitter="Twitter",r.TokenParticipants="Token Participants",r.OnChainPerformance="On-Chain Performance",r.AlphaPoints="Alpha Points",r.TokenizedStocksLaunchPlatform="Tokenized Stocks Launch Platform",r.BinanceExclusiveLaunchpads="Binance Exclusive Launchpads",r.TradingCompetitionToken="Trading Competition Token"})(Hce||(Hce={}));var Yi;(function(r){r.Alpha="Alpha",r.TGE="TGE",r.CommunityRecognized="Community Recognized",r.DevBuy="DEV Add Position",r.DevSell="DEV Reduce Position",r.DevSellAll="DEV Close Position",r.DevAddLiquidity="DEV Add Liquidity",r.DevRemoveLiquidity="DEV Remove Liquidity",r.SmartMoneyBuy="Smart Money Add Holdings",r.SmartMoneySell="Smart Money Remove Holdings",r.Fourmeme="Fourmeme",r.Pumpfun="Pumpfun",r.Bonk="Bonk",r.LaunchLab="LaunchLab",r.Bags="Bags",r.Moonshot="Moonshot",r.Believer="Believer",r.JupiterStudio="Jupiter Studio",r.DynamicBC="Dynamic BC",r.Ondo="Ondo",r.Xstock="Xstock",r.AlphaStock="Alpha Stock",r.RiskToken="RiskToken",r.Alpha2Points="2x Alpha Points",r.Alpha4Points="4x Alpha Points",r.BinanceExclusiveLaunchpads="Binance Exclusive Launchpads",r.Meteora="Meteora",r.ORCA="ORCA",r.Raydium="Raydium",r.PaidOnDexScreener="Paid on DEXScreener",r.TradingCompetition="Trading Competition"})(Yi||(Yi={}));var Ks,kdt=(Ks={},vt(Ks,Yi.Alpha,{key:"token_tag_alpha",default:"Binance Alpha"}),vt(Ks,Yi.TGE,{key:"token_tag_tge",default:"Exclusive TGE"}),vt(Ks,Yi.CommunityRecognized,{key:"token_tag_community_recognized",default:"Community recognized"}),vt(Ks,Yi.DevBuy,{key:"token_tag_dev_buy",default:"Dev buy more"}),vt(Ks,Yi.DevSell,{key:"token_tag_dev_sell",default:"Dev sell more"}),vt(Ks,Yi.DevSellAll,{key:"token_tag_dev_sell_all",default:"Dev sell all"}),vt(Ks,Yi.DevAddLiquidity,{key:"token_tag_dev_add_liquidity",default:"Dev add liquidity"}),vt(Ks,Yi.DevRemoveLiquidity,{key:"token_tag_dev_remove_liquidity",default:"Dev remove liquidity"}),vt(Ks,Yi.SmartMoneyBuy,{key:"token_tag_smart_money_buy",default:"Smart money buy"}),vt(Ks,Yi.SmartMoneySell,{key:"token_tag_smart_money_sell",default:"Smart money sell"}),vt(Ks,Yi.Fourmeme,{key:"token_tag_fourmeme",default:"Four.meme"}),vt(Ks,Yi.Pumpfun,{key:"token_tag_pumpfun",default:"Pump.fun"}),vt(Ks,Yi.Bonk,{key:"token_tag_bonk",default:"Bonk"}),vt(Ks,Yi.LaunchLab,{key:"token_tag_launchlab",default:"LaunchLab"}),vt(Ks,Yi.Bags,{key:"token_tag_bags",default:"Bags"}),vt(Ks,Yi.Moonshot,{key:"token_tag_moonshot",default:"Moonshot"}),vt(Ks,Yi.Believer,{key:"token_tag_believer",default:"Believe"}),vt(Ks,Yi.JupiterStudio,{key:"token_tag_jupiter_studio",default:"Jupiter Studio"}),vt(Ks,Yi.DynamicBC,{key:"token_tag_dynamic_bc",default:"Dynamic BC"}),vt(Ks,Yi.Ondo,{key:"token_tag_ondo",default:"Ondo Finance"}),vt(Ks,Yi.Xstock,{key:"token_tag_xstocks",default:"XStocks"}),vt(Ks,Yi.AlphaStock,{key:"token_tag_alpha_stock",default:"Alpha Stock"}),vt(Ks,Yi.RiskToken,{key:"token_tag_risk_token",default:"Risk token"}),vt(Ks,Yi.Alpha2Points,{key:"token_tag_alpha_multi_points",default:{defaultValue:"Alpha token with {{num}}x alpha points",num:2}}),vt(Ks,Yi.Alpha4Points,{key:"token_tag_alpha_multi_points",default:{defaultValue:"Alpha token with {{num}}x alpha points",num:4}}),vt(Ks,Yi.BinanceExclusiveLaunchpads,{key:"token_tag_x_mode",default:"Token from Four.meme - X Mode"}),vt(Ks,Yi.Meteora,{key:"token_tag_meteora",default:"Meteora"}),vt(Ks,Yi.ORCA,{key:"token_tag_orca",default:"ORCA"}),vt(Ks,Yi.Raydium,{key:"token_tag_raydium",default:"Raydium"}),vt(Ks,Yi.PaidOnDexScreener,{key:"token_tag_paid_on_dex_screener",default:"Paid on DEXScreener"}),vt(Ks,Yi.TradingCompetition,{key:"token_tag_trading_competition",default:"Trading Competition"}),Ks),bS,Rdt=(bS={},vt(bS,Yi.Alpha,0),vt(bS,Yi.TGE,1),vt(bS,Yi.CommunityRecognized,2),bS),Eg,Cdt=(Eg={},vt(Eg,Yi.DevBuy,0),vt(Eg,Yi.DevSell,1),vt(Eg,Yi.DevSellAll,2),vt(Eg,Yi.DevAddLiquidity,3),vt(Eg,Yi.DevRemoveLiquidity,4),vt(Eg,Yi.SmartMoneyBuy,5),vt(Eg,Yi.SmartMoneySell,6),Eg),zce={};Object.values(Yi).forEach(function(r){zce[r]=!0});var Dze=function(r){return!!zce[r]},Uze=function(r,e){var n,i;return((n=CommunityRecognitionTagsOrder[r.tagName])!==null&&n!==void 0?n:999)-((i=CommunityRecognitionTagsOrder[e.tagName])!==null&&i!==void 0?i:999)},xdt=function(r,e){var n=[];if(e!==void 0&&e>=RiskLevel.HighRisk&&n.push(TokenTagName.RiskToken),r){var i,s=r[TokenTagGroup.CommunityRecognitionLevel]||[],o=r[TokenTagGroup.LaunchPlatform]||[],a=r[TokenTagGroup.TokenizedStocksLaunchPlatform]||[],u=s.sort(Uze).concat(o).concat(a).map(function(l){return l.tagName}).filter(Dze);(i=n).push.apply(i,_to_consumable_array(u))}return n.slice(0,2)},$ce=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct;return b().wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return i=n.swapConfirmParams,s=n.antiMEV,o=n.walletItem,a=n.fromNetwork,u=n.gasAccountLevel,l=u===void 0?ds.Medium:u,g=n.accountId,A=i,I=i.quote,P=i.fromToken,D=i.toToken,U=i.tips,V=dh(o,a.chainType)[0],Bt.next=7,y4(V,a.id);case 7:if(J=Bt.sent,re=[],ce=O7.includes(a.chainType),!ce){Bt.next=17;break}return Bt.next=13,li.getPublicKeyHex(o.id,g,a.chainType);case 13:if(Re=Bt.sent,Re){Bt.next=16;break}throw Error("Get public key failed");case 16:re.push(Re);case 17:if(Se={params:{fromWalletId:A.fromWalletId,fromNetwork:{wcId:a.wcId,transactionType:a.transactionType},approved:(De=A.approved)!==null&&De!==void 0?De:!1,slippage:A.slippage,fromTokenSymbol:P.symbol,toTokenSymbol:D.symbol,nativeTokenSymbol:a.nativeToken,transferTax:(Ue=A.fromTokenTax)!==null&&Ue!==void 0?Ue:"0",nativeTokenDecimals:(Ve=a.nativeTokenDecimals)!==null&&Ve!==void 0?Ve:18,isRecommendSlippage:A.slippageMode===oS.RECOMMEND,source:(pe=A.source_1)!==null&&pe!==void 0?pe:"ext-swap",publicKeys:re,walletType:J},quote:gn(Mr({},I),{fromWalletAddress:V,toWalletAddress:V})},console.log("buildGasAccountForSwapConfirm - generating transaction list",{swapInput:Se}),Ce=nae(Se),Ce.variant!==Rc.ERROR){Bt.next=24;break}throw console.error("buildGasAccountForSwapConfirm - generateError:",Ce.error),Ce.error;case 24:return console.log("buildGasAccountForSwapConfirm - transaction list generated:",Ce.data),Bt.next=27,oA.buildTransactionList(Ce.data,{mev:s??!1,gasLevel:l,tipsDetail:U},{runSteps:[Ti.FETCH_CALLDATA,Ti.FETCH_GAS]});case 27:if(je=Bt.sent,$e=je.data,console.log("buildGasAccountForSwapConfirm buildResultData:",$e),$e){Bt.next=32;break}throw je.error;case 32:if(Ce.variant===Rc.APPROVE_AND_SWAP&&(nt=$e[Gl.APPROVE]),Qe=$e[Gl.SWAP],Ne=Qe.FETCH_GAS.output[0],Me=nt?nt.FETCH_GAS.output[0]:void 0,console.log("buildGasAccountForSwapConfirm - gasAccounts:",{swapGasAccountItem:Ne,approveGasAccountItem:Me,hasSwapResult:!!Qe,hasApproveResult:!!nt}),Ne){Bt.next=41;break}throw console.error("buildGasAccountForSwapConfirm - Failed: No swapGasAccountItem",{swapResult:Qe,gasOutput:Ne}),new Error("Failed to build gas account for swap transaction");case 41:if(ct=Cae([Me,Ne].filter(Boolean),l),console.log("buildGasAccountForSwapConfirm - mergedGasAccount:",{mergedGasAccount:ct,hasFeeInfo:!!ct?.feeInfo,succeedEstimateGas:(y=ct?.feeInfo)===null||y===void 0?void 0:y.succeedEstimateGas}),ct){Bt.next=46;break}throw console.error("buildGasAccountForSwapConfirm - Failed: mergeGasAccounts returned null"),new Error("Failed to merge gas accounts for approve+swap transaction");case 46:return Bt.abrupt("return",{buildResultData:$e,mergedGasAccount:ct});case 47:case"end":return Bt.stop()}},e)}));return function(n){return r.apply(this,arguments)}}();function Vce(r){var e=r.approvalId,n=r.callPreCheck;return function(){var i=(0,k.A)(b().mark(function s(o){var a,u,l,g,y,A,I,P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return a=o.txId,u=o.generateNewTxId,De.next=3,ll();case 3:if(l=De.sent,g=r.serialNum,!u){De.next=12;break}return De.next=8,n();case 8:y=De.sent,g=y.serialNum,De.next=18;break;case 12:return De.next=15,Zn.getApproval(e);case 15:I=De.sent,P=I==null||(A=I.requestData)===null||A===void 0?void 0:A.serialNum,P&&(g=P);case 18:return D=r.quote||r.swapParams.quote,U=D.vendor,V=D.subVendorId,De.abrupt("return",{version:"v2",extensionId:l,serialNum:g,pushId:a,fromToken:r.swapParams.fromToken,toToken:r.swapParams.toToken,fromTokenAmount:D.fromTokenAmount,fromWallet:{walletId:r.walletId,rawAddress:r.address,address:r.address},toWallet:{walletId:r.walletId,rawAddress:r.address,address:r.address},slippage:r.swapParams.slippage,slippageMode:r.swapParams.slippageMode,mev:!!r.antiMEV,tab:r.swapParams.tab,approveInfo:{allowance:(J=r.swapParams.allowance)!==null&&J!==void 0?J:"",isApproveUnlimited:ti((re=r.swapParams.allowance)!==null&&re!==void 0?re:0).gte(nke),approved:r.swapParams.approved},source_1:Go.swapToMap,source_2:"",fromTokenTax:(ce=r.swapParams.fromTokenTax)!==null&&ce!==void 0?ce:"",vendor:U,subVendorId:V,orderSource:"EXTENSION_NORMAL_SWAP_MPC"});case 23:case"end":return De.stop()}},s)}));return function(s){return i.apply(this,arguments)}}()}function Fze(r){return VF.apply(this,arguments)}function VF(){return VF=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue;return b().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return a=no(e.fromBinanceChainId),u=no(e.toBinanceChainId),pe.t0=ur,pe.next=6,Promise.all([Ii.getTokenMetaByContract(a,e.fromTokenAddress),Ii.getTokenMetaByContract(u,e.toTokenAddress)]);case 6:return pe.t1=pe.sent,l=(0,pe.t0)(pe.t1,2),g=l[0],y=l[1],pe.next=12,zt.get(cre);case 12:return A=pe.sent,I=fl(g.binanceTokenId),P=fl(y.binanceTokenId),U=(D=(n=g.tokenAddresses.find(function(Se){return Se.chainId===e.fromBinanceChainId}))===null||n===void 0?void 0:n.decimals)!==null&&D!==void 0?D:e.fromTokenDecimals,J=(V=(i=y.tokenAddresses.find(function(Se){return Se.chainId===e.toBinanceChainId}))===null||i===void 0?void 0:i.decimals)!==null&&V!==void 0?V:e.toTokenDecimals,re=[{type:"TOKEN",contractAddress:e.fromTokenAddress,amount:ti(e.fromTokenAmount).times(ti(10).pow(U)).negated().toFixed(0),isGreaterOrEqual0:!1},{type:"TOKEN",contractAddress:e.toTokenAddress,amount:ti(e.toTokenAmount).times(ti(10).pow(J)).toFixed(0),isGreaterOrEqual0:!0}],Ue=(De={},vt(De,e.fromTokenAddress,{type:"TOKEN",decimals:String(U),symbol:g.symbol,icon:g.icon,name:g.name,price:(ce=(s=A[I])===null||s===void 0?void 0:s.price)!==null&&ce!==void 0?ce:"0"}),vt(De,e.toTokenAddress,{type:"TOKEN",decimals:String(J),symbol:y.symbol,icon:y.icon,name:y.name,price:(Re=(o=A[P])===null||o===void 0?void 0:o.price)!==null&&Re!==void 0?Re:"0"}),De),pe.abrupt("return",{balanceChanges:re,tokenInfoMap:Ue});case 24:case"end":return pe.stop()}},r)})),VF.apply(this,arguments)}function jce(r){return jF.apply(this,arguments)}function jF(){return jF=(0,k.A)(b().mark(function r(e){var n,i,s,o;return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return n=e.quote,u.next=3,Fze(n);case 3:return i=u.sent,s=i.balanceChanges,o=i.tokenInfoMap,u.abrupt("return",{rawData:"",type:lm.Swap,amount:"",memo:"",recipient:"",action:"",balanceChanges:s,allowanceChanges:[],authorityChanges:[],simulationCode:"",tokenInfoMap:o,reportData:{},enableAntiMEV:!0,gasTokenFromData:"",riskCodes:[]});case 7:case"end":return u.stop()}},r)})),jF.apply(this,arguments)}var Kce={low:Cs.STANDARD,medium:Cs.FAST,high:Cs.TURBO};function KF(r){return r==="204"?"10000000000000":"0"}function Wze(r){return r==="BSC"?{maxPriorityFeePerGas:"0",maxBaseFeePerGas:"0",gasPrice:"0.12",waitTimeEstimate:6e3}:r==="SONIC"?{maxPriorityFeePerGas:"101.88778837902001",maxBaseFeePerGas:"206.25",gasPrice:"308.13778837902",waitTimeEstimate:1e3}:r==="ETH"?{maxPriorityFeePerGas:"0.098",maxBaseFeePerGas:"6.860420035",gasPrice:"6.958420035",waitTimeEstimate:28e3}:r==="BASE"?{maxPriorityFeePerGas:"0.00294",maxBaseFeePerGas:"0.0072485175",gasPrice:"0.0101885175",waitTimeEstimate:4e3}:{gasPrice:"0",maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0}}function Hze(r,e){var n=r==="BTC";return{gasPrice:new ti(e.gasPrice||"0").times(n?1:1e9).toFixed(0),maxBaseFeePerGas:new ti(e.maxBaseFeePerGas).times(1e9).toFixed(0),maxPriorityFeePerGas:new ti(e.maxPriorityFeePerGas).times(1e9).toFixed(0),waitTimeEstimate:e.waitTimeEstimate}}function zze(r,e){return GF.apply(this,arguments)}function GF(){return GF=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(e==="TRON"&&(e="TRX"),P.prev=1,!(n&&l9e.includes(n.binanceChainId))){P.next=9;break}return P.next=6,Gze(n);case 6:P.t0=P.sent,P.next=12;break;case 9:return P.next=11,jze(e);case 11:P.t0=P.sent;case 12:if(o=P.t0,a=e==="BTC",u=Object.keys(o).reduce(function(D,U){if(+o[U].gasPrice!=0&&Kce[U]){var V;return Mr(vt({},Kce[U],{gasPrice:new ti(o[U].gasPrice||"0").times(a?1:1e9).toFixed(0),maxBaseFeePerGas:new ti(o[U].maxBaseFeePerGas).times(1e9).toFixed(0),maxPriorityFeePerGas:new ti(o[U].maxPriorityFeePerGas).times(1e9).toFixed(0),waitTimeEstimate:o[U].waitTimeEstimate,tags:(V=o[U])===null||V===void 0?void 0:V.tags}),D)}return D},{}),l=Cs.TURBO,!(!(!((i=u[l])===null||i===void 0)&&i.gasPrice)||!((s=u[l])===null||s===void 0)&&s.gasPrice&&+u[l].gasPrice==0)){P.next=18;break}throw new Error("get zero gas price from backend");case 18:return P.abrupt("return",{gasDetail:u});case 21:return P.prev=21,P.t1=P.catch(1),console.error("[SwapController] getGasRequest error:",P.t1),g=Wze(e),y=Hze(e,g),P.abrupt("return",{gasDetail:(A={},vt(A,Cs.STANDARD,y),vt(A,Cs.FAST,y),vt(A,Cs.TURBO,y),A)});case 28:case"end":return P.stop()}},r,null,[[1,21]])})),GF.apply(this,arguments)}var $ze=function(r){return r==="ETH"?7e3:r==="BSC"?2500:6e4},av={};function Vze(r,e){return qF.apply(this,arguments)}function qF(){return qF=(0,k.A)(b().mark(function r(e,n){var i,s,o,a;return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(s={gasDetail:vt({},Cs.FAST,{gasPrice:"0",maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0}),default:Cs.FAST},e){l.next=4;break}return l.abrupt("return",s);case 4:if(e!==a9e){l.next=6;break}return l.abrupt("return",{gasDetail:vt({},Cs.FAST,{gasPrice:"1",maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0})});case 6:if(e!==c9e){l.next=8;break}return l.abrupt("return",{gasDetail:vt({},Cs.FAST,{gasPrice:"1",maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0})});case 8:if(e!==sS){l.next=10;break}return l.abrupt("return",{gasDetail:vt({},Cs.FAST,{gasPrice:"0.5",maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0})});case 10:if(e===u9e&&(e="TRX"),o=av[e]||{expire:1,gas:s},!(Date.now()<o.expire&&Number((i=o.gas.gasDetail[Cs.FAST])===null||i===void 0?void 0:i.gasPrice)>0)){l.next=14;break}return l.abrupt("return",av[e].gas);case 14:return l.prev=14,l.next=17,zze(e,n);case 17:return a=l.sent,av[e]={gas:a,expire:Date.now()+$ze(e)},l.abrupt("return",a);case 22:l.prev=22,l.t0=l.catch(14),console.error("[SwapController] getSwapGasPrice error:",l.t0);case 25:return l.abrupt("return",s);case 26:case"end":return l.stop()}},r,null,[[14,22]])})),qF.apply(this,arguments)}var ZF=function(r){return Number(r||"0")<5e5?"500000":r||"500000"};function YF(r,e){return XF.apply(this,arguments)}function XF(){return XF=(0,k.A)(b().mark(function r(e,n){var i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(e!==sS){g.next=17;break}if(s=av[sS],!(s&&Date.now()<s.expire&&Number((i=s.gas.gasDetail[Cs.FAST])===null||i===void 0?void 0:i.gasPrice)>0)){g.next=5;break}return g.abrupt("return",av[e].gas);case 5:return g.prev=5,g.next=8,Kze();case 8:return o=g.sent,av[sS]={gas:{gasDetail:(a={},vt(a,Cs.STANDARD,{gasPrice:FU(o.normalStandard.priorityFee,6),maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0}),vt(a,Cs.FAST,{gasPrice:FU(o.normalFast.priorityFee,6),maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0}),vt(a,Cs.TURBO,{gasPrice:FU(o.normalTurbo.priorityFee,6),maxBaseFeePerGas:"0",maxPriorityFeePerGas:"0",waitTimeEstimate:0}),a),tips:{tipAccount:o.tipsAccounts[0],amount:(u={},vt(u,Cs.STANDARD,o.antiMevStandard.tips),vt(u,Cs.FAST,o.antiMevFast.tips),vt(u,Cs.TURBO,o.antiMevTurbo.tips),u)}},expire:Date.now()+6e4},g.abrupt("return",av[sS].gas);case 14:g.prev=14,g.t0=g.catch(5),console.error("[SwapController] getQuickSwapGasPrice SOL error:",g.t0);case 17:return g.abrupt("return",Vze(e,n));case 18:case"end":return g.stop()}},r,null,[[5,14]])})),XF.apply(this,arguments)}var Bdt=function(r,e,n,i){return BigNumber(r).plus(KF(e)).plus(n||"0").dividedBy(new BigNumber(10).exponentiatedBy(i||18)).toFixed(8)};function jze(r){return JF.apply(this,arguments)}function JF(){return JF=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,hn.SwapGas.fetchEstimateGas(e);case 2:return n=s.sent,s.abrupt("return",n.data);case 4:case"end":return s.stop()}},r)})),JF.apply(this,arguments)}function Kze(){return QF.apply(this,arguments)}function QF(){return QF=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return e={normalStandard:{priorityFee:"500000"},normalFast:{priorityFee:"600000"},normalTurbo:{priorityFee:"9549075"},antiMevStandard:{tips:"0.0000449"},antiMevFast:{tips:"0.0007060505"},antiMevTurbo:{tips:"0.07852395585000004"},tipsAccounts:["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe"]},g.prev=1,g.next=4,hn.SwapGas.fetchSolanaGas();case 4:n=g.sent,i=n.data,i&&(e={normalStandard:{priorityFee:ZF(i==null||(s=i.normalStandard)===null||s===void 0?void 0:s.priorityFee)},normalFast:{priorityFee:ZF(i==null||(o=i.normalFast)===null||o===void 0?void 0:o.priorityFee)},normalTurbo:{priorityFee:ZF(i==null||(a=i.normalTurbo)===null||a===void 0?void 0:a.priorityFee)},antiMevStandard:i.antiMevStandard||e.antiMevStandard,antiMevFast:i.antiMevFast||e.antiMevFast,antiMevTurbo:i.antiMevTurbo||e.antiMevTurbo,tipsAccounts:((u=i.tipsAccounts)===null||u===void 0?void 0:u.length)>0?i.tipsAccounts:e.tipsAccounts}),g.next=12;break;case 9:g.prev=9,g.t0=g.catch(1),console.error("[SwapController] fetchSolanaGas error:",g.t0);case 12:return g.abrupt("return",e);case 13:case"end":return g.stop()}},r,null,[[1,9]])})),QF.apply(this,arguments)}function Gze(r){return eW.apply(this,arguments)}function eW(){return eW=(0,k.A)(b().mark(function r(e){var n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,hn.SwapGas.postGasPrice(e);case 2:return n=a.sent,i=n.data,s=i.baseFeePerGas,a.abrupt("return",{low:gn(Mr({},i.low),{maxBaseFeePerGas:s}),medium:gn(Mr({},i.medium),{maxBaseFeePerGas:s}),high:gn(Mr({},i.high),{maxBaseFeePerGas:s})});case 6:case"end":return a.stop()}},r)})),eW.apply(this,arguments)}function qze(r){return tW.apply(this,arguments)}function tW(){return tW=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J;return b().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return s=e.fromChainDefaultGasLimit,o=e.toChainDefaultGasLimit,e.fromBinanceChainId===Tee&&e.fromChainDefaultGasLimit==="2"&&(s="20000000"),e.toBinanceChainId===Tee&&e.toChainDefaultGasLimit==="2"&&(o="20000000"),ce.next=7,Fi.getNetworkByChainId(e.fromBinanceChainId);case 7:if(a=ce.sent,u=a?.nativeTokenDecimals,!(!a||!u)){ce.next=11;break}return ce.abrupt("return","0");case 11:return l=e.fromBinanceChainId===e.toBinanceChainId,ce.t0=ur,ce.next=15,Promise.all([YF(a.networkIdOnBinance,{binanceChainId:e.fromBinanceChainId,scenario:Goe.SWAP}),l?Promise.resolve({gasDetail:vt({},Cs.FAST,{gasPrice:"0",maxPriorityFeePerGas:"0",maxBaseFeePerGas:"0",waitTimeEstimate:0})}):(0,k.A)(b().mark(function Re(){var De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return Ve.next=2,Fi.getNetworkByChainId(e.toBinanceChainId);case 2:if(De=Ve.sent,De){Ve.next=5;break}return Ve.abrupt("return",{gasDetail:vt({},Cs.FAST,{gasPrice:"0",maxPriorityFeePerGas:"0",maxBaseFeePerGas:"0",waitTimeEstimate:0})});case 5:return Ve.abrupt("return",YF(De.networkIdOnBinance,{binanceChainId:e.toBinanceChainId,scenario:Goe.BRIDGE}));case 6:case"end":return Ve.stop()}},Re)}))()]);case 15:if(ce.t1=ce.sent,g=(0,ce.t0)(ce.t1,2),y=g[0],A=g[1],I=((n=y.gasDetail[Cs.FAST])===null||n===void 0?void 0:n.gasPrice)||"0",P=((i=A.gasDetail[Cs.FAST])===null||i===void 0?void 0:i.gasPrice)||"0",!(!I||!P)){ce.next=23;break}return ce.abrupt("return","0");case 23:if(D=new ti(s).multipliedBy(e.fromBinanceChainId===CSe?+I+4:I).plus(KF(e.fromBinanceChainId)).dividedBy(new ti(10).pow(u)).toFixed(u),e.fromBinanceChainId===yC&&e.fromTokenAddress===nS&&(D="3"),!(l||e.fromChainNativeTokenPrice==="0"||e.toChainNativeTokenPrice==="0")){ce.next=27;break}return ce.abrupt("return",D);case 27:return ce.next=29,Fi.getNetworkByChainId(e.toBinanceChainId);case 29:if(U=ce.sent,V=U?.nativeTokenDecimals,V){ce.next=33;break}return ce.abrupt("return",D);case 33:return J=new ti(o).multipliedBy(P).plus(KF(e.toBinanceChainId)).dividedBy(new ti(10).pow(V)),e.toBinanceChainId===yC&&e.toTokenAddress===nS&&(J=new ti(3)),ce.abrupt("return",new ti(D).plus(J.multipliedBy(e.toChainNativeTokenPrice).dividedBy(e.fromChainNativeTokenPrice).multipliedBy(3)).toFixed(u));case 36:case"end":return ce.stop()}},r)})),tW.apply(this,arguments)}function Zze(r){return rW.apply(this,arguments)}function rW(){return rW=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(n=e.walletItem,i=e.quote,s=e.fromToken,o=e.toToken,a=e.slippage,u=e.transferTax,l=e.serialNum,n.metadata.keyring.type===di.mpc){P.next=3;break}return P.abrupt("return",{type:"skip"});case 3:return P.prev=3,g={quoteId:i.quoteId,fromCoinChainId:i.fromBinanceChainId,toCoinChainId:i.toBinanceChainId,fromCoinAddress:bg.getSwapContractAddress(i.fromBinanceChainId,s.contractAddress),toCoinAddress:bg.getSwapContractAddress(i.toBinanceChainId,o.contractAddress),fromCoinAmount:i.fromTokenAmount,toCoinAmount:i.toTokenAmount,fromCoinSymbol:s.symbol,toCoinSymbol:o.symbol,slippage:a,serialNum:l,transferTax:u??"0"},P.next=7,hn.Swap.mpcPreCheck(g);case 7:if(y=P.sent,y.data.needBlock!==!0){P.next=11;break}return P.abrupt("return",{type:"needBlock",needBlockReason:(A=y.data.needBlockReason)!==null&&A!==void 0?A:""});case 11:if(!y.data.needConfirm){P.next=13;break}return P.abrupt("return",{type:"needConfirm",needConfirmReason:y.data.needConfirmReason,serialNum:y.data.serialNum});case 13:return P.abrupt("return",{type:"noConfirmNeeded",serialNum:y.data.serialNum});case 16:return P.prev=16,P.t0=P.catch(3),console.error("[mpcPreCheck] API error:",P.t0),P.abrupt("return",{type:"error",error:(0,ag.A)(P.t0,Error)?P.t0:new Error(String(P.t0))});case 20:case"end":return P.stop()}},r,null,[[3,16]])})),rW.apply(this,arguments)}function Gce(r){return nW.apply(this,arguments)}function nW(){return nW=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return i=e.approvalId,s=bs(e,["approvalId"]),y.next=4,Zn.getApproval(i);case 4:return o=y.sent,a=o==null||(n=o.requestData)===null||n===void 0?void 0:n.serialNum,y.next=8,Zze(gn(Mr({},s),{serialNum:a}));case 8:if(u=y.sent,l=u.serialNum,!(l&&o&&a!==l)){y.next=13;break}return y.next=13,Zn.changeRequestData(i,gn(Mr({},o.requestData),{serialNum:l}));case 13:return y.abrupt("return",gn(Mr({},u),{serialNum:l}));case 14:case"end":return y.stop()}},r)})),nW.apply(this,arguments)}var qce=function(){var r=(0,k.A)(b().mark(function e(n){var i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt,er,cr,pr,Dr,Rr,Pr,on,xn,Ar,Xr,Tn,Bn,ni,en,si,ei;return b().wrap(function(wi){for(;;)switch(wi.prev=wi.next){case 0:return o=n.approvalId,a=n.getSwapQuote,u=n.updateQuoteOnly,wi.next=4,Zn.getApproval(o);case 4:if(l=wi.sent,l){wi.next=7;break}throw new Error("Approval not found for approvalId: ".concat(o));case 7:if(g=l.requestData,g){wi.next=10;break}throw new Error("Approval requestData is null");case 10:return y=g.swapParams,A=g.antiMEV,I=g.quoteReq,wi.next=13,vn.getWalletItemByWalletId(y.fromWalletId);case 13:if(P=wi.sent,P){wi.next=16;break}throw new Error("Wallet not found for walletId: ".concat(y.fromWalletId));case 16:return wi.next=18,Fi.getNetworkList();case 18:if(D=wi.sent,U=D.find(function(ho){return ho.binanceChainId===y.fromToken.binanceChainId}),U){wi.next=22;break}throw new Error("Network not found for binanceChainId: ".concat(y.fromToken.binanceChainId));case 22:if(I){wi.next=24;break}throw new Error("quoteReq is null in approval requestData");case 24:return V=I,V.mev=!!A,wi.next=28,a(V);case 28:if(J=wi.sent,!(J.error||!J.result)){wi.next=33;break}throw new Error((ce=(re=J.error)===null||re===void 0?void 0:re.message)!==null&&ce!==void 0?ce:"Failed to fetch new quote");case 33:if(Re=J.result,De=Re.quotes,Ue=Re.slippage,Ve=Re.expireTime,!(!De||De.length===0)){wi.next=36;break}throw new Error("No quotes available for refresh");case 36:if(pe=y.quote.vendor,Se=De.find(function(ho){return ho.vendor===pe}),Ce=De.find(function(ho){var Zo;return(Zo=ho.tags)===null||Zo===void 0?void 0:Zo.includes("best_price")}),$e=(je=Se??Ce)!==null&&je!==void 0?je:De[0],$e){wi.next=43;break}throw new Error("No quotes available for refresh");case 43:if(!u){wi.next=48;break}return Qe=gn(Mr({},g),{swapParams:gn(Mr({},y),{quote:$e})}),wi.next=47,Zn.changeRequestData(o,Qe);case 47:return wi.abrupt("return",{quote:$e,slippage:Ue,expireTime:Ve});case 48:if(nt=function(){var ho=(0,k.A)(b().mark(function Zo(){var qa;return b().wrap(function(Fa){for(;;)switch(Fa.prev=Fa.next){case 0:return Fa.next=2,Gce({walletItem:P,quote:$e,fromToken:g.swapParams.fromToken,toToken:g.swapParams.toToken,slippage:g.swapParams.slippage,approvalId:o});case 2:return qa=Fa.sent,Fa.abrupt("return",qa);case 4:case"end":return Fa.stop()}},Zo)}));return function(){return ho.apply(this,arguments)}}(),l.type!==Hs.SwapConfirm){wi.next=61;break}return wi.next=52,nt();case 52:if(Ne=wi.sent,Ne.type!=="error"){wi.next=57;break}return wi.next=56,Zn.upsertApproval({approvalId:o,origin:"",type:Hs.NeedRefresh,requestData:{},requestId:g.requestId,source:Go.swap,onRefresh:(0,k.A)(b().mark(function ho(){return b().wrap(function(qa){for(;;)switch(qa.prev=qa.next){case 0:return qa.next=2,qce(n);case 2:case"end":return qa.stop()}},ho)})),onlyCancel:!0});case 56:return wi.abrupt("return",{quote:$e,slippage:Ue,expireTime:Ve});case 57:if(Ne.type!=="needConfirm"){wi.next=61;break}return wi.next=60,Ci.createMPCAppApproval({approvalId:o,arg:gn(Mr({},g),{signType:Hs.SendTransaction,signContext:g.signContext,isBroadcast:!0}),approvalType:Hs.MPCAppDexSign,generateTaskData:Vce({approvalId:o,swapParams:g.swapParams,antiMEV:g.antiMEV,walletId:P.id,address:g.signContext.address,quote:$e,serialNum:Ne.serialNum,callPreCheck:nt})});case 60:return wi.abrupt("return",{quote:$e,slippage:Ue,expireTime:Ve,switchedToMPC:!0,serialNum:Ne.serialNum});case 61:return Me=gn(Mr({},y),{quote:$e}),wi.next=64,$ce({swapConfirmParams:Me,antiMEV:A,walletItem:P,fromNetwork:U,accountId:g.signContext.accountId});case 64:return ct=wi.sent,mt=ct.mergedGasAccount,Bt=ct.buildResultData,wi.next=69,jce(Me);case 69:return er=wi.sent,cr=g.swapParams.quote.toTokenAmount,pr=Ve,Dr=gn(Mr({},g),{swapParams:Me,gasAccountInfo:mt,buildResultData:Bt,parsedResult:er,originToTokenAmount:cr,requestId:$e.quoteId}),wi.next=75,zt.get(RU);case 75:if(Rr=wi.sent,Pr=Rr!==null,on=Pr?Rr.originalOfferAmount:cr,xn=g.swapParams.toToken,Ar=Lze(on,$e.toTokenAmount),Xr=(i=er.tokenInfoMap)===null||i===void 0||(s=i[xn.contractAddress])===null||s===void 0?void 0:s.price,Tn=Xr&&Xr!=="0"?Xr:null,Bn=new ti(Tn||"0").multipliedBy(on).toFixed(),ni=Wce(Ar,Bn,f9e),en=Wce(Ar,Bn,d9e),si=ni||en,ei={priceChangePercent:Ar,tokenSymbol:xn.symbol,tokenPrice:Tn,originalOfferAmount:on,newOfferAmount:$e.toTokenAmount,binanceChainId:xn.binanceChainId,isTipWithCheckbox:en,quoteId:$e.quoteId},!(si||Pr)){wi.next=92;break}return wi.next=90,zt.set(RU,ei);case 90:wi.next=94;break;case 92:return wi.next=94,zt.set(RU,null);case 94:return wi.next=96,Zn.changeRequestData(o,Dr);case 96:return wi.abrupt("return",{quote:$e,slippage:Ue,expireTime:pr});case 97:case"end":return wi.stop()}},e)}));return function(n){return r.apply(this,arguments)}}(),Zce=new WeakSet,Yce=new WeakSet,Yze=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),Zce),B(F(s),Yce),s.name="swap",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return Zn.registerBeforeApprove(Hs.SwapConfirm,Bze),l.next=3,K(o,Yce,Jze).call(o);case 3:case"end":return l.stop()}},a)}))()},i.updateMaxRecommendSlippage=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.set(n9e,o);case 2:case"end":return l.stop()}},a)}))()},i.getSwapSelectors=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce;return b().wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return l=o.binanceChainIds,g=o.isAlphaOnly,y=bs(o,["binanceChainIds","isAlphaOnly"]),$e.next=3,Mce(l);case 3:return A=$e.sent,$e.next=6,hn.Swap.getSwapSelectors(gn(Mr({},y),{chainList:A,filter:g?{alpha:!0}:void 0}));case 6:I=$e.sent,P=[],D=!0,U=!1,V=void 0,$e.prev=9,J=Object.values(I.data)[Symbol.iterator]();case 11:if(D=(re=J.next()).done){$e.next=36;break}return ce=re.value,$e.next=15,a.filterOndoToken(ce);case 15:for(Re=$e.sent,De=!0,Ue=!1,Ve=void 0,$e.prev=17,pe=Re[Symbol.iterator]();!(De=(Se=pe.next()).done);De=!0)Ce=Se.value,P.push(gn(Mr({},Ce),{contractAddress:bg.getUniversalContractAddress(Ce.binanceChainId,Ce.contractAddress)}));$e.next=25;break;case 21:$e.prev=21,$e.t0=$e.catch(17),Ue=!0,Ve=$e.t0;case 25:$e.prev=25,$e.prev=26,!De&&pe.return!=null&&pe.return();case 28:if($e.prev=28,!Ue){$e.next=31;break}throw Ve;case 31:return $e.finish(28);case 32:return $e.finish(25);case 33:D=!0,$e.next=11;break;case 36:$e.next=42;break;case 38:$e.prev=38,$e.t1=$e.catch(9),U=!0,V=$e.t1;case 42:$e.prev=42,$e.prev=43,!D&&J.return!=null&&J.return();case 45:if($e.prev=45,!U){$e.next=48;break}throw V;case 48:return $e.finish(45);case 49:return $e.finish(42);case 50:return $e.abrupt("return",P);case 51:case"end":return $e.stop()}},u,null,[[9,38,42,50],[17,21,25,33],[26,,28,32],[43,,45,49]])}))()},i.searchSwapSelectors=function(o,a,u){var l=this;return(0,k.A)(b().mark(function g(){var y,A,I,P,D,U,V,J,re,ce;return b().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.next=2,Mce(o);case 2:return y=De.sent,De.next=5,hn.Swap.searchSwapSelectors({chainList:y,inputValue:a,filter:u?{alpha:!0}:void 0});case 5:return A=De.sent,I=[],De.next=9,l.filterOndoToken(A.data);case 9:for(P=De.sent,D=!0,U=!1,V=void 0,De.prev=11,J=P[Symbol.iterator]();!(D=(re=J.next()).done);D=!0)ce=re.value,I.push(gn(Mr({},ce),{contractAddress:bg.getUniversalContractAddress(ce.binanceChainId,ce.contractAddress)}));De.next=19;break;case 15:De.prev=15,De.t0=De.catch(11),U=!0,V=De.t0;case 19:De.prev=19,De.prev=20,!D&&J.return!=null&&J.return();case 22:if(De.prev=22,!U){De.next=25;break}throw V;case 25:return De.finish(22);case 26:return De.finish(19);case 27:return De.abrupt("return",I);case 28:case"end":return De.stop()}},g,null,[[11,15,19,27],[20,,22,26]])}))()},i.filterOndoToken=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(lre);case 2:return u=g.sent,g.abrupt("return",o.filter(function(y){var A="".concat(Wl(y.contractAddress),"-").concat(y.binanceChainId);return!u[A]}));case 4:case"end":return g.stop()}},a)}))()},i.getSelectorInfo=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I,P;return b().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=3,Fi.getNetworkList();case 3:if(g=U.sent,y=(0,H.keyBy)(g,function(V){return V.binanceChainId}),A=o.filter(function(V){var J=V.contractAddress,re=V.binanceChainId;return J&&re}).filter(function(V){var J;return(J=y[V.binanceChainId])===null||J===void 0?void 0:J.networkIdOnBinance}).map(function(V){return{contractAddress:bg.getSwapContractAddress(V.binanceChainId,V.contractAddress),binanceChainId:V.binanceChainId,networkId:y[V.binanceChainId].networkIdOnBinance}}),A.length!==0){U.next=8;break}return U.abrupt("return",[]);case 8:return U.next=10,hn.Swap.getSelectorInfo(A);case 10:if(I=U.sent,!(!I?.data||!(!(I==null||(l=I.data)===null||l===void 0)&&l.length))){U.next=13;break}return U.abrupt("return",[]);case 13:return P=I.data.map(function(V){return gn(Mr({},V),{contractAddress:bg.getUniversalContractAddress(V.binanceChainId,V.contractAddress),needSimulate:V.transferTax!=="0"})}),K(a,Zce,Xze).call(a,P),U.abrupt("return",P);case 16:case"end":return U.stop()}},u)}))()},i.getQuickSwapGasPrice=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return u=o.binanceChainId,l=o.scenario,g=no(u),D.next=4,Fi.getNetworkList();case 4:if(y=D.sent,A=y.find(function(U){return U.id===g}),A?.networkIdOnBinance){D.next=8;break}return D.abrupt("return",null);case 8:return D.prev=8,D.next=11,YF(A.networkIdOnBinance,{binanceChainId:u,scenario:l});case 11:return I=D.sent,D.abrupt("return",I);case 15:return D.prev=15,D.t0=D.catch(8),console.error("[SwapController] getQuickSwapGasPrice error:",D.t0),D.abrupt("return",null);case 19:case"end":return D.stop()}},a,null,[[8,15]])}))()},i.getSwapQuote=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt,Ne,Me,ct,mt,Bt;return b().wrap(function(cr){for(;;)switch(cr.prev=cr.next){case 0:return u=o.fromWalletAddress,l=o.toWalletAddress,g=o.fromTokenAddress,y=o.toTokenAddress,A=o.fromTokenAmount,I=o.toTokenAmount,P=o.fromTokenDecimals,D=o.toTokenDecimals,U=o.fromNetworkId,V=o.toNetworkId,J=o.fromBinanceChainId,re=o.toBinanceChainId,ce=o.fromTokenSymbol,Re=o.toTokenSymbol,De=o.slippage,Ue=o.mev,Ve=o.isTransferTax,pe=o.maxRecommendSlippage,cr.next=3,Fi.getNetworkList();case 3:return Se=cr.sent,Ce=Se.find(function(pr){return pr.binanceChainId===J}),$e=(je=Ce?.nativeTokenDecimals)!==null&&je!==void 0?je:18,cr.next=9,y4(u,Ce.id);case 9:return Qe=cr.sent,cr.prev=10,nt=De!==void 0?ti(De).dividedBy(100).toFixed():void 0,Ne=pe!==void 0?ti(pe).dividedBy(100).toFixed():void 0,cr.next=15,oA.fetchQuote({kind:yoe.SWAP_QUOTE,input:{fromAddress:u,toAddress:l,fromTokenAddress:g,toTokenAddress:y,fromTokenAmount:J1(A),toTokenAmount:J1(I),fromTokenDecimals:P,toTokenDecimals:D,fromNetworkId:U,toNetworkId:V,fromBinanceChainId:J,toBinanceChainId:re,fromTokenSymbol:ce,toTokenSymbol:Re,slippage:nt,mev:Ue,isTransferTax:Ve,maxRecommendSlippage:Ne,nativeTokenDecimals:$e,extra:{walletType:Qe,version:2}}});case 15:if(Me=cr.sent,console.log("\u{1F680} ~ SwapController ~ getSwapQuote ~ response:",Me),Ii.updateTokenPriceByContractAndBinanceChainIdList([{contractAddress:g,binanceChainId:J},{contractAddress:y,binanceChainId:re}]),!Me.error){cr.next=21;break}return ct=xze(Me.error.code),cr.abrupt("return",{error:{type:ct,message:Me.error.message,data:Me.error.data},result:null});case 21:if(Me.data){cr.next=23;break}return cr.abrupt("return",{error:{type:j2.QUOTE_FETCH_FAILED,message:"No data returned from SDK"},result:null});case 23:return cr.abrupt("return",{error:null,result:{quotes:Me.data.quotes,slippage:{slippage:Me.data.slippage.slippage,isNeedRemind:(mt=Me.data.slippage.isNeedRemind)!==null&&mt!==void 0?mt:!1,remindContext:(Bt=Me.data.slippage.remindContext)!==null&&Bt!==void 0?Bt:""},expireTime:Me.data.expireTime}});case 27:return cr.prev=27,cr.t0=cr.catch(10),console.error("[SwapController] getSwapQuote error:",cr.t0),cr.abrupt("return",{error:{type:j2.QUOTE_FETCH_FAILED,message:(0,ag.A)(cr.t0,Error)?cr.t0.message:"Unknown error"},result:null});case 31:case"end":return cr.stop()}},a,null,[[10,27]])}))()},i.checkApprove=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe;return b().wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return u=o.vendor,l=o.fromTokenAddress,g=o.fromTokenAmount,y=o.fromTokenDecimals,A=o.fromBinanceChainId,I=o.router,P=o.fromWalletAddress,D=o.isNativeToken,U=o.quoteMode,Ce.next=3,Fi.getNetworkList();case 3:if(V=Ce.sent,J=V.find(function(je){return je.binanceChainId===A}),J){Ce.next=7;break}return Ce.abrupt("return",{approved:!1,isApproveUnlimited:!1,allowance:"0",error:"Network not found for binanceChainId: ".concat(A)});case 7:return Ce.prev=7,Ce.next=11,oA.checkApprove({quoteMode:U,fromTokenAddress:l,fromTokenAmount:g,fromTokenDecimals:y,fromBinanceChainId:A,router:I,wcId:J.wcId,fromWalletAddress:P,isNativeToken:D});case 11:if(De=Ce.sent,!De.error){Ce.next=14;break}return Ce.abrupt("return",{approved:!1,isApproveUnlimited:!1,allowance:"0",error:De.error.message||"Check approve failed"});case 14:return Ce.abrupt("return",{approved:(Ue=(re=De.data)===null||re===void 0?void 0:re.approved)!==null&&Ue!==void 0?Ue:!1,isApproveUnlimited:(Ve=(ce=De.data)===null||ce===void 0?void 0:ce.isApproveUnlimited)!==null&&Ve!==void 0?Ve:!1,allowance:(pe=(Re=De.data)===null||Re===void 0?void 0:Re.allowance)!==null&&pe!==void 0?pe:"0"});case 18:return Ce.prev=18,Ce.t0=Ce.catch(7),console.error("[SwapController] checkApprove error:",Ce.t0),Ce.abrupt("return",{approved:!1,isApproveUnlimited:!1,allowance:"0",error:(0,ag.A)(Ce.t0,Error)?Ce.t0.message:"Unknown error"});case 22:case"end":return Ce.stop()}},a,null,[[7,18]])}))()},i.getSwapRiskDetail=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.prev=0,I.next=3,y4(o.fromWalletAddress,no(o.fromChainId));case 3:return u=I.sent,I.next=6,hn.Swap.swapSecurityCheck(gn(Mr({},o),{walletType:u}));case 6:return l=I.sent,g=function(P){var D,U,V,J;return(J=(V=(D=l.data)===null||D===void 0||(U=D.items)===null||U===void 0?void 0:U.find(function(re){return re.address===P}))===null||V===void 0?void 0:V.riskLevel)!==null&&J!==void 0?J:0},y={requestId:o.requestId,fromBinanceChainId:o.fromChainId,fromWalletAddress:o.fromWalletAddress,fromTokenAddress:o.fromTokenAddress,fromTokenRiskLevel:g(o.fromTokenAddress),toBinanceChainId:o.toChainId,toWalletAddress:o.toWalletAddress,toTokenAddress:o.toTokenAddress,toTokenRiskLevel:g(o.toTokenAddress),amount:o.amount},I.abrupt("return",{requestId:l.data.requestId,level:l.data.overallRiskLevel,message:l.data.overallRiskDetail,transferTax:l.data.transferTax,riskAlert:l.data.riskAlert,riskPopup:l.data.riskPopup,trackData:y,fromTokenRiskLevel:y.fromTokenRiskLevel,toTokenRiskLevel:y.toTokenRiskLevel});case 12:throw I.prev=12,I.t0=I.catch(0),console.error("[SwapController] getSwapRiskDetail error:",I.t0),I.t0;case 16:case"end":return I.stop()}},a,null,[[0,12]])}))()},i.getReservedGas=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",qze(o));case 1:case"end":return l.stop()}},a)}))()},i.addSwapConfirm=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue;return b().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return u=o.swapConfirmParams,l=o.antiMEV,g=o.approvalInfo,y=o.quoteReq,A=u.fromWalletId,I=u.fromToken,pe.next=4,vn.getWalletItemByWalletId(A);case 4:if(P=pe.sent,P){pe.next=7;break}throw new Error("Wallet not found for walletId: ".concat(A));case 7:return pe.next=9,Fi.getNetworkList();case 9:if(D=pe.sent,U=D.find(function(Se){return Se.binanceChainId===I.binanceChainId}),U){pe.next=13;break}throw new Error("Network not found for binanceChainId: ".concat(I.binanceChainId));case 13:return V=dh(P,U.chainType)[0],J={origin:"",networkType:U.chainType,accountId:P.accounts[0].id,networkId:U.id,signSource:Go.swap,address:V},pe.next=17,Zn.addApproval({type:Hs.Loading,origin:"",requestData:{originType:Hs.SwapConfirm},requestId:u.quote.requestId,source:Go.swap,onlyCancel:!0});case 17:return re=pe.sent,ce=function(){var Se=(0,k.A)(b().mark(function Ce(je){var $e,Qe,nt,Ne,Me,ct;return b().wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return $e=je.serialNum,Bt.next=3,$ce({swapConfirmParams:u,antiMEV:l,walletItem:P,fromNetwork:U,accountId:J.accountId});case 3:return Qe=Bt.sent,nt=Qe.mergedGasAccount,Ne=Qe.buildResultData,Bt.next=8,jce(u);case 8:return Me=Bt.sent,ct={signContext:J,swapParams:u,antiMEV:l,gasAccountInfo:nt,buildResultData:Ne,parsedResult:Me,requestId:u.quote.requestId,approvalInfo:g,quoteReq:y,serialNum:$e},Bt.next=12,Zn.upsertApproval({approvalId:re,origin:"",type:Hs.SwapConfirm,requestData:ct,requestId:u.quote.requestId,source:Go.swap});case 12:re=Bt.sent;case 13:case"end":return Bt.stop()}},Ce)}));return function(je){return Se.apply(this,arguments)}}(),Re=function(){var Se=(0,k.A)(b().mark(function Ce(){var je,$e,Qe;return b().wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return je=function(){return Gce({walletItem:P,quote:u.quote,fromToken:u.fromToken,toToken:u.toToken,slippage:u.slippage,approvalId:re})},Ne.next=3,je();case 3:if($e=Ne.sent,$e.type!=="error"){Ne.next=6;break}throw $e.error;case 6:if($e.type!=="needBlock"){Ne.next=11;break}return Ne.next=9,Zn.upsertApproval({approvalId:re,origin:"",type:Hs.TransactionBlock,requestData:{needBlockReason:$e.needBlockReason,requestId:u.quote.requestId},requestId:u.quote.requestId,source:Go.swap,onlyCancel:!0});case 9:return re=Ne.sent,Ne.abrupt("return");case 11:if($e.type!=="needConfirm"){Ne.next=17;break}return Qe={swapParams:u,antiMEV:l,quoteReq:y,serialNum:$e.serialNum},Ne.next=15,Ci.createMPCAppApproval({approvalId:re,arg:gn(Mr({},Qe),{signType:Hs.SendTransaction,signContext:J,isBroadcast:!0}),approvalType:Hs.MPCAppDexSign,generateTaskData:Vce({approvalId:re,swapParams:u,antiMEV:l,walletId:P.id,address:J.address,serialNum:$e.serialNum,callPreCheck:je})});case 15:return re=Ne.sent,Ne.abrupt("return");case 17:return Ne.next=19,ce({serialNum:$e.serialNum});case 19:case"end":return Ne.stop()}},Ce)}));return function(){return Se.apply(this,arguments)}}(),pe.prev=20,pe.next=23,Re();case 23:pe.next=31;break;case 25:return pe.prev=25,pe.t0=pe.catch(20),console.error("[SwapController:addSwapConfirm] error in MPC check or approval preparation",pe.t0),pe.next=30,Zn.upsertApproval({approvalId:re,origin:"",type:Hs.NeedRefresh,requestData:{},requestId:u.quote.requestId,source:Go.swap,onRefresh:(0,k.A)(b().mark(function Se(){return b().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,Re();case 2:case"end":return je.stop()}},Se)})),onlyCancel:!0});case 30:re=pe.sent;case 31:return pe.next=33,Zn.waitForApproval(re);case 33:if(De=pe.sent,!De){pe.next=37;break}return Ue=Zn.fetchExtraReturn(re),pe.abrupt("return",{orderId:Ue.orderId,isAgree:!0});case 37:return pe.abrupt("return",{isAgree:De});case 38:case"end":return pe.stop()}},a,null,[[20,25]])}))()},i.changeApproveAmount=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return u=o.approvalId,l=o.amount,P.next=3,Zn.getApproval(u);case 3:if(g=P.sent,g){P.next=6;break}throw new Error("Approval not found for approvalId: ".concat(u));case 6:if(y=g.requestData,y.approvalInfo){P.next=9;break}throw new Error("Approval does not have approvalInfo");case 9:return A=gn(Mr({},y),{approvalInfo:gn(Mr({},y.approvalInfo),{amount:l})}),P.next=12,Zn.changeRequestData(u,A);case 12:case"end":return P.stop()}},a)}))()},i.refreshQuote=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.abrupt("return",qce({approvalId:o.approvalId,getSwapQuote:a.getSwapQuote.bind(a)}));case 1:case"end":return g.stop()}},u)}))()},i.homePageComplianceCheck=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,hn.Swap.homePageCheck(o);case 3:return u=g.sent,g.abrupt("return",u.data);case 7:throw g.prev=7,g.t0=g.catch(0),console.error("[SwapController] homePageComplianceCheck error:",g.t0),g.t0;case 11:case"end":return g.stop()}},a,null,[[0,7]])}))()},i.queryOrder=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.Swap.queryOrder(o);case 2:return u=g.sent,g.abrupt("return",u.data);case 4:case"end":return g.stop()}},a)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[Fi,Zn]}}]),n}(Yr);function Xze(r){return iW.apply(this,arguments)}function iW(){return iW=(0,k.A)(b().mark(function r(e){var n,i,s,o,a,u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce,je,$e,Qe,nt;return b().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(Me.prev=0,e.length!==0){Me.next=3;break}return Me.abrupt("return");case 3:return n=e.map(function(ct){return{contractAddress:ct.contractAddress,binanceChainId:ct.binanceChainId}}),Me.next=6,Ii.getTokenMetaByContractList(n);case 6:i=Me.sent,s=new Map,o=!0,a=!1,u=void 0,Me.prev=9,l=i[Symbol.iterator]();case 11:if(o=(g=l.next()).done){Me.next=33;break}for(y=g.value,A=!0,I=!1,P=void 0,Me.prev=14,D=y.tokenAddresses[Symbol.iterator]();!(A=(U=D.next()).done);A=!0)V=U.value,J="".concat(Wl(V.contractAddress),"-").concat(V.chainId),s.set(J,y);Me.next=22;break;case 18:Me.prev=18,Me.t0=Me.catch(14),I=!0,P=Me.t0;case 22:Me.prev=22,Me.prev=23,!A&&D.return!=null&&D.return();case 25:if(Me.prev=25,!I){Me.next=28;break}throw P;case 28:return Me.finish(25);case 29:return Me.finish(22);case 30:o=!0,Me.next=11;break;case 33:Me.next=39;break;case 35:Me.prev=35,Me.t1=Me.catch(9),a=!0,u=Me.t1;case 39:Me.prev=39,Me.prev=40,!o&&l.return!=null&&l.return();case 42:if(Me.prev=42,!a){Me.next=45;break}throw u;case 45:return Me.finish(42);case 46:return Me.finish(39);case 47:re={},ce={},Re=!0,De=!1,Ue=void 0,Me.prev=50,Ve=e[Symbol.iterator]();case 52:if(Re=(pe=Ve.next()).done){Me.next=65;break}if(Se=pe.value,Ce="".concat(Wl(Se.contractAddress),"-").concat(Se.binanceChainId),je=s.get(Ce),je){Me.next=58;break}return Me.abrupt("continue",62);case 58:re[je.id]={price:Se.price,percentChange24h:Se.percentChange24h},$e=gn(Mr({},je),{name:Se.name,symbol:Se.symbol}),Se.logoUrl!==null&&($e.icon=Se.logoUrl),ce[je.id]=$e;case 62:Re=!0,Me.next=52;break;case 65:Me.next=71;break;case 67:Me.prev=67,Me.t2=Me.catch(50),De=!0,Ue=Me.t2;case 71:Me.prev=71,Me.prev=72,!Re&&Ve.return!=null&&Ve.return();case 74:if(Me.prev=74,!De){Me.next=77;break}throw Ue;case 77:return Me.finish(74);case 78:return Me.finish(71);case 79:Qe=Object.keys(re).length>0,nt=Object.keys(ce).length>0,Qe&&p7.updateValue(re),nt&&h7.updateValue(ce),Me.next=88;break;case 85:Me.prev=85,Me.t3=Me.catch(0),console.error("[SwapController] #updateTokenMetaAndPriceBySelector error:",Me.t3);case 88:case"end":return Me.stop()}},r,null,[[0,85],[9,35,39,47],[14,18,22,30],[23,,25,29],[40,,42,46],[50,67,71,79],[72,,74,78]])})),iW.apply(this,arguments)}function Jze(){return sW.apply(this,arguments)}function sW(){return sW=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=3,hn.Swap.getAggregatorConfig();case 3:return n=g.sent,i=Object.keys(n.data.swapTokenConfig).reduce(function(y,A){var I=n.data.swapTokenConfig[A].defaultStableToken;return y[A]={defaultStableToken:I?Mr({},I):void 0,nativeTokenList:n.data.swapTokenConfig[A].nativeTokenList.map(function(P){return gn(Mr({},P),{contractAddress:bg.getUniversalContractAddress(P.binanceChainId,P.contractAddress)})}),stableTokenList:n.data.swapTokenConfig[A].stableTokenList.map(function(P){return gn(Mr({},P),{contractAddress:bg.getUniversalContractAddress(P.binanceChainId,P.contractAddress)})})},y},{}),s=(n.data.bridgeNetworkPairs||[]).reduce(function(y,A){return y[A.fromChainConfig.binanceChainId]=A,y},{}),o=(((e=n.data.bnPaySwapConfig)===null||e===void 0?void 0:e.swapTradingTokenList)||[]).filter(function(y){return y.status==="ENABLE"}),a=Object.keys(n.data.proModeStableCoinConfigs||{}).reduce(function(y,A){return y[A]=n.data.proModeStableCoinConfigs[A].map(function(I){return gn(Mr({},I),{tokenAddress:bg.getUniversalContractAddress(I.binanceChainId,I.tokenAddress)})}),y},{}),u={bridgeNetworkList:n.data.bridgeNetworkList,estimatedGasList:n.data.estimatedGasList,swapNetworkList:n.data.swapNetworkList,bridgeNetworkPairs:n.data.bridgeNetworkPairs||[],bridgeNetworkPairsMap:s,swapTokenConfig:i,mevConfigs:n.data.mevConfigs,gasFreeChains:n.data.gasFreeChains,bnPaySwapConfig:gn(Mr({},n.data.bnPaySwapConfig),{swapTradingTokenList:o}),quoteSpreadLimitConfig:n.data.quoteSpreadLimitConfig,cbtInputBufferUsd:n.data.cbtInputBufferUsd,presetMaxSlippageConfigs:n.data.presetMaxSlippageConfigs,proModeStableCoinConfigs:a},g.next=11,zt.set(r9e,u);case 11:case"end":return g.stop()}},r)})),sW.apply(this,arguments)}var To=new Yze;_e("swap",{getSwapSelectors:To.getSwapSelectors.bind(To),searchSwapSelectors:To.searchSwapSelectors.bind(To),getSelectorInfo:To.getSelectorInfo.bind(To),updateMaxRecommendSlippage:To.updateMaxRecommendSlippage.bind(To),getQuickSwapGasPrice:To.getQuickSwapGasPrice.bind(To),getSwapQuote:To.getSwapQuote.bind(To),checkApprove:To.checkApprove.bind(To),getSwapRiskDetail:To.getSwapRiskDetail.bind(To),getReservedGas:To.getReservedGas.bind(To),addSwapConfirm:To.addSwapConfirm.bind(To),changeApproveAmount:To.changeApproveAmount.bind(To),refreshQuote:To.refreshQuote.bind(To),homePageComplianceCheck:To.homePageComplianceCheck.bind(To),queryOrder:To.queryOrder.bind(To)});var Qze=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="tokenAudit",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:globalThis.getAuditInfo=o.getAuditInfo.bind(o);case 1:case"end":return l.stop()}},a)}))()},i.getAuditInfo=function(o,a){return(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(!za(a)){D.next=3;break}return D.abrupt("return",null);case 3:return D.next=5,Ii.getTokenMetaByTokenId(o);case 5:if(g=D.sent,g){D.next=8;break}return D.abrupt("return",null);case 8:if(y=Za(a),A=(l=g.tokenAddresses.find(function(U){return U.chainId===y}))===null||l===void 0?void 0:l.contractAddress,A){D.next=12;break}return D.abrupt("return",null);case 12:return D.next=14,hn.TokenAudit.getTokenAudit({binanceChainId:y,contractAddress:A});case 14:return I=D.sent,D.abrupt("return",I.data);case 16:case"end":return D.stop()}},u)}))()},n}(Yr),oW=new Qze;_e("tokenAudit",{getAuditInfo:oW.getAuditInfo.bind(oW)});var e$e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="transaction",s}var i=n.prototype;return i.txHistory=function(o){return(0,k.A)(b().mark(function a(){var u,l,g,y,A,I,P,D,U,V,J,re,ce,Re,De,Ue,Ve,pe,Se,Ce;return b().wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return u=o.walletIds,l=o.startTime,g=o.endTime,y=o.nextToken,A=o.networkIds,I=o.tokenIds,P=o.activityType,D=o.hideSpam,U=o.hideLowValue,V=(A??[]).map(function(Qe){return Za(Qe)}).join(",")||void 0,J=(I??[]).map(function(Qe){return Wm(Qe)}).join(",")||void 0,$e.next=5,Ci.getAndCheckMpcWalletStatus();case 5:return re=$e.sent,ce=u.filter(function(Qe){return Qe!==re?.id}),Re=re?.id,De=Re&&u.includes(Re),Ue={keyIds:ce.join(","),mpcKeyId:De?Re:void 0,startTime:l,endTime:g,nextToken:y,activityType:P,binanceChainIds:V,tokenIds:J,hideRisk:D,hideLowValue:U,size:30},Object.keys(Ue).forEach(function(Qe){(Ue[Qe]===void 0||Ue[Qe]==="")&&delete Ue[Qe]}),$e.next=13,hn.Transaction.getHistoryList(Ue);case 13:return Ve=$e.sent.data,Se=(pe=Ve?.list)!==null&&pe!==void 0?pe:[],Ce=Se.map(function(Qe){return gn(Mr({},Qe),{networkId:no(Qe.binanceChainId)})}),$e.abrupt("return",{list:Ce,nextToken:Ve?.nextToken});case 18:case"end":return $e.stop()}},a)}))()},i.txDetail=function(o){return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,hn.Transaction.getTxDetail(o);case 2:return u=g.sent,g.abrupt("return",gn(Mr({},u.data),{networkId:no(u.data.binanceChainId)}));case 4:case"end":return g.stop()}},a)}))()},i.waitHash=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A;return b().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return l=o.txHash,g=o.address,y=o.binanceChainId,A=null,P.next=4,oM((0,k.A)(b().mark(function D(){var U;return b().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,a.txDetail({txHash:l,address:g,binanceChainId:y});case 2:return U=J.sent,U&&(A=U.status),J.abrupt("return",U&&(U.status===rg.CONFIRMED||U.status===rg.FAILED));case 5:case"end":return J.stop()}},D)})),{interval:1500,timeout:6e4});case 4:return P.abrupt("return",A);case 5:case"end":return P.stop()}},u)}))()},n}(Yr),uv=new e$e;_e("transaction",{txHistory:uv.txHistory.bind(uv),txDetail:uv.txDetail.bind(uv),waitHash:uv.waitHash.bind(uv)});var t$e={translationResources:{},languageList:[]},Xce=Nr(t$e),r$e=Xce.translationResourcesBgAtom,n$e=Xce.languageListBgAtom,vS="__fetchTime__",i$e=1*60*60*1e3,Jce=new WeakSet,aW=new WeakMap,O4=new WeakSet,Qce=new WeakSet,ele=new WeakSet,P4=new WeakSet,tle=new WeakSet,s$e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),Jce),B(F(s),O4),B(F(s),Qce),B(F(s),ele),B(F(s),P4),B(F(s),tle),s.name="translation",de(F(s),aW,{writable:!0,value:rf(function(o){return hn.Translation.getResource(o)},{cacheTime:5*60*1e3})}),s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Promise.all([K(o,Jce,o$e).call(o),K(o,tle,c$e).call(o)]);case 2:wo.onHasUIConnected(function(){K(o,Qce,a$e).call(o)});case 3:case"end":return l.stop()}},a)}))()},i.changeLanguage=function(o){var a=this;return(0,k.A)(b().mark(function u(){return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,X(a,aW).call(a,o);case 2:return g.next=4,Bi.updatePreference("currentLanguage",o);case 4:return g.next=6,K(a,O4,cW).call(a,o);case 6:return g.next=8,K(a,P4,hW).call(a);case 8:case"end":return g.stop()}},u)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[wo]}}]),n}(Yr);function o$e(){return uW.apply(this,arguments)}function uW(){return uW=(0,k.A)(b().mark(function r(){var e,n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e=this,a.next=3,Bi.getPreference("currentLanguage");case 3:return n=a.sent,i="en",s=(0,H.uniq)([n,i]),a.next=8,Promise.all(s.map(function(u){return K(e,O4,cW).call(e,u)}));case 8:return a.next=10,K(this,P4,hW).call(this);case 10:case"end":return a.stop()}},r,this)})),uW.apply(this,arguments)}function cW(r){return lW.apply(this,arguments)}function lW(){return lW=(0,k.A)(b().mark(function r(e){var n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,X(this,aW).call(this,e);case 2:return n=a.sent,a.next=5,Sr.get(e);case 5:return i=a.sent,s=i&&(0,H.isEqual)((0,H.omit)(i,[vS,"_id"]),n),a.next=9,Sr.upsert(e,gn(Mr({},n),vt({},vS,Date.now())));case 9:return a.abrupt("return",s);case 10:case"end":return a.stop()}},r,this)})),lW.apply(this,arguments)}function a$e(){return fW.apply(this,arguments)}function fW(){return fW=(0,k.A)(b().mark(function r(){var e;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,Bi.getPreference("currentLanguage");case 3:return e=i.sent,i.next=6,K(this,ele,u$e).call(this,e);case 6:i.next=11;break;case 8:i.prev=8,i.t0=i.catch(0),console.error("Failed to fetch current language resource:",i.t0);case 11:case"end":return i.stop()}},r,this,[[0,8]])})),fW.apply(this,arguments)}function u$e(r){return dW.apply(this,arguments)}function dW(){return dW=(0,k.A)(b().mark(function r(e){var n,i,s;return b().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Sr.get(e);case 2:if(n=a.sent,i=!n||!n[vS]||Date.now()-n[vS]>i$e,!i){a.next=11;break}return a.next=7,K(this,O4,cW).call(this,e);case 7:if(s=a.sent,s){a.next=11;break}return a.next=11,K(this,P4,hW).call(this);case 11:case"end":return a.stop()}},r,this)})),dW.apply(this,arguments)}function hW(){return pW.apply(this,arguments)}function pW(){return pW=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y;return b().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Sr.toMap();case 2:for(e=I.sent,n={},i=!0,s=!1,o=void 0,I.prev=5,a=Object.entries(e)[Symbol.iterator]();!(i=(u=a.next()).done);i=!0)l=ur(u.value,2),g=l[0],y=l[1],n[g]={translation:(0,H.omit)(y,[vS])};I.next=13;break;case 9:I.prev=9,I.t0=I.catch(5),s=!0,o=I.t0;case 13:I.prev=13,I.prev=14,!i&&a.return!=null&&a.return();case 16:if(I.prev=16,!s){I.next=19;break}throw o;case 19:return I.finish(16);case 20:return I.finish(13);case 21:return I.next=23,zt.set(r$e,n);case 23:case"end":return I.stop()}},r,null,[[5,9,13,21],[14,,16,20]])})),pW.apply(this,arguments)}function c$e(){return gW.apply(this,arguments)}function gW(){return gW=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,zt.set(n$e,Hn);case 2:case"end":return n.stop()}},r)})),gW.apply(this,arguments)}var yW=new s$e;_e("translation",{changeLanguage:yW.changeLanguage.bind(yW)});var l$e={lastAcknowledgedUpgradeVersion:"",upgradeMessage:""},rle=Nr(l$e,{persistKeys:["lastAcknowledgedUpgradeVersion"]}),mW=rle.lastAcknowledgedUpgradeVersionBgAtom,nle=rle.upgradeMessageBgAtom,ile="prevVersion",f$e="local:keyshare",d$e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="versionUpgrade",s.criticalUpgradeFns=[{version:"1.2.0",fn:s.upgrade_1_2_0},{version:"1.3.1",fn:s.upgrade_1_3_1},{version:"1.3.2",fn:s.upgrade_1_3_2}],s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return u=Nc(),y.next=3,ee.getItem("local:".concat(ile));case 3:if(l=y.sent,!(l&&M2(u,l)>0)){y.next=10;break}return y.next=7,o.handleCriticalUpgrades(l,u);case 7:if(!(M2(l,"1.1.1")<0)){y.next=10;break}return y.next=10,aA.setAckVersion(l);case 10:return y.next=12,ee.setItem("local:".concat(ile),u);case 12:case"end":return y.stop()}},a)}))()},i.handleCriticalUpgrades=function(o,a){var u=this;return(0,k.A)(b().mark(function l(){var g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:g=!0,y=!1,A=void 0,V.prev=1,I=u.criticalUpgradeFns[Symbol.iterator]();case 3:if(g=(P=I.next()).done){V.next=11;break}if(D=P.value,!(M2(D.version,o)>=0)){V.next=8;break}return V.next=8,D.fn(D.version);case 8:g=!0,V.next=3;break;case 11:V.next=17;break;case 13:V.prev=13,V.t0=V.catch(1),y=!0,A=V.t0;case 17:V.prev=17,V.prev=18,!g&&I.return!=null&&I.return();case 20:if(V.prev=20,!y){V.next=23;break}throw A;case 23:return V.finish(20);case 24:return V.finish(17);case 25:case"end":return V.stop()}},l,null,[[1,13,17,25],[18,,20,24]])}))()},i.upgrade_1_3_2=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Ci.logout();case 2:case"end":return u.stop()}},o)}))()},i.upgrade_1_3_1=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Ci.logout();case 2:case"end":return u.stop()}},o)}))()},i.upgrade_1_2_0=function(){return(0,k.A)(b().mark(function o(){return b().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Ci.logout();case 2:return u.prev=2,u.next=5,ee.removeItem(f$e);case 5:u.next=9;break;case 7:u.prev=7,u.t0=u.catch(2);case 9:case"end":return u.stop()}},o,null,[[2,7]])}))()},n}(Yr),sle=new d$e,h$e=function(r){var e=r.replaceAll(".","-");return"upgrade-msg-v-".concat(e)},ole=new WeakSet,ale=new WeakSet,bW=new WeakSet,p$e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),B(F(s),ole),B(F(s),ale),B(F(s),bW),s.name="upgradeAnnouncement",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){var u;return b().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,zt.get(mW);case 2:if(u=g.sent,u){g.next=6;break}return g.next=6,o.ackUpgrade();case 6:return g.next=8,K(o,ole,g$e).call(o);case 8:case"end":return g.stop()}},a)}))()},i.setAckVersion=function(o){return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,zt.set(mW,o);case 2:case"end":return l.stop()}},a)}))()},i.ackUpgrade=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,o.setAckVersion(Nc());case 2:return l.next=4,zt.set(nle,"");case 4:case"end":return l.stop()}},a)}))()},(0,L.A)(n,[{key:"initDependency",get:function(){return[sle]}}]),n}(Yr);function g$e(){return vW.apply(this,arguments)}function vW(){return vW=(0,k.A)(b().mark(function r(){var e,n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,zt.get(mW);case 2:if(e=s.sent,e){s.next=5;break}return s.abrupt("return");case 5:if(n=Nc(),!(M2(n,e)>0)){s.next=9;break}return s.next=9,K(this,ale,y$e).call(this);case 9:case"end":return s.stop()}},r,this)})),vW.apply(this,arguments)}function y$e(){return wW.apply(this,arguments)}function wW(){return wW=(0,k.A)(b().mark(function r(){var e,n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Bi.getPreference("currentLanguage");case 2:return e=o.sent,n="en",o.next=6,K(this,bW,ule).call(this,e);case 6:if(i=o.sent,!(!i&&e!==n)){o.next=11;break}return o.next=10,K(this,bW,ule).call(this,n);case 10:i=o.sent;case 11:return o.next=13,zt.set(nle,i||"");case 13:case"end":return o.stop()}},r,this)})),wW.apply(this,arguments)}function ule(r){return AW.apply(this,arguments)}function AW(){return AW=(0,k.A)(b().mark(function r(e){var n,i;return b().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,n=Nc(),o.next=4,hn.Translation.getOthersResource(e);case 4:return i=o.sent,o.abrupt("return",i[h$e(n)]);case 8:return o.prev=8,o.t0=o.catch(0),console.error(o.t0),o.abrupt("return","");case 12:case"end":return o.stop()}},r,null,[[0,8]])})),AW.apply(this,arguments)}var aA=new p$e;_e("upgradeAnnouncement",{ackUpgrade:aA.ackUpgrade.bind(aA),setAckVersion:aA.setAckVersion.bind(aA)});var m$e=function(r){var e=new URL(r);return e.origin},N4=function(r){var e="session:risky-domain-".concat(r);return e},b$e=function(r){"use strict";N(n,r);var e=te(n);function n(){(0,G.A)(this,n);var s;return s=e.apply(this,arguments),s.name="urlBlocker",s}var i=n.prototype;return i.init=function(){var o=this;return(0,k.A)(b().mark(function a(){return b().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:o.addTabUpdateEvent();case 1:case"end":return l.stop()}},a)}))()},i.addTabUpdateEvent=function(){var o=this;chrome.tabs.onUpdated.addListener(function(){var a=(0,k.A)(b().mark(function u(l,g,y){var A,I,P,D,U,V,J,re,ce,Re,De;return b().wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(I=g?.url,I){Ve.next=4;break}return Ve.abrupt("return");case 4:if(P=m$e(I),!P.startsWith("chrome")){Ve.next=7;break}return Ve.abrupt("return");case 7:return D=N4(l),Ve.next=10,o.getDomainInfo(l);case 10:return U=Ve.sent,Ve.next=13,ee.setItem(D,gn(Mr({},U),{currentOrigin:P,returnUrl:I}));case 13:if(V=(A=U.acknowledgeInfo)===null||A===void 0?void 0:A[P],!V){Ve.next=16;break}return Ve.abrupt("return");case 16:return J=xu(),Ve.next=19,hn.Security.commonCheck({businessName:"web3_wallet_open_url_detection",params:{requestId:J,url:P}});case 19:if(re=Ve.sent,ce=re.data,Re=ce.riskLevel,!(Re<ou.HighRisk)){Ve.next=24;break}return Ve.abrupt("return");case 24:return De=U.riskInfo||{},Ve.next=27,ee.setItem(D,gn(Mr({},U),{currentOrigin:P,returnUrl:I,riskInfo:gn(Mr({},De),vt({},P,ce))}));case 27:chrome.tabs.update(l,{url:"chrome-extension://".concat(chrome.runtime.id,"/index.html?warning-domain")});case 28:case"end":return Ve.stop()}},u)}));return function(u,l,g){return a.apply(this,arguments)}}()),chrome.tabs.onRemoved.addListener(function(){var a=(0,k.A)(b().mark(function u(l){var g;return b().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return g=N4(l),A.next=3,ee.removeItem(g);case 3:case"end":return A.stop()}},u)}));return function(u){return a.apply(this,arguments)}}())},i.getBlockInfo=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(l=o.tabId,l){y.next=3;break}return y.abrupt("return",null);case 3:return y.abrupt("return",a.getDomainInfo(l));case 4:case"end":return y.stop()}},u)}))()},i.acknowledgeBlockedUrl=function(o){var a=this;return(0,k.A)(b().mark(function u(){var l,g,y,A,I;return b().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(l=o.tabId,l){D.next=3;break}return D.abrupt("return");case 3:return D.next=5,a.getDomainInfo(l);case 5:return g=D.sent,y=g.currentOrigin,A=N4(l),I=g?.acknowledgeInfo||{},I[y]=!0,D.next=12,ee.setItem(A,gn(Mr({},g),{acknowledgeInfo:I}));case 12:return D.next=14,chrome.tabs.update(l,{url:g.returnUrl});case 14:case"end":return D.stop()}},u)}))()},i.getDomainInfo=function(o){return(0,k.A)(b().mark(function a(){var u,l;return b().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return u=N4(o),y.next=3,ee.getItem(u);case 3:return l=y.sent,y.abrupt("return",l||{currentOrigin:"",returnUrl:""});case 5:case"end":return y.stop()}},a)}))()},n}(Yr),wS=new b$e;_e("urlBlock",{getBlockInfo:wS.getBlockInfo.bind(wS),acknowledgeBlockedUrl:wS.acknowledgeBlockedUrl.bind(wS)});var _W=[GT,Zn,yg,gT,GOe,vo,Da,R2,H1,wo,ZOe,C2,li,Cf,Ci,js,Fi,mh,qi,Bi,XOe,hs,R1,cm,F1,ng,G1,kf,To,Ii,ta,oW,uv,yW,aA,wS,sle,vn,vm,O2,lC];function v$e(){return EW.apply(this,arguments)}function EW(){return EW=(0,k.A)(b().mark(function r(){var e,n,i,s,o,a,u,l,g,y,A,I,P,D;return b().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:for(y=function(){return A.apply(this,arguments)},A=function(){return A=(0,k.A)(b().mark(function re(){var ce,Re,De,Ue,Ve,pe,Se,Ce;return b().wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:ce=!0,Re=!1,De=void 0,$e.prev=1,Ue=g.entries()[Symbol.iterator]();case 3:if(ce=(Ve=Ue.next()).done){$e.next=11;break}return pe=ur(Ve.value,2),Se=pe[0],Ce=pe[1],console.log(" ---- init layer ".concat(Se," --- ")),$e.next=8,Promise.allSettled(Ce.map(function(){var Qe=(0,k.A)(b().mark(function nt(Ne){var Me,ct;return b().wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(Bt.prev=0,Me=n.get(Ne)||[],ct=Me.every(function(er){return e.get(er)===!0}),ct){Bt.next=5;break}throw new Error("Dependencies for ".concat(Ne.name," are not initialized."));case 5:if(e.get(Ne)!==!0){Bt.next=7;break}return Bt.abrupt("return");case 7:return Bt.next=9,wee((0,k.A)(b().mark(function er(){return b().wrap(function(pr){for(;;)switch(pr.prev=pr.next){case 0:return pr.next=2,Ne.init();case 2:case"end":return pr.stop()}},er)})),5e3);case 9:e.set(Ne,!0),console.log(" ---- controller ".concat(Ne.name," init succeeded --- ")),Bt.next=18;break;case 13:Bt.prev=13,Bt.t0=Bt.catch(0),console.error(" ---- controller ".concat(Ne.name," init failed --- ")),console.error(Bt.t0),e.set(Ne,!1);case 18:case"end":return Bt.stop()}},nt,null,[[0,13]])}));return function(nt){return Qe.apply(this,arguments)}}()));case 8:ce=!0,$e.next=3;break;case 11:$e.next=17;break;case 13:$e.prev=13,$e.t0=$e.catch(1),Re=!0,De=$e.t0;case 17:$e.prev=17,$e.prev=18,!ce&&Ue.return!=null&&Ue.return();case 20:if($e.prev=20,!Re){$e.next=23;break}throw De;case 23:return $e.finish(20);case 24:return $e.finish(17);case 25:case"end":return $e.stop()}},re,null,[[1,13,17,25],[18,,20,24]])})),A.apply(this,arguments)},e=new Map,n=new Map,i=!0,s=!1,o=void 0,V.prev=5,a=_W[Symbol.iterator]();!(i=(u=a.next()).done);i=!0)l=u.value,n.set(l,l.initDependency||[]);V.next=13;break;case 9:V.prev=9,V.t0=V.catch(5),s=!0,o=V.t0;case 13:V.prev=13,V.prev=14,!i&&a.return!=null&&a.return();case 16:if(V.prev=16,!s){V.next=19;break}throw o;case 19:return V.finish(16);case 20:return V.finish(13);case 21:return g=w$e(n),console.log("first [initControllers] all layers:",g),V.next=27,y();case 27:console.log("first [initControllers] all done"),I=Array.from(e.entries()).filter(function(J){var re=ur(J,2),ce=re[1];return!ce}).map(function(J){var re=ur(J,1),ce=re[0];return ce}),P=0;case 30:if(!(I.length>0)){V.next=43;break}return console.log(" ---- retrying init for ".concat(I.length," failed controllers --- ")),V.next=34,y();case 34:if(I=I.filter(function(J){return!e.get(J)}),!(I.length>0)){V.next=41;break}return P++,D=P>3?40*1e3:Math.pow(2,P)*5e3,console.log(" ---- waiting ".concat(D/1e3,"s before next retry round --- ")),V.next=41,new Promise(function(J){return setTimeout(J,D)});case 41:V.next=30;break;case 43:wOe(void 0);case 44:case"end":return V.stop()}},r,null,[[5,9,13,21],[14,,16,20]])})),EW.apply(this,arguments)}function w$e(r){var e=new Map,n=new Map,i=[],s=new Set;_W.forEach(function(ct){e.set(ct,0)});var o=!0,a=!1,u=void 0;try{for(var l=function(ct,mt){var Bt=ur(mt.value,2),er=Bt[0],cr=Bt[1];cr.forEach(function(pr){e.set(er,(e.get(er)||0)+1);var Dr=n.get(pr)||[];Dr.push(er),n.set(pr,Dr)})},g=r.entries()[Symbol.iterator](),y;!(o=(y=g.next()).done);o=!0)l(g,y)}catch(ct){a=!0,u=ct}finally{try{!o&&g.return!=null&&g.return()}finally{if(a)throw u}}for(;s.size<_W.length;){var A=[],I=!0,P=!1,D=void 0;try{for(var U=e.entries()[Symbol.iterator](),V;!(I=(V=U.next()).done);I=!0){var J=ur(V.value,2),re=J[0],ce=J[1];ce===0&&!s.has(re)&&A.push(re)}}catch(ct){P=!0,D=ct}finally{try{!I&&U.return!=null&&U.return()}finally{if(P)throw D}}if(A.length===0)throw new Error("Circular dependency detected or unresolved graph");i.push(A);var Re=!0,De=!1,Ue=void 0;try{for(var Ve=A[Symbol.iterator](),pe;!(Re=(pe=Ve.next()).done);Re=!0){var Se=pe.value;s.add(Se);var Ce=n.get(Se)||[],je=!0,$e=!1,Qe=void 0;try{for(var nt=Ce[Symbol.iterator](),Ne;!(je=(Ne=nt.next()).done);je=!0){var Me=Ne.value;e.set(Me,(e.get(Me)||1)-1)}}catch(ct){$e=!0,Qe=ct}finally{try{!je&&nt.return!=null&&nt.return()}finally{if($e)throw Qe}}}}catch(ct){De=!0,Ue=ct}finally{try{!Re&&Ve.return!=null&&Ve.return()}finally{if(De)throw Ue}}}return i}var A$e=chrome;function cle(){var r=new Date().toISOString();A$e.storage.session.set({aliveTimestamp:r})}var _$e=(0,H.once)(function(){var r=2e3;cle(),setInterval(cle,r)});function E$e(r){return TW.apply(this,arguments)}function TW(){return TW=(0,k.A)(b().mark(function r(e){var n;return b().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=e.tabId,s.next=3,vm.setCurrentActiveTabId(n);case 3:case"end":return s.stop()}},r)})),TW.apply(this,arguments)}var T$e=chrome,S$e=function(){var r=(0,k.A)(b().mark(function e(){return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,T$e.scripting.registerContentScripts([{id:"bw-wallet-inpage",matches:["file://*/*","http://*/*","https://*/*"],js:["inpage.js"],runAt:"document_start",world:"MAIN",allFrames:!0}]);case 3:i.next=8;break;case 5:i.prev=5,i.t0=i.catch(0),console.warn("Dropped attempt to register inpage content script. ".concat(i.t0));case 8:case"end":return i.stop()}},e,null,[[0,5]])}));return function(){return r.apply(this,arguments)}}();function I$e(){return SW.apply(this,arguments)}function SW(){return SW=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return _$e(),n.next=3,S$e();case 3:return chrome.runtime.onConnect.addListener(BOe),chrome.tabs.onActivated.addListener(E$e),n.next=7,v$e();case 7:return n.next=9,NOe();case 9:case"end":return n.stop()}},r)})),SW.apply(this,arguments)}var k$e=function(r){return Array.from(r).map(function(e){try{return JSON.stringify(e)}catch{try{return e.toString()}catch{return""}}}).join(" ")},R$e=function(){var r=function(e,n){return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];e.apply(void 0,(0,Li.A)(o)),!(o[0]&&(0,H.isString)(o[0])&&o[0].startsWith("!-"))&&Cf.addLog({ts:Date.now(),level:n,content:k$e(o),p:"background"})}};console.log=r(console.log.bind(console),"log"),console.warn=r(console.warn.bind(console),"warn"),console.error=r(console.error.bind(console),"error"),console.debug=r(console.debug.bind(console),"debug"),console.info=r(console.info.bind(console),"info")};function C$e(){return IW.apply(this,arguments)}function IW(){return IW=(0,k.A)(b().mark(function r(){return b().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return R$e(),console.debug("Hello background!",{id:chrome.runtime.id}),n.next=4,I$e();case 4:return console.debug("addConnectListener done"),n.next=7,wo.markBackgroundFinishInit();case 7:console.debug("markBackgroundFinishInit done"),_Oe(void 0);case 9:case"end":return n.stop()}},r)})),IW.apply(this,arguments)}C$e()})()})();
|
||
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bfa70e28-bbaf-5e08-8fb7-9e599b6c4ad5")}catch(e){}}();
|
||
//# debugId=bfa70e28-bbaf-5e08-8fb7-9e599b6c4ad5
|