@learncard/core 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- "use strict";var a5=Object.create;var zs=Object.defineProperty,f5=Object.defineProperties,c5=Object.getOwnPropertyDescriptor,u5=Object.getOwnPropertyDescriptors,l5=Object.getOwnPropertyNames,kc=Object.getOwnPropertySymbols,Cm=Object.getPrototypeOf,md=Object.prototype.hasOwnProperty,Dm=Object.prototype.propertyIsEnumerable,d5=Reflect.get;var bd=Math.pow,km=(r,e,t)=>e in r?zs(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ie=(r,e)=>{for(var t in e||(e={}))md.call(e,t)&&km(r,t,e[t]);if(kc)for(var t of kc(e))Dm.call(e,t)&&km(r,t,e[t]);return r},Ae=(r,e)=>f5(r,u5(e)),o=(r,e)=>zs(r,"name",{value:e,configurable:!0});var Im=(r,e)=>{var t={};for(var n in r)md.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&kc)for(var n of kc(r))e.indexOf(n)<0&&Dm.call(r,n)&&(t[n]=r[n]);return t};var gt=(r,e)=>()=>(r&&(e=r(r=0)),e);var me=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),St=(r,e)=>{for(var t in e)zs(r,t,{get:e[t],enumerable:!0})},Om=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l5(e))!md.call(r,i)&&i!==t&&zs(r,i,{get:()=>e[i],enumerable:!(n=c5(e,i))||n.enumerable});return r};var at=(r,e,t)=>(t=r!=null?a5(Cm(r)):{},Om(e||!r||!r.__esModule?zs(t,"default",{value:r,enumerable:!0}):t,r)),tf=r=>Om(zs({},"__esModule",{value:!0}),r);var gd=(r,e,t)=>d5(Cm(r),t,e);var Z=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{f(t.next(u))}catch(m){i(m)}},a=u=>{try{f(t.throw(u))}catch(m){i(m)}},f=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);f((t=t.apply(r,e)).next())});var Lm={};St(Lm,{concat:()=>vn});function vn(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}var yd=gt(()=>{o(vn,"concat")});function I5(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var s=r.charAt(i),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=i}var f=r.length,u=r.charAt(0),m=Math.log(f)/Math.log(256),p=Math.log(256)/Math.log(f);function x(T){if(T instanceof Uint8Array||(ArrayBuffer.isView(T)?T=new Uint8Array(T.buffer,T.byteOffset,T.byteLength):Array.isArray(T)&&(T=Uint8Array.from(T))),!(T instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(T.length===0)return"";for(var C=0,$=0,I=0,U=T.length;I!==U&&T[I]===0;)I++,C++;for(var z=(U-I)*p+1>>>0,H=new Uint8Array(z);I!==U;){for(var X=T[I],B=0,L=z-1;(X!==0||B<$)&&L!==-1;L--,B++)X+=256*H[L]>>>0,H[L]=X%f>>>0,X=X/f>>>0;if(X!==0)throw new Error("Non-zero carry");$=B,I++}for(var F=z-$;F!==z&&H[F]===0;)F++;for(var re=u.repeat(C);F<z;++F)re+=r.charAt(H[F]);return re}o(x,"encode");function k(T){if(typeof T!="string")throw new TypeError("Expected String");if(T.length===0)return new Uint8Array;var C=0;if(T[C]!==" "){for(var $=0,I=0;T[C]===u;)$++,C++;for(var U=(T.length-C)*m+1>>>0,z=new Uint8Array(U);T[C];){var H=t[T.charCodeAt(C)];if(H===255)return;for(var X=0,B=U-1;(H!==0||X<I)&&B!==-1;B--,X++)H+=f*z[B]>>>0,z[B]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");I=X,C++}if(T[C]!==" "){for(var L=U-I;L!==U&&z[L]===0;)L++;for(var F=new Uint8Array($+(U-L)),re=$;L!==U;)F[re++]=z[L++];return F}}}o(k,"decodeUnsafe");function O(T){var C=k(T);if(C)return C;throw new Error(`Non-${e} character`)}return o(O,"decode"),{encode:x,decodeUnsafe:k,decode:O}}var O5,P5,Bm,Um=gt(()=>{o(I5,"base");O5=I5,P5=O5,Bm=P5});var of={};St(of,{coerce:()=>en,empty:()=>Fm,equals:()=>xd,fromHex:()=>R5,fromString:()=>wd,isBinary:()=>L5,toHex:()=>N5,toString:()=>_d});var Fm,N5,R5,xd,en,L5,wd,_d,Vi=gt(()=>{Fm=new Uint8Array(0),N5=o(r=>r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),"toHex"),R5=o(r=>{let e=r.match(/../g);return e?new Uint8Array(e.map(t=>parseInt(t,16))):Fm},"fromHex"),xd=o((r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},"equals"),en=o(r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),L5=o(r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),"isBinary"),wd=o(r=>new TextEncoder().encode(r),"fromString"),_d=o(r=>new TextDecoder().decode(r),"toString")});var Dc,Ic,Oc,$m,Pc,Ks,Wi,B5,U5,Dt,yn=gt(()=>{Um();Vi();Dc=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}};o(Dc,"Encoder");Ic=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return $m(this,e)}};o(Ic,"Decoder");Oc=class{constructor(e){this.decoders=e}or(e){return $m(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};o(Oc,"ComposedDecoder");$m=o((r,e)=>new Oc(ie(ie({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e})),"or"),Pc=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Dc(e,t,n),this.decoder=new Ic(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Pc,"Codec");Ks=o(({name:r,prefix:e,encode:t,decode:n})=>new Pc(r,e,t,n),"from"),Wi=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Bm(t,e);return Ks({prefix:r,name:e,encode:n,decode:s=>en(i(s))})},"baseX"),B5=o((r,e,t,n)=>{let i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=r.length;for(;r[s-1]==="=";)--s;let a=new Uint8Array(s*t/8|0),f=0,u=0,m=0;for(let p=0;p<s;++p){let x=i[r[p]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<t|x,f+=t,f>=8&&(f-=8,a[m++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return a},"decode"),U5=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Dt=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ks({prefix:e,name:r,encode(i){return U5(i,n,t)},decode(i){return B5(i,n,t,r)}}),"rfc4648")});var Ed={};St(Ed,{identity:()=>F5});var F5,qm=gt(()=>{yn();Vi();F5=Ks({prefix:"\0",name:"identity",encode:r=>_d(r),decode:r=>wd(r)})});var Sd={};St(Sd,{base2:()=>$5});var $5,Hm=gt(()=>{yn();$5=Dt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Md={};St(Md,{base8:()=>q5});var q5,jm=gt(()=>{yn();q5=Dt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Ad={};St(Ad,{base10:()=>H5});var H5,zm=gt(()=>{yn();H5=Wi({prefix:"9",name:"base10",alphabet:"0123456789"})});var Td={};St(Td,{base16:()=>j5,base16upper:()=>z5});var j5,z5,Km=gt(()=>{yn();j5=Dt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),z5=Dt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var kd={};St(kd,{base32:()=>Vs,base32hex:()=>G5,base32hexpad:()=>J5,base32hexpadupper:()=>X5,base32hexupper:()=>Y5,base32pad:()=>V5,base32padupper:()=>W5,base32upper:()=>K5,base32z:()=>Z5});var Vs,K5,V5,W5,G5,Y5,J5,X5,Z5,Cd=gt(()=>{yn();Vs=Dt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),K5=Dt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),V5=Dt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),W5=Dt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),G5=Dt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Y5=Dt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),J5=Dt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),X5=Dt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Z5=Dt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Dd={};St(Dd,{base36:()=>Fo,base36upper:()=>Q5});var Fo,Q5,Nc=gt(()=>{yn();Fo=Wi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Q5=Wi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Id={};St(Id,{base58btc:()=>zn,base58flickr:()=>e8});var zn,e8,Od=gt(()=>{yn();zn=Wi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),e8=Wi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Pd={};St(Pd,{base64:()=>t8,base64pad:()=>r8,base64url:()=>Vm,base64urlpad:()=>n8});var t8,r8,Vm,n8,Nd=gt(()=>{yn();t8=Dt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),r8=Dt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Vm=Dt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),n8=Dt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Rd={};St(Rd,{base256emoji:()=>f8});function s8(r){return r.reduce((e,t)=>(e+=i8[t],e),"")}function a8(r){let e=[];for(let t of r){let n=o8[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Wm,i8,o8,f8,Gm=gt(()=>{yn();Wm=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),i8=Wm.reduce((r,e,t)=>(r[t]=e,r),[]),o8=Wm.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(s8,"encode");o(a8,"decode");f8=Ks({prefix:"\u{1F680}",name:"base256emoji",encode:s8,decode:a8})});function Xm(r,e,t){e=e||[],t=t||0;for(var n=t;r>=d8;)e[t++]=r&255|Ym,r/=128;for(;r&l8;)e[t++]=r&255|Ym,r>>>=7;return e[t]=r|0,Xm.bytes=t-n+1,e}function Ld(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw Ld.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Jm)<<i:(a&Jm)*Math.pow(2,i),i+=7}while(a>=p8);return Ld.bytes=s-n,t}var c8,Ym,u8,l8,d8,h8,p8,Jm,m8,b8,g8,v8,y8,x8,w8,_8,E8,S8,M8,A8,sf,Zm=gt(()=>{c8=Xm,Ym=128,u8=127,l8=~u8,d8=Math.pow(2,31);o(Xm,"encode");h8=Ld,p8=128,Jm=127;o(Ld,"read");m8=Math.pow(2,7),b8=Math.pow(2,14),g8=Math.pow(2,21),v8=Math.pow(2,28),y8=Math.pow(2,35),x8=Math.pow(2,42),w8=Math.pow(2,49),_8=Math.pow(2,56),E8=Math.pow(2,63),S8=o(function(r){return r<m8?1:r<b8?2:r<g8?3:r<v8?4:r<y8?5:r<x8?6:r<w8?7:r<_8?8:r<E8?9:10},"length"),M8={encode:c8,decode:h8,encodingLength:S8},A8=M8,sf=A8});var Gs={};St(Gs,{decode:()=>Ws,encodeTo:()=>$o,encodingLength:()=>qo});var Ws,$o,qo,Rc=gt(()=>{Zm();Ws=o(r=>[sf.decode(r),sf.decode.bytes],"decode"),$o=o((r,e,t=0)=>(sf.encode(r,e,t),e),"encodeTo"),qo=o(r=>sf.encodingLength(r),"encodingLength")});var Ho={};St(Ho,{Digest:()=>Gi,create:()=>Kn,decode:()=>af,equals:()=>Bd});var Kn,af,Bd,Gi,jo=gt(()=>{Vi();Rc();Kn=o((r,e)=>{let t=e.byteLength,n=qo(r),i=n+qo(t),s=new Uint8Array(i+t);return $o(r,s,0),$o(t,s,n),s.set(e,i),new Gi(r,t,e,s)},"create"),af=o(r=>{let e=en(r),[t,n]=Ws(e),[i,s]=Ws(e.subarray(n)),a=e.subarray(n+s);if(a.byteLength!==i)throw new Error("Incorrect length");return new Gi(t,i,a,e)},"decode"),Bd=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&xd(r.bytes,e.bytes),"equals"),Gi=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Gi,"Digest")});var Bc={};St(Bc,{Hasher:()=>ff,from:()=>Lc});var Lc,ff,Ud=gt(()=>{jo();Lc=o(({name:r,code:e,encode:t})=>new ff(r,e,t),"from"),ff=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Kn(this.code,t):t.then(n=>Kn(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(ff,"Hasher")});var Fd={};St(Fd,{sha256:()=>zo,sha512:()=>T8});var Qm,zo,T8,cf=gt(()=>{Ud();Qm=o(r=>e=>Z(void 0,null,function*(){return new Uint8Array(yield crypto.subtle.digest(r,e))}),"sha"),zo=Lc({name:"sha2-256",code:18,encode:Qm("SHA-256")}),T8=Lc({name:"sha2-512",code:19,encode:Qm("SHA-512")})});var $d={};St($d,{identity:()=>Uc});var e1,k8,t1,C8,Uc,qd=gt(()=>{Vi();jo();e1=0,k8="identity",t1=en,C8=o(r=>Kn(e1,t1(r)),"digest"),Uc={code:e1,name:k8,encode:t1,digest:C8}});var Hd={};St(Hd,{code:()=>I8,decode:()=>P8,encode:()=>O8,name:()=>D8});var D8,I8,O8,P8,r1=gt(()=>{Vi();D8="raw",I8=85,O8=o(r=>en(r),"encode"),P8=o(r=>en(r),"decode")});var jd={};St(jd,{code:()=>B8,decode:()=>F8,encode:()=>U8,name:()=>L8});var N8,R8,L8,B8,U8,F8,n1=gt(()=>{N8=new TextEncoder,R8=new TextDecoder,L8="json",B8=512,U8=o(r=>N8.encode(JSON.stringify(r)),"encode"),F8=o(r=>JSON.parse(R8.decode(r)),"decode")});var Pe,$8,q8,H8,uf,j8,i1,o1,Fc,$c,z8,K8,V8,Vn=gt(()=>{Rc();jo();Od();Cd();Vi();Pe=class{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:$c,byteLength:$c,code:Fc,version:Fc,multihash:Fc,bytes:Fc,_baseCache:$c,asCID:$c})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==uf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==j8)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Pe.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Kn(e,t);return Pe.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&Bd(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return q8(t,i,e||zn.encoder);default:return H8(t,i,e||Vs.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return K8(/^0\.0/,V8),!!(e&&(e[o1]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Pe)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Pe(t,n,i,s||i1(t,n,i.bytes))}else if(e!=null&&e[o1]===!0){let{version:t,multihash:n,code:i}=e,s=af(n);return Pe.create(t,i,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==uf)throw new Error(`Version 0 CID must use dag-pb (code: ${uf}) block encoding`);return new Pe(e,t,n,n.bytes)}case 1:{let i=i1(e,t,n.bytes);return new Pe(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Pe.create(0,uf,e)}static createV1(e,t){return Pe.create(1,e,t)}static decode(e){let[t,n]=Pe.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Pe.inspectBytes(e),n=t.size-t.multihashSize,i=en(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),a=new Gi(t.multihashCode,t.digestSize,s,i);return[t.version===0?Pe.createV0(a):Pe.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[x,k]=Ws(e.subarray(t));return t+=k,x},"next"),i=n(),s=uf;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=t,f=n(),u=n(),m=t+u,p=m-a;return{version:i,codec:s,multihashCode:f,digestSize:u,multihashSize:p,size:m}}static parse(e,t){let[n,i]=$8(e,t),s=Pe.decode(i);return s._baseCache.set(n,e),s}};o(Pe,"CID");$8=o((r,e)=>{switch(r[0]){case"Q":{let t=e||zn;return[zn.prefix,t.decode(`${zn.prefix}${r}`)]}case zn.prefix:{let t=e||zn;return[zn.prefix,t.decode(r)]}case Vs.prefix:{let t=e||Vs;return[Vs.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},"parseCIDtoBytes"),q8=o((r,e,t)=>{let{prefix:n}=t;if(n!==zn.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return i},"toStringV0"),H8=o((r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let s=t.encode(r);return e.set(n,s),s}else return i},"toStringV1"),uf=112,j8=18,i1=o((r,e,t)=>{let n=qo(r),i=n+qo(e),s=new Uint8Array(i+t.byteLength);return $o(r,s,0),$o(e,s,n),s.set(t,i),s},"encodeCID"),o1=Symbol.for("@ipld/js-cid/CID"),Fc={writable:!1,configurable:!1,enumerable:!0},$c={writable:!1,enumerable:!1,configurable:!1},z8="0.0.0-dev",K8=o((r,e)=>{if(r.test(z8))console.warn(e);else throw new Error(e)},"deprecate"),V8=`CID.isCID(v) is deprecated and will be removed in the next major release.
1
+ "use strict";var l5=Object.create;var js=Object.defineProperty,d5=Object.defineProperties,h5=Object.getOwnPropertyDescriptor,p5=Object.getOwnPropertyDescriptors,m5=Object.getOwnPropertyNames,kc=Object.getOwnPropertySymbols,Cm=Object.getPrototypeOf,md=Object.prototype.hasOwnProperty,Dm=Object.prototype.propertyIsEnumerable,b5=Reflect.get;var bd=Math.pow,km=(r,e,t)=>e in r?js(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ie=(r,e)=>{for(var t in e||(e={}))md.call(e,t)&&km(r,t,e[t]);if(kc)for(var t of kc(e))Dm.call(e,t)&&km(r,t,e[t]);return r},Te=(r,e)=>d5(r,p5(e)),o=(r,e)=>js(r,"name",{value:e,configurable:!0});var Om=(r,e)=>{var t={};for(var n in r)md.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&kc)for(var n of kc(r))e.indexOf(n)<0&&Dm.call(r,n)&&(t[n]=r[n]);return t};var gt=(r,e)=>()=>(r&&(e=r(r=0)),e);var me=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),St=(r,e)=>{for(var t in e)js(r,t,{get:e[t],enumerable:!0})},Im=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of m5(e))!md.call(r,i)&&i!==t&&js(r,i,{get:()=>e[i],enumerable:!(n=h5(e,i))||n.enumerable});return r};var at=(r,e,t)=>(t=r!=null?l5(Cm(r)):{},Im(e||!r||!r.__esModule?js(t,"default",{value:r,enumerable:!0}):t,r)),tf=r=>Im(js({},"__esModule",{value:!0}),r);var gd=(r,e,t)=>b5(Cm(r),t,e);var Z=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{f(t.next(u))}catch(m){i(m)}},a=u=>{try{f(t.throw(u))}catch(m){i(m)}},f=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);f((t=t.apply(r,e)).next())});var Lm={};St(Lm,{concat:()=>vn});function vn(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}var yd=gt(()=>{o(vn,"concat")});function R5(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var s=r.charAt(i),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=i}var f=r.length,u=r.charAt(0),m=Math.log(f)/Math.log(256),p=Math.log(256)/Math.log(f);function x(T){if(T instanceof Uint8Array||(ArrayBuffer.isView(T)?T=new Uint8Array(T.buffer,T.byteOffset,T.byteLength):Array.isArray(T)&&(T=Uint8Array.from(T))),!(T instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(T.length===0)return"";for(var C=0,$=0,O=0,U=T.length;O!==U&&T[O]===0;)O++,C++;for(var j=(U-O)*p+1>>>0,H=new Uint8Array(j);O!==U;){for(var X=T[O],B=0,L=j-1;(X!==0||B<$)&&L!==-1;L--,B++)X+=256*H[L]>>>0,H[L]=X%f>>>0,X=X/f>>>0;if(X!==0)throw new Error("Non-zero carry");$=B,O++}for(var F=j-$;F!==j&&H[F]===0;)F++;for(var re=u.repeat(C);F<j;++F)re+=r.charAt(H[F]);return re}o(x,"encode");function k(T){if(typeof T!="string")throw new TypeError("Expected String");if(T.length===0)return new Uint8Array;var C=0;if(T[C]!==" "){for(var $=0,O=0;T[C]===u;)$++,C++;for(var U=(T.length-C)*m+1>>>0,j=new Uint8Array(U);T[C];){var H=t[T.charCodeAt(C)];if(H===255)return;for(var X=0,B=U-1;(H!==0||X<O)&&B!==-1;B--,X++)H+=f*j[B]>>>0,j[B]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");O=X,C++}if(T[C]!==" "){for(var L=U-O;L!==U&&j[L]===0;)L++;for(var F=new Uint8Array($+(U-L)),re=$;L!==U;)F[re++]=j[L++];return F}}}o(k,"decodeUnsafe");function I(T){var C=k(T);if(C)return C;throw new Error(`Non-${e} character`)}return o(I,"decode"),{encode:x,decodeUnsafe:k,decode:I}}var L5,B5,Bm,Um=gt(()=>{o(R5,"base");L5=R5,B5=L5,Bm=B5});var of={};St(of,{coerce:()=>en,empty:()=>Fm,equals:()=>xd,fromHex:()=>F5,fromString:()=>wd,isBinary:()=>$5,toHex:()=>U5,toString:()=>_d});var Fm,U5,F5,xd,en,$5,wd,_d,Vi=gt(()=>{Fm=new Uint8Array(0),U5=o(r=>r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),"toHex"),F5=o(r=>{let e=r.match(/../g);return e?new Uint8Array(e.map(t=>parseInt(t,16))):Fm},"fromHex"),xd=o((r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},"equals"),en=o(r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),$5=o(r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),"isBinary"),wd=o(r=>new TextEncoder().encode(r),"fromString"),_d=o(r=>new TextDecoder().decode(r),"toString")});var Dc,Oc,Ic,$m,Pc,Ks,Wi,q5,H5,Dt,yn=gt(()=>{Um();Vi();Dc=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}};o(Dc,"Encoder");Oc=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return $m(this,e)}};o(Oc,"Decoder");Ic=class{constructor(e){this.decoders=e}or(e){return $m(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};o(Ic,"ComposedDecoder");$m=o((r,e)=>new Ic(ie(ie({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e})),"or"),Pc=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Dc(e,t,n),this.decoder=new Oc(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Pc,"Codec");Ks=o(({name:r,prefix:e,encode:t,decode:n})=>new Pc(r,e,t,n),"from"),Wi=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Bm(t,e);return Ks({prefix:r,name:e,encode:n,decode:s=>en(i(s))})},"baseX"),q5=o((r,e,t,n)=>{let i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=r.length;for(;r[s-1]==="=";)--s;let a=new Uint8Array(s*t/8|0),f=0,u=0,m=0;for(let p=0;p<s;++p){let x=i[r[p]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<t|x,f+=t,f>=8&&(f-=8,a[m++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return a},"decode"),H5=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Dt=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ks({prefix:e,name:r,encode(i){return H5(i,n,t)},decode(i){return q5(i,n,t,r)}}),"rfc4648")});var Ed={};St(Ed,{identity:()=>z5});var z5,qm=gt(()=>{yn();Vi();z5=Ks({prefix:"\0",name:"identity",encode:r=>_d(r),decode:r=>wd(r)})});var Sd={};St(Sd,{base2:()=>j5});var j5,Hm=gt(()=>{yn();j5=Dt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Md={};St(Md,{base8:()=>K5});var K5,zm=gt(()=>{yn();K5=Dt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Ad={};St(Ad,{base10:()=>V5});var V5,jm=gt(()=>{yn();V5=Wi({prefix:"9",name:"base10",alphabet:"0123456789"})});var Td={};St(Td,{base16:()=>W5,base16upper:()=>G5});var W5,G5,Km=gt(()=>{yn();W5=Dt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),G5=Dt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var kd={};St(kd,{base32:()=>Vs,base32hex:()=>Z5,base32hexpad:()=>e8,base32hexpadupper:()=>t8,base32hexupper:()=>Q5,base32pad:()=>J5,base32padupper:()=>X5,base32upper:()=>Y5,base32z:()=>r8});var Vs,Y5,J5,X5,Z5,Q5,e8,t8,r8,Cd=gt(()=>{yn();Vs=Dt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Y5=Dt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),J5=Dt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),X5=Dt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Z5=Dt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Q5=Dt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),e8=Dt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),t8=Dt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),r8=Dt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Dd={};St(Dd,{base36:()=>Fo,base36upper:()=>n8});var Fo,n8,Nc=gt(()=>{yn();Fo=Wi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),n8=Wi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Od={};St(Od,{base58btc:()=>jn,base58flickr:()=>i8});var jn,i8,Id=gt(()=>{yn();jn=Wi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),i8=Wi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Pd={};St(Pd,{base64:()=>o8,base64pad:()=>s8,base64url:()=>Vm,base64urlpad:()=>a8});var o8,s8,Vm,a8,Nd=gt(()=>{yn();o8=Dt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),s8=Dt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Vm=Dt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),a8=Dt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Rd={};St(Rd,{base256emoji:()=>d8});function u8(r){return r.reduce((e,t)=>(e+=f8[t],e),"")}function l8(r){let e=[];for(let t of r){let n=c8[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Wm,f8,c8,d8,Gm=gt(()=>{yn();Wm=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),f8=Wm.reduce((r,e,t)=>(r[t]=e,r),[]),c8=Wm.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(u8,"encode");o(l8,"decode");d8=Ks({prefix:"\u{1F680}",name:"base256emoji",encode:u8,decode:l8})});function Xm(r,e,t){e=e||[],t=t||0;for(var n=t;r>=b8;)e[t++]=r&255|Ym,r/=128;for(;r&m8;)e[t++]=r&255|Ym,r>>>=7;return e[t]=r|0,Xm.bytes=t-n+1,e}function Ld(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw Ld.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Jm)<<i:(a&Jm)*Math.pow(2,i),i+=7}while(a>=v8);return Ld.bytes=s-n,t}var h8,Ym,p8,m8,b8,g8,v8,Jm,y8,x8,w8,_8,E8,S8,M8,A8,T8,k8,C8,D8,sf,Zm=gt(()=>{h8=Xm,Ym=128,p8=127,m8=~p8,b8=Math.pow(2,31);o(Xm,"encode");g8=Ld,v8=128,Jm=127;o(Ld,"read");y8=Math.pow(2,7),x8=Math.pow(2,14),w8=Math.pow(2,21),_8=Math.pow(2,28),E8=Math.pow(2,35),S8=Math.pow(2,42),M8=Math.pow(2,49),A8=Math.pow(2,56),T8=Math.pow(2,63),k8=o(function(r){return r<y8?1:r<x8?2:r<w8?3:r<_8?4:r<E8?5:r<S8?6:r<M8?7:r<A8?8:r<T8?9:10},"length"),C8={encode:h8,decode:g8,encodingLength:k8},D8=C8,sf=D8});var Gs={};St(Gs,{decode:()=>Ws,encodeTo:()=>$o,encodingLength:()=>qo});var Ws,$o,qo,Rc=gt(()=>{Zm();Ws=o(r=>[sf.decode(r),sf.decode.bytes],"decode"),$o=o((r,e,t=0)=>(sf.encode(r,e,t),e),"encodeTo"),qo=o(r=>sf.encodingLength(r),"encodingLength")});var Ho={};St(Ho,{Digest:()=>Gi,create:()=>Kn,decode:()=>af,equals:()=>Bd});var Kn,af,Bd,Gi,zo=gt(()=>{Vi();Rc();Kn=o((r,e)=>{let t=e.byteLength,n=qo(r),i=n+qo(t),s=new Uint8Array(i+t);return $o(r,s,0),$o(t,s,n),s.set(e,i),new Gi(r,t,e,s)},"create"),af=o(r=>{let e=en(r),[t,n]=Ws(e),[i,s]=Ws(e.subarray(n)),a=e.subarray(n+s);if(a.byteLength!==i)throw new Error("Incorrect length");return new Gi(t,i,a,e)},"decode"),Bd=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&xd(r.bytes,e.bytes),"equals"),Gi=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Gi,"Digest")});var Bc={};St(Bc,{Hasher:()=>ff,from:()=>Lc});var Lc,ff,Ud=gt(()=>{zo();Lc=o(({name:r,code:e,encode:t})=>new ff(r,e,t),"from"),ff=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Kn(this.code,t):t.then(n=>Kn(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(ff,"Hasher")});var Fd={};St(Fd,{sha256:()=>jo,sha512:()=>O8});var Qm,jo,O8,cf=gt(()=>{Ud();Qm=o(r=>e=>Z(void 0,null,function*(){return new Uint8Array(yield crypto.subtle.digest(r,e))}),"sha"),jo=Lc({name:"sha2-256",code:18,encode:Qm("SHA-256")}),O8=Lc({name:"sha2-512",code:19,encode:Qm("SHA-512")})});var $d={};St($d,{identity:()=>Uc});var e1,I8,t1,P8,Uc,qd=gt(()=>{Vi();zo();e1=0,I8="identity",t1=en,P8=o(r=>Kn(e1,t1(r)),"digest"),Uc={code:e1,name:I8,encode:t1,digest:P8}});var Hd={};St(Hd,{code:()=>R8,decode:()=>B8,encode:()=>L8,name:()=>N8});var N8,R8,L8,B8,r1=gt(()=>{Vi();N8="raw",R8=85,L8=o(r=>en(r),"encode"),B8=o(r=>en(r),"decode")});var zd={};St(zd,{code:()=>q8,decode:()=>z8,encode:()=>H8,name:()=>$8});var U8,F8,$8,q8,H8,z8,n1=gt(()=>{U8=new TextEncoder,F8=new TextDecoder,$8="json",q8=512,H8=o(r=>U8.encode(JSON.stringify(r)),"encode"),z8=o(r=>JSON.parse(F8.decode(r)),"decode")});var Pe,j8,K8,V8,uf,W8,i1,o1,Fc,$c,G8,Y8,J8,Vn=gt(()=>{Rc();zo();Id();Cd();Vi();Pe=class{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:$c,byteLength:$c,code:Fc,version:Fc,multihash:Fc,bytes:Fc,_baseCache:$c,asCID:$c})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==uf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==W8)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Pe.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Kn(e,t);return Pe.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&Bd(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return K8(t,i,e||jn.encoder);default:return V8(t,i,e||Vs.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return Y8(/^0\.0/,J8),!!(e&&(e[o1]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Pe)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Pe(t,n,i,s||i1(t,n,i.bytes))}else if(e!=null&&e[o1]===!0){let{version:t,multihash:n,code:i}=e,s=af(n);return Pe.create(t,i,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==uf)throw new Error(`Version 0 CID must use dag-pb (code: ${uf}) block encoding`);return new Pe(e,t,n,n.bytes)}case 1:{let i=i1(e,t,n.bytes);return new Pe(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Pe.create(0,uf,e)}static createV1(e,t){return Pe.create(1,e,t)}static decode(e){let[t,n]=Pe.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Pe.inspectBytes(e),n=t.size-t.multihashSize,i=en(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),a=new Gi(t.multihashCode,t.digestSize,s,i);return[t.version===0?Pe.createV0(a):Pe.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[x,k]=Ws(e.subarray(t));return t+=k,x},"next"),i=n(),s=uf;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=t,f=n(),u=n(),m=t+u,p=m-a;return{version:i,codec:s,multihashCode:f,digestSize:u,multihashSize:p,size:m}}static parse(e,t){let[n,i]=j8(e,t),s=Pe.decode(i);return s._baseCache.set(n,e),s}};o(Pe,"CID");j8=o((r,e)=>{switch(r[0]){case"Q":{let t=e||jn;return[jn.prefix,t.decode(`${jn.prefix}${r}`)]}case jn.prefix:{let t=e||jn;return[jn.prefix,t.decode(r)]}case Vs.prefix:{let t=e||Vs;return[Vs.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},"parseCIDtoBytes"),K8=o((r,e,t)=>{let{prefix:n}=t;if(n!==jn.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return i},"toStringV0"),V8=o((r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let s=t.encode(r);return e.set(n,s),s}else return i},"toStringV1"),uf=112,W8=18,i1=o((r,e,t)=>{let n=qo(r),i=n+qo(e),s=new Uint8Array(i+t.byteLength);return $o(r,s,0),$o(e,s,n),s.set(t,i),s},"encodeCID"),o1=Symbol.for("@ipld/js-cid/CID"),Fc={writable:!1,configurable:!1,enumerable:!0},$c={writable:!1,enumerable:!1,configurable:!1},G8="0.0.0-dev",Y8=o((r,e)=>{if(r.test(G8))console.warn(e);else throw new Error(e)},"deprecate"),J8=`CID.isCID(v) is deprecated and will be removed in the next major release.
2
2
  Following code pattern:
3
3
 
4
4
  if (CID.isCID(value)) {
@@ -12,11 +12,11 @@ if (cid) {
12
12
  // Make sure to use cid instead of value
13
13
  doSomethingWithCID(cid)
14
14
  }
15
- `});var zd=gt(()=>{Vn();Rc();Vi();Ud();jo()});var s1={};St(s1,{CID:()=>Pe,bases:()=>Ys,bytes:()=>of,codecs:()=>G8,digest:()=>Ho,hasher:()=>Bc,hashes:()=>W8,varint:()=>Gs});var Ys,W8,G8,qc=gt(()=>{qm();Hm();jm();zm();Km();Cd();Nc();Od();Nd();Gm();cf();qd();r1();n1();zd();Ys=ie(ie(ie(ie(ie(ie(ie(ie(ie(ie({},Ed),Sd),Md),Ad),Td),kd),Dd),Id),Pd),Rd),W8=ie(ie({},Fd),$d),G8={raw:Hd,json:jd}});function f1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var a1,Kd,Y8,Hc,Vd=gt(()=>{qc();o(f1,"createCodec");a1=f1("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Kd=f1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Y8=ie({utf8:a1,"utf-8":a1,hex:Ys.base16,latin1:Kd,ascii:Kd,binary:Kd},Ys),Hc=Y8});var c1={};St(c1,{fromString:()=>Rt});function Rt(r,e="utf8"){let t=Hc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var jc=gt(()=>{Vd();o(Rt,"fromString")});var u1={};St(u1,{toString:()=>It});function It(r,e="utf8"){let t=Hc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var lf=gt(()=>{Vd();o(It,"toString")});var l1=me(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});function J8(r,e){var t=r>>>16&65535,n=r&65535,i=e>>>16&65535,s=e&65535;return n*s+(t*s+n*i<<16>>>0)|0}o(J8,"imulShim");Ir.mul=Math.imul||J8;function X8(r,e){return r+e|0}o(X8,"add");Ir.add=X8;function Z8(r,e){return r-e|0}o(Z8,"sub");Ir.sub=Z8;function Q8(r,e){return r<<e|r>>>32-e}o(Q8,"rotl");Ir.rotl=Q8;function e_(r,e){return r<<32-e|r>>>e}o(e_,"rotr");Ir.rotr=e_;function t_(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(t_,"isIntegerShim");Ir.isInteger=Number.isInteger||t_;Ir.MAX_SAFE_INTEGER=9007199254740991;Ir.isSafeInteger=function(r){return Ir.isInteger(r)&&r>=-Ir.MAX_SAFE_INTEGER&&r<=Ir.MAX_SAFE_INTEGER}});var Ko=me(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});var d1=l1();function r_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(r_,"readInt16BE");it.readInt16BE=r_;function n_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(n_,"readUint16BE");it.readUint16BE=n_;function i_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(i_,"readInt16LE");it.readInt16LE=i_;function o_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(o_,"readUint16LE");it.readUint16LE=o_;function h1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}o(h1,"writeUint16BE");it.writeUint16BE=h1;it.writeInt16BE=h1;function p1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}o(p1,"writeUint16LE");it.writeUint16LE=p1;it.writeInt16LE=p1;function Wd(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Wd,"readInt32BE");it.readInt32BE=Wd;function Gd(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Gd,"readUint32BE");it.readUint32BE=Gd;function Yd(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Yd,"readInt32LE");it.readInt32LE=Yd;function Jd(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(Jd,"readUint32LE");it.readUint32LE=Jd;function Kc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}o(Kc,"writeUint32BE");it.writeUint32BE=Kc;it.writeInt32BE=Kc;function Vc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}o(Vc,"writeUint32LE");it.writeUint32LE=Vc;it.writeInt32LE=Vc;function s_(r,e){e===void 0&&(e=0);var t=Wd(r,e),n=Wd(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(s_,"readInt64BE");it.readInt64BE=s_;function a_(r,e){e===void 0&&(e=0);var t=Gd(r,e),n=Gd(r,e+4);return t*4294967296+n}o(a_,"readUint64BE");it.readUint64BE=a_;function f_(r,e){e===void 0&&(e=0);var t=Yd(r,e),n=Yd(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(f_,"readInt64LE");it.readInt64LE=f_;function c_(r,e){e===void 0&&(e=0);var t=Jd(r,e),n=Jd(r,e+4);return n*4294967296+t}o(c_,"readUint64LE");it.readUint64LE=c_;function m1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Kc(r/4294967296>>>0,e,t),Kc(r>>>0,e,t+4),e}o(m1,"writeUint64BE");it.writeUint64BE=m1;it.writeInt64BE=m1;function b1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Vc(r>>>0,e,t),Vc(r/4294967296>>>0,e,t+4),e}o(b1,"writeUint64LE");it.writeUint64LE=b1;it.writeInt64LE=b1;function u_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=r/8+t-1;s>=t;s--)n+=e[s]*i,i*=256;return n}o(u_,"readUintBE");it.readUintBE=u_;function l_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=t;s<t+r/8;s++)n+=e[s]*i,i*=256;return n}o(l_,"readUintLE");it.readUintLE=l_;function d_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!d1.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=r/8+n-1;s>=n;s--)t[s]=e/i&255,i*=256;return t}o(d_,"writeUintBE");it.writeUintBE=d_;function h_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!d1.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+r/8;s++)t[s]=e/i&255,i*=256;return t}o(h_,"writeUintLE");it.writeUintLE=h_;function p_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(p_,"readFloat32BE");it.readFloat32BE=p_;function m_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(m_,"readFloat32LE");it.readFloat32LE=m_;function b_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(b_,"readFloat64BE");it.readFloat64BE=b_;function g_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(g_,"readFloat64LE");it.readFloat64LE=g_;function v_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}o(v_,"writeFloat32BE");it.writeFloat32BE=v_;function y_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}o(y_,"writeFloat32LE");it.writeFloat32LE=y_;function x_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}o(x_,"writeFloat64BE");it.writeFloat64BE=x_;function w_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}o(w_,"writeFloat64LE");it.writeFloat64LE=w_});var tn=me(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});function __(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(__,"wipe");Xd.wipe=__});var v1=me(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Gc=Ko(),Wc=tn();Yi.DIGEST_LENGTH=32;Yi.BLOCK_SIZE=64;var g1=function(){function r(){this.digestLength=Yi.DIGEST_LENGTH,this.blockSize=Yi.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA256"),r.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){Wc.wipe(this._buffer),Wc.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Zd(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Zd(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%64<56?64:128;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;Gc.writeUint32BE(i,this._buffer,a-8),Gc.writeUint32BE(s,this._buffer,a-4),Zd(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/4;f++)Gc.writeUint32BE(this._state[f],e,f*4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){Wc.wipe(e.state),e.buffer&&Wc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Yi.SHA256=g1;var E_=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Zd(r,e,t,n,i){for(;i>=64;){for(var s=e[0],a=e[1],f=e[2],u=e[3],m=e[4],p=e[5],x=e[6],k=e[7],O=0;O<16;O++){var T=n+O*4;r[O]=Gc.readUint32BE(t,T)}for(var O=16;O<64;O++){var C=r[O-2],$=(C>>>17|C<<32-17)^(C>>>19|C<<32-19)^C>>>10;C=r[O-15];var I=(C>>>7|C<<32-7)^(C>>>18|C<<32-18)^C>>>3;r[O]=($+r[O-7]|0)+(I+r[O-16]|0)}for(var O=0;O<64;O++){var $=(((m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&p^~m&x)|0)+(k+(E_[O]+r[O]|0)|0)|0,I=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&a^s&f^a&f)|0;k=x,x=p,p=m,m=u+$|0,u=f,f=a,a=s,s=$+I|0}e[0]+=s,e[1]+=a,e[2]+=f,e[3]+=u,e[4]+=m,e[5]+=p,e[6]+=x,e[7]+=k,n+=64,i-=64}return n}o(Zd,"hashBlocks");function S_(r){var e=new g1;e.update(r);var t=e.digest();return e.clean(),t}o(S_,"hash");Yi.hash=S_});var Qd=me((eN,Yc)=>{(function(){"use strict";var r="input is invalid type",e="finalize already called",t=typeof window=="object",n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var i=!t&&typeof self=="object",s=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?n=global:i&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&typeof Yc=="object"&&Yc.exports,f=typeof define=="function"&&define.amd,u=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",m="0123456789abcdef".split(""),p=[31,7936,2031616,520093696],x=[4,1024,262144,67108864],k=[1,256,65536,16777216],O=[6,1536,393216,100663296],T=[0,8,16,24],C=[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],$=[224,256,384,512],I=[128,256],U=["hex","buffer","arrayBuffer","array","digest"],z={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(A){return Object.prototype.toString.call(A)==="[object Array]"}),u&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(A){return typeof A=="object"&&A.buffer&&A.buffer.constructor===ArrayBuffer});for(var H=o(function(A,K,J){return function(N){return new v(A,K,A).update(N)[J]()}},"createOutputMethod"),X=o(function(A,K,J){return function(N,R){return new v(A,K,R).update(N)[J]()}},"createShakeOutputMethod"),B=o(function(A,K,J){return function(N,R,V,W){return c["cshake"+A].update(N,R,V,W)[J]()}},"createCshakeOutputMethod"),L=o(function(A,K,J){return function(N,R,V,W){return c["kmac"+A].update(N,R,V,W)[J]()}},"createKmacOutputMethod"),F=o(function(A,K,J,N){for(var R=0;R<U.length;++R){var V=U[R];A[V]=K(J,N,V)}return A},"createOutputMethods"),re=o(function(A,K){var J=H(A,K,"hex");return J.create=function(){return new v(A,K,A)},J.update=function(N){return J.create().update(N)},F(J,H,A,K)},"createMethod"),E=o(function(A,K){var J=X(A,K,"hex");return J.create=function(N){return new v(A,K,N)},J.update=function(N,R){return J.create(R).update(N)},F(J,X,A,K)},"createShakeMethod"),l=o(function(A,K){var J=z[A],N=B(A,K,"hex");return N.create=function(R,V,W){return!V&&!W?c["shake"+A].create(R):new v(A,K,R).bytepad([V,W],J)},N.update=function(R,V,W,ee){return N.create(V,W,ee).update(R)},F(N,B,A,K)},"createCshakeMethod"),g=o(function(A,K){var J=z[A],N=L(A,K,"hex");return N.create=function(R,V,W){return new M(A,K,V).bytepad(["KMAC",W],J).bytepad([R],J)},N.update=function(R,V,W,ee){return N.create(R,W,ee).update(V)},F(N,L,A,K)},"createKmacMethod"),h=[{name:"keccak",padding:k,bits:$,createMethod:re},{name:"sha3",padding:O,bits:$,createMethod:re},{name:"shake",padding:p,bits:I,createMethod:E},{name:"cshake",padding:x,bits:I,createMethod:l},{name:"kmac",padding:x,bits:I,createMethod:g}],c={},d=[],y=0;y<h.length;++y)for(var _=h[y],w=_.bits,b=0;b<w.length;++b){var S=_.name+"_"+w[b];if(d.push(S),c[S]=_.createMethod(w[b],_.padding),_.name!=="sha3"){var D=_.name+w[b];d.push(D),c[D]=c[S]}}function v(A,K,J){this.blocks=[],this.s=[],this.padding=K,this.outputBits=J,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(A<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var N=0;N<50;++N)this.s[N]=0}o(v,"Keccak"),v.prototype.update=function(A){if(this.finalized)throw new Error(e);var K,J=typeof A;if(J!=="string"){if(J==="object"){if(A===null)throw new Error(r);if(u&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!u||!ArrayBuffer.isView(A)))throw new Error(r)}else throw new Error(r);K=!0}for(var N=this.blocks,R=this.byteCount,V=A.length,W=this.blockCount,ee=0,he=this.s,fe,Y;ee<V;){if(this.reset)for(this.reset=!1,N[0]=this.block,fe=1;fe<W+1;++fe)N[fe]=0;if(K)for(fe=this.start;ee<V&&fe<R;++ee)N[fe>>2]|=A[ee]<<T[fe++&3];else for(fe=this.start;ee<V&&fe<R;++ee)Y=A.charCodeAt(ee),Y<128?N[fe>>2]|=Y<<T[fe++&3]:Y<2048?(N[fe>>2]|=(192|Y>>6)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):Y<55296||Y>=57344?(N[fe>>2]|=(224|Y>>12)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):(Y=65536+((Y&1023)<<10|A.charCodeAt(++ee)&1023),N[fe>>2]|=(240|Y>>18)<<T[fe++&3],N[fe>>2]|=(128|Y>>12&63)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]);if(this.lastByteIndex=fe,fe>=R){for(this.start=fe-R,this.block=N[W],fe=0;fe<W;++fe)he[fe]^=N[fe];ne(he),this.reset=!0}else this.start=fe}return this},v.prototype.encode=function(A,K){var J=A&255,N=1,R=[J];for(A=A>>8,J=A&255;J>0;)R.unshift(J),A=A>>8,J=A&255,++N;return K?R.push(N):R.unshift(N),this.update(R),R.length},v.prototype.encodeString=function(A){var K,J=typeof A;if(J!=="string"){if(J==="object"){if(A===null)throw new Error(r);if(u&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!u||!ArrayBuffer.isView(A)))throw new Error(r)}else throw new Error(r);K=!0}var N=0,R=A.length;if(K)N=R;else for(var V=0;V<A.length;++V){var W=A.charCodeAt(V);W<128?N+=1:W<2048?N+=2:W<55296||W>=57344?N+=3:(W=65536+((W&1023)<<10|A.charCodeAt(++V)&1023),N+=4)}return N+=this.encode(N*8),this.update(A),N},v.prototype.bytepad=function(A,K){for(var J=this.encode(K),N=0;N<A.length;++N)J+=this.encodeString(A[N]);var R=K-J%K,V=[];return V.length=R,this.update(V),this},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var A=this.blocks,K=this.lastByteIndex,J=this.blockCount,N=this.s;if(A[K>>2]|=this.padding[K&3],this.lastByteIndex===this.byteCount)for(A[0]=A[J],K=1;K<J+1;++K)A[K]=0;for(A[J-1]|=2147483648,K=0;K<J;++K)N[K]^=A[K];ne(N)}},v.prototype.toString=v.prototype.hex=function(){this.finalize();for(var A=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W="",ee;V<J;){for(R=0;R<A&&V<J;++R,++V)ee=K[R],W+=m[ee>>4&15]+m[ee&15]+m[ee>>12&15]+m[ee>>8&15]+m[ee>>20&15]+m[ee>>16&15]+m[ee>>28&15]+m[ee>>24&15];V%A===0&&(ne(K),R=0)}return N&&(ee=K[R],W+=m[ee>>4&15]+m[ee&15],N>1&&(W+=m[ee>>12&15]+m[ee>>8&15]),N>2&&(W+=m[ee>>20&15]+m[ee>>16&15])),W},v.prototype.arrayBuffer=function(){this.finalize();var A=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=this.outputBits>>3,ee;N?ee=new ArrayBuffer(J+1<<2):ee=new ArrayBuffer(W);for(var he=new Uint32Array(ee);V<J;){for(R=0;R<A&&V<J;++R,++V)he[V]=K[R];V%A===0&&ne(K)}return N&&(he[R]=K[R],ee=ee.slice(0,W)),ee},v.prototype.buffer=v.prototype.arrayBuffer,v.prototype.digest=v.prototype.array=function(){this.finalize();for(var A=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=[],ee,he;V<J;){for(R=0;R<A&&V<J;++R,++V)ee=V<<2,he=K[R],W[ee]=he&255,W[ee+1]=he>>8&255,W[ee+2]=he>>16&255,W[ee+3]=he>>24&255;V%A===0&&ne(K)}return N&&(ee=V<<2,he=K[R],W[ee]=he&255,N>1&&(W[ee+1]=he>>8&255),N>2&&(W[ee+2]=he>>16&255)),W};function M(A,K,J){v.call(this,A,K,J)}o(M,"Kmac"),M.prototype=new v,M.prototype.finalize=function(){return this.encode(this.outputBits,!0),v.prototype.finalize.call(this)};var ne=o(function(A){var K,J,N,R,V,W,ee,he,fe,Y,pe,Q,ce,q,se,be,Te,we,Oe,gr,te,G,P,j,ae,ue,le,ge,ft,Ee,ve,lt,De,Ne,Bn,Le,Be,Un,Ue,Fe,Fn,$e,qe,$n,He,je,qn,ze,Ke,Hn,Ve,We,jn,Ge,Ye,gn,mt,bt,Yr,Jr,Xr,Zr,Qr;for(N=0;N<48;N+=2)R=A[0]^A[10]^A[20]^A[30]^A[40],V=A[1]^A[11]^A[21]^A[31]^A[41],W=A[2]^A[12]^A[22]^A[32]^A[42],ee=A[3]^A[13]^A[23]^A[33]^A[43],he=A[4]^A[14]^A[24]^A[34]^A[44],fe=A[5]^A[15]^A[25]^A[35]^A[45],Y=A[6]^A[16]^A[26]^A[36]^A[46],pe=A[7]^A[17]^A[27]^A[37]^A[47],Q=A[8]^A[18]^A[28]^A[38]^A[48],ce=A[9]^A[19]^A[29]^A[39]^A[49],K=Q^(W<<1|ee>>>31),J=ce^(ee<<1|W>>>31),A[0]^=K,A[1]^=J,A[10]^=K,A[11]^=J,A[20]^=K,A[21]^=J,A[30]^=K,A[31]^=J,A[40]^=K,A[41]^=J,K=R^(he<<1|fe>>>31),J=V^(fe<<1|he>>>31),A[2]^=K,A[3]^=J,A[12]^=K,A[13]^=J,A[22]^=K,A[23]^=J,A[32]^=K,A[33]^=J,A[42]^=K,A[43]^=J,K=W^(Y<<1|pe>>>31),J=ee^(pe<<1|Y>>>31),A[4]^=K,A[5]^=J,A[14]^=K,A[15]^=J,A[24]^=K,A[25]^=J,A[34]^=K,A[35]^=J,A[44]^=K,A[45]^=J,K=he^(Q<<1|ce>>>31),J=fe^(ce<<1|Q>>>31),A[6]^=K,A[7]^=J,A[16]^=K,A[17]^=J,A[26]^=K,A[27]^=J,A[36]^=K,A[37]^=J,A[46]^=K,A[47]^=J,K=Y^(R<<1|V>>>31),J=pe^(V<<1|R>>>31),A[8]^=K,A[9]^=J,A[18]^=K,A[19]^=J,A[28]^=K,A[29]^=J,A[38]^=K,A[39]^=J,A[48]^=K,A[49]^=J,q=A[0],se=A[1],je=A[11]<<4|A[10]>>>28,qn=A[10]<<4|A[11]>>>28,ge=A[20]<<3|A[21]>>>29,ft=A[21]<<3|A[20]>>>29,Jr=A[31]<<9|A[30]>>>23,Xr=A[30]<<9|A[31]>>>23,$e=A[40]<<18|A[41]>>>14,qe=A[41]<<18|A[40]>>>14,Ne=A[2]<<1|A[3]>>>31,Bn=A[3]<<1|A[2]>>>31,be=A[13]<<12|A[12]>>>20,Te=A[12]<<12|A[13]>>>20,ze=A[22]<<10|A[23]>>>22,Ke=A[23]<<10|A[22]>>>22,Ee=A[33]<<13|A[32]>>>19,ve=A[32]<<13|A[33]>>>19,Zr=A[42]<<2|A[43]>>>30,Qr=A[43]<<2|A[42]>>>30,Ge=A[5]<<30|A[4]>>>2,Ye=A[4]<<30|A[5]>>>2,Le=A[14]<<6|A[15]>>>26,Be=A[15]<<6|A[14]>>>26,we=A[25]<<11|A[24]>>>21,Oe=A[24]<<11|A[25]>>>21,Hn=A[34]<<15|A[35]>>>17,Ve=A[35]<<15|A[34]>>>17,lt=A[45]<<29|A[44]>>>3,De=A[44]<<29|A[45]>>>3,j=A[6]<<28|A[7]>>>4,ae=A[7]<<28|A[6]>>>4,gn=A[17]<<23|A[16]>>>9,mt=A[16]<<23|A[17]>>>9,Un=A[26]<<25|A[27]>>>7,Ue=A[27]<<25|A[26]>>>7,gr=A[36]<<21|A[37]>>>11,te=A[37]<<21|A[36]>>>11,We=A[47]<<24|A[46]>>>8,jn=A[46]<<24|A[47]>>>8,$n=A[8]<<27|A[9]>>>5,He=A[9]<<27|A[8]>>>5,ue=A[18]<<20|A[19]>>>12,le=A[19]<<20|A[18]>>>12,bt=A[29]<<7|A[28]>>>25,Yr=A[28]<<7|A[29]>>>25,Fe=A[38]<<8|A[39]>>>24,Fn=A[39]<<8|A[38]>>>24,G=A[48]<<14|A[49]>>>18,P=A[49]<<14|A[48]>>>18,A[0]=q^~be&we,A[1]=se^~Te&Oe,A[10]=j^~ue&ge,A[11]=ae^~le&ft,A[20]=Ne^~Le&Un,A[21]=Bn^~Be&Ue,A[30]=$n^~je&ze,A[31]=He^~qn&Ke,A[40]=Ge^~gn&bt,A[41]=Ye^~mt&Yr,A[2]=be^~we&gr,A[3]=Te^~Oe&te,A[12]=ue^~ge&Ee,A[13]=le^~ft&ve,A[22]=Le^~Un&Fe,A[23]=Be^~Ue&Fn,A[32]=je^~ze&Hn,A[33]=qn^~Ke&Ve,A[42]=gn^~bt&Jr,A[43]=mt^~Yr&Xr,A[4]=we^~gr&G,A[5]=Oe^~te&P,A[14]=ge^~Ee&lt,A[15]=ft^~ve&De,A[24]=Un^~Fe&$e,A[25]=Ue^~Fn&qe,A[34]=ze^~Hn&We,A[35]=Ke^~Ve&jn,A[44]=bt^~Jr&Zr,A[45]=Yr^~Xr&Qr,A[6]=gr^~G&q,A[7]=te^~P&se,A[16]=Ee^~lt&j,A[17]=ve^~De&ae,A[26]=Fe^~$e&Ne,A[27]=Fn^~qe&Bn,A[36]=Hn^~We&$n,A[37]=Ve^~jn&He,A[46]=Jr^~Zr&Ge,A[47]=Xr^~Qr&Ye,A[8]=G^~q&be,A[9]=P^~se&Te,A[18]=lt^~j&ue,A[19]=De^~ae&le,A[28]=$e^~Ne&Le,A[29]=qe^~Bn&Be,A[38]=We^~$n&je,A[39]=jn^~He&qn,A[48]=Zr^~Ge&gn,A[49]=Qr^~Ye&mt,A[0]^=C[N],A[1]^=C[N+1]},"f");if(a)Yc.exports=c;else{for(y=0;y<d.length;++y)n[d[y]]=c[d[y]];f&&define(function(){return c})}})()});var y1=me((tN,M_)=>{M_.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var eh=me(()=>{});var Wn=me((x1,th)=>{(function(r,e){"use strict";function t(E,l){if(!E)throw new Error(l||"Assertion failed")}o(t,"assert");function n(E,l){E.super_=l;var g=o(function(){},"TempCtor");g.prototype=l.prototype,E.prototype=new g,E.prototype.constructor=E}o(n,"inherits");function i(E,l,g){if(i.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((l==="le"||l==="be")&&(g=l,l=10),this._init(E||0,l||10,g||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=eh().Buffer}catch(E){}i.isBN=o(function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},"isBN"),i.max=o(function(l,g){return l.cmp(g)>0?l:g},"max"),i.min=o(function(l,g){return l.cmp(g)<0?l:g},"min"),i.prototype._init=o(function(l,g,h){if(typeof l=="number")return this._initNumber(l,g,h);if(typeof l=="object")return this._initArray(l,g,h);g==="hex"&&(g=16),t(g===(g|0)&&g>=2&&g<=36),l=l.toString().replace(/\s+/g,"");var c=0;l[0]==="-"&&(c++,this.negative=1),c<l.length&&(g===16?this._parseHex(l,c,h):(this._parseBase(l,g,c),h==="le"&&this._initArray(this.toArray(),g,h)))},"init"),i.prototype._initNumber=o(function(l,g,h){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),g,h)},"_initNumber"),i.prototype._initArray=o(function(l,g,h){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d,y,_=0;if(h==="be")for(c=l.length-1,d=0;c>=0;c-=3)y=l[c]|l[c-1]<<8|l[c-2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);else if(h==="le")for(c=0,d=0;c<l.length;c+=3)y=l[c]|l[c+1]<<8|l[c+2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);return this.strip()},"_initArray");function a(E,l){var g=E.charCodeAt(l);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}o(a,"parseHex4Bits");function f(E,l,g){var h=a(E,g);return g-1>=l&&(h|=a(E,g-1)<<4),h}o(f,"parseHexByte"),i.prototype._parseHex=o(function(l,g,h){this.length=Math.ceil((l.length-g)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d=0,y=0,_;if(h==="be")for(c=l.length-1;c>=g;c-=2)_=f(l,g,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8;else{var w=l.length-g;for(c=w%2===0?g+1:g;c<l.length;c+=2)_=f(l,g,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8}this.strip()},"_parseHex");function u(E,l,g,h){for(var c=0,d=Math.min(E.length,g),y=l;y<d;y++){var _=E.charCodeAt(y)-48;c*=h,_>=49?c+=_-49+10:_>=17?c+=_-17+10:c+=_}return c}o(u,"parseBase"),i.prototype._parseBase=o(function(l,g,h){this.words=[0],this.length=1;for(var c=0,d=1;d<=67108863;d*=g)c++;c--,d=d/g|0;for(var y=l.length-h,_=y%c,w=Math.min(y,y-_)+h,b=0,S=h;S<w;S+=c)b=u(l,S,S+c,g),this.imuln(d),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(_!==0){var D=1;for(b=u(l,S,l.length,g),S=0;S<_;S++)D*=g;this.imuln(D),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this.strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var g=0;g<this.length;g++)l.words[g]=this.words[g];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy"),i.prototype.clone=o(function(){var l=new i(null);return this.copy(l),l},"clone"),i.prototype._expand=o(function(l){for(;this.length<l;)this.words[this.length++]=0;return this},"_expand"),i.prototype.strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),i.prototype.inspect=o(function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"},"inspect");var m=["","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"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=o(function(l,g){l=l||10,g=g|0||1;var h;if(l===16||l==="hex"){h="";for(var c=0,d=0,y=0;y<this.length;y++){var _=this.words[y],w=((_<<c|d)&16777215).toString(16);d=_>>>24-c&16777215,d!==0||y!==this.length-1?h=m[6-w.length]+w+h:h=w+h,c+=2,c>=26&&(c-=26,y--)}for(d!==0&&(h=d.toString(16)+h);h.length%g!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(l===(l|0)&&l>=2&&l<=36){var b=p[l],S=x[l];h="";var D=this.clone();for(D.negative=0;!D.isZero();){var v=D.modn(S).toString(l);D=D.idivn(S),D.isZero()?h=v+h:h=m[b-v.length]+v+h}for(this.isZero()&&(h="0"+h);h.length%g!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(l,g){return t(typeof s!="undefined"),this.toArrayLike(s,l,g)},"toBuffer"),i.prototype.toArray=o(function(l,g){return this.toArrayLike(Array,l,g)},"toArray"),i.prototype.toArrayLike=o(function(l,g,h){var c=this.byteLength(),d=h||Math.max(1,c);t(c<=d,"byte array longer than desired length"),t(d>0,"Requested array length <= 0"),this.strip();var y=g==="le",_=new l(d),w,b,S=this.clone();if(y){for(b=0;!S.isZero();b++)w=S.andln(255),S.iushrn(8),_[b]=w;for(;b<d;b++)_[b]=0}else{for(b=0;b<d-c;b++)_[b]=0;for(b=0;!S.isZero();b++)w=S.andln(255),S.iushrn(8),_[d-b-1]=w}return _},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var g=l,h=0;return g>=4096&&(h+=13,g>>>=13),g>=64&&(h+=7,g>>>=7),g>=8&&(h+=4,g>>>=4),g>=2&&(h+=2,g>>>=2),h+g},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var g=l,h=0;return(g&8191)===0&&(h+=13,g>>>=13),(g&127)===0&&(h+=7,g>>>=7),(g&15)===0&&(h+=4,g>>>=4),(g&3)===0&&(h+=2,g>>>=2),(g&1)===0&&h++,h},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],g=this._countBits(l);return(this.length-1)*26+g},"bitLength");function k(E){for(var l=new Array(E.bitLength()),g=0;g<l.length;g++){var h=g/26|0,c=g%26;l[g]=(E.words[h]&1<<c)>>>c}return l}o(k,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,g=0;g<this.length;g++){var h=this._zeroBits(this.words[g]);if(l+=h,h!==26)break}return l},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var g=0;g<l.length;g++)this.words[g]=this.words[g]|l.words[g];return this.strip()},"iuor"),i.prototype.ior=o(function(l){return t((this.negative|l.negative)===0),this.iuor(l)},"ior"),i.prototype.or=o(function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},"or"),i.prototype.uor=o(function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(l){var g;this.length>l.length?g=l:g=this;for(var h=0;h<g.length;h++)this.words[h]=this.words[h]&l.words[h];return this.length=g.length,this.strip()},"iuand"),i.prototype.iand=o(function(l){return t((this.negative|l.negative)===0),this.iuand(l)},"iand"),i.prototype.and=o(function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},"and"),i.prototype.uand=o(function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(l){var g,h;this.length>l.length?(g=this,h=l):(g=l,h=this);for(var c=0;c<h.length;c++)this.words[c]=g.words[c]^h.words[c];if(this!==g)for(;c<g.length;c++)this.words[c]=g.words[c];return this.length=g.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},"ixor"),i.prototype.xor=o(function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(l){t(typeof l=="number"&&l>=0);var g=Math.ceil(l/26)|0,h=l%26;this._expand(g),h>0&&g--;for(var c=0;c<g;c++)this.words[c]=~this.words[c]&67108863;return h>0&&(this.words[c]=~this.words[c]&67108863>>26-h),this.strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,g){t(typeof l=="number"&&l>=0);var h=l/26|0,c=l%26;return this._expand(h+1),g?this.words[h]=this.words[h]|1<<c:this.words[h]=this.words[h]&~(1<<c),this.strip()},"setn"),i.prototype.iadd=o(function(l){var g;if(this.negative!==0&&l.negative===0)return this.negative=0,g=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,g=this.isub(l),l.negative=1,g._normSign();var h,c;this.length>l.length?(h=this,c=l):(h=l,c=this);for(var d=0,y=0;y<c.length;y++)g=(h.words[y]|0)+(c.words[y]|0)+d,this.words[y]=g&67108863,d=g>>>26;for(;d!==0&&y<h.length;y++)g=(h.words[y]|0)+d,this.words[y]=g&67108863,d=g>>>26;if(this.length=h.length,d!==0)this.words[this.length]=d,this.length++;else if(h!==this)for(;y<h.length;y++)this.words[y]=h.words[y];return this},"iadd"),i.prototype.add=o(function(l){var g;return l.negative!==0&&this.negative===0?(l.negative=0,g=this.sub(l),l.negative^=1,g):l.negative===0&&this.negative!==0?(this.negative=0,g=l.sub(this),this.negative=1,g):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},"add"),i.prototype.isub=o(function(l){if(l.negative!==0){l.negative=0;var g=this.iadd(l);return l.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var h=this.cmp(l);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;h>0?(c=this,d=l):(c=l,d=this);for(var y=0,_=0;_<d.length;_++)g=(c.words[_]|0)-(d.words[_]|0)+y,y=g>>26,this.words[_]=g&67108863;for(;y!==0&&_<c.length;_++)g=(c.words[_]|0)+y,y=g>>26,this.words[_]=g&67108863;if(y===0&&_<c.length&&c!==this)for(;_<c.length;_++)this.words[_]=c.words[_];return this.length=Math.max(this.length,_),c!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function O(E,l,g){g.negative=l.negative^E.negative;var h=E.length+l.length|0;g.length=h,h=h-1|0;var c=E.words[0]|0,d=l.words[0]|0,y=c*d,_=y&67108863,w=y/67108864|0;g.words[0]=_;for(var b=1;b<h;b++){for(var S=w>>>26,D=w&67108863,v=Math.min(b,l.length-1),M=Math.max(0,b-E.length+1);M<=v;M++){var ne=b-M|0;c=E.words[ne]|0,d=l.words[M]|0,y=c*d+D,S+=y/67108864|0,D=y&67108863}g.words[b]=D|0,w=S|0}return w!==0?g.words[b]=w|0:g.length--,g.strip()}o(O,"smallMulTo");var T=o(function(l,g,h){var c=l.words,d=g.words,y=h.words,_=0,w,b,S,D=c[0]|0,v=D&8191,M=D>>>13,ne=c[1]|0,A=ne&8191,K=ne>>>13,J=c[2]|0,N=J&8191,R=J>>>13,V=c[3]|0,W=V&8191,ee=V>>>13,he=c[4]|0,fe=he&8191,Y=he>>>13,pe=c[5]|0,Q=pe&8191,ce=pe>>>13,q=c[6]|0,se=q&8191,be=q>>>13,Te=c[7]|0,we=Te&8191,Oe=Te>>>13,gr=c[8]|0,te=gr&8191,G=gr>>>13,P=c[9]|0,j=P&8191,ae=P>>>13,ue=d[0]|0,le=ue&8191,ge=ue>>>13,ft=d[1]|0,Ee=ft&8191,ve=ft>>>13,lt=d[2]|0,De=lt&8191,Ne=lt>>>13,Bn=d[3]|0,Le=Bn&8191,Be=Bn>>>13,Un=d[4]|0,Ue=Un&8191,Fe=Un>>>13,Fn=d[5]|0,$e=Fn&8191,qe=Fn>>>13,$n=d[6]|0,He=$n&8191,je=$n>>>13,qn=d[7]|0,ze=qn&8191,Ke=qn>>>13,Hn=d[8]|0,Ve=Hn&8191,We=Hn>>>13,jn=d[9]|0,Ge=jn&8191,Ye=jn>>>13;h.negative=l.negative^g.negative,h.length=19,w=Math.imul(v,le),b=Math.imul(v,ge),b=b+Math.imul(M,le)|0,S=Math.imul(M,ge);var gn=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(gn>>>26)|0,gn&=67108863,w=Math.imul(A,le),b=Math.imul(A,ge),b=b+Math.imul(K,le)|0,S=Math.imul(K,ge),w=w+Math.imul(v,Ee)|0,b=b+Math.imul(v,ve)|0,b=b+Math.imul(M,Ee)|0,S=S+Math.imul(M,ve)|0;var mt=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(mt>>>26)|0,mt&=67108863,w=Math.imul(N,le),b=Math.imul(N,ge),b=b+Math.imul(R,le)|0,S=Math.imul(R,ge),w=w+Math.imul(A,Ee)|0,b=b+Math.imul(A,ve)|0,b=b+Math.imul(K,Ee)|0,S=S+Math.imul(K,ve)|0,w=w+Math.imul(v,De)|0,b=b+Math.imul(v,Ne)|0,b=b+Math.imul(M,De)|0,S=S+Math.imul(M,Ne)|0;var bt=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,w=Math.imul(W,le),b=Math.imul(W,ge),b=b+Math.imul(ee,le)|0,S=Math.imul(ee,ge),w=w+Math.imul(N,Ee)|0,b=b+Math.imul(N,ve)|0,b=b+Math.imul(R,Ee)|0,S=S+Math.imul(R,ve)|0,w=w+Math.imul(A,De)|0,b=b+Math.imul(A,Ne)|0,b=b+Math.imul(K,De)|0,S=S+Math.imul(K,Ne)|0,w=w+Math.imul(v,Le)|0,b=b+Math.imul(v,Be)|0,b=b+Math.imul(M,Le)|0,S=S+Math.imul(M,Be)|0;var Yr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,w=Math.imul(fe,le),b=Math.imul(fe,ge),b=b+Math.imul(Y,le)|0,S=Math.imul(Y,ge),w=w+Math.imul(W,Ee)|0,b=b+Math.imul(W,ve)|0,b=b+Math.imul(ee,Ee)|0,S=S+Math.imul(ee,ve)|0,w=w+Math.imul(N,De)|0,b=b+Math.imul(N,Ne)|0,b=b+Math.imul(R,De)|0,S=S+Math.imul(R,Ne)|0,w=w+Math.imul(A,Le)|0,b=b+Math.imul(A,Be)|0,b=b+Math.imul(K,Le)|0,S=S+Math.imul(K,Be)|0,w=w+Math.imul(v,Ue)|0,b=b+Math.imul(v,Fe)|0,b=b+Math.imul(M,Ue)|0,S=S+Math.imul(M,Fe)|0;var Jr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,w=Math.imul(Q,le),b=Math.imul(Q,ge),b=b+Math.imul(ce,le)|0,S=Math.imul(ce,ge),w=w+Math.imul(fe,Ee)|0,b=b+Math.imul(fe,ve)|0,b=b+Math.imul(Y,Ee)|0,S=S+Math.imul(Y,ve)|0,w=w+Math.imul(W,De)|0,b=b+Math.imul(W,Ne)|0,b=b+Math.imul(ee,De)|0,S=S+Math.imul(ee,Ne)|0,w=w+Math.imul(N,Le)|0,b=b+Math.imul(N,Be)|0,b=b+Math.imul(R,Le)|0,S=S+Math.imul(R,Be)|0,w=w+Math.imul(A,Ue)|0,b=b+Math.imul(A,Fe)|0,b=b+Math.imul(K,Ue)|0,S=S+Math.imul(K,Fe)|0,w=w+Math.imul(v,$e)|0,b=b+Math.imul(v,qe)|0,b=b+Math.imul(M,$e)|0,S=S+Math.imul(M,qe)|0;var Xr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,w=Math.imul(se,le),b=Math.imul(se,ge),b=b+Math.imul(be,le)|0,S=Math.imul(be,ge),w=w+Math.imul(Q,Ee)|0,b=b+Math.imul(Q,ve)|0,b=b+Math.imul(ce,Ee)|0,S=S+Math.imul(ce,ve)|0,w=w+Math.imul(fe,De)|0,b=b+Math.imul(fe,Ne)|0,b=b+Math.imul(Y,De)|0,S=S+Math.imul(Y,Ne)|0,w=w+Math.imul(W,Le)|0,b=b+Math.imul(W,Be)|0,b=b+Math.imul(ee,Le)|0,S=S+Math.imul(ee,Be)|0,w=w+Math.imul(N,Ue)|0,b=b+Math.imul(N,Fe)|0,b=b+Math.imul(R,Ue)|0,S=S+Math.imul(R,Fe)|0,w=w+Math.imul(A,$e)|0,b=b+Math.imul(A,qe)|0,b=b+Math.imul(K,$e)|0,S=S+Math.imul(K,qe)|0,w=w+Math.imul(v,He)|0,b=b+Math.imul(v,je)|0,b=b+Math.imul(M,He)|0,S=S+Math.imul(M,je)|0;var Zr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,w=Math.imul(we,le),b=Math.imul(we,ge),b=b+Math.imul(Oe,le)|0,S=Math.imul(Oe,ge),w=w+Math.imul(se,Ee)|0,b=b+Math.imul(se,ve)|0,b=b+Math.imul(be,Ee)|0,S=S+Math.imul(be,ve)|0,w=w+Math.imul(Q,De)|0,b=b+Math.imul(Q,Ne)|0,b=b+Math.imul(ce,De)|0,S=S+Math.imul(ce,Ne)|0,w=w+Math.imul(fe,Le)|0,b=b+Math.imul(fe,Be)|0,b=b+Math.imul(Y,Le)|0,S=S+Math.imul(Y,Be)|0,w=w+Math.imul(W,Ue)|0,b=b+Math.imul(W,Fe)|0,b=b+Math.imul(ee,Ue)|0,S=S+Math.imul(ee,Fe)|0,w=w+Math.imul(N,$e)|0,b=b+Math.imul(N,qe)|0,b=b+Math.imul(R,$e)|0,S=S+Math.imul(R,qe)|0,w=w+Math.imul(A,He)|0,b=b+Math.imul(A,je)|0,b=b+Math.imul(K,He)|0,S=S+Math.imul(K,je)|0,w=w+Math.imul(v,ze)|0,b=b+Math.imul(v,Ke)|0,b=b+Math.imul(M,ze)|0,S=S+Math.imul(M,Ke)|0;var Qr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,w=Math.imul(te,le),b=Math.imul(te,ge),b=b+Math.imul(G,le)|0,S=Math.imul(G,ge),w=w+Math.imul(we,Ee)|0,b=b+Math.imul(we,ve)|0,b=b+Math.imul(Oe,Ee)|0,S=S+Math.imul(Oe,ve)|0,w=w+Math.imul(se,De)|0,b=b+Math.imul(se,Ne)|0,b=b+Math.imul(be,De)|0,S=S+Math.imul(be,Ne)|0,w=w+Math.imul(Q,Le)|0,b=b+Math.imul(Q,Be)|0,b=b+Math.imul(ce,Le)|0,S=S+Math.imul(ce,Be)|0,w=w+Math.imul(fe,Ue)|0,b=b+Math.imul(fe,Fe)|0,b=b+Math.imul(Y,Ue)|0,S=S+Math.imul(Y,Fe)|0,w=w+Math.imul(W,$e)|0,b=b+Math.imul(W,qe)|0,b=b+Math.imul(ee,$e)|0,S=S+Math.imul(ee,qe)|0,w=w+Math.imul(N,He)|0,b=b+Math.imul(N,je)|0,b=b+Math.imul(R,He)|0,S=S+Math.imul(R,je)|0,w=w+Math.imul(A,ze)|0,b=b+Math.imul(A,Ke)|0,b=b+Math.imul(K,ze)|0,S=S+Math.imul(K,Ke)|0,w=w+Math.imul(v,Ve)|0,b=b+Math.imul(v,We)|0,b=b+Math.imul(M,Ve)|0,S=S+Math.imul(M,We)|0;var ko=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(ko>>>26)|0,ko&=67108863,w=Math.imul(j,le),b=Math.imul(j,ge),b=b+Math.imul(ae,le)|0,S=Math.imul(ae,ge),w=w+Math.imul(te,Ee)|0,b=b+Math.imul(te,ve)|0,b=b+Math.imul(G,Ee)|0,S=S+Math.imul(G,ve)|0,w=w+Math.imul(we,De)|0,b=b+Math.imul(we,Ne)|0,b=b+Math.imul(Oe,De)|0,S=S+Math.imul(Oe,Ne)|0,w=w+Math.imul(se,Le)|0,b=b+Math.imul(se,Be)|0,b=b+Math.imul(be,Le)|0,S=S+Math.imul(be,Be)|0,w=w+Math.imul(Q,Ue)|0,b=b+Math.imul(Q,Fe)|0,b=b+Math.imul(ce,Ue)|0,S=S+Math.imul(ce,Fe)|0,w=w+Math.imul(fe,$e)|0,b=b+Math.imul(fe,qe)|0,b=b+Math.imul(Y,$e)|0,S=S+Math.imul(Y,qe)|0,w=w+Math.imul(W,He)|0,b=b+Math.imul(W,je)|0,b=b+Math.imul(ee,He)|0,S=S+Math.imul(ee,je)|0,w=w+Math.imul(N,ze)|0,b=b+Math.imul(N,Ke)|0,b=b+Math.imul(R,ze)|0,S=S+Math.imul(R,Ke)|0,w=w+Math.imul(A,Ve)|0,b=b+Math.imul(A,We)|0,b=b+Math.imul(K,Ve)|0,S=S+Math.imul(K,We)|0,w=w+Math.imul(v,Ge)|0,b=b+Math.imul(v,Ye)|0,b=b+Math.imul(M,Ge)|0,S=S+Math.imul(M,Ye)|0;var Co=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Co>>>26)|0,Co&=67108863,w=Math.imul(j,Ee),b=Math.imul(j,ve),b=b+Math.imul(ae,Ee)|0,S=Math.imul(ae,ve),w=w+Math.imul(te,De)|0,b=b+Math.imul(te,Ne)|0,b=b+Math.imul(G,De)|0,S=S+Math.imul(G,Ne)|0,w=w+Math.imul(we,Le)|0,b=b+Math.imul(we,Be)|0,b=b+Math.imul(Oe,Le)|0,S=S+Math.imul(Oe,Be)|0,w=w+Math.imul(se,Ue)|0,b=b+Math.imul(se,Fe)|0,b=b+Math.imul(be,Ue)|0,S=S+Math.imul(be,Fe)|0,w=w+Math.imul(Q,$e)|0,b=b+Math.imul(Q,qe)|0,b=b+Math.imul(ce,$e)|0,S=S+Math.imul(ce,qe)|0,w=w+Math.imul(fe,He)|0,b=b+Math.imul(fe,je)|0,b=b+Math.imul(Y,He)|0,S=S+Math.imul(Y,je)|0,w=w+Math.imul(W,ze)|0,b=b+Math.imul(W,Ke)|0,b=b+Math.imul(ee,ze)|0,S=S+Math.imul(ee,Ke)|0,w=w+Math.imul(N,Ve)|0,b=b+Math.imul(N,We)|0,b=b+Math.imul(R,Ve)|0,S=S+Math.imul(R,We)|0,w=w+Math.imul(A,Ge)|0,b=b+Math.imul(A,Ye)|0,b=b+Math.imul(K,Ge)|0,S=S+Math.imul(K,Ye)|0;var Do=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Do>>>26)|0,Do&=67108863,w=Math.imul(j,De),b=Math.imul(j,Ne),b=b+Math.imul(ae,De)|0,S=Math.imul(ae,Ne),w=w+Math.imul(te,Le)|0,b=b+Math.imul(te,Be)|0,b=b+Math.imul(G,Le)|0,S=S+Math.imul(G,Be)|0,w=w+Math.imul(we,Ue)|0,b=b+Math.imul(we,Fe)|0,b=b+Math.imul(Oe,Ue)|0,S=S+Math.imul(Oe,Fe)|0,w=w+Math.imul(se,$e)|0,b=b+Math.imul(se,qe)|0,b=b+Math.imul(be,$e)|0,S=S+Math.imul(be,qe)|0,w=w+Math.imul(Q,He)|0,b=b+Math.imul(Q,je)|0,b=b+Math.imul(ce,He)|0,S=S+Math.imul(ce,je)|0,w=w+Math.imul(fe,ze)|0,b=b+Math.imul(fe,Ke)|0,b=b+Math.imul(Y,ze)|0,S=S+Math.imul(Y,Ke)|0,w=w+Math.imul(W,Ve)|0,b=b+Math.imul(W,We)|0,b=b+Math.imul(ee,Ve)|0,S=S+Math.imul(ee,We)|0,w=w+Math.imul(N,Ge)|0,b=b+Math.imul(N,Ye)|0,b=b+Math.imul(R,Ge)|0,S=S+Math.imul(R,Ye)|0;var Io=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Io>>>26)|0,Io&=67108863,w=Math.imul(j,Le),b=Math.imul(j,Be),b=b+Math.imul(ae,Le)|0,S=Math.imul(ae,Be),w=w+Math.imul(te,Ue)|0,b=b+Math.imul(te,Fe)|0,b=b+Math.imul(G,Ue)|0,S=S+Math.imul(G,Fe)|0,w=w+Math.imul(we,$e)|0,b=b+Math.imul(we,qe)|0,b=b+Math.imul(Oe,$e)|0,S=S+Math.imul(Oe,qe)|0,w=w+Math.imul(se,He)|0,b=b+Math.imul(se,je)|0,b=b+Math.imul(be,He)|0,S=S+Math.imul(be,je)|0,w=w+Math.imul(Q,ze)|0,b=b+Math.imul(Q,Ke)|0,b=b+Math.imul(ce,ze)|0,S=S+Math.imul(ce,Ke)|0,w=w+Math.imul(fe,Ve)|0,b=b+Math.imul(fe,We)|0,b=b+Math.imul(Y,Ve)|0,S=S+Math.imul(Y,We)|0,w=w+Math.imul(W,Ge)|0,b=b+Math.imul(W,Ye)|0,b=b+Math.imul(ee,Ge)|0,S=S+Math.imul(ee,Ye)|0;var Oo=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,w=Math.imul(j,Ue),b=Math.imul(j,Fe),b=b+Math.imul(ae,Ue)|0,S=Math.imul(ae,Fe),w=w+Math.imul(te,$e)|0,b=b+Math.imul(te,qe)|0,b=b+Math.imul(G,$e)|0,S=S+Math.imul(G,qe)|0,w=w+Math.imul(we,He)|0,b=b+Math.imul(we,je)|0,b=b+Math.imul(Oe,He)|0,S=S+Math.imul(Oe,je)|0,w=w+Math.imul(se,ze)|0,b=b+Math.imul(se,Ke)|0,b=b+Math.imul(be,ze)|0,S=S+Math.imul(be,Ke)|0,w=w+Math.imul(Q,Ve)|0,b=b+Math.imul(Q,We)|0,b=b+Math.imul(ce,Ve)|0,S=S+Math.imul(ce,We)|0,w=w+Math.imul(fe,Ge)|0,b=b+Math.imul(fe,Ye)|0,b=b+Math.imul(Y,Ge)|0,S=S+Math.imul(Y,Ye)|0;var Po=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Po>>>26)|0,Po&=67108863,w=Math.imul(j,$e),b=Math.imul(j,qe),b=b+Math.imul(ae,$e)|0,S=Math.imul(ae,qe),w=w+Math.imul(te,He)|0,b=b+Math.imul(te,je)|0,b=b+Math.imul(G,He)|0,S=S+Math.imul(G,je)|0,w=w+Math.imul(we,ze)|0,b=b+Math.imul(we,Ke)|0,b=b+Math.imul(Oe,ze)|0,S=S+Math.imul(Oe,Ke)|0,w=w+Math.imul(se,Ve)|0,b=b+Math.imul(se,We)|0,b=b+Math.imul(be,Ve)|0,S=S+Math.imul(be,We)|0,w=w+Math.imul(Q,Ge)|0,b=b+Math.imul(Q,Ye)|0,b=b+Math.imul(ce,Ge)|0,S=S+Math.imul(ce,Ye)|0;var No=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(No>>>26)|0,No&=67108863,w=Math.imul(j,He),b=Math.imul(j,je),b=b+Math.imul(ae,He)|0,S=Math.imul(ae,je),w=w+Math.imul(te,ze)|0,b=b+Math.imul(te,Ke)|0,b=b+Math.imul(G,ze)|0,S=S+Math.imul(G,Ke)|0,w=w+Math.imul(we,Ve)|0,b=b+Math.imul(we,We)|0,b=b+Math.imul(Oe,Ve)|0,S=S+Math.imul(Oe,We)|0,w=w+Math.imul(se,Ge)|0,b=b+Math.imul(se,Ye)|0,b=b+Math.imul(be,Ge)|0,S=S+Math.imul(be,Ye)|0;var Ro=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,w=Math.imul(j,ze),b=Math.imul(j,Ke),b=b+Math.imul(ae,ze)|0,S=Math.imul(ae,Ke),w=w+Math.imul(te,Ve)|0,b=b+Math.imul(te,We)|0,b=b+Math.imul(G,Ve)|0,S=S+Math.imul(G,We)|0,w=w+Math.imul(we,Ge)|0,b=b+Math.imul(we,Ye)|0,b=b+Math.imul(Oe,Ge)|0,S=S+Math.imul(Oe,Ye)|0;var Lo=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,w=Math.imul(j,Ve),b=Math.imul(j,We),b=b+Math.imul(ae,Ve)|0,S=Math.imul(ae,We),w=w+Math.imul(te,Ge)|0,b=b+Math.imul(te,Ye)|0,b=b+Math.imul(G,Ge)|0,S=S+Math.imul(G,Ye)|0;var Bo=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,w=Math.imul(j,Ge),b=Math.imul(j,Ye),b=b+Math.imul(ae,Ge)|0,S=Math.imul(ae,Ye);var Uo=(_+w|0)+((b&8191)<<13)|0;return _=(S+(b>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,y[0]=gn,y[1]=mt,y[2]=bt,y[3]=Yr,y[4]=Jr,y[5]=Xr,y[6]=Zr,y[7]=Qr,y[8]=ko,y[9]=Co,y[10]=Do,y[11]=Io,y[12]=Oo,y[13]=Po,y[14]=No,y[15]=Ro,y[16]=Lo,y[17]=Bo,y[18]=Uo,_!==0&&(y[19]=_,h.length++),h},"comb10MulTo");Math.imul||(T=O);function C(E,l,g){g.negative=l.negative^E.negative,g.length=E.length+l.length;for(var h=0,c=0,d=0;d<g.length-1;d++){var y=c;c=0;for(var _=h&67108863,w=Math.min(d,l.length-1),b=Math.max(0,d-E.length+1);b<=w;b++){var S=d-b,D=E.words[S]|0,v=l.words[b]|0,M=D*v,ne=M&67108863;y=y+(M/67108864|0)|0,ne=ne+_|0,_=ne&67108863,y=y+(ne>>>26)|0,c+=y>>>26,y&=67108863}g.words[d]=_,h=y,y=c}return h!==0?g.words[d]=h:g.length--,g.strip()}o(C,"bigMulTo");function $(E,l,g){var h=new I;return h.mulp(E,l,g)}o($,"jumboMulTo"),i.prototype.mulTo=o(function(l,g){var h,c=this.length+l.length;return this.length===10&&l.length===10?h=T(this,l,g):c<63?h=O(this,l,g):c<1024?h=C(this,l,g):h=$(this,l,g),h},"mulTo");function I(E,l){this.x=E,this.y=l}o(I,"FFTM"),I.prototype.makeRBT=o(function(l){for(var g=new Array(l),h=i.prototype._countBits(l)-1,c=0;c<l;c++)g[c]=this.revBin(c,h,l);return g},"makeRBT"),I.prototype.revBin=o(function(l,g,h){if(l===0||l===h-1)return l;for(var c=0,d=0;d<g;d++)c|=(l&1)<<g-d-1,l>>=1;return c},"revBin"),I.prototype.permute=o(function(l,g,h,c,d,y){for(var _=0;_<y;_++)c[_]=g[l[_]],d[_]=h[l[_]]},"permute"),I.prototype.transform=o(function(l,g,h,c,d,y){this.permute(y,l,g,h,c,d);for(var _=1;_<d;_<<=1)for(var w=_<<1,b=Math.cos(2*Math.PI/w),S=Math.sin(2*Math.PI/w),D=0;D<d;D+=w)for(var v=b,M=S,ne=0;ne<_;ne++){var A=h[D+ne],K=c[D+ne],J=h[D+ne+_],N=c[D+ne+_],R=v*J-M*N;N=v*N+M*J,J=R,h[D+ne]=A+J,c[D+ne]=K+N,h[D+ne+_]=A-J,c[D+ne+_]=K-N,ne!==w&&(R=b*v-S*M,M=b*M+S*v,v=R)}},"transform"),I.prototype.guessLen13b=o(function(l,g){var h=Math.max(g,l)|1,c=h&1,d=0;for(h=h/2|0;h;h=h>>>1)d++;return 1<<d+1+c},"guessLen13b"),I.prototype.conjugate=o(function(l,g,h){if(!(h<=1))for(var c=0;c<h/2;c++){var d=l[c];l[c]=l[h-c-1],l[h-c-1]=d,d=g[c],g[c]=-g[h-c-1],g[h-c-1]=-d}},"conjugate"),I.prototype.normalize13b=o(function(l,g){for(var h=0,c=0;c<g/2;c++){var d=Math.round(l[2*c+1]/g)*8192+Math.round(l[2*c]/g)+h;l[c]=d&67108863,d<67108864?h=0:h=d/67108864|0}return l},"normalize13b"),I.prototype.convert13b=o(function(l,g,h,c){for(var d=0,y=0;y<g;y++)d=d+(l[y]|0),h[2*y]=d&8191,d=d>>>13,h[2*y+1]=d&8191,d=d>>>13;for(y=2*g;y<c;++y)h[y]=0;t(d===0),t((d&-8192)===0)},"convert13b"),I.prototype.stub=o(function(l){for(var g=new Array(l),h=0;h<l;h++)g[h]=0;return g},"stub"),I.prototype.mulp=o(function(l,g,h){var c=2*this.guessLen13b(l.length,g.length),d=this.makeRBT(c),y=this.stub(c),_=new Array(c),w=new Array(c),b=new Array(c),S=new Array(c),D=new Array(c),v=new Array(c),M=h.words;M.length=c,this.convert13b(l.words,l.length,_,c),this.convert13b(g.words,g.length,S,c),this.transform(_,y,w,b,c,d),this.transform(S,y,D,v,c,d);for(var ne=0;ne<c;ne++){var A=w[ne]*D[ne]-b[ne]*v[ne];b[ne]=w[ne]*v[ne]+b[ne]*D[ne],w[ne]=A}return this.conjugate(w,b,c),this.transform(w,b,M,y,c,d),this.conjugate(M,y,c),this.normalize13b(M,c),h.negative=l.negative^g.negative,h.length=l.length+g.length,h.strip()},"mulp"),i.prototype.mul=o(function(l){var g=new i(null);return g.words=new Array(this.length+l.length),this.mulTo(l,g)},"mul"),i.prototype.mulf=o(function(l){var g=new i(null);return g.words=new Array(this.length+l.length),$(this,l,g)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){t(typeof l=="number"),t(l<67108864);for(var g=0,h=0;h<this.length;h++){var c=(this.words[h]|0)*l,d=(c&67108863)+(g&67108863);g>>=26,g+=c/67108864|0,g+=d>>>26,this.words[h]=d&67108863}return g!==0&&(this.words[h]=g,this.length++),this},"imuln"),i.prototype.muln=o(function(l){return this.clone().imuln(l)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(l){var g=k(l);if(g.length===0)return new i(1);for(var h=this,c=0;c<g.length&&g[c]===0;c++,h=h.sqr());if(++c<g.length)for(var d=h.sqr();c<g.length;c++,d=d.sqr())g[c]!==0&&(h=h.mul(d));return h},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var g=l%26,h=(l-g)/26,c=67108863>>>26-g<<26-g,d;if(g!==0){var y=0;for(d=0;d<this.length;d++){var _=this.words[d]&c,w=(this.words[d]|0)-_<<g;this.words[d]=w|y,y=_>>>26-g}y&&(this.words[d]=y,this.length++)}if(h!==0){for(d=this.length-1;d>=0;d--)this.words[d+h]=this.words[d];for(d=0;d<h;d++)this.words[d]=0;this.length+=h}return this.strip()},"iushln"),i.prototype.ishln=o(function(l){return t(this.negative===0),this.iushln(l)},"ishln"),i.prototype.iushrn=o(function(l,g,h){t(typeof l=="number"&&l>=0);var c;g?c=(g-g%26)/26:c=0;var d=l%26,y=Math.min((l-d)/26,this.length),_=67108863^67108863>>>d<<d,w=h;if(c-=y,c=Math.max(0,c),w){for(var b=0;b<y;b++)w.words[b]=this.words[b];w.length=y}if(y!==0)if(this.length>y)for(this.length-=y,b=0;b<this.length;b++)this.words[b]=this.words[b+y];else this.words[0]=0,this.length=1;var S=0;for(b=this.length-1;b>=0&&(S!==0||b>=c);b--){var D=this.words[b]|0;this.words[b]=S<<26-d|D>>>d,S=D&_}return w&&S!==0&&(w.words[w.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(l,g,h){return t(this.negative===0),this.iushrn(l,g,h)},"ishrn"),i.prototype.shln=o(function(l){return this.clone().ishln(l)},"shln"),i.prototype.ushln=o(function(l){return this.clone().iushln(l)},"ushln"),i.prototype.shrn=o(function(l){return this.clone().ishrn(l)},"shrn"),i.prototype.ushrn=o(function(l){return this.clone().iushrn(l)},"ushrn"),i.prototype.testn=o(function(l){t(typeof l=="number"&&l>=0);var g=l%26,h=(l-g)/26,c=1<<g;if(this.length<=h)return!1;var d=this.words[h];return!!(d&c)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var g=l%26,h=(l-g)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(g!==0&&h++,this.length=Math.min(h,this.length),g!==0){var c=67108863^67108863>>>g<<g;this.words[this.length-1]&=c}return this.strip()},"imaskn"),i.prototype.maskn=o(function(l){return this.clone().imaskn(l)},"maskn"),i.prototype.iaddn=o(function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},"iaddn"),i.prototype._iaddn=o(function(l){this.words[0]+=l;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},"_iaddn"),i.prototype.isubn=o(function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(l){return this.clone().iaddn(l)},"addn"),i.prototype.subn=o(function(l){return this.clone().isubn(l)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(l,g,h){var c=l.length+h,d;this._expand(c);var y,_=0;for(d=0;d<l.length;d++){y=(this.words[d+h]|0)+_;var w=(l.words[d]|0)*g;y-=w&67108863,_=(y>>26)-(w/67108864|0),this.words[d+h]=y&67108863}for(;d<this.length-h;d++)y=(this.words[d+h]|0)+_,_=y>>26,this.words[d+h]=y&67108863;if(_===0)return this.strip();for(t(_===-1),_=0,d=0;d<this.length;d++)y=-(this.words[d]|0)+_,_=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,g){var h=this.length-l.length,c=this.clone(),d=l,y=d.words[d.length-1]|0,_=this._countBits(y);h=26-_,h!==0&&(d=d.ushln(h),c.iushln(h),y=d.words[d.length-1]|0);var w=c.length-d.length,b;if(g!=="mod"){b=new i(null),b.length=w+1,b.words=new Array(b.length);for(var S=0;S<b.length;S++)b.words[S]=0}var D=c.clone()._ishlnsubmul(d,1,w);D.negative===0&&(c=D,b&&(b.words[w]=1));for(var v=w-1;v>=0;v--){var M=(c.words[d.length+v]|0)*67108864+(c.words[d.length+v-1]|0);for(M=Math.min(M/y|0,67108863),c._ishlnsubmul(d,M,v);c.negative!==0;)M--,c.negative=0,c._ishlnsubmul(d,1,v),c.isZero()||(c.negative^=1);b&&(b.words[v]=M)}return b&&b.strip(),c.strip(),g!=="div"&&h!==0&&c.iushrn(h),{div:b||null,mod:c}},"_wordDiv"),i.prototype.divmod=o(function(l,g,h){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var c,d,y;return this.negative!==0&&l.negative===0?(y=this.neg().divmod(l,g),g!=="mod"&&(c=y.div.neg()),g!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.iadd(l)),{div:c,mod:d}):this.negative===0&&l.negative!==0?(y=this.divmod(l.neg(),g),g!=="mod"&&(c=y.div.neg()),{div:c,mod:y.mod}):(this.negative&l.negative)!==0?(y=this.neg().divmod(l.neg(),g),g!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.isub(l)),{div:y.div,mod:d}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?g==="div"?{div:this.divn(l.words[0]),mod:null}:g==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,g)},"divmod"),i.prototype.div=o(function(l){return this.divmod(l,"div",!1).div},"div"),i.prototype.mod=o(function(l){return this.divmod(l,"mod",!1).mod},"mod"),i.prototype.umod=o(function(l){return this.divmod(l,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(l){var g=this.divmod(l);if(g.mod.isZero())return g.div;var h=g.div.negative!==0?g.mod.isub(l):g.mod,c=l.ushrn(1),d=l.andln(1),y=h.cmp(c);return y<0||d===1&&y===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(l){t(l<=67108863);for(var g=(1<<26)%l,h=0,c=this.length-1;c>=0;c--)h=(g*h+(this.words[c]|0))%l;return h},"modn"),i.prototype.idivn=o(function(l){t(l<=67108863);for(var g=0,h=this.length-1;h>=0;h--){var c=(this.words[h]|0)+g*67108864;this.words[h]=c/l|0,g=c%l}return this.strip()},"idivn"),i.prototype.divn=o(function(l){return this.clone().idivn(l)},"divn"),i.prototype.egcd=o(function(l){t(l.negative===0),t(!l.isZero());var g=this,h=l.clone();g.negative!==0?g=g.umod(l):g=g.clone();for(var c=new i(1),d=new i(0),y=new i(0),_=new i(1),w=0;g.isEven()&&h.isEven();)g.iushrn(1),h.iushrn(1),++w;for(var b=h.clone(),S=g.clone();!g.isZero();){for(var D=0,v=1;(g.words[0]&v)===0&&D<26;++D,v<<=1);if(D>0)for(g.iushrn(D);D-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(b),d.isub(S)),c.iushrn(1),d.iushrn(1);for(var M=0,ne=1;(h.words[0]&ne)===0&&M<26;++M,ne<<=1);if(M>0)for(h.iushrn(M);M-- >0;)(y.isOdd()||_.isOdd())&&(y.iadd(b),_.isub(S)),y.iushrn(1),_.iushrn(1);g.cmp(h)>=0?(g.isub(h),c.isub(y),d.isub(_)):(h.isub(g),y.isub(c),_.isub(d))}return{a:y,b:_,gcd:h.iushln(w)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var g=this,h=l.clone();g.negative!==0?g=g.umod(l):g=g.clone();for(var c=new i(1),d=new i(0),y=h.clone();g.cmpn(1)>0&&h.cmpn(1)>0;){for(var _=0,w=1;(g.words[0]&w)===0&&_<26;++_,w<<=1);if(_>0)for(g.iushrn(_);_-- >0;)c.isOdd()&&c.iadd(y),c.iushrn(1);for(var b=0,S=1;(h.words[0]&S)===0&&b<26;++b,S<<=1);if(b>0)for(h.iushrn(b);b-- >0;)d.isOdd()&&d.iadd(y),d.iushrn(1);g.cmp(h)>=0?(g.isub(h),c.isub(d)):(h.isub(g),d.isub(c))}var D;return g.cmpn(1)===0?D=c:D=d,D.cmpn(0)<0&&D.iadd(l),D},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var g=this.clone(),h=l.clone();g.negative=0,h.negative=0;for(var c=0;g.isEven()&&h.isEven();c++)g.iushrn(1),h.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;h.isEven();)h.iushrn(1);var d=g.cmp(h);if(d<0){var y=g;g=h,h=y}else if(d===0||h.cmpn(1)===0)break;g.isub(h)}while(!0);return h.iushln(c)},"gcd"),i.prototype.invm=o(function(l){return this.egcd(l).a.umod(l)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(l){return this.words[0]&l},"andln"),i.prototype.bincn=o(function(l){t(typeof l=="number");var g=l%26,h=(l-g)/26,c=1<<g;if(this.length<=h)return this._expand(h+1),this.words[h]|=c,this;for(var d=c,y=h;d!==0&&y<this.length;y++){var _=this.words[y]|0;_+=d,d=_>>>26,_&=67108863,this.words[y]=_}return d!==0&&(this.words[y]=d,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(l){var g=l<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var h;if(this.length>1)h=1;else{g&&(l=-l),t(l<=67108863,"Number is too big");var c=this.words[0]|0;h=c===l?0:c<l?-1:1}return this.negative!==0?-h|0:h},"cmpn"),i.prototype.cmp=o(function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var g=this.ucmp(l);return this.negative!==0?-g|0:g},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var g=0,h=this.length-1;h>=0;h--){var c=this.words[h]|0,d=l.words[h]|0;if(c!==d){c<d?g=-1:c>d&&(g=1);break}}return g},"ucmp"),i.prototype.gtn=o(function(l){return this.cmpn(l)===1},"gtn"),i.prototype.gt=o(function(l){return this.cmp(l)===1},"gt"),i.prototype.gten=o(function(l){return this.cmpn(l)>=0},"gten"),i.prototype.gte=o(function(l){return this.cmp(l)>=0},"gte"),i.prototype.ltn=o(function(l){return this.cmpn(l)===-1},"ltn"),i.prototype.lt=o(function(l){return this.cmp(l)===-1},"lt"),i.prototype.lten=o(function(l){return this.cmpn(l)<=0},"lten"),i.prototype.lte=o(function(l){return this.cmp(l)<=0},"lte"),i.prototype.eqn=o(function(l){return this.cmpn(l)===0},"eqn"),i.prototype.eq=o(function(l){return this.cmp(l)===0},"eq"),i.red=o(function(l){return new F(l)},"red"),i.prototype.toRed=o(function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(l){return this.red=l,this},"_forceRed"),i.prototype.forceRed=o(function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},"forceRed"),i.prototype.redAdd=o(function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},"redAdd"),i.prototype.redIAdd=o(function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},"redIAdd"),i.prototype.redSub=o(function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},"redSub"),i.prototype.redISub=o(function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},"redISub"),i.prototype.redShl=o(function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},"redShl"),i.prototype.redMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},"redMul"),i.prototype.redIMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)},"redPow");var U={k256:null,p224:null,p192:null,p25519:null};function z(E,l){this.name=E,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(z,"MPrime"),z.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),z.prototype.ireduce=o(function(l){var g=l,h;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),h=g.bitLength();while(h>this.n);var c=h<this.n?-1:g.ucmp(this.p);return c===0?(g.words[0]=0,g.length=1):c>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},"ireduce"),z.prototype.split=o(function(l,g){l.iushrn(this.n,0,g)},"split"),z.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,z),H.prototype.split=o(function(l,g){for(var h=4194303,c=Math.min(l.length,9),d=0;d<c;d++)g.words[d]=l.words[d];if(g.length=c,l.length<=9){l.words[0]=0,l.length=1;return}var y=l.words[9];for(g.words[g.length++]=y&h,d=10;d<l.length;d++){var _=l.words[d]|0;l.words[d-10]=(_&h)<<4|y>>>22,y=_}y>>>=22,l.words[d-10]=y,y===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var g=0,h=0;h<l.length;h++){var c=l.words[h]|0;g+=c*977,l.words[h]=g&67108863,g=c*64+(g/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function X(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(X,"P224"),n(X,z);function B(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(B,"P192"),n(B,z);function L(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,z),L.prototype.imulK=o(function(l){for(var g=0,h=0;h<l.length;h++){var c=(l.words[h]|0)*19+g,d=c&67108863;c>>>=26,l.words[h]=d,g=c}return g!==0&&(l.words[l.length++]=g),l},"imulK"),i._prime=o(function(l){if(U[l])return U[l];var g;if(l==="k256")g=new H;else if(l==="p224")g=new X;else if(l==="p192")g=new B;else if(l==="p25519")g=new L;else throw new Error("Unknown prime "+l);return U[l]=g,g},"prime");function F(E){if(typeof E=="string"){var l=i._prime(E);this.m=l.p,this.prime=l}else t(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}o(F,"Red"),F.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),F.prototype._verify2=o(function(l,g){t((l.negative|g.negative)===0,"red works only with positives"),t(l.red&&l.red===g.red,"red works only with red numbers")},"_verify2"),F.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},"imod"),F.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),F.prototype.add=o(function(l,g){this._verify2(l,g);var h=l.add(g);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},"add"),F.prototype.iadd=o(function(l,g){this._verify2(l,g);var h=l.iadd(g);return h.cmp(this.m)>=0&&h.isub(this.m),h},"iadd"),F.prototype.sub=o(function(l,g){this._verify2(l,g);var h=l.sub(g);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},"sub"),F.prototype.isub=o(function(l,g){this._verify2(l,g);var h=l.isub(g);return h.cmpn(0)<0&&h.iadd(this.m),h},"isub"),F.prototype.shl=o(function(l,g){return this._verify1(l),this.imod(l.ushln(g))},"shl"),F.prototype.imul=o(function(l,g){return this._verify2(l,g),this.imod(l.imul(g))},"imul"),F.prototype.mul=o(function(l,g){return this._verify2(l,g),this.imod(l.mul(g))},"mul"),F.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),F.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),F.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var g=this.m.andln(3);if(t(g%2===1),g===3){var h=this.m.add(new i(1)).iushrn(2);return this.pow(l,h)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);t(!c.isZero());var y=new i(1).toRed(this),_=y.redNeg(),w=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new i(2*b*b).toRed(this);this.pow(b,w).cmp(_)!==0;)b.redIAdd(_);for(var S=this.pow(b,c),D=this.pow(l,c.addn(1).iushrn(1)),v=this.pow(l,c),M=d;v.cmp(y)!==0;){for(var ne=v,A=0;ne.cmp(y)!==0;A++)ne=ne.redSqr();t(A<M);var K=this.pow(S,new i(1).iushln(M-A-1));D=D.redMul(K),S=K.redSqr(),v=v.redMul(S),M=A}return D},"sqrt"),F.prototype.invm=o(function(l){var g=l._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},"invm"),F.prototype.pow=o(function(l,g){if(g.isZero())return new i(1).toRed(this);if(g.cmpn(1)===0)return l.clone();var h=4,c=new Array(1<<h);c[0]=new i(1).toRed(this),c[1]=l;for(var d=2;d<c.length;d++)c[d]=this.mul(c[d-1],l);var y=c[0],_=0,w=0,b=g.bitLength()%26;for(b===0&&(b=26),d=g.length-1;d>=0;d--){for(var S=g.words[d],D=b-1;D>=0;D--){var v=S>>D&1;if(y!==c[0]&&(y=this.sqr(y)),v===0&&_===0){w=0;continue}_<<=1,_|=v,w++,!(w!==h&&(d!==0||D!==0))&&(y=this.mul(y,c[_]),w=0,_=0)}b=26}return y},"pow"),F.prototype.convertTo=o(function(l){var g=l.umod(this.m);return g===l?g.clone():g},"convertTo"),F.prototype.convertFrom=o(function(l){var g=l.clone();return g.red=null,g},"convertFrom"),i.mont=o(function(l){return new re(l)},"mont");function re(E){F.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(re,"Mont"),n(re,F),re.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),re.prototype.convertFrom=o(function(l){var g=this.imod(l.mul(this.rinv));return g.red=null,g},"convertFrom"),re.prototype.imul=o(function(l,g){if(l.isZero()||g.isZero())return l.words[0]=0,l.length=1,l;var h=l.imul(g),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"imul"),re.prototype.mul=o(function(l,g){if(l.isZero()||g.isZero())return new i(0)._forceRed(this);var h=l.mul(g),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"mul"),re.prototype.invm=o(function(l){var g=this.imod(l._invmp(this.m).mul(this.r2));return g._forceRed(this)},"invm")})(typeof th=="undefined"||th,x1)});var Ji=me((iN,_1)=>{_1.exports=w1;function w1(r,e){if(!r)throw new Error(e||"Assertion failed")}o(w1,"assert");w1.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var rh=me(M1=>{"use strict";var Jc=M1;function A_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r!="string"){for(var n=0;n<r.length;n++)t[n]=r[n]|0;return t}if(e==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var n=0;n<r.length;n+=2)t.push(parseInt(r[n]+r[n+1],16))}else for(var n=0;n<r.length;n++){var i=r.charCodeAt(n),s=i>>8,a=i&255;s?t.push(s,a):t.push(a)}return t}o(A_,"toArray");Jc.toArray=A_;function E1(r){return r.length===1?"0"+r:r}o(E1,"zero2");Jc.zero2=E1;function S1(r){for(var e="",t=0;t<r.length;t++)e+=E1(r[t].toString(16));return e}o(S1,"toHex");Jc.toHex=S1;Jc.encode=o(function(e,t){return t==="hex"?S1(e):e},"encode")});var Or=me(A1=>{"use strict";var xn=A1,T_=Wn(),k_=Ji(),Xc=rh();xn.assert=k_;xn.toArray=Xc.toArray;xn.zero2=Xc.zero2;xn.toHex=Xc.toHex;xn.encode=Xc.encode;function C_(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1);n.fill(0);for(var i=1<<e+1,s=r.clone(),a=0;a<n.length;a++){var f,u=s.andln(i-1);s.isOdd()?(u>(i>>1)-1?f=(i>>1)-u:f=u,s.isubn(f)):f=0,n[a]=f,s.iushrn(1)}return n}o(C_,"getNAF");xn.getNAF=C_;function D_(r,e){var t=[[],[]];r=r.clone(),e=e.clone();for(var n=0,i=0,s;r.cmpn(-n)>0||e.cmpn(-i)>0;){var a=r.andln(3)+n&3,f=e.andln(3)+i&3;a===3&&(a=-1),f===3&&(f=-1);var u;(a&1)===0?u=0:(s=r.andln(7)+n&7,(s===3||s===5)&&f===2?u=-a:u=a),t[0].push(u);var m;(f&1)===0?m=0:(s=e.andln(7)+i&7,(s===3||s===5)&&a===2?m=-f:m=f),t[1].push(m),2*n===u+1&&(n=1-n),2*i===m+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(D_,"getJSF");xn.getJSF=D_;function I_(r,e,t){var n="_"+e;r.prototype[e]=o(function(){return this[n]!==void 0?this[n]:this[n]=t.call(this)},"cachedProperty")}o(I_,"cachedProperty");xn.cachedProperty=I_;function O_(r){return typeof r=="string"?xn.toArray(r,"hex"):r}o(O_,"parseBytes");xn.parseBytes=O_;function P_(r){return new T_(r,"hex","le")}o(P_,"intFromLE");xn.intFromLE=P_});var sh=me((aN,oh)=>{var nh;oh.exports=o(function(e){return nh||(nh=new Xi(null)),nh.generate(e)},"rand");function Xi(r){this.rand=r}o(Xi,"Rand");oh.exports.Rand=Xi;Xi.prototype.generate=o(function(e){return this._rand(e)},"generate");Xi.prototype._rand=o(function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"_rand");if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Xi.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Xi.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(Xi.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(ih=require("crypto"),typeof ih.randomBytes!="function")throw new Error("Not supported");Xi.prototype._rand=o(function(e){return ih.randomBytes(e)},"_rand")}catch(r){}var ih});var hf=me((fN,T1)=>{"use strict";var Vo=Wn(),df=Or(),Zc=df.getNAF,N_=df.getJSF,Qc=df.assert;function Zi(r,e){this.type=r,this.p=new Vo(e.p,16),this.red=e.prime?Vo.red(e.prime):Vo.mont(this.p),this.zero=new Vo(0).toRed(this.red),this.one=new Vo(1).toRed(this.red),this.two=new Vo(2).toRed(this.red),this.n=e.n&&new Vo(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Zi,"BaseCurve");T1.exports=Zi;Zi.prototype.point=o(function(){throw new Error("Not implemented")},"point");Zi.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Zi.prototype._fixedNafMul=o(function(e,t){Qc(e.precomputed);var n=e._getDoubles(),i=Zc(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var m=f+n.step-1;m>=f;m--)u=(u<<1)+i[m];a.push(u)}for(var p=this.jpoint(null,null,null),x=this.jpoint(null,null,null),k=s;k>0;k--){for(f=0;f<a.length;f++)u=a[f],u===k?x=x.mixedAdd(n.points[f]):u===-k&&(x=x.mixedAdd(n.points[f].neg()));p=p.add(x)}return p.toP()},"_fixedNafMul");Zi.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Zc(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var m=0;u>=0&&a[u]===0;u--)m++;if(u>=0&&m++,f=f.dblp(m),u<0)break;var p=a[u];Qc(p!==0),e.type==="affine"?p>0?f=f.mixedAdd(s[p-1>>1]):f=f.mixedAdd(s[-p-1>>1].neg()):p>0?f=f.add(s[p-1>>1]):f=f.add(s[-p-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");Zi.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,m=0,p,x,k;for(p=0;p<i;p++){k=t[p];var O=k._getNAFPoints(e);a[p]=O.wnd,f[p]=O.points}for(p=i-1;p>=1;p-=2){var T=p-1,C=p;if(a[T]!==1||a[C]!==1){u[T]=Zc(n[T],a[T],this._bitLength),u[C]=Zc(n[C],a[C],this._bitLength),m=Math.max(u[T].length,m),m=Math.max(u[C].length,m);continue}var $=[t[T],null,null,t[C]];t[T].y.cmp(t[C].y)===0?($[1]=t[T].add(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg())):t[T].y.cmp(t[C].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].add(t[C].neg())):($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],U=N_(n[T],n[C]);for(m=Math.max(U[0].length,m),u[T]=new Array(m),u[C]=new Array(m),x=0;x<m;x++){var z=U[0][x]|0,H=U[1][x]|0;u[T][x]=I[(z+1)*3+(H+1)],u[C][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),B=this._wnafT4;for(p=m;p>=0;p--){for(var L=0;p>=0;){var F=!0;for(x=0;x<i;x++)B[x]=u[x][p]|0,B[x]!==0&&(F=!1);if(!F)break;L++,p--}if(p>=0&&L++,X=X.dblp(L),p<0)break;for(x=0;x<i;x++){var re=B[x];re!==0&&(re>0?k=f[x][re-1>>1]:re<0&&(k=f[x][-re-1>>1].neg()),k.type==="affine"?X=X.mixedAdd(k):X=X.add(k))}}for(p=0;p<i;p++)f[p]=null;return s?X:X.toP()},"_wnafMulAdd");function rn(r,e){this.curve=r,this.type=e,this.precomputed=null}o(rn,"BasePoint");Zi.BasePoint=rn;rn.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");rn.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Zi.prototype.decodePoint=o(function(e,t){e=df.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Qc(e[e.length-1]%2===0):e[0]===7&&Qc(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");rn.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");rn.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");rn.prototype.encode=o(function(e,t){return df.encode(this._encode(t),e)},"encode");rn.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");rn.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");rn.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");rn.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");rn.prototype._getBeta=o(function(){return null},"_getBeta");rn.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var pf=me((cN,ah)=>{typeof Object.create=="function"?ah.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):ah.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var C1=me((uN,k1)=>{"use strict";var R_=Or(),Ot=Wn(),fh=pf(),Js=hf(),L_=R_.assert;function nn(r){Js.call(this,"short",r),this.a=new Ot(r.a,16).toRed(this.red),this.b=new Ot(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(nn,"ShortCurve");fh(nn,Js);k1.exports=nn;nn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new Ot(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new Ot(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],L_(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new Ot(f.a,16),b:new Ot(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");nn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:Ot.mont(e),n=new Ot(2).toRed(t).redInvm(),i=n.redNeg(),s=new Ot(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");nn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new Ot(1),a=new Ot(0),f=new Ot(0),u=new Ot(1),m,p,x,k,O,T,C,$=0,I,U;n.cmpn(0)!==0;){var z=i.div(n);I=i.sub(z.mul(n)),U=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&I.cmp(t)<0)m=C.neg(),p=s,x=I.neg(),k=U;else if(x&&++$===2)break;C=I,i=n,n=I,f=s,s=U,u=a,a=H}O=I.neg(),T=U;var X=x.sqr().add(k.sqr()),B=O.sqr().add(T.sqr());return B.cmp(X)>=0&&(O=m,T=p),x.negative&&(x=x.neg(),k=k.neg()),O.negative&&(O=O.neg(),T=T.neg()),[{a:x,b:k},{a:O,b:T}]},"_getEndoBasis");nn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),m=s.mul(n.b),p=a.mul(i.b),x=e.sub(f).sub(u),k=m.add(p).neg();return{k1:x,k2:k}},"_endoSplit");nn.prototype.pointFromX=o(function(e,t){e=new Ot(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");nn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");nn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],m=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),m=m.neg(!0)),i[a*2]=u,i[a*2+1]=m,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var p=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return p},"_endoWnafMulAdd");function jt(r,e,t,n){Js.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ot(e,16),this.y=new Ot(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(jt,"Point");fh(jt,Js.BasePoint);nn.prototype.point=o(function(e,t,n){return new jt(this,e,t,n)},"point");nn.prototype.pointFromJSON=o(function(e,t){return jt.fromJSON(this,e,t)},"pointFromJSON");jt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");jt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");jt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");jt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");jt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");jt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");jt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");jt.prototype.getX=o(function(){return this.x.fromRed()},"getX");jt.prototype.getY=o(function(){return this.y.fromRed()},"getY");jt.prototype.mul=o(function(e){return e=new Ot(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");jt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");jt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");jt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");jt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");jt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function Xt(r,e,t,n){Js.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ot(0)):(this.x=new Ot(e,16),this.y=new Ot(t,16),this.z=new Ot(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(Xt,"JPoint");fh(Xt,Js.BasePoint);nn.prototype.jpoint=o(function(e,t,n){return new Xt(this,e,t,n)},"jpoint");Xt.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");Xt.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Xt.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),m=a.redSub(f);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),x=p.redMul(u),k=i.redMul(p),O=m.redSqr().redIAdd(x).redISub(k).redISub(k),T=m.redMul(k.redISub(O)).redISub(a.redMul(x)),C=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(O,T,C)},"add");Xt.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=f.redSqr(),p=m.redMul(f),x=n.redMul(m),k=u.redSqr().redIAdd(p).redISub(x).redISub(x),O=u.redMul(x.redISub(k)).redISub(s.redMul(p)),T=this.z.redMul(f);return this.curve.jpoint(k,O,T)},"mixedAdd");Xt.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,m=u.redSqr().redSqr(),p=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),k=p.redSqr(),O=k.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(m)),C=a.redMul(k),$=T.redSqr().redISub(C.redAdd(C)),I=C.redISub($),U=T.redMul(I);U=U.redIAdd(U).redISub(O);var z=p.redMul(u);t+1<e&&(m=m.redMul(O)),a=$,u=z,p=U}return this.curve.jpoint(a,p.redMul(s),u)},"dblp");Xt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Xt.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),m=u.redSqr().redISub(f).redISub(f),p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),e=m,t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),k=this.y.redSqr(),O=k.redSqr(),T=this.x.redAdd(k).redSqr().redISub(x).redISub(O);T=T.redIAdd(T);var C=x.redAdd(x).redIAdd(x),$=C.redSqr(),I=O.redIAdd(O);I=I.redIAdd(I),I=I.redIAdd(I),e=$.redISub(T).redISub(T),t=C.redMul(T.redISub(e)).redISub(I),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");Xt.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),m=u.redSqr().redISub(f).redISub(f);e=m;var p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),k=this.y.redSqr(),O=this.x.redMul(k),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var C=O.redIAdd(O);C=C.redIAdd(C);var $=C.redAdd(C);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(k).redISub(x);var I=k.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I),t=T.redMul(C.redISub(e)).redISub(I)}return this.curve.jpoint(e,t,n)},"_threeDbl");Xt.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),m=t.redAdd(t);m=m.redIAdd(m);var p=m.redMul(f),x=u.redSqr().redISub(p.redAdd(p)),k=p.redISub(x),O=f.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=u.redMul(k).redISub(O),C=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,C)},"_dbl");Xt.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),m=i.redIAdd(i);m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var p=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(m),x=t.redMul(p);x=x.redIAdd(x),x=x.redIAdd(x);var k=this.x.redMul(u).redISub(x);k=k.redIAdd(k),k=k.redIAdd(k);var O=this.y.redMul(p.redMul(m.redISub(p)).redISub(f.redMul(u)));O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(k,O,T)},"trpl");Xt.prototype.mul=o(function(e,t){return e=new Ot(e,t),this.curve._wnafMul(this,e)},"mul");Xt.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Xt.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");Xt.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");Xt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var O1=me((lN,I1)=>{"use strict";var Xs=Wn(),D1=pf(),eu=hf(),B_=Or();function Zs(r){eu.call(this,"mont",r),this.a=new Xs(r.a,16).toRed(this.red),this.b=new Xs(r.b,16).toRed(this.red),this.i4=new Xs(4).toRed(this.red).redInvm(),this.two=new Xs(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Zs,"MontCurve");D1(Zs,eu);I1.exports=Zs;Zs.prototype.validate=o(function(e){var t=e.normalize().x,n=t.redSqr(),i=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t),s=i.redSqrt();return s.redSqr().cmp(i)===0},"validate");function zt(r,e,t){eu.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Xs(e,16),this.z=new Xs(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(zt,"Point");D1(zt,eu.BasePoint);Zs.prototype.decodePoint=o(function(e,t){return this.point(B_.toArray(e,t),1)},"decodePoint");Zs.prototype.point=o(function(e,t){return new zt(this,e,t)},"point");Zs.prototype.pointFromJSON=o(function(e){return zt.fromJSON(this,e)},"pointFromJSON");zt.prototype.precompute=o(function(){},"precompute");zt.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");zt.fromJSON=o(function(e,t){return new zt(e,t[0],t[1]||e.one)},"fromJSON");zt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");zt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");zt.prototype.dbl=o(function(){var e=this.x.redAdd(this.z),t=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=t.redSub(i),a=t.redMul(i),f=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,f)},"dbl");zt.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");zt.prototype.diffAdd=o(function(e,t){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),f=a.redMul(n),u=s.redMul(i),m=t.z.redMul(f.redAdd(u).redSqr()),p=t.x.redMul(f.redISub(u).redSqr());return this.curve.point(m,p)},"diffAdd");zt.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var f=a.length-1;f>=0;f--)a[f]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");zt.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");zt.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");zt.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");zt.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");zt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var R1=me((dN,N1)=>{"use strict";var U_=Or(),gi=Wn(),P1=pf(),tu=hf(),F_=U_.assert;function Gn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,tu.call(this,"edwards",r),this.a=new gi(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new gi(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new gi(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),F_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(Gn,"EdwardsCurve");P1(Gn,tu);N1.exports=Gn;Gn.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");Gn.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");Gn.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");Gn.prototype.pointFromX=o(function(e,t){e=new gi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(s.redInvm()),f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var u=f.fromRed().isOdd();return(t&&!u||!t&&u)&&(f=f.redNeg()),this.point(e,f)},"pointFromX");Gn.prototype.pointFromY=o(function(e,t){e=new gi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return f.fromRed().isOdd()!==t&&(f=f.redNeg()),this.point(f,e)},"pointFromY");Gn.prototype.validate=o(function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),i=t.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return i.cmp(s)===0},"validate");function Mt(r,e,t,n,i){tu.BasePoint.call(this,r,"projective"),e===null&&t===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new gi(e,16),this.y=new gi(t,16),this.z=n?new gi(n,16):this.curve.one,this.t=i&&new gi(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(Mt,"Point");P1(Mt,tu.BasePoint);Gn.prototype.pointFromJSON=o(function(e){return Mt.fromJSON(this,e)},"pointFromJSON");Gn.prototype.point=o(function(e,t,n,i){return new Mt(this,e,t,n,i)},"point");Mt.fromJSON=o(function(e,t){return new Mt(e,t[0],t[1],t[2])},"fromJSON");Mt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");Mt.prototype.isInfinity=o(function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},"isInfinity");Mt.prototype._extDbl=o(function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),f=a.redSub(n),u=i.redSub(t),m=s.redMul(f),p=a.redMul(u),x=s.redMul(u),k=f.redMul(a);return this.curve.point(m,p,k,x)},"_extDbl");Mt.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,a,f,u,m;if(this.curve.twisted){f=this.curve._mulA(t);var p=f.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(p.redSub(this.curve.two)),s=p.redMul(f.redSub(n)),a=p.redSqr().redSub(p).redSub(p)):(u=this.z.redSqr(),m=p.redSub(u).redISub(u),i=e.redSub(t).redISub(n).redMul(m),s=p.redMul(f.redSub(n)),a=p.redMul(m))}else f=t.redAdd(n),u=this.curve._mulC(this.z).redSqr(),m=f.redSub(u).redSub(u),i=this.curve._mulC(e.redISub(f)).redMul(m),s=this.curve._mulC(f).redMul(t.redISub(n)),a=f.redMul(m);return this.curve.point(i,s,a)},"_projDbl");Mt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");Mt.prototype._extAdd=o(function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(t),f=s.redSub(i),u=s.redAdd(i),m=n.redAdd(t),p=a.redMul(f),x=u.redMul(m),k=a.redMul(m),O=f.redMul(u);return this.curve.point(p,x,O,k)},"_extAdd");Mt.prototype._projAdd=o(function(e){var t=this.z.redMul(e.z),n=t.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(s),f=n.redSub(a),u=n.redAdd(a),m=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),p=t.redMul(f).redMul(m),x,k;return this.curve.twisted?(x=t.redMul(u).redMul(s.redSub(this.curve._mulA(i))),k=f.redMul(u)):(x=t.redMul(u).redMul(s.redSub(i)),k=this.curve._mulC(f).redMul(u)),this.curve.point(p,x,k)},"_projAdd");Mt.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");Mt.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");Mt.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");Mt.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");Mt.prototype.normalize=o(function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},"normalize");Mt.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");Mt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");Mt.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");Mt.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");Mt.prototype.eqXToP=o(function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),this.x.cmp(t)===0)return!0}},"eqXToP");Mt.prototype.toP=Mt.prototype.normalize;Mt.prototype.mixedAdd=Mt.prototype.add});var ch=me(L1=>{"use strict";var ru=L1;ru.base=hf();ru.short=C1();ru.mont=O1();ru.edwards=R1()});var wn=me(wt=>{"use strict";var $_=Ji(),q_=pf();wt.inherits=q_;function H_(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(H_,"isSurrogatePair");function j_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),i=0;i<r.length;i+=2)t.push(parseInt(r[i]+r[i+1],16))}else for(var n=0,i=0;i<r.length;i++){var s=r.charCodeAt(i);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):H_(r,i)?(s=65536+((s&1023)<<10)+(r.charCodeAt(++i)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}else for(i=0;i<r.length;i++)t[i]=r[i]|0;return t}o(j_,"toArray");wt.toArray=j_;function z_(r){for(var e="",t=0;t<r.length;t++)e+=U1(r[t].toString(16));return e}o(z_,"toHex");wt.toHex=z_;function B1(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(B1,"htonl");wt.htonl=B1;function K_(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=B1(i)),t+=F1(i.toString(16))}return t}o(K_,"toHex32");wt.toHex32=K_;function U1(r){return r.length===1?"0"+r:r}o(U1,"zero2");wt.zero2=U1;function F1(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}o(F1,"zero8");wt.zero8=F1;function V_(r,e,t,n){var i=t-e;$_(i%4===0);for(var s=new Array(i/4),a=0,f=e;a<s.length;a++,f+=4){var u;n==="big"?u=r[f]<<24|r[f+1]<<16|r[f+2]<<8|r[f+3]:u=r[f+3]<<24|r[f+2]<<16|r[f+1]<<8|r[f],s[a]=u>>>0}return s}o(V_,"join32");wt.join32=V_;function W_(r,e){for(var t=new Array(r.length*4),n=0,i=0;n<r.length;n++,i+=4){var s=r[n];e==="big"?(t[i]=s>>>24,t[i+1]=s>>>16&255,t[i+2]=s>>>8&255,t[i+3]=s&255):(t[i+3]=s>>>24,t[i+2]=s>>>16&255,t[i+1]=s>>>8&255,t[i]=s&255)}return t}o(W_,"split32");wt.split32=W_;function G_(r,e){return r>>>e|r<<32-e}o(G_,"rotr32");wt.rotr32=G_;function Y_(r,e){return r<<e|r>>>32-e}o(Y_,"rotl32");wt.rotl32=Y_;function J_(r,e){return r+e>>>0}o(J_,"sum32");wt.sum32=J_;function X_(r,e,t){return r+e+t>>>0}o(X_,"sum32_3");wt.sum32_3=X_;function Z_(r,e,t,n){return r+e+t+n>>>0}o(Z_,"sum32_4");wt.sum32_4=Z_;function Q_(r,e,t,n,i){return r+e+t+n+i>>>0}o(Q_,"sum32_5");wt.sum32_5=Q_;function e9(r,e,t,n){var i=r[e],s=r[e+1],a=n+s>>>0,f=(a<n?1:0)+t+i;r[e]=f>>>0,r[e+1]=a}o(e9,"sum64");wt.sum64=e9;function t9(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(t9,"sum64_hi");wt.sum64_hi=t9;function r9(r,e,t,n){var i=e+n;return i>>>0}o(r9,"sum64_lo");wt.sum64_lo=r9;function n9(r,e,t,n,i,s,a,f){var u=0,m=e;m=m+n>>>0,u+=m<e?1:0,m=m+s>>>0,u+=m<s?1:0,m=m+f>>>0,u+=m<f?1:0;var p=r+t+i+a+u;return p>>>0}o(n9,"sum64_4_hi");wt.sum64_4_hi=n9;function i9(r,e,t,n,i,s,a,f){var u=e+n+s+f;return u>>>0}o(i9,"sum64_4_lo");wt.sum64_4_lo=i9;function o9(r,e,t,n,i,s,a,f,u,m){var p=0,x=e;x=x+n>>>0,p+=x<e?1:0,x=x+s>>>0,p+=x<s?1:0,x=x+f>>>0,p+=x<f?1:0,x=x+m>>>0,p+=x<m?1:0;var k=r+t+i+a+u+p;return k>>>0}o(o9,"sum64_5_hi");wt.sum64_5_hi=o9;function s9(r,e,t,n,i,s,a,f,u,m){var p=e+n+s+f+m;return p>>>0}o(s9,"sum64_5_lo");wt.sum64_5_lo=s9;function a9(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(a9,"rotr64_hi");wt.rotr64_hi=a9;function f9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(f9,"rotr64_lo");wt.rotr64_lo=f9;function c9(r,e,t){return r>>>t}o(c9,"shr64_hi");wt.shr64_hi=c9;function u9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(u9,"shr64_lo");wt.shr64_lo=u9});var Qs=me(q1=>{"use strict";var $1=wn(),l9=Ji();function nu(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}o(nu,"BlockHash");q1.BlockHash=nu;nu.prototype.update=o(function(e,t){if(e=$1.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=$1.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},"update");nu.prototype.digest=o(function(e){return this.update(this._pad()),l9(this.pending===null),this._digest(e)},"digest");nu.prototype._pad=o(function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,a=8;a<this.padLength;a++)i[s++]=0;return i},"pad")});var uh=me(vi=>{"use strict";var d9=wn(),Yn=d9.rotr32;function h9(r,e,t,n){if(r===0)return H1(e,t,n);if(r===1||r===3)return z1(e,t,n);if(r===2)return j1(e,t,n)}o(h9,"ft_1");vi.ft_1=h9;function H1(r,e,t){return r&e^~r&t}o(H1,"ch32");vi.ch32=H1;function j1(r,e,t){return r&e^r&t^e&t}o(j1,"maj32");vi.maj32=j1;function z1(r,e,t){return r^e^t}o(z1,"p32");vi.p32=z1;function p9(r){return Yn(r,2)^Yn(r,13)^Yn(r,22)}o(p9,"s0_256");vi.s0_256=p9;function m9(r){return Yn(r,6)^Yn(r,11)^Yn(r,25)}o(m9,"s1_256");vi.s1_256=m9;function b9(r){return Yn(r,7)^Yn(r,18)^r>>>3}o(b9,"g0_256");vi.g0_256=b9;function g9(r){return Yn(r,17)^Yn(r,19)^r>>>10}o(g9,"g1_256");vi.g1_256=g9});var W1=me((gN,V1)=>{"use strict";var ea=wn(),v9=Qs(),y9=uh(),lh=ea.rotl32,mf=ea.sum32,x9=ea.sum32_5,w9=y9.ft_1,K1=v9.BlockHash,_9=[1518500249,1859775393,2400959708,3395469782];function Jn(){if(!(this instanceof Jn))return new Jn;K1.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(Jn,"SHA1");ea.inherits(Jn,K1);V1.exports=Jn;Jn.blockSize=512;Jn.outSize=160;Jn.hmacStrength=80;Jn.padLength=64;Jn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=lh(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],m=this.h[4];for(i=0;i<n.length;i++){var p=~~(i/20),x=x9(lh(s,5),w9(p,a,f,u),m,n[i],_9[p]);m=u,u=f,f=lh(a,30),a=s,s=x}this.h[0]=mf(this.h[0],s),this.h[1]=mf(this.h[1],a),this.h[2]=mf(this.h[2],f),this.h[3]=mf(this.h[3],u),this.h[4]=mf(this.h[4],m)},"_update");Jn.prototype._digest=o(function(e){return e==="hex"?ea.toHex32(this.h,"big"):ea.split32(this.h,"big")},"digest")});var dh=me((vN,Y1)=>{"use strict";var ta=wn(),E9=Qs(),ra=uh(),S9=Ji(),_n=ta.sum32,M9=ta.sum32_4,A9=ta.sum32_5,T9=ra.ch32,k9=ra.maj32,C9=ra.s0_256,D9=ra.s1_256,I9=ra.g0_256,O9=ra.g1_256,G1=E9.BlockHash,P9=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Xn(){if(!(this instanceof Xn))return new Xn;G1.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=P9,this.W=new Array(64)}o(Xn,"SHA256");ta.inherits(Xn,G1);Y1.exports=Xn;Xn.blockSize=512;Xn.outSize=256;Xn.hmacStrength=192;Xn.padLength=64;Xn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=M9(O9(n[i-2]),n[i-7],I9(n[i-15]),n[i-16]);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],m=this.h[4],p=this.h[5],x=this.h[6],k=this.h[7];for(S9(this.k.length===n.length),i=0;i<n.length;i++){var O=A9(k,D9(m),T9(m,p,x),this.k[i],n[i]),T=_n(C9(s),k9(s,a,f));k=x,x=p,p=m,m=_n(u,O),u=f,f=a,a=s,s=_n(O,T)}this.h[0]=_n(this.h[0],s),this.h[1]=_n(this.h[1],a),this.h[2]=_n(this.h[2],f),this.h[3]=_n(this.h[3],u),this.h[4]=_n(this.h[4],m),this.h[5]=_n(this.h[5],p),this.h[6]=_n(this.h[6],x),this.h[7]=_n(this.h[7],k)},"_update");Xn.prototype._digest=o(function(e){return e==="hex"?ta.toHex32(this.h,"big"):ta.split32(this.h,"big")},"digest")});var Z1=me((yN,X1)=>{"use strict";var hh=wn(),J1=dh();function yi(){if(!(this instanceof yi))return new yi;J1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(yi,"SHA224");hh.inherits(yi,J1);X1.exports=yi;yi.blockSize=512;yi.outSize=224;yi.hmacStrength=192;yi.padLength=64;yi.prototype._digest=o(function(e){return e==="hex"?hh.toHex32(this.h.slice(0,7),"big"):hh.split32(this.h.slice(0,7),"big")},"digest")});var bh=me((xN,rb)=>{"use strict";var _r=wn(),N9=Qs(),R9=Ji(),Zn=_r.rotr64_hi,Qn=_r.rotr64_lo,Q1=_r.shr64_hi,eb=_r.shr64_lo,Qi=_r.sum64,ph=_r.sum64_hi,mh=_r.sum64_lo,L9=_r.sum64_4_hi,B9=_r.sum64_4_lo,U9=_r.sum64_5_hi,F9=_r.sum64_5_lo,tb=N9.BlockHash,$9=[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 En(){if(!(this instanceof En))return new En;tb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=$9,this.W=new Array(160)}o(En,"SHA512");_r.inherits(En,tb);rb.exports=En;En.blockSize=1024;En.outSize=512;En.hmacStrength=192;En.padLength=128;En.prototype._prepareBlock=o(function(e,t){for(var n=this.W,i=0;i<32;i++)n[i]=e[t+i];for(;i<n.length;i+=2){var s=X9(n[i-4],n[i-3]),a=Z9(n[i-4],n[i-3]),f=n[i-14],u=n[i-13],m=Y9(n[i-30],n[i-29]),p=J9(n[i-30],n[i-29]),x=n[i-32],k=n[i-31];n[i]=L9(s,a,f,u,m,p,x,k),n[i+1]=B9(s,a,f,u,m,p,x,k)}},"_prepareBlock");En.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],a=this.h[2],f=this.h[3],u=this.h[4],m=this.h[5],p=this.h[6],x=this.h[7],k=this.h[8],O=this.h[9],T=this.h[10],C=this.h[11],$=this.h[12],I=this.h[13],U=this.h[14],z=this.h[15];R9(this.k.length===n.length);for(var H=0;H<n.length;H+=2){var X=U,B=z,L=W9(k,O),F=G9(k,O),re=q9(k,O,T,C,$,I),E=H9(k,O,T,C,$,I),l=this.k[H],g=this.k[H+1],h=n[H],c=n[H+1],d=U9(X,B,L,F,re,E,l,g,h,c),y=F9(X,B,L,F,re,E,l,g,h,c);X=K9(i,s),B=V9(i,s),L=j9(i,s,a,f,u,m),F=z9(i,s,a,f,u,m);var _=ph(X,B,L,F),w=mh(X,B,L,F);U=$,z=I,$=T,I=C,T=k,C=O,k=ph(p,x,d,y),O=mh(x,x,d,y),p=u,x=m,u=a,m=f,a=i,f=s,i=ph(d,y,_,w),s=mh(d,y,_,w)}Qi(this.h,0,i,s),Qi(this.h,2,a,f),Qi(this.h,4,u,m),Qi(this.h,6,p,x),Qi(this.h,8,k,O),Qi(this.h,10,T,C),Qi(this.h,12,$,I),Qi(this.h,14,U,z)},"_update");En.prototype._digest=o(function(e){return e==="hex"?_r.toHex32(this.h,"big"):_r.split32(this.h,"big")},"digest");function q9(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(q9,"ch64_hi");function H9(r,e,t,n,i,s){var a=e&n^~e&s;return a<0&&(a+=4294967296),a}o(H9,"ch64_lo");function j9(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(j9,"maj64_hi");function z9(r,e,t,n,i,s){var a=e&n^e&s^n&s;return a<0&&(a+=4294967296),a}o(z9,"maj64_lo");function K9(r,e){var t=Zn(r,e,28),n=Zn(e,r,2),i=Zn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(K9,"s0_512_hi");function V9(r,e){var t=Qn(r,e,28),n=Qn(e,r,2),i=Qn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(V9,"s0_512_lo");function W9(r,e){var t=Zn(r,e,14),n=Zn(r,e,18),i=Zn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(W9,"s1_512_hi");function G9(r,e){var t=Qn(r,e,14),n=Qn(r,e,18),i=Qn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(G9,"s1_512_lo");function Y9(r,e){var t=Zn(r,e,1),n=Zn(r,e,8),i=Q1(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(Y9,"g0_512_hi");function J9(r,e){var t=Qn(r,e,1),n=Qn(r,e,8),i=eb(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(J9,"g0_512_lo");function X9(r,e){var t=Zn(r,e,19),n=Zn(e,r,29),i=Q1(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(X9,"g1_512_hi");function Z9(r,e){var t=Qn(r,e,19),n=Qn(e,r,29),i=eb(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(Z9,"g1_512_lo")});var ob=me((wN,ib)=>{"use strict";var gh=wn(),nb=bh();function xi(){if(!(this instanceof xi))return new xi;nb.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(xi,"SHA384");gh.inherits(xi,nb);ib.exports=xi;xi.blockSize=1024;xi.outSize=384;xi.hmacStrength=192;xi.padLength=128;xi.prototype._digest=o(function(e){return e==="hex"?gh.toHex32(this.h.slice(0,12),"big"):gh.split32(this.h.slice(0,12),"big")},"digest")});var sb=me(na=>{"use strict";na.sha1=W1();na.sha224=Z1();na.sha256=dh();na.sha384=ob();na.sha512=bh()});var db=me(lb=>{"use strict";var Wo=wn(),Q9=Qs(),iu=Wo.rotl32,ab=Wo.sum32,bf=Wo.sum32_3,fb=Wo.sum32_4,ub=Q9.BlockHash;function ei(){if(!(this instanceof ei))return new ei;ub.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(ei,"RIPEMD160");Wo.inherits(ei,ub);lb.ripemd160=ei;ei.blockSize=512;ei.outSize=160;ei.hmacStrength=192;ei.padLength=64;ei.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],u=n,m=i,p=s,x=a,k=f,O=0;O<80;O++){var T=ab(iu(fb(n,cb(O,i,s,a),e[rE[O]+t],eE(O)),iE[O]),f);n=f,f=a,a=iu(s,10),s=i,i=T,T=ab(iu(fb(u,cb(79-O,m,p,x),e[nE[O]+t],tE(O)),oE[O]),k),u=k,k=x,x=iu(p,10),p=m,m=T}T=bf(this.h[1],s,x),this.h[1]=bf(this.h[2],a,k),this.h[2]=bf(this.h[3],f,u),this.h[3]=bf(this.h[4],n,m),this.h[4]=bf(this.h[0],i,p),this.h[0]=T},"update");ei.prototype._digest=o(function(e){return e==="hex"?Wo.toHex32(this.h,"little"):Wo.split32(this.h,"little")},"digest");function cb(r,e,t,n){return r<=15?e^t^n:r<=31?e&t|~e&n:r<=47?(e|~t)^n:r<=63?e&n|t&~n:e^(t|~n)}o(cb,"f");function eE(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(eE,"K");function tE(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(tE,"Kh");var rE=[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],nE=[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],iE=[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],oE=[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]});var pb=me((SN,hb)=>{"use strict";var sE=wn(),aE=Ji();function ia(r,e,t){if(!(this instanceof ia))return new ia(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(sE.toArray(e,t))}o(ia,"Hmac");hb.exports=ia;ia.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),aE(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},"init");ia.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");ia.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var gf=me(mb=>{var Zt=mb;Zt.utils=wn();Zt.common=Qs();Zt.sha=sb();Zt.ripemd=db();Zt.hmac=pb();Zt.sha1=Zt.sha.sha1;Zt.sha256=Zt.sha.sha256;Zt.sha224=Zt.sha.sha224;Zt.sha384=Zt.sha.sha384;Zt.sha512=Zt.sha.sha512;Zt.ripemd160=Zt.ripemd.ripemd160});var gb=me((AN,bb)=>{bb.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var ou=me(xb=>{"use strict";var yh=xb,eo=gf(),vh=ch(),fE=Or(),vb=fE.assert;function yb(r){r.type==="short"?this.curve=new vh.short(r):r.type==="edwards"?this.curve=new vh.edwards(r):this.curve=new vh.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,vb(this.g.validate(),"Invalid curve"),vb(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(yb,"PresetCurve");yh.PresetCurve=yb;function to(r,e){Object.defineProperty(yh,r,{configurable:!0,enumerable:!0,get:function(){var t=new yb(e);return Object.defineProperty(yh,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(to,"defineCurve");to("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:eo.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});to("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:eo.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});to("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:eo.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});to("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:eo.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});to("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:eo.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});to("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:eo.sha256,gRed:!1,g:["9"]});to("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:eo.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var xh;try{xh=gb()}catch(r){xh=void 0}to("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:eo.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",xh]})});var Eb=me((kN,_b)=>{"use strict";var cE=gf(),Go=rh(),wb=Ji();function ro(r){if(!(this instanceof ro))return new ro(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Go.toArray(r.entropy,r.entropyEnc||"hex"),t=Go.toArray(r.nonce,r.nonceEnc||"hex"),n=Go.toArray(r.pers,r.persEnc||"hex");wb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ro,"HmacDRBG");_b.exports=ro;ro.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");ro.prototype._hmac=o(function(){return new cE.hmac(this.hash,this.K)},"hmac");ro.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");ro.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Go.toArray(e,t),n=Go.toArray(n,i),wb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");ro.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Go.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Go.encode(a,t)},"generate")});var Mb=me((CN,Sb)=>{"use strict";var uE=Wn(),lE=Or(),wh=lE.assert;function sr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(sr,"KeyPair");Sb.exports=sr;sr.fromPublic=o(function(e,t,n){return t instanceof sr?t:new sr(e,{pub:t,pubEnc:n})},"fromPublic");sr.fromPrivate=o(function(e,t,n){return t instanceof sr?t:new sr(e,{priv:t,privEnc:n})},"fromPrivate");sr.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");sr.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");sr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");sr.prototype._importPrivate=o(function(e,t){this.priv=new uE(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");sr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?wh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&wh(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");sr.prototype.derive=o(function(e){return e.validate()||wh(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");sr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");sr.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");sr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var kb=me((DN,Tb)=>{"use strict";var su=Wn(),Sh=Or(),dE=Sh.assert;function au(r,e){if(r instanceof au)return r;this._importDER(r,e)||(dE(r.r&&r.s,"Signature without r or s"),this.r=new su(r.r,16),this.s=new su(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(au,"Signature");Tb.exports=au;function hE(){this.place=0}o(hE,"Position");function _h(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(_h,"getLength");function Ab(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(Ab,"rmPadding");au.prototype._importDER=o(function(e,t){e=Sh.toArray(e,t);var n=new hE;if(e[n.place++]!==48)return!1;var i=_h(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=_h(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=_h(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new su(a),this.s=new su(u),this.recoveryParam=null,!0},"_importDER");function Eh(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(Eh,"constructLength");au.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=Ab(t),n=Ab(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Eh(i,t.length),i=i.concat(t),i.push(2),Eh(i,n.length);var s=i.concat(n),a=[48];return Eh(a,s.length),a=a.concat(s),Sh.encode(a,e)},"toDER")});var Ob=me((IN,Ib)=>{"use strict";var Yo=Wn(),Cb=Eb(),pE=Or(),Mh=ou(),mE=sh(),Db=pE.assert,Ah=Mb(),fu=kb();function on(r){if(!(this instanceof on))return new on(r);typeof r=="string"&&(Db(Object.prototype.hasOwnProperty.call(Mh,r),"Unknown curve "+r),r=Mh[r]),r instanceof Mh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(on,"EC");Ib.exports=on;on.prototype.keyPair=o(function(e){return new Ah(this,e)},"keyPair");on.prototype.keyFromPrivate=o(function(e,t){return Ah.fromPrivate(this,e,t)},"keyFromPrivate");on.prototype.keyFromPublic=o(function(e,t){return Ah.fromPublic(this,e,t)},"keyFromPublic");on.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Cb({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||mE(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Yo(2));;){var s=new Yo(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");on.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");on.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Yo(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new Cb({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),m=this.n.sub(new Yo(1)),p=0;;p++){var x=i.k?i.k(p):new Yo(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(m)>=0)){var k=this.g.mul(x);if(!k.isInfinity()){var O=k.getX(),T=O.umod(this.n);if(T.cmpn(0)!==0){var C=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(C=C.umod(this.n),C.cmpn(0)!==0){var $=(k.getY().isOdd()?1:0)|(O.cmp(T)!==0?2:0);return i.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),$^=1),new fu({r:T,s:C,recoveryParam:$})}}}}}},"sign");on.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Yo(e,16)),n=this.keyFromPublic(n,i),t=new fu(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),m=f.mul(s).umod(this.n),p;return this.curve._maxwellTrick?(p=this.g.jmulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.eqXToP(s)):(p=this.g.mulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.getX().umod(this.n).cmp(s)===0)},"verify");on.prototype.recoverPubKey=function(r,e,t,n){Db((3&t)===t,"The recovery param is more than two bits"),e=new fu(e,n);var i=this.n,s=new Yo(r),a=e.r,f=e.s,u=t&1,m=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");m?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var p=e.r.invm(i),x=i.sub(s).mul(p).umod(i),k=f.mul(p).umod(i);return this.g.mulAdd(x,a,k)};on.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new fu(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var Lb=me((ON,Rb)=>{"use strict";var vf=Or(),Nb=vf.assert,Pb=vf.parseBytes,oa=vf.cachedProperty;function Kt(r,e){this.eddsa=r,this._secret=Pb(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Pb(e.pub)}o(Kt,"KeyPair");Kt.fromPublic=o(function(e,t){return t instanceof Kt?t:new Kt(e,{pub:t})},"fromPublic");Kt.fromSecret=o(function(e,t){return t instanceof Kt?t:new Kt(e,{secret:t})},"fromSecret");Kt.prototype.secret=o(function(){return this._secret},"secret");oa(Kt,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));oa(Kt,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));oa(Kt,"privBytes",o(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i},"privBytes"));oa(Kt,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));oa(Kt,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));oa(Kt,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Kt.prototype.sign=o(function(e){return Nb(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Kt.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Kt.prototype.getSecret=o(function(e){return Nb(this._secret,"KeyPair is public only"),vf.encode(this.secret(),e)},"getSecret");Kt.prototype.getPublic=o(function(e){return vf.encode(this.pubBytes(),e)},"getPublic");Rb.exports=Kt});var Ub=me((PN,Bb)=>{"use strict";var bE=Wn(),cu=Or(),gE=cu.assert,uu=cu.cachedProperty,vE=cu.parseBytes;function Jo(r,e){this.eddsa=r,typeof e!="object"&&(e=vE(e)),Array.isArray(e)&&(e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),gE(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof bE&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(Jo,"Signature");uu(Jo,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));uu(Jo,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));uu(Jo,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));uu(Jo,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Jo.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Jo.prototype.toHex=o(function(){return cu.encode(this.toBytes(),"hex").toUpperCase()},"toHex");Bb.exports=Jo});var jb=me((NN,Hb)=>{"use strict";var yE=gf(),xE=ou(),sa=Or(),wE=sa.assert,$b=sa.parseBytes,qb=Lb(),Fb=Ub();function Er(r){if(wE(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Er))return new Er(r);r=xE[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=yE.sha512}o(Er,"EDDSA");Hb.exports=Er;Er.prototype.sign=o(function(e,t){e=$b(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),a=this.encodePoint(s),f=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),u=i.add(f).umod(this.curve.n);return this.makeSignature({R:s,S:u,Rencoded:a})},"sign");Er.prototype.verify=o(function(e,t,n){e=$b(e),t=this.makeSignature(t);var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S()),f=t.R().add(i.pub().mul(s));return f.eq(a)},"verify");Er.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return sa.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");Er.prototype.keyFromPublic=o(function(e){return qb.fromPublic(this,e)},"keyFromPublic");Er.prototype.keyFromSecret=o(function(e){return qb.fromSecret(this,e)},"keyFromSecret");Er.prototype.makeSignature=o(function(e){return e instanceof Fb?e:new Fb(this,e)},"makeSignature");Er.prototype.encodePoint=o(function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},"encodePoint");Er.prototype.decodePoint=o(function(e){e=sa.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=sa.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");Er.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");Er.prototype.decodeInt=o(function(e){return sa.intFromLE(e)},"decodeInt");Er.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var Kb=me(zb=>{"use strict";var Xo=zb;Xo.version=y1().version;Xo.utils=Or();Xo.rand=sh();Xo.curve=ch();Xo.curves=ou();Xo.ec=Ob();Xo.eddsa=jb()});var Wb=me(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var Vb=65536,_E=function(){function r(){this.isAvailable=!1,this.isInstantiated=!1;var e=typeof self!="undefined"?self.crypto||self.msCrypto:null;e&&e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}return o(r,"BrowserRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),n=0;n<t.length;n+=Vb)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,Vb)));return t},r}();Th.BrowserRandomSource=_E});var Gb=me(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});var EE=tn(),SE=function(){function r(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require!="undefined"){var e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}return o(r,"NodeRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");var t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");for(var n=new Uint8Array(e),i=0;i<n.length;i++)n[i]=t[i];return EE.wipe(t),n},r}();kh.NodeRandomSource=SE});var Yb=me(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var ME=Wb(),AE=Gb(),TE=function(){function r(){if(this.isAvailable=!1,this.name="",this._source=new ME.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new AE.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}return o(r,"SystemRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)},r}();Ch.SystemRandomSource=TE});var no=me(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var kE=Yb(),CE=Ko(),Jb=tn();Sn.defaultRandomSource=new kE.SystemRandomSource;function Dh(r,e){return e===void 0&&(e=Sn.defaultRandomSource),e.randomBytes(r)}o(Dh,"randomBytes");Sn.randomBytes=Dh;function DE(r){r===void 0&&(r=Sn.defaultRandomSource);var e=Dh(4,r),t=CE.readUint32LE(e);return Jb.wipe(e),t}o(DE,"randomUint32");Sn.randomUint32=DE;var Xb="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Zb(r,e,t){if(e===void 0&&(e=Xb),t===void 0&&(t=Sn.defaultRandomSource),e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");for(var n="",i=e.length,s=256-256%i;r>0;){for(var a=Dh(Math.ceil(r*256/s),t),f=0;f<a.length&&r>0;f++){var u=a[f];u<s&&(n+=e.charAt(u%i),r--)}Jb.wipe(a)}return n}o(Zb,"randomString");Sn.randomString=Zb;function IE(r,e,t){e===void 0&&(e=Xb),t===void 0&&(t=Sn.defaultRandomSource);var n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return Zb(n,e,t)}o(IE,"randomStringForEntropy");Sn.randomStringForEntropy=IE});var tg=me(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});var fa=Ko(),aa=tn();wi.DIGEST_LENGTH=64;wi.BLOCK_SIZE=128;var eg=function(){function r(){this.digestLength=wi.DIGEST_LENGTH,this.blockSize=wi.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA512"),r.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){aa.wipe(this._buffer),aa.wipe(this._tempHi),aa.wipe(this._tempLo),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<wi.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Ih(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Ih(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%128<112?128:256;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;fa.writeUint32BE(i,this._buffer,a-8),fa.writeUint32BE(s,this._buffer,a-4),Ih(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/8;f++)fa.writeUint32BE(this._stateHi[f],e,f*8),fa.writeUint32BE(this._stateLo[f],e,f*8+4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){aa.wipe(e.stateHi),aa.wipe(e.stateLo),e.buffer&&aa.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();wi.SHA512=eg;var Qb=new Int32Array([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 Ih(r,e,t,n,i,s,a){for(var f=t[0],u=t[1],m=t[2],p=t[3],x=t[4],k=t[5],O=t[6],T=t[7],C=n[0],$=n[1],I=n[2],U=n[3],z=n[4],H=n[5],X=n[6],B=n[7],L,F,re,E,l,g,h,c;a>=128;){for(var d=0;d<16;d++){var y=8*d+s;r[d]=fa.readUint32BE(i,y),e[d]=fa.readUint32BE(i,y+4)}for(var d=0;d<80;d++){var _=f,w=u,b=m,S=p,D=x,v=k,M=O,ne=T,A=C,K=$,J=I,N=U,R=z,V=H,W=X,ee=B;if(L=T,F=B,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=(x>>>14|z<<32-14)^(x>>>18|z<<32-18)^(z>>>41-32|x<<32-(41-32)),F=(z>>>14|x<<32-14)^(z>>>18|x<<32-18)^(x>>>41-32|z<<32-(41-32)),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=x&k^~x&O,F=z&H^~z&X,l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=Qb[d*2],F=Qb[d*2+1],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=r[d%16],F=e[d%16],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,re=h&65535|c<<16,E=l&65535|g<<16,L=re,F=E,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=(f>>>28|C<<32-28)^(C>>>34-32|f<<32-(34-32))^(C>>>39-32|f<<32-(39-32)),F=(C>>>28|f<<32-28)^(f>>>34-32|C<<32-(34-32))^(f>>>39-32|C<<32-(39-32)),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=f&u^f&m^u&m,F=C&$^C&I^$&I,l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,ne=h&65535|c<<16,ee=l&65535|g<<16,L=S,F=N,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=re,F=E,l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,S=h&65535|c<<16,N=l&65535|g<<16,u=_,m=w,p=b,x=S,k=D,O=v,T=M,f=ne,$=A,I=K,U=J,z=N,H=R,X=V,B=W,C=ee,d%16===15)for(var y=0;y<16;y++)L=r[y],F=e[y],l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=r[(y+9)%16],F=e[(y+9)%16],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,re=r[(y+1)%16],E=e[(y+1)%16],L=(re>>>1|E<<32-1)^(re>>>8|E<<32-8)^re>>>7,F=(E>>>1|re<<32-1)^(E>>>8|re<<32-8)^(E>>>7|re<<32-7),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,re=r[(y+14)%16],E=e[(y+14)%16],L=(re>>>19|E<<32-19)^(E>>>61-32|re<<32-(61-32))^re>>>6,F=(E>>>19|re<<32-19)^(re>>>61-32|E<<32-(61-32))^(E>>>6|re<<32-6),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,r[y]=h&65535|c<<16,e[y]=l&65535|g<<16}L=f,F=C,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[0],F=n[0],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[0]=f=h&65535|c<<16,n[0]=C=l&65535|g<<16,L=u,F=$,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[1],F=n[1],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[1]=u=h&65535|c<<16,n[1]=$=l&65535|g<<16,L=m,F=I,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[2],F=n[2],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[2]=m=h&65535|c<<16,n[2]=I=l&65535|g<<16,L=p,F=U,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[3],F=n[3],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[3]=p=h&65535|c<<16,n[3]=U=l&65535|g<<16,L=x,F=z,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[4],F=n[4],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[4]=x=h&65535|c<<16,n[4]=z=l&65535|g<<16,L=k,F=H,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[5],F=n[5],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[5]=k=h&65535|c<<16,n[5]=H=l&65535|g<<16,L=O,F=X,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[6],F=n[6],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[6]=O=h&65535|c<<16,n[6]=X=l&65535|g<<16,L=T,F=B,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[7],F=n[7],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[7]=T=h&65535|c<<16,n[7]=B=l&65535|g<<16,s+=128,a-=128}return s}o(Ih,"hashBlocks");function OE(r){var e=new eg;e.update(r);var t=e.digest();return e.clean(),t}o(OE,"hash");wi.hash=OE});var lu=me($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var PE=no(),yf=tg(),sg=tn();$t.SIGNATURE_LENGTH=64;$t.PUBLIC_KEY_LENGTH=32;$t.SECRET_KEY_LENGTH=64;$t.SEED_LENGTH=32;function Ce(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(Ce,"gf");var NE=new Uint8Array(32);NE[0]=9;var Nh=Ce(),ca=Ce([1]),RE=Ce([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),LE=Ce([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),rg=Ce([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),ng=Ce([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),BE=Ce([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function io(r,e){for(var t=0;t<16;t++)r[t]=e[t]|0}o(io,"set25519");function Oh(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Oh,"car25519");function ag(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(ag,"sel25519");function xf(r,e){for(var t=Ce(),n=Ce(),i=0;i<16;i++)n[i]=e[i];Oh(n),Oh(n),Oh(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,ag(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(xf,"pack25519");function fg(r,e){for(var t=0,n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(fg,"verify32");function ig(r,e){var t=new Uint8Array(32),n=new Uint8Array(32);return xf(t,r),xf(n,e),fg(t,n)}o(ig,"neq25519");function cg(r){var e=new Uint8Array(32);return xf(e,r),e[0]&1}o(cg,"par25519");function UE(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(UE,"unpack25519");function Zo(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(Zo,"add");function es(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(es,"sub");function vt(r,e,t){var n,i,s=0,a=0,f=0,u=0,m=0,p=0,x=0,k=0,O=0,T=0,C=0,$=0,I=0,U=0,z=0,H=0,X=0,B=0,L=0,F=0,re=0,E=0,l=0,g=0,h=0,c=0,d=0,y=0,_=0,w=0,b=0,S=t[0],D=t[1],v=t[2],M=t[3],ne=t[4],A=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*S,a+=n*D,f+=n*v,u+=n*M,m+=n*ne,p+=n*A,x+=n*K,k+=n*J,O+=n*N,T+=n*R,C+=n*V,$+=n*W,I+=n*ee,U+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*S,f+=n*D,u+=n*v,m+=n*M,p+=n*ne,x+=n*A,k+=n*K,O+=n*J,T+=n*N,C+=n*R,$+=n*V,I+=n*W,U+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*S,u+=n*D,m+=n*v,p+=n*M,x+=n*ne,k+=n*A,O+=n*K,T+=n*J,C+=n*N,$+=n*R,I+=n*V,U+=n*W,z+=n*ee,H+=n*he,X+=n*fe,B+=n*Y,n=e[3],u+=n*S,m+=n*D,p+=n*v,x+=n*M,k+=n*ne,O+=n*A,T+=n*K,C+=n*J,$+=n*N,I+=n*R,U+=n*V,z+=n*W,H+=n*ee,X+=n*he,B+=n*fe,L+=n*Y,n=e[4],m+=n*S,p+=n*D,x+=n*v,k+=n*M,O+=n*ne,T+=n*A,C+=n*K,$+=n*J,I+=n*N,U+=n*R,z+=n*V,H+=n*W,X+=n*ee,B+=n*he,L+=n*fe,F+=n*Y,n=e[5],p+=n*S,x+=n*D,k+=n*v,O+=n*M,T+=n*ne,C+=n*A,$+=n*K,I+=n*J,U+=n*N,z+=n*R,H+=n*V,X+=n*W,B+=n*ee,L+=n*he,F+=n*fe,re+=n*Y,n=e[6],x+=n*S,k+=n*D,O+=n*v,T+=n*M,C+=n*ne,$+=n*A,I+=n*K,U+=n*J,z+=n*N,H+=n*R,X+=n*V,B+=n*W,L+=n*ee,F+=n*he,re+=n*fe,E+=n*Y,n=e[7],k+=n*S,O+=n*D,T+=n*v,C+=n*M,$+=n*ne,I+=n*A,U+=n*K,z+=n*J,H+=n*N,X+=n*R,B+=n*V,L+=n*W,F+=n*ee,re+=n*he,E+=n*fe,l+=n*Y,n=e[8],O+=n*S,T+=n*D,C+=n*v,$+=n*M,I+=n*ne,U+=n*A,z+=n*K,H+=n*J,X+=n*N,B+=n*R,L+=n*V,F+=n*W,re+=n*ee,E+=n*he,l+=n*fe,g+=n*Y,n=e[9],T+=n*S,C+=n*D,$+=n*v,I+=n*M,U+=n*ne,z+=n*A,H+=n*K,X+=n*J,B+=n*N,L+=n*R,F+=n*V,re+=n*W,E+=n*ee,l+=n*he,g+=n*fe,h+=n*Y,n=e[10],C+=n*S,$+=n*D,I+=n*v,U+=n*M,z+=n*ne,H+=n*A,X+=n*K,B+=n*J,L+=n*N,F+=n*R,re+=n*V,E+=n*W,l+=n*ee,g+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*S,I+=n*D,U+=n*v,z+=n*M,H+=n*ne,X+=n*A,B+=n*K,L+=n*J,F+=n*N,re+=n*R,E+=n*V,l+=n*W,g+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],I+=n*S,U+=n*D,z+=n*v,H+=n*M,X+=n*ne,B+=n*A,L+=n*K,F+=n*J,re+=n*N,E+=n*R,l+=n*V,g+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],U+=n*S,z+=n*D,H+=n*v,X+=n*M,B+=n*ne,L+=n*A,F+=n*K,re+=n*J,E+=n*N,l+=n*R,g+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],z+=n*S,H+=n*D,X+=n*v,B+=n*M,L+=n*ne,F+=n*A,re+=n*K,E+=n*J,l+=n*N,g+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*S,X+=n*D,B+=n*v,L+=n*M,F+=n*ne,re+=n*A,E+=n*K,l+=n*J,g+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,b+=n*Y,s+=38*X,a+=38*B,f+=38*L,u+=38*F,m+=38*re,p+=38*E,x+=38*l,k+=38*g,O+=38*h,T+=38*c,C+=38*d,$+=38*y,I+=38*_,U+=38*w,z+=38*b,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=m,r[5]=p,r[6]=x,r[7]=k,r[8]=O,r[9]=T,r[10]=C,r[11]=$,r[12]=I,r[13]=U,r[14]=z,r[15]=H}o(vt,"mul");function Qo(r,e){vt(r,e,e)}o(Qo,"square");function ug(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Qo(t,t),n!==2&&n!==4&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(ug,"inv25519");function FE(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Qo(t,t),n!==1&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(FE,"pow2523");function Rh(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce(),m=Ce(),p=Ce();es(t,r[1],r[0]),es(p,e[1],e[0]),vt(t,t,p),Zo(n,r[0],r[1]),Zo(p,e[0],e[1]),vt(n,n,p),vt(i,r[3],e[3]),vt(i,i,LE),vt(s,r[2],e[2]),Zo(s,s,s),es(a,n,t),es(f,s,i),Zo(u,s,i),Zo(m,n,t),vt(r[0],a,f),vt(r[1],m,u),vt(r[2],u,f),vt(r[3],a,m)}o(Rh,"edadd");function og(r,e,t){for(var n=0;n<4;n++)ag(r[n],e[n],t)}o(og,"cswap");function Bh(r,e){var t=Ce(),n=Ce(),i=Ce();ug(i,e[2]),vt(t,e[0],i),vt(n,e[1],i),xf(r,n),r[31]^=cg(t)<<7}o(Bh,"pack");function lg(r,e,t){io(r[0],Nh),io(r[1],ca),io(r[2],ca),io(r[3],Nh);for(var n=255;n>=0;--n){var i=t[n/8|0]>>(n&7)&1;og(r,e,i),Rh(e,r),Rh(r,r),og(r,e,i)}}o(lg,"scalarmult");function Uh(r,e){var t=[Ce(),Ce(),Ce(),Ce()];io(t[0],rg),io(t[1],ng),io(t[2],ca),vt(t[3],rg,ng),lg(r,t,e)}o(Uh,"scalarbase");function dg(r){if(r.length!==$t.SEED_LENGTH)throw new Error("ed25519: seed must be "+$t.SEED_LENGTH+" bytes");var e=yf.hash(r);e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(32),n=[Ce(),Ce(),Ce(),Ce()];Uh(n,e),Bh(t,n);var i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(dg,"generateKeyPairFromSeed");$t.generateKeyPairFromSeed=dg;function $E(r){var e=PE.randomBytes(32,r),t=dg(e);return sg.wipe(e),t}o($E,"generateKeyPair");$t.generateKeyPair=$E;function qE(r){if(r.length!==$t.SECRET_KEY_LENGTH)throw new Error("ed25519: secret key must be "+$t.SECRET_KEY_LENGTH+" bytes");return new Uint8Array(r.subarray(32))}o(qE,"extractPublicKeyFromSecretKey");$t.extractPublicKeyFromSecretKey=qE;var Ph=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 hg(r,e){var t,n,i,s;for(n=63;n>=32;--n){for(t=0,i=n-32,s=n-12;i<s;++i)e[i]+=t-16*e[n]*Ph[i-(n-32)],t=Math.floor((e[i]+128)/256),e[i]-=t*256;e[i]+=t,e[n]=0}for(t=0,i=0;i<32;i++)e[i]+=t-(e[31]>>4)*Ph[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Ph[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(hg,"modL");function Lh(r){for(var e=new Float64Array(64),t=0;t<64;t++)e[t]=r[t];for(var t=0;t<64;t++)r[t]=0;hg(r,e)}o(Lh,"reduce");function HE(r,e){var t=new Float64Array(64),n=[Ce(),Ce(),Ce(),Ce()],i=yf.hash(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;var s=new Uint8Array(64);s.set(i.subarray(32),32);var a=new yf.SHA512;a.update(s.subarray(32)),a.update(e);var f=a.digest();a.clean(),Lh(f),Uh(n,f),Bh(s,n),a.reset(),a.update(s.subarray(0,32)),a.update(r.subarray(32)),a.update(e);var u=a.digest();Lh(u);for(var m=0;m<32;m++)t[m]=f[m];for(var m=0;m<32;m++)for(var p=0;p<32;p++)t[m+p]+=u[m]*i[p];return hg(s.subarray(32),t),s}o(HE,"sign");$t.sign=HE;function pg(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce();return io(r[2],ca),UE(r[1],e),Qo(i,r[1]),vt(s,i,RE),es(i,i,r[2]),Zo(s,r[2],s),Qo(a,s),Qo(f,a),vt(u,f,a),vt(t,u,i),vt(t,t,s),FE(t,t),vt(t,t,i),vt(t,t,s),vt(t,t,s),vt(r[0],t,s),Qo(n,r[0]),vt(n,n,s),ig(n,i)&&vt(r[0],r[0],BE),Qo(n,r[0]),vt(n,n,s),ig(n,i)?-1:(cg(r[0])===e[31]>>7&&es(r[0],Nh,r[0]),vt(r[3],r[0],r[1]),0)}o(pg,"unpackneg");function jE(r,e,t){var n=new Uint8Array(32),i=[Ce(),Ce(),Ce(),Ce()],s=[Ce(),Ce(),Ce(),Ce()];if(t.length!==$t.SIGNATURE_LENGTH)throw new Error("ed25519: signature must be "+$t.SIGNATURE_LENGTH+" bytes");if(pg(s,r))return!1;var a=new yf.SHA512;a.update(t.subarray(0,32)),a.update(r),a.update(e);var f=a.digest();return Lh(f),lg(i,s,f),Uh(s,t.subarray(32)),Rh(i,s),Bh(n,i),!fg(t,n)}o(jE,"verify");$t.verify=jE;function zE(r){var e=[Ce(),Ce(),Ce(),Ce()];if(pg(e,r))throw new Error("Ed25519: invalid public key");var t=Ce(),n=Ce(),i=e[1];Zo(t,ca,i),es(n,ca,i),ug(n,n),vt(t,t,n);var s=new Uint8Array(32);return xf(s,t),s}o(zE,"convertPublicKeyToX25519");$t.convertPublicKeyToX25519=zE;function KE(r){var e=yf.hash(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(e.subarray(0,32));return sg.wipe(e),t}o(KE,"convertSecretKeyToX25519");$t.convertSecretKeyToX25519=KE});var bg=me((HN,mg)=>{"use strict";mg.exports=o(function r(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,n,i)=>{let s=i===0?"":",",a=n===void 0||typeof n=="symbol"?null:n;return t+s+r(a)},"")+"]":"{"+Object.keys(e).sort().reduce((t,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return t;let s=t.length===0?"":",";return t+s+r(n)+":"+r(e[n])},"")+"}"},"serialize")});var xg=me(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});var VE=no(),WE=tn();Sr.PUBLIC_KEY_LENGTH=32;Sr.SECRET_KEY_LENGTH=32;Sr.SHARED_KEY_LENGTH=32;function ti(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(ti,"gf");var gg=new Uint8Array(32);gg[0]=9;var GE=ti([56129,1]);function Fh(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Fh,"car25519");function wf(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(wf,"sel25519");function YE(r,e){for(var t=ti(),n=ti(),i=0;i<16;i++)n[i]=e[i];Fh(n),Fh(n),Fh(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,wf(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(YE,"pack25519");function JE(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(JE,"unpack25519");function du(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(du,"add");function hu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(hu,"sub");function _i(r,e,t){var n,i,s=0,a=0,f=0,u=0,m=0,p=0,x=0,k=0,O=0,T=0,C=0,$=0,I=0,U=0,z=0,H=0,X=0,B=0,L=0,F=0,re=0,E=0,l=0,g=0,h=0,c=0,d=0,y=0,_=0,w=0,b=0,S=t[0],D=t[1],v=t[2],M=t[3],ne=t[4],A=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*S,a+=n*D,f+=n*v,u+=n*M,m+=n*ne,p+=n*A,x+=n*K,k+=n*J,O+=n*N,T+=n*R,C+=n*V,$+=n*W,I+=n*ee,U+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*S,f+=n*D,u+=n*v,m+=n*M,p+=n*ne,x+=n*A,k+=n*K,O+=n*J,T+=n*N,C+=n*R,$+=n*V,I+=n*W,U+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*S,u+=n*D,m+=n*v,p+=n*M,x+=n*ne,k+=n*A,O+=n*K,T+=n*J,C+=n*N,$+=n*R,I+=n*V,U+=n*W,z+=n*ee,H+=n*he,X+=n*fe,B+=n*Y,n=e[3],u+=n*S,m+=n*D,p+=n*v,x+=n*M,k+=n*ne,O+=n*A,T+=n*K,C+=n*J,$+=n*N,I+=n*R,U+=n*V,z+=n*W,H+=n*ee,X+=n*he,B+=n*fe,L+=n*Y,n=e[4],m+=n*S,p+=n*D,x+=n*v,k+=n*M,O+=n*ne,T+=n*A,C+=n*K,$+=n*J,I+=n*N,U+=n*R,z+=n*V,H+=n*W,X+=n*ee,B+=n*he,L+=n*fe,F+=n*Y,n=e[5],p+=n*S,x+=n*D,k+=n*v,O+=n*M,T+=n*ne,C+=n*A,$+=n*K,I+=n*J,U+=n*N,z+=n*R,H+=n*V,X+=n*W,B+=n*ee,L+=n*he,F+=n*fe,re+=n*Y,n=e[6],x+=n*S,k+=n*D,O+=n*v,T+=n*M,C+=n*ne,$+=n*A,I+=n*K,U+=n*J,z+=n*N,H+=n*R,X+=n*V,B+=n*W,L+=n*ee,F+=n*he,re+=n*fe,E+=n*Y,n=e[7],k+=n*S,O+=n*D,T+=n*v,C+=n*M,$+=n*ne,I+=n*A,U+=n*K,z+=n*J,H+=n*N,X+=n*R,B+=n*V,L+=n*W,F+=n*ee,re+=n*he,E+=n*fe,l+=n*Y,n=e[8],O+=n*S,T+=n*D,C+=n*v,$+=n*M,I+=n*ne,U+=n*A,z+=n*K,H+=n*J,X+=n*N,B+=n*R,L+=n*V,F+=n*W,re+=n*ee,E+=n*he,l+=n*fe,g+=n*Y,n=e[9],T+=n*S,C+=n*D,$+=n*v,I+=n*M,U+=n*ne,z+=n*A,H+=n*K,X+=n*J,B+=n*N,L+=n*R,F+=n*V,re+=n*W,E+=n*ee,l+=n*he,g+=n*fe,h+=n*Y,n=e[10],C+=n*S,$+=n*D,I+=n*v,U+=n*M,z+=n*ne,H+=n*A,X+=n*K,B+=n*J,L+=n*N,F+=n*R,re+=n*V,E+=n*W,l+=n*ee,g+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*S,I+=n*D,U+=n*v,z+=n*M,H+=n*ne,X+=n*A,B+=n*K,L+=n*J,F+=n*N,re+=n*R,E+=n*V,l+=n*W,g+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],I+=n*S,U+=n*D,z+=n*v,H+=n*M,X+=n*ne,B+=n*A,L+=n*K,F+=n*J,re+=n*N,E+=n*R,l+=n*V,g+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],U+=n*S,z+=n*D,H+=n*v,X+=n*M,B+=n*ne,L+=n*A,F+=n*K,re+=n*J,E+=n*N,l+=n*R,g+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],z+=n*S,H+=n*D,X+=n*v,B+=n*M,L+=n*ne,F+=n*A,re+=n*K,E+=n*J,l+=n*N,g+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*S,X+=n*D,B+=n*v,L+=n*M,F+=n*ne,re+=n*A,E+=n*K,l+=n*J,g+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,b+=n*Y,s+=38*X,a+=38*B,f+=38*L,u+=38*F,m+=38*re,p+=38*E,x+=38*l,k+=38*g,O+=38*h,T+=38*c,C+=38*d,$+=38*y,I+=38*_,U+=38*w,z+=38*b,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=m,r[5]=p,r[6]=x,r[7]=k,r[8]=O,r[9]=T,r[10]=C,r[11]=$,r[12]=I,r[13]=U,r[14]=z,r[15]=H}o(_i,"mul");function _f(r,e){_i(r,e,e)}o(_f,"square");function XE(r,e){for(var t=ti(),n=0;n<16;n++)t[n]=e[n];for(var n=253;n>=0;n--)_f(t,t),n!==2&&n!==4&&_i(t,t,e);for(var n=0;n<16;n++)r[n]=t[n]}o(XE,"inv25519");function $h(r,e){for(var t=new Uint8Array(32),n=new Float64Array(80),i=ti(),s=ti(),a=ti(),f=ti(),u=ti(),m=ti(),p=0;p<31;p++)t[p]=r[p];t[31]=r[31]&127|64,t[0]&=248,JE(n,e);for(var p=0;p<16;p++)s[p]=n[p];i[0]=f[0]=1;for(var p=254;p>=0;--p){var x=t[p>>>3]>>>(p&7)&1;wf(i,s,x),wf(a,f,x),du(u,i,a),hu(i,i,a),du(a,s,f),hu(s,s,f),_f(f,u),_f(m,i),_i(i,a,i),_i(a,s,u),du(u,i,a),hu(i,i,a),_f(s,i),hu(a,f,m),_i(i,a,GE),du(i,i,f),_i(a,a,i),_i(i,f,m),_i(f,s,n),_f(s,u),wf(i,s,x),wf(a,f,x)}for(var p=0;p<16;p++)n[p+16]=i[p],n[p+32]=a[p],n[p+48]=s[p],n[p+64]=f[p];var k=n.subarray(32),O=n.subarray(16);XE(k,k),_i(O,O,k);var T=new Uint8Array(32);return YE(T,O),T}o($h,"scalarMult");Sr.scalarMult=$h;function vg(r){return $h(r,gg)}o(vg,"scalarMultBase");Sr.scalarMultBase=vg;function yg(r){if(r.length!==Sr.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+Sr.SECRET_KEY_LENGTH+" bytes");var e=new Uint8Array(r),t=vg(e);return{publicKey:t,secretKey:e}}o(yg,"generateKeyPairFromSeed");Sr.generateKeyPairFromSeed=yg;function ZE(r){var e=VE.randomBytes(32,r),t=yg(e);return WE.wipe(e),t}o(ZE,"generateKeyPair");Sr.generateKeyPair=ZE;function QE(r,e,t){if(t===void 0&&(t=!1),r.length!==Sr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==Sr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var n=$h(r,e);if(t){for(var i=0,s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(QE,"sharedKey");Sr.sharedKey=QE});var Hh=me(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});var ar=Ko(),qh=tn(),e7=20;function t7(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=t[3]<<24|t[2]<<16|t[1]<<8|t[0],u=t[7]<<24|t[6]<<16|t[5]<<8|t[4],m=t[11]<<24|t[10]<<16|t[9]<<8|t[8],p=t[15]<<24|t[14]<<16|t[13]<<8|t[12],x=t[19]<<24|t[18]<<16|t[17]<<8|t[16],k=t[23]<<24|t[22]<<16|t[21]<<8|t[20],O=t[27]<<24|t[26]<<16|t[25]<<8|t[24],T=t[31]<<24|t[30]<<16|t[29]<<8|t[28],C=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],I=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,H=i,X=s,B=a,L=f,F=u,re=m,E=p,l=x,g=k,h=O,c=T,d=C,y=$,_=I,w=U,b=0;b<e7;b+=2)z=z+L|0,d^=z,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,g=g+y|0,F^=g,F=F>>>32-12|F<<12,X=X+re|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,re^=h,re=re>>>32-12|re<<12,B=B+E|0,w^=B,w=w>>>32-16|w<<16,c=c+w|0,E^=c,E=E>>>32-12|E<<12,X=X+re|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,re^=h,re=re>>>32-7|re<<7,B=B+E|0,w^=B,w=w>>>32-8|w<<8,c=c+w|0,E^=c,E=E>>>32-7|E<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,g=g+y|0,F^=g,F=F>>>32-7|F<<7,z=z+L|0,d^=z,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,z=z+F|0,w^=z,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+re|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,re^=c,re=re>>>32-12|re<<12,X=X+E|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,E^=l,E=E>>>32-12|E<<12,B=B+L|0,_^=B,_=_>>>32-16|_<<16,g=g+_|0,L^=g,L=L>>>32-12|L<<12,X=X+E|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,E^=l,E=E>>>32-7|E<<7,B=B+L|0,_^=B,_=_>>>32-8|_<<8,g=g+_|0,L^=g,L=L>>>32-7|L<<7,H=H+re|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,re^=c,re=re>>>32-7|re<<7,z=z+F|0,w^=z,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;ar.writeUint32LE(z+n|0,r,0),ar.writeUint32LE(H+i|0,r,4),ar.writeUint32LE(X+s|0,r,8),ar.writeUint32LE(B+a|0,r,12),ar.writeUint32LE(L+f|0,r,16),ar.writeUint32LE(F+u|0,r,20),ar.writeUint32LE(re+m|0,r,24),ar.writeUint32LE(E+p|0,r,28),ar.writeUint32LE(l+x|0,r,32),ar.writeUint32LE(g+k|0,r,36),ar.writeUint32LE(h+O|0,r,40),ar.writeUint32LE(c+T|0,r,44),ar.writeUint32LE(d+C|0,r,48),ar.writeUint32LE(y+$|0,r,52),ar.writeUint32LE(_+I|0,r,56),ar.writeUint32LE(w+U|0,r,60)}o(t7,"core");function wg(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=i}for(var f=new Uint8Array(64),u=0;u<t.length;u+=64){t7(f,s,r);for(var m=u;m<u+64&&m<t.length;m++)n[m]=t[m]^f[m-u];n7(s,0,a)}return qh.wipe(f),i===0&&qh.wipe(s),n}o(wg,"streamXOR");pu.streamXOR=wg;function r7(r,e,t,n){return n===void 0&&(n=0),qh.wipe(t),wg(r,e,t,t,n)}o(r7,"stream");pu.stream=r7;function n7(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}o(n7,"incrementCounter")});var Mg=me(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var oo=Ko(),_g=tn(),i7=Hh(),o7=20;function Eg(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=Sg(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var a=i7.streamXOR(i,s,t,n);return _g.wipe(i),a}o(Eg,"streamXOR");Ef.streamXOR=Eg;function s7(r,e,t){return _g.wipe(t),Eg(r,e,t,t)}o(s7,"stream");Ef.stream=s7;function Sg(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=r[3]<<24|r[2]<<16|r[1]<<8|r[0],u=r[7]<<24|r[6]<<16|r[5]<<8|r[4],m=r[11]<<24|r[10]<<16|r[9]<<8|r[8],p=r[15]<<24|r[14]<<16|r[13]<<8|r[12],x=r[19]<<24|r[18]<<16|r[17]<<8|r[16],k=r[23]<<24|r[22]<<16|r[21]<<8|r[20],O=r[27]<<24|r[26]<<16|r[25]<<8|r[24],T=r[31]<<24|r[30]<<16|r[29]<<8|r[28],C=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],I=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,H=i,X=s,B=a,L=f,F=u,re=m,E=p,l=x,g=k,h=O,c=T,d=C,y=$,_=I,w=U,b=0;b<o7;b+=2)z=z+L|0,d^=z,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,g=g+y|0,F^=g,F=F>>>32-12|F<<12,X=X+re|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,re^=h,re=re>>>32-12|re<<12,B=B+E|0,w^=B,w=w>>>32-16|w<<16,c=c+w|0,E^=c,E=E>>>32-12|E<<12,X=X+re|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,re^=h,re=re>>>32-7|re<<7,B=B+E|0,w^=B,w=w>>>32-8|w<<8,c=c+w|0,E^=c,E=E>>>32-7|E<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,g=g+y|0,F^=g,F=F>>>32-7|F<<7,z=z+L|0,d^=z,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,z=z+F|0,w^=z,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+re|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,re^=c,re=re>>>32-12|re<<12,X=X+E|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,E^=l,E=E>>>32-12|E<<12,B=B+L|0,_^=B,_=_>>>32-16|_<<16,g=g+_|0,L^=g,L=L>>>32-12|L<<12,X=X+E|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,E^=l,E=E>>>32-7|E<<7,B=B+L|0,_^=B,_=_>>>32-8|_<<8,g=g+_|0,L^=g,L=L>>>32-7|L<<7,H=H+re|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,re^=c,re=re>>>32-7|re<<7,z=z+F|0,w^=z,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;return oo.writeUint32LE(z,t,0),oo.writeUint32LE(H,t,4),oo.writeUint32LE(X,t,8),oo.writeUint32LE(B,t,12),oo.writeUint32LE(d,t,16),oo.writeUint32LE(y,t,20),oo.writeUint32LE(_,t,24),oo.writeUint32LE(w,t,28),t}o(Sg,"hchacha");Ef.hchacha=Sg});var jh=me(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});function a7(r,e,t){return~(r-1)&e|r-1&t}o(a7,"select");ua.select=a7;function f7(r,e){return(r|0)-(e|0)-1>>>31&1}o(f7,"lessOrEqual");ua.lessOrEqual=f7;function Ag(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}o(Ag,"compare");ua.compare=Ag;function c7(r,e){return r.length===0||e.length===0?!1:Ag(r,e)!==0}o(c7,"equal");ua.equal=c7});var kg=me(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var u7=jh(),mu=tn();Ei.DIGEST_LENGTH=16;var Tg=function(){function r(e){this.digestLength=Ei.DIGEST_LENGTH,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,this._finished=!1;var t=e[0]|e[1]<<8;this._r[0]=t&8191;var n=e[2]|e[3]<<8;this._r[1]=(t>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(i>>>7|s<<9)&8191;var a=e[8]|e[9]<<8;this._r[4]=(s>>>4|a<<12)&255,this._r[5]=a>>>1&8190;var f=e[10]|e[11]<<8;this._r[6]=(a>>>14|f<<2)&8191;var u=e[12]|e[13]<<8;this._r[7]=(f>>>11|u<<5)&8065;var m=e[14]|e[15]<<8;this._r[8]=(u>>>8|m<<8)&8191,this._r[9]=m>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return o(r,"Poly1305"),r.prototype._blocks=function(e,t,n){for(var i=this._fin?0:2048,s=this._h[0],a=this._h[1],f=this._h[2],u=this._h[3],m=this._h[4],p=this._h[5],x=this._h[6],k=this._h[7],O=this._h[8],T=this._h[9],C=this._r[0],$=this._r[1],I=this._r[2],U=this._r[3],z=this._r[4],H=this._r[5],X=this._r[6],B=this._r[7],L=this._r[8],F=this._r[9];n>=16;){var re=e[t+0]|e[t+1]<<8;s+=re&8191;var E=e[t+2]|e[t+3]<<8;a+=(re>>>13|E<<3)&8191;var l=e[t+4]|e[t+5]<<8;f+=(E>>>10|l<<6)&8191;var g=e[t+6]|e[t+7]<<8;u+=(l>>>7|g<<9)&8191;var h=e[t+8]|e[t+9]<<8;m+=(g>>>4|h<<12)&8191,p+=h>>>1&8191;var c=e[t+10]|e[t+11]<<8;x+=(h>>>14|c<<2)&8191;var d=e[t+12]|e[t+13]<<8;k+=(c>>>11|d<<5)&8191;var y=e[t+14]|e[t+15]<<8;O+=(d>>>8|y<<8)&8191,T+=y>>>5|i;var _=0,w=_;w+=s*C,w+=a*(5*F),w+=f*(5*L),w+=u*(5*B),w+=m*(5*X),_=w>>>13,w&=8191,w+=p*(5*H),w+=x*(5*z),w+=k*(5*U),w+=O*(5*I),w+=T*(5*$),_+=w>>>13,w&=8191;var b=_;b+=s*$,b+=a*C,b+=f*(5*F),b+=u*(5*L),b+=m*(5*B),_=b>>>13,b&=8191,b+=p*(5*X),b+=x*(5*H),b+=k*(5*z),b+=O*(5*U),b+=T*(5*I),_+=b>>>13,b&=8191;var S=_;S+=s*I,S+=a*$,S+=f*C,S+=u*(5*F),S+=m*(5*L),_=S>>>13,S&=8191,S+=p*(5*B),S+=x*(5*X),S+=k*(5*H),S+=O*(5*z),S+=T*(5*U),_+=S>>>13,S&=8191;var D=_;D+=s*U,D+=a*I,D+=f*$,D+=u*C,D+=m*(5*F),_=D>>>13,D&=8191,D+=p*(5*L),D+=x*(5*B),D+=k*(5*X),D+=O*(5*H),D+=T*(5*z),_+=D>>>13,D&=8191;var v=_;v+=s*z,v+=a*U,v+=f*I,v+=u*$,v+=m*C,_=v>>>13,v&=8191,v+=p*(5*F),v+=x*(5*L),v+=k*(5*B),v+=O*(5*X),v+=T*(5*H),_+=v>>>13,v&=8191;var M=_;M+=s*H,M+=a*z,M+=f*U,M+=u*I,M+=m*$,_=M>>>13,M&=8191,M+=p*C,M+=x*(5*F),M+=k*(5*L),M+=O*(5*B),M+=T*(5*X),_+=M>>>13,M&=8191;var ne=_;ne+=s*X,ne+=a*H,ne+=f*z,ne+=u*U,ne+=m*I,_=ne>>>13,ne&=8191,ne+=p*$,ne+=x*C,ne+=k*(5*F),ne+=O*(5*L),ne+=T*(5*B),_+=ne>>>13,ne&=8191;var A=_;A+=s*B,A+=a*X,A+=f*H,A+=u*z,A+=m*U,_=A>>>13,A&=8191,A+=p*I,A+=x*$,A+=k*C,A+=O*(5*F),A+=T*(5*L),_+=A>>>13,A&=8191;var K=_;K+=s*L,K+=a*B,K+=f*X,K+=u*H,K+=m*z,_=K>>>13,K&=8191,K+=p*U,K+=x*I,K+=k*$,K+=O*C,K+=T*(5*F),_+=K>>>13,K&=8191;var J=_;J+=s*F,J+=a*L,J+=f*B,J+=u*X,J+=m*H,_=J>>>13,J&=8191,J+=p*z,J+=x*U,J+=k*I,J+=O*$,J+=T*C,_+=J>>>13,J&=8191,_=(_<<2)+_|0,_=_+w|0,w=_&8191,_=_>>>13,b+=_,s=w,a=b,f=S,u=D,m=v,p=M,x=ne,k=A,O=K,T=J,t+=16,n-=16}this._h[0]=s,this._h[1]=a,this._h[2]=f,this._h[3]=u,this._h[4]=m,this._h[5]=p,this._h[6]=x,this._h[7]=k,this._h[8]=O,this._h[9]=T},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,a,f;if(this._leftover){for(f=this._leftover,this._buffer[f++]=1;f<16;f++)this._buffer[f]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,f=2;f<10;f++)this._h[f]+=i,i=this._h[f]>>>13,this._h[f]&=8191;for(this._h[0]+=i*5,i=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=i,i=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=i,n[0]=this._h[0]+5,i=n[0]>>>13,n[0]&=8191,f=1;f<10;f++)n[f]=this._h[f]+i,i=n[f]>>>13,n[f]&=8191;for(n[9]-=1<<13,s=(i^1)-1,f=0;f<10;f++)n[f]&=s;for(s=~s,f=0;f<10;f++)this._h[f]=this._h[f]&s|n[f];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,a=this._h[0]+this._pad[0],this._h[0]=a&65535,f=1;f<8;f++)a=(this._h[f]+this._pad[f]|0)+(a>>>16)|0,this._h[f]=a&65535;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},r.prototype.update=function(e){var t=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var s=0;s<i;s++)this._buffer[this._leftover+s]=e[t+s];if(n-=i,t+=i,this._leftover+=i,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(i=n-n%16,this._blocks(e,t,i),t+=i,n-=i),n){for(var s=0;s<n;s++)this._buffer[this._leftover+s]=e[t+s];this._leftover+=n}return this},r.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},r.prototype.clean=function(){return mu.wipe(this._buffer),mu.wipe(this._r),mu.wipe(this._h),mu.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();Ei.Poly1305=Tg;function l7(r,e){var t=new Tg(r);t.update(e);var n=t.digest();return t.clean(),n}o(l7,"oneTimeAuth");Ei.oneTimeAuth=l7;function d7(r,e){return r.length!==Ei.DIGEST_LENGTH||e.length!==Ei.DIGEST_LENGTH?!1:u7.equal(r,e)}o(d7,"equal");Ei.equal=d7});var Ig=me(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var bu=Hh(),h7=kg(),Sf=tn(),Cg=Ko(),p7=jh();Si.KEY_LENGTH=32;Si.NONCE_LENGTH=12;Si.TAG_LENGTH=16;var Dg=new Uint8Array(16),m7=function(){function r(e){if(this.nonceLength=Si.NONCE_LENGTH,this.tagLength=Si.TAG_LENGTH,e.length!==Si.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"ChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);bu.stream(this._key,s,a,4);var f=t.length+this.tagLength,u;if(i){if(i.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(f);return bu.streamXOR(this._key,s,t,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),a,u.subarray(0,u.length-this.tagLength),n),Sf.wipe(s),u},r.prototype.open=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);bu.stream(this._key,s,a,4);var f=new Uint8Array(this.tagLength);if(this._authenticate(f,a,t.subarray(0,t.length-this.tagLength),n),!p7.equal(f,t.subarray(t.length-this.tagLength,t.length)))return null;var u=t.length-this.tagLength,m;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");m=i}else m=new Uint8Array(u);return bu.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),m,4),Sf.wipe(s),m},r.prototype.clean=function(){return Sf.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new h7.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(Dg.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(Dg.subarray(n.length%16));var a=new Uint8Array(8);i&&Cg.writeUint64LE(i.length,a),s.update(a),Cg.writeUint64LE(n.length,a),s.update(a);for(var f=s.digest(),u=0;u<f.length;u++)e[u]=f[u];s.clean(),Sf.wipe(f),Sf.wipe(a)},r}();Si.ChaCha20Poly1305=m7});var Ng=me(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var Og=Mg(),Pg=Ig(),Mf=tn();Mi.KEY_LENGTH=32;Mi.NONCE_LENGTH=24;Mi.TAG_LENGTH=16;var b7=function(){function r(e){if(this.nonceLength=Mi.NONCE_LENGTH,this.tagLength=Mi.TAG_LENGTH,e.length!==Mi.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"XChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var s=Og.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Pg.ChaCha20Poly1305(s),u=f.seal(a,t,n,i);return Mf.wipe(s),Mf.wipe(a),f.clean(),u},r.prototype.open=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=Og.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Pg.ChaCha20Poly1305(s),u=f.open(a,t,n,i);return Mf.wipe(s),Mf.wipe(a),f.clean(),u},r.prototype.clean=function(){return Mf.wipe(this._key),this},r}();Mi.XChaCha20Poly1305=b7});var Tn=me((EL,_2)=>{_2.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}});var Rf=me((SL,E2)=>{E2.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}});var A2=me(er=>{var S2=er,Ru=4294967292,Lu=4294967293,m0=4294967294,M2=4294967295,xe=[0,1,3,7,15,31,63,127,255,511,1023],co=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],LS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Br=[];LS.forEach(r=>{Br.push(r.charCodeAt(0))});er.utf8={encode(r){let e=[];return r.forEach(t=>{if(t>=0&&t<=127)e.push(t);else if(t<=2047)e.push(192+(t>>6&xe[5])),e.push(128+(t&xe[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]));else if(t>=65536&&t<=1114111){let n=t>>16&xe[5];e.push(240+(n>>2)),e.push(128+((n&xe[2])<<4)+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Buffer.from(e)},decode(r,e){function t(T,C){if((C&192)!==128)return Lu;let $=((T&xe[5])<<6)+(C&xe[6]);return $<128?Ru:$}o(t,"bytes2");function n(T,C,$){if(($&192)!==128||(C&192)!==128)return Lu;let I=((T&xe[4])<<12)+((C&xe[6])<<6)+($&xe[6]);return I<2048?Ru:I>=55296&&I<=57343?m0:I}o(n,"bytes3");function i(T,C,$,I){if((I&192)!==128||($&192)!==128||(C&192)!==128)return Lu;let U=(((T&xe[3])<<2)+(C>>4&xe[2])<<16)+((C&xe[4])<<12)+(($&xe[6])<<6)+(I&xe[6]);return U<65536?Ru:U>1114111?m0:U}o(i,"bytes4");let s,a,f,u,m,p,x=r.length,k=e?3:0,O=[];for(;k<x;){a=r[k],s=M2;let T=!0;for(;T;){if(a>=0&&a<=127){s=a,p=1;break}if(f=k+1,f<x&&a>=194&&a<=223){s=t(a,r[f]),p=2;break}if(u=k+2,u<x&&a>=224&&a<=239){s=n(a,r[f],r[u]),p=3;break}if(m=k+3,m<x&&a>=240&&a<=244){s=i(a,r[f],r[u],r[m]),p=4;break}break}if(s>1114111){let C=`byte[${k}]`;throw s===M2?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${C}`):s===Lu?new RangeError(`utf8.decode: illegal trailing byte found at: ${C}`):s===m0?new RangeError(`utf8.decode: code point out of range found at: ${C}`):s===Ru?new RangeError(`utf8.decode: non-shortest form found at: ${C}`):new RangeError(`utf8.decode: unrecognized error found at: ${C}`)}O.push(s),k+=p}return O}};er.utf16be={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t>>8&xe[8]),e.push(t&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n>>8&xe[8]),e.push(n&xe[8]),e.push(i>>8&xe[8]),e.push(i&xe[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,m,p,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(p=(r[i]<<8)+r[u],p<55296||p>57343){a=p,f=2;break}if(m=i+3,m<n&&(x=(r[i+2]<<8)+r[m],p<=56319&&x>=56320&&x<=57343)){a=65536+(p-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};er.utf16le={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t&xe[8]),e.push(t>>8&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n&xe[8]),e.push(n>>8&xe[8]),e.push(i&xe[8]),e.push(i>>8&xe[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,m,p,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(p=(r[u]<<8)+r[i],p<55296||p>57343){a=p,f=2;break}if(m=i+3,m<n&&(x=(r[m]<<8)+r[i+2],p<=56319&&x>=56320&&x<=57343)){a=65536+(p-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};er.utf32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${t/4}]: ${n}`);e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n]<<24)+(r[n+1]<<16)+(r[n+2]<<8)+r[n+3];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};er.utf32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${t/4}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+r[n];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};er.uint7={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${t}]: ${r[t]}`);e[t]=r[t]}return e}};er.uint8={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1)e[t]=r[t];return e}};er.uint16be={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${t/2}]: ${n}`);e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t]<<8)+r[t+1]);return e}};er.uint16le={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${t/2}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t+1]<<8)+r[t]);return e}};er.uint32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3]);return e}};er.uint32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t+3]<<24)+(r[t+2]<<16)+(r[t+1]<<8)+r[t]);return e}};er.string={encode(r){return S2.utf16le.encode(r).toString("utf16le")},decode(r){return S2.utf16le.decode(Buffer.from(r,"utf16le"),0)}};er.escaped={encode(r){let e=[];for(let t=0;t<r.length;t+=1){let n=r[t];if(n===96)e.push(n),e.push(n);else if(n===10)e.push(n);else if(n>=32&&n<=126)e.push(n);else{let i="";if(n>=0&&n<=31)i+=`\`x${co[n]}`;else if(n>=127&&n<=255)i+=`\`x${co[n]}`;else if(n>=256&&n<=65535)i+=`\`u${co[n>>8&xe[8]]}${co[n&xe[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let a=n>>24&xe[8];a>0&&(i+=co[a]),i+=`${co[n>>16&xe[8]]+co[n>>8&xe[8]]+co[n&xe[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(i).forEach(a=>{e.push(a)})}}return Buffer.from(e)},decode(r){function e(x){return x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102}o(e,"isHex");function t(x,k,O){let T={char:null,nexti:x+2,error:!0};if(x+1<k&&e(O[x])&&e(O[x+1])){let C=String.fromCodePoint(O[x],O[x+1]);T.char=parseInt(C,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(t,"getx");function n(x,k,O){let T={char:null,nexti:x+4,error:!0};if(x+3<k&&e(O[x])&&e(O[x+1])&&e(O[x+2])&&e(O[x+3])){let C=String.fromCodePoint(O[x],O[x+1],O[x+2],O[x+3]);T.char=parseInt(C,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(n,"getu");function i(x,k,O){let T={char:null,nexti:x+4,error:!0},C="";for(;x<k&&e(O[x]);)C+=String.fromCodePoint(O[x]),x+=1;return T.char=parseInt(C,16),O[x]===125&&!Number.isNaN(T.char)&&(T.error=!1),T.nexti=x+1,T}o(i,"getU");let s=[],a=r.length,f,u,m,p=0;for(;p<a;){for(;;){if(m=!0,r[p]!==96){s.push(r[p]),p+=1,m=!1;break}if(f=p+1,f>=a)break;if(r[f]===96){s.push(96),p+=2,m=!1;break}if(r[f]===120){if(u=t(f+1,a,r),u.error)break;s.push(u.char),p=u.nexti,m=!1;break}if(r[f]===117){if(r[f+1]===123){if(u=i(f+2,a,r),u.error)break;s.push(u.char),p=u.nexti,m=!1;break}if(u=n(f+1,a,r),u.error)break;s.push(u.char),p=u.nexti,m=!1;break}break}if(m)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${p}]`)}return s}};var Lf=13,cn=10;er.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Lf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(Lf),e.push(cn);break;case cn:e.push(Lf),e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&(e.push(Lf),e.push(cn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Lf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(cn);break;case cn:e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&e.push(cn),e}};er.base64={encode(r){if(r.length===0)return Buffer.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,a=Buffer.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let f=0;f<s;f+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t++]=Br[n&xe[6]];if(i===0)return a;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t]=Br[64],a;if(i===2)return n=r[e]<<16,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[64],a[t]=Br[64],a},decode(r){function e(p){let x=[],k=0;for(let O=0;O<p.length;O+=1){let T=p[O],C=!0;for(;C&&!(T===32||T===9||T===10||T===13);){if(T>=65&&T<=90){x.push(T-65);break}if(T>=97&&T<=122){x.push(T-71);break}if(T>=48&&T<=57){x.push(T+4);break}if(T===43){x.push(62);break}if(T===47){x.push(63);break}if(T===61){x.push(64),k+=1;break}throw new RangeError(`base64.decode: invalid character buf[${O}]: ${T}`)}}if(x.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${x.length}`);switch(k){case 0:break;case 1:if(x[x.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(x[x.length-1]!==64||x[x.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${k}`)}return{tail:k,buf:Buffer.from(x)}}if(o(e,"validate"),r.length===0)return Buffer.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,a,f,u=i.length/4,m=Buffer.alloc(u*3-n);n>0&&(u-=1),a=0,s=0;for(let p=0;p<u;p+=1)f=i[s++]<<18,f+=i[s++]<<12,f+=i[s++]<<6,f+=i[s++],m[a++]=f>>16&xe[8],m[a++]=f>>8&xe[8],m[a++]=f&xe[8];return n===1&&(f=i[s++]<<18,f+=i[s++]<<12,f+=i[s]<<6,m[a++]=f>>16&xe[8],m[a]=f>>8&xe[8]),n===2&&(f=i[s++]<<18,f+=i[s++]<<12,m[a]=f>>16&xe[8]),m},toString(r){if(r.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${r.length}`);let e="",t=0;function n(s,a,f,u){switch(t){case 76:e+=`\r
15
+ `});var jd=gt(()=>{Vn();Rc();Vi();Ud();zo()});var s1={};St(s1,{CID:()=>Pe,bases:()=>Ys,bytes:()=>of,codecs:()=>Z8,digest:()=>Ho,hasher:()=>Bc,hashes:()=>X8,varint:()=>Gs});var Ys,X8,Z8,qc=gt(()=>{qm();Hm();zm();jm();Km();Cd();Nc();Id();Nd();Gm();cf();qd();r1();n1();jd();Ys=ie(ie(ie(ie(ie(ie(ie(ie(ie(ie({},Ed),Sd),Md),Ad),Td),kd),Dd),Od),Pd),Rd),X8=ie(ie({},Fd),$d),Z8={raw:Hd,json:zd}});function f1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var a1,Kd,Q8,Hc,Vd=gt(()=>{qc();o(f1,"createCodec");a1=f1("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Kd=f1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Q8=ie({utf8:a1,"utf-8":a1,hex:Ys.base16,latin1:Kd,ascii:Kd,binary:Kd},Ys),Hc=Q8});var c1={};St(c1,{fromString:()=>Lt});function Lt(r,e="utf8"){let t=Hc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var zc=gt(()=>{Vd();o(Lt,"fromString")});var u1={};St(u1,{toString:()=>Ot});function Ot(r,e="utf8"){let t=Hc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var lf=gt(()=>{Vd();o(Ot,"toString")});var l1=me(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function e_(r,e){var t=r>>>16&65535,n=r&65535,i=e>>>16&65535,s=e&65535;return n*s+(t*s+n*i<<16>>>0)|0}o(e_,"imulShim");Or.mul=Math.imul||e_;function t_(r,e){return r+e|0}o(t_,"add");Or.add=t_;function r_(r,e){return r-e|0}o(r_,"sub");Or.sub=r_;function n_(r,e){return r<<e|r>>>32-e}o(n_,"rotl");Or.rotl=n_;function i_(r,e){return r<<32-e|r>>>e}o(i_,"rotr");Or.rotr=i_;function o_(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(o_,"isIntegerShim");Or.isInteger=Number.isInteger||o_;Or.MAX_SAFE_INTEGER=9007199254740991;Or.isSafeInteger=function(r){return Or.isInteger(r)&&r>=-Or.MAX_SAFE_INTEGER&&r<=Or.MAX_SAFE_INTEGER}});var Ko=me(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});var d1=l1();function s_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(s_,"readInt16BE");it.readInt16BE=s_;function a_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(a_,"readUint16BE");it.readUint16BE=a_;function f_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(f_,"readInt16LE");it.readInt16LE=f_;function c_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(c_,"readUint16LE");it.readUint16LE=c_;function h1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}o(h1,"writeUint16BE");it.writeUint16BE=h1;it.writeInt16BE=h1;function p1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}o(p1,"writeUint16LE");it.writeUint16LE=p1;it.writeInt16LE=p1;function Wd(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Wd,"readInt32BE");it.readInt32BE=Wd;function Gd(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Gd,"readUint32BE");it.readUint32BE=Gd;function Yd(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Yd,"readInt32LE");it.readInt32LE=Yd;function Jd(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(Jd,"readUint32LE");it.readUint32LE=Jd;function Kc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}o(Kc,"writeUint32BE");it.writeUint32BE=Kc;it.writeInt32BE=Kc;function Vc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}o(Vc,"writeUint32LE");it.writeUint32LE=Vc;it.writeInt32LE=Vc;function u_(r,e){e===void 0&&(e=0);var t=Wd(r,e),n=Wd(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(u_,"readInt64BE");it.readInt64BE=u_;function l_(r,e){e===void 0&&(e=0);var t=Gd(r,e),n=Gd(r,e+4);return t*4294967296+n}o(l_,"readUint64BE");it.readUint64BE=l_;function d_(r,e){e===void 0&&(e=0);var t=Yd(r,e),n=Yd(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(d_,"readInt64LE");it.readInt64LE=d_;function h_(r,e){e===void 0&&(e=0);var t=Jd(r,e),n=Jd(r,e+4);return n*4294967296+t}o(h_,"readUint64LE");it.readUint64LE=h_;function m1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Kc(r/4294967296>>>0,e,t),Kc(r>>>0,e,t+4),e}o(m1,"writeUint64BE");it.writeUint64BE=m1;it.writeInt64BE=m1;function b1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Vc(r>>>0,e,t),Vc(r/4294967296>>>0,e,t+4),e}o(b1,"writeUint64LE");it.writeUint64LE=b1;it.writeInt64LE=b1;function p_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=r/8+t-1;s>=t;s--)n+=e[s]*i,i*=256;return n}o(p_,"readUintBE");it.readUintBE=p_;function m_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=t;s<t+r/8;s++)n+=e[s]*i,i*=256;return n}o(m_,"readUintLE");it.readUintLE=m_;function b_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!d1.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=r/8+n-1;s>=n;s--)t[s]=e/i&255,i*=256;return t}o(b_,"writeUintBE");it.writeUintBE=b_;function g_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!d1.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+r/8;s++)t[s]=e/i&255,i*=256;return t}o(g_,"writeUintLE");it.writeUintLE=g_;function v_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(v_,"readFloat32BE");it.readFloat32BE=v_;function y_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(y_,"readFloat32LE");it.readFloat32LE=y_;function x_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(x_,"readFloat64BE");it.readFloat64BE=x_;function w_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(w_,"readFloat64LE");it.readFloat64LE=w_;function __(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}o(__,"writeFloat32BE");it.writeFloat32BE=__;function E_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}o(E_,"writeFloat32LE");it.writeFloat32LE=E_;function S_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}o(S_,"writeFloat64BE");it.writeFloat64BE=S_;function M_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}o(M_,"writeFloat64LE");it.writeFloat64LE=M_});var tn=me(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});function A_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(A_,"wipe");Xd.wipe=A_});var v1=me(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Gc=Ko(),Wc=tn();Yi.DIGEST_LENGTH=32;Yi.BLOCK_SIZE=64;var g1=function(){function r(){this.digestLength=Yi.DIGEST_LENGTH,this.blockSize=Yi.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA256"),r.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){Wc.wipe(this._buffer),Wc.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Zd(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Zd(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%64<56?64:128;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;Gc.writeUint32BE(i,this._buffer,a-8),Gc.writeUint32BE(s,this._buffer,a-4),Zd(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/4;f++)Gc.writeUint32BE(this._state[f],e,f*4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){Wc.wipe(e.state),e.buffer&&Wc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Yi.SHA256=g1;var T_=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Zd(r,e,t,n,i){for(;i>=64;){for(var s=e[0],a=e[1],f=e[2],u=e[3],m=e[4],p=e[5],x=e[6],k=e[7],I=0;I<16;I++){var T=n+I*4;r[I]=Gc.readUint32BE(t,T)}for(var I=16;I<64;I++){var C=r[I-2],$=(C>>>17|C<<32-17)^(C>>>19|C<<32-19)^C>>>10;C=r[I-15];var O=(C>>>7|C<<32-7)^(C>>>18|C<<32-18)^C>>>3;r[I]=($+r[I-7]|0)+(O+r[I-16]|0)}for(var I=0;I<64;I++){var $=(((m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&p^~m&x)|0)+(k+(T_[I]+r[I]|0)|0)|0,O=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&a^s&f^a&f)|0;k=x,x=p,p=m,m=u+$|0,u=f,f=a,a=s,s=$+O|0}e[0]+=s,e[1]+=a,e[2]+=f,e[3]+=u,e[4]+=m,e[5]+=p,e[6]+=x,e[7]+=k,n+=64,i-=64}return n}o(Zd,"hashBlocks");function k_(r){var e=new g1;e.update(r);var t=e.digest();return e.clean(),t}o(k_,"hash");Yi.hash=k_});var Qd=me((iN,Yc)=>{(function(){"use strict";var r="input is invalid type",e="finalize already called",t=typeof window=="object",n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var i=!t&&typeof self=="object",s=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?n=global:i&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&typeof Yc=="object"&&Yc.exports,f=typeof define=="function"&&define.amd,u=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",m="0123456789abcdef".split(""),p=[31,7936,2031616,520093696],x=[4,1024,262144,67108864],k=[1,256,65536,16777216],I=[6,1536,393216,100663296],T=[0,8,16,24],C=[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],$=[224,256,384,512],O=[128,256],U=["hex","buffer","arrayBuffer","array","digest"],j={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(A){return Object.prototype.toString.call(A)==="[object Array]"}),u&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(A){return typeof A=="object"&&A.buffer&&A.buffer.constructor===ArrayBuffer});for(var H=o(function(A,K,J){return function(N){return new v(A,K,A).update(N)[J]()}},"createOutputMethod"),X=o(function(A,K,J){return function(N,R){return new v(A,K,R).update(N)[J]()}},"createShakeOutputMethod"),B=o(function(A,K,J){return function(N,R,V,W){return c["cshake"+A].update(N,R,V,W)[J]()}},"createCshakeOutputMethod"),L=o(function(A,K,J){return function(N,R,V,W){return c["kmac"+A].update(N,R,V,W)[J]()}},"createKmacOutputMethod"),F=o(function(A,K,J,N){for(var R=0;R<U.length;++R){var V=U[R];A[V]=K(J,N,V)}return A},"createOutputMethods"),re=o(function(A,K){var J=H(A,K,"hex");return J.create=function(){return new v(A,K,A)},J.update=function(N){return J.create().update(N)},F(J,H,A,K)},"createMethod"),E=o(function(A,K){var J=X(A,K,"hex");return J.create=function(N){return new v(A,K,N)},J.update=function(N,R){return J.create(R).update(N)},F(J,X,A,K)},"createShakeMethod"),l=o(function(A,K){var J=j[A],N=B(A,K,"hex");return N.create=function(R,V,W){return!V&&!W?c["shake"+A].create(R):new v(A,K,R).bytepad([V,W],J)},N.update=function(R,V,W,ee){return N.create(V,W,ee).update(R)},F(N,B,A,K)},"createCshakeMethod"),g=o(function(A,K){var J=j[A],N=L(A,K,"hex");return N.create=function(R,V,W){return new M(A,K,V).bytepad(["KMAC",W],J).bytepad([R],J)},N.update=function(R,V,W,ee){return N.create(R,W,ee).update(V)},F(N,L,A,K)},"createKmacMethod"),h=[{name:"keccak",padding:k,bits:$,createMethod:re},{name:"sha3",padding:I,bits:$,createMethod:re},{name:"shake",padding:p,bits:O,createMethod:E},{name:"cshake",padding:x,bits:O,createMethod:l},{name:"kmac",padding:x,bits:O,createMethod:g}],c={},d=[],y=0;y<h.length;++y)for(var _=h[y],w=_.bits,b=0;b<w.length;++b){var S=_.name+"_"+w[b];if(d.push(S),c[S]=_.createMethod(w[b],_.padding),_.name!=="sha3"){var D=_.name+w[b];d.push(D),c[D]=c[S]}}function v(A,K,J){this.blocks=[],this.s=[],this.padding=K,this.outputBits=J,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(A<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var N=0;N<50;++N)this.s[N]=0}o(v,"Keccak"),v.prototype.update=function(A){if(this.finalized)throw new Error(e);var K,J=typeof A;if(J!=="string"){if(J==="object"){if(A===null)throw new Error(r);if(u&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!u||!ArrayBuffer.isView(A)))throw new Error(r)}else throw new Error(r);K=!0}for(var N=this.blocks,R=this.byteCount,V=A.length,W=this.blockCount,ee=0,he=this.s,fe,Y;ee<V;){if(this.reset)for(this.reset=!1,N[0]=this.block,fe=1;fe<W+1;++fe)N[fe]=0;if(K)for(fe=this.start;ee<V&&fe<R;++ee)N[fe>>2]|=A[ee]<<T[fe++&3];else for(fe=this.start;ee<V&&fe<R;++ee)Y=A.charCodeAt(ee),Y<128?N[fe>>2]|=Y<<T[fe++&3]:Y<2048?(N[fe>>2]|=(192|Y>>6)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):Y<55296||Y>=57344?(N[fe>>2]|=(224|Y>>12)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):(Y=65536+((Y&1023)<<10|A.charCodeAt(++ee)&1023),N[fe>>2]|=(240|Y>>18)<<T[fe++&3],N[fe>>2]|=(128|Y>>12&63)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]);if(this.lastByteIndex=fe,fe>=R){for(this.start=fe-R,this.block=N[W],fe=0;fe<W;++fe)he[fe]^=N[fe];ne(he),this.reset=!0}else this.start=fe}return this},v.prototype.encode=function(A,K){var J=A&255,N=1,R=[J];for(A=A>>8,J=A&255;J>0;)R.unshift(J),A=A>>8,J=A&255,++N;return K?R.push(N):R.unshift(N),this.update(R),R.length},v.prototype.encodeString=function(A){var K,J=typeof A;if(J!=="string"){if(J==="object"){if(A===null)throw new Error(r);if(u&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!u||!ArrayBuffer.isView(A)))throw new Error(r)}else throw new Error(r);K=!0}var N=0,R=A.length;if(K)N=R;else for(var V=0;V<A.length;++V){var W=A.charCodeAt(V);W<128?N+=1:W<2048?N+=2:W<55296||W>=57344?N+=3:(W=65536+((W&1023)<<10|A.charCodeAt(++V)&1023),N+=4)}return N+=this.encode(N*8),this.update(A),N},v.prototype.bytepad=function(A,K){for(var J=this.encode(K),N=0;N<A.length;++N)J+=this.encodeString(A[N]);var R=K-J%K,V=[];return V.length=R,this.update(V),this},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var A=this.blocks,K=this.lastByteIndex,J=this.blockCount,N=this.s;if(A[K>>2]|=this.padding[K&3],this.lastByteIndex===this.byteCount)for(A[0]=A[J],K=1;K<J+1;++K)A[K]=0;for(A[J-1]|=2147483648,K=0;K<J;++K)N[K]^=A[K];ne(N)}},v.prototype.toString=v.prototype.hex=function(){this.finalize();for(var A=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W="",ee;V<J;){for(R=0;R<A&&V<J;++R,++V)ee=K[R],W+=m[ee>>4&15]+m[ee&15]+m[ee>>12&15]+m[ee>>8&15]+m[ee>>20&15]+m[ee>>16&15]+m[ee>>28&15]+m[ee>>24&15];V%A===0&&(ne(K),R=0)}return N&&(ee=K[R],W+=m[ee>>4&15]+m[ee&15],N>1&&(W+=m[ee>>12&15]+m[ee>>8&15]),N>2&&(W+=m[ee>>20&15]+m[ee>>16&15])),W},v.prototype.arrayBuffer=function(){this.finalize();var A=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=this.outputBits>>3,ee;N?ee=new ArrayBuffer(J+1<<2):ee=new ArrayBuffer(W);for(var he=new Uint32Array(ee);V<J;){for(R=0;R<A&&V<J;++R,++V)he[V]=K[R];V%A===0&&ne(K)}return N&&(he[R]=K[R],ee=ee.slice(0,W)),ee},v.prototype.buffer=v.prototype.arrayBuffer,v.prototype.digest=v.prototype.array=function(){this.finalize();for(var A=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=[],ee,he;V<J;){for(R=0;R<A&&V<J;++R,++V)ee=V<<2,he=K[R],W[ee]=he&255,W[ee+1]=he>>8&255,W[ee+2]=he>>16&255,W[ee+3]=he>>24&255;V%A===0&&ne(K)}return N&&(ee=V<<2,he=K[R],W[ee]=he&255,N>1&&(W[ee+1]=he>>8&255),N>2&&(W[ee+2]=he>>16&255)),W};function M(A,K,J){v.call(this,A,K,J)}o(M,"Kmac"),M.prototype=new v,M.prototype.finalize=function(){return this.encode(this.outputBits,!0),v.prototype.finalize.call(this)};var ne=o(function(A){var K,J,N,R,V,W,ee,he,fe,Y,pe,Q,ce,q,se,be,ke,we,Ie,vr,te,G,P,z,ae,ue,le,ge,ft,Ee,ve,lt,De,Ne,Bn,Le,Be,Un,Ue,Fe,Fn,$e,qe,$n,He,ze,qn,je,Ke,Hn,Ve,We,zn,Ge,Ye,gn,mt,bt,Yr,Jr,Xr,Zr,Qr;for(N=0;N<48;N+=2)R=A[0]^A[10]^A[20]^A[30]^A[40],V=A[1]^A[11]^A[21]^A[31]^A[41],W=A[2]^A[12]^A[22]^A[32]^A[42],ee=A[3]^A[13]^A[23]^A[33]^A[43],he=A[4]^A[14]^A[24]^A[34]^A[44],fe=A[5]^A[15]^A[25]^A[35]^A[45],Y=A[6]^A[16]^A[26]^A[36]^A[46],pe=A[7]^A[17]^A[27]^A[37]^A[47],Q=A[8]^A[18]^A[28]^A[38]^A[48],ce=A[9]^A[19]^A[29]^A[39]^A[49],K=Q^(W<<1|ee>>>31),J=ce^(ee<<1|W>>>31),A[0]^=K,A[1]^=J,A[10]^=K,A[11]^=J,A[20]^=K,A[21]^=J,A[30]^=K,A[31]^=J,A[40]^=K,A[41]^=J,K=R^(he<<1|fe>>>31),J=V^(fe<<1|he>>>31),A[2]^=K,A[3]^=J,A[12]^=K,A[13]^=J,A[22]^=K,A[23]^=J,A[32]^=K,A[33]^=J,A[42]^=K,A[43]^=J,K=W^(Y<<1|pe>>>31),J=ee^(pe<<1|Y>>>31),A[4]^=K,A[5]^=J,A[14]^=K,A[15]^=J,A[24]^=K,A[25]^=J,A[34]^=K,A[35]^=J,A[44]^=K,A[45]^=J,K=he^(Q<<1|ce>>>31),J=fe^(ce<<1|Q>>>31),A[6]^=K,A[7]^=J,A[16]^=K,A[17]^=J,A[26]^=K,A[27]^=J,A[36]^=K,A[37]^=J,A[46]^=K,A[47]^=J,K=Y^(R<<1|V>>>31),J=pe^(V<<1|R>>>31),A[8]^=K,A[9]^=J,A[18]^=K,A[19]^=J,A[28]^=K,A[29]^=J,A[38]^=K,A[39]^=J,A[48]^=K,A[49]^=J,q=A[0],se=A[1],ze=A[11]<<4|A[10]>>>28,qn=A[10]<<4|A[11]>>>28,ge=A[20]<<3|A[21]>>>29,ft=A[21]<<3|A[20]>>>29,Jr=A[31]<<9|A[30]>>>23,Xr=A[30]<<9|A[31]>>>23,$e=A[40]<<18|A[41]>>>14,qe=A[41]<<18|A[40]>>>14,Ne=A[2]<<1|A[3]>>>31,Bn=A[3]<<1|A[2]>>>31,be=A[13]<<12|A[12]>>>20,ke=A[12]<<12|A[13]>>>20,je=A[22]<<10|A[23]>>>22,Ke=A[23]<<10|A[22]>>>22,Ee=A[33]<<13|A[32]>>>19,ve=A[32]<<13|A[33]>>>19,Zr=A[42]<<2|A[43]>>>30,Qr=A[43]<<2|A[42]>>>30,Ge=A[5]<<30|A[4]>>>2,Ye=A[4]<<30|A[5]>>>2,Le=A[14]<<6|A[15]>>>26,Be=A[15]<<6|A[14]>>>26,we=A[25]<<11|A[24]>>>21,Ie=A[24]<<11|A[25]>>>21,Hn=A[34]<<15|A[35]>>>17,Ve=A[35]<<15|A[34]>>>17,lt=A[45]<<29|A[44]>>>3,De=A[44]<<29|A[45]>>>3,z=A[6]<<28|A[7]>>>4,ae=A[7]<<28|A[6]>>>4,gn=A[17]<<23|A[16]>>>9,mt=A[16]<<23|A[17]>>>9,Un=A[26]<<25|A[27]>>>7,Ue=A[27]<<25|A[26]>>>7,vr=A[36]<<21|A[37]>>>11,te=A[37]<<21|A[36]>>>11,We=A[47]<<24|A[46]>>>8,zn=A[46]<<24|A[47]>>>8,$n=A[8]<<27|A[9]>>>5,He=A[9]<<27|A[8]>>>5,ue=A[18]<<20|A[19]>>>12,le=A[19]<<20|A[18]>>>12,bt=A[29]<<7|A[28]>>>25,Yr=A[28]<<7|A[29]>>>25,Fe=A[38]<<8|A[39]>>>24,Fn=A[39]<<8|A[38]>>>24,G=A[48]<<14|A[49]>>>18,P=A[49]<<14|A[48]>>>18,A[0]=q^~be&we,A[1]=se^~ke&Ie,A[10]=z^~ue&ge,A[11]=ae^~le&ft,A[20]=Ne^~Le&Un,A[21]=Bn^~Be&Ue,A[30]=$n^~ze&je,A[31]=He^~qn&Ke,A[40]=Ge^~gn&bt,A[41]=Ye^~mt&Yr,A[2]=be^~we&vr,A[3]=ke^~Ie&te,A[12]=ue^~ge&Ee,A[13]=le^~ft&ve,A[22]=Le^~Un&Fe,A[23]=Be^~Ue&Fn,A[32]=ze^~je&Hn,A[33]=qn^~Ke&Ve,A[42]=gn^~bt&Jr,A[43]=mt^~Yr&Xr,A[4]=we^~vr&G,A[5]=Ie^~te&P,A[14]=ge^~Ee&lt,A[15]=ft^~ve&De,A[24]=Un^~Fe&$e,A[25]=Ue^~Fn&qe,A[34]=je^~Hn&We,A[35]=Ke^~Ve&zn,A[44]=bt^~Jr&Zr,A[45]=Yr^~Xr&Qr,A[6]=vr^~G&q,A[7]=te^~P&se,A[16]=Ee^~lt&z,A[17]=ve^~De&ae,A[26]=Fe^~$e&Ne,A[27]=Fn^~qe&Bn,A[36]=Hn^~We&$n,A[37]=Ve^~zn&He,A[46]=Jr^~Zr&Ge,A[47]=Xr^~Qr&Ye,A[8]=G^~q&be,A[9]=P^~se&ke,A[18]=lt^~z&ue,A[19]=De^~ae&le,A[28]=$e^~Ne&Le,A[29]=qe^~Bn&Be,A[38]=We^~$n&ze,A[39]=zn^~He&qn,A[48]=Zr^~Ge&gn,A[49]=Qr^~Ye&mt,A[0]^=C[N],A[1]^=C[N+1]},"f");if(a)Yc.exports=c;else{for(y=0;y<d.length;++y)n[d[y]]=c[d[y]];f&&define(function(){return c})}})()});var y1=me((oN,C_)=>{C_.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var eh=me(()=>{});var Wn=me((x1,th)=>{(function(r,e){"use strict";function t(E,l){if(!E)throw new Error(l||"Assertion failed")}o(t,"assert");function n(E,l){E.super_=l;var g=o(function(){},"TempCtor");g.prototype=l.prototype,E.prototype=new g,E.prototype.constructor=E}o(n,"inherits");function i(E,l,g){if(i.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((l==="le"||l==="be")&&(g=l,l=10),this._init(E||0,l||10,g||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=eh().Buffer}catch(E){}i.isBN=o(function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},"isBN"),i.max=o(function(l,g){return l.cmp(g)>0?l:g},"max"),i.min=o(function(l,g){return l.cmp(g)<0?l:g},"min"),i.prototype._init=o(function(l,g,h){if(typeof l=="number")return this._initNumber(l,g,h);if(typeof l=="object")return this._initArray(l,g,h);g==="hex"&&(g=16),t(g===(g|0)&&g>=2&&g<=36),l=l.toString().replace(/\s+/g,"");var c=0;l[0]==="-"&&(c++,this.negative=1),c<l.length&&(g===16?this._parseHex(l,c,h):(this._parseBase(l,g,c),h==="le"&&this._initArray(this.toArray(),g,h)))},"init"),i.prototype._initNumber=o(function(l,g,h){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),g,h)},"_initNumber"),i.prototype._initArray=o(function(l,g,h){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d,y,_=0;if(h==="be")for(c=l.length-1,d=0;c>=0;c-=3)y=l[c]|l[c-1]<<8|l[c-2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);else if(h==="le")for(c=0,d=0;c<l.length;c+=3)y=l[c]|l[c+1]<<8|l[c+2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);return this.strip()},"_initArray");function a(E,l){var g=E.charCodeAt(l);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}o(a,"parseHex4Bits");function f(E,l,g){var h=a(E,g);return g-1>=l&&(h|=a(E,g-1)<<4),h}o(f,"parseHexByte"),i.prototype._parseHex=o(function(l,g,h){this.length=Math.ceil((l.length-g)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d=0,y=0,_;if(h==="be")for(c=l.length-1;c>=g;c-=2)_=f(l,g,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8;else{var w=l.length-g;for(c=w%2===0?g+1:g;c<l.length;c+=2)_=f(l,g,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8}this.strip()},"_parseHex");function u(E,l,g,h){for(var c=0,d=Math.min(E.length,g),y=l;y<d;y++){var _=E.charCodeAt(y)-48;c*=h,_>=49?c+=_-49+10:_>=17?c+=_-17+10:c+=_}return c}o(u,"parseBase"),i.prototype._parseBase=o(function(l,g,h){this.words=[0],this.length=1;for(var c=0,d=1;d<=67108863;d*=g)c++;c--,d=d/g|0;for(var y=l.length-h,_=y%c,w=Math.min(y,y-_)+h,b=0,S=h;S<w;S+=c)b=u(l,S,S+c,g),this.imuln(d),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(_!==0){var D=1;for(b=u(l,S,l.length,g),S=0;S<_;S++)D*=g;this.imuln(D),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this.strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var g=0;g<this.length;g++)l.words[g]=this.words[g];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy"),i.prototype.clone=o(function(){var l=new i(null);return this.copy(l),l},"clone"),i.prototype._expand=o(function(l){for(;this.length<l;)this.words[this.length++]=0;return this},"_expand"),i.prototype.strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),i.prototype.inspect=o(function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"},"inspect");var m=["","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"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=o(function(l,g){l=l||10,g=g|0||1;var h;if(l===16||l==="hex"){h="";for(var c=0,d=0,y=0;y<this.length;y++){var _=this.words[y],w=((_<<c|d)&16777215).toString(16);d=_>>>24-c&16777215,d!==0||y!==this.length-1?h=m[6-w.length]+w+h:h=w+h,c+=2,c>=26&&(c-=26,y--)}for(d!==0&&(h=d.toString(16)+h);h.length%g!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(l===(l|0)&&l>=2&&l<=36){var b=p[l],S=x[l];h="";var D=this.clone();for(D.negative=0;!D.isZero();){var v=D.modn(S).toString(l);D=D.idivn(S),D.isZero()?h=v+h:h=m[b-v.length]+v+h}for(this.isZero()&&(h="0"+h);h.length%g!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(l,g){return t(typeof s!="undefined"),this.toArrayLike(s,l,g)},"toBuffer"),i.prototype.toArray=o(function(l,g){return this.toArrayLike(Array,l,g)},"toArray"),i.prototype.toArrayLike=o(function(l,g,h){var c=this.byteLength(),d=h||Math.max(1,c);t(c<=d,"byte array longer than desired length"),t(d>0,"Requested array length <= 0"),this.strip();var y=g==="le",_=new l(d),w,b,S=this.clone();if(y){for(b=0;!S.isZero();b++)w=S.andln(255),S.iushrn(8),_[b]=w;for(;b<d;b++)_[b]=0}else{for(b=0;b<d-c;b++)_[b]=0;for(b=0;!S.isZero();b++)w=S.andln(255),S.iushrn(8),_[d-b-1]=w}return _},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var g=l,h=0;return g>=4096&&(h+=13,g>>>=13),g>=64&&(h+=7,g>>>=7),g>=8&&(h+=4,g>>>=4),g>=2&&(h+=2,g>>>=2),h+g},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var g=l,h=0;return(g&8191)===0&&(h+=13,g>>>=13),(g&127)===0&&(h+=7,g>>>=7),(g&15)===0&&(h+=4,g>>>=4),(g&3)===0&&(h+=2,g>>>=2),(g&1)===0&&h++,h},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],g=this._countBits(l);return(this.length-1)*26+g},"bitLength");function k(E){for(var l=new Array(E.bitLength()),g=0;g<l.length;g++){var h=g/26|0,c=g%26;l[g]=(E.words[h]&1<<c)>>>c}return l}o(k,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,g=0;g<this.length;g++){var h=this._zeroBits(this.words[g]);if(l+=h,h!==26)break}return l},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var g=0;g<l.length;g++)this.words[g]=this.words[g]|l.words[g];return this.strip()},"iuor"),i.prototype.ior=o(function(l){return t((this.negative|l.negative)===0),this.iuor(l)},"ior"),i.prototype.or=o(function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},"or"),i.prototype.uor=o(function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(l){var g;this.length>l.length?g=l:g=this;for(var h=0;h<g.length;h++)this.words[h]=this.words[h]&l.words[h];return this.length=g.length,this.strip()},"iuand"),i.prototype.iand=o(function(l){return t((this.negative|l.negative)===0),this.iuand(l)},"iand"),i.prototype.and=o(function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},"and"),i.prototype.uand=o(function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(l){var g,h;this.length>l.length?(g=this,h=l):(g=l,h=this);for(var c=0;c<h.length;c++)this.words[c]=g.words[c]^h.words[c];if(this!==g)for(;c<g.length;c++)this.words[c]=g.words[c];return this.length=g.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},"ixor"),i.prototype.xor=o(function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(l){t(typeof l=="number"&&l>=0);var g=Math.ceil(l/26)|0,h=l%26;this._expand(g),h>0&&g--;for(var c=0;c<g;c++)this.words[c]=~this.words[c]&67108863;return h>0&&(this.words[c]=~this.words[c]&67108863>>26-h),this.strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,g){t(typeof l=="number"&&l>=0);var h=l/26|0,c=l%26;return this._expand(h+1),g?this.words[h]=this.words[h]|1<<c:this.words[h]=this.words[h]&~(1<<c),this.strip()},"setn"),i.prototype.iadd=o(function(l){var g;if(this.negative!==0&&l.negative===0)return this.negative=0,g=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,g=this.isub(l),l.negative=1,g._normSign();var h,c;this.length>l.length?(h=this,c=l):(h=l,c=this);for(var d=0,y=0;y<c.length;y++)g=(h.words[y]|0)+(c.words[y]|0)+d,this.words[y]=g&67108863,d=g>>>26;for(;d!==0&&y<h.length;y++)g=(h.words[y]|0)+d,this.words[y]=g&67108863,d=g>>>26;if(this.length=h.length,d!==0)this.words[this.length]=d,this.length++;else if(h!==this)for(;y<h.length;y++)this.words[y]=h.words[y];return this},"iadd"),i.prototype.add=o(function(l){var g;return l.negative!==0&&this.negative===0?(l.negative=0,g=this.sub(l),l.negative^=1,g):l.negative===0&&this.negative!==0?(this.negative=0,g=l.sub(this),this.negative=1,g):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},"add"),i.prototype.isub=o(function(l){if(l.negative!==0){l.negative=0;var g=this.iadd(l);return l.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var h=this.cmp(l);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;h>0?(c=this,d=l):(c=l,d=this);for(var y=0,_=0;_<d.length;_++)g=(c.words[_]|0)-(d.words[_]|0)+y,y=g>>26,this.words[_]=g&67108863;for(;y!==0&&_<c.length;_++)g=(c.words[_]|0)+y,y=g>>26,this.words[_]=g&67108863;if(y===0&&_<c.length&&c!==this)for(;_<c.length;_++)this.words[_]=c.words[_];return this.length=Math.max(this.length,_),c!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function I(E,l,g){g.negative=l.negative^E.negative;var h=E.length+l.length|0;g.length=h,h=h-1|0;var c=E.words[0]|0,d=l.words[0]|0,y=c*d,_=y&67108863,w=y/67108864|0;g.words[0]=_;for(var b=1;b<h;b++){for(var S=w>>>26,D=w&67108863,v=Math.min(b,l.length-1),M=Math.max(0,b-E.length+1);M<=v;M++){var ne=b-M|0;c=E.words[ne]|0,d=l.words[M]|0,y=c*d+D,S+=y/67108864|0,D=y&67108863}g.words[b]=D|0,w=S|0}return w!==0?g.words[b]=w|0:g.length--,g.strip()}o(I,"smallMulTo");var T=o(function(l,g,h){var c=l.words,d=g.words,y=h.words,_=0,w,b,S,D=c[0]|0,v=D&8191,M=D>>>13,ne=c[1]|0,A=ne&8191,K=ne>>>13,J=c[2]|0,N=J&8191,R=J>>>13,V=c[3]|0,W=V&8191,ee=V>>>13,he=c[4]|0,fe=he&8191,Y=he>>>13,pe=c[5]|0,Q=pe&8191,ce=pe>>>13,q=c[6]|0,se=q&8191,be=q>>>13,ke=c[7]|0,we=ke&8191,Ie=ke>>>13,vr=c[8]|0,te=vr&8191,G=vr>>>13,P=c[9]|0,z=P&8191,ae=P>>>13,ue=d[0]|0,le=ue&8191,ge=ue>>>13,ft=d[1]|0,Ee=ft&8191,ve=ft>>>13,lt=d[2]|0,De=lt&8191,Ne=lt>>>13,Bn=d[3]|0,Le=Bn&8191,Be=Bn>>>13,Un=d[4]|0,Ue=Un&8191,Fe=Un>>>13,Fn=d[5]|0,$e=Fn&8191,qe=Fn>>>13,$n=d[6]|0,He=$n&8191,ze=$n>>>13,qn=d[7]|0,je=qn&8191,Ke=qn>>>13,Hn=d[8]|0,Ve=Hn&8191,We=Hn>>>13,zn=d[9]|0,Ge=zn&8191,Ye=zn>>>13;h.negative=l.negative^g.negative,h.length=19,w=Math.imul(v,le),b=Math.imul(v,ge),b=b+Math.imul(M,le)|0,S=Math.imul(M,ge);var gn=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(gn>>>26)|0,gn&=67108863,w=Math.imul(A,le),b=Math.imul(A,ge),b=b+Math.imul(K,le)|0,S=Math.imul(K,ge),w=w+Math.imul(v,Ee)|0,b=b+Math.imul(v,ve)|0,b=b+Math.imul(M,Ee)|0,S=S+Math.imul(M,ve)|0;var mt=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(mt>>>26)|0,mt&=67108863,w=Math.imul(N,le),b=Math.imul(N,ge),b=b+Math.imul(R,le)|0,S=Math.imul(R,ge),w=w+Math.imul(A,Ee)|0,b=b+Math.imul(A,ve)|0,b=b+Math.imul(K,Ee)|0,S=S+Math.imul(K,ve)|0,w=w+Math.imul(v,De)|0,b=b+Math.imul(v,Ne)|0,b=b+Math.imul(M,De)|0,S=S+Math.imul(M,Ne)|0;var bt=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,w=Math.imul(W,le),b=Math.imul(W,ge),b=b+Math.imul(ee,le)|0,S=Math.imul(ee,ge),w=w+Math.imul(N,Ee)|0,b=b+Math.imul(N,ve)|0,b=b+Math.imul(R,Ee)|0,S=S+Math.imul(R,ve)|0,w=w+Math.imul(A,De)|0,b=b+Math.imul(A,Ne)|0,b=b+Math.imul(K,De)|0,S=S+Math.imul(K,Ne)|0,w=w+Math.imul(v,Le)|0,b=b+Math.imul(v,Be)|0,b=b+Math.imul(M,Le)|0,S=S+Math.imul(M,Be)|0;var Yr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,w=Math.imul(fe,le),b=Math.imul(fe,ge),b=b+Math.imul(Y,le)|0,S=Math.imul(Y,ge),w=w+Math.imul(W,Ee)|0,b=b+Math.imul(W,ve)|0,b=b+Math.imul(ee,Ee)|0,S=S+Math.imul(ee,ve)|0,w=w+Math.imul(N,De)|0,b=b+Math.imul(N,Ne)|0,b=b+Math.imul(R,De)|0,S=S+Math.imul(R,Ne)|0,w=w+Math.imul(A,Le)|0,b=b+Math.imul(A,Be)|0,b=b+Math.imul(K,Le)|0,S=S+Math.imul(K,Be)|0,w=w+Math.imul(v,Ue)|0,b=b+Math.imul(v,Fe)|0,b=b+Math.imul(M,Ue)|0,S=S+Math.imul(M,Fe)|0;var Jr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,w=Math.imul(Q,le),b=Math.imul(Q,ge),b=b+Math.imul(ce,le)|0,S=Math.imul(ce,ge),w=w+Math.imul(fe,Ee)|0,b=b+Math.imul(fe,ve)|0,b=b+Math.imul(Y,Ee)|0,S=S+Math.imul(Y,ve)|0,w=w+Math.imul(W,De)|0,b=b+Math.imul(W,Ne)|0,b=b+Math.imul(ee,De)|0,S=S+Math.imul(ee,Ne)|0,w=w+Math.imul(N,Le)|0,b=b+Math.imul(N,Be)|0,b=b+Math.imul(R,Le)|0,S=S+Math.imul(R,Be)|0,w=w+Math.imul(A,Ue)|0,b=b+Math.imul(A,Fe)|0,b=b+Math.imul(K,Ue)|0,S=S+Math.imul(K,Fe)|0,w=w+Math.imul(v,$e)|0,b=b+Math.imul(v,qe)|0,b=b+Math.imul(M,$e)|0,S=S+Math.imul(M,qe)|0;var Xr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,w=Math.imul(se,le),b=Math.imul(se,ge),b=b+Math.imul(be,le)|0,S=Math.imul(be,ge),w=w+Math.imul(Q,Ee)|0,b=b+Math.imul(Q,ve)|0,b=b+Math.imul(ce,Ee)|0,S=S+Math.imul(ce,ve)|0,w=w+Math.imul(fe,De)|0,b=b+Math.imul(fe,Ne)|0,b=b+Math.imul(Y,De)|0,S=S+Math.imul(Y,Ne)|0,w=w+Math.imul(W,Le)|0,b=b+Math.imul(W,Be)|0,b=b+Math.imul(ee,Le)|0,S=S+Math.imul(ee,Be)|0,w=w+Math.imul(N,Ue)|0,b=b+Math.imul(N,Fe)|0,b=b+Math.imul(R,Ue)|0,S=S+Math.imul(R,Fe)|0,w=w+Math.imul(A,$e)|0,b=b+Math.imul(A,qe)|0,b=b+Math.imul(K,$e)|0,S=S+Math.imul(K,qe)|0,w=w+Math.imul(v,He)|0,b=b+Math.imul(v,ze)|0,b=b+Math.imul(M,He)|0,S=S+Math.imul(M,ze)|0;var Zr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,w=Math.imul(we,le),b=Math.imul(we,ge),b=b+Math.imul(Ie,le)|0,S=Math.imul(Ie,ge),w=w+Math.imul(se,Ee)|0,b=b+Math.imul(se,ve)|0,b=b+Math.imul(be,Ee)|0,S=S+Math.imul(be,ve)|0,w=w+Math.imul(Q,De)|0,b=b+Math.imul(Q,Ne)|0,b=b+Math.imul(ce,De)|0,S=S+Math.imul(ce,Ne)|0,w=w+Math.imul(fe,Le)|0,b=b+Math.imul(fe,Be)|0,b=b+Math.imul(Y,Le)|0,S=S+Math.imul(Y,Be)|0,w=w+Math.imul(W,Ue)|0,b=b+Math.imul(W,Fe)|0,b=b+Math.imul(ee,Ue)|0,S=S+Math.imul(ee,Fe)|0,w=w+Math.imul(N,$e)|0,b=b+Math.imul(N,qe)|0,b=b+Math.imul(R,$e)|0,S=S+Math.imul(R,qe)|0,w=w+Math.imul(A,He)|0,b=b+Math.imul(A,ze)|0,b=b+Math.imul(K,He)|0,S=S+Math.imul(K,ze)|0,w=w+Math.imul(v,je)|0,b=b+Math.imul(v,Ke)|0,b=b+Math.imul(M,je)|0,S=S+Math.imul(M,Ke)|0;var Qr=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,w=Math.imul(te,le),b=Math.imul(te,ge),b=b+Math.imul(G,le)|0,S=Math.imul(G,ge),w=w+Math.imul(we,Ee)|0,b=b+Math.imul(we,ve)|0,b=b+Math.imul(Ie,Ee)|0,S=S+Math.imul(Ie,ve)|0,w=w+Math.imul(se,De)|0,b=b+Math.imul(se,Ne)|0,b=b+Math.imul(be,De)|0,S=S+Math.imul(be,Ne)|0,w=w+Math.imul(Q,Le)|0,b=b+Math.imul(Q,Be)|0,b=b+Math.imul(ce,Le)|0,S=S+Math.imul(ce,Be)|0,w=w+Math.imul(fe,Ue)|0,b=b+Math.imul(fe,Fe)|0,b=b+Math.imul(Y,Ue)|0,S=S+Math.imul(Y,Fe)|0,w=w+Math.imul(W,$e)|0,b=b+Math.imul(W,qe)|0,b=b+Math.imul(ee,$e)|0,S=S+Math.imul(ee,qe)|0,w=w+Math.imul(N,He)|0,b=b+Math.imul(N,ze)|0,b=b+Math.imul(R,He)|0,S=S+Math.imul(R,ze)|0,w=w+Math.imul(A,je)|0,b=b+Math.imul(A,Ke)|0,b=b+Math.imul(K,je)|0,S=S+Math.imul(K,Ke)|0,w=w+Math.imul(v,Ve)|0,b=b+Math.imul(v,We)|0,b=b+Math.imul(M,Ve)|0,S=S+Math.imul(M,We)|0;var ko=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(ko>>>26)|0,ko&=67108863,w=Math.imul(z,le),b=Math.imul(z,ge),b=b+Math.imul(ae,le)|0,S=Math.imul(ae,ge),w=w+Math.imul(te,Ee)|0,b=b+Math.imul(te,ve)|0,b=b+Math.imul(G,Ee)|0,S=S+Math.imul(G,ve)|0,w=w+Math.imul(we,De)|0,b=b+Math.imul(we,Ne)|0,b=b+Math.imul(Ie,De)|0,S=S+Math.imul(Ie,Ne)|0,w=w+Math.imul(se,Le)|0,b=b+Math.imul(se,Be)|0,b=b+Math.imul(be,Le)|0,S=S+Math.imul(be,Be)|0,w=w+Math.imul(Q,Ue)|0,b=b+Math.imul(Q,Fe)|0,b=b+Math.imul(ce,Ue)|0,S=S+Math.imul(ce,Fe)|0,w=w+Math.imul(fe,$e)|0,b=b+Math.imul(fe,qe)|0,b=b+Math.imul(Y,$e)|0,S=S+Math.imul(Y,qe)|0,w=w+Math.imul(W,He)|0,b=b+Math.imul(W,ze)|0,b=b+Math.imul(ee,He)|0,S=S+Math.imul(ee,ze)|0,w=w+Math.imul(N,je)|0,b=b+Math.imul(N,Ke)|0,b=b+Math.imul(R,je)|0,S=S+Math.imul(R,Ke)|0,w=w+Math.imul(A,Ve)|0,b=b+Math.imul(A,We)|0,b=b+Math.imul(K,Ve)|0,S=S+Math.imul(K,We)|0,w=w+Math.imul(v,Ge)|0,b=b+Math.imul(v,Ye)|0,b=b+Math.imul(M,Ge)|0,S=S+Math.imul(M,Ye)|0;var Co=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Co>>>26)|0,Co&=67108863,w=Math.imul(z,Ee),b=Math.imul(z,ve),b=b+Math.imul(ae,Ee)|0,S=Math.imul(ae,ve),w=w+Math.imul(te,De)|0,b=b+Math.imul(te,Ne)|0,b=b+Math.imul(G,De)|0,S=S+Math.imul(G,Ne)|0,w=w+Math.imul(we,Le)|0,b=b+Math.imul(we,Be)|0,b=b+Math.imul(Ie,Le)|0,S=S+Math.imul(Ie,Be)|0,w=w+Math.imul(se,Ue)|0,b=b+Math.imul(se,Fe)|0,b=b+Math.imul(be,Ue)|0,S=S+Math.imul(be,Fe)|0,w=w+Math.imul(Q,$e)|0,b=b+Math.imul(Q,qe)|0,b=b+Math.imul(ce,$e)|0,S=S+Math.imul(ce,qe)|0,w=w+Math.imul(fe,He)|0,b=b+Math.imul(fe,ze)|0,b=b+Math.imul(Y,He)|0,S=S+Math.imul(Y,ze)|0,w=w+Math.imul(W,je)|0,b=b+Math.imul(W,Ke)|0,b=b+Math.imul(ee,je)|0,S=S+Math.imul(ee,Ke)|0,w=w+Math.imul(N,Ve)|0,b=b+Math.imul(N,We)|0,b=b+Math.imul(R,Ve)|0,S=S+Math.imul(R,We)|0,w=w+Math.imul(A,Ge)|0,b=b+Math.imul(A,Ye)|0,b=b+Math.imul(K,Ge)|0,S=S+Math.imul(K,Ye)|0;var Do=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Do>>>26)|0,Do&=67108863,w=Math.imul(z,De),b=Math.imul(z,Ne),b=b+Math.imul(ae,De)|0,S=Math.imul(ae,Ne),w=w+Math.imul(te,Le)|0,b=b+Math.imul(te,Be)|0,b=b+Math.imul(G,Le)|0,S=S+Math.imul(G,Be)|0,w=w+Math.imul(we,Ue)|0,b=b+Math.imul(we,Fe)|0,b=b+Math.imul(Ie,Ue)|0,S=S+Math.imul(Ie,Fe)|0,w=w+Math.imul(se,$e)|0,b=b+Math.imul(se,qe)|0,b=b+Math.imul(be,$e)|0,S=S+Math.imul(be,qe)|0,w=w+Math.imul(Q,He)|0,b=b+Math.imul(Q,ze)|0,b=b+Math.imul(ce,He)|0,S=S+Math.imul(ce,ze)|0,w=w+Math.imul(fe,je)|0,b=b+Math.imul(fe,Ke)|0,b=b+Math.imul(Y,je)|0,S=S+Math.imul(Y,Ke)|0,w=w+Math.imul(W,Ve)|0,b=b+Math.imul(W,We)|0,b=b+Math.imul(ee,Ve)|0,S=S+Math.imul(ee,We)|0,w=w+Math.imul(N,Ge)|0,b=b+Math.imul(N,Ye)|0,b=b+Math.imul(R,Ge)|0,S=S+Math.imul(R,Ye)|0;var Oo=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,w=Math.imul(z,Le),b=Math.imul(z,Be),b=b+Math.imul(ae,Le)|0,S=Math.imul(ae,Be),w=w+Math.imul(te,Ue)|0,b=b+Math.imul(te,Fe)|0,b=b+Math.imul(G,Ue)|0,S=S+Math.imul(G,Fe)|0,w=w+Math.imul(we,$e)|0,b=b+Math.imul(we,qe)|0,b=b+Math.imul(Ie,$e)|0,S=S+Math.imul(Ie,qe)|0,w=w+Math.imul(se,He)|0,b=b+Math.imul(se,ze)|0,b=b+Math.imul(be,He)|0,S=S+Math.imul(be,ze)|0,w=w+Math.imul(Q,je)|0,b=b+Math.imul(Q,Ke)|0,b=b+Math.imul(ce,je)|0,S=S+Math.imul(ce,Ke)|0,w=w+Math.imul(fe,Ve)|0,b=b+Math.imul(fe,We)|0,b=b+Math.imul(Y,Ve)|0,S=S+Math.imul(Y,We)|0,w=w+Math.imul(W,Ge)|0,b=b+Math.imul(W,Ye)|0,b=b+Math.imul(ee,Ge)|0,S=S+Math.imul(ee,Ye)|0;var Io=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Io>>>26)|0,Io&=67108863,w=Math.imul(z,Ue),b=Math.imul(z,Fe),b=b+Math.imul(ae,Ue)|0,S=Math.imul(ae,Fe),w=w+Math.imul(te,$e)|0,b=b+Math.imul(te,qe)|0,b=b+Math.imul(G,$e)|0,S=S+Math.imul(G,qe)|0,w=w+Math.imul(we,He)|0,b=b+Math.imul(we,ze)|0,b=b+Math.imul(Ie,He)|0,S=S+Math.imul(Ie,ze)|0,w=w+Math.imul(se,je)|0,b=b+Math.imul(se,Ke)|0,b=b+Math.imul(be,je)|0,S=S+Math.imul(be,Ke)|0,w=w+Math.imul(Q,Ve)|0,b=b+Math.imul(Q,We)|0,b=b+Math.imul(ce,Ve)|0,S=S+Math.imul(ce,We)|0,w=w+Math.imul(fe,Ge)|0,b=b+Math.imul(fe,Ye)|0,b=b+Math.imul(Y,Ge)|0,S=S+Math.imul(Y,Ye)|0;var Po=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Po>>>26)|0,Po&=67108863,w=Math.imul(z,$e),b=Math.imul(z,qe),b=b+Math.imul(ae,$e)|0,S=Math.imul(ae,qe),w=w+Math.imul(te,He)|0,b=b+Math.imul(te,ze)|0,b=b+Math.imul(G,He)|0,S=S+Math.imul(G,ze)|0,w=w+Math.imul(we,je)|0,b=b+Math.imul(we,Ke)|0,b=b+Math.imul(Ie,je)|0,S=S+Math.imul(Ie,Ke)|0,w=w+Math.imul(se,Ve)|0,b=b+Math.imul(se,We)|0,b=b+Math.imul(be,Ve)|0,S=S+Math.imul(be,We)|0,w=w+Math.imul(Q,Ge)|0,b=b+Math.imul(Q,Ye)|0,b=b+Math.imul(ce,Ge)|0,S=S+Math.imul(ce,Ye)|0;var No=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(No>>>26)|0,No&=67108863,w=Math.imul(z,He),b=Math.imul(z,ze),b=b+Math.imul(ae,He)|0,S=Math.imul(ae,ze),w=w+Math.imul(te,je)|0,b=b+Math.imul(te,Ke)|0,b=b+Math.imul(G,je)|0,S=S+Math.imul(G,Ke)|0,w=w+Math.imul(we,Ve)|0,b=b+Math.imul(we,We)|0,b=b+Math.imul(Ie,Ve)|0,S=S+Math.imul(Ie,We)|0,w=w+Math.imul(se,Ge)|0,b=b+Math.imul(se,Ye)|0,b=b+Math.imul(be,Ge)|0,S=S+Math.imul(be,Ye)|0;var Ro=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,w=Math.imul(z,je),b=Math.imul(z,Ke),b=b+Math.imul(ae,je)|0,S=Math.imul(ae,Ke),w=w+Math.imul(te,Ve)|0,b=b+Math.imul(te,We)|0,b=b+Math.imul(G,Ve)|0,S=S+Math.imul(G,We)|0,w=w+Math.imul(we,Ge)|0,b=b+Math.imul(we,Ye)|0,b=b+Math.imul(Ie,Ge)|0,S=S+Math.imul(Ie,Ye)|0;var Lo=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,w=Math.imul(z,Ve),b=Math.imul(z,We),b=b+Math.imul(ae,Ve)|0,S=Math.imul(ae,We),w=w+Math.imul(te,Ge)|0,b=b+Math.imul(te,Ye)|0,b=b+Math.imul(G,Ge)|0,S=S+Math.imul(G,Ye)|0;var Bo=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,w=Math.imul(z,Ge),b=Math.imul(z,Ye),b=b+Math.imul(ae,Ge)|0,S=Math.imul(ae,Ye);var Uo=(_+w|0)+((b&8191)<<13)|0;return _=(S+(b>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,y[0]=gn,y[1]=mt,y[2]=bt,y[3]=Yr,y[4]=Jr,y[5]=Xr,y[6]=Zr,y[7]=Qr,y[8]=ko,y[9]=Co,y[10]=Do,y[11]=Oo,y[12]=Io,y[13]=Po,y[14]=No,y[15]=Ro,y[16]=Lo,y[17]=Bo,y[18]=Uo,_!==0&&(y[19]=_,h.length++),h},"comb10MulTo");Math.imul||(T=I);function C(E,l,g){g.negative=l.negative^E.negative,g.length=E.length+l.length;for(var h=0,c=0,d=0;d<g.length-1;d++){var y=c;c=0;for(var _=h&67108863,w=Math.min(d,l.length-1),b=Math.max(0,d-E.length+1);b<=w;b++){var S=d-b,D=E.words[S]|0,v=l.words[b]|0,M=D*v,ne=M&67108863;y=y+(M/67108864|0)|0,ne=ne+_|0,_=ne&67108863,y=y+(ne>>>26)|0,c+=y>>>26,y&=67108863}g.words[d]=_,h=y,y=c}return h!==0?g.words[d]=h:g.length--,g.strip()}o(C,"bigMulTo");function $(E,l,g){var h=new O;return h.mulp(E,l,g)}o($,"jumboMulTo"),i.prototype.mulTo=o(function(l,g){var h,c=this.length+l.length;return this.length===10&&l.length===10?h=T(this,l,g):c<63?h=I(this,l,g):c<1024?h=C(this,l,g):h=$(this,l,g),h},"mulTo");function O(E,l){this.x=E,this.y=l}o(O,"FFTM"),O.prototype.makeRBT=o(function(l){for(var g=new Array(l),h=i.prototype._countBits(l)-1,c=0;c<l;c++)g[c]=this.revBin(c,h,l);return g},"makeRBT"),O.prototype.revBin=o(function(l,g,h){if(l===0||l===h-1)return l;for(var c=0,d=0;d<g;d++)c|=(l&1)<<g-d-1,l>>=1;return c},"revBin"),O.prototype.permute=o(function(l,g,h,c,d,y){for(var _=0;_<y;_++)c[_]=g[l[_]],d[_]=h[l[_]]},"permute"),O.prototype.transform=o(function(l,g,h,c,d,y){this.permute(y,l,g,h,c,d);for(var _=1;_<d;_<<=1)for(var w=_<<1,b=Math.cos(2*Math.PI/w),S=Math.sin(2*Math.PI/w),D=0;D<d;D+=w)for(var v=b,M=S,ne=0;ne<_;ne++){var A=h[D+ne],K=c[D+ne],J=h[D+ne+_],N=c[D+ne+_],R=v*J-M*N;N=v*N+M*J,J=R,h[D+ne]=A+J,c[D+ne]=K+N,h[D+ne+_]=A-J,c[D+ne+_]=K-N,ne!==w&&(R=b*v-S*M,M=b*M+S*v,v=R)}},"transform"),O.prototype.guessLen13b=o(function(l,g){var h=Math.max(g,l)|1,c=h&1,d=0;for(h=h/2|0;h;h=h>>>1)d++;return 1<<d+1+c},"guessLen13b"),O.prototype.conjugate=o(function(l,g,h){if(!(h<=1))for(var c=0;c<h/2;c++){var d=l[c];l[c]=l[h-c-1],l[h-c-1]=d,d=g[c],g[c]=-g[h-c-1],g[h-c-1]=-d}},"conjugate"),O.prototype.normalize13b=o(function(l,g){for(var h=0,c=0;c<g/2;c++){var d=Math.round(l[2*c+1]/g)*8192+Math.round(l[2*c]/g)+h;l[c]=d&67108863,d<67108864?h=0:h=d/67108864|0}return l},"normalize13b"),O.prototype.convert13b=o(function(l,g,h,c){for(var d=0,y=0;y<g;y++)d=d+(l[y]|0),h[2*y]=d&8191,d=d>>>13,h[2*y+1]=d&8191,d=d>>>13;for(y=2*g;y<c;++y)h[y]=0;t(d===0),t((d&-8192)===0)},"convert13b"),O.prototype.stub=o(function(l){for(var g=new Array(l),h=0;h<l;h++)g[h]=0;return g},"stub"),O.prototype.mulp=o(function(l,g,h){var c=2*this.guessLen13b(l.length,g.length),d=this.makeRBT(c),y=this.stub(c),_=new Array(c),w=new Array(c),b=new Array(c),S=new Array(c),D=new Array(c),v=new Array(c),M=h.words;M.length=c,this.convert13b(l.words,l.length,_,c),this.convert13b(g.words,g.length,S,c),this.transform(_,y,w,b,c,d),this.transform(S,y,D,v,c,d);for(var ne=0;ne<c;ne++){var A=w[ne]*D[ne]-b[ne]*v[ne];b[ne]=w[ne]*v[ne]+b[ne]*D[ne],w[ne]=A}return this.conjugate(w,b,c),this.transform(w,b,M,y,c,d),this.conjugate(M,y,c),this.normalize13b(M,c),h.negative=l.negative^g.negative,h.length=l.length+g.length,h.strip()},"mulp"),i.prototype.mul=o(function(l){var g=new i(null);return g.words=new Array(this.length+l.length),this.mulTo(l,g)},"mul"),i.prototype.mulf=o(function(l){var g=new i(null);return g.words=new Array(this.length+l.length),$(this,l,g)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){t(typeof l=="number"),t(l<67108864);for(var g=0,h=0;h<this.length;h++){var c=(this.words[h]|0)*l,d=(c&67108863)+(g&67108863);g>>=26,g+=c/67108864|0,g+=d>>>26,this.words[h]=d&67108863}return g!==0&&(this.words[h]=g,this.length++),this},"imuln"),i.prototype.muln=o(function(l){return this.clone().imuln(l)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(l){var g=k(l);if(g.length===0)return new i(1);for(var h=this,c=0;c<g.length&&g[c]===0;c++,h=h.sqr());if(++c<g.length)for(var d=h.sqr();c<g.length;c++,d=d.sqr())g[c]!==0&&(h=h.mul(d));return h},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var g=l%26,h=(l-g)/26,c=67108863>>>26-g<<26-g,d;if(g!==0){var y=0;for(d=0;d<this.length;d++){var _=this.words[d]&c,w=(this.words[d]|0)-_<<g;this.words[d]=w|y,y=_>>>26-g}y&&(this.words[d]=y,this.length++)}if(h!==0){for(d=this.length-1;d>=0;d--)this.words[d+h]=this.words[d];for(d=0;d<h;d++)this.words[d]=0;this.length+=h}return this.strip()},"iushln"),i.prototype.ishln=o(function(l){return t(this.negative===0),this.iushln(l)},"ishln"),i.prototype.iushrn=o(function(l,g,h){t(typeof l=="number"&&l>=0);var c;g?c=(g-g%26)/26:c=0;var d=l%26,y=Math.min((l-d)/26,this.length),_=67108863^67108863>>>d<<d,w=h;if(c-=y,c=Math.max(0,c),w){for(var b=0;b<y;b++)w.words[b]=this.words[b];w.length=y}if(y!==0)if(this.length>y)for(this.length-=y,b=0;b<this.length;b++)this.words[b]=this.words[b+y];else this.words[0]=0,this.length=1;var S=0;for(b=this.length-1;b>=0&&(S!==0||b>=c);b--){var D=this.words[b]|0;this.words[b]=S<<26-d|D>>>d,S=D&_}return w&&S!==0&&(w.words[w.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(l,g,h){return t(this.negative===0),this.iushrn(l,g,h)},"ishrn"),i.prototype.shln=o(function(l){return this.clone().ishln(l)},"shln"),i.prototype.ushln=o(function(l){return this.clone().iushln(l)},"ushln"),i.prototype.shrn=o(function(l){return this.clone().ishrn(l)},"shrn"),i.prototype.ushrn=o(function(l){return this.clone().iushrn(l)},"ushrn"),i.prototype.testn=o(function(l){t(typeof l=="number"&&l>=0);var g=l%26,h=(l-g)/26,c=1<<g;if(this.length<=h)return!1;var d=this.words[h];return!!(d&c)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var g=l%26,h=(l-g)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(g!==0&&h++,this.length=Math.min(h,this.length),g!==0){var c=67108863^67108863>>>g<<g;this.words[this.length-1]&=c}return this.strip()},"imaskn"),i.prototype.maskn=o(function(l){return this.clone().imaskn(l)},"maskn"),i.prototype.iaddn=o(function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},"iaddn"),i.prototype._iaddn=o(function(l){this.words[0]+=l;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},"_iaddn"),i.prototype.isubn=o(function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(l){return this.clone().iaddn(l)},"addn"),i.prototype.subn=o(function(l){return this.clone().isubn(l)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(l,g,h){var c=l.length+h,d;this._expand(c);var y,_=0;for(d=0;d<l.length;d++){y=(this.words[d+h]|0)+_;var w=(l.words[d]|0)*g;y-=w&67108863,_=(y>>26)-(w/67108864|0),this.words[d+h]=y&67108863}for(;d<this.length-h;d++)y=(this.words[d+h]|0)+_,_=y>>26,this.words[d+h]=y&67108863;if(_===0)return this.strip();for(t(_===-1),_=0,d=0;d<this.length;d++)y=-(this.words[d]|0)+_,_=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,g){var h=this.length-l.length,c=this.clone(),d=l,y=d.words[d.length-1]|0,_=this._countBits(y);h=26-_,h!==0&&(d=d.ushln(h),c.iushln(h),y=d.words[d.length-1]|0);var w=c.length-d.length,b;if(g!=="mod"){b=new i(null),b.length=w+1,b.words=new Array(b.length);for(var S=0;S<b.length;S++)b.words[S]=0}var D=c.clone()._ishlnsubmul(d,1,w);D.negative===0&&(c=D,b&&(b.words[w]=1));for(var v=w-1;v>=0;v--){var M=(c.words[d.length+v]|0)*67108864+(c.words[d.length+v-1]|0);for(M=Math.min(M/y|0,67108863),c._ishlnsubmul(d,M,v);c.negative!==0;)M--,c.negative=0,c._ishlnsubmul(d,1,v),c.isZero()||(c.negative^=1);b&&(b.words[v]=M)}return b&&b.strip(),c.strip(),g!=="div"&&h!==0&&c.iushrn(h),{div:b||null,mod:c}},"_wordDiv"),i.prototype.divmod=o(function(l,g,h){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var c,d,y;return this.negative!==0&&l.negative===0?(y=this.neg().divmod(l,g),g!=="mod"&&(c=y.div.neg()),g!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.iadd(l)),{div:c,mod:d}):this.negative===0&&l.negative!==0?(y=this.divmod(l.neg(),g),g!=="mod"&&(c=y.div.neg()),{div:c,mod:y.mod}):(this.negative&l.negative)!==0?(y=this.neg().divmod(l.neg(),g),g!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.isub(l)),{div:y.div,mod:d}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?g==="div"?{div:this.divn(l.words[0]),mod:null}:g==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,g)},"divmod"),i.prototype.div=o(function(l){return this.divmod(l,"div",!1).div},"div"),i.prototype.mod=o(function(l){return this.divmod(l,"mod",!1).mod},"mod"),i.prototype.umod=o(function(l){return this.divmod(l,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(l){var g=this.divmod(l);if(g.mod.isZero())return g.div;var h=g.div.negative!==0?g.mod.isub(l):g.mod,c=l.ushrn(1),d=l.andln(1),y=h.cmp(c);return y<0||d===1&&y===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(l){t(l<=67108863);for(var g=(1<<26)%l,h=0,c=this.length-1;c>=0;c--)h=(g*h+(this.words[c]|0))%l;return h},"modn"),i.prototype.idivn=o(function(l){t(l<=67108863);for(var g=0,h=this.length-1;h>=0;h--){var c=(this.words[h]|0)+g*67108864;this.words[h]=c/l|0,g=c%l}return this.strip()},"idivn"),i.prototype.divn=o(function(l){return this.clone().idivn(l)},"divn"),i.prototype.egcd=o(function(l){t(l.negative===0),t(!l.isZero());var g=this,h=l.clone();g.negative!==0?g=g.umod(l):g=g.clone();for(var c=new i(1),d=new i(0),y=new i(0),_=new i(1),w=0;g.isEven()&&h.isEven();)g.iushrn(1),h.iushrn(1),++w;for(var b=h.clone(),S=g.clone();!g.isZero();){for(var D=0,v=1;(g.words[0]&v)===0&&D<26;++D,v<<=1);if(D>0)for(g.iushrn(D);D-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(b),d.isub(S)),c.iushrn(1),d.iushrn(1);for(var M=0,ne=1;(h.words[0]&ne)===0&&M<26;++M,ne<<=1);if(M>0)for(h.iushrn(M);M-- >0;)(y.isOdd()||_.isOdd())&&(y.iadd(b),_.isub(S)),y.iushrn(1),_.iushrn(1);g.cmp(h)>=0?(g.isub(h),c.isub(y),d.isub(_)):(h.isub(g),y.isub(c),_.isub(d))}return{a:y,b:_,gcd:h.iushln(w)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var g=this,h=l.clone();g.negative!==0?g=g.umod(l):g=g.clone();for(var c=new i(1),d=new i(0),y=h.clone();g.cmpn(1)>0&&h.cmpn(1)>0;){for(var _=0,w=1;(g.words[0]&w)===0&&_<26;++_,w<<=1);if(_>0)for(g.iushrn(_);_-- >0;)c.isOdd()&&c.iadd(y),c.iushrn(1);for(var b=0,S=1;(h.words[0]&S)===0&&b<26;++b,S<<=1);if(b>0)for(h.iushrn(b);b-- >0;)d.isOdd()&&d.iadd(y),d.iushrn(1);g.cmp(h)>=0?(g.isub(h),c.isub(d)):(h.isub(g),d.isub(c))}var D;return g.cmpn(1)===0?D=c:D=d,D.cmpn(0)<0&&D.iadd(l),D},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var g=this.clone(),h=l.clone();g.negative=0,h.negative=0;for(var c=0;g.isEven()&&h.isEven();c++)g.iushrn(1),h.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;h.isEven();)h.iushrn(1);var d=g.cmp(h);if(d<0){var y=g;g=h,h=y}else if(d===0||h.cmpn(1)===0)break;g.isub(h)}while(!0);return h.iushln(c)},"gcd"),i.prototype.invm=o(function(l){return this.egcd(l).a.umod(l)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(l){return this.words[0]&l},"andln"),i.prototype.bincn=o(function(l){t(typeof l=="number");var g=l%26,h=(l-g)/26,c=1<<g;if(this.length<=h)return this._expand(h+1),this.words[h]|=c,this;for(var d=c,y=h;d!==0&&y<this.length;y++){var _=this.words[y]|0;_+=d,d=_>>>26,_&=67108863,this.words[y]=_}return d!==0&&(this.words[y]=d,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(l){var g=l<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var h;if(this.length>1)h=1;else{g&&(l=-l),t(l<=67108863,"Number is too big");var c=this.words[0]|0;h=c===l?0:c<l?-1:1}return this.negative!==0?-h|0:h},"cmpn"),i.prototype.cmp=o(function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var g=this.ucmp(l);return this.negative!==0?-g|0:g},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var g=0,h=this.length-1;h>=0;h--){var c=this.words[h]|0,d=l.words[h]|0;if(c!==d){c<d?g=-1:c>d&&(g=1);break}}return g},"ucmp"),i.prototype.gtn=o(function(l){return this.cmpn(l)===1},"gtn"),i.prototype.gt=o(function(l){return this.cmp(l)===1},"gt"),i.prototype.gten=o(function(l){return this.cmpn(l)>=0},"gten"),i.prototype.gte=o(function(l){return this.cmp(l)>=0},"gte"),i.prototype.ltn=o(function(l){return this.cmpn(l)===-1},"ltn"),i.prototype.lt=o(function(l){return this.cmp(l)===-1},"lt"),i.prototype.lten=o(function(l){return this.cmpn(l)<=0},"lten"),i.prototype.lte=o(function(l){return this.cmp(l)<=0},"lte"),i.prototype.eqn=o(function(l){return this.cmpn(l)===0},"eqn"),i.prototype.eq=o(function(l){return this.cmp(l)===0},"eq"),i.red=o(function(l){return new F(l)},"red"),i.prototype.toRed=o(function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(l){return this.red=l,this},"_forceRed"),i.prototype.forceRed=o(function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},"forceRed"),i.prototype.redAdd=o(function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},"redAdd"),i.prototype.redIAdd=o(function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},"redIAdd"),i.prototype.redSub=o(function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},"redSub"),i.prototype.redISub=o(function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},"redISub"),i.prototype.redShl=o(function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},"redShl"),i.prototype.redMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},"redMul"),i.prototype.redIMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)},"redPow");var U={k256:null,p224:null,p192:null,p25519:null};function j(E,l){this.name=E,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(j,"MPrime"),j.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),j.prototype.ireduce=o(function(l){var g=l,h;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),h=g.bitLength();while(h>this.n);var c=h<this.n?-1:g.ucmp(this.p);return c===0?(g.words[0]=0,g.length=1):c>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},"ireduce"),j.prototype.split=o(function(l,g){l.iushrn(this.n,0,g)},"split"),j.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,j),H.prototype.split=o(function(l,g){for(var h=4194303,c=Math.min(l.length,9),d=0;d<c;d++)g.words[d]=l.words[d];if(g.length=c,l.length<=9){l.words[0]=0,l.length=1;return}var y=l.words[9];for(g.words[g.length++]=y&h,d=10;d<l.length;d++){var _=l.words[d]|0;l.words[d-10]=(_&h)<<4|y>>>22,y=_}y>>>=22,l.words[d-10]=y,y===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var g=0,h=0;h<l.length;h++){var c=l.words[h]|0;g+=c*977,l.words[h]=g&67108863,g=c*64+(g/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function X(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(X,"P224"),n(X,j);function B(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(B,"P192"),n(B,j);function L(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,j),L.prototype.imulK=o(function(l){for(var g=0,h=0;h<l.length;h++){var c=(l.words[h]|0)*19+g,d=c&67108863;c>>>=26,l.words[h]=d,g=c}return g!==0&&(l.words[l.length++]=g),l},"imulK"),i._prime=o(function(l){if(U[l])return U[l];var g;if(l==="k256")g=new H;else if(l==="p224")g=new X;else if(l==="p192")g=new B;else if(l==="p25519")g=new L;else throw new Error("Unknown prime "+l);return U[l]=g,g},"prime");function F(E){if(typeof E=="string"){var l=i._prime(E);this.m=l.p,this.prime=l}else t(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}o(F,"Red"),F.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),F.prototype._verify2=o(function(l,g){t((l.negative|g.negative)===0,"red works only with positives"),t(l.red&&l.red===g.red,"red works only with red numbers")},"_verify2"),F.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},"imod"),F.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),F.prototype.add=o(function(l,g){this._verify2(l,g);var h=l.add(g);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},"add"),F.prototype.iadd=o(function(l,g){this._verify2(l,g);var h=l.iadd(g);return h.cmp(this.m)>=0&&h.isub(this.m),h},"iadd"),F.prototype.sub=o(function(l,g){this._verify2(l,g);var h=l.sub(g);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},"sub"),F.prototype.isub=o(function(l,g){this._verify2(l,g);var h=l.isub(g);return h.cmpn(0)<0&&h.iadd(this.m),h},"isub"),F.prototype.shl=o(function(l,g){return this._verify1(l),this.imod(l.ushln(g))},"shl"),F.prototype.imul=o(function(l,g){return this._verify2(l,g),this.imod(l.imul(g))},"imul"),F.prototype.mul=o(function(l,g){return this._verify2(l,g),this.imod(l.mul(g))},"mul"),F.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),F.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),F.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var g=this.m.andln(3);if(t(g%2===1),g===3){var h=this.m.add(new i(1)).iushrn(2);return this.pow(l,h)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);t(!c.isZero());var y=new i(1).toRed(this),_=y.redNeg(),w=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new i(2*b*b).toRed(this);this.pow(b,w).cmp(_)!==0;)b.redIAdd(_);for(var S=this.pow(b,c),D=this.pow(l,c.addn(1).iushrn(1)),v=this.pow(l,c),M=d;v.cmp(y)!==0;){for(var ne=v,A=0;ne.cmp(y)!==0;A++)ne=ne.redSqr();t(A<M);var K=this.pow(S,new i(1).iushln(M-A-1));D=D.redMul(K),S=K.redSqr(),v=v.redMul(S),M=A}return D},"sqrt"),F.prototype.invm=o(function(l){var g=l._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},"invm"),F.prototype.pow=o(function(l,g){if(g.isZero())return new i(1).toRed(this);if(g.cmpn(1)===0)return l.clone();var h=4,c=new Array(1<<h);c[0]=new i(1).toRed(this),c[1]=l;for(var d=2;d<c.length;d++)c[d]=this.mul(c[d-1],l);var y=c[0],_=0,w=0,b=g.bitLength()%26;for(b===0&&(b=26),d=g.length-1;d>=0;d--){for(var S=g.words[d],D=b-1;D>=0;D--){var v=S>>D&1;if(y!==c[0]&&(y=this.sqr(y)),v===0&&_===0){w=0;continue}_<<=1,_|=v,w++,!(w!==h&&(d!==0||D!==0))&&(y=this.mul(y,c[_]),w=0,_=0)}b=26}return y},"pow"),F.prototype.convertTo=o(function(l){var g=l.umod(this.m);return g===l?g.clone():g},"convertTo"),F.prototype.convertFrom=o(function(l){var g=l.clone();return g.red=null,g},"convertFrom"),i.mont=o(function(l){return new re(l)},"mont");function re(E){F.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(re,"Mont"),n(re,F),re.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),re.prototype.convertFrom=o(function(l){var g=this.imod(l.mul(this.rinv));return g.red=null,g},"convertFrom"),re.prototype.imul=o(function(l,g){if(l.isZero()||g.isZero())return l.words[0]=0,l.length=1,l;var h=l.imul(g),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"imul"),re.prototype.mul=o(function(l,g){if(l.isZero()||g.isZero())return new i(0)._forceRed(this);var h=l.mul(g),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"mul"),re.prototype.invm=o(function(l){var g=this.imod(l._invmp(this.m).mul(this.r2));return g._forceRed(this)},"invm")})(typeof th=="undefined"||th,x1)});var Ji=me((fN,_1)=>{_1.exports=w1;function w1(r,e){if(!r)throw new Error(e||"Assertion failed")}o(w1,"assert");w1.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var rh=me(M1=>{"use strict";var Jc=M1;function D_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r!="string"){for(var n=0;n<r.length;n++)t[n]=r[n]|0;return t}if(e==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var n=0;n<r.length;n+=2)t.push(parseInt(r[n]+r[n+1],16))}else for(var n=0;n<r.length;n++){var i=r.charCodeAt(n),s=i>>8,a=i&255;s?t.push(s,a):t.push(a)}return t}o(D_,"toArray");Jc.toArray=D_;function E1(r){return r.length===1?"0"+r:r}o(E1,"zero2");Jc.zero2=E1;function S1(r){for(var e="",t=0;t<r.length;t++)e+=E1(r[t].toString(16));return e}o(S1,"toHex");Jc.toHex=S1;Jc.encode=o(function(e,t){return t==="hex"?S1(e):e},"encode")});var Ir=me(A1=>{"use strict";var xn=A1,O_=Wn(),I_=Ji(),Xc=rh();xn.assert=I_;xn.toArray=Xc.toArray;xn.zero2=Xc.zero2;xn.toHex=Xc.toHex;xn.encode=Xc.encode;function P_(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1);n.fill(0);for(var i=1<<e+1,s=r.clone(),a=0;a<n.length;a++){var f,u=s.andln(i-1);s.isOdd()?(u>(i>>1)-1?f=(i>>1)-u:f=u,s.isubn(f)):f=0,n[a]=f,s.iushrn(1)}return n}o(P_,"getNAF");xn.getNAF=P_;function N_(r,e){var t=[[],[]];r=r.clone(),e=e.clone();for(var n=0,i=0,s;r.cmpn(-n)>0||e.cmpn(-i)>0;){var a=r.andln(3)+n&3,f=e.andln(3)+i&3;a===3&&(a=-1),f===3&&(f=-1);var u;(a&1)===0?u=0:(s=r.andln(7)+n&7,(s===3||s===5)&&f===2?u=-a:u=a),t[0].push(u);var m;(f&1)===0?m=0:(s=e.andln(7)+i&7,(s===3||s===5)&&a===2?m=-f:m=f),t[1].push(m),2*n===u+1&&(n=1-n),2*i===m+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(N_,"getJSF");xn.getJSF=N_;function R_(r,e,t){var n="_"+e;r.prototype[e]=o(function(){return this[n]!==void 0?this[n]:this[n]=t.call(this)},"cachedProperty")}o(R_,"cachedProperty");xn.cachedProperty=R_;function L_(r){return typeof r=="string"?xn.toArray(r,"hex"):r}o(L_,"parseBytes");xn.parseBytes=L_;function B_(r){return new O_(r,"hex","le")}o(B_,"intFromLE");xn.intFromLE=B_});var sh=me((lN,oh)=>{var nh;oh.exports=o(function(e){return nh||(nh=new Xi(null)),nh.generate(e)},"rand");function Xi(r){this.rand=r}o(Xi,"Rand");oh.exports.Rand=Xi;Xi.prototype.generate=o(function(e){return this._rand(e)},"generate");Xi.prototype._rand=o(function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"_rand");if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Xi.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Xi.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(Xi.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(ih=require("crypto"),typeof ih.randomBytes!="function")throw new Error("Not supported");Xi.prototype._rand=o(function(e){return ih.randomBytes(e)},"_rand")}catch(r){}var ih});var hf=me((dN,T1)=>{"use strict";var Vo=Wn(),df=Ir(),Zc=df.getNAF,U_=df.getJSF,Qc=df.assert;function Zi(r,e){this.type=r,this.p=new Vo(e.p,16),this.red=e.prime?Vo.red(e.prime):Vo.mont(this.p),this.zero=new Vo(0).toRed(this.red),this.one=new Vo(1).toRed(this.red),this.two=new Vo(2).toRed(this.red),this.n=e.n&&new Vo(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Zi,"BaseCurve");T1.exports=Zi;Zi.prototype.point=o(function(){throw new Error("Not implemented")},"point");Zi.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Zi.prototype._fixedNafMul=o(function(e,t){Qc(e.precomputed);var n=e._getDoubles(),i=Zc(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var m=f+n.step-1;m>=f;m--)u=(u<<1)+i[m];a.push(u)}for(var p=this.jpoint(null,null,null),x=this.jpoint(null,null,null),k=s;k>0;k--){for(f=0;f<a.length;f++)u=a[f],u===k?x=x.mixedAdd(n.points[f]):u===-k&&(x=x.mixedAdd(n.points[f].neg()));p=p.add(x)}return p.toP()},"_fixedNafMul");Zi.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Zc(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var m=0;u>=0&&a[u]===0;u--)m++;if(u>=0&&m++,f=f.dblp(m),u<0)break;var p=a[u];Qc(p!==0),e.type==="affine"?p>0?f=f.mixedAdd(s[p-1>>1]):f=f.mixedAdd(s[-p-1>>1].neg()):p>0?f=f.add(s[p-1>>1]):f=f.add(s[-p-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");Zi.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,m=0,p,x,k;for(p=0;p<i;p++){k=t[p];var I=k._getNAFPoints(e);a[p]=I.wnd,f[p]=I.points}for(p=i-1;p>=1;p-=2){var T=p-1,C=p;if(a[T]!==1||a[C]!==1){u[T]=Zc(n[T],a[T],this._bitLength),u[C]=Zc(n[C],a[C],this._bitLength),m=Math.max(u[T].length,m),m=Math.max(u[C].length,m);continue}var $=[t[T],null,null,t[C]];t[T].y.cmp(t[C].y)===0?($[1]=t[T].add(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg())):t[T].y.cmp(t[C].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].add(t[C].neg())):($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg()));var O=[-3,-1,-5,-7,0,7,5,1,3],U=U_(n[T],n[C]);for(m=Math.max(U[0].length,m),u[T]=new Array(m),u[C]=new Array(m),x=0;x<m;x++){var j=U[0][x]|0,H=U[1][x]|0;u[T][x]=O[(j+1)*3+(H+1)],u[C][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),B=this._wnafT4;for(p=m;p>=0;p--){for(var L=0;p>=0;){var F=!0;for(x=0;x<i;x++)B[x]=u[x][p]|0,B[x]!==0&&(F=!1);if(!F)break;L++,p--}if(p>=0&&L++,X=X.dblp(L),p<0)break;for(x=0;x<i;x++){var re=B[x];re!==0&&(re>0?k=f[x][re-1>>1]:re<0&&(k=f[x][-re-1>>1].neg()),k.type==="affine"?X=X.mixedAdd(k):X=X.add(k))}}for(p=0;p<i;p++)f[p]=null;return s?X:X.toP()},"_wnafMulAdd");function rn(r,e){this.curve=r,this.type=e,this.precomputed=null}o(rn,"BasePoint");Zi.BasePoint=rn;rn.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");rn.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Zi.prototype.decodePoint=o(function(e,t){e=df.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Qc(e[e.length-1]%2===0):e[0]===7&&Qc(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");rn.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");rn.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");rn.prototype.encode=o(function(e,t){return df.encode(this._encode(t),e)},"encode");rn.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");rn.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");rn.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");rn.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");rn.prototype._getBeta=o(function(){return null},"_getBeta");rn.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var pf=me((hN,ah)=>{typeof Object.create=="function"?ah.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):ah.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var C1=me((pN,k1)=>{"use strict";var F_=Ir(),It=Wn(),fh=pf(),Js=hf(),$_=F_.assert;function nn(r){Js.call(this,"short",r),this.a=new It(r.a,16).toRed(this.red),this.b=new It(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(nn,"ShortCurve");fh(nn,Js);k1.exports=nn;nn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new It(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new It(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],$_(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new It(f.a,16),b:new It(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");nn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:It.mont(e),n=new It(2).toRed(t).redInvm(),i=n.redNeg(),s=new It(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");nn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new It(1),a=new It(0),f=new It(0),u=new It(1),m,p,x,k,I,T,C,$=0,O,U;n.cmpn(0)!==0;){var j=i.div(n);O=i.sub(j.mul(n)),U=f.sub(j.mul(s));var H=u.sub(j.mul(a));if(!x&&O.cmp(t)<0)m=C.neg(),p=s,x=O.neg(),k=U;else if(x&&++$===2)break;C=O,i=n,n=O,f=s,s=U,u=a,a=H}I=O.neg(),T=U;var X=x.sqr().add(k.sqr()),B=I.sqr().add(T.sqr());return B.cmp(X)>=0&&(I=m,T=p),x.negative&&(x=x.neg(),k=k.neg()),I.negative&&(I=I.neg(),T=T.neg()),[{a:x,b:k},{a:I,b:T}]},"_getEndoBasis");nn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),m=s.mul(n.b),p=a.mul(i.b),x=e.sub(f).sub(u),k=m.add(p).neg();return{k1:x,k2:k}},"_endoSplit");nn.prototype.pointFromX=o(function(e,t){e=new It(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");nn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");nn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],m=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),m=m.neg(!0)),i[a*2]=u,i[a*2+1]=m,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var p=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return p},"_endoWnafMulAdd");function zt(r,e,t,n){Js.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new It(e,16),this.y=new It(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(zt,"Point");fh(zt,Js.BasePoint);nn.prototype.point=o(function(e,t,n){return new zt(this,e,t,n)},"point");nn.prototype.pointFromJSON=o(function(e,t){return zt.fromJSON(this,e,t)},"pointFromJSON");zt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");zt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");zt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");zt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");zt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");zt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");zt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");zt.prototype.getX=o(function(){return this.x.fromRed()},"getX");zt.prototype.getY=o(function(){return this.y.fromRed()},"getY");zt.prototype.mul=o(function(e){return e=new It(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");zt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");zt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");zt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");zt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");zt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function Zt(r,e,t,n){Js.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new It(0)):(this.x=new It(e,16),this.y=new It(t,16),this.z=new It(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(Zt,"JPoint");fh(Zt,Js.BasePoint);nn.prototype.jpoint=o(function(e,t,n){return new Zt(this,e,t,n)},"jpoint");Zt.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");Zt.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Zt.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),m=a.redSub(f);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),x=p.redMul(u),k=i.redMul(p),I=m.redSqr().redIAdd(x).redISub(k).redISub(k),T=m.redMul(k.redISub(I)).redISub(a.redMul(x)),C=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(I,T,C)},"add");Zt.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=f.redSqr(),p=m.redMul(f),x=n.redMul(m),k=u.redSqr().redIAdd(p).redISub(x).redISub(x),I=u.redMul(x.redISub(k)).redISub(s.redMul(p)),T=this.z.redMul(f);return this.curve.jpoint(k,I,T)},"mixedAdd");Zt.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,m=u.redSqr().redSqr(),p=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),k=p.redSqr(),I=k.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(m)),C=a.redMul(k),$=T.redSqr().redISub(C.redAdd(C)),O=C.redISub($),U=T.redMul(O);U=U.redIAdd(U).redISub(I);var j=p.redMul(u);t+1<e&&(m=m.redMul(I)),a=$,u=j,p=U}return this.curve.jpoint(a,p.redMul(s),u)},"dblp");Zt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Zt.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),m=u.redSqr().redISub(f).redISub(f),p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),e=m,t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),k=this.y.redSqr(),I=k.redSqr(),T=this.x.redAdd(k).redSqr().redISub(x).redISub(I);T=T.redIAdd(T);var C=x.redAdd(x).redIAdd(x),$=C.redSqr(),O=I.redIAdd(I);O=O.redIAdd(O),O=O.redIAdd(O),e=$.redISub(T).redISub(T),t=C.redMul(T.redISub(e)).redISub(O),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");Zt.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),m=u.redSqr().redISub(f).redISub(f);e=m;var p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),k=this.y.redSqr(),I=this.x.redMul(k),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var C=I.redIAdd(I);C=C.redIAdd(C);var $=C.redAdd(C);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(k).redISub(x);var O=k.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O),t=T.redMul(C.redISub(e)).redISub(O)}return this.curve.jpoint(e,t,n)},"_threeDbl");Zt.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),m=t.redAdd(t);m=m.redIAdd(m);var p=m.redMul(f),x=u.redSqr().redISub(p.redAdd(p)),k=p.redISub(x),I=f.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=u.redMul(k).redISub(I),C=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,C)},"_dbl");Zt.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),m=i.redIAdd(i);m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var p=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(m),x=t.redMul(p);x=x.redIAdd(x),x=x.redIAdd(x);var k=this.x.redMul(u).redISub(x);k=k.redIAdd(k),k=k.redIAdd(k);var I=this.y.redMul(p.redMul(m.redISub(p)).redISub(f.redMul(u)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(k,I,T)},"trpl");Zt.prototype.mul=o(function(e,t){return e=new It(e,t),this.curve._wnafMul(this,e)},"mul");Zt.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Zt.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");Zt.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");Zt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var I1=me((mN,O1)=>{"use strict";var Xs=Wn(),D1=pf(),eu=hf(),q_=Ir();function Zs(r){eu.call(this,"mont",r),this.a=new Xs(r.a,16).toRed(this.red),this.b=new Xs(r.b,16).toRed(this.red),this.i4=new Xs(4).toRed(this.red).redInvm(),this.two=new Xs(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Zs,"MontCurve");D1(Zs,eu);O1.exports=Zs;Zs.prototype.validate=o(function(e){var t=e.normalize().x,n=t.redSqr(),i=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t),s=i.redSqrt();return s.redSqr().cmp(i)===0},"validate");function jt(r,e,t){eu.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Xs(e,16),this.z=new Xs(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(jt,"Point");D1(jt,eu.BasePoint);Zs.prototype.decodePoint=o(function(e,t){return this.point(q_.toArray(e,t),1)},"decodePoint");Zs.prototype.point=o(function(e,t){return new jt(this,e,t)},"point");Zs.prototype.pointFromJSON=o(function(e){return jt.fromJSON(this,e)},"pointFromJSON");jt.prototype.precompute=o(function(){},"precompute");jt.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");jt.fromJSON=o(function(e,t){return new jt(e,t[0],t[1]||e.one)},"fromJSON");jt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");jt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");jt.prototype.dbl=o(function(){var e=this.x.redAdd(this.z),t=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=t.redSub(i),a=t.redMul(i),f=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,f)},"dbl");jt.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");jt.prototype.diffAdd=o(function(e,t){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),f=a.redMul(n),u=s.redMul(i),m=t.z.redMul(f.redAdd(u).redSqr()),p=t.x.redMul(f.redISub(u).redSqr());return this.curve.point(m,p)},"diffAdd");jt.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var f=a.length-1;f>=0;f--)a[f]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");jt.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");jt.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");jt.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");jt.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");jt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var R1=me((bN,N1)=>{"use strict";var H_=Ir(),yi=Wn(),P1=pf(),tu=hf(),z_=H_.assert;function Gn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,tu.call(this,"edwards",r),this.a=new yi(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new yi(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new yi(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),z_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(Gn,"EdwardsCurve");P1(Gn,tu);N1.exports=Gn;Gn.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");Gn.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");Gn.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");Gn.prototype.pointFromX=o(function(e,t){e=new yi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(s.redInvm()),f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var u=f.fromRed().isOdd();return(t&&!u||!t&&u)&&(f=f.redNeg()),this.point(e,f)},"pointFromX");Gn.prototype.pointFromY=o(function(e,t){e=new yi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return f.fromRed().isOdd()!==t&&(f=f.redNeg()),this.point(f,e)},"pointFromY");Gn.prototype.validate=o(function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),i=t.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return i.cmp(s)===0},"validate");function Mt(r,e,t,n,i){tu.BasePoint.call(this,r,"projective"),e===null&&t===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new yi(e,16),this.y=new yi(t,16),this.z=n?new yi(n,16):this.curve.one,this.t=i&&new yi(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(Mt,"Point");P1(Mt,tu.BasePoint);Gn.prototype.pointFromJSON=o(function(e){return Mt.fromJSON(this,e)},"pointFromJSON");Gn.prototype.point=o(function(e,t,n,i){return new Mt(this,e,t,n,i)},"point");Mt.fromJSON=o(function(e,t){return new Mt(e,t[0],t[1],t[2])},"fromJSON");Mt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");Mt.prototype.isInfinity=o(function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},"isInfinity");Mt.prototype._extDbl=o(function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),f=a.redSub(n),u=i.redSub(t),m=s.redMul(f),p=a.redMul(u),x=s.redMul(u),k=f.redMul(a);return this.curve.point(m,p,k,x)},"_extDbl");Mt.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,a,f,u,m;if(this.curve.twisted){f=this.curve._mulA(t);var p=f.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(p.redSub(this.curve.two)),s=p.redMul(f.redSub(n)),a=p.redSqr().redSub(p).redSub(p)):(u=this.z.redSqr(),m=p.redSub(u).redISub(u),i=e.redSub(t).redISub(n).redMul(m),s=p.redMul(f.redSub(n)),a=p.redMul(m))}else f=t.redAdd(n),u=this.curve._mulC(this.z).redSqr(),m=f.redSub(u).redSub(u),i=this.curve._mulC(e.redISub(f)).redMul(m),s=this.curve._mulC(f).redMul(t.redISub(n)),a=f.redMul(m);return this.curve.point(i,s,a)},"_projDbl");Mt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");Mt.prototype._extAdd=o(function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(t),f=s.redSub(i),u=s.redAdd(i),m=n.redAdd(t),p=a.redMul(f),x=u.redMul(m),k=a.redMul(m),I=f.redMul(u);return this.curve.point(p,x,I,k)},"_extAdd");Mt.prototype._projAdd=o(function(e){var t=this.z.redMul(e.z),n=t.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(s),f=n.redSub(a),u=n.redAdd(a),m=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),p=t.redMul(f).redMul(m),x,k;return this.curve.twisted?(x=t.redMul(u).redMul(s.redSub(this.curve._mulA(i))),k=f.redMul(u)):(x=t.redMul(u).redMul(s.redSub(i)),k=this.curve._mulC(f).redMul(u)),this.curve.point(p,x,k)},"_projAdd");Mt.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");Mt.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");Mt.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");Mt.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");Mt.prototype.normalize=o(function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},"normalize");Mt.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");Mt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");Mt.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");Mt.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");Mt.prototype.eqXToP=o(function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),this.x.cmp(t)===0)return!0}},"eqXToP");Mt.prototype.toP=Mt.prototype.normalize;Mt.prototype.mixedAdd=Mt.prototype.add});var ch=me(L1=>{"use strict";var ru=L1;ru.base=hf();ru.short=C1();ru.mont=I1();ru.edwards=R1()});var wn=me(wt=>{"use strict";var j_=Ji(),K_=pf();wt.inherits=K_;function V_(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(V_,"isSurrogatePair");function W_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),i=0;i<r.length;i+=2)t.push(parseInt(r[i]+r[i+1],16))}else for(var n=0,i=0;i<r.length;i++){var s=r.charCodeAt(i);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):V_(r,i)?(s=65536+((s&1023)<<10)+(r.charCodeAt(++i)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}else for(i=0;i<r.length;i++)t[i]=r[i]|0;return t}o(W_,"toArray");wt.toArray=W_;function G_(r){for(var e="",t=0;t<r.length;t++)e+=U1(r[t].toString(16));return e}o(G_,"toHex");wt.toHex=G_;function B1(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(B1,"htonl");wt.htonl=B1;function Y_(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=B1(i)),t+=F1(i.toString(16))}return t}o(Y_,"toHex32");wt.toHex32=Y_;function U1(r){return r.length===1?"0"+r:r}o(U1,"zero2");wt.zero2=U1;function F1(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}o(F1,"zero8");wt.zero8=F1;function J_(r,e,t,n){var i=t-e;j_(i%4===0);for(var s=new Array(i/4),a=0,f=e;a<s.length;a++,f+=4){var u;n==="big"?u=r[f]<<24|r[f+1]<<16|r[f+2]<<8|r[f+3]:u=r[f+3]<<24|r[f+2]<<16|r[f+1]<<8|r[f],s[a]=u>>>0}return s}o(J_,"join32");wt.join32=J_;function X_(r,e){for(var t=new Array(r.length*4),n=0,i=0;n<r.length;n++,i+=4){var s=r[n];e==="big"?(t[i]=s>>>24,t[i+1]=s>>>16&255,t[i+2]=s>>>8&255,t[i+3]=s&255):(t[i+3]=s>>>24,t[i+2]=s>>>16&255,t[i+1]=s>>>8&255,t[i]=s&255)}return t}o(X_,"split32");wt.split32=X_;function Z_(r,e){return r>>>e|r<<32-e}o(Z_,"rotr32");wt.rotr32=Z_;function Q_(r,e){return r<<e|r>>>32-e}o(Q_,"rotl32");wt.rotl32=Q_;function e9(r,e){return r+e>>>0}o(e9,"sum32");wt.sum32=e9;function t9(r,e,t){return r+e+t>>>0}o(t9,"sum32_3");wt.sum32_3=t9;function r9(r,e,t,n){return r+e+t+n>>>0}o(r9,"sum32_4");wt.sum32_4=r9;function n9(r,e,t,n,i){return r+e+t+n+i>>>0}o(n9,"sum32_5");wt.sum32_5=n9;function i9(r,e,t,n){var i=r[e],s=r[e+1],a=n+s>>>0,f=(a<n?1:0)+t+i;r[e]=f>>>0,r[e+1]=a}o(i9,"sum64");wt.sum64=i9;function o9(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(o9,"sum64_hi");wt.sum64_hi=o9;function s9(r,e,t,n){var i=e+n;return i>>>0}o(s9,"sum64_lo");wt.sum64_lo=s9;function a9(r,e,t,n,i,s,a,f){var u=0,m=e;m=m+n>>>0,u+=m<e?1:0,m=m+s>>>0,u+=m<s?1:0,m=m+f>>>0,u+=m<f?1:0;var p=r+t+i+a+u;return p>>>0}o(a9,"sum64_4_hi");wt.sum64_4_hi=a9;function f9(r,e,t,n,i,s,a,f){var u=e+n+s+f;return u>>>0}o(f9,"sum64_4_lo");wt.sum64_4_lo=f9;function c9(r,e,t,n,i,s,a,f,u,m){var p=0,x=e;x=x+n>>>0,p+=x<e?1:0,x=x+s>>>0,p+=x<s?1:0,x=x+f>>>0,p+=x<f?1:0,x=x+m>>>0,p+=x<m?1:0;var k=r+t+i+a+u+p;return k>>>0}o(c9,"sum64_5_hi");wt.sum64_5_hi=c9;function u9(r,e,t,n,i,s,a,f,u,m){var p=e+n+s+f+m;return p>>>0}o(u9,"sum64_5_lo");wt.sum64_5_lo=u9;function l9(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(l9,"rotr64_hi");wt.rotr64_hi=l9;function d9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(d9,"rotr64_lo");wt.rotr64_lo=d9;function h9(r,e,t){return r>>>t}o(h9,"shr64_hi");wt.shr64_hi=h9;function p9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(p9,"shr64_lo");wt.shr64_lo=p9});var Qs=me(q1=>{"use strict";var $1=wn(),m9=Ji();function nu(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}o(nu,"BlockHash");q1.BlockHash=nu;nu.prototype.update=o(function(e,t){if(e=$1.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=$1.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},"update");nu.prototype.digest=o(function(e){return this.update(this._pad()),m9(this.pending===null),this._digest(e)},"digest");nu.prototype._pad=o(function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,a=8;a<this.padLength;a++)i[s++]=0;return i},"pad")});var uh=me(xi=>{"use strict";var b9=wn(),Yn=b9.rotr32;function g9(r,e,t,n){if(r===0)return H1(e,t,n);if(r===1||r===3)return j1(e,t,n);if(r===2)return z1(e,t,n)}o(g9,"ft_1");xi.ft_1=g9;function H1(r,e,t){return r&e^~r&t}o(H1,"ch32");xi.ch32=H1;function z1(r,e,t){return r&e^r&t^e&t}o(z1,"maj32");xi.maj32=z1;function j1(r,e,t){return r^e^t}o(j1,"p32");xi.p32=j1;function v9(r){return Yn(r,2)^Yn(r,13)^Yn(r,22)}o(v9,"s0_256");xi.s0_256=v9;function y9(r){return Yn(r,6)^Yn(r,11)^Yn(r,25)}o(y9,"s1_256");xi.s1_256=y9;function x9(r){return Yn(r,7)^Yn(r,18)^r>>>3}o(x9,"g0_256");xi.g0_256=x9;function w9(r){return Yn(r,17)^Yn(r,19)^r>>>10}o(w9,"g1_256");xi.g1_256=w9});var W1=me((wN,V1)=>{"use strict";var ea=wn(),_9=Qs(),E9=uh(),lh=ea.rotl32,mf=ea.sum32,S9=ea.sum32_5,M9=E9.ft_1,K1=_9.BlockHash,A9=[1518500249,1859775393,2400959708,3395469782];function Jn(){if(!(this instanceof Jn))return new Jn;K1.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(Jn,"SHA1");ea.inherits(Jn,K1);V1.exports=Jn;Jn.blockSize=512;Jn.outSize=160;Jn.hmacStrength=80;Jn.padLength=64;Jn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=lh(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],m=this.h[4];for(i=0;i<n.length;i++){var p=~~(i/20),x=S9(lh(s,5),M9(p,a,f,u),m,n[i],A9[p]);m=u,u=f,f=lh(a,30),a=s,s=x}this.h[0]=mf(this.h[0],s),this.h[1]=mf(this.h[1],a),this.h[2]=mf(this.h[2],f),this.h[3]=mf(this.h[3],u),this.h[4]=mf(this.h[4],m)},"_update");Jn.prototype._digest=o(function(e){return e==="hex"?ea.toHex32(this.h,"big"):ea.split32(this.h,"big")},"digest")});var dh=me((_N,Y1)=>{"use strict";var ta=wn(),T9=Qs(),ra=uh(),k9=Ji(),_n=ta.sum32,C9=ta.sum32_4,D9=ta.sum32_5,O9=ra.ch32,I9=ra.maj32,P9=ra.s0_256,N9=ra.s1_256,R9=ra.g0_256,L9=ra.g1_256,G1=T9.BlockHash,B9=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Xn(){if(!(this instanceof Xn))return new Xn;G1.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=B9,this.W=new Array(64)}o(Xn,"SHA256");ta.inherits(Xn,G1);Y1.exports=Xn;Xn.blockSize=512;Xn.outSize=256;Xn.hmacStrength=192;Xn.padLength=64;Xn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=C9(L9(n[i-2]),n[i-7],R9(n[i-15]),n[i-16]);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],m=this.h[4],p=this.h[5],x=this.h[6],k=this.h[7];for(k9(this.k.length===n.length),i=0;i<n.length;i++){var I=D9(k,N9(m),O9(m,p,x),this.k[i],n[i]),T=_n(P9(s),I9(s,a,f));k=x,x=p,p=m,m=_n(u,I),u=f,f=a,a=s,s=_n(I,T)}this.h[0]=_n(this.h[0],s),this.h[1]=_n(this.h[1],a),this.h[2]=_n(this.h[2],f),this.h[3]=_n(this.h[3],u),this.h[4]=_n(this.h[4],m),this.h[5]=_n(this.h[5],p),this.h[6]=_n(this.h[6],x),this.h[7]=_n(this.h[7],k)},"_update");Xn.prototype._digest=o(function(e){return e==="hex"?ta.toHex32(this.h,"big"):ta.split32(this.h,"big")},"digest")});var Z1=me((EN,X1)=>{"use strict";var hh=wn(),J1=dh();function wi(){if(!(this instanceof wi))return new wi;J1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(wi,"SHA224");hh.inherits(wi,J1);X1.exports=wi;wi.blockSize=512;wi.outSize=224;wi.hmacStrength=192;wi.padLength=64;wi.prototype._digest=o(function(e){return e==="hex"?hh.toHex32(this.h.slice(0,7),"big"):hh.split32(this.h.slice(0,7),"big")},"digest")});var bh=me((SN,rb)=>{"use strict";var Er=wn(),U9=Qs(),F9=Ji(),Zn=Er.rotr64_hi,Qn=Er.rotr64_lo,Q1=Er.shr64_hi,eb=Er.shr64_lo,Qi=Er.sum64,ph=Er.sum64_hi,mh=Er.sum64_lo,$9=Er.sum64_4_hi,q9=Er.sum64_4_lo,H9=Er.sum64_5_hi,z9=Er.sum64_5_lo,tb=U9.BlockHash,j9=[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 En(){if(!(this instanceof En))return new En;tb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=j9,this.W=new Array(160)}o(En,"SHA512");Er.inherits(En,tb);rb.exports=En;En.blockSize=1024;En.outSize=512;En.hmacStrength=192;En.padLength=128;En.prototype._prepareBlock=o(function(e,t){for(var n=this.W,i=0;i<32;i++)n[i]=e[t+i];for(;i<n.length;i+=2){var s=tE(n[i-4],n[i-3]),a=rE(n[i-4],n[i-3]),f=n[i-14],u=n[i-13],m=Q9(n[i-30],n[i-29]),p=eE(n[i-30],n[i-29]),x=n[i-32],k=n[i-31];n[i]=$9(s,a,f,u,m,p,x,k),n[i+1]=q9(s,a,f,u,m,p,x,k)}},"_prepareBlock");En.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],a=this.h[2],f=this.h[3],u=this.h[4],m=this.h[5],p=this.h[6],x=this.h[7],k=this.h[8],I=this.h[9],T=this.h[10],C=this.h[11],$=this.h[12],O=this.h[13],U=this.h[14],j=this.h[15];F9(this.k.length===n.length);for(var H=0;H<n.length;H+=2){var X=U,B=j,L=X9(k,I),F=Z9(k,I),re=K9(k,I,T,C,$,O),E=V9(k,I,T,C,$,O),l=this.k[H],g=this.k[H+1],h=n[H],c=n[H+1],d=H9(X,B,L,F,re,E,l,g,h,c),y=z9(X,B,L,F,re,E,l,g,h,c);X=Y9(i,s),B=J9(i,s),L=W9(i,s,a,f,u,m),F=G9(i,s,a,f,u,m);var _=ph(X,B,L,F),w=mh(X,B,L,F);U=$,j=O,$=T,O=C,T=k,C=I,k=ph(p,x,d,y),I=mh(x,x,d,y),p=u,x=m,u=a,m=f,a=i,f=s,i=ph(d,y,_,w),s=mh(d,y,_,w)}Qi(this.h,0,i,s),Qi(this.h,2,a,f),Qi(this.h,4,u,m),Qi(this.h,6,p,x),Qi(this.h,8,k,I),Qi(this.h,10,T,C),Qi(this.h,12,$,O),Qi(this.h,14,U,j)},"_update");En.prototype._digest=o(function(e){return e==="hex"?Er.toHex32(this.h,"big"):Er.split32(this.h,"big")},"digest");function K9(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(K9,"ch64_hi");function V9(r,e,t,n,i,s){var a=e&n^~e&s;return a<0&&(a+=4294967296),a}o(V9,"ch64_lo");function W9(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(W9,"maj64_hi");function G9(r,e,t,n,i,s){var a=e&n^e&s^n&s;return a<0&&(a+=4294967296),a}o(G9,"maj64_lo");function Y9(r,e){var t=Zn(r,e,28),n=Zn(e,r,2),i=Zn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(Y9,"s0_512_hi");function J9(r,e){var t=Qn(r,e,28),n=Qn(e,r,2),i=Qn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(J9,"s0_512_lo");function X9(r,e){var t=Zn(r,e,14),n=Zn(r,e,18),i=Zn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(X9,"s1_512_hi");function Z9(r,e){var t=Qn(r,e,14),n=Qn(r,e,18),i=Qn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(Z9,"s1_512_lo");function Q9(r,e){var t=Zn(r,e,1),n=Zn(r,e,8),i=Q1(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(Q9,"g0_512_hi");function eE(r,e){var t=Qn(r,e,1),n=Qn(r,e,8),i=eb(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(eE,"g0_512_lo");function tE(r,e){var t=Zn(r,e,19),n=Zn(e,r,29),i=Q1(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(tE,"g1_512_hi");function rE(r,e){var t=Qn(r,e,19),n=Qn(e,r,29),i=eb(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(rE,"g1_512_lo")});var ob=me((MN,ib)=>{"use strict";var gh=wn(),nb=bh();function _i(){if(!(this instanceof _i))return new _i;nb.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(_i,"SHA384");gh.inherits(_i,nb);ib.exports=_i;_i.blockSize=1024;_i.outSize=384;_i.hmacStrength=192;_i.padLength=128;_i.prototype._digest=o(function(e){return e==="hex"?gh.toHex32(this.h.slice(0,12),"big"):gh.split32(this.h.slice(0,12),"big")},"digest")});var sb=me(na=>{"use strict";na.sha1=W1();na.sha224=Z1();na.sha256=dh();na.sha384=ob();na.sha512=bh()});var db=me(lb=>{"use strict";var Wo=wn(),nE=Qs(),iu=Wo.rotl32,ab=Wo.sum32,bf=Wo.sum32_3,fb=Wo.sum32_4,ub=nE.BlockHash;function ei(){if(!(this instanceof ei))return new ei;ub.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(ei,"RIPEMD160");Wo.inherits(ei,ub);lb.ripemd160=ei;ei.blockSize=512;ei.outSize=160;ei.hmacStrength=192;ei.padLength=64;ei.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],u=n,m=i,p=s,x=a,k=f,I=0;I<80;I++){var T=ab(iu(fb(n,cb(I,i,s,a),e[sE[I]+t],iE(I)),fE[I]),f);n=f,f=a,a=iu(s,10),s=i,i=T,T=ab(iu(fb(u,cb(79-I,m,p,x),e[aE[I]+t],oE(I)),cE[I]),k),u=k,k=x,x=iu(p,10),p=m,m=T}T=bf(this.h[1],s,x),this.h[1]=bf(this.h[2],a,k),this.h[2]=bf(this.h[3],f,u),this.h[3]=bf(this.h[4],n,m),this.h[4]=bf(this.h[0],i,p),this.h[0]=T},"update");ei.prototype._digest=o(function(e){return e==="hex"?Wo.toHex32(this.h,"little"):Wo.split32(this.h,"little")},"digest");function cb(r,e,t,n){return r<=15?e^t^n:r<=31?e&t|~e&n:r<=47?(e|~t)^n:r<=63?e&n|t&~n:e^(t|~n)}o(cb,"f");function iE(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(iE,"K");function oE(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(oE,"Kh");var sE=[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],aE=[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],fE=[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],cE=[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]});var pb=me((kN,hb)=>{"use strict";var uE=wn(),lE=Ji();function ia(r,e,t){if(!(this instanceof ia))return new ia(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(uE.toArray(e,t))}o(ia,"Hmac");hb.exports=ia;ia.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),lE(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},"init");ia.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");ia.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var gf=me(mb=>{var Qt=mb;Qt.utils=wn();Qt.common=Qs();Qt.sha=sb();Qt.ripemd=db();Qt.hmac=pb();Qt.sha1=Qt.sha.sha1;Qt.sha256=Qt.sha.sha256;Qt.sha224=Qt.sha.sha224;Qt.sha384=Qt.sha.sha384;Qt.sha512=Qt.sha.sha512;Qt.ripemd160=Qt.ripemd.ripemd160});var gb=me((DN,bb)=>{bb.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var ou=me(xb=>{"use strict";var yh=xb,eo=gf(),vh=ch(),dE=Ir(),vb=dE.assert;function yb(r){r.type==="short"?this.curve=new vh.short(r):r.type==="edwards"?this.curve=new vh.edwards(r):this.curve=new vh.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,vb(this.g.validate(),"Invalid curve"),vb(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(yb,"PresetCurve");yh.PresetCurve=yb;function to(r,e){Object.defineProperty(yh,r,{configurable:!0,enumerable:!0,get:function(){var t=new yb(e);return Object.defineProperty(yh,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(to,"defineCurve");to("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:eo.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});to("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:eo.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});to("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:eo.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});to("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:eo.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});to("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:eo.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});to("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:eo.sha256,gRed:!1,g:["9"]});to("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:eo.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var xh;try{xh=gb()}catch(r){xh=void 0}to("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:eo.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",xh]})});var Eb=me((IN,_b)=>{"use strict";var hE=gf(),Go=rh(),wb=Ji();function ro(r){if(!(this instanceof ro))return new ro(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Go.toArray(r.entropy,r.entropyEnc||"hex"),t=Go.toArray(r.nonce,r.nonceEnc||"hex"),n=Go.toArray(r.pers,r.persEnc||"hex");wb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ro,"HmacDRBG");_b.exports=ro;ro.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");ro.prototype._hmac=o(function(){return new hE.hmac(this.hash,this.K)},"hmac");ro.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");ro.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Go.toArray(e,t),n=Go.toArray(n,i),wb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");ro.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Go.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Go.encode(a,t)},"generate")});var Mb=me((PN,Sb)=>{"use strict";var pE=Wn(),mE=Ir(),wh=mE.assert;function ar(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(ar,"KeyPair");Sb.exports=ar;ar.fromPublic=o(function(e,t,n){return t instanceof ar?t:new ar(e,{pub:t,pubEnc:n})},"fromPublic");ar.fromPrivate=o(function(e,t,n){return t instanceof ar?t:new ar(e,{priv:t,privEnc:n})},"fromPrivate");ar.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");ar.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");ar.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");ar.prototype._importPrivate=o(function(e,t){this.priv=new pE(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");ar.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?wh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&wh(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");ar.prototype.derive=o(function(e){return e.validate()||wh(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");ar.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");ar.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");ar.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var kb=me((NN,Tb)=>{"use strict";var su=Wn(),Sh=Ir(),bE=Sh.assert;function au(r,e){if(r instanceof au)return r;this._importDER(r,e)||(bE(r.r&&r.s,"Signature without r or s"),this.r=new su(r.r,16),this.s=new su(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(au,"Signature");Tb.exports=au;function gE(){this.place=0}o(gE,"Position");function _h(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(_h,"getLength");function Ab(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(Ab,"rmPadding");au.prototype._importDER=o(function(e,t){e=Sh.toArray(e,t);var n=new gE;if(e[n.place++]!==48)return!1;var i=_h(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=_h(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=_h(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new su(a),this.s=new su(u),this.recoveryParam=null,!0},"_importDER");function Eh(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(Eh,"constructLength");au.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=Ab(t),n=Ab(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Eh(i,t.length),i=i.concat(t),i.push(2),Eh(i,n.length);var s=i.concat(n),a=[48];return Eh(a,s.length),a=a.concat(s),Sh.encode(a,e)},"toDER")});var Ib=me((RN,Ob)=>{"use strict";var Yo=Wn(),Cb=Eb(),vE=Ir(),Mh=ou(),yE=sh(),Db=vE.assert,Ah=Mb(),fu=kb();function on(r){if(!(this instanceof on))return new on(r);typeof r=="string"&&(Db(Object.prototype.hasOwnProperty.call(Mh,r),"Unknown curve "+r),r=Mh[r]),r instanceof Mh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(on,"EC");Ob.exports=on;on.prototype.keyPair=o(function(e){return new Ah(this,e)},"keyPair");on.prototype.keyFromPrivate=o(function(e,t){return Ah.fromPrivate(this,e,t)},"keyFromPrivate");on.prototype.keyFromPublic=o(function(e,t){return Ah.fromPublic(this,e,t)},"keyFromPublic");on.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Cb({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||yE(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Yo(2));;){var s=new Yo(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");on.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");on.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Yo(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new Cb({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),m=this.n.sub(new Yo(1)),p=0;;p++){var x=i.k?i.k(p):new Yo(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(m)>=0)){var k=this.g.mul(x);if(!k.isInfinity()){var I=k.getX(),T=I.umod(this.n);if(T.cmpn(0)!==0){var C=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(C=C.umod(this.n),C.cmpn(0)!==0){var $=(k.getY().isOdd()?1:0)|(I.cmp(T)!==0?2:0);return i.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),$^=1),new fu({r:T,s:C,recoveryParam:$})}}}}}},"sign");on.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Yo(e,16)),n=this.keyFromPublic(n,i),t=new fu(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),m=f.mul(s).umod(this.n),p;return this.curve._maxwellTrick?(p=this.g.jmulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.eqXToP(s)):(p=this.g.mulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.getX().umod(this.n).cmp(s)===0)},"verify");on.prototype.recoverPubKey=function(r,e,t,n){Db((3&t)===t,"The recovery param is more than two bits"),e=new fu(e,n);var i=this.n,s=new Yo(r),a=e.r,f=e.s,u=t&1,m=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");m?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var p=e.r.invm(i),x=i.sub(s).mul(p).umod(i),k=f.mul(p).umod(i);return this.g.mulAdd(x,a,k)};on.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new fu(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var Lb=me((LN,Rb)=>{"use strict";var vf=Ir(),Nb=vf.assert,Pb=vf.parseBytes,oa=vf.cachedProperty;function Kt(r,e){this.eddsa=r,this._secret=Pb(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Pb(e.pub)}o(Kt,"KeyPair");Kt.fromPublic=o(function(e,t){return t instanceof Kt?t:new Kt(e,{pub:t})},"fromPublic");Kt.fromSecret=o(function(e,t){return t instanceof Kt?t:new Kt(e,{secret:t})},"fromSecret");Kt.prototype.secret=o(function(){return this._secret},"secret");oa(Kt,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));oa(Kt,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));oa(Kt,"privBytes",o(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i},"privBytes"));oa(Kt,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));oa(Kt,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));oa(Kt,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Kt.prototype.sign=o(function(e){return Nb(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Kt.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Kt.prototype.getSecret=o(function(e){return Nb(this._secret,"KeyPair is public only"),vf.encode(this.secret(),e)},"getSecret");Kt.prototype.getPublic=o(function(e){return vf.encode(this.pubBytes(),e)},"getPublic");Rb.exports=Kt});var Ub=me((BN,Bb)=>{"use strict";var xE=Wn(),cu=Ir(),wE=cu.assert,uu=cu.cachedProperty,_E=cu.parseBytes;function Jo(r,e){this.eddsa=r,typeof e!="object"&&(e=_E(e)),Array.isArray(e)&&(e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),wE(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof xE&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(Jo,"Signature");uu(Jo,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));uu(Jo,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));uu(Jo,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));uu(Jo,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Jo.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Jo.prototype.toHex=o(function(){return cu.encode(this.toBytes(),"hex").toUpperCase()},"toHex");Bb.exports=Jo});var zb=me((UN,Hb)=>{"use strict";var EE=gf(),SE=ou(),sa=Ir(),ME=sa.assert,$b=sa.parseBytes,qb=Lb(),Fb=Ub();function Sr(r){if(ME(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Sr))return new Sr(r);r=SE[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=EE.sha512}o(Sr,"EDDSA");Hb.exports=Sr;Sr.prototype.sign=o(function(e,t){e=$b(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),a=this.encodePoint(s),f=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),u=i.add(f).umod(this.curve.n);return this.makeSignature({R:s,S:u,Rencoded:a})},"sign");Sr.prototype.verify=o(function(e,t,n){e=$b(e),t=this.makeSignature(t);var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S()),f=t.R().add(i.pub().mul(s));return f.eq(a)},"verify");Sr.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return sa.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");Sr.prototype.keyFromPublic=o(function(e){return qb.fromPublic(this,e)},"keyFromPublic");Sr.prototype.keyFromSecret=o(function(e){return qb.fromSecret(this,e)},"keyFromSecret");Sr.prototype.makeSignature=o(function(e){return e instanceof Fb?e:new Fb(this,e)},"makeSignature");Sr.prototype.encodePoint=o(function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},"encodePoint");Sr.prototype.decodePoint=o(function(e){e=sa.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=sa.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");Sr.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");Sr.prototype.decodeInt=o(function(e){return sa.intFromLE(e)},"decodeInt");Sr.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var Kb=me(jb=>{"use strict";var Xo=jb;Xo.version=y1().version;Xo.utils=Ir();Xo.rand=sh();Xo.curve=ch();Xo.curves=ou();Xo.ec=Ib();Xo.eddsa=zb()});var Wb=me(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var Vb=65536,AE=function(){function r(){this.isAvailable=!1,this.isInstantiated=!1;var e=typeof self!="undefined"?self.crypto||self.msCrypto:null;e&&e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}return o(r,"BrowserRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),n=0;n<t.length;n+=Vb)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,Vb)));return t},r}();Th.BrowserRandomSource=AE});var Gb=me(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});var TE=tn(),kE=function(){function r(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require!="undefined"){var e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}return o(r,"NodeRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");var t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");for(var n=new Uint8Array(e),i=0;i<n.length;i++)n[i]=t[i];return TE.wipe(t),n},r}();kh.NodeRandomSource=kE});var Yb=me(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var CE=Wb(),DE=Gb(),OE=function(){function r(){if(this.isAvailable=!1,this.name="",this._source=new CE.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new DE.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}return o(r,"SystemRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)},r}();Ch.SystemRandomSource=OE});var no=me(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var IE=Yb(),PE=Ko(),Jb=tn();Sn.defaultRandomSource=new IE.SystemRandomSource;function Dh(r,e){return e===void 0&&(e=Sn.defaultRandomSource),e.randomBytes(r)}o(Dh,"randomBytes");Sn.randomBytes=Dh;function NE(r){r===void 0&&(r=Sn.defaultRandomSource);var e=Dh(4,r),t=PE.readUint32LE(e);return Jb.wipe(e),t}o(NE,"randomUint32");Sn.randomUint32=NE;var Xb="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Zb(r,e,t){if(e===void 0&&(e=Xb),t===void 0&&(t=Sn.defaultRandomSource),e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");for(var n="",i=e.length,s=256-256%i;r>0;){for(var a=Dh(Math.ceil(r*256/s),t),f=0;f<a.length&&r>0;f++){var u=a[f];u<s&&(n+=e.charAt(u%i),r--)}Jb.wipe(a)}return n}o(Zb,"randomString");Sn.randomString=Zb;function RE(r,e,t){e===void 0&&(e=Xb),t===void 0&&(t=Sn.defaultRandomSource);var n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return Zb(n,e,t)}o(RE,"randomStringForEntropy");Sn.randomStringForEntropy=RE});var tg=me(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var fa=Ko(),aa=tn();Ei.DIGEST_LENGTH=64;Ei.BLOCK_SIZE=128;var eg=function(){function r(){this.digestLength=Ei.DIGEST_LENGTH,this.blockSize=Ei.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA512"),r.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){aa.wipe(this._buffer),aa.wipe(this._tempHi),aa.wipe(this._tempLo),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<Ei.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Oh(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Oh(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%128<112?128:256;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;fa.writeUint32BE(i,this._buffer,a-8),fa.writeUint32BE(s,this._buffer,a-4),Oh(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/8;f++)fa.writeUint32BE(this._stateHi[f],e,f*8),fa.writeUint32BE(this._stateLo[f],e,f*8+4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){aa.wipe(e.stateHi),aa.wipe(e.stateLo),e.buffer&&aa.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Ei.SHA512=eg;var Qb=new Int32Array([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 Oh(r,e,t,n,i,s,a){for(var f=t[0],u=t[1],m=t[2],p=t[3],x=t[4],k=t[5],I=t[6],T=t[7],C=n[0],$=n[1],O=n[2],U=n[3],j=n[4],H=n[5],X=n[6],B=n[7],L,F,re,E,l,g,h,c;a>=128;){for(var d=0;d<16;d++){var y=8*d+s;r[d]=fa.readUint32BE(i,y),e[d]=fa.readUint32BE(i,y+4)}for(var d=0;d<80;d++){var _=f,w=u,b=m,S=p,D=x,v=k,M=I,ne=T,A=C,K=$,J=O,N=U,R=j,V=H,W=X,ee=B;if(L=T,F=B,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=(x>>>14|j<<32-14)^(x>>>18|j<<32-18)^(j>>>41-32|x<<32-(41-32)),F=(j>>>14|x<<32-14)^(j>>>18|x<<32-18)^(x>>>41-32|j<<32-(41-32)),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=x&k^~x&I,F=j&H^~j&X,l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=Qb[d*2],F=Qb[d*2+1],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=r[d%16],F=e[d%16],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,re=h&65535|c<<16,E=l&65535|g<<16,L=re,F=E,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=(f>>>28|C<<32-28)^(C>>>34-32|f<<32-(34-32))^(C>>>39-32|f<<32-(39-32)),F=(C>>>28|f<<32-28)^(f>>>34-32|C<<32-(34-32))^(f>>>39-32|C<<32-(39-32)),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=f&u^f&m^u&m,F=C&$^C&O^$&O,l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,ne=h&65535|c<<16,ee=l&65535|g<<16,L=S,F=N,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=re,F=E,l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,S=h&65535|c<<16,N=l&65535|g<<16,u=_,m=w,p=b,x=S,k=D,I=v,T=M,f=ne,$=A,O=K,U=J,j=N,H=R,X=V,B=W,C=ee,d%16===15)for(var y=0;y<16;y++)L=r[y],F=e[y],l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=r[(y+9)%16],F=e[(y+9)%16],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,re=r[(y+1)%16],E=e[(y+1)%16],L=(re>>>1|E<<32-1)^(re>>>8|E<<32-8)^re>>>7,F=(E>>>1|re<<32-1)^(E>>>8|re<<32-8)^(E>>>7|re<<32-7),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,re=r[(y+14)%16],E=e[(y+14)%16],L=(re>>>19|E<<32-19)^(E>>>61-32|re<<32-(61-32))^re>>>6,F=(E>>>19|re<<32-19)^(re>>>61-32|E<<32-(61-32))^(E>>>6|re<<32-6),l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,r[y]=h&65535|c<<16,e[y]=l&65535|g<<16}L=f,F=C,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[0],F=n[0],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[0]=f=h&65535|c<<16,n[0]=C=l&65535|g<<16,L=u,F=$,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[1],F=n[1],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[1]=u=h&65535|c<<16,n[1]=$=l&65535|g<<16,L=m,F=O,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[2],F=n[2],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[2]=m=h&65535|c<<16,n[2]=O=l&65535|g<<16,L=p,F=U,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[3],F=n[3],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[3]=p=h&65535|c<<16,n[3]=U=l&65535|g<<16,L=x,F=j,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[4],F=n[4],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[4]=x=h&65535|c<<16,n[4]=j=l&65535|g<<16,L=k,F=H,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[5],F=n[5],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[5]=k=h&65535|c<<16,n[5]=H=l&65535|g<<16,L=I,F=X,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[6],F=n[6],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[6]=I=h&65535|c<<16,n[6]=X=l&65535|g<<16,L=T,F=B,l=F&65535,g=F>>>16,h=L&65535,c=L>>>16,L=t[7],F=n[7],l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,g+=l>>>16,h+=g>>>16,c+=h>>>16,t[7]=T=h&65535|c<<16,n[7]=B=l&65535|g<<16,s+=128,a-=128}return s}o(Oh,"hashBlocks");function LE(r){var e=new eg;e.update(r);var t=e.digest();return e.clean(),t}o(LE,"hash");Ei.hash=LE});var lu=me($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var BE=no(),yf=tg(),sg=tn();$t.SIGNATURE_LENGTH=64;$t.PUBLIC_KEY_LENGTH=32;$t.SECRET_KEY_LENGTH=64;$t.SEED_LENGTH=32;function Ce(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(Ce,"gf");var UE=new Uint8Array(32);UE[0]=9;var Nh=Ce(),ca=Ce([1]),FE=Ce([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),$E=Ce([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),rg=Ce([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),ng=Ce([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),qE=Ce([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function io(r,e){for(var t=0;t<16;t++)r[t]=e[t]|0}o(io,"set25519");function Ih(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Ih,"car25519");function ag(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(ag,"sel25519");function xf(r,e){for(var t=Ce(),n=Ce(),i=0;i<16;i++)n[i]=e[i];Ih(n),Ih(n),Ih(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,ag(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(xf,"pack25519");function fg(r,e){for(var t=0,n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(fg,"verify32");function ig(r,e){var t=new Uint8Array(32),n=new Uint8Array(32);return xf(t,r),xf(n,e),fg(t,n)}o(ig,"neq25519");function cg(r){var e=new Uint8Array(32);return xf(e,r),e[0]&1}o(cg,"par25519");function HE(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(HE,"unpack25519");function Zo(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(Zo,"add");function es(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(es,"sub");function vt(r,e,t){var n,i,s=0,a=0,f=0,u=0,m=0,p=0,x=0,k=0,I=0,T=0,C=0,$=0,O=0,U=0,j=0,H=0,X=0,B=0,L=0,F=0,re=0,E=0,l=0,g=0,h=0,c=0,d=0,y=0,_=0,w=0,b=0,S=t[0],D=t[1],v=t[2],M=t[3],ne=t[4],A=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*S,a+=n*D,f+=n*v,u+=n*M,m+=n*ne,p+=n*A,x+=n*K,k+=n*J,I+=n*N,T+=n*R,C+=n*V,$+=n*W,O+=n*ee,U+=n*he,j+=n*fe,H+=n*Y,n=e[1],a+=n*S,f+=n*D,u+=n*v,m+=n*M,p+=n*ne,x+=n*A,k+=n*K,I+=n*J,T+=n*N,C+=n*R,$+=n*V,O+=n*W,U+=n*ee,j+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*S,u+=n*D,m+=n*v,p+=n*M,x+=n*ne,k+=n*A,I+=n*K,T+=n*J,C+=n*N,$+=n*R,O+=n*V,U+=n*W,j+=n*ee,H+=n*he,X+=n*fe,B+=n*Y,n=e[3],u+=n*S,m+=n*D,p+=n*v,x+=n*M,k+=n*ne,I+=n*A,T+=n*K,C+=n*J,$+=n*N,O+=n*R,U+=n*V,j+=n*W,H+=n*ee,X+=n*he,B+=n*fe,L+=n*Y,n=e[4],m+=n*S,p+=n*D,x+=n*v,k+=n*M,I+=n*ne,T+=n*A,C+=n*K,$+=n*J,O+=n*N,U+=n*R,j+=n*V,H+=n*W,X+=n*ee,B+=n*he,L+=n*fe,F+=n*Y,n=e[5],p+=n*S,x+=n*D,k+=n*v,I+=n*M,T+=n*ne,C+=n*A,$+=n*K,O+=n*J,U+=n*N,j+=n*R,H+=n*V,X+=n*W,B+=n*ee,L+=n*he,F+=n*fe,re+=n*Y,n=e[6],x+=n*S,k+=n*D,I+=n*v,T+=n*M,C+=n*ne,$+=n*A,O+=n*K,U+=n*J,j+=n*N,H+=n*R,X+=n*V,B+=n*W,L+=n*ee,F+=n*he,re+=n*fe,E+=n*Y,n=e[7],k+=n*S,I+=n*D,T+=n*v,C+=n*M,$+=n*ne,O+=n*A,U+=n*K,j+=n*J,H+=n*N,X+=n*R,B+=n*V,L+=n*W,F+=n*ee,re+=n*he,E+=n*fe,l+=n*Y,n=e[8],I+=n*S,T+=n*D,C+=n*v,$+=n*M,O+=n*ne,U+=n*A,j+=n*K,H+=n*J,X+=n*N,B+=n*R,L+=n*V,F+=n*W,re+=n*ee,E+=n*he,l+=n*fe,g+=n*Y,n=e[9],T+=n*S,C+=n*D,$+=n*v,O+=n*M,U+=n*ne,j+=n*A,H+=n*K,X+=n*J,B+=n*N,L+=n*R,F+=n*V,re+=n*W,E+=n*ee,l+=n*he,g+=n*fe,h+=n*Y,n=e[10],C+=n*S,$+=n*D,O+=n*v,U+=n*M,j+=n*ne,H+=n*A,X+=n*K,B+=n*J,L+=n*N,F+=n*R,re+=n*V,E+=n*W,l+=n*ee,g+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*S,O+=n*D,U+=n*v,j+=n*M,H+=n*ne,X+=n*A,B+=n*K,L+=n*J,F+=n*N,re+=n*R,E+=n*V,l+=n*W,g+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],O+=n*S,U+=n*D,j+=n*v,H+=n*M,X+=n*ne,B+=n*A,L+=n*K,F+=n*J,re+=n*N,E+=n*R,l+=n*V,g+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],U+=n*S,j+=n*D,H+=n*v,X+=n*M,B+=n*ne,L+=n*A,F+=n*K,re+=n*J,E+=n*N,l+=n*R,g+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],j+=n*S,H+=n*D,X+=n*v,B+=n*M,L+=n*ne,F+=n*A,re+=n*K,E+=n*J,l+=n*N,g+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*S,X+=n*D,B+=n*v,L+=n*M,F+=n*ne,re+=n*A,E+=n*K,l+=n*J,g+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,b+=n*Y,s+=38*X,a+=38*B,f+=38*L,u+=38*F,m+=38*re,p+=38*E,x+=38*l,k+=38*g,I+=38*h,T+=38*c,C+=38*d,$+=38*y,O+=38*_,U+=38*w,j+=38*b,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=m,r[5]=p,r[6]=x,r[7]=k,r[8]=I,r[9]=T,r[10]=C,r[11]=$,r[12]=O,r[13]=U,r[14]=j,r[15]=H}o(vt,"mul");function Qo(r,e){vt(r,e,e)}o(Qo,"square");function ug(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Qo(t,t),n!==2&&n!==4&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(ug,"inv25519");function zE(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Qo(t,t),n!==1&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(zE,"pow2523");function Rh(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce(),m=Ce(),p=Ce();es(t,r[1],r[0]),es(p,e[1],e[0]),vt(t,t,p),Zo(n,r[0],r[1]),Zo(p,e[0],e[1]),vt(n,n,p),vt(i,r[3],e[3]),vt(i,i,$E),vt(s,r[2],e[2]),Zo(s,s,s),es(a,n,t),es(f,s,i),Zo(u,s,i),Zo(m,n,t),vt(r[0],a,f),vt(r[1],m,u),vt(r[2],u,f),vt(r[3],a,m)}o(Rh,"edadd");function og(r,e,t){for(var n=0;n<4;n++)ag(r[n],e[n],t)}o(og,"cswap");function Bh(r,e){var t=Ce(),n=Ce(),i=Ce();ug(i,e[2]),vt(t,e[0],i),vt(n,e[1],i),xf(r,n),r[31]^=cg(t)<<7}o(Bh,"pack");function lg(r,e,t){io(r[0],Nh),io(r[1],ca),io(r[2],ca),io(r[3],Nh);for(var n=255;n>=0;--n){var i=t[n/8|0]>>(n&7)&1;og(r,e,i),Rh(e,r),Rh(r,r),og(r,e,i)}}o(lg,"scalarmult");function Uh(r,e){var t=[Ce(),Ce(),Ce(),Ce()];io(t[0],rg),io(t[1],ng),io(t[2],ca),vt(t[3],rg,ng),lg(r,t,e)}o(Uh,"scalarbase");function dg(r){if(r.length!==$t.SEED_LENGTH)throw new Error("ed25519: seed must be "+$t.SEED_LENGTH+" bytes");var e=yf.hash(r);e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(32),n=[Ce(),Ce(),Ce(),Ce()];Uh(n,e),Bh(t,n);var i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(dg,"generateKeyPairFromSeed");$t.generateKeyPairFromSeed=dg;function jE(r){var e=BE.randomBytes(32,r),t=dg(e);return sg.wipe(e),t}o(jE,"generateKeyPair");$t.generateKeyPair=jE;function KE(r){if(r.length!==$t.SECRET_KEY_LENGTH)throw new Error("ed25519: secret key must be "+$t.SECRET_KEY_LENGTH+" bytes");return new Uint8Array(r.subarray(32))}o(KE,"extractPublicKeyFromSecretKey");$t.extractPublicKeyFromSecretKey=KE;var Ph=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 hg(r,e){var t,n,i,s;for(n=63;n>=32;--n){for(t=0,i=n-32,s=n-12;i<s;++i)e[i]+=t-16*e[n]*Ph[i-(n-32)],t=Math.floor((e[i]+128)/256),e[i]-=t*256;e[i]+=t,e[n]=0}for(t=0,i=0;i<32;i++)e[i]+=t-(e[31]>>4)*Ph[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Ph[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(hg,"modL");function Lh(r){for(var e=new Float64Array(64),t=0;t<64;t++)e[t]=r[t];for(var t=0;t<64;t++)r[t]=0;hg(r,e)}o(Lh,"reduce");function VE(r,e){var t=new Float64Array(64),n=[Ce(),Ce(),Ce(),Ce()],i=yf.hash(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;var s=new Uint8Array(64);s.set(i.subarray(32),32);var a=new yf.SHA512;a.update(s.subarray(32)),a.update(e);var f=a.digest();a.clean(),Lh(f),Uh(n,f),Bh(s,n),a.reset(),a.update(s.subarray(0,32)),a.update(r.subarray(32)),a.update(e);var u=a.digest();Lh(u);for(var m=0;m<32;m++)t[m]=f[m];for(var m=0;m<32;m++)for(var p=0;p<32;p++)t[m+p]+=u[m]*i[p];return hg(s.subarray(32),t),s}o(VE,"sign");$t.sign=VE;function pg(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce();return io(r[2],ca),HE(r[1],e),Qo(i,r[1]),vt(s,i,FE),es(i,i,r[2]),Zo(s,r[2],s),Qo(a,s),Qo(f,a),vt(u,f,a),vt(t,u,i),vt(t,t,s),zE(t,t),vt(t,t,i),vt(t,t,s),vt(t,t,s),vt(r[0],t,s),Qo(n,r[0]),vt(n,n,s),ig(n,i)&&vt(r[0],r[0],qE),Qo(n,r[0]),vt(n,n,s),ig(n,i)?-1:(cg(r[0])===e[31]>>7&&es(r[0],Nh,r[0]),vt(r[3],r[0],r[1]),0)}o(pg,"unpackneg");function WE(r,e,t){var n=new Uint8Array(32),i=[Ce(),Ce(),Ce(),Ce()],s=[Ce(),Ce(),Ce(),Ce()];if(t.length!==$t.SIGNATURE_LENGTH)throw new Error("ed25519: signature must be "+$t.SIGNATURE_LENGTH+" bytes");if(pg(s,r))return!1;var a=new yf.SHA512;a.update(t.subarray(0,32)),a.update(r),a.update(e);var f=a.digest();return Lh(f),lg(i,s,f),Uh(s,t.subarray(32)),Rh(i,s),Bh(n,i),!fg(t,n)}o(WE,"verify");$t.verify=WE;function GE(r){var e=[Ce(),Ce(),Ce(),Ce()];if(pg(e,r))throw new Error("Ed25519: invalid public key");var t=Ce(),n=Ce(),i=e[1];Zo(t,ca,i),es(n,ca,i),ug(n,n),vt(t,t,n);var s=new Uint8Array(32);return xf(s,t),s}o(GE,"convertPublicKeyToX25519");$t.convertPublicKeyToX25519=GE;function YE(r){var e=yf.hash(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(e.subarray(0,32));return sg.wipe(e),t}o(YE,"convertSecretKeyToX25519");$t.convertSecretKeyToX25519=YE});var bg=me((VN,mg)=>{"use strict";mg.exports=o(function r(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,n,i)=>{let s=i===0?"":",",a=n===void 0||typeof n=="symbol"?null:n;return t+s+r(a)},"")+"]":"{"+Object.keys(e).sort().reduce((t,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return t;let s=t.length===0?"":",";return t+s+r(n)+":"+r(e[n])},"")+"}"},"serialize")});var xg=me(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var JE=no(),XE=tn();Mr.PUBLIC_KEY_LENGTH=32;Mr.SECRET_KEY_LENGTH=32;Mr.SHARED_KEY_LENGTH=32;function ti(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(ti,"gf");var gg=new Uint8Array(32);gg[0]=9;var ZE=ti([56129,1]);function Fh(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Fh,"car25519");function wf(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(wf,"sel25519");function QE(r,e){for(var t=ti(),n=ti(),i=0;i<16;i++)n[i]=e[i];Fh(n),Fh(n),Fh(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,wf(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(QE,"pack25519");function e7(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(e7,"unpack25519");function du(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(du,"add");function hu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(hu,"sub");function Si(r,e,t){var n,i,s=0,a=0,f=0,u=0,m=0,p=0,x=0,k=0,I=0,T=0,C=0,$=0,O=0,U=0,j=0,H=0,X=0,B=0,L=0,F=0,re=0,E=0,l=0,g=0,h=0,c=0,d=0,y=0,_=0,w=0,b=0,S=t[0],D=t[1],v=t[2],M=t[3],ne=t[4],A=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*S,a+=n*D,f+=n*v,u+=n*M,m+=n*ne,p+=n*A,x+=n*K,k+=n*J,I+=n*N,T+=n*R,C+=n*V,$+=n*W,O+=n*ee,U+=n*he,j+=n*fe,H+=n*Y,n=e[1],a+=n*S,f+=n*D,u+=n*v,m+=n*M,p+=n*ne,x+=n*A,k+=n*K,I+=n*J,T+=n*N,C+=n*R,$+=n*V,O+=n*W,U+=n*ee,j+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*S,u+=n*D,m+=n*v,p+=n*M,x+=n*ne,k+=n*A,I+=n*K,T+=n*J,C+=n*N,$+=n*R,O+=n*V,U+=n*W,j+=n*ee,H+=n*he,X+=n*fe,B+=n*Y,n=e[3],u+=n*S,m+=n*D,p+=n*v,x+=n*M,k+=n*ne,I+=n*A,T+=n*K,C+=n*J,$+=n*N,O+=n*R,U+=n*V,j+=n*W,H+=n*ee,X+=n*he,B+=n*fe,L+=n*Y,n=e[4],m+=n*S,p+=n*D,x+=n*v,k+=n*M,I+=n*ne,T+=n*A,C+=n*K,$+=n*J,O+=n*N,U+=n*R,j+=n*V,H+=n*W,X+=n*ee,B+=n*he,L+=n*fe,F+=n*Y,n=e[5],p+=n*S,x+=n*D,k+=n*v,I+=n*M,T+=n*ne,C+=n*A,$+=n*K,O+=n*J,U+=n*N,j+=n*R,H+=n*V,X+=n*W,B+=n*ee,L+=n*he,F+=n*fe,re+=n*Y,n=e[6],x+=n*S,k+=n*D,I+=n*v,T+=n*M,C+=n*ne,$+=n*A,O+=n*K,U+=n*J,j+=n*N,H+=n*R,X+=n*V,B+=n*W,L+=n*ee,F+=n*he,re+=n*fe,E+=n*Y,n=e[7],k+=n*S,I+=n*D,T+=n*v,C+=n*M,$+=n*ne,O+=n*A,U+=n*K,j+=n*J,H+=n*N,X+=n*R,B+=n*V,L+=n*W,F+=n*ee,re+=n*he,E+=n*fe,l+=n*Y,n=e[8],I+=n*S,T+=n*D,C+=n*v,$+=n*M,O+=n*ne,U+=n*A,j+=n*K,H+=n*J,X+=n*N,B+=n*R,L+=n*V,F+=n*W,re+=n*ee,E+=n*he,l+=n*fe,g+=n*Y,n=e[9],T+=n*S,C+=n*D,$+=n*v,O+=n*M,U+=n*ne,j+=n*A,H+=n*K,X+=n*J,B+=n*N,L+=n*R,F+=n*V,re+=n*W,E+=n*ee,l+=n*he,g+=n*fe,h+=n*Y,n=e[10],C+=n*S,$+=n*D,O+=n*v,U+=n*M,j+=n*ne,H+=n*A,X+=n*K,B+=n*J,L+=n*N,F+=n*R,re+=n*V,E+=n*W,l+=n*ee,g+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*S,O+=n*D,U+=n*v,j+=n*M,H+=n*ne,X+=n*A,B+=n*K,L+=n*J,F+=n*N,re+=n*R,E+=n*V,l+=n*W,g+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],O+=n*S,U+=n*D,j+=n*v,H+=n*M,X+=n*ne,B+=n*A,L+=n*K,F+=n*J,re+=n*N,E+=n*R,l+=n*V,g+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],U+=n*S,j+=n*D,H+=n*v,X+=n*M,B+=n*ne,L+=n*A,F+=n*K,re+=n*J,E+=n*N,l+=n*R,g+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],j+=n*S,H+=n*D,X+=n*v,B+=n*M,L+=n*ne,F+=n*A,re+=n*K,E+=n*J,l+=n*N,g+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*S,X+=n*D,B+=n*v,L+=n*M,F+=n*ne,re+=n*A,E+=n*K,l+=n*J,g+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,b+=n*Y,s+=38*X,a+=38*B,f+=38*L,u+=38*F,m+=38*re,p+=38*E,x+=38*l,k+=38*g,I+=38*h,T+=38*c,C+=38*d,$+=38*y,O+=38*_,U+=38*w,j+=38*b,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=U+i+65535,i=Math.floor(n/65536),U=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=m,r[5]=p,r[6]=x,r[7]=k,r[8]=I,r[9]=T,r[10]=C,r[11]=$,r[12]=O,r[13]=U,r[14]=j,r[15]=H}o(Si,"mul");function _f(r,e){Si(r,e,e)}o(_f,"square");function t7(r,e){for(var t=ti(),n=0;n<16;n++)t[n]=e[n];for(var n=253;n>=0;n--)_f(t,t),n!==2&&n!==4&&Si(t,t,e);for(var n=0;n<16;n++)r[n]=t[n]}o(t7,"inv25519");function $h(r,e){for(var t=new Uint8Array(32),n=new Float64Array(80),i=ti(),s=ti(),a=ti(),f=ti(),u=ti(),m=ti(),p=0;p<31;p++)t[p]=r[p];t[31]=r[31]&127|64,t[0]&=248,e7(n,e);for(var p=0;p<16;p++)s[p]=n[p];i[0]=f[0]=1;for(var p=254;p>=0;--p){var x=t[p>>>3]>>>(p&7)&1;wf(i,s,x),wf(a,f,x),du(u,i,a),hu(i,i,a),du(a,s,f),hu(s,s,f),_f(f,u),_f(m,i),Si(i,a,i),Si(a,s,u),du(u,i,a),hu(i,i,a),_f(s,i),hu(a,f,m),Si(i,a,ZE),du(i,i,f),Si(a,a,i),Si(i,f,m),Si(f,s,n),_f(s,u),wf(i,s,x),wf(a,f,x)}for(var p=0;p<16;p++)n[p+16]=i[p],n[p+32]=a[p],n[p+48]=s[p],n[p+64]=f[p];var k=n.subarray(32),I=n.subarray(16);t7(k,k),Si(I,I,k);var T=new Uint8Array(32);return QE(T,I),T}o($h,"scalarMult");Mr.scalarMult=$h;function vg(r){return $h(r,gg)}o(vg,"scalarMultBase");Mr.scalarMultBase=vg;function yg(r){if(r.length!==Mr.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+Mr.SECRET_KEY_LENGTH+" bytes");var e=new Uint8Array(r),t=vg(e);return{publicKey:t,secretKey:e}}o(yg,"generateKeyPairFromSeed");Mr.generateKeyPairFromSeed=yg;function r7(r){var e=JE.randomBytes(32,r),t=yg(e);return XE.wipe(e),t}o(r7,"generateKeyPair");Mr.generateKeyPair=r7;function n7(r,e,t){if(t===void 0&&(t=!1),r.length!==Mr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==Mr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var n=$h(r,e);if(t){for(var i=0,s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(n7,"sharedKey");Mr.sharedKey=n7});var Hh=me(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});var fr=Ko(),qh=tn(),i7=20;function o7(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=t[3]<<24|t[2]<<16|t[1]<<8|t[0],u=t[7]<<24|t[6]<<16|t[5]<<8|t[4],m=t[11]<<24|t[10]<<16|t[9]<<8|t[8],p=t[15]<<24|t[14]<<16|t[13]<<8|t[12],x=t[19]<<24|t[18]<<16|t[17]<<8|t[16],k=t[23]<<24|t[22]<<16|t[21]<<8|t[20],I=t[27]<<24|t[26]<<16|t[25]<<8|t[24],T=t[31]<<24|t[30]<<16|t[29]<<8|t[28],C=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],O=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],j=n,H=i,X=s,B=a,L=f,F=u,re=m,E=p,l=x,g=k,h=I,c=T,d=C,y=$,_=O,w=U,b=0;b<i7;b+=2)j=j+L|0,d^=j,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,g=g+y|0,F^=g,F=F>>>32-12|F<<12,X=X+re|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,re^=h,re=re>>>32-12|re<<12,B=B+E|0,w^=B,w=w>>>32-16|w<<16,c=c+w|0,E^=c,E=E>>>32-12|E<<12,X=X+re|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,re^=h,re=re>>>32-7|re<<7,B=B+E|0,w^=B,w=w>>>32-8|w<<8,c=c+w|0,E^=c,E=E>>>32-7|E<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,g=g+y|0,F^=g,F=F>>>32-7|F<<7,j=j+L|0,d^=j,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,j=j+F|0,w^=j,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+re|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,re^=c,re=re>>>32-12|re<<12,X=X+E|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,E^=l,E=E>>>32-12|E<<12,B=B+L|0,_^=B,_=_>>>32-16|_<<16,g=g+_|0,L^=g,L=L>>>32-12|L<<12,X=X+E|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,E^=l,E=E>>>32-7|E<<7,B=B+L|0,_^=B,_=_>>>32-8|_<<8,g=g+_|0,L^=g,L=L>>>32-7|L<<7,H=H+re|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,re^=c,re=re>>>32-7|re<<7,j=j+F|0,w^=j,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;fr.writeUint32LE(j+n|0,r,0),fr.writeUint32LE(H+i|0,r,4),fr.writeUint32LE(X+s|0,r,8),fr.writeUint32LE(B+a|0,r,12),fr.writeUint32LE(L+f|0,r,16),fr.writeUint32LE(F+u|0,r,20),fr.writeUint32LE(re+m|0,r,24),fr.writeUint32LE(E+p|0,r,28),fr.writeUint32LE(l+x|0,r,32),fr.writeUint32LE(g+k|0,r,36),fr.writeUint32LE(h+I|0,r,40),fr.writeUint32LE(c+T|0,r,44),fr.writeUint32LE(d+C|0,r,48),fr.writeUint32LE(y+$|0,r,52),fr.writeUint32LE(_+O|0,r,56),fr.writeUint32LE(w+U|0,r,60)}o(o7,"core");function wg(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=i}for(var f=new Uint8Array(64),u=0;u<t.length;u+=64){o7(f,s,r);for(var m=u;m<u+64&&m<t.length;m++)n[m]=t[m]^f[m-u];a7(s,0,a)}return qh.wipe(f),i===0&&qh.wipe(s),n}o(wg,"streamXOR");pu.streamXOR=wg;function s7(r,e,t,n){return n===void 0&&(n=0),qh.wipe(t),wg(r,e,t,t,n)}o(s7,"stream");pu.stream=s7;function a7(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}o(a7,"incrementCounter")});var Mg=me(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var oo=Ko(),_g=tn(),f7=Hh(),c7=20;function Eg(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=Sg(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var a=f7.streamXOR(i,s,t,n);return _g.wipe(i),a}o(Eg,"streamXOR");Ef.streamXOR=Eg;function u7(r,e,t){return _g.wipe(t),Eg(r,e,t,t)}o(u7,"stream");Ef.stream=u7;function Sg(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=r[3]<<24|r[2]<<16|r[1]<<8|r[0],u=r[7]<<24|r[6]<<16|r[5]<<8|r[4],m=r[11]<<24|r[10]<<16|r[9]<<8|r[8],p=r[15]<<24|r[14]<<16|r[13]<<8|r[12],x=r[19]<<24|r[18]<<16|r[17]<<8|r[16],k=r[23]<<24|r[22]<<16|r[21]<<8|r[20],I=r[27]<<24|r[26]<<16|r[25]<<8|r[24],T=r[31]<<24|r[30]<<16|r[29]<<8|r[28],C=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],O=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],j=n,H=i,X=s,B=a,L=f,F=u,re=m,E=p,l=x,g=k,h=I,c=T,d=C,y=$,_=O,w=U,b=0;b<c7;b+=2)j=j+L|0,d^=j,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,g=g+y|0,F^=g,F=F>>>32-12|F<<12,X=X+re|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,re^=h,re=re>>>32-12|re<<12,B=B+E|0,w^=B,w=w>>>32-16|w<<16,c=c+w|0,E^=c,E=E>>>32-12|E<<12,X=X+re|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,re^=h,re=re>>>32-7|re<<7,B=B+E|0,w^=B,w=w>>>32-8|w<<8,c=c+w|0,E^=c,E=E>>>32-7|E<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,g=g+y|0,F^=g,F=F>>>32-7|F<<7,j=j+L|0,d^=j,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,j=j+F|0,w^=j,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+re|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,re^=c,re=re>>>32-12|re<<12,X=X+E|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,E^=l,E=E>>>32-12|E<<12,B=B+L|0,_^=B,_=_>>>32-16|_<<16,g=g+_|0,L^=g,L=L>>>32-12|L<<12,X=X+E|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,E^=l,E=E>>>32-7|E<<7,B=B+L|0,_^=B,_=_>>>32-8|_<<8,g=g+_|0,L^=g,L=L>>>32-7|L<<7,H=H+re|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,re^=c,re=re>>>32-7|re<<7,j=j+F|0,w^=j,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;return oo.writeUint32LE(j,t,0),oo.writeUint32LE(H,t,4),oo.writeUint32LE(X,t,8),oo.writeUint32LE(B,t,12),oo.writeUint32LE(d,t,16),oo.writeUint32LE(y,t,20),oo.writeUint32LE(_,t,24),oo.writeUint32LE(w,t,28),t}o(Sg,"hchacha");Ef.hchacha=Sg});var zh=me(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});function l7(r,e,t){return~(r-1)&e|r-1&t}o(l7,"select");ua.select=l7;function d7(r,e){return(r|0)-(e|0)-1>>>31&1}o(d7,"lessOrEqual");ua.lessOrEqual=d7;function Ag(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}o(Ag,"compare");ua.compare=Ag;function h7(r,e){return r.length===0||e.length===0?!1:Ag(r,e)!==0}o(h7,"equal");ua.equal=h7});var kg=me(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var p7=zh(),mu=tn();Mi.DIGEST_LENGTH=16;var Tg=function(){function r(e){this.digestLength=Mi.DIGEST_LENGTH,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,this._finished=!1;var t=e[0]|e[1]<<8;this._r[0]=t&8191;var n=e[2]|e[3]<<8;this._r[1]=(t>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(i>>>7|s<<9)&8191;var a=e[8]|e[9]<<8;this._r[4]=(s>>>4|a<<12)&255,this._r[5]=a>>>1&8190;var f=e[10]|e[11]<<8;this._r[6]=(a>>>14|f<<2)&8191;var u=e[12]|e[13]<<8;this._r[7]=(f>>>11|u<<5)&8065;var m=e[14]|e[15]<<8;this._r[8]=(u>>>8|m<<8)&8191,this._r[9]=m>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return o(r,"Poly1305"),r.prototype._blocks=function(e,t,n){for(var i=this._fin?0:2048,s=this._h[0],a=this._h[1],f=this._h[2],u=this._h[3],m=this._h[4],p=this._h[5],x=this._h[6],k=this._h[7],I=this._h[8],T=this._h[9],C=this._r[0],$=this._r[1],O=this._r[2],U=this._r[3],j=this._r[4],H=this._r[5],X=this._r[6],B=this._r[7],L=this._r[8],F=this._r[9];n>=16;){var re=e[t+0]|e[t+1]<<8;s+=re&8191;var E=e[t+2]|e[t+3]<<8;a+=(re>>>13|E<<3)&8191;var l=e[t+4]|e[t+5]<<8;f+=(E>>>10|l<<6)&8191;var g=e[t+6]|e[t+7]<<8;u+=(l>>>7|g<<9)&8191;var h=e[t+8]|e[t+9]<<8;m+=(g>>>4|h<<12)&8191,p+=h>>>1&8191;var c=e[t+10]|e[t+11]<<8;x+=(h>>>14|c<<2)&8191;var d=e[t+12]|e[t+13]<<8;k+=(c>>>11|d<<5)&8191;var y=e[t+14]|e[t+15]<<8;I+=(d>>>8|y<<8)&8191,T+=y>>>5|i;var _=0,w=_;w+=s*C,w+=a*(5*F),w+=f*(5*L),w+=u*(5*B),w+=m*(5*X),_=w>>>13,w&=8191,w+=p*(5*H),w+=x*(5*j),w+=k*(5*U),w+=I*(5*O),w+=T*(5*$),_+=w>>>13,w&=8191;var b=_;b+=s*$,b+=a*C,b+=f*(5*F),b+=u*(5*L),b+=m*(5*B),_=b>>>13,b&=8191,b+=p*(5*X),b+=x*(5*H),b+=k*(5*j),b+=I*(5*U),b+=T*(5*O),_+=b>>>13,b&=8191;var S=_;S+=s*O,S+=a*$,S+=f*C,S+=u*(5*F),S+=m*(5*L),_=S>>>13,S&=8191,S+=p*(5*B),S+=x*(5*X),S+=k*(5*H),S+=I*(5*j),S+=T*(5*U),_+=S>>>13,S&=8191;var D=_;D+=s*U,D+=a*O,D+=f*$,D+=u*C,D+=m*(5*F),_=D>>>13,D&=8191,D+=p*(5*L),D+=x*(5*B),D+=k*(5*X),D+=I*(5*H),D+=T*(5*j),_+=D>>>13,D&=8191;var v=_;v+=s*j,v+=a*U,v+=f*O,v+=u*$,v+=m*C,_=v>>>13,v&=8191,v+=p*(5*F),v+=x*(5*L),v+=k*(5*B),v+=I*(5*X),v+=T*(5*H),_+=v>>>13,v&=8191;var M=_;M+=s*H,M+=a*j,M+=f*U,M+=u*O,M+=m*$,_=M>>>13,M&=8191,M+=p*C,M+=x*(5*F),M+=k*(5*L),M+=I*(5*B),M+=T*(5*X),_+=M>>>13,M&=8191;var ne=_;ne+=s*X,ne+=a*H,ne+=f*j,ne+=u*U,ne+=m*O,_=ne>>>13,ne&=8191,ne+=p*$,ne+=x*C,ne+=k*(5*F),ne+=I*(5*L),ne+=T*(5*B),_+=ne>>>13,ne&=8191;var A=_;A+=s*B,A+=a*X,A+=f*H,A+=u*j,A+=m*U,_=A>>>13,A&=8191,A+=p*O,A+=x*$,A+=k*C,A+=I*(5*F),A+=T*(5*L),_+=A>>>13,A&=8191;var K=_;K+=s*L,K+=a*B,K+=f*X,K+=u*H,K+=m*j,_=K>>>13,K&=8191,K+=p*U,K+=x*O,K+=k*$,K+=I*C,K+=T*(5*F),_+=K>>>13,K&=8191;var J=_;J+=s*F,J+=a*L,J+=f*B,J+=u*X,J+=m*H,_=J>>>13,J&=8191,J+=p*j,J+=x*U,J+=k*O,J+=I*$,J+=T*C,_+=J>>>13,J&=8191,_=(_<<2)+_|0,_=_+w|0,w=_&8191,_=_>>>13,b+=_,s=w,a=b,f=S,u=D,m=v,p=M,x=ne,k=A,I=K,T=J,t+=16,n-=16}this._h[0]=s,this._h[1]=a,this._h[2]=f,this._h[3]=u,this._h[4]=m,this._h[5]=p,this._h[6]=x,this._h[7]=k,this._h[8]=I,this._h[9]=T},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,a,f;if(this._leftover){for(f=this._leftover,this._buffer[f++]=1;f<16;f++)this._buffer[f]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,f=2;f<10;f++)this._h[f]+=i,i=this._h[f]>>>13,this._h[f]&=8191;for(this._h[0]+=i*5,i=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=i,i=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=i,n[0]=this._h[0]+5,i=n[0]>>>13,n[0]&=8191,f=1;f<10;f++)n[f]=this._h[f]+i,i=n[f]>>>13,n[f]&=8191;for(n[9]-=1<<13,s=(i^1)-1,f=0;f<10;f++)n[f]&=s;for(s=~s,f=0;f<10;f++)this._h[f]=this._h[f]&s|n[f];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,a=this._h[0]+this._pad[0],this._h[0]=a&65535,f=1;f<8;f++)a=(this._h[f]+this._pad[f]|0)+(a>>>16)|0,this._h[f]=a&65535;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},r.prototype.update=function(e){var t=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var s=0;s<i;s++)this._buffer[this._leftover+s]=e[t+s];if(n-=i,t+=i,this._leftover+=i,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(i=n-n%16,this._blocks(e,t,i),t+=i,n-=i),n){for(var s=0;s<n;s++)this._buffer[this._leftover+s]=e[t+s];this._leftover+=n}return this},r.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},r.prototype.clean=function(){return mu.wipe(this._buffer),mu.wipe(this._r),mu.wipe(this._h),mu.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();Mi.Poly1305=Tg;function m7(r,e){var t=new Tg(r);t.update(e);var n=t.digest();return t.clean(),n}o(m7,"oneTimeAuth");Mi.oneTimeAuth=m7;function b7(r,e){return r.length!==Mi.DIGEST_LENGTH||e.length!==Mi.DIGEST_LENGTH?!1:p7.equal(r,e)}o(b7,"equal");Mi.equal=b7});var Og=me(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var bu=Hh(),g7=kg(),Sf=tn(),Cg=Ko(),v7=zh();Ai.KEY_LENGTH=32;Ai.NONCE_LENGTH=12;Ai.TAG_LENGTH=16;var Dg=new Uint8Array(16),y7=function(){function r(e){if(this.nonceLength=Ai.NONCE_LENGTH,this.tagLength=Ai.TAG_LENGTH,e.length!==Ai.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"ChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);bu.stream(this._key,s,a,4);var f=t.length+this.tagLength,u;if(i){if(i.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(f);return bu.streamXOR(this._key,s,t,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),a,u.subarray(0,u.length-this.tagLength),n),Sf.wipe(s),u},r.prototype.open=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);bu.stream(this._key,s,a,4);var f=new Uint8Array(this.tagLength);if(this._authenticate(f,a,t.subarray(0,t.length-this.tagLength),n),!v7.equal(f,t.subarray(t.length-this.tagLength,t.length)))return null;var u=t.length-this.tagLength,m;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");m=i}else m=new Uint8Array(u);return bu.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),m,4),Sf.wipe(s),m},r.prototype.clean=function(){return Sf.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new g7.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(Dg.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(Dg.subarray(n.length%16));var a=new Uint8Array(8);i&&Cg.writeUint64LE(i.length,a),s.update(a),Cg.writeUint64LE(n.length,a),s.update(a);for(var f=s.digest(),u=0;u<f.length;u++)e[u]=f[u];s.clean(),Sf.wipe(f),Sf.wipe(a)},r}();Ai.ChaCha20Poly1305=y7});var Ng=me(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var Ig=Mg(),Pg=Og(),Mf=tn();Ti.KEY_LENGTH=32;Ti.NONCE_LENGTH=24;Ti.TAG_LENGTH=16;var x7=function(){function r(e){if(this.nonceLength=Ti.NONCE_LENGTH,this.tagLength=Ti.TAG_LENGTH,e.length!==Ti.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"XChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var s=Ig.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Pg.ChaCha20Poly1305(s),u=f.seal(a,t,n,i);return Mf.wipe(s),Mf.wipe(a),f.clean(),u},r.prototype.open=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=Ig.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Pg.ChaCha20Poly1305(s),u=f.open(a,t,n,i);return Mf.wipe(s),Mf.wipe(a),f.clean(),u},r.prototype.clean=function(){return Mf.wipe(this._key),this},r}();Ti.XChaCha20Poly1305=x7});var Tn=me((TL,_2)=>{_2.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}});var Rf=me((kL,E2)=>{E2.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}});var A2=me(tr=>{var S2=tr,Ru=4294967292,Lu=4294967293,m0=4294967294,M2=4294967295,xe=[0,1,3,7,15,31,63,127,255,511,1023],co=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],$S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Br=[];$S.forEach(r=>{Br.push(r.charCodeAt(0))});tr.utf8={encode(r){let e=[];return r.forEach(t=>{if(t>=0&&t<=127)e.push(t);else if(t<=2047)e.push(192+(t>>6&xe[5])),e.push(128+(t&xe[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]));else if(t>=65536&&t<=1114111){let n=t>>16&xe[5];e.push(240+(n>>2)),e.push(128+((n&xe[2])<<4)+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Buffer.from(e)},decode(r,e){function t(T,C){if((C&192)!==128)return Lu;let $=((T&xe[5])<<6)+(C&xe[6]);return $<128?Ru:$}o(t,"bytes2");function n(T,C,$){if(($&192)!==128||(C&192)!==128)return Lu;let O=((T&xe[4])<<12)+((C&xe[6])<<6)+($&xe[6]);return O<2048?Ru:O>=55296&&O<=57343?m0:O}o(n,"bytes3");function i(T,C,$,O){if((O&192)!==128||($&192)!==128||(C&192)!==128)return Lu;let U=(((T&xe[3])<<2)+(C>>4&xe[2])<<16)+((C&xe[4])<<12)+(($&xe[6])<<6)+(O&xe[6]);return U<65536?Ru:U>1114111?m0:U}o(i,"bytes4");let s,a,f,u,m,p,x=r.length,k=e?3:0,I=[];for(;k<x;){a=r[k],s=M2;let T=!0;for(;T;){if(a>=0&&a<=127){s=a,p=1;break}if(f=k+1,f<x&&a>=194&&a<=223){s=t(a,r[f]),p=2;break}if(u=k+2,u<x&&a>=224&&a<=239){s=n(a,r[f],r[u]),p=3;break}if(m=k+3,m<x&&a>=240&&a<=244){s=i(a,r[f],r[u],r[m]),p=4;break}break}if(s>1114111){let C=`byte[${k}]`;throw s===M2?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${C}`):s===Lu?new RangeError(`utf8.decode: illegal trailing byte found at: ${C}`):s===m0?new RangeError(`utf8.decode: code point out of range found at: ${C}`):s===Ru?new RangeError(`utf8.decode: non-shortest form found at: ${C}`):new RangeError(`utf8.decode: unrecognized error found at: ${C}`)}I.push(s),k+=p}return I}};tr.utf16be={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t>>8&xe[8]),e.push(t&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n>>8&xe[8]),e.push(n&xe[8]),e.push(i>>8&xe[8]),e.push(i&xe[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,m,p,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(p=(r[i]<<8)+r[u],p<55296||p>57343){a=p,f=2;break}if(m=i+3,m<n&&(x=(r[i+2]<<8)+r[m],p<=56319&&x>=56320&&x<=57343)){a=65536+(p-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};tr.utf16le={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t&xe[8]),e.push(t>>8&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n&xe[8]),e.push(n>>8&xe[8]),e.push(i&xe[8]),e.push(i>>8&xe[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,m,p,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(p=(r[u]<<8)+r[i],p<55296||p>57343){a=p,f=2;break}if(m=i+3,m<n&&(x=(r[m]<<8)+r[i+2],p<=56319&&x>=56320&&x<=57343)){a=65536+(p-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};tr.utf32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${t/4}]: ${n}`);e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n]<<24)+(r[n+1]<<16)+(r[n+2]<<8)+r[n+3];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};tr.utf32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${t/4}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+r[n];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};tr.uint7={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${t}]: ${r[t]}`);e[t]=r[t]}return e}};tr.uint8={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1)e[t]=r[t];return e}};tr.uint16be={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${t/2}]: ${n}`);e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t]<<8)+r[t+1]);return e}};tr.uint16le={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${t/2}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t+1]<<8)+r[t]);return e}};tr.uint32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3]);return e}};tr.uint32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t+3]<<24)+(r[t+2]<<16)+(r[t+1]<<8)+r[t]);return e}};tr.string={encode(r){return S2.utf16le.encode(r).toString("utf16le")},decode(r){return S2.utf16le.decode(Buffer.from(r,"utf16le"),0)}};tr.escaped={encode(r){let e=[];for(let t=0;t<r.length;t+=1){let n=r[t];if(n===96)e.push(n),e.push(n);else if(n===10)e.push(n);else if(n>=32&&n<=126)e.push(n);else{let i="";if(n>=0&&n<=31)i+=`\`x${co[n]}`;else if(n>=127&&n<=255)i+=`\`x${co[n]}`;else if(n>=256&&n<=65535)i+=`\`u${co[n>>8&xe[8]]}${co[n&xe[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let a=n>>24&xe[8];a>0&&(i+=co[a]),i+=`${co[n>>16&xe[8]]+co[n>>8&xe[8]]+co[n&xe[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(i).forEach(a=>{e.push(a)})}}return Buffer.from(e)},decode(r){function e(x){return x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102}o(e,"isHex");function t(x,k,I){let T={char:null,nexti:x+2,error:!0};if(x+1<k&&e(I[x])&&e(I[x+1])){let C=String.fromCodePoint(I[x],I[x+1]);T.char=parseInt(C,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(t,"getx");function n(x,k,I){let T={char:null,nexti:x+4,error:!0};if(x+3<k&&e(I[x])&&e(I[x+1])&&e(I[x+2])&&e(I[x+3])){let C=String.fromCodePoint(I[x],I[x+1],I[x+2],I[x+3]);T.char=parseInt(C,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(n,"getu");function i(x,k,I){let T={char:null,nexti:x+4,error:!0},C="";for(;x<k&&e(I[x]);)C+=String.fromCodePoint(I[x]),x+=1;return T.char=parseInt(C,16),I[x]===125&&!Number.isNaN(T.char)&&(T.error=!1),T.nexti=x+1,T}o(i,"getU");let s=[],a=r.length,f,u,m,p=0;for(;p<a;){for(;;){if(m=!0,r[p]!==96){s.push(r[p]),p+=1,m=!1;break}if(f=p+1,f>=a)break;if(r[f]===96){s.push(96),p+=2,m=!1;break}if(r[f]===120){if(u=t(f+1,a,r),u.error)break;s.push(u.char),p=u.nexti,m=!1;break}if(r[f]===117){if(r[f+1]===123){if(u=i(f+2,a,r),u.error)break;s.push(u.char),p=u.nexti,m=!1;break}if(u=n(f+1,a,r),u.error)break;s.push(u.char),p=u.nexti,m=!1;break}break}if(m)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${p}]`)}return s}};var Lf=13,cn=10;tr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Lf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(Lf),e.push(cn);break;case cn:e.push(Lf),e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&(e.push(Lf),e.push(cn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Lf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(cn);break;case cn:e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&e.push(cn),e}};tr.base64={encode(r){if(r.length===0)return Buffer.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,a=Buffer.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let f=0;f<s;f+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t++]=Br[n&xe[6]];if(i===0)return a;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t]=Br[64],a;if(i===2)return n=r[e]<<16,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[64],a[t]=Br[64],a},decode(r){function e(p){let x=[],k=0;for(let I=0;I<p.length;I+=1){let T=p[I],C=!0;for(;C&&!(T===32||T===9||T===10||T===13);){if(T>=65&&T<=90){x.push(T-65);break}if(T>=97&&T<=122){x.push(T-71);break}if(T>=48&&T<=57){x.push(T+4);break}if(T===43){x.push(62);break}if(T===47){x.push(63);break}if(T===61){x.push(64),k+=1;break}throw new RangeError(`base64.decode: invalid character buf[${I}]: ${T}`)}}if(x.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${x.length}`);switch(k){case 0:break;case 1:if(x[x.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(x[x.length-1]!==64||x[x.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${k}`)}return{tail:k,buf:Buffer.from(x)}}if(o(e,"validate"),r.length===0)return Buffer.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,a,f,u=i.length/4,m=Buffer.alloc(u*3-n);n>0&&(u-=1),a=0,s=0;for(let p=0;p<u;p+=1)f=i[s++]<<18,f+=i[s++]<<12,f+=i[s++]<<6,f+=i[s++],m[a++]=f>>16&xe[8],m[a++]=f>>8&xe[8],m[a++]=f&xe[8];return n===1&&(f=i[s++]<<18,f+=i[s++]<<12,f+=i[s]<<6,m[a++]=f>>16&xe[8],m[a]=f>>8&xe[8]),n===2&&(f=i[s++]<<18,f+=i[s++]<<12,m[a]=f>>16&xe[8]),m},toString(r){if(r.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${r.length}`);let e="",t=0;function n(s,a,f,u){switch(t){case 76:e+=`\r
16
16
  ${s}${a}${f}${u}`,t=4;break;case 75:e+=`${s}\r
17
17
  ${a}${f}${u}`,t=3;break;case 74:e+=`${s+a}\r
18
18
  ${f}${u}`,t=2;break;case 73:e+=`${s+a+f}\r
19
- ${u}`,t=1;break;default:e+=s+a+f+u,t+=4;break}}o(n,"buildLine");function i(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===47||s===61}o(i,"validate");for(let s=0;s<r.length;s+=4){for(let a=s;a<s+4;a+=1)if(!i(r[a]))throw new RangeError(`base64.toString: buf[${a}]: ${r[a]} : not valid base64 character code`);n(String.fromCharCode(r[s]),String.fromCharCode(r[s+1]),String.fromCharCode(r[s+2]),String.fromCharCode(r[s+3]))}return e}}});var y0=me(Uf=>{var T2=Uf,dt=A2(),Bf="UTF8",g0="UTF16",ni="UTF16BE",ki="UTF16LE",v0="UTF32",ii="UTF32BE",Ci="UTF32LE",ya="UINT7",k2="ASCII",C2="BINARY",xa="UINT8",D2="UINT16",Bu="UINT16LE",wa="UINT16BE",I2="UINT32",Uu="UINT32LE",_a="UINT32BE",Fu="ESCAPED",uo="STRING",BS=o(function(e){e.type=Bf;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),US=o(function(e){let t=e.data;switch(e.bom=0,e.type){case g0:e.type=ni,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=ki,e.bom=2));break;case ni:if(e.type=ni,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${ni}" specified but BOM is for "${ki}"`)}break;case ki:if(e.type=ki,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${ki}" specified but BOM is for "${ni}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),FS=o(function(e){let t=e.data;switch(e.bom=0,e.type){case v0:e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=Ci,e.bom=4));break;case ii:if(e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${ii} specified but BOM is for ${Ci}"`);break;case Ci:if(e.type=Ci,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${Ci}" specified but BOM is for "${ii}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),$S=o(function(e,t){function n(s){let a={type:"",base64:!1},u=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return u&&(u[2]&&(a.type=u[2].toUpperCase()),u[1]&&(a.base64=!0)),a}if(o(n,"getType"),typeof e!="string"||e==="")throw new TypeError(`type: "${e}" not recognized`);let i=n(e.toUpperCase());if(i.base64){if(i.type===uo)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${uo}`);if(Buffer.isBuffer(t))i.data=dt.base64.decode(t);else if(typeof t=="string"){let s=Buffer.from(t,"ascii");i.data=dt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case Bf:BS(i);break;case g0:case ni:case ki:US(i);break;case v0:case ii:case Ci:FS(i);break;case D2:i.type=wa;break;case I2:i.type=_a;break;case k2:i.type=ya;break;case C2:i.type=xa;break;case ya:case xa:case Bu:case wa:case Uu:case _a:case uo:case Fu:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===uo){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Buffer.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),qS=o(function(e,t){function n(s){let a,f,u={crlf:!1,lf:!1,base64:!1,type:""},m=!0;for(;m;){if(f=s,a=s.slice(0,5),a==="CRLF:"){u.crlf=!0,f=s.slice(5);break}if(a=s.slice(0,3),a==="LF:"){u.lf=!0,f=s.slice(3);break}break}return a=f.split(":"),a.length===1?u.type=a[0]:a.length===2&&a[1]==="BASE64"&&(u.base64=!0,u.type=a[0]),u}if(o(n,"getType"),!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case Bf:case ni:case ki:case ii:case Ci:case ya:case xa:case Bu:case wa:case Uu:case _a:case Fu:break;case uo:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${uo}`);break;case k2:i.type=ya;break;case C2:i.type=xa;break;case g0:i.type=ni;break;case v0:i.type=ii;break;case D2:i.type=wa;break;case I2:i.type=_a;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),b0=o(function(e,t){switch(e){case Bf:return dt.utf8.encode(t);case ni:return dt.utf16be.encode(t);case ki:return dt.utf16le.encode(t);case ii:return dt.utf32be.encode(t);case Ci:return dt.utf32le.encode(t);case ya:return dt.uint7.encode(t);case xa:return dt.uint8.encode(t);case wa:return dt.uint16be.encode(t);case Bu:return dt.uint16le.encode(t);case _a:return dt.uint32be.encode(t);case Uu:return dt.uint32le.encode(t);case uo:return dt.string.encode(t);case Fu:return dt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),HS=o(function(e){switch(e.type){case Bf:return dt.utf8.decode(e.data,e.bom);case ki:return dt.utf16le.decode(e.data,e.bom);case ni:return dt.utf16be.decode(e.data,e.bom);case ii:return dt.utf32be.decode(e.data,e.bom);case Ci:return dt.utf32le.decode(e.data,e.bom);case ya:return dt.uint7.decode(e.data);case xa:return dt.uint8.decode(e.data);case wa:return dt.uint16be.decode(e.data);case Bu:return dt.uint16le.decode(e.data);case _a:return dt.uint32be.decode(e.data);case Uu:return dt.uint32le.decode(e.data);case uo:return dt.string.decode(e.data);case Fu:return dt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Uf.decode=o(function(e,t){let n=$S(e,t);return HS(n)},"exportsDecode");Uf.encode=o(function(e,t){let n,i,s=qS(e,t);return s.crlf?(n=dt.lineEnds.crlf(t),i=b0(s.type,n)):s.lf?(n=dt.lineEnds.lf(t),i=b0(s.type,n)):i=b0(s.type,t),s.base64&&(i=dt.base64.encode(i)),i},"exportsEncode");Uf.convert=o(function(e,t,n){return T2.encode(n,T2.decode(e,t))},"convert")});var x0=me((TL,O2)=>{O2.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
19
+ ${u}`,t=1;break;default:e+=s+a+f+u,t+=4;break}}o(n,"buildLine");function i(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===47||s===61}o(i,"validate");for(let s=0;s<r.length;s+=4){for(let a=s;a<s+4;a+=1)if(!i(r[a]))throw new RangeError(`base64.toString: buf[${a}]: ${r[a]} : not valid base64 character code`);n(String.fromCharCode(r[s]),String.fromCharCode(r[s+1]),String.fromCharCode(r[s+2]),String.fromCharCode(r[s+3]))}return e}}});var y0=me(Uf=>{var T2=Uf,dt=A2(),Bf="UTF8",g0="UTF16",ni="UTF16BE",Di="UTF16LE",v0="UTF32",ii="UTF32BE",Oi="UTF32LE",ya="UINT7",k2="ASCII",C2="BINARY",xa="UINT8",D2="UINT16",Bu="UINT16LE",wa="UINT16BE",O2="UINT32",Uu="UINT32LE",_a="UINT32BE",Fu="ESCAPED",uo="STRING",qS=o(function(e){e.type=Bf;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),HS=o(function(e){let t=e.data;switch(e.bom=0,e.type){case g0:e.type=ni,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=Di,e.bom=2));break;case ni:if(e.type=ni,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${ni}" specified but BOM is for "${Di}"`)}break;case Di:if(e.type=Di,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${Di}" specified but BOM is for "${ni}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),zS=o(function(e){let t=e.data;switch(e.bom=0,e.type){case v0:e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=Oi,e.bom=4));break;case ii:if(e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${ii} specified but BOM is for ${Oi}"`);break;case Oi:if(e.type=Oi,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${Oi}" specified but BOM is for "${ii}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),jS=o(function(e,t){function n(s){let a={type:"",base64:!1},u=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return u&&(u[2]&&(a.type=u[2].toUpperCase()),u[1]&&(a.base64=!0)),a}if(o(n,"getType"),typeof e!="string"||e==="")throw new TypeError(`type: "${e}" not recognized`);let i=n(e.toUpperCase());if(i.base64){if(i.type===uo)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${uo}`);if(Buffer.isBuffer(t))i.data=dt.base64.decode(t);else if(typeof t=="string"){let s=Buffer.from(t,"ascii");i.data=dt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case Bf:qS(i);break;case g0:case ni:case Di:HS(i);break;case v0:case ii:case Oi:zS(i);break;case D2:i.type=wa;break;case O2:i.type=_a;break;case k2:i.type=ya;break;case C2:i.type=xa;break;case ya:case xa:case Bu:case wa:case Uu:case _a:case uo:case Fu:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===uo){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Buffer.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),KS=o(function(e,t){function n(s){let a,f,u={crlf:!1,lf:!1,base64:!1,type:""},m=!0;for(;m;){if(f=s,a=s.slice(0,5),a==="CRLF:"){u.crlf=!0,f=s.slice(5);break}if(a=s.slice(0,3),a==="LF:"){u.lf=!0,f=s.slice(3);break}break}return a=f.split(":"),a.length===1?u.type=a[0]:a.length===2&&a[1]==="BASE64"&&(u.base64=!0,u.type=a[0]),u}if(o(n,"getType"),!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case Bf:case ni:case Di:case ii:case Oi:case ya:case xa:case Bu:case wa:case Uu:case _a:case Fu:break;case uo:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${uo}`);break;case k2:i.type=ya;break;case C2:i.type=xa;break;case g0:i.type=ni;break;case v0:i.type=ii;break;case D2:i.type=wa;break;case O2:i.type=_a;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),b0=o(function(e,t){switch(e){case Bf:return dt.utf8.encode(t);case ni:return dt.utf16be.encode(t);case Di:return dt.utf16le.encode(t);case ii:return dt.utf32be.encode(t);case Oi:return dt.utf32le.encode(t);case ya:return dt.uint7.encode(t);case xa:return dt.uint8.encode(t);case wa:return dt.uint16be.encode(t);case Bu:return dt.uint16le.encode(t);case _a:return dt.uint32be.encode(t);case Uu:return dt.uint32le.encode(t);case uo:return dt.string.encode(t);case Fu:return dt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),VS=o(function(e){switch(e.type){case Bf:return dt.utf8.decode(e.data,e.bom);case Di:return dt.utf16le.decode(e.data,e.bom);case ni:return dt.utf16be.decode(e.data,e.bom);case ii:return dt.utf32be.decode(e.data,e.bom);case Oi:return dt.utf32le.decode(e.data,e.bom);case ya:return dt.uint7.decode(e.data);case xa:return dt.uint8.decode(e.data);case wa:return dt.uint16be.decode(e.data);case Bu:return dt.uint16le.decode(e.data);case _a:return dt.uint32be.decode(e.data);case Uu:return dt.uint32le.decode(e.data);case uo:return dt.string.decode(e.data);case Fu:return dt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Uf.decode=o(function(e,t){let n=jS(e,t);return VS(n)},"exportsDecode");Uf.encode=o(function(e,t){let n,i,s=KS(e,t);return s.crlf?(n=dt.lineEnds.crlf(t),i=b0(s.type,n)):s.lf?(n=dt.lineEnds.lf(t),i=b0(s.type,n)):i=b0(s.type,t),s.base64&&(i=dt.base64.encode(i)),i},"exportsEncode");Uf.convert=o(function(e,t,n){return T2.encode(n,T2.decode(e,t))},"convert")});var x0=me((OL,I2)=>{I2.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
20
20
  .apg-mono {
21
21
  font-family: monospace;
22
22
  }
@@ -230,27 +230,27 @@ table.apg-attrs a {
230
230
  table.apg-attrs a:hover {
231
231
  color: #8caae6 !important;
232
232
  }
233
- `},"emittcss")});var as=me(Wt=>{var Tr=Rf(),w0=y0(),jS=x0(),Pt=Tn(),lo="utilities.js: ",Di=Wt,ss=o(function(r,e,t){let n,i=e,s=!0;for(;s;){if(r<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=r;break}if(i>=r){i=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=i+t,n>r){n=r;break}break}return{beg:i,end:n}},"getBounds");Wt.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${lo}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
233
+ `},"emittcss")});var as=me(Wt=>{var kr=Rf(),w0=y0(),WS=x0(),Pt=Tn(),lo="utilities.js: ",Ii=Wt,ss=o(function(r,e,t){let n,i=e,s=!0;for(;s;){if(r<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=r;break}if(i>=r){i=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=i+t,n>r){n=r;break}break}return{beg:i,end:n}},"getBounds");Wt.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${lo}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
234
234
  `,n+=`<html lang="en">
235
235
  `,n+=`<head>
236
236
  `,n+=`<meta charset="utf-8">
237
237
  `,n+=`<title>${t}</title>
238
238
  `,n+=`<style>
239
- `,n+=jS(),n+=`</style>
239
+ `,n+=WS(),n+=`</style>
240
240
  `,n+=`</head>
241
241
  <body>
242
242
  `,n+=`<p>${new Date}</p>
243
243
  `,n+=r,n+=`</body>
244
244
  </html>
245
- `,n};Wt.parserResultToHtml=function(r,e){let t=null;typeof e=="string"&&e!==""&&(t=e);let n,i;r.success===!0?n=`<span class="${Tr.CLASS_MATCH}">true</span>`:n=`<span class="${Tr.CLASS_NOMATCH}">false</span>`,r.state===Pt.EMPTY?i=`<span class="${Tr.CLASS_EMPTY}">EMPTY</span>`:r.state===Pt.MATCH?i=`<span class="${Tr.CLASS_MATCH}">MATCH</span>`:r.state===Pt.NOMATCH?i=`<span class="${Tr.CLASS_NOMATCH}">NOMATCH</span>`:i=`<span class="${Tr.CLASS_NOMATCH}">unrecognized</span>`;let s="";return s+=`<table class="${Tr.CLASS_STATE}">
245
+ `,n};Wt.parserResultToHtml=function(r,e){let t=null;typeof e=="string"&&e!==""&&(t=e);let n,i;r.success===!0?n=`<span class="${kr.CLASS_MATCH}">true</span>`:n=`<span class="${kr.CLASS_NOMATCH}">false</span>`,r.state===Pt.EMPTY?i=`<span class="${kr.CLASS_EMPTY}">EMPTY</span>`:r.state===Pt.MATCH?i=`<span class="${kr.CLASS_MATCH}">MATCH</span>`:r.state===Pt.NOMATCH?i=`<span class="${kr.CLASS_NOMATCH}">NOMATCH</span>`:i=`<span class="${kr.CLASS_NOMATCH}">unrecognized</span>`;let s="";return s+=`<table class="${kr.CLASS_STATE}">
246
246
  `,t&&(s+=`<caption>${t}</caption>
247
247
  `),s+=`<tr><th>state item</th><th>value</th><th>description</th></tr>
248
248
  `,s+=`<tr><td>parser success</td><td>${n}</td>
249
- `,s+=`<td><span class="${Tr.CLASS_MATCH}">true</span> if the parse succeeded,
250
- `,s+=` <span class="${Tr.CLASS_NOMATCH}">false</span> otherwise`,s+=`<br><i>NOTE: for success, entire string must be matched</i></td></tr>
249
+ `,s+=`<td><span class="${kr.CLASS_MATCH}">true</span> if the parse succeeded,
250
+ `,s+=` <span class="${kr.CLASS_NOMATCH}">false</span> otherwise`,s+=`<br><i>NOTE: for success, entire string must be matched</i></td></tr>
251
251
  `,s+=`<tr><td>parser state</td><td>${i}</td>
252
- `,s+=`<td><span class="${Tr.CLASS_EMPTY}">EMPTY</span>, `,s+=`<span class="${Tr.CLASS_MATCH}">MATCH</span> or
253
- `,s+=`<span class="${Tr.CLASS_NOMATCH}">NOMATCH</span></td></tr>
252
+ `,s+=`<td><span class="${kr.CLASS_EMPTY}">EMPTY</span>, `,s+=`<span class="${kr.CLASS_MATCH}">MATCH</span> or
253
+ `,s+=`<span class="${kr.CLASS_NOMATCH}">NOMATCH</span></td></tr>
254
254
  `,s+=`<tr><td>string length</td><td>${r.length}</td><td>length of the input (sub)string</td></tr>
255
255
  `,s+=`<tr><td>matched length</td><td>${r.matched}</td><td>number of input string characters matched</td></tr>
256
256
  `,s+=`<tr><td>max matched</td><td>${r.maxMatched}</td><td>maximum number of input string characters matched</td></tr>
@@ -261,30 +261,30 @@ table.apg-attrs a:hover {
261
261
  `,s+=`<tr><td>sub-string end</td><td>${r.subEnd}</td><td>sub-string end-of-string index</td></tr>
262
262
  `,s+=`<tr><td>sub-string length</td><td>${r.subLength}</td><td>sub-string length</td></tr>
263
263
  `,s+=`</table>
264
- `,s};Wt.charsToString=function(r,e,t){let n,i;if(typeof e=="number"){if(e>=r.length)return"";n=e<0?0:e}else n=0;if(typeof t=="number"){if(t<=0)return"";i=t>r.length-n?r.length:n+t}else i=r.length;return n<i?w0.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};Wt.stringToChars=function(r){return w0.decode("STRING",r)};Wt.opcodeToString=function(r){let e="unknown";switch(r){case Pt.ALT:e="ALT";break;case Pt.CAT:e="CAT";break;case Pt.RNM:e="RNM";break;case Pt.UDT:e="UDT";break;case Pt.AND:e="AND";break;case Pt.NOT:e="NOT";break;case Pt.REP:e="REP";break;case Pt.TRG:e="TRG";break;case Pt.TBS:e="TBS";break;case Pt.TLS:e="TLS";break;case Pt.BKR:e="BKR";break;case Pt.BKA:e="BKA";break;case Pt.BKN:e="BKN";break;case Pt.ABG:e="ABG";break;case Pt.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};Wt.stateToString=function(r){let e="unknown";switch(r){case Pt.ACTIVE:e="ACTIVE";break;case Pt.MATCH:e="MATCH";break;case Pt.EMPTY:e="EMPTY";break;case Pt.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};Wt.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US","&nbsp;","!","&#34;","#","$","%","&#38;","&#39;","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&#60;","=","&#62;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","&#92;","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"];Wt.charToHex=function(r){let e=r.toString(16).toUpperCase();switch(e.length){case 1:case 3:case 7:e=`0${e}`;break;case 2:case 6:e=`00${e}`;break;case 4:break;case 5:e=`000${e}`;break;default:throw new Error("unrecognized option")}return e};Wt.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToDec: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg){n+=r[i.beg];for(let s=i.beg+1;s<i.end;s+=1)n+=`,${r[s]}`}return n};Wt.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToHex: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg){n+=`\\x${Di.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${Di.charToHex(r[s])}`}return n};Wt.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToHex: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)n+=`&#x${r[s].toString(16)};`;return n};function zS(r){return!(r>=55296&&r<=57343||r>1114111)}o(zS,"isUnicode");Wt.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToUnicode: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)zS(r[s])?n+=`&#${r[s]};`:n+=` U+${Di.charToHex(r[s])}`;return n};Wt.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToJsUnicode: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg){n+=`\\u${Di.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${Di.charToHex(r[s])}`}return n};Wt.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToAscii: input must be an array of integers`);let i=ss(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let a=r[s];a>=32&&a<=126?n+=String.fromCharCode(a):n+=`\\x${Di.charToHex(a)}`}return n};Wt.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${lo}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=ss(r.length,e,t);for(let a=s.beg;a<s.end;a+=1)i=r[a],i<32||i===127?n+=`<span class="${Tr.CLASS_CTRLCHAR}">${Di.asciiChars[i]}</span>`:i>127?n+=`<span class="${Tr.CLASS_CTRLCHAR}">U+${Di.charToHex(i)}</span>`:n+=Di.asciiChars[i];return n};Wt.stringToAsciiHtml=function(r){let e=w0.decode("STRING",r);return this.charsToAsciiHtml(e)}});var N2=me((CL,P2)=>{P2.exports=o(function(){let e=Tn(),t=as(),n="ast.js: ",i=this,s=null,a=null,f=null,u=0,m=[],p=[],x=[],k=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(C,$,I){x.length=0,k.length=0,m.length=0,u=0,s=C,a=$,f=I;let U,z=[];for(U=0;U<s.length;U+=1)z.push(s[U].lower);for(U=0;U<a.length;U+=1)z.push(a[U].lower);for(u=s.length+a.length,U=0;U<u;U+=1)m[U]=!1,p[U]=null;for(let H in i.callbacks){let X=H.toLowerCase();if(U=z.indexOf(X),U<0)throw new Error(`${n}init: node '${H}' not a rule or udt name`);typeof i.callbacks[H]=="function"&&(m[U]=!0,p[U]=i.callbacks[H]),i.callbacks[H]===!0&&(m[U]=!0)}},"init"),this.ruleDefined=o(function(C){return m[C]!==!1},"ruleDefined"),this.udtDefined=o(function(C){return m[s.length+C]!==!1},"udtDefined"),this.down=o(function(C,$){let I=k.length;return x.push(I),k.push({name:$,thisIndex:I,thatIndex:null,state:e.SEM_PRE,callbackIndex:C,phraseIndex:null,phraseLength:null,stack:x.length}),I},"down"),this.up=o(function(C,$,I,U){let z=k.length,H=x.pop();return k.push({name:$,thisIndex:z,thatIndex:H,state:e.SEM_POST,callbackIndex:C,phraseIndex:I,phraseLength:U,stack:x.length}),k[H].thatIndex=z,k[H].phraseIndex=I,k[H].phraseLength=U,z},"up"),this.translate=o(function(C){let $,I,U;for(let z=0;z<k.length;z+=1)U=k[z],I=p[U.callbackIndex],U.state===e.SEM_PRE?I!==null&&($=I(e.SEM_PRE,f,U.phraseIndex,U.phraseLength,C),$===e.SEM_SKIP&&(z=U.thatIndex)):I!==null&&I(e.SEM_POST,f,U.phraseIndex,U.phraseLength,C)},"translate"),this.setLength=o(function(C){k.length=C,C>0?x.length=k[C-1].stack:x.length=0},"setLength"),this.getLength=o(function(){return k.length},"getLength");function O(T){let C="";for(let $=0;$<T;$+=1)C+=" ";return C}o(O,"indent"),this.toXml=o(function(C){let $=t.charsToDec,I="decimal integer character codes";if(typeof C=="string"&&C.length>=3){let H=C.slice(0,3).toLowerCase();H==="asc"?($=t.charsToAscii,I="ASCII for printing characters, hex for non-printing"):H==="hex"?($=t.charsToHex,I="hexadecimal integer character codes"):H==="uni"&&($=t.charsToUnicode,I="Unicode UTF-32 integer character codes")}let U="",z=0;return U+=`<?xml version="1.0" encoding="utf-8"?>
264
+ `,s};Wt.charsToString=function(r,e,t){let n,i;if(typeof e=="number"){if(e>=r.length)return"";n=e<0?0:e}else n=0;if(typeof t=="number"){if(t<=0)return"";i=t>r.length-n?r.length:n+t}else i=r.length;return n<i?w0.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};Wt.stringToChars=function(r){return w0.decode("STRING",r)};Wt.opcodeToString=function(r){let e="unknown";switch(r){case Pt.ALT:e="ALT";break;case Pt.CAT:e="CAT";break;case Pt.RNM:e="RNM";break;case Pt.UDT:e="UDT";break;case Pt.AND:e="AND";break;case Pt.NOT:e="NOT";break;case Pt.REP:e="REP";break;case Pt.TRG:e="TRG";break;case Pt.TBS:e="TBS";break;case Pt.TLS:e="TLS";break;case Pt.BKR:e="BKR";break;case Pt.BKA:e="BKA";break;case Pt.BKN:e="BKN";break;case Pt.ABG:e="ABG";break;case Pt.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};Wt.stateToString=function(r){let e="unknown";switch(r){case Pt.ACTIVE:e="ACTIVE";break;case Pt.MATCH:e="MATCH";break;case Pt.EMPTY:e="EMPTY";break;case Pt.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};Wt.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US","&nbsp;","!","&#34;","#","$","%","&#38;","&#39;","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&#60;","=","&#62;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","&#92;","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"];Wt.charToHex=function(r){let e=r.toString(16).toUpperCase();switch(e.length){case 1:case 3:case 7:e=`0${e}`;break;case 2:case 6:e=`00${e}`;break;case 4:break;case 5:e=`000${e}`;break;default:throw new Error("unrecognized option")}return e};Wt.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToDec: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg){n+=r[i.beg];for(let s=i.beg+1;s<i.end;s+=1)n+=`,${r[s]}`}return n};Wt.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToHex: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg){n+=`\\x${Ii.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${Ii.charToHex(r[s])}`}return n};Wt.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToHex: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)n+=`&#x${r[s].toString(16)};`;return n};function GS(r){return!(r>=55296&&r<=57343||r>1114111)}o(GS,"isUnicode");Wt.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToUnicode: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)GS(r[s])?n+=`&#${r[s]};`:n+=` U+${Ii.charToHex(r[s])}`;return n};Wt.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToJsUnicode: input must be an array of integers`);let i=ss(r.length,e,t);if(i.end>i.beg){n+=`\\u${Ii.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${Ii.charToHex(r[s])}`}return n};Wt.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${lo}charsToAscii: input must be an array of integers`);let i=ss(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let a=r[s];a>=32&&a<=126?n+=String.fromCharCode(a):n+=`\\x${Ii.charToHex(a)}`}return n};Wt.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${lo}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=ss(r.length,e,t);for(let a=s.beg;a<s.end;a+=1)i=r[a],i<32||i===127?n+=`<span class="${kr.CLASS_CTRLCHAR}">${Ii.asciiChars[i]}</span>`:i>127?n+=`<span class="${kr.CLASS_CTRLCHAR}">U+${Ii.charToHex(i)}</span>`:n+=Ii.asciiChars[i];return n};Wt.stringToAsciiHtml=function(r){let e=w0.decode("STRING",r);return this.charsToAsciiHtml(e)}});var N2=me((PL,P2)=>{P2.exports=o(function(){let e=Tn(),t=as(),n="ast.js: ",i=this,s=null,a=null,f=null,u=0,m=[],p=[],x=[],k=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(C,$,O){x.length=0,k.length=0,m.length=0,u=0,s=C,a=$,f=O;let U,j=[];for(U=0;U<s.length;U+=1)j.push(s[U].lower);for(U=0;U<a.length;U+=1)j.push(a[U].lower);for(u=s.length+a.length,U=0;U<u;U+=1)m[U]=!1,p[U]=null;for(let H in i.callbacks){let X=H.toLowerCase();if(U=j.indexOf(X),U<0)throw new Error(`${n}init: node '${H}' not a rule or udt name`);typeof i.callbacks[H]=="function"&&(m[U]=!0,p[U]=i.callbacks[H]),i.callbacks[H]===!0&&(m[U]=!0)}},"init"),this.ruleDefined=o(function(C){return m[C]!==!1},"ruleDefined"),this.udtDefined=o(function(C){return m[s.length+C]!==!1},"udtDefined"),this.down=o(function(C,$){let O=k.length;return x.push(O),k.push({name:$,thisIndex:O,thatIndex:null,state:e.SEM_PRE,callbackIndex:C,phraseIndex:null,phraseLength:null,stack:x.length}),O},"down"),this.up=o(function(C,$,O,U){let j=k.length,H=x.pop();return k.push({name:$,thisIndex:j,thatIndex:H,state:e.SEM_POST,callbackIndex:C,phraseIndex:O,phraseLength:U,stack:x.length}),k[H].thatIndex=j,k[H].phraseIndex=O,k[H].phraseLength=U,j},"up"),this.translate=o(function(C){let $,O,U;for(let j=0;j<k.length;j+=1)U=k[j],O=p[U.callbackIndex],U.state===e.SEM_PRE?O!==null&&($=O(e.SEM_PRE,f,U.phraseIndex,U.phraseLength,C),$===e.SEM_SKIP&&(j=U.thatIndex)):O!==null&&O(e.SEM_POST,f,U.phraseIndex,U.phraseLength,C)},"translate"),this.setLength=o(function(C){k.length=C,C>0?x.length=k[C-1].stack:x.length=0},"setLength"),this.getLength=o(function(){return k.length},"getLength");function I(T){let C="";for(let $=0;$<T;$+=1)C+=" ";return C}o(I,"indent"),this.toXml=o(function(C){let $=t.charsToDec,O="decimal integer character codes";if(typeof C=="string"&&C.length>=3){let H=C.slice(0,3).toLowerCase();H==="asc"?($=t.charsToAscii,O="ASCII for printing characters, hex for non-printing"):H==="hex"?($=t.charsToHex,O="hexadecimal integer character codes"):H==="uni"&&($=t.charsToUnicode,O="Unicode UTF-32 integer character codes")}let U="",j=0;return U+=`<?xml version="1.0" encoding="utf-8"?>
265
265
  `,U+=`<root nodes="${k.length/2}" characters="${f.length}">
266
- `,U+=`<!-- input string, ${I} -->
267
- `,U+=O(z+2),U+=$(f),U+=`
268
- `,k.forEach(H=>{H.state===e.SEM_PRE?(z+=1,U+=O(z),U+=`<node name="${H.name}" index="${H.phraseIndex}" length="${H.phraseLength}">
269
- `,U+=O(z+2),U+=$(f,H.phraseIndex,H.phraseLength),U+=`
270
- `):(U+=O(z),U+=`</node><!-- name="${H.name}" -->
271
- `,z-=1)}),U+=`</root>
272
- `,U},"toSml"),this.phrases=o(function(){let C={},$,I;for($=0;$<k.length;$+=1)I=k[$],I.state===e.SEM_PRE&&(Array.isArray(C[I.name])||(C[I.name]=[]),C[I.name].push({index:I.phraseIndex,length:I.phraseLength}));return C},"phrases")},"exportsAst")});var _0=me((DL,R2)=>{R2.exports=o(function(){let e="circular-buffer.js: ",t=-1,n=0;this.init=o(function(s){if(typeof s!="number"||s<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(s),t=-1},"init"),this.increment=o(function(){return t+=1,(t+n)%n},"increment"),this.maxSize=o(function(){return n},"maxSize"),this.items=o(function(){return t+1},"items"),this.getListIndex=o(function(s){return t===-1||s<0||s>t||t-s>=n?-1:(s+n)%n},"getListIndex"),this.forEach=o(function(s){if(t!==-1){if(t<n){for(let a=0;a<=t;a+=1)s(a,a);return}for(let a=t-n+1;a<=t;a+=1){let f=(a+n)%n;s(f,a)}}},"forEach")},"exportsCircularBuffer")});var B2=me((IL,L2)=>{L2.exports=o(function(){let e=Tn(),t=as(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let a=null,f=null,u,m,p,x,k=0,O=0,T=0,C=null,$=null,I=null,U=null,z=null,H=0,X=1/0,B=1/0,L=o(function(G,P,j){let ae=`${n}evaluateRule(): `;if(G>=I.length)throw new Error(`${ae}rule index: ${G} out of range`);if(P>=p)throw new Error(`${ae}phrase index: ${P} out of range`);let{length:ue}=a;a.push({type:e.RNM,index:G}),s(ue,P,j),a.pop()},"evaluateRule"),F=o(function(te,G,P){let j=`${n}evaluateUdt(): `;if(te>=U.length)throw new Error(`${j}udt index: ${te} out of range`);if(G>=p)throw new Error(`${j}phrase index: ${G} out of range`);let{length:ae}=a;a.push({type:e.UDT,empty:U[te].empty,index:te}),s(ae,G,P),a.pop()},"evaluateUdt"),re=o(function(){k=0,O=0,T=0,H=0,x=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],I=null,U=null,f=null,u=0,m=0,p=0,C=null,$=null,z=null,a=null},"clear"),E=o(function(){let te=[],G=o(function(){let j={};I.forEach(ae=>{ae.isBkr&&(j[ae.lower]=null)}),U.length>0&&U.forEach(ae=>{ae.isBkr&&(j[ae.lower]=null)}),te.push(j)},"init"),P=o(function(){let j=te[te.length-1],ae={};for(let ue in j)ae[ue]=j[ue];return ae},"copy");this.push=o(function(){te.push(P())},"push"),this.pop=o(function(ae){let ue=ae;if(ue||(ue=te.length-1),ue<1||ue>te.length)throw new Error(`${n}backRef.pop(): bad length: ${ue}`);return te.length=ue,te[te.length-1]},"pop"),this.length=o(function(){return te.length},"length"),this.savePhrase=o(function(ae,ue,le){te[te.length-1][ae]={phraseIndex:ue,phraseLength:le}},"savePhrase"),this.getPhrase=function(j){return te[te.length-1][j]},G()},"backRef"),l=o(function(){let G=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=x[x.length-1],this.uFrame=new E,this.pFrame=new E,this.evaluateRule=L,this.evaluateUdt=F,this.refresh=o(function(){G.state=e.ACTIVE,G.phraseLength=0,G.lookAround=x[x.length-1]},"refresh")},"systemData"),g=o(function(){return x[x.length-1]},"lookAroundValue"),h=o(function(){return x.length>1},"inLookAround"),c=o(function(){return x[x.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),d=o(function(){let te=`${n}initializeAst(): `,G=!0;for(;G;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${te}ast object not recognized`);break}i.ast!==null&&i.ast.init(I,U,f)},"initializeAst"),y=o(function(){let te=`${n}initializeTrace(): `,G=!0;for(;G;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${te}trace object not recognized`);break}i.trace!==null&&i.trace.init(I,U,f)},"initializeTrace"),_=o(function(){let te=`${n}initializeStats(): `,G=!0;for(;G;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${te}stats object not recognized`);break}i.stats!==null&&i.stats.init(I,U)},"initializeStats"),w=o(function(te){let G=`${n}initializeGrammar(): `;if(!te)throw new Error(`${G}grammar object undefined`);if(te.grammarObject!=="grammarObject")throw new Error(`${G}bad grammar object`);I=te.rules,U=te.udts},"initializeGrammar"),b=o(function(te){let G=`${n}initializeStartRule(): `,P=null;if(typeof te=="number"){if(te>=I.length)throw new Error(`${G}start rule index too large: max: ${I.length}: index: ${te}`);P=te}else if(typeof te=="string"){let j=te.toLowerCase();for(let ae=0;ae<I.length;ae+=1)if(j===I[ae].lower){P=I[ae].index;break}if(P===null)throw new Error(`${G}start rule name '${te}' not recognized`)}else throw new Error(`${G}type of start rule '${typeof te}' not recognized`);return P},"initializeStartRule"),S=o(function(G,P,j){let ae=`${n}initializeInputChars(): `,ue=G,le=P,ge=j;if(ue===void 0)throw new Error(`${ae}input string is undefined`);if(ue===null)throw new Error(`${ae}input string is null`);if(typeof ue=="string")ue=t.stringToChars(ue);else if(!Array.isArray(ue))throw new Error(`${ae}input string is not a string or array`);if(ue.length>0&&typeof ue[0]!="number")throw new Error(`${ae}input string not an array of integers`);if(typeof le!="number")le=0;else if(le=Math.floor(le),le<0||le>ue.length)throw new Error(`${ae}input beginning index out of range: ${le}`);if(typeof ge!="number")ge=ue.length-le;else if(ge=Math.floor(ge),ge<0||ge>ue.length-le)throw new Error(`${ae}input length out of range: ${ge}`);f=ue,u=le,m=ge,p=u+m},"initializeInputChars"),D=o(function(){let te=`${n}initializeCallbacks(): `,G;for(C=[],$=[],G=0;G<I.length;G+=1)C[G]=null;for(G=0;G<U.length;G+=1)$[G]=null;let P,j=[];for(G=0;G<I.length;G+=1)j.push(I[G].lower);for(G=0;G<U.length;G+=1)j.push(U[G].lower);for(let ae in i.callbacks){if(G=j.indexOf(ae.toLowerCase()),G<0)throw new Error(`${te}syntax callback '${ae}' not a rule or udt name`);if(P=i.callbacks[ae],P||(P=null),typeof P=="function"||P===null)G<I.length?C[G]=P:$[G-I.length]=P;else throw new Error(`${te}syntax callback[${ae}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(G=0;G<U.length;G+=1)if($[G]===null)throw new Error(`${te}all UDT callbacks must be defined. UDT callback[${U[G].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(te){if(typeof te!="number")throw new Error(`parser: max tree depth must be integer > 0: ${te}`);if(X=Math.floor(te),X<=0)throw new Error(`parser: max tree depth must be integer > 0: ${te}`)},this.setMaxNodeHits=function(te){if(typeof te!="number")throw new Error(`parser: max node hits must be integer > 0: ${te}`);if(B=Math.floor(te),B<=0)throw new Error(`parser: max node hits must be integer > 0: ${te}`)};let v=o(function(te,G,P){let j,ae=`${n}parse(): `;w(te);let ue=b(G);D(),y(),_(),d();let le=new l;switch(P!=null&&(z=P),a=[{type:e.RNM,index:ue}],s(0,u,le),a=null,le.state){case e.ACTIVE:throw new Error(`${ae}final state should never be 'ACTIVE'`);case e.NOMATCH:j=!1;break;case e.EMPTY:case e.MATCH:le.phraseLength===m?j=!0:j=!1;break;default:throw new Error("unrecognized state")}return{success:j,state:le.state,length:m,matched:le.phraseLength,maxMatched:H,maxTreeDepth:O,nodeHits:T,inputLength:f.length,subBegin:u,subEnd:p,subLength:m}},"privateParse");this.parseSubstring=o(function(G,P,j,ae,ue,le){return re(),S(j,ae,ue),v(G,P,le)},"parseSubstring"),this.parse=o(function(G,P,j,ae){return re(),S(j,0,j.length),v(G,P,ae)},"parse");let M=o(function(te,G,P){let j=a[te];for(let ae=0;ae<j.children.length&&(s(j.children[ae],G,P),P.state===e.NOMATCH);ae+=1);},"opALT"),ne=o(function(te,G,P){let j,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),j=!0,ue=G,le=0;for(let ve=0;ve<ge.children.length;ve+=1)if(s(ge.children[ve],ue,P),P.state===e.NOMATCH){j=!1;break}else ue+=P.phraseLength,le+=P.phraseLength;j?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCAT"),A=o(function(te,G,P){let j,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(j=i.ast.getLength());let ve=!0;for(;ve&&!(ae>=p||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae+=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(j))},"opREP"),K=o(function(te,G,P,j){if(G.phraseLength>P){let ae=`${n}opRNM(${te.name}): callback function error: `;throw ae+=`sysData.phraseLength: ${G.phraseLength}`,ae+=` must be <= remaining chars: ${P}`,new Error(ae)}switch(G.state){case e.ACTIVE:if(j!==!0)throw new Error(`${n}opRNM(${te.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:G.phraseLength=0;break;case e.MATCH:G.phraseLength===0&&(G.state=e.EMPTY);break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opRNM(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateRnmCallbackResult"),J=o(function(te,G,P){let j,ae,ue,le,ge,ft,Ee=a[te],ve=I[Ee.index],lt=C[ve.index],De=!h();if(De&&(ae=i.ast&&i.ast.ruleDefined(Ee.index),ae&&(j=i.ast.getLength(),i.ast.down(Ee.index,I[Ee.index].name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new E),lt===null)ue=a,a=ve.opcodes,s(0,G,P),a=ue;else{let Ne=p-G;P.ruleIndex=ve.index,lt(P,f,G,z),K(ve,P,Ne,!0),P.state===e.ACTIVE&&(ue=a,a=ve.opcodes,s(0,G,P),a=ue,P.ruleIndex=ve.index,lt(P,f,G,z),K(ve,P,Ne,!1))}De&&(ae&&(P.state===e.NOMATCH?i.ast.setLength(j):i.ast.up(Ee.index,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opRNM"),N=o(function(te,G,P){if(G.phraseLength>P){let j=`${n}opUDT(${te.name}): callback function error: `;throw j+=`sysData.phraseLength: ${G.phraseLength}`,j+=` must be <= remaining chars: ${P}`,new Error(j)}switch(G.state){case e.ACTIVE:throw new Error(`${n}opUDT(${te.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.phraseLength=0;break;case e.MATCH:if(G.phraseLength===0){if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.state=e.EMPTY}break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opUDT(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateUdtCallbackResult"),R=o(function(te,G,P){let j,ae,ue,le,ge,ft,Ee=a[te],ve=U[Ee.index];P.UdtIndex=ve.index;let lt=!h();lt&&(ue=i.ast&&i.ast.udtDefined(Ee.index),ue&&(ae=I.length+Ee.index,j=i.ast.getLength(),i.ast.down(ae,ve.name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new E);let De=p-G;$[Ee.index](P,f,G,z),N(ve,P,De),lt&&(ue&&(P.state===e.NOMATCH?i.ast.setLength(j):i.ast.up(ae,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opUDT"),V=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:p,charsLength:m}),p=f.length,m=f.length-u,s(te+1,G,P);let j=x.pop();switch(p=j.charsEnd,m=j.charsLength,P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${P.state}`)}},"opAND"),W=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:p,charsLength:m}),p=f.length,m=f.length-u,s(te+1,G,P);let j=x.pop();switch(p=j.charsEnd,m=j.charsLength,P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${P.state}`)}},"opNOT"),ee=o(function(te,G,P){let j=a[te];P.state=e.NOMATCH,G<p&&j.min<=f[G]&&f[G]<=j.max&&(P.state=e.MATCH,P.phraseLength=1)},"opTRG"),he=o(function(te,G,P){let j,ae=a[te],ue=ae.string.length;if(P.state=e.NOMATCH,G+ue<=p){for(j=0;j<ue;j+=1)if(f[G+j]!==ae.string[j])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBS"),fe=o(function(te,G,P){let j,ae,ue=a[te];P.state=e.NOMATCH;let le=ue.string.length;if(le===0){P.state=e.EMPTY;return}if(G+le<=p){for(j=0;j<le;j+=1)if(ae=f[G+j],ae>=65&&ae<=90&&(ae+=32),ae!==ue.string[j])return;P.state=e.MATCH,P.phraseLength=le}},"opTLS"),Y=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===0?e.EMPTY:e.NOMATCH},"opABG"),pe=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===f.length?e.EMPTY:e.NOMATCH},"opAEN"),Q=o(function(te,G,P){let j,ae,ue,le,ge=a[te];P.state=e.NOMATCH,ge.index<I.length?le=I[ge.index].lower:le=U[ge.index-I.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY;return}if(G+lt<=p){if(Ee){for(j=0;j<lt;j+=1)if(ae=f[G+j],ue=f[ve+j],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(j=0;j<lt;j+=1)if(ae=f[G+j],ue=f[ve+j],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKR"),ce=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${P.state}`)}},"opBKA"),q=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${P.state}`)}},"opBKN"),se=o(function(te,G,P){let j,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),j=!0,ue=G,le=0;for(let ve=ge.children.length-1;ve>=0;ve-=1)if(s(ge.children[ve],ue,P),ue-=P.phraseLength,le+=P.phraseLength,P.state===e.NOMATCH){j=!1;break}j?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCATBehind"),be=o(function(te,G,P){let j,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(j=i.ast.getLength());let ve=!0;for(;ve&&!(ae<=0||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae-=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(j))},"opREPBehind"),Te=o(function(te,G,P){let j=a[te];if(P.state=e.NOMATCH,P.phraseLength=0,G>0){let ae=f[G-1];j.min<=ae&&ae<=j.max&&(P.state=e.MATCH,P.phraseLength=1)}},"opTRGBehind"),we=o(function(te,G,P){let j,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length,le=G-ue;if(le>=0){for(j=0;j<ue;j+=1)if(f[le+j]!==ae.string[j])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBSBehind"),Oe=o(function(te,G,P){let j,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length;if(ue===0){P.state=e.EMPTY;return}let le=G-ue;if(le>=0){for(let ge=0;ge<ue;ge+=1)if(j=f[le+ge],j>=65&&j<=90&&(j+=32),j!==ae.string[ge])return;P.state=e.MATCH,P.phraseLength=ue}},"opTLSBehind"),gr=o(function(te,G,P){let j,ae,ue,le,ge=a[te];P.state=e.NOMATCH,P.phraseLength=0,ge.index<I.length?le=I[ge.index].lower:le=U[ge.index-I.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY,P.phraseLength=0;return}let De=G-lt;if(De>=0){if(Ee){for(j=0;j<lt;j+=1)if(ae=f[De+j],ue=f[ve+j],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(j=0;j<lt;j+=1)if(ae=f[De+j],ue=f[ve+j],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKRBehind");s=o(function(G,P,j){let ae=!0,ue=a[G];if(T+=1,T>B)throw new Error(`parser: maximum number of node hits exceeded: ${B}`);if(k+=1,k>O&&(O=k,O>X))throw new Error(`parser: maximum parse tree depth exceeded: ${X}`);if(j.refresh(),i.trace!==null){let le=g();i.trace.down(ue,j.state,P,j.phraseLength,le.anchor,le.lookAround)}if(c())switch(ue.type){case e.ALT:M(G,P,j);break;case e.CAT:se(G,P,j);break;case e.REP:be(G,P,j);break;case e.RNM:J(G,P,j);break;case e.UDT:R(G,P,j);break;case e.AND:V(G,P,j);break;case e.NOT:W(G,P,j);break;case e.TRG:Te(G,P,j);break;case e.TBS:we(G,P,j);break;case e.TLS:Oe(G,P,j);break;case e.BKR:gr(G,P,j);break;case e.BKA:ce(G,P,j);break;case e.BKN:q(G,P,j);break;case e.ABG:Y(G,P,j);break;case e.AEN:pe(G,P,j);break;default:ae=!1;break}else switch(ue.type){case e.ALT:M(G,P,j);break;case e.CAT:ne(G,P,j);break;case e.REP:A(G,P,j);break;case e.RNM:J(G,P,j);break;case e.UDT:R(G,P,j);break;case e.AND:V(G,P,j);break;case e.NOT:W(G,P,j);break;case e.TRG:ee(G,P,j);break;case e.TBS:he(G,P,j);break;case e.TLS:fe(G,P,j);break;case e.BKR:Q(G,P,j);break;case e.BKA:ce(G,P,j);break;case e.BKN:q(G,P,j);break;case e.ABG:Y(G,P,j);break;case e.AEN:pe(G,P,j);break;default:ae=!1;break}if(!h()&&P+j.phraseLength>H&&(H=P+j.phraseLength),i.stats!==null&&i.stats.collect(ue,j),i.trace!==null){let le=g();i.trace.up(ue,j.state,P,j.phraseLength,le.anchor,le.lookAround)}return k-=1,ae},"opExecuteFunc")},"parser")});var F2=me((OL,U2)=>{U2.exports=o(function(){let e=Tn(),t=as(),n=Rf(),i="stats.js: ",s=[],a=[],f=[],u,m=[],p=[];this.statsObject="statsObject";let x="stats",k=o(function(B,L){return B.lower<L.lower?-1:B.lower>L.lower?1:0},"sortAlpha"),O=o(function(B,L){return B.total<L.total?1:B.total>L.total?-1:k(B,L)},"sortHits"),T=o(function(B,L){return B.index<L.index?-1:B.index>L.index?1:0},"sortIndex"),C=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),$=o(function(){f.length=0,u=new C,f[e.ALT]=new C,f[e.CAT]=new C,f[e.REP]=new C,f[e.RNM]=new C,f[e.TRG]=new C,f[e.TBS]=new C,f[e.TLS]=new C,f[e.UDT]=new C,f[e.AND]=new C,f[e.NOT]=new C,f[e.BKR]=new C,f[e.BKA]=new C,f[e.BKN]=new C,f[e.ABG]=new C,f[e.AEN]=new C,m.length=0;for(let B=0;B<s.length;B+=1)m.push({empty:0,match:0,nomatch:0,total:0,name:s[B].name,lower:s[B].lower,index:s[B].index});if(a.length>0){p.length=0;for(let B=0;B<a.length;B+=1)p.push({empty:0,match:0,nomatch:0,total:0,name:a[B].name,lower:a[B].lower,index:a[B].index})}},"clear"),I=o(function(B,L){switch(B.total+=1,L){case e.EMPTY:B.empty+=1;break;case e.MATCH:B.match+=1;break;case e.NOMATCH:B.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${L}`)}},"incStat"),U=o(function(B,L){let F="";return F+="<tr>",F+=`<td class="${n.CLASS_ACTIVE}">${B}</td>`,F+=`<td class="${n.CLASS_EMPTY}">${L.empty}</td>`,F+=`<td class="${n.CLASS_MATCH}">${L.match}</td>`,F+=`<td class="${n.CLASS_NOMATCH}">${L.nomatch}</td>`,F+=`<td class="${n.CLASS_ACTIVE}">${L.total}</td>`,F+=`</tr>
273
- `,F},"displayRow"),z=o(function(){let B="";return B+=U("ALT",f[e.ALT]),B+=U("CAT",f[e.CAT]),B+=U("REP",f[e.REP]),B+=U("RNM",f[e.RNM]),B+=U("TRG",f[e.TRG]),B+=U("TBS",f[e.TBS]),B+=U("TLS",f[e.TLS]),B+=U("UDT",f[e.UDT]),B+=U("AND",f[e.AND]),B+=U("NOT",f[e.NOT]),B+=U("BKR",f[e.BKR]),B+=U("BKA",f[e.BKA]),B+=U("BKN",f[e.BKN]),B+=U("ABG",f[e.ABG]),B+=U("AEN",f[e.AEN]),B+=U("totals",u),B},"displayOpsOnly"),H=o(function(){let B="";B+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
266
+ `,U+=`<!-- input string, ${O} -->
267
+ `,U+=I(j+2),U+=$(f),U+=`
268
+ `,k.forEach(H=>{H.state===e.SEM_PRE?(j+=1,U+=I(j),U+=`<node name="${H.name}" index="${H.phraseIndex}" length="${H.phraseLength}">
269
+ `,U+=I(j+2),U+=$(f,H.phraseIndex,H.phraseLength),U+=`
270
+ `):(U+=I(j),U+=`</node><!-- name="${H.name}" -->
271
+ `,j-=1)}),U+=`</root>
272
+ `,U},"toSml"),this.phrases=o(function(){let C={},$,O;for($=0;$<k.length;$+=1)O=k[$],O.state===e.SEM_PRE&&(Array.isArray(C[O.name])||(C[O.name]=[]),C[O.name].push({index:O.phraseIndex,length:O.phraseLength}));return C},"phrases")},"exportsAst")});var _0=me((NL,R2)=>{R2.exports=o(function(){let e="circular-buffer.js: ",t=-1,n=0;this.init=o(function(s){if(typeof s!="number"||s<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(s),t=-1},"init"),this.increment=o(function(){return t+=1,(t+n)%n},"increment"),this.maxSize=o(function(){return n},"maxSize"),this.items=o(function(){return t+1},"items"),this.getListIndex=o(function(s){return t===-1||s<0||s>t||t-s>=n?-1:(s+n)%n},"getListIndex"),this.forEach=o(function(s){if(t!==-1){if(t<n){for(let a=0;a<=t;a+=1)s(a,a);return}for(let a=t-n+1;a<=t;a+=1){let f=(a+n)%n;s(f,a)}}},"forEach")},"exportsCircularBuffer")});var B2=me((RL,L2)=>{L2.exports=o(function(){let e=Tn(),t=as(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let a=null,f=null,u,m,p,x,k=0,I=0,T=0,C=null,$=null,O=null,U=null,j=null,H=0,X=1/0,B=1/0,L=o(function(G,P,z){let ae=`${n}evaluateRule(): `;if(G>=O.length)throw new Error(`${ae}rule index: ${G} out of range`);if(P>=p)throw new Error(`${ae}phrase index: ${P} out of range`);let{length:ue}=a;a.push({type:e.RNM,index:G}),s(ue,P,z),a.pop()},"evaluateRule"),F=o(function(te,G,P){let z=`${n}evaluateUdt(): `;if(te>=U.length)throw new Error(`${z}udt index: ${te} out of range`);if(G>=p)throw new Error(`${z}phrase index: ${G} out of range`);let{length:ae}=a;a.push({type:e.UDT,empty:U[te].empty,index:te}),s(ae,G,P),a.pop()},"evaluateUdt"),re=o(function(){k=0,I=0,T=0,H=0,x=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],O=null,U=null,f=null,u=0,m=0,p=0,C=null,$=null,j=null,a=null},"clear"),E=o(function(){let te=[],G=o(function(){let z={};O.forEach(ae=>{ae.isBkr&&(z[ae.lower]=null)}),U.length>0&&U.forEach(ae=>{ae.isBkr&&(z[ae.lower]=null)}),te.push(z)},"init"),P=o(function(){let z=te[te.length-1],ae={};for(let ue in z)ae[ue]=z[ue];return ae},"copy");this.push=o(function(){te.push(P())},"push"),this.pop=o(function(ae){let ue=ae;if(ue||(ue=te.length-1),ue<1||ue>te.length)throw new Error(`${n}backRef.pop(): bad length: ${ue}`);return te.length=ue,te[te.length-1]},"pop"),this.length=o(function(){return te.length},"length"),this.savePhrase=o(function(ae,ue,le){te[te.length-1][ae]={phraseIndex:ue,phraseLength:le}},"savePhrase"),this.getPhrase=function(z){return te[te.length-1][z]},G()},"backRef"),l=o(function(){let G=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=x[x.length-1],this.uFrame=new E,this.pFrame=new E,this.evaluateRule=L,this.evaluateUdt=F,this.refresh=o(function(){G.state=e.ACTIVE,G.phraseLength=0,G.lookAround=x[x.length-1]},"refresh")},"systemData"),g=o(function(){return x[x.length-1]},"lookAroundValue"),h=o(function(){return x.length>1},"inLookAround"),c=o(function(){return x[x.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),d=o(function(){let te=`${n}initializeAst(): `,G=!0;for(;G;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${te}ast object not recognized`);break}i.ast!==null&&i.ast.init(O,U,f)},"initializeAst"),y=o(function(){let te=`${n}initializeTrace(): `,G=!0;for(;G;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${te}trace object not recognized`);break}i.trace!==null&&i.trace.init(O,U,f)},"initializeTrace"),_=o(function(){let te=`${n}initializeStats(): `,G=!0;for(;G;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${te}stats object not recognized`);break}i.stats!==null&&i.stats.init(O,U)},"initializeStats"),w=o(function(te){let G=`${n}initializeGrammar(): `;if(!te)throw new Error(`${G}grammar object undefined`);if(te.grammarObject!=="grammarObject")throw new Error(`${G}bad grammar object`);O=te.rules,U=te.udts},"initializeGrammar"),b=o(function(te){let G=`${n}initializeStartRule(): `,P=null;if(typeof te=="number"){if(te>=O.length)throw new Error(`${G}start rule index too large: max: ${O.length}: index: ${te}`);P=te}else if(typeof te=="string"){let z=te.toLowerCase();for(let ae=0;ae<O.length;ae+=1)if(z===O[ae].lower){P=O[ae].index;break}if(P===null)throw new Error(`${G}start rule name '${te}' not recognized`)}else throw new Error(`${G}type of start rule '${typeof te}' not recognized`);return P},"initializeStartRule"),S=o(function(G,P,z){let ae=`${n}initializeInputChars(): `,ue=G,le=P,ge=z;if(ue===void 0)throw new Error(`${ae}input string is undefined`);if(ue===null)throw new Error(`${ae}input string is null`);if(typeof ue=="string")ue=t.stringToChars(ue);else if(!Array.isArray(ue))throw new Error(`${ae}input string is not a string or array`);if(ue.length>0&&typeof ue[0]!="number")throw new Error(`${ae}input string not an array of integers`);if(typeof le!="number")le=0;else if(le=Math.floor(le),le<0||le>ue.length)throw new Error(`${ae}input beginning index out of range: ${le}`);if(typeof ge!="number")ge=ue.length-le;else if(ge=Math.floor(ge),ge<0||ge>ue.length-le)throw new Error(`${ae}input length out of range: ${ge}`);f=ue,u=le,m=ge,p=u+m},"initializeInputChars"),D=o(function(){let te=`${n}initializeCallbacks(): `,G;for(C=[],$=[],G=0;G<O.length;G+=1)C[G]=null;for(G=0;G<U.length;G+=1)$[G]=null;let P,z=[];for(G=0;G<O.length;G+=1)z.push(O[G].lower);for(G=0;G<U.length;G+=1)z.push(U[G].lower);for(let ae in i.callbacks){if(G=z.indexOf(ae.toLowerCase()),G<0)throw new Error(`${te}syntax callback '${ae}' not a rule or udt name`);if(P=i.callbacks[ae],P||(P=null),typeof P=="function"||P===null)G<O.length?C[G]=P:$[G-O.length]=P;else throw new Error(`${te}syntax callback[${ae}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(G=0;G<U.length;G+=1)if($[G]===null)throw new Error(`${te}all UDT callbacks must be defined. UDT callback[${U[G].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(te){if(typeof te!="number")throw new Error(`parser: max tree depth must be integer > 0: ${te}`);if(X=Math.floor(te),X<=0)throw new Error(`parser: max tree depth must be integer > 0: ${te}`)},this.setMaxNodeHits=function(te){if(typeof te!="number")throw new Error(`parser: max node hits must be integer > 0: ${te}`);if(B=Math.floor(te),B<=0)throw new Error(`parser: max node hits must be integer > 0: ${te}`)};let v=o(function(te,G,P){let z,ae=`${n}parse(): `;w(te);let ue=b(G);D(),y(),_(),d();let le=new l;switch(P!=null&&(j=P),a=[{type:e.RNM,index:ue}],s(0,u,le),a=null,le.state){case e.ACTIVE:throw new Error(`${ae}final state should never be 'ACTIVE'`);case e.NOMATCH:z=!1;break;case e.EMPTY:case e.MATCH:le.phraseLength===m?z=!0:z=!1;break;default:throw new Error("unrecognized state")}return{success:z,state:le.state,length:m,matched:le.phraseLength,maxMatched:H,maxTreeDepth:I,nodeHits:T,inputLength:f.length,subBegin:u,subEnd:p,subLength:m}},"privateParse");this.parseSubstring=o(function(G,P,z,ae,ue,le){return re(),S(z,ae,ue),v(G,P,le)},"parseSubstring"),this.parse=o(function(G,P,z,ae){return re(),S(z,0,z.length),v(G,P,ae)},"parse");let M=o(function(te,G,P){let z=a[te];for(let ae=0;ae<z.children.length&&(s(z.children[ae],G,P),P.state===e.NOMATCH);ae+=1);},"opALT"),ne=o(function(te,G,P){let z,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),z=!0,ue=G,le=0;for(let ve=0;ve<ge.children.length;ve+=1)if(s(ge.children[ve],ue,P),P.state===e.NOMATCH){z=!1;break}else ue+=P.phraseLength,le+=P.phraseLength;z?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCAT"),A=o(function(te,G,P){let z,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(z=i.ast.getLength());let ve=!0;for(;ve&&!(ae>=p||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae+=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(z))},"opREP"),K=o(function(te,G,P,z){if(G.phraseLength>P){let ae=`${n}opRNM(${te.name}): callback function error: `;throw ae+=`sysData.phraseLength: ${G.phraseLength}`,ae+=` must be <= remaining chars: ${P}`,new Error(ae)}switch(G.state){case e.ACTIVE:if(z!==!0)throw new Error(`${n}opRNM(${te.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:G.phraseLength=0;break;case e.MATCH:G.phraseLength===0&&(G.state=e.EMPTY);break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opRNM(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateRnmCallbackResult"),J=o(function(te,G,P){let z,ae,ue,le,ge,ft,Ee=a[te],ve=O[Ee.index],lt=C[ve.index],De=!h();if(De&&(ae=i.ast&&i.ast.ruleDefined(Ee.index),ae&&(z=i.ast.getLength(),i.ast.down(Ee.index,O[Ee.index].name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new E),lt===null)ue=a,a=ve.opcodes,s(0,G,P),a=ue;else{let Ne=p-G;P.ruleIndex=ve.index,lt(P,f,G,j),K(ve,P,Ne,!0),P.state===e.ACTIVE&&(ue=a,a=ve.opcodes,s(0,G,P),a=ue,P.ruleIndex=ve.index,lt(P,f,G,j),K(ve,P,Ne,!1))}De&&(ae&&(P.state===e.NOMATCH?i.ast.setLength(z):i.ast.up(Ee.index,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opRNM"),N=o(function(te,G,P){if(G.phraseLength>P){let z=`${n}opUDT(${te.name}): callback function error: `;throw z+=`sysData.phraseLength: ${G.phraseLength}`,z+=` must be <= remaining chars: ${P}`,new Error(z)}switch(G.state){case e.ACTIVE:throw new Error(`${n}opUDT(${te.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.phraseLength=0;break;case e.MATCH:if(G.phraseLength===0){if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.state=e.EMPTY}break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opUDT(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateUdtCallbackResult"),R=o(function(te,G,P){let z,ae,ue,le,ge,ft,Ee=a[te],ve=U[Ee.index];P.UdtIndex=ve.index;let lt=!h();lt&&(ue=i.ast&&i.ast.udtDefined(Ee.index),ue&&(ae=O.length+Ee.index,z=i.ast.getLength(),i.ast.down(ae,ve.name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new E);let De=p-G;$[Ee.index](P,f,G,j),N(ve,P,De),lt&&(ue&&(P.state===e.NOMATCH?i.ast.setLength(z):i.ast.up(ae,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opUDT"),V=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:p,charsLength:m}),p=f.length,m=f.length-u,s(te+1,G,P);let z=x.pop();switch(p=z.charsEnd,m=z.charsLength,P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${P.state}`)}},"opAND"),W=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:p,charsLength:m}),p=f.length,m=f.length-u,s(te+1,G,P);let z=x.pop();switch(p=z.charsEnd,m=z.charsLength,P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${P.state}`)}},"opNOT"),ee=o(function(te,G,P){let z=a[te];P.state=e.NOMATCH,G<p&&z.min<=f[G]&&f[G]<=z.max&&(P.state=e.MATCH,P.phraseLength=1)},"opTRG"),he=o(function(te,G,P){let z,ae=a[te],ue=ae.string.length;if(P.state=e.NOMATCH,G+ue<=p){for(z=0;z<ue;z+=1)if(f[G+z]!==ae.string[z])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBS"),fe=o(function(te,G,P){let z,ae,ue=a[te];P.state=e.NOMATCH;let le=ue.string.length;if(le===0){P.state=e.EMPTY;return}if(G+le<=p){for(z=0;z<le;z+=1)if(ae=f[G+z],ae>=65&&ae<=90&&(ae+=32),ae!==ue.string[z])return;P.state=e.MATCH,P.phraseLength=le}},"opTLS"),Y=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===0?e.EMPTY:e.NOMATCH},"opABG"),pe=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===f.length?e.EMPTY:e.NOMATCH},"opAEN"),Q=o(function(te,G,P){let z,ae,ue,le,ge=a[te];P.state=e.NOMATCH,ge.index<O.length?le=O[ge.index].lower:le=U[ge.index-O.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY;return}if(G+lt<=p){if(Ee){for(z=0;z<lt;z+=1)if(ae=f[G+z],ue=f[ve+z],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(z=0;z<lt;z+=1)if(ae=f[G+z],ue=f[ve+z],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKR"),ce=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${P.state}`)}},"opBKA"),q=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${P.state}`)}},"opBKN"),se=o(function(te,G,P){let z,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),z=!0,ue=G,le=0;for(let ve=ge.children.length-1;ve>=0;ve-=1)if(s(ge.children[ve],ue,P),ue-=P.phraseLength,le+=P.phraseLength,P.state===e.NOMATCH){z=!1;break}z?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCATBehind"),be=o(function(te,G,P){let z,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(z=i.ast.getLength());let ve=!0;for(;ve&&!(ae<=0||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae-=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(z))},"opREPBehind"),ke=o(function(te,G,P){let z=a[te];if(P.state=e.NOMATCH,P.phraseLength=0,G>0){let ae=f[G-1];z.min<=ae&&ae<=z.max&&(P.state=e.MATCH,P.phraseLength=1)}},"opTRGBehind"),we=o(function(te,G,P){let z,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length,le=G-ue;if(le>=0){for(z=0;z<ue;z+=1)if(f[le+z]!==ae.string[z])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBSBehind"),Ie=o(function(te,G,P){let z,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length;if(ue===0){P.state=e.EMPTY;return}let le=G-ue;if(le>=0){for(let ge=0;ge<ue;ge+=1)if(z=f[le+ge],z>=65&&z<=90&&(z+=32),z!==ae.string[ge])return;P.state=e.MATCH,P.phraseLength=ue}},"opTLSBehind"),vr=o(function(te,G,P){let z,ae,ue,le,ge=a[te];P.state=e.NOMATCH,P.phraseLength=0,ge.index<O.length?le=O[ge.index].lower:le=U[ge.index-O.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY,P.phraseLength=0;return}let De=G-lt;if(De>=0){if(Ee){for(z=0;z<lt;z+=1)if(ae=f[De+z],ue=f[ve+z],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(z=0;z<lt;z+=1)if(ae=f[De+z],ue=f[ve+z],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKRBehind");s=o(function(G,P,z){let ae=!0,ue=a[G];if(T+=1,T>B)throw new Error(`parser: maximum number of node hits exceeded: ${B}`);if(k+=1,k>I&&(I=k,I>X))throw new Error(`parser: maximum parse tree depth exceeded: ${X}`);if(z.refresh(),i.trace!==null){let le=g();i.trace.down(ue,z.state,P,z.phraseLength,le.anchor,le.lookAround)}if(c())switch(ue.type){case e.ALT:M(G,P,z);break;case e.CAT:se(G,P,z);break;case e.REP:be(G,P,z);break;case e.RNM:J(G,P,z);break;case e.UDT:R(G,P,z);break;case e.AND:V(G,P,z);break;case e.NOT:W(G,P,z);break;case e.TRG:ke(G,P,z);break;case e.TBS:we(G,P,z);break;case e.TLS:Ie(G,P,z);break;case e.BKR:vr(G,P,z);break;case e.BKA:ce(G,P,z);break;case e.BKN:q(G,P,z);break;case e.ABG:Y(G,P,z);break;case e.AEN:pe(G,P,z);break;default:ae=!1;break}else switch(ue.type){case e.ALT:M(G,P,z);break;case e.CAT:ne(G,P,z);break;case e.REP:A(G,P,z);break;case e.RNM:J(G,P,z);break;case e.UDT:R(G,P,z);break;case e.AND:V(G,P,z);break;case e.NOT:W(G,P,z);break;case e.TRG:ee(G,P,z);break;case e.TBS:he(G,P,z);break;case e.TLS:fe(G,P,z);break;case e.BKR:Q(G,P,z);break;case e.BKA:ce(G,P,z);break;case e.BKN:q(G,P,z);break;case e.ABG:Y(G,P,z);break;case e.AEN:pe(G,P,z);break;default:ae=!1;break}if(!h()&&P+z.phraseLength>H&&(H=P+z.phraseLength),i.stats!==null&&i.stats.collect(ue,z),i.trace!==null){let le=g();i.trace.up(ue,z.state,P,z.phraseLength,le.anchor,le.lookAround)}return k-=1,ae},"opExecuteFunc")},"parser")});var F2=me((LL,U2)=>{U2.exports=o(function(){let e=Tn(),t=as(),n=Rf(),i="stats.js: ",s=[],a=[],f=[],u,m=[],p=[];this.statsObject="statsObject";let x="stats",k=o(function(B,L){return B.lower<L.lower?-1:B.lower>L.lower?1:0},"sortAlpha"),I=o(function(B,L){return B.total<L.total?1:B.total>L.total?-1:k(B,L)},"sortHits"),T=o(function(B,L){return B.index<L.index?-1:B.index>L.index?1:0},"sortIndex"),C=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),$=o(function(){f.length=0,u=new C,f[e.ALT]=new C,f[e.CAT]=new C,f[e.REP]=new C,f[e.RNM]=new C,f[e.TRG]=new C,f[e.TBS]=new C,f[e.TLS]=new C,f[e.UDT]=new C,f[e.AND]=new C,f[e.NOT]=new C,f[e.BKR]=new C,f[e.BKA]=new C,f[e.BKN]=new C,f[e.ABG]=new C,f[e.AEN]=new C,m.length=0;for(let B=0;B<s.length;B+=1)m.push({empty:0,match:0,nomatch:0,total:0,name:s[B].name,lower:s[B].lower,index:s[B].index});if(a.length>0){p.length=0;for(let B=0;B<a.length;B+=1)p.push({empty:0,match:0,nomatch:0,total:0,name:a[B].name,lower:a[B].lower,index:a[B].index})}},"clear"),O=o(function(B,L){switch(B.total+=1,L){case e.EMPTY:B.empty+=1;break;case e.MATCH:B.match+=1;break;case e.NOMATCH:B.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${L}`)}},"incStat"),U=o(function(B,L){let F="";return F+="<tr>",F+=`<td class="${n.CLASS_ACTIVE}">${B}</td>`,F+=`<td class="${n.CLASS_EMPTY}">${L.empty}</td>`,F+=`<td class="${n.CLASS_MATCH}">${L.match}</td>`,F+=`<td class="${n.CLASS_NOMATCH}">${L.nomatch}</td>`,F+=`<td class="${n.CLASS_ACTIVE}">${L.total}</td>`,F+=`</tr>
273
+ `,F},"displayRow"),j=o(function(){let B="";return B+=U("ALT",f[e.ALT]),B+=U("CAT",f[e.CAT]),B+=U("REP",f[e.REP]),B+=U("RNM",f[e.RNM]),B+=U("TRG",f[e.TRG]),B+=U("TBS",f[e.TBS]),B+=U("TLS",f[e.TLS]),B+=U("UDT",f[e.UDT]),B+=U("AND",f[e.AND]),B+=U("NOT",f[e.NOT]),B+=U("BKR",f[e.BKR]),B+=U("BKA",f[e.BKA]),B+=U("BKN",f[e.BKN]),B+=U("ABG",f[e.ABG]),B+=U("AEN",f[e.AEN]),B+=U("totals",u),B},"displayOpsOnly"),H=o(function(){let B="";B+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
274
274
  `,B+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
275
275
  `;for(let L=0;L<s.length;L+=1)m[L].total>0&&(B+="<tr>",B+=`<td class="${n.CLASS_ACTIVE}">${m[L].name}</td>`,B+=`<td class="${n.CLASS_EMPTY}">${m[L].empty}</td>`,B+=`<td class="${n.CLASS_MATCH}">${m[L].match}</td>`,B+=`<td class="${n.CLASS_NOMATCH}">${m[L].nomatch}</td>`,B+=`<td class="${n.CLASS_ACTIVE}">${m[L].total}</td>`,B+=`</tr>
276
276
  `);if(a.length>0){B+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
277
277
  `,B+=`<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>
278
278
  `;for(let L=0;L<a.length;L+=1)p[L].total>0&&(B+="<tr>",B+=`<td class="${n.CLASS_ACTIVE}">${p[L].name}</td>`,B+=`<td class="${n.CLASS_EMPTY}">${p[L].empty}</td>`,B+=`<td class="${n.CLASS_MATCH}">${p[L].match}</td>`,B+=`<td class="${n.CLASS_NOMATCH}">${p[L].nomatch}</td>`,B+=`<td class="${n.CLASS_ACTIVE}">${p[L].total}</td>`,B+=`</tr>
279
- `)}return B},"displayRules");this.validate=o(function(B){let L=!1;return typeof B=="string"&&x===B&&(L=!0),L},"validate"),this.init=o(function(B,L){s=B,a=L,$()},"init"),this.collect=o(function(B,L){I(u,L.state,L.phraseLength),I(f[B.type],L.state,L.phraseLength),B.type===e.RNM&&I(m[B.index],L.state,L.phraseLength),B.type===e.UDT&&I(p[B.index],L.state,L.phraseLength)},"collect"),this.toHtml=o(function(B,L){let F="";F+=`<table class="${n.CLASS_STATS}">
279
+ `)}return B},"displayRules");this.validate=o(function(B){let L=!1;return typeof B=="string"&&x===B&&(L=!0),L},"validate"),this.init=o(function(B,L){s=B,a=L,$()},"init"),this.collect=o(function(B,L){O(u,L.state,L.phraseLength),O(f[B.type],L.state,L.phraseLength),B.type===e.RNM&&O(m[B.index],L.state,L.phraseLength),B.type===e.UDT&&O(p[B.index],L.state,L.phraseLength)},"collect"),this.toHtml=o(function(B,L){let F="";F+=`<table class="${n.CLASS_STATS}">
280
280
  `,typeof L=="string"&&(F+=`<caption>${L}</caption>
281
281
  `),F+=`<tr><th class="${n.CLASS_ACTIVE}">ops</th>
282
282
  `,F+=`<th class="${n.CLASS_EMPTY}">EMPTY</th>
283
283
  `,F+=`<th class="${n.CLASS_MATCH}">MATCH</th>
284
284
  `,F+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
285
285
  `,F+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
286
- `;let re=!0;for(;re;){if(B===void 0){F+=z();break}if(B===null){F+=z();break}if(B==="ops"){F+=z();break}if(B==="index"){m.sort(T),p.length>0&&p.sort(T),F+=z(),F+=H();break}if(B==="hits"){m.sort(O),p.length>0&&p.sort(T),F+=z(),F+=H();break}if(B==="alpha"){m.sort(k),p.length>0&&p.sort(k),F+=z(),F+=H();break}break}return F+=`</table>
287
- `,F},"toHtml"),this.toHtmlPage=o(function(B,L,F){return t.htmlToPage(this.toHtml(B,L),F)},"toHtmlPage")},"statsFunc")});var q2=me((PL,$2)=>{$2.exports=o(function(){let e=as(),t=Rf(),n=new(_0()),i=Tn(),s="trace.js: ",a=this,f=16,u=10,m=8,p=32,x=80,k=5,O=[],T=5e3,C=-1,$=0,I=0,U=[],z=null,H=null,X=null,B=[],L=[],F=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,re=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,E=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,l=o(function(){let N=o(function(V){B[i.ALT]=V,B[i.CAT]=V,B[i.REP]=V,B[i.TLS]=V,B[i.TBS]=V,B[i.TRG]=V,B[i.AND]=V,B[i.NOT]=V,B[i.BKR]=V,B[i.BKA]=V,B[i.BKN]=V,B[i.ABG]=V,B[i.AEN]=V},"setOperators"),R=0;for(let V in a.filter.operators)R+=1;if(R===0){N(!1);return}for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="<ALL>"){N(!0);return}if(W==="<NONE>"){N(!1);return}}N(!1);for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="ALT")B[i.ALT]=a.filter.operators[V]===!0;else if(W==="CAT")B[i.CAT]=a.filter.operators[V]===!0;else if(W==="REP")B[i.REP]=a.filter.operators[V]===!0;else if(W==="AND")B[i.AND]=a.filter.operators[V]===!0;else if(W==="NOT")B[i.NOT]=a.filter.operators[V]===!0;else if(W==="TLS")B[i.TLS]=a.filter.operators[V]===!0;else if(W==="TBS")B[i.TBS]=a.filter.operators[V]===!0;else if(W==="TRG")B[i.TRG]=a.filter.operators[V]===!0;else if(W==="BKR")B[i.BKR]=a.filter.operators[V]===!0;else if(W==="BKA")B[i.BKA]=a.filter.operators[V]===!0;else if(W==="BKN")B[i.BKN]=a.filter.operators[V]===!0;else if(W==="ABG")B[i.ABG]=a.filter.operators[V]===!0;else if(W==="AEN")B[i.AEN]=a.filter.operators[V]===!0;else throw new Error(`${s}initOpratorFilter: '${V}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),g=o(function(){let N=o(function(ee){B[i.RNM]=ee,B[i.UDT]=ee;let he=H.length+X.length;L.length=0;for(let fe=0;fe<he;fe+=1)L.push(ee)},"setRules"),R,V,W=[];for(V=0;V<H.length;V+=1)W.push(H[V].lower);for(V=0;V<X.length;V+=1)W.push(X[V].lower);L.length=0,R=0;for(let ee in a.filter.rules)R+=1;if(R===0){N(!0);return}for(let ee in a.filter.rules){let he=ee.toLowerCase();if(he==="<all>"){N(!0);return}if(he==="<none>"){N(!1);return}}N(!1),B[i.RNM]=!0,B[i.UDT]=!0;for(let ee in a.filter.rules){let he=ee.toLowerCase();if(V=W.indexOf(he),V<0)throw new Error(`${s}initRuleFilter: '${ee}' not a valid rule or udt name`);L[V]=a.filter.rules[ee]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(N,R){if(C=-1,typeof N=="number"&&N>0)T=Math.ceil(N);else{T=0;return}typeof R=="number"&&(C=Math.floor(R),C<0&&(C=-1))},this.getMaxRecords=function(){return T},this.getLastRecord=function(){return C},this.init=function(N,R,V){O.length=0,U.length=0,$=0,I=0,z=V,H=N,X=R,l(),g(),n.init(T)};let h=o(function(N){let R=!1;return N.type===i.RNM?B[N.type]&&L[N.index]?R=!0:R=!1:N.type===i.UDT?B[N.type]&&L[H.length+N.index]?R=!0:R=!1:R=B[N.type],R},"filterOps"),c=o(function(N){return C===-1||N<=C},"filterRecords");this.down=function(N,R,V,W,ee,he){c($)&&h(N)&&(U.push($),O[n.increment()]={dirUp:!1,depth:I,thisLine:$,thatLine:void 0,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1,I+=1)},this.up=function(N,R,V,W,ee,he){if(c($)&&h(N)){let fe=$,Y=U.pop(),pe=n.getListIndex(Y);pe!==-1&&(O[pe].thatLine=fe),I-=1,O[n.increment()]={dirUp:!0,depth:I,thisLine:fe,thatLine:Y,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1}};let d=o(function(){function N(P,j){let ae,ue,le;if(j)switch(P.op={id:j.type,name:e.opcodeToString(j.type)},P.opData=void 0,j.type){case i.RNM:P.opData=H[j.index].name;break;case i.UDT:P.opData=X[j.index].name;break;case i.BKR:j.index<H.length?ae=H[j.index].name:ae=X[j.index-H.length].name,ue=j.bkrCase===i.BKR_MODE_CI?"%i":"%s",le=j.bkrMode===i.BKR_MODE_UM?"%u":"%p",P.opData=`\\\\${ue}${le}${ae}`;break;case i.TLS:P.opData=[];for(let ge=0;ge<j.string.length;ge+=1)P.opData.push(j.string[ge]);break;case i.TBS:P.opData=[];for(let ge=0;ge<j.string.length;ge+=1)P.opData.push(j.string[ge]);break;case i.TRG:P.opData=[j.min,j.max];break;case i.REP:P.opData=[j.min,j.max];break;default:throw new Error("unrecognized opcode")}else P.op={id:void 0,name:void 0},P.opData=void 0}o(N,"nodeOpcode");function R(P,j,ae){return P===i.MATCH?{index:j,length:ae}:P===i.NOMATCH?{index:j,length:0}:P===i.EMPTY?{index:j,length:0}:null}o(R,"nodePhrase");let V=-1;function W(P,j,ae){let ue={id:V++,branch:-1,parent:P,up:!1,down:!1,depth:ae,children:[]};return j?(ue.down=!0,ue.state={id:j.state,name:e.stateToString(j.state)},ue.phrase=null,N(ue,j.opcode)):(ue.state={id:void 0,name:void 0},ue.phrase=R(),N(ue,void 0)),ue}o(W,"nodeDown");function ee(P,j){j&&(P.up=!0,P.state={id:j.state,name:e.stateToString(j.state)},P.phrase=R(j.state,j.phraseIndex,j.phraseLength),P.down||N(P,j.opcode))}o(ee,"nodeUp");let he=0,fe=-1,Y=1;function pe(P){if(fe+=1,P.branch=Y,fe>I&&(I=fe),P.children.length===0)he+=1;else for(let j=0;j<P.children.length;j+=1)j>0&&(Y+=1),P.children[j].leftMost=!1,P.children[j].rightMost=!1,P.leftMost&&(P.children[j].leftMost=j===0),P.rightMost&&(P.children[j].rightMost=j===P.children.length-1),pe(P.children[j]);fe-=1}o(pe,"walk");function Q(P,j){let ae,ue={};if(ue.id=P.id,ue.branch=P.branch,ue.leftMost=P.leftMost,ue.rightMost=P.rightMost,ae=P.state.name?P.state.name:"ACTIVE",ue.state={id:P.state.id,name:ae},ae=P.op.name?P.op.name:"?",ue.op={id:P.op.id,name:ae},typeof P.opData=="string")ue.opData=P.opData;else if(Array.isArray(P.opData)){ue.opData=[];for(let le=0;le<P.opData.length;le+=1)ue.opData[le]=P.opData[le]}else ue.opData=void 0;P.phrase?ue.phrase={index:P.phrase.index,length:P.phrase.length}:ue.phrase=null,ue.depth=P.depth,ue.children=[];for(let le=0;le<P.children.length;le+=1){let ge=le!==P.children.length-1;ue.children[le]=Q(P.children[le],j,ge)}return ue}o(Q,"display");let ce=[],q,se,be,Te,we=!0,Oe=W(null,null,-1);for(ce.push(Oe),se=Oe,n.forEach(P=>{if(Te=O[P],we&&(we=!1,Te.depth>0)){let j=Te.dirUp?Te.depth+1:Te.depth;for(let ae=0;ae<j;ae+=1)be=se,se=W(se,null,ae),ce.push(se),be.children.push(se)}Te.dirUp?(se=ce.pop(),ee(se,Te),se=ce[ce.length-1]):(be=se,se=W(se,Te,Te.depth),ce.push(se),be.children.push(se))});ce.length>1;)se=ce.pop(),ee(se,null);if(Oe.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ce.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");q=Oe.children[0];let gr=q;for(;q&&!q.down&&!q.up;)gr=q,q=q.children[0];q=gr,q.leftMost=!0,q.rightMost=!0,pe(q),q.branch=0;let te={};te.string=[];for(let P=0;P<z.length;P+=1)te.string[P]=z[P];te.rules=[];for(let P=0;P<H.length;P+=1)te.rules[P]=H[P].name;te.udts=[];for(let P=0;P<X.length;P+=1)te.udts[P]=X[P].name;te.id={},te.id.ALT={id:i.ALT,name:"ALT"},te.id.CAT={id:i.CAT,name:"CAT"},te.id.REP={id:i.REP,name:"REP"},te.id.RNM={id:i.RNM,name:"RNM"},te.id.TLS={id:i.TLS,name:"TLS"},te.id.TBS={id:i.TBS,name:"TBS"},te.id.TRG={id:i.TRG,name:"TRG"},te.id.UDT={id:i.UDT,name:"UDT"},te.id.AND={id:i.AND,name:"AND"},te.id.NOT={id:i.NOT,name:"NOT"},te.id.BKR={id:i.BKR,name:"BKR"},te.id.BKA={id:i.BKA,name:"BKA"},te.id.BKN={id:i.BKN,name:"BKN"},te.id.ABG={id:i.ABG,name:"ABG"},te.id.AEN={id:i.AEN,name:"AEN"},te.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},te.id.MATCH={id:i.MATCH,name:"MATCH"},te.id.EMPTY={id:i.EMPTY,name:"EMPTY"},te.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},te.treeDepth=I,te.leafNodes=he;let G;return q.down?q.up?G="none":G="right":q.up?G="left":G="both",te.branchesIncomplete=G,te.tree=Q(q,q.depth,!1),te},"toTreeObj");this.toTree=function(N){let R=d();return N?JSON.stringify(R):R},this.toHtmlPage=function(N,R,V){return e.htmlToPage(this.toHtml(N,R),V)};let y=o(function(N,R){let V;switch(N){case f:V="hexadecimal";break;case u:V="decimal";break;case m:V="ASCII";break;case p:V="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${N}`)}let W="";return W+=`<p>display mode: ${V}</p>
286
+ `;let re=!0;for(;re;){if(B===void 0){F+=j();break}if(B===null){F+=j();break}if(B==="ops"){F+=j();break}if(B==="index"){m.sort(T),p.length>0&&p.sort(T),F+=j(),F+=H();break}if(B==="hits"){m.sort(I),p.length>0&&p.sort(T),F+=j(),F+=H();break}if(B==="alpha"){m.sort(k),p.length>0&&p.sort(k),F+=j(),F+=H();break}break}return F+=`</table>
287
+ `,F},"toHtml"),this.toHtmlPage=o(function(B,L,F){return t.htmlToPage(this.toHtml(B,L),F)},"toHtmlPage")},"statsFunc")});var q2=me((BL,$2)=>{$2.exports=o(function(){let e=as(),t=Rf(),n=new(_0()),i=Tn(),s="trace.js: ",a=this,f=16,u=10,m=8,p=32,x=80,k=5,I=[],T=5e3,C=-1,$=0,O=0,U=[],j=null,H=null,X=null,B=[],L=[],F=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,re=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,E=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,l=o(function(){let N=o(function(V){B[i.ALT]=V,B[i.CAT]=V,B[i.REP]=V,B[i.TLS]=V,B[i.TBS]=V,B[i.TRG]=V,B[i.AND]=V,B[i.NOT]=V,B[i.BKR]=V,B[i.BKA]=V,B[i.BKN]=V,B[i.ABG]=V,B[i.AEN]=V},"setOperators"),R=0;for(let V in a.filter.operators)R+=1;if(R===0){N(!1);return}for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="<ALL>"){N(!0);return}if(W==="<NONE>"){N(!1);return}}N(!1);for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="ALT")B[i.ALT]=a.filter.operators[V]===!0;else if(W==="CAT")B[i.CAT]=a.filter.operators[V]===!0;else if(W==="REP")B[i.REP]=a.filter.operators[V]===!0;else if(W==="AND")B[i.AND]=a.filter.operators[V]===!0;else if(W==="NOT")B[i.NOT]=a.filter.operators[V]===!0;else if(W==="TLS")B[i.TLS]=a.filter.operators[V]===!0;else if(W==="TBS")B[i.TBS]=a.filter.operators[V]===!0;else if(W==="TRG")B[i.TRG]=a.filter.operators[V]===!0;else if(W==="BKR")B[i.BKR]=a.filter.operators[V]===!0;else if(W==="BKA")B[i.BKA]=a.filter.operators[V]===!0;else if(W==="BKN")B[i.BKN]=a.filter.operators[V]===!0;else if(W==="ABG")B[i.ABG]=a.filter.operators[V]===!0;else if(W==="AEN")B[i.AEN]=a.filter.operators[V]===!0;else throw new Error(`${s}initOpratorFilter: '${V}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),g=o(function(){let N=o(function(ee){B[i.RNM]=ee,B[i.UDT]=ee;let he=H.length+X.length;L.length=0;for(let fe=0;fe<he;fe+=1)L.push(ee)},"setRules"),R,V,W=[];for(V=0;V<H.length;V+=1)W.push(H[V].lower);for(V=0;V<X.length;V+=1)W.push(X[V].lower);L.length=0,R=0;for(let ee in a.filter.rules)R+=1;if(R===0){N(!0);return}for(let ee in a.filter.rules){let he=ee.toLowerCase();if(he==="<all>"){N(!0);return}if(he==="<none>"){N(!1);return}}N(!1),B[i.RNM]=!0,B[i.UDT]=!0;for(let ee in a.filter.rules){let he=ee.toLowerCase();if(V=W.indexOf(he),V<0)throw new Error(`${s}initRuleFilter: '${ee}' not a valid rule or udt name`);L[V]=a.filter.rules[ee]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(N,R){if(C=-1,typeof N=="number"&&N>0)T=Math.ceil(N);else{T=0;return}typeof R=="number"&&(C=Math.floor(R),C<0&&(C=-1))},this.getMaxRecords=function(){return T},this.getLastRecord=function(){return C},this.init=function(N,R,V){I.length=0,U.length=0,$=0,O=0,j=V,H=N,X=R,l(),g(),n.init(T)};let h=o(function(N){let R=!1;return N.type===i.RNM?B[N.type]&&L[N.index]?R=!0:R=!1:N.type===i.UDT?B[N.type]&&L[H.length+N.index]?R=!0:R=!1:R=B[N.type],R},"filterOps"),c=o(function(N){return C===-1||N<=C},"filterRecords");this.down=function(N,R,V,W,ee,he){c($)&&h(N)&&(U.push($),I[n.increment()]={dirUp:!1,depth:O,thisLine:$,thatLine:void 0,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1,O+=1)},this.up=function(N,R,V,W,ee,he){if(c($)&&h(N)){let fe=$,Y=U.pop(),pe=n.getListIndex(Y);pe!==-1&&(I[pe].thatLine=fe),O-=1,I[n.increment()]={dirUp:!0,depth:O,thisLine:fe,thatLine:Y,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1}};let d=o(function(){function N(P,z){let ae,ue,le;if(z)switch(P.op={id:z.type,name:e.opcodeToString(z.type)},P.opData=void 0,z.type){case i.RNM:P.opData=H[z.index].name;break;case i.UDT:P.opData=X[z.index].name;break;case i.BKR:z.index<H.length?ae=H[z.index].name:ae=X[z.index-H.length].name,ue=z.bkrCase===i.BKR_MODE_CI?"%i":"%s",le=z.bkrMode===i.BKR_MODE_UM?"%u":"%p",P.opData=`\\\\${ue}${le}${ae}`;break;case i.TLS:P.opData=[];for(let ge=0;ge<z.string.length;ge+=1)P.opData.push(z.string[ge]);break;case i.TBS:P.opData=[];for(let ge=0;ge<z.string.length;ge+=1)P.opData.push(z.string[ge]);break;case i.TRG:P.opData=[z.min,z.max];break;case i.REP:P.opData=[z.min,z.max];break;default:throw new Error("unrecognized opcode")}else P.op={id:void 0,name:void 0},P.opData=void 0}o(N,"nodeOpcode");function R(P,z,ae){return P===i.MATCH?{index:z,length:ae}:P===i.NOMATCH?{index:z,length:0}:P===i.EMPTY?{index:z,length:0}:null}o(R,"nodePhrase");let V=-1;function W(P,z,ae){let ue={id:V++,branch:-1,parent:P,up:!1,down:!1,depth:ae,children:[]};return z?(ue.down=!0,ue.state={id:z.state,name:e.stateToString(z.state)},ue.phrase=null,N(ue,z.opcode)):(ue.state={id:void 0,name:void 0},ue.phrase=R(),N(ue,void 0)),ue}o(W,"nodeDown");function ee(P,z){z&&(P.up=!0,P.state={id:z.state,name:e.stateToString(z.state)},P.phrase=R(z.state,z.phraseIndex,z.phraseLength),P.down||N(P,z.opcode))}o(ee,"nodeUp");let he=0,fe=-1,Y=1;function pe(P){if(fe+=1,P.branch=Y,fe>O&&(O=fe),P.children.length===0)he+=1;else for(let z=0;z<P.children.length;z+=1)z>0&&(Y+=1),P.children[z].leftMost=!1,P.children[z].rightMost=!1,P.leftMost&&(P.children[z].leftMost=z===0),P.rightMost&&(P.children[z].rightMost=z===P.children.length-1),pe(P.children[z]);fe-=1}o(pe,"walk");function Q(P,z){let ae,ue={};if(ue.id=P.id,ue.branch=P.branch,ue.leftMost=P.leftMost,ue.rightMost=P.rightMost,ae=P.state.name?P.state.name:"ACTIVE",ue.state={id:P.state.id,name:ae},ae=P.op.name?P.op.name:"?",ue.op={id:P.op.id,name:ae},typeof P.opData=="string")ue.opData=P.opData;else if(Array.isArray(P.opData)){ue.opData=[];for(let le=0;le<P.opData.length;le+=1)ue.opData[le]=P.opData[le]}else ue.opData=void 0;P.phrase?ue.phrase={index:P.phrase.index,length:P.phrase.length}:ue.phrase=null,ue.depth=P.depth,ue.children=[];for(let le=0;le<P.children.length;le+=1){let ge=le!==P.children.length-1;ue.children[le]=Q(P.children[le],z,ge)}return ue}o(Q,"display");let ce=[],q,se,be,ke,we=!0,Ie=W(null,null,-1);for(ce.push(Ie),se=Ie,n.forEach(P=>{if(ke=I[P],we&&(we=!1,ke.depth>0)){let z=ke.dirUp?ke.depth+1:ke.depth;for(let ae=0;ae<z;ae+=1)be=se,se=W(se,null,ae),ce.push(se),be.children.push(se)}ke.dirUp?(se=ce.pop(),ee(se,ke),se=ce[ce.length-1]):(be=se,se=W(se,ke,ke.depth),ce.push(se),be.children.push(se))});ce.length>1;)se=ce.pop(),ee(se,null);if(Ie.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ce.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");q=Ie.children[0];let vr=q;for(;q&&!q.down&&!q.up;)vr=q,q=q.children[0];q=vr,q.leftMost=!0,q.rightMost=!0,pe(q),q.branch=0;let te={};te.string=[];for(let P=0;P<j.length;P+=1)te.string[P]=j[P];te.rules=[];for(let P=0;P<H.length;P+=1)te.rules[P]=H[P].name;te.udts=[];for(let P=0;P<X.length;P+=1)te.udts[P]=X[P].name;te.id={},te.id.ALT={id:i.ALT,name:"ALT"},te.id.CAT={id:i.CAT,name:"CAT"},te.id.REP={id:i.REP,name:"REP"},te.id.RNM={id:i.RNM,name:"RNM"},te.id.TLS={id:i.TLS,name:"TLS"},te.id.TBS={id:i.TBS,name:"TBS"},te.id.TRG={id:i.TRG,name:"TRG"},te.id.UDT={id:i.UDT,name:"UDT"},te.id.AND={id:i.AND,name:"AND"},te.id.NOT={id:i.NOT,name:"NOT"},te.id.BKR={id:i.BKR,name:"BKR"},te.id.BKA={id:i.BKA,name:"BKA"},te.id.BKN={id:i.BKN,name:"BKN"},te.id.ABG={id:i.ABG,name:"ABG"},te.id.AEN={id:i.AEN,name:"AEN"},te.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},te.id.MATCH={id:i.MATCH,name:"MATCH"},te.id.EMPTY={id:i.EMPTY,name:"EMPTY"},te.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},te.treeDepth=O,te.leafNodes=he;let G;return q.down?q.up?G="none":G="right":q.up?G="left":G="both",te.branchesIncomplete=G,te.tree=Q(q,q.depth,!1),te},"toTreeObj");this.toTree=function(N){let R=d();return N?JSON.stringify(R):R},this.toHtmlPage=function(N,R,V){return e.htmlToPage(this.toHtml(N,R),V)};let y=o(function(N,R){let V;switch(N){case f:V="hexadecimal";break;case u:V="decimal";break;case m:V="ASCII";break;case p:V="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${N}`)}let W="";return W+=`<p>display mode: ${V}</p>
288
288
  `,W+=`<table class="${t.CLASS_TRACE}">
289
289
  `,typeof R=="string"&&(W+=`<caption>${R}</caption>`),W},"htmlHeader"),_=o(function(){let N="";return N+=`</table>
290
290
  `,N+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>
@@ -329,11 +329,11 @@ table.apg-attrs a:hover {
329
329
  `,N+=`ABG - anchor - begin of input string<br>
330
330
  `,N+=`AEN - anchor - end of input string<br>
331
331
  `,N+=`</p>
332
- `,N},"htmlFooter");this.indent=function(N){let R="";for(let V=0;V<N;V+=1)R+=".";return R};let w=o(function(N,R){let V="";if(R.type===i.TRG)if(N===f||N===p){let W=R.min.toString(16).toUpperCase();W.length%2!==0&&(W=`0${W}`),V+=N===f?"%x":"U+",V+=W,W=R.max.toString(16).toUpperCase(),W.length%2!==0&&(W=`0${W}`),V+=`&ndash;${W}`}else V=`%d${R.min.toString(10)}&ndash;${R.max.toString(10)}`;return V},"displayTrg"),b=o(function(N,R){let V="";if(R.type===i.REP)if(N===f){let W=R.min.toString(16).toUpperCase();W.length%2!==0&&(W=`0${W}`),V=`x${W}`,R.max<1/0?(W=R.max.toString(16).toUpperCase(),W.length%2!==0&&(W=`0${W}`)):W="inf",V+=`&ndash;${W}`}else R.max<1/0?V=`${R.min.toString(10)}&ndash;${R.max.toString(10)}`:V=`${R.min.toString(10)}&ndash;inf`;return V},"displayRep"),S=o(function(N,R){let V="";if(R.type===i.TBS){let W=Math.min(R.string.length,k*2);if(N===f||N===p){V+=N===f?"%x":"U+";for(let ee=0;ee<W;ee+=1){let he;ee>0&&(V+="."),he=R.string[ee].toString(16).toUpperCase(),he.length%2!==0&&(he=`0${he}`),V+=he}}else{V="%d";for(let ee=0;ee<W;ee+=1)ee>0&&(V+="."),V+=R.string[ee].toString(10)}W<R.string.length&&(V+=re)}return V},"displayTbs"),D=o(function(N,R){let V="";if(R.type===i.TLS){let W=Math.min(R.string.length,k);if(N===f||N===u){let ee,he,fe;N===f?(V="%x",fe=16):(V="%d",fe=10);for(let Y=0;Y<W;Y+=1)Y>0&&(V+="."),he=R.string[Y],he>=97&&he<=122?(ee=he-32,V+=`${ee.toString(fe)}/${he.toString(fe)}`.toUpperCase()):he>=65&&he<=90?(ee=he,he+=32,V+=`${ee.toString(fe)}/${he.toString(fe)}`.toUpperCase()):V+=he.toString(fe).toUpperCase();W<R.string.length&&(V+=re)}else{V='"';for(let ee=0;ee<W;ee+=1)V+=e.asciiChars[R.string[ee]];W<R.string.length&&(V+=re),V+='"'}}return V},"displayTls"),v=o(function(N,R,V,W,ee){if(W===0)return"";let he="",fe=ee?",":"";switch(N){case f:he=fe+e.charsToHex(R,V,W);break;case u:if(ee)return`,${e.charsToDec(R,V,W)}`;he=fe+e.charsToDec(R,V,W);break;case p:he=e.charsToUnicode(R,V,W);break;case m:default:he=e.charsToAsciiHtml(R,V,W);break}return he},"subPhrase"),M=o(function(N,R,V,W,ee,he){let fe="",Y,pe,Q,ce,q=F,se=`<span class="${t.CLASS_LOOKBEHIND}">`,be=`<span class="${t.CLASS_REMAINDER}">`,Te="</span>",we=!1;switch(V){case i.EMPTY:fe+=E;case i.NOMATCH:case i.MATCH:case i.ACTIVE:Y=W-ee,pe=he-Y,Q=he,ce=R.length-Q;break;default:throw new Error("unrecognized state")}return q=F,pe>x?(pe=x,q=re,ce=0):pe+ce>x&&(q=re,ce=x-pe),pe>0&&(fe+=se,fe+=v(N,R,Y,pe,we),fe+=Te,we=!0),ce>0&&(fe+=be,fe+=v(N,R,Q,ce,we),fe+=Te),fe+q},"displayBehind"),ne=o(function(N,R,V,W,ee,he){let fe="",Y,pe,Q,ce,q=F,se=`<span class="${t.CLASS_REMAINDER}">`,be="</span>",Te=!1;switch(V){case i.EMPTY:fe+=E;case i.NOMATCH:case i.ACTIVE:Y=W,pe=0,Q=W,ce=R.length-Q;break;case i.MATCH:Y=W,pe=ee,Q=W+pe,ce=R.length-Q;break;default:throw new Error("unrecognized state")}return q=F,pe>x?(pe=x,q=re,ce=0):pe+ce>x&&(q=re,ce=x-pe),pe>0&&(fe+=he,fe+=v(N,R,Y,pe,Te),fe+=be,Te=!0),ce>0&&(fe+=se,fe+=v(N,R,Q,ce,Te),fe+=be),fe+q},"displayForward"),A=o(function(N,R,V,W,ee){let he=`<span class="${t.CLASS_LOOKAHEAD}">`;return ne(N,R,V,W,ee,he)},"displayAhead"),K=o(function(N,R,V,W,ee){let he=`<span class="${t.CLASS_MATCH}">`;return ne(N,R,V,W,ee,he)},"displayNone"),J=o(function(N){if(H===null)return"";let R="",V,W,ee,he,fe,Y;return R+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",R+=`<th>operator</th><th>phrase</th></tr>
333
- `,n.forEach(pe=>{let Q=O[pe];switch(V=Q.thisLine,W=Q.thatLine!==void 0?Q.thatLine:"--",ee=!1,he=!1,fe=!1,Q.lookAround===i.LOOKAROUND_AHEAD&&(ee=!0,fe=!0,Y=Q.lookAnchor),(Q.opcode.type===i.AND||Q.opcode.type===i.NOT)&&(ee=!0,fe=!0,Y=Q.phraseIndex),Q.lookAround===i.LOOKAROUND_BEHIND&&(he=!0,fe=!0,Y=Q.lookAnchor),(Q.opcode.type===i.BKA||Q.opcode.type===i.BKN)&&(he=!0,fe=!0,Y=Q.phraseIndex),R+="<tr>",R+=`<td>${V}</td><td>${W}</td>`,R+=`<td>${Q.phraseIndex}</td>`,R+=`<td>${Q.phraseLength}</td>`,R+=`<td>${Q.depth}</td>`,R+="<td>",Q.state){case i.ACTIVE:R+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:R+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:R+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:R+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:R+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(R+="</td>",R+="<td>",R+=a.indent(Q.depth),ee?R+=`<span class="${t.CLASS_LOOKAHEAD}">`:he&&(R+=`<span class="${t.CLASS_LOOKBEHIND}">`),R+=e.opcodeToString(Q.opcode.type),Q.opcode.type===i.RNM&&(R+=`(${H[Q.opcode.index].name}) `),Q.opcode.type===i.BKR){let ce=Q.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",q=Q.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";R+=`(\\${ce}${q}${H[Q.opcode.index].name}) `}Q.opcode.type===i.UDT&&(R+=`(${X[Q.opcode.index].name}) `),Q.opcode.type===i.TRG&&(R+=`(${w(N,Q.opcode)}) `),Q.opcode.type===i.TBS&&(R+=`(${S(N,Q.opcode)}) `),Q.opcode.type===i.TLS&&(R+=`(${D(N,Q.opcode)}) `),Q.opcode.type===i.REP&&(R+=`(${b(N,Q.opcode)}) `),fe&&(R+="</span>"),R+="</td>",R+="<td>",he?R+=M(N,z,Q.state,Q.phraseIndex,Q.phraseLength,Y):ee?R+=A(N,z,Q.state,Q.phraseIndex,Q.phraseLength):R+=K(N,z,Q.state,Q.phraseIndex,Q.phraseLength),R+=`</td></tr>
332
+ `,N},"htmlFooter");this.indent=function(N){let R="";for(let V=0;V<N;V+=1)R+=".";return R};let w=o(function(N,R){let V="";if(R.type===i.TRG)if(N===f||N===p){let W=R.min.toString(16).toUpperCase();W.length%2!==0&&(W=`0${W}`),V+=N===f?"%x":"U+",V+=W,W=R.max.toString(16).toUpperCase(),W.length%2!==0&&(W=`0${W}`),V+=`&ndash;${W}`}else V=`%d${R.min.toString(10)}&ndash;${R.max.toString(10)}`;return V},"displayTrg"),b=o(function(N,R){let V="";if(R.type===i.REP)if(N===f){let W=R.min.toString(16).toUpperCase();W.length%2!==0&&(W=`0${W}`),V=`x${W}`,R.max<1/0?(W=R.max.toString(16).toUpperCase(),W.length%2!==0&&(W=`0${W}`)):W="inf",V+=`&ndash;${W}`}else R.max<1/0?V=`${R.min.toString(10)}&ndash;${R.max.toString(10)}`:V=`${R.min.toString(10)}&ndash;inf`;return V},"displayRep"),S=o(function(N,R){let V="";if(R.type===i.TBS){let W=Math.min(R.string.length,k*2);if(N===f||N===p){V+=N===f?"%x":"U+";for(let ee=0;ee<W;ee+=1){let he;ee>0&&(V+="."),he=R.string[ee].toString(16).toUpperCase(),he.length%2!==0&&(he=`0${he}`),V+=he}}else{V="%d";for(let ee=0;ee<W;ee+=1)ee>0&&(V+="."),V+=R.string[ee].toString(10)}W<R.string.length&&(V+=re)}return V},"displayTbs"),D=o(function(N,R){let V="";if(R.type===i.TLS){let W=Math.min(R.string.length,k);if(N===f||N===u){let ee,he,fe;N===f?(V="%x",fe=16):(V="%d",fe=10);for(let Y=0;Y<W;Y+=1)Y>0&&(V+="."),he=R.string[Y],he>=97&&he<=122?(ee=he-32,V+=`${ee.toString(fe)}/${he.toString(fe)}`.toUpperCase()):he>=65&&he<=90?(ee=he,he+=32,V+=`${ee.toString(fe)}/${he.toString(fe)}`.toUpperCase()):V+=he.toString(fe).toUpperCase();W<R.string.length&&(V+=re)}else{V='"';for(let ee=0;ee<W;ee+=1)V+=e.asciiChars[R.string[ee]];W<R.string.length&&(V+=re),V+='"'}}return V},"displayTls"),v=o(function(N,R,V,W,ee){if(W===0)return"";let he="",fe=ee?",":"";switch(N){case f:he=fe+e.charsToHex(R,V,W);break;case u:if(ee)return`,${e.charsToDec(R,V,W)}`;he=fe+e.charsToDec(R,V,W);break;case p:he=e.charsToUnicode(R,V,W);break;case m:default:he=e.charsToAsciiHtml(R,V,W);break}return he},"subPhrase"),M=o(function(N,R,V,W,ee,he){let fe="",Y,pe,Q,ce,q=F,se=`<span class="${t.CLASS_LOOKBEHIND}">`,be=`<span class="${t.CLASS_REMAINDER}">`,ke="</span>",we=!1;switch(V){case i.EMPTY:fe+=E;case i.NOMATCH:case i.MATCH:case i.ACTIVE:Y=W-ee,pe=he-Y,Q=he,ce=R.length-Q;break;default:throw new Error("unrecognized state")}return q=F,pe>x?(pe=x,q=re,ce=0):pe+ce>x&&(q=re,ce=x-pe),pe>0&&(fe+=se,fe+=v(N,R,Y,pe,we),fe+=ke,we=!0),ce>0&&(fe+=be,fe+=v(N,R,Q,ce,we),fe+=ke),fe+q},"displayBehind"),ne=o(function(N,R,V,W,ee,he){let fe="",Y,pe,Q,ce,q=F,se=`<span class="${t.CLASS_REMAINDER}">`,be="</span>",ke=!1;switch(V){case i.EMPTY:fe+=E;case i.NOMATCH:case i.ACTIVE:Y=W,pe=0,Q=W,ce=R.length-Q;break;case i.MATCH:Y=W,pe=ee,Q=W+pe,ce=R.length-Q;break;default:throw new Error("unrecognized state")}return q=F,pe>x?(pe=x,q=re,ce=0):pe+ce>x&&(q=re,ce=x-pe),pe>0&&(fe+=he,fe+=v(N,R,Y,pe,ke),fe+=be,ke=!0),ce>0&&(fe+=se,fe+=v(N,R,Q,ce,ke),fe+=be),fe+q},"displayForward"),A=o(function(N,R,V,W,ee){let he=`<span class="${t.CLASS_LOOKAHEAD}">`;return ne(N,R,V,W,ee,he)},"displayAhead"),K=o(function(N,R,V,W,ee){let he=`<span class="${t.CLASS_MATCH}">`;return ne(N,R,V,W,ee,he)},"displayNone"),J=o(function(N){if(H===null)return"";let R="",V,W,ee,he,fe,Y;return R+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",R+=`<th>operator</th><th>phrase</th></tr>
333
+ `,n.forEach(pe=>{let Q=I[pe];switch(V=Q.thisLine,W=Q.thatLine!==void 0?Q.thatLine:"--",ee=!1,he=!1,fe=!1,Q.lookAround===i.LOOKAROUND_AHEAD&&(ee=!0,fe=!0,Y=Q.lookAnchor),(Q.opcode.type===i.AND||Q.opcode.type===i.NOT)&&(ee=!0,fe=!0,Y=Q.phraseIndex),Q.lookAround===i.LOOKAROUND_BEHIND&&(he=!0,fe=!0,Y=Q.lookAnchor),(Q.opcode.type===i.BKA||Q.opcode.type===i.BKN)&&(he=!0,fe=!0,Y=Q.phraseIndex),R+="<tr>",R+=`<td>${V}</td><td>${W}</td>`,R+=`<td>${Q.phraseIndex}</td>`,R+=`<td>${Q.phraseLength}</td>`,R+=`<td>${Q.depth}</td>`,R+="<td>",Q.state){case i.ACTIVE:R+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:R+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:R+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:R+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:R+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(R+="</td>",R+="<td>",R+=a.indent(Q.depth),ee?R+=`<span class="${t.CLASS_LOOKAHEAD}">`:he&&(R+=`<span class="${t.CLASS_LOOKBEHIND}">`),R+=e.opcodeToString(Q.opcode.type),Q.opcode.type===i.RNM&&(R+=`(${H[Q.opcode.index].name}) `),Q.opcode.type===i.BKR){let ce=Q.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",q=Q.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";R+=`(\\${ce}${q}${H[Q.opcode.index].name}) `}Q.opcode.type===i.UDT&&(R+=`(${X[Q.opcode.index].name}) `),Q.opcode.type===i.TRG&&(R+=`(${w(N,Q.opcode)}) `),Q.opcode.type===i.TBS&&(R+=`(${S(N,Q.opcode)}) `),Q.opcode.type===i.TLS&&(R+=`(${D(N,Q.opcode)}) `),Q.opcode.type===i.REP&&(R+=`(${b(N,Q.opcode)}) `),fe&&(R+="</span>"),R+="</td>",R+="<td>",he?R+=M(N,j,Q.state,Q.phraseIndex,Q.phraseLength,Y):ee?R+=A(N,j,Q.state,Q.phraseIndex,Q.phraseLength):R+=K(N,j,Q.state,Q.phraseIndex,Q.phraseLength),R+=`</td></tr>
334
334
  `}),R+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",R+=`<th>operator</th><th>phrase</th></tr>
335
335
  `,R+=`</table>
336
- `,R},"htmlTable");this.toHtml=function(N,R){let V=m;if(typeof N=="string"&&N.length>=3){let ee=N.toLowerCase().slice(0,3);ee==="hex"?V=f:ee==="dec"?V=u:ee==="uni"&&(V=p)}let W="";return W+=y(V,R),W+=J(V),W+=_(),W}},"exportTrace")});var fs=me((NL,H2)=>{H2.exports={ast:N2(),circular:_0(),ids:Tn(),parser:B2(),stats:F2(),trace:q2(),utils:as(),emitcss:x0(),style:Rf()}});var z2=me((RL,j2)=>{j2.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=o(function(){let t="";return t+=`file = *line [last-line]
336
+ `,R},"htmlTable");this.toHtml=function(N,R){let V=m;if(typeof N=="string"&&N.length>=3){let ee=N.toLowerCase().slice(0,3);ee==="hex"?V=f:ee==="dec"?V=u:ee==="uni"&&(V=p)}let W="";return W+=y(V,R),W+=J(V),W+=_(),W}},"exportTrace")});var fs=me((UL,H2)=>{H2.exports={ast:N2(),circular:_0(),ids:Tn(),parser:B2(),stats:F2(),trace:q2(),utils:as(),emitcss:x0(),style:Rf()}});var j2=me((FL,z2)=>{z2.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=o(function(){let t="";return t+=`file = *line [last-line]
337
337
  `,t+=`line = line-text end
338
338
  `,t+=`line-text = *(valid/invalid)
339
339
  `,t+=`last-line = 1*(valid/invalid)
@@ -343,7 +343,7 @@ table.apg-attrs a:hover {
343
343
  `,t+=`CRLF = %d13.10
344
344
  `,t+=`LF = %d10
345
345
  `,t+=`CR = %d13
346
- `,t},"toString")},"grammar")});var V2=me(K2=>{var fr=Tn(),KS=as();function VS(r,e,t,n,i){return r===fr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:i.textLength,endType:i.endType,invalidChars:i.invalidCount}),fr.SEM_OK}o(VS,"semLine");function WS(r,e,t,n,i){return r===fr.SEM_PRE&&(i.textLength=n),fr.SEM_OK}o(WS,"semLineText");function GS(r,e,t,n,i){return r===fr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.strict?(i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:n,endType:"none",invalidChars:i.invalidCount}),i.errors.push({line:i.lineNo,char:t+n,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(e.push(10),i.lines.push({lineNo:i.lines.length,beginChar:t,length:n+1,textLength:n,endType:"LF",invalidChars:i.invalidCount})),fr.SEM_OK}o(GS,"semLastLine");function YS(r,e,t,n,i){return r===fr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${KS.charToHex(e[t])}'`}),fr.SEM_OK}o(YS,"semInvalid");function JS(r,e,t,n,i){return r===fr.SEM_POST&&(i.lineNo+=1),fr.SEM_OK}o(JS,"semEnd");function XS(r,e,t,n,i){return r===fr.SEM_PRE&&(i.endType="LF",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),fr.SEM_OK}o(XS,"semLF");function ZS(r,e,t,n,i){return r===fr.SEM_PRE&&(i.endType="CR",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),fr.SEM_OK}o(ZS,"semCR");function QS(r,e,t,n,i){return r===fr.SEM_PRE&&(i.endType="CRLF"),fr.SEM_OK}o(QS,"semCRLF");var Ii=[];Ii.line=VS;Ii["line-text"]=WS;Ii["last-line"]=GS;Ii.invalid=YS;Ii.end=JS;Ii.lf=XS;Ii.cr=ZS;Ii.crlf=QS;K2.callbacks=Ii});var G2=me((BL,W2)=>{W2.exports=o(function(e,t,n,i){let s="scanner.js: ",a=fs(),f=new(z2()),{callbacks:u}=V2(),m=[],p=new a.parser;if(p.ast=new a.ast,p.ast.callbacks=u,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);p.trace=i}if(p.parse(f,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let k={lines:m,lineNo:0,errors:t,strict:!!n};return p.ast.translate(k),m},"exfn")});var J2=me((UL,Y2)=>{Y2.exports=o(function(){let e="syntax-callbacks.js: ",t=fs(),n=t.ids,i,s=o(function(D,v,M,ne){switch(D.state){case n.ACTIVE:ne.altStack=[],ne.repCount=0;break;case n.EMPTY:ne.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:ne.ruleCount===0&&ne.errors.push({line:0,char:0,msg:"no rules defined"});break;case n.NOMATCH:throw new Error(`${e}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${e}synFile: unrecognized case.`)}},"synFile"),a=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},M.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:M.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),f=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),u=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),m=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),p=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),x=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),k=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),O=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),T=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),C=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),$=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(M.strict){let ne=t.utils.charsToString(D,v,S.phraseLength);M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:`Back reference operator(${ne}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),I=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(M.strict){let ne=t.utils.charsToString(D,v,S.phraseLength);M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:`UDT operator found(${ne}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),U=o(function(S,D,v){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),z=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar!==!1&&M.errors.push({line:M.findLine(M.lines,M.stringTabChar),char:M.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsString"),H=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),X=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.tlsOpen),char:i.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),i.basicError=!0,i.tlsOpen=null;break;case n.MATCH:i.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsClose"),B=o(function(S,D,v){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),L=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar!==!1&&M.errors.push({line:M.findLine(M.lines,M.stringTabChar),char:M.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),F=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),i.clsOpen=null,i.basicError=!0;break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),i.clsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsClose"),re=o(function(S,D,v){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),E=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar!==!1&&M.errors.push({line:M.findLine(M.lines,M.stringTabChar),char:M.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),l=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),i.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValClose"),g=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:v,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},M.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),h=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=M.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=M.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),c=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:v,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},M.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),d=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=M.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=M.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),y=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),_=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(S.phraseLength===1&&M.strict){let ne=D[v]===13?"CR":"LF";M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:`Line end '${ne}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),w=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),b=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.repCount+=1;break;case n.MATCH:M.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=p,this.callbacks.basicelementerr=y,this.callbacks.clsclose=F,this.callbacks.clsopen=B,this.callbacks.clsstring=L,this.callbacks.definedaserror=m,this.callbacks.file=s,this.callbacks.groupclose=h,this.callbacks.groupopen=g,this.callbacks.lineenderror=w,this.callbacks.lineend=_,this.callbacks.notop=x,this.callbacks.optionclose=d,this.callbacks.optionopen=c,this.callbacks.prosvalclose=l,this.callbacks.prosvalopen=re,this.callbacks.prosvalstring=E,this.callbacks.repetition=b,this.callbacks.rule=a,this.callbacks.ruleerror=f,this.callbacks.rulenameerror=u,this.callbacks.stringtab=H,this.callbacks.tlsclose=X,this.callbacks.tlsopen=U,this.callbacks.tlsstring=z,this.callbacks.udtop=I,this.callbacks.bkaop=k,this.callbacks.bknop=O,this.callbacks.bkrop=$,this.callbacks.abgop=T,this.callbacks.aenop=C},"exfn")});var Z2=me((FL,X2)=>{X2.exports=o(function(){let e=fs(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(Q){let ce=-1;return this.get(Q)===-1&&(ce={name:Q,lower:Q.toLowerCase(),index:this.names.length},this.names.push(ce)),ce},"add"),this.get=o(function(Q){let ce=-1,q=Q.toLowerCase();for(let se=0;se<this.names.length;se+=1)if(this.names[se].lower===q){ce=this.names[se];break}return ce},"get")},"NameList"),i=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=10*q+pe[se]-48;return q},"decnum"),s=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=2*q+pe[se]-48;return q},"binnum"),a=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1){let be=pe[se];if(be>=48&&be<=57)be-=48;else if(be>=65&&be<=70)be-=55;else if(be>=97&&be<=102)be-=87;else throw new Error("hexnum out of range");q=16*q+be}return q},"hexnum");function f(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleNames=new n,q.udtNames=new n,q.rules=[],q.udts=[],q.rulesLineMap=[],q.opcodes=[],q.altStack=[],q.topStack=null,q.topRule=null;else if(Y===t.SEM_POST){let be;q.rules.forEach(Te=>{Te.isBkr=!1,Te.opcodes.forEach(we=>{we.type===t.RNM&&(be=q.ruleNames.get(we.index.name),be===-1?(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Rule name '${we.index.name}' used but not defined.`}),we.index=-1):we.index=be.index)})}),q.udts.forEach(Te=>{Te.isBkr=!1}),q.rules.forEach(Te=>{Te.opcodes.forEach(we=>{we.type===t.BKR&&(Te.hasBkr=!0,be=q.ruleNames.get(we.index.name),be!==-1?(q.rules[be.index].isBkr=!0,we.index=be.index):(be=q.udtNames.get(we.index.name),be!==-1?(q.udts[be.index].isBkr=!0,we.index=q.rules.length+be.index):(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Back reference name '${we.index.name}' refers to undefined rule or unamed UDT.`}),we.index=-1)))})})}return se}o(f,"semFile");function u(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.altStack.length=0,q.topStack=null,q.rulesLineMap.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q})),se}o(u,"semRule");function m(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleName="",q.definedas="";else if(Y===t.SEM_POST){let be;q.definedas==="="?(be=q.ruleNames.add(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' previously defined.`})):(q.topRule={name:be.name,lower:be.lower,opcodes:[],index:be.index},q.rules.push(q.topRule),q.opcodes=q.topRule.opcodes)):(be=q.ruleNames.get(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' for incremental alternate not previously defined.`})):(q.topRule=q.rules[be.index],q.opcodes=q.topRule.opcodes))}return se}o(m,"semRuleLookup");function p(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)for(;;){if(q.definedas===null){se=t.SEM_SKIP;break}if(q.topStack===null){if(q.definedas==="="){q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}q.topStack={alt:q.opcodes[0],cat:null},q.altStack.push(q.topStack);break}q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}else Y===t.SEM_POST&&(q.altStack.pop(),q.altStack.length>0?q.topStack=q.altStack[q.altStack.length-1]:q.topStack=null);return se}o(p,"semAlternation");function x(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.topStack.alt.children.push(q.opcodes.length),q.topStack.cat={type:t.CAT,children:[]},q.opcodes.push(q.topStack.cat)):Y===t.SEM_POST&&(q.topStack.cat=null),se}o(x,"semConcatenation");function k(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&q.topStack.cat.children.push(q.opcodes.length),se}o(k,"semRepetition");function O(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.REP,min:0,max:1,char:Q}),se}o(O,"semOptionOpen");function T(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.ruleName=e.utils.charsToString(pe,Q,ce)),se}o(T,"semRuleName");function C(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="="),se}o(C,"semDefined");function $(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="=/"),se}o($,"semIncAlt");function I(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=1/0,q.topRep={type:t.REP,min:0,max:1/0},q.opcodes.push(q.topRep)):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`repetition min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.topRep.min=q.min,q.topRep.max=q.max),se}o(I,"semRepOp");function U(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(U,"semRepMin");function z(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(z,"semRepMax");function H(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce),q.min=q.max),se}o(H,"semRepMinMax");function X(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AND}),se}o(X,"semAndOp");function B(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.NOT}),se}o(B,"semNotOp");function L(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.RNM,index:{phraseIndex:Q,name:e.utils.charsToString(pe,Q,ce)}}),se}o(L,"semRnmOp");function F(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.ABG}),se}o(F,"semAbgOp");function re(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AEN}),se}o(re,"semAenOp");function E(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKA}),se}o(E,"semBkaOp");function l(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKN}),se}o(l,"semBknOp");function g(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.ci=!0,q.cs=!1,q.um=!0,q.pm=!1):Y===t.SEM_POST&&q.opcodes.push({type:t.BKR,bkrCase:q.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:q.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:q.bkrname.phraseIndex,name:e.utils.charsToString(pe,q.bkrname.phraseIndex,q.bkrname.phraseLength)}}),se}o(g,"semBkrOp");function h(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.ci=!0),se}o(h,"semBkrCi");function c(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.cs=!0),se}o(c,"semBkrCs");function d(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.um=!0),se}o(d,"semBkrUm");function y(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.pm=!0),se}o(y,"semBkrPm");function _(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.bkrname={phraseIndex:Q,phraseLength:ce}),se}o(_,"semBkrName");function w(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),Te=q.udtNames.add(be);if(Te===-1){if(Te=q.udtNames.get(be),Te===-1)throw new Error("semUdtEmpty: name look up error")}else q.udts.push({name:Te.name,lower:Te.lower,index:Te.index,empty:!0});q.opcodes.push({type:t.UDT,empty:!0,index:Te.index})}return se}o(w,"semUdtEmpty");function b(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),Te=q.udtNames.add(be);if(Te===-1){if(Te=q.udtNames.get(be),Te===-1)throw new Error("semUdtNonEmpty: name look up error")}else q.udts.push({name:Te.name,lower:Te.lower,index:Te.index,empty:!1});q.opcodes.push({type:t.UDT,empty:!1,index:Te.index,syntax:null,semantic:null})}return se}o(b,"semUdtNonEmpty");function S(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.tlscase=!0),se}o(S,"semTlsOp");function D(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&ce>0&&(pe[Q+1]===83||pe[Q+1]===115)&&(q.tlscase=!1),se}o(D,"semTlsCase");function v(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST)if(q.tlscase){let be=pe.slice(Q,Q+ce);for(let Te=0;Te<be.length;Te+=1)be[Te]>=65&&be[Te]<=90&&(be[Te]+=32);q.opcodes.push({type:t.TLS,string:be})}else q.opcodes.push({type:t.TBS,string:pe.slice(Q,Q+ce)});return se}o(v,"semTlsString");function M(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(ce<=2?q.opcodes.push({type:t.TLS,string:[]}):q.opcodes.push({type:t.TBS,string:pe.slice(Q+1,Q+ce-1)})),se}o(M,"semClsOp");function ne(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?q.tbsstr=[]:Y===t.SEM_POST&&q.opcodes.push({type:t.TBS,string:q.tbsstr}),se}o(ne,"semTbsOp");function A(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=0):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.opcodes.push({type:t.TRG,min:q.min,max:q.max})),se}o(A,"semTrgOp");function K(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(K,"semDmin");function J(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(J,"semDmax");function N(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=s(pe,Q,ce)),se}o(N,"semBmin");function R(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=s(pe,Q,ce)),se}o(R,"semBmax");function V(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=a(pe,Q,ce)),se}o(V,"semXmin");function W(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=a(pe,Q,ce)),se}o(W,"semXmax");function ee(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(i(pe,Q,ce)),se}o(ee,"semDstring");function he(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(s(pe,Q,ce)),se}o(he,"semBstring");function fe(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(a(pe,Q,ce)),se}o(fe,"semXstring"),this.callbacks=[],this.callbacks.abgop=F,this.callbacks.aenop=re,this.callbacks.alternation=p,this.callbacks.andop=X,this.callbacks.bmax=R,this.callbacks.bmin=N,this.callbacks.bkaop=E,this.callbacks.bknop=l,this.callbacks.bkrop=g,this.callbacks["bkr-name"]=_,this.callbacks.bstring=he,this.callbacks.clsop=M,this.callbacks.ci=h,this.callbacks.cs=c,this.callbacks.um=d,this.callbacks.pm=y,this.callbacks.concatenation=x,this.callbacks.defined=C,this.callbacks.dmax=J,this.callbacks.dmin=K,this.callbacks.dstring=ee,this.callbacks.file=f,this.callbacks.incalt=$,this.callbacks.notop=B,this.callbacks.optionopen=O,this.callbacks["rep-max"]=z,this.callbacks["rep-min"]=U,this.callbacks["rep-min-max"]=H,this.callbacks.repetition=k,this.callbacks.repop=I,this.callbacks.rnmop=L,this.callbacks.rule=u,this.callbacks.rulelookup=m,this.callbacks.rulename=T,this.callbacks.tbsop=ne,this.callbacks.tlscase=D,this.callbacks.tlsstring=v,this.callbacks.tlsop=S,this.callbacks.trgop=A,this.callbacks["udt-empty"]=w,this.callbacks["udt-non-empty"]=b,this.callbacks.xmax=W,this.callbacks.xmin=V,this.callbacks.xstring=fe},"exfn")});var ey=me(($L,Q2)=>{Q2.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=o(function(){let t="";return t+=`;
346
+ `,t},"toString")},"grammar")});var V2=me(K2=>{var cr=Tn(),YS=as();function JS(r,e,t,n,i){return r===cr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:i.textLength,endType:i.endType,invalidChars:i.invalidCount}),cr.SEM_OK}o(JS,"semLine");function XS(r,e,t,n,i){return r===cr.SEM_PRE&&(i.textLength=n),cr.SEM_OK}o(XS,"semLineText");function ZS(r,e,t,n,i){return r===cr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.strict?(i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:n,endType:"none",invalidChars:i.invalidCount}),i.errors.push({line:i.lineNo,char:t+n,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(e.push(10),i.lines.push({lineNo:i.lines.length,beginChar:t,length:n+1,textLength:n,endType:"LF",invalidChars:i.invalidCount})),cr.SEM_OK}o(ZS,"semLastLine");function QS(r,e,t,n,i){return r===cr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${YS.charToHex(e[t])}'`}),cr.SEM_OK}o(QS,"semInvalid");function eM(r,e,t,n,i){return r===cr.SEM_POST&&(i.lineNo+=1),cr.SEM_OK}o(eM,"semEnd");function tM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="LF",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),cr.SEM_OK}o(tM,"semLF");function rM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CR",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),cr.SEM_OK}o(rM,"semCR");function nM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CRLF"),cr.SEM_OK}o(nM,"semCRLF");var Pi=[];Pi.line=JS;Pi["line-text"]=XS;Pi["last-line"]=ZS;Pi.invalid=QS;Pi.end=eM;Pi.lf=tM;Pi.cr=rM;Pi.crlf=nM;K2.callbacks=Pi});var G2=me((qL,W2)=>{W2.exports=o(function(e,t,n,i){let s="scanner.js: ",a=fs(),f=new(j2()),{callbacks:u}=V2(),m=[],p=new a.parser;if(p.ast=new a.ast,p.ast.callbacks=u,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);p.trace=i}if(p.parse(f,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let k={lines:m,lineNo:0,errors:t,strict:!!n};return p.ast.translate(k),m},"exfn")});var J2=me((HL,Y2)=>{Y2.exports=o(function(){let e="syntax-callbacks.js: ",t=fs(),n=t.ids,i,s=o(function(D,v,M,ne){switch(D.state){case n.ACTIVE:ne.altStack=[],ne.repCount=0;break;case n.EMPTY:ne.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:ne.ruleCount===0&&ne.errors.push({line:0,char:0,msg:"no rules defined"});break;case n.NOMATCH:throw new Error(`${e}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${e}synFile: unrecognized case.`)}},"synFile"),a=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},M.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:M.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),f=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),u=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),m=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),p=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),x=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),k=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),I=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),T=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),C=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),$=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(M.strict){let ne=t.utils.charsToString(D,v,S.phraseLength);M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:`Back reference operator(${ne}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),O=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(M.strict){let ne=t.utils.charsToString(D,v,S.phraseLength);M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:`UDT operator found(${ne}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),U=o(function(S,D,v){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),j=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar!==!1&&M.errors.push({line:M.findLine(M.lines,M.stringTabChar),char:M.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsString"),H=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),X=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.tlsOpen),char:i.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),i.basicError=!0,i.tlsOpen=null;break;case n.MATCH:i.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsClose"),B=o(function(S,D,v){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),L=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar!==!1&&M.errors.push({line:M.findLine(M.lines,M.stringTabChar),char:M.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),F=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),i.clsOpen=null,i.basicError=!0;break;case n.MATCH:M.strict&&M.errors.push({line:M.findLine(M.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),i.clsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsClose"),re=o(function(S,D,v){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),E=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:M.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.stringTabChar!==!1&&M.errors.push({line:M.findLine(M.lines,M.stringTabChar),char:M.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),l=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),i.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValClose"),g=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:v,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},M.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),h=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=M.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=M.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),c=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:v,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},M.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),d=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.errors.push({line:M.findLine(M.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=M.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=M.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),y=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),_=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(S.phraseLength===1&&M.strict){let ne=D[v]===13?"CR":"LF";M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:`Line end '${ne}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),w=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:M.errors.push({line:M.findLine(M.lines,v,M.charsLength),char:v,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),b=o(function(S,D,v,M){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:M.repCount+=1;break;case n.MATCH:M.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=p,this.callbacks.basicelementerr=y,this.callbacks.clsclose=F,this.callbacks.clsopen=B,this.callbacks.clsstring=L,this.callbacks.definedaserror=m,this.callbacks.file=s,this.callbacks.groupclose=h,this.callbacks.groupopen=g,this.callbacks.lineenderror=w,this.callbacks.lineend=_,this.callbacks.notop=x,this.callbacks.optionclose=d,this.callbacks.optionopen=c,this.callbacks.prosvalclose=l,this.callbacks.prosvalopen=re,this.callbacks.prosvalstring=E,this.callbacks.repetition=b,this.callbacks.rule=a,this.callbacks.ruleerror=f,this.callbacks.rulenameerror=u,this.callbacks.stringtab=H,this.callbacks.tlsclose=X,this.callbacks.tlsopen=U,this.callbacks.tlsstring=j,this.callbacks.udtop=O,this.callbacks.bkaop=k,this.callbacks.bknop=I,this.callbacks.bkrop=$,this.callbacks.abgop=T,this.callbacks.aenop=C},"exfn")});var Z2=me((zL,X2)=>{X2.exports=o(function(){let e=fs(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(Q){let ce=-1;return this.get(Q)===-1&&(ce={name:Q,lower:Q.toLowerCase(),index:this.names.length},this.names.push(ce)),ce},"add"),this.get=o(function(Q){let ce=-1,q=Q.toLowerCase();for(let se=0;se<this.names.length;se+=1)if(this.names[se].lower===q){ce=this.names[se];break}return ce},"get")},"NameList"),i=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=10*q+pe[se]-48;return q},"decnum"),s=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=2*q+pe[se]-48;return q},"binnum"),a=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1){let be=pe[se];if(be>=48&&be<=57)be-=48;else if(be>=65&&be<=70)be-=55;else if(be>=97&&be<=102)be-=87;else throw new Error("hexnum out of range");q=16*q+be}return q},"hexnum");function f(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleNames=new n,q.udtNames=new n,q.rules=[],q.udts=[],q.rulesLineMap=[],q.opcodes=[],q.altStack=[],q.topStack=null,q.topRule=null;else if(Y===t.SEM_POST){let be;q.rules.forEach(ke=>{ke.isBkr=!1,ke.opcodes.forEach(we=>{we.type===t.RNM&&(be=q.ruleNames.get(we.index.name),be===-1?(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Rule name '${we.index.name}' used but not defined.`}),we.index=-1):we.index=be.index)})}),q.udts.forEach(ke=>{ke.isBkr=!1}),q.rules.forEach(ke=>{ke.opcodes.forEach(we=>{we.type===t.BKR&&(ke.hasBkr=!0,be=q.ruleNames.get(we.index.name),be!==-1?(q.rules[be.index].isBkr=!0,we.index=be.index):(be=q.udtNames.get(we.index.name),be!==-1?(q.udts[be.index].isBkr=!0,we.index=q.rules.length+be.index):(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Back reference name '${we.index.name}' refers to undefined rule or unamed UDT.`}),we.index=-1)))})})}return se}o(f,"semFile");function u(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.altStack.length=0,q.topStack=null,q.rulesLineMap.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q})),se}o(u,"semRule");function m(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleName="",q.definedas="";else if(Y===t.SEM_POST){let be;q.definedas==="="?(be=q.ruleNames.add(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' previously defined.`})):(q.topRule={name:be.name,lower:be.lower,opcodes:[],index:be.index},q.rules.push(q.topRule),q.opcodes=q.topRule.opcodes)):(be=q.ruleNames.get(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' for incremental alternate not previously defined.`})):(q.topRule=q.rules[be.index],q.opcodes=q.topRule.opcodes))}return se}o(m,"semRuleLookup");function p(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)for(;;){if(q.definedas===null){se=t.SEM_SKIP;break}if(q.topStack===null){if(q.definedas==="="){q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}q.topStack={alt:q.opcodes[0],cat:null},q.altStack.push(q.topStack);break}q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}else Y===t.SEM_POST&&(q.altStack.pop(),q.altStack.length>0?q.topStack=q.altStack[q.altStack.length-1]:q.topStack=null);return se}o(p,"semAlternation");function x(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.topStack.alt.children.push(q.opcodes.length),q.topStack.cat={type:t.CAT,children:[]},q.opcodes.push(q.topStack.cat)):Y===t.SEM_POST&&(q.topStack.cat=null),se}o(x,"semConcatenation");function k(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&q.topStack.cat.children.push(q.opcodes.length),se}o(k,"semRepetition");function I(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.REP,min:0,max:1,char:Q}),se}o(I,"semOptionOpen");function T(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.ruleName=e.utils.charsToString(pe,Q,ce)),se}o(T,"semRuleName");function C(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="="),se}o(C,"semDefined");function $(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="=/"),se}o($,"semIncAlt");function O(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=1/0,q.topRep={type:t.REP,min:0,max:1/0},q.opcodes.push(q.topRep)):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`repetition min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.topRep.min=q.min,q.topRep.max=q.max),se}o(O,"semRepOp");function U(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(U,"semRepMin");function j(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(j,"semRepMax");function H(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce),q.min=q.max),se}o(H,"semRepMinMax");function X(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AND}),se}o(X,"semAndOp");function B(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.NOT}),se}o(B,"semNotOp");function L(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.RNM,index:{phraseIndex:Q,name:e.utils.charsToString(pe,Q,ce)}}),se}o(L,"semRnmOp");function F(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.ABG}),se}o(F,"semAbgOp");function re(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AEN}),se}o(re,"semAenOp");function E(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKA}),se}o(E,"semBkaOp");function l(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKN}),se}o(l,"semBknOp");function g(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.ci=!0,q.cs=!1,q.um=!0,q.pm=!1):Y===t.SEM_POST&&q.opcodes.push({type:t.BKR,bkrCase:q.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:q.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:q.bkrname.phraseIndex,name:e.utils.charsToString(pe,q.bkrname.phraseIndex,q.bkrname.phraseLength)}}),se}o(g,"semBkrOp");function h(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.ci=!0),se}o(h,"semBkrCi");function c(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.cs=!0),se}o(c,"semBkrCs");function d(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.um=!0),se}o(d,"semBkrUm");function y(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.pm=!0),se}o(y,"semBkrPm");function _(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.bkrname={phraseIndex:Q,phraseLength:ce}),se}o(_,"semBkrName");function w(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),ke=q.udtNames.add(be);if(ke===-1){if(ke=q.udtNames.get(be),ke===-1)throw new Error("semUdtEmpty: name look up error")}else q.udts.push({name:ke.name,lower:ke.lower,index:ke.index,empty:!0});q.opcodes.push({type:t.UDT,empty:!0,index:ke.index})}return se}o(w,"semUdtEmpty");function b(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),ke=q.udtNames.add(be);if(ke===-1){if(ke=q.udtNames.get(be),ke===-1)throw new Error("semUdtNonEmpty: name look up error")}else q.udts.push({name:ke.name,lower:ke.lower,index:ke.index,empty:!1});q.opcodes.push({type:t.UDT,empty:!1,index:ke.index,syntax:null,semantic:null})}return se}o(b,"semUdtNonEmpty");function S(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.tlscase=!0),se}o(S,"semTlsOp");function D(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&ce>0&&(pe[Q+1]===83||pe[Q+1]===115)&&(q.tlscase=!1),se}o(D,"semTlsCase");function v(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST)if(q.tlscase){let be=pe.slice(Q,Q+ce);for(let ke=0;ke<be.length;ke+=1)be[ke]>=65&&be[ke]<=90&&(be[ke]+=32);q.opcodes.push({type:t.TLS,string:be})}else q.opcodes.push({type:t.TBS,string:pe.slice(Q,Q+ce)});return se}o(v,"semTlsString");function M(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(ce<=2?q.opcodes.push({type:t.TLS,string:[]}):q.opcodes.push({type:t.TBS,string:pe.slice(Q+1,Q+ce-1)})),se}o(M,"semClsOp");function ne(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?q.tbsstr=[]:Y===t.SEM_POST&&q.opcodes.push({type:t.TBS,string:q.tbsstr}),se}o(ne,"semTbsOp");function A(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=0):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.opcodes.push({type:t.TRG,min:q.min,max:q.max})),se}o(A,"semTrgOp");function K(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(K,"semDmin");function J(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(J,"semDmax");function N(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=s(pe,Q,ce)),se}o(N,"semBmin");function R(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=s(pe,Q,ce)),se}o(R,"semBmax");function V(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=a(pe,Q,ce)),se}o(V,"semXmin");function W(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=a(pe,Q,ce)),se}o(W,"semXmax");function ee(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(i(pe,Q,ce)),se}o(ee,"semDstring");function he(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(s(pe,Q,ce)),se}o(he,"semBstring");function fe(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(a(pe,Q,ce)),se}o(fe,"semXstring"),this.callbacks=[],this.callbacks.abgop=F,this.callbacks.aenop=re,this.callbacks.alternation=p,this.callbacks.andop=X,this.callbacks.bmax=R,this.callbacks.bmin=N,this.callbacks.bkaop=E,this.callbacks.bknop=l,this.callbacks.bkrop=g,this.callbacks["bkr-name"]=_,this.callbacks.bstring=he,this.callbacks.clsop=M,this.callbacks.ci=h,this.callbacks.cs=c,this.callbacks.um=d,this.callbacks.pm=y,this.callbacks.concatenation=x,this.callbacks.defined=C,this.callbacks.dmax=J,this.callbacks.dmin=K,this.callbacks.dstring=ee,this.callbacks.file=f,this.callbacks.incalt=$,this.callbacks.notop=B,this.callbacks.optionopen=I,this.callbacks["rep-max"]=j,this.callbacks["rep-min"]=U,this.callbacks["rep-min-max"]=H,this.callbacks.repetition=k,this.callbacks.repop=O,this.callbacks.rnmop=L,this.callbacks.rule=u,this.callbacks.rulelookup=m,this.callbacks.rulename=T,this.callbacks.tbsop=ne,this.callbacks.tlscase=D,this.callbacks.tlsstring=v,this.callbacks.tlsop=S,this.callbacks.trgop=A,this.callbacks["udt-empty"]=w,this.callbacks["udt-non-empty"]=b,this.callbacks.xmax=W,this.callbacks.xmin=V,this.callbacks.xstring=fe},"exfn")});var ey=me((jL,Q2)=>{Q2.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=o(function(){let t="";return t+=`;
347
347
  `,t+=`; ABNF for JavaScript APG 2.0 SABNF
348
348
  `,t+=`; RFC 5234 with some restrictions and additions.
349
349
  `,t+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
@@ -514,85 +514,85 @@ table.apg-attrs a:hover {
514
514
  `,t+=` / %d10
515
515
  `,t+=` / %d13
516
516
  `,t+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
517
- `,t},"toString")},"grammar")});var ry=me((qL,ty)=>{ty.exports=o(function(){let e="parser: ",t=fs(),n=t.ids,i=new(J2()),s=new(Z2()),a=new(ey()),f=new t.parser;f.ast=new t.ast,f.callbacks=i.callbacks,f.ast.callbacks=s.callbacks;let u=o(function(k,O,T){if(O<0||O>=T)return-1;for(let C=0;C<k.length;C+=1)if(O>=k[C].beginChar&&O<k[C].beginChar+k[C].length)return C;return-1},"findLine"),m=o(function(k,O){let T=-1;if(O<k.length){for(let C=O;C<k.length;C+=1)if(k[C]!==null){T=k[C];break}}return T},"translateIndex"),p=o(function(k){k.forEach(O=>{let T=[],C=[],$=0;O.opcodes.forEach(I=>{I.type===n.ALT&&I.children.length===1||I.type===n.CAT&&I.children.length===1||I.type===n.REP&&I.min===1&&I.max===1?C.push(null):(C.push($),T.push(I),$+=1)}),C.push($),T.forEach(I=>{if(I.type===n.ALT||I.type===n.CAT)for(let U=0;U<I.children.length;U+=1)I.children[U]=m(C,I.children[U])}),O.opcodes=T})},"reduceOpcodes");this.syntax=o(function(k,O,T,C,$){if($){if($.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);f.trace=$}let I={};I.errors=T,I.strict=!!C,I.lines=O,I.findLine=u,I.charsLength=k.length,I.ruleCount=0,f.parse(a,"file",k,I).success||T.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(k,O,T){let C={};return C.errors=T,C.lines=O,C.findLine=u,C.charsLength=k.length,f.ast.translate(C),T.length?null:(p(C.rules),{rules:C.rules,udts:C.udts,lineMap:C.rulesLineMap})},"semantic"),this.generateSource=o(function(k,O,T,C,$){let I="",U,z,H,X=0,B=1/0,L=0,F=[],re=[],E=0,l=0,g=0,h=0,c=0,d=0,y=0,_=0,w=0,b=0,S=0,D=0,v=0,M=0,ne=0;T.forEach(J=>{F.push(J.lower),X+=J.opcodes.length,J.opcodes.forEach(N=>{switch(N.type){case n.ALT:E+=1;break;case n.CAT:l+=1;break;case n.RNM:g+=1;break;case n.UDT:h+=1;break;case n.REP:c+=1;break;case n.AND:d+=1;break;case n.NOT:y+=1;break;case n.BKA:D+=1;break;case n.BKN:v+=1;break;case n.BKR:S+=1;break;case n.ABG:M+=1;break;case n.AEN:ne+=1;break;case n.TLS:for(_+=1,U=0;U<N.string.length;U+=1)N.string[U]<B&&(B=N.string[U]),N.string[U]>L&&(L=N.string[U]);break;case n.TBS:for(w+=1,U=0;U<N.string.length;U+=1)N.string[U]<B&&(B=N.string[U]),N.string[U]>L&&(L=N.string[U]);break;case n.TRG:b+=1,N.min<B&&(B=N.min),N.max>L&&(L=N.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),F.sort(),C.length>0&&(C.forEach(J=>{re.push(J.lower)}),re.sort());let A="module.exports";$&&typeof $=="string"&&(A=`let ${$}`),I+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
518
- `,I+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
519
- `,I+=`//
520
- `,I+=`// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)
521
- `,I+=`${A} = function grammar(){
522
- `,I+=" // ```\n",I+=` // SUMMARY
523
- `,I+=` // rules = ${T.length}
524
- `,I+=` // udts = ${C.length}
525
- `,I+=` // opcodes = ${X}
526
- `,I+=` // --- ABNF original opcodes
527
- `,I+=` // ALT = ${E}
528
- `,I+=` // CAT = ${l}
529
- `,I+=` // REP = ${c}
530
- `,I+=` // RNM = ${g}
531
- `,I+=` // TLS = ${_}
532
- `,I+=` // TBS = ${w}
533
- `,I+=` // TRG = ${b}
534
- `,I+=` // --- SABNF superset opcodes
535
- `,I+=` // UDT = ${h}
536
- `,I+=` // AND = ${d}
537
- `,I+=` // NOT = ${y}
538
- `,I+=` // BKA = ${D}
539
- `,I+=` // BKN = ${v}
540
- `,I+=` // BKR = ${S}
541
- `,I+=` // ABG = ${M}
542
- `,I+=` // AEN = ${ne}
543
- `,I+=" // characters = [",_+w+b===0?I+=" none defined ]":I+=`${B} - ${L}]`,h>0&&(I+=" + user defined"),I+=`
544
- `,I+=" // ```\n",I+=` /* OBJECT IDENTIFIER (for internal parser use) */
545
- `,I+=` this.grammarObject = 'grammarObject';
546
- `,I+=`
547
- `,I+=` /* RULES */
548
- `,I+=` this.rules = [];
517
+ `,t},"toString")},"grammar")});var ry=me((KL,ty)=>{ty.exports=o(function(){let e="parser: ",t=fs(),n=t.ids,i=new(J2()),s=new(Z2()),a=new(ey()),f=new t.parser;f.ast=new t.ast,f.callbacks=i.callbacks,f.ast.callbacks=s.callbacks;let u=o(function(k,I,T){if(I<0||I>=T)return-1;for(let C=0;C<k.length;C+=1)if(I>=k[C].beginChar&&I<k[C].beginChar+k[C].length)return C;return-1},"findLine"),m=o(function(k,I){let T=-1;if(I<k.length){for(let C=I;C<k.length;C+=1)if(k[C]!==null){T=k[C];break}}return T},"translateIndex"),p=o(function(k){k.forEach(I=>{let T=[],C=[],$=0;I.opcodes.forEach(O=>{O.type===n.ALT&&O.children.length===1||O.type===n.CAT&&O.children.length===1||O.type===n.REP&&O.min===1&&O.max===1?C.push(null):(C.push($),T.push(O),$+=1)}),C.push($),T.forEach(O=>{if(O.type===n.ALT||O.type===n.CAT)for(let U=0;U<O.children.length;U+=1)O.children[U]=m(C,O.children[U])}),I.opcodes=T})},"reduceOpcodes");this.syntax=o(function(k,I,T,C,$){if($){if($.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);f.trace=$}let O={};O.errors=T,O.strict=!!C,O.lines=I,O.findLine=u,O.charsLength=k.length,O.ruleCount=0,f.parse(a,"file",k,O).success||T.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(k,I,T){let C={};return C.errors=T,C.lines=I,C.findLine=u,C.charsLength=k.length,f.ast.translate(C),T.length?null:(p(C.rules),{rules:C.rules,udts:C.udts,lineMap:C.rulesLineMap})},"semantic"),this.generateSource=o(function(k,I,T,C,$){let O="",U,j,H,X=0,B=1/0,L=0,F=[],re=[],E=0,l=0,g=0,h=0,c=0,d=0,y=0,_=0,w=0,b=0,S=0,D=0,v=0,M=0,ne=0;T.forEach(J=>{F.push(J.lower),X+=J.opcodes.length,J.opcodes.forEach(N=>{switch(N.type){case n.ALT:E+=1;break;case n.CAT:l+=1;break;case n.RNM:g+=1;break;case n.UDT:h+=1;break;case n.REP:c+=1;break;case n.AND:d+=1;break;case n.NOT:y+=1;break;case n.BKA:D+=1;break;case n.BKN:v+=1;break;case n.BKR:S+=1;break;case n.ABG:M+=1;break;case n.AEN:ne+=1;break;case n.TLS:for(_+=1,U=0;U<N.string.length;U+=1)N.string[U]<B&&(B=N.string[U]),N.string[U]>L&&(L=N.string[U]);break;case n.TBS:for(w+=1,U=0;U<N.string.length;U+=1)N.string[U]<B&&(B=N.string[U]),N.string[U]>L&&(L=N.string[U]);break;case n.TRG:b+=1,N.min<B&&(B=N.min),N.max>L&&(L=N.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),F.sort(),C.length>0&&(C.forEach(J=>{re.push(J.lower)}),re.sort());let A="module.exports";$&&typeof $=="string"&&(A=`let ${$}`),O+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
518
+ `,O+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
519
+ `,O+=`//
520
+ `,O+=`// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)
521
+ `,O+=`${A} = function grammar(){
522
+ `,O+=" // ```\n",O+=` // SUMMARY
523
+ `,O+=` // rules = ${T.length}
524
+ `,O+=` // udts = ${C.length}
525
+ `,O+=` // opcodes = ${X}
526
+ `,O+=` // --- ABNF original opcodes
527
+ `,O+=` // ALT = ${E}
528
+ `,O+=` // CAT = ${l}
529
+ `,O+=` // REP = ${c}
530
+ `,O+=` // RNM = ${g}
531
+ `,O+=` // TLS = ${_}
532
+ `,O+=` // TBS = ${w}
533
+ `,O+=` // TRG = ${b}
534
+ `,O+=` // --- SABNF superset opcodes
535
+ `,O+=` // UDT = ${h}
536
+ `,O+=` // AND = ${d}
537
+ `,O+=` // NOT = ${y}
538
+ `,O+=` // BKA = ${D}
539
+ `,O+=` // BKN = ${v}
540
+ `,O+=` // BKR = ${S}
541
+ `,O+=` // ABG = ${M}
542
+ `,O+=` // AEN = ${ne}
543
+ `,O+=" // characters = [",_+w+b===0?O+=" none defined ]":O+=`${B} - ${L}]`,h>0&&(O+=" + user defined"),O+=`
544
+ `,O+=" // ```\n",O+=` /* OBJECT IDENTIFIER (for internal parser use) */
545
+ `,O+=` this.grammarObject = 'grammarObject';
546
+ `,O+=`
547
+ `,O+=` /* RULES */
548
+ `,O+=` this.rules = [];
549
549
  `,T.forEach((J,N)=>{let R=" this.rules[";R+=N,R+="] = {name: '",R+=J.name,R+="', lower: '",R+=J.lower,R+="', index: ",R+=J.index,R+=", isBkr: ",R+=J.isBkr,R+=`};
550
- `,I+=R}),I+=`
551
- `,I+=` /* UDTS */
552
- `,I+=` this.udts = [];
550
+ `,O+=R}),O+=`
551
+ `,O+=` /* UDTS */
552
+ `,O+=` this.udts = [];
553
553
  `,C.length>0&&C.forEach((J,N)=>{let R=" this.udts[";R+=N,R+="] = {name: '",R+=J.name,R+="', lower: '",R+=J.lower,R+="', index: ",R+=J.index,R+=", empty: ",R+=J.empty,R+=", isBkr: ",R+=J.isBkr,R+=`};
554
- `,I+=R}),I+=`
555
- `,I+=` /* OPCODES */
556
- `,T.forEach((J,N)=>{N>0&&(I+=`
557
- `),I+=` /* ${J.name} */
558
- `,I+=` this.rules[${N}].opcodes = [];
559
- `,J.opcodes.forEach((R,V)=>{let W;switch(R.type){case n.ALT:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, children: [${R.children.toString()}]};// ALT
560
- `;break;case n.CAT:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, children: [${R.children.toString()}]};// CAT
561
- `;break;case n.RNM:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, index: ${R.index}};// RNM(${T[R.index].name})
562
- `;break;case n.BKR:R.index>=T.length?(z=C[R.index-T.length].name,H=C[R.index-T.length].lower):(z=T[R.index].name,H=T[R.index].lower),W="%i",R.bkrCase===n.BKR_MODE_CS&&(W="%s"),R.bkrMode===n.BKR_MODE_UM?W+="%u":W+="%p",z=W+z,I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, index: ${R.index}, lower: '${H}', bkrCase: ${R.bkrCase}, bkrMode: ${R.bkrMode}};// BKR(\\${z})
563
- `;break;case n.UDT:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, empty: ${R.empty}, index: ${R.index}};// UDT(${C[R.index].name})
564
- `;break;case n.REP:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, min: ${R.min}, max: ${R.max}};// REP
565
- `;break;case n.AND:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// AND
566
- `;break;case n.NOT:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// NOT
567
- `;break;case n.ABG:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// ABG(%^)
568
- `;break;case n.AEN:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// AEN(%$)
569
- `;break;case n.BKA:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// BKA
570
- `;break;case n.BKN:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// BKN
571
- `;break;case n.TLS:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, string: [${R.string.toString()}]};// TLS
572
- `;break;case n.TBS:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, string: [${R.string.toString()}]};// TBS
573
- `;break;case n.TRG:I+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, min: ${R.min}, max: ${R.max}};// TRG
574
- `;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),I+=`
575
- `,I+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",I+=` this.toString = function toString(){
576
- `,I+=` let str = "";
577
- `;let K;return O.forEach(J=>{let N=J.beginChar+J.length;K="",I+=' str += "';for(let R=J.beginChar;R<N;R+=1){switch(k[R]){case 9:K=" ";break;case 10:K="\\n";break;case 13:K="\\r";break;case 34:K='\\"';break;case 92:K="\\\\";break;default:K=String.fromCharCode(k[R]);break}I+=K}I+=`";
578
- `}),I+=` return str;
579
- `,I+=` }
580
- `,I+=`}
581
- `,I},"generateSource"),this.generateObject=o(function(k,O,T){let C={},$=[],I=[],U=k.slice(0);return C.grammarObject="grammarObject",O.forEach(z=>{$.push(z.lower)}),$.sort(),T.length>0&&(T.forEach(z=>{I.push(z.lower)}),I.sort()),C.callbacks=[],$.forEach(z=>{C.callbacks[z]=!1}),T.length>0&&I.forEach(z=>{C.callbacks[z]=!1}),C.rules=O,C.udts=T,C.toString=o(function(){return U},"toStringFunc"),C},"generateObject")},"exportParser")});var iy=me((HL,ny)=>{ny.exports=o(function(){let e=Tn(),t="rule-attributes.js",n=null;function i(E){return E.left||E.nested||E.right||E.cyclic?!1:E.empty}o(i,"isEmptyOnly");function s(E){return!!(E.left||E.nested||E.right||E.cyclic)}o(s,"isRecursive");function a(E,l){let g=0,h=0,c=0;for(g=0;g<l;g+=1)if(E[g].nested)return!0;for(g=0;g<l;g+=1)if(E[g].right&&!E[g].leaf){for(h=g+1;h<l;h+=1)if(!i(E[h]))return!0}for(g=l-1;g>=0;g-=1)if(E[g].left&&!E[g].leaf){for(h=g-1;h>=0;h-=1)if(!i(E[h]))return!0}for(g=0;g<l;g+=1)if(!E[g].empty&&!s(E[g])){for(h=g+1;h<l;h+=1)if(s(E[h])){for(c=h+1;c<l;c+=1)if(!E[c].empty&&!s(E[c]))return!0}}return!1}o(a,"isCatNested");function f(E,l){for(let g=0;g<l;g+=1)if(!E[g].cyclic)return!1;return!0}o(f,"isCatCyclic");function u(E,l){for(let g=0;g<l;g+=1){if(E[g].left)return!0;if(!E[g].empty)return!1}return!1}o(u,"isCatLeft");function m(E,l){for(let g=l-1;g>=0;g-=1){if(E[g].right)return!0;if(!E[g].empty)return!1}return!1}o(m,"isCatRight");function p(E,l){for(let g=0;g<l;g+=1)if(!E[g].empty)return!1;return!0}o(p,"isCatEmpty");function x(E,l){for(let g=0;g<l;g+=1)if(!E[g].finite)return!1;return!0}o(x,"isCatFinite");function k(E,l,g,h){let c=0,d=l[g],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(E.attrGen());for(c=0;c<y;c+=1)C(E,l,d.children[c],_[c]);h.left=u(_,y),h.right=m(_,y),h.nested=a(_,y),h.empty=p(_,y),h.finite=x(_,y),h.cyclic=f(_,y)}o(k,"cat");function O(E,l,g,h){let c=0,d=l[g],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(E.attrGen());for(c=0;c<y;c+=1)C(E,l,d.children[c],_[c]);for(h.left=!1,h.right=!1,h.nested=!1,h.empty=!1,h.finite=!1,h.cyclic=!1,c=0;c<y;c+=1)_[c].left&&(h.left=!0),_[c].nested&&(h.nested=!0),_[c].right&&(h.right=!0),_[c].empty&&(h.empty=!0),_[c].finite&&(h.finite=!0),_[c].cyclic&&(h.cyclic=!0)}o(O,"alt");function T(E,l,g,h){let c=l[g];c.index>=E.ruleCount?(h.empty=E.udts[c.index-E.ruleCount].empty,h.finite=!0):($(E,c.index,h),h.left=!1,h.nested=!1,h.right=!1,h.cyclic=!1)}o(T,"bkr");function C(E,l,g,h){E.attrInit(h);let c=l[g];switch(c.type){case e.ALT:O(E,l,g,h);break;case e.CAT:k(E,l,g,h);break;case e.REP:C(E,l,g+1,h),c.min===0&&(h.empty=!0,h.finite=!0);break;case e.RNM:$(E,l[g].index,h);break;case e.BKR:T(E,l,g,h);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:C(E,l,g+1,h),h.empty=!0;break;case e.TLS:h.empty=!l[g].string.length,h.finite=!0,h.cyclic=!1;break;case e.TBS:case e.TRG:h.empty=!1,h.finite=!0,h.cyclic=!1;break;case e.UDT:h.empty=c.empty,h.finite=!0,h.cyclic=!1;break;case e.ABG:case e.AEN:h.empty=!0,h.finite=!0,h.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${c}`)}}o(C,"opEval");function $(E,l,g){let h=E.attrsWorking[l];h.isComplete?E.attrCopy(g,h):h.isOpen?l===E.startRule?l===E.startRule&&(g.left=!0,g.right=!0,g.cyclic=!0,g.leaf=!0):g.finite=!0:(h.isOpen=!0,C(E,h.rule.opcodes,0,g),h.left=g.left,h.right=g.right,h.nested=g.nested,h.empty=g.empty,h.finite=g.finite,h.cyclic=g.cyclic,h.leaf=!1,h.isOpen=!1,h.isComplete=!0)}o($,"ruleAttrsEval");let I=o(E=>{n=E;let l=0,g=0,h=n.attrGen();for(l=0;l<n.ruleCount;l+=1){for(g=0;g<n.ruleCount;g+=1)n.attrInit(n.attrsWorking[g]);n.startRule=l,$(n,l,h),n.attrCopy(n.attrs[l],n.attrsWorking[l])}n.attributesComplete=!0;let c=null;for(l=0;l<n.ruleCount;l+=1)if(c=n.attrs[l],c.left||!c.finite||c.cyclic){let d=n.attrGen(c.rule);n.attrCopy(d,c),n.attrsErrors.push(d),n.attrsErrorCount+=1}},"ruleAttributes"),U=o(E=>E?"t":"f","truth"),z=o(E=>E?"e":"f","tError"),H=o(E=>E?"t":"e","fError"),X=o((E,l,g,h)=>{let c=`${E}:${l}:`;return c+=`${z(g.left)} `,c+=`${U(g.nested)} `,c+=`${U(g.right)} `,c+=`${z(g.cyclic)} `,c+=`${H(g.finite)} `,c+=`${U(g.empty)}:`,c+=`${n.typeToString(h.recursiveType)}:`,c+=h.recursiveType===e.ATTR_MR?h.groupNumber:"-",c+=`:${g.rule.name}
554
+ `,O+=R}),O+=`
555
+ `,O+=` /* OPCODES */
556
+ `,T.forEach((J,N)=>{N>0&&(O+=`
557
+ `),O+=` /* ${J.name} */
558
+ `,O+=` this.rules[${N}].opcodes = [];
559
+ `,J.opcodes.forEach((R,V)=>{let W;switch(R.type){case n.ALT:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, children: [${R.children.toString()}]};// ALT
560
+ `;break;case n.CAT:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, children: [${R.children.toString()}]};// CAT
561
+ `;break;case n.RNM:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, index: ${R.index}};// RNM(${T[R.index].name})
562
+ `;break;case n.BKR:R.index>=T.length?(j=C[R.index-T.length].name,H=C[R.index-T.length].lower):(j=T[R.index].name,H=T[R.index].lower),W="%i",R.bkrCase===n.BKR_MODE_CS&&(W="%s"),R.bkrMode===n.BKR_MODE_UM?W+="%u":W+="%p",j=W+j,O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, index: ${R.index}, lower: '${H}', bkrCase: ${R.bkrCase}, bkrMode: ${R.bkrMode}};// BKR(\\${j})
563
+ `;break;case n.UDT:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, empty: ${R.empty}, index: ${R.index}};// UDT(${C[R.index].name})
564
+ `;break;case n.REP:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, min: ${R.min}, max: ${R.max}};// REP
565
+ `;break;case n.AND:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// AND
566
+ `;break;case n.NOT:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// NOT
567
+ `;break;case n.ABG:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// ABG(%^)
568
+ `;break;case n.AEN:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// AEN(%$)
569
+ `;break;case n.BKA:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// BKA
570
+ `;break;case n.BKN:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}};// BKN
571
+ `;break;case n.TLS:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, string: [${R.string.toString()}]};// TLS
572
+ `;break;case n.TBS:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, string: [${R.string.toString()}]};// TBS
573
+ `;break;case n.TRG:O+=` this.rules[${N}].opcodes[${V}] = {type: ${R.type}, min: ${R.min}, max: ${R.max}};// TRG
574
+ `;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),O+=`
575
+ `,O+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",O+=` this.toString = function toString(){
576
+ `,O+=` let str = "";
577
+ `;let K;return I.forEach(J=>{let N=J.beginChar+J.length;K="",O+=' str += "';for(let R=J.beginChar;R<N;R+=1){switch(k[R]){case 9:K=" ";break;case 10:K="\\n";break;case 13:K="\\r";break;case 34:K='\\"';break;case 92:K="\\\\";break;default:K=String.fromCharCode(k[R]);break}O+=K}O+=`";
578
+ `}),O+=` return str;
579
+ `,O+=` }
580
+ `,O+=`}
581
+ `,O},"generateSource"),this.generateObject=o(function(k,I,T){let C={},$=[],O=[],U=k.slice(0);return C.grammarObject="grammarObject",I.forEach(j=>{$.push(j.lower)}),$.sort(),T.length>0&&(T.forEach(j=>{O.push(j.lower)}),O.sort()),C.callbacks=[],$.forEach(j=>{C.callbacks[j]=!1}),T.length>0&&O.forEach(j=>{C.callbacks[j]=!1}),C.rules=I,C.udts=T,C.toString=o(function(){return U},"toStringFunc"),C},"generateObject")},"exportParser")});var iy=me((VL,ny)=>{ny.exports=o(function(){let e=Tn(),t="rule-attributes.js",n=null;function i(E){return E.left||E.nested||E.right||E.cyclic?!1:E.empty}o(i,"isEmptyOnly");function s(E){return!!(E.left||E.nested||E.right||E.cyclic)}o(s,"isRecursive");function a(E,l){let g=0,h=0,c=0;for(g=0;g<l;g+=1)if(E[g].nested)return!0;for(g=0;g<l;g+=1)if(E[g].right&&!E[g].leaf){for(h=g+1;h<l;h+=1)if(!i(E[h]))return!0}for(g=l-1;g>=0;g-=1)if(E[g].left&&!E[g].leaf){for(h=g-1;h>=0;h-=1)if(!i(E[h]))return!0}for(g=0;g<l;g+=1)if(!E[g].empty&&!s(E[g])){for(h=g+1;h<l;h+=1)if(s(E[h])){for(c=h+1;c<l;c+=1)if(!E[c].empty&&!s(E[c]))return!0}}return!1}o(a,"isCatNested");function f(E,l){for(let g=0;g<l;g+=1)if(!E[g].cyclic)return!1;return!0}o(f,"isCatCyclic");function u(E,l){for(let g=0;g<l;g+=1){if(E[g].left)return!0;if(!E[g].empty)return!1}return!1}o(u,"isCatLeft");function m(E,l){for(let g=l-1;g>=0;g-=1){if(E[g].right)return!0;if(!E[g].empty)return!1}return!1}o(m,"isCatRight");function p(E,l){for(let g=0;g<l;g+=1)if(!E[g].empty)return!1;return!0}o(p,"isCatEmpty");function x(E,l){for(let g=0;g<l;g+=1)if(!E[g].finite)return!1;return!0}o(x,"isCatFinite");function k(E,l,g,h){let c=0,d=l[g],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(E.attrGen());for(c=0;c<y;c+=1)C(E,l,d.children[c],_[c]);h.left=u(_,y),h.right=m(_,y),h.nested=a(_,y),h.empty=p(_,y),h.finite=x(_,y),h.cyclic=f(_,y)}o(k,"cat");function I(E,l,g,h){let c=0,d=l[g],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(E.attrGen());for(c=0;c<y;c+=1)C(E,l,d.children[c],_[c]);for(h.left=!1,h.right=!1,h.nested=!1,h.empty=!1,h.finite=!1,h.cyclic=!1,c=0;c<y;c+=1)_[c].left&&(h.left=!0),_[c].nested&&(h.nested=!0),_[c].right&&(h.right=!0),_[c].empty&&(h.empty=!0),_[c].finite&&(h.finite=!0),_[c].cyclic&&(h.cyclic=!0)}o(I,"alt");function T(E,l,g,h){let c=l[g];c.index>=E.ruleCount?(h.empty=E.udts[c.index-E.ruleCount].empty,h.finite=!0):($(E,c.index,h),h.left=!1,h.nested=!1,h.right=!1,h.cyclic=!1)}o(T,"bkr");function C(E,l,g,h){E.attrInit(h);let c=l[g];switch(c.type){case e.ALT:I(E,l,g,h);break;case e.CAT:k(E,l,g,h);break;case e.REP:C(E,l,g+1,h),c.min===0&&(h.empty=!0,h.finite=!0);break;case e.RNM:$(E,l[g].index,h);break;case e.BKR:T(E,l,g,h);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:C(E,l,g+1,h),h.empty=!0;break;case e.TLS:h.empty=!l[g].string.length,h.finite=!0,h.cyclic=!1;break;case e.TBS:case e.TRG:h.empty=!1,h.finite=!0,h.cyclic=!1;break;case e.UDT:h.empty=c.empty,h.finite=!0,h.cyclic=!1;break;case e.ABG:case e.AEN:h.empty=!0,h.finite=!0,h.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${c}`)}}o(C,"opEval");function $(E,l,g){let h=E.attrsWorking[l];h.isComplete?E.attrCopy(g,h):h.isOpen?l===E.startRule?l===E.startRule&&(g.left=!0,g.right=!0,g.cyclic=!0,g.leaf=!0):g.finite=!0:(h.isOpen=!0,C(E,h.rule.opcodes,0,g),h.left=g.left,h.right=g.right,h.nested=g.nested,h.empty=g.empty,h.finite=g.finite,h.cyclic=g.cyclic,h.leaf=!1,h.isOpen=!1,h.isComplete=!0)}o($,"ruleAttrsEval");let O=o(E=>{n=E;let l=0,g=0,h=n.attrGen();for(l=0;l<n.ruleCount;l+=1){for(g=0;g<n.ruleCount;g+=1)n.attrInit(n.attrsWorking[g]);n.startRule=l,$(n,l,h),n.attrCopy(n.attrs[l],n.attrsWorking[l])}n.attributesComplete=!0;let c=null;for(l=0;l<n.ruleCount;l+=1)if(c=n.attrs[l],c.left||!c.finite||c.cyclic){let d=n.attrGen(c.rule);n.attrCopy(d,c),n.attrsErrors.push(d),n.attrsErrorCount+=1}},"ruleAttributes"),U=o(E=>E?"t":"f","truth"),j=o(E=>E?"e":"f","tError"),H=o(E=>E?"t":"e","fError"),X=o((E,l,g,h)=>{let c=`${E}:${l}:`;return c+=`${j(g.left)} `,c+=`${U(g.nested)} `,c+=`${U(g.right)} `,c+=`${j(g.cyclic)} `,c+=`${H(g.finite)} `,c+=`${U(g.empty)}:`,c+=`${n.typeToString(h.recursiveType)}:`,c+=h.recursiveType===e.ATTR_MR?h.groupNumber:"-",c+=`:${g.rule.name}
582
582
  `,c},"showAttr"),B=o(()=>{let E=`LEGEND - t=true, f=false, e=error
583
583
  `;return E+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
584
584
  `,E},"showLegend"),L=o(()=>{let E=null,l=null,g="";if(g+=`RULE ATTRIBUTES WITH ERRORS
585
585
  `,g+=B(),n.attrsErrorCount)for(let h=0;h<n.attrsErrorCount;h+=1)E=n.attrsErrors[h],l=n.ruleDeps[E.rule.index],g+=X(h,E.rule.index,E,l);else g+=`<none>
586
- `;return g},"showAttributeErrors"),F=o(E=>{let l=0,g=0,h=null,c=null,d="",{ruleIndexes:y}=n;for(E===97?y=n.ruleAlphaIndexes:E===116&&(y=n.ruleTypeIndexes),l=0;l<n.ruleCount;l+=1)g=y[l],h=n.attrs[g],c=n.ruleDeps[g],d+=X(l,g,h,c);return d},"show");return{ruleAttributes:I,showAttributes:o((E="index")=>{if(!n.attributesComplete)throw new Error(`${t}:showAttributes: attributes not available`);let l="",g=`RULE ATTRIBUTES
586
+ `;return g},"showAttributeErrors"),F=o(E=>{let l=0,g=0,h=null,c=null,d="",{ruleIndexes:y}=n;for(E===97?y=n.ruleAlphaIndexes:E===116&&(y=n.ruleTypeIndexes),l=0;l<n.ruleCount;l+=1)g=y[l],h=n.attrs[g],c=n.ruleDeps[g],d+=X(l,g,h,c);return d},"show");return{ruleAttributes:O,showAttributes:o((E="index")=>{if(!n.attributesComplete)throw new Error(`${t}:showAttributes: attributes not available`);let l="",g=`RULE ATTRIBUTES
587
587
  `;return E.charCodeAt(0)===97?(l+=`alphabetical by rule name
588
588
  `,l+=g,l+=B(),l+=F(97)):E.charCodeAt(0)===116?(l+=`ordered by rule type
589
589
  `,l+=g,l+=B(),l+=F(116)):(l+=`ordered by rule index
590
- `,l+=g,l+=B(),l+=F()),l},"showAttributes"),showAttributeErrors:L}},"exportRuleAttributes")()});var sy=me((jL,oy)=>{oy.exports=(()=>{let r=Tn(),e=null,t=o((a,f,u,m)=>{let p=0,x=0,k=f[u];m[u]=!0;let O=k.rule.opcodes;for(p=0;p<O.length;p+=1){let T=O[p];if(T.type===r.RNM)for(k.refersTo[T.index]=!0,m[T.index]||t(a,f,T.index,m),x=0;x<a;x+=1)f[T.index].refersTo[x]&&(k.refersTo[x]=!0);else T.type===r.UDT?k.refersToUdt[T.index]=!0:T.type===r.BKR&&(T.index<a?(k.refersTo[T.index]=!0,m[T.index]||t(a,f,T.index,m)):k.refersToUdt[a-T.index]=!0)}},"scan"),n=o(a=>{e=a;let f=0,u=0,m=0,p=null,x=null,k=!1;e.dependenciesComplete=!1;let O=e.falseArray(e.ruleCount);for(f=0;f<e.ruleCount;f+=1)e.falsifyArray(O),t(e.ruleCount,e.ruleDeps,f,O);for(f=0;f<e.ruleCount;f+=1)for(u=0;u<e.ruleCount;u+=1)f!==u&&e.ruleDeps[u].refersTo[f]&&(e.ruleDeps[f].referencedBy[u]=!0);for(f=0;f<e.ruleCount;f+=1)e.ruleDeps[f].recursiveType=r.ATTR_N,e.ruleDeps[f].refersTo[f]&&(e.ruleDeps[f].recursiveType=r.ATTR_R);for(m=-1,f=0;f<e.ruleCount;f+=1)if(p=e.ruleDeps[f],p.recursiveType===r.ATTR_R)for(k=!0,u=0;u<e.ruleCount;u+=1)f!==u&&(x=e.ruleDeps[u],x.recursiveType===r.ATTR_R&&p.refersTo[u]&&x.refersTo[f]&&(k&&(m+=1,p.recursiveType=r.ATTR_MR,p.groupNumber=m,k=!1),x.recursiveType=r.ATTR_MR,x.groupNumber=m));e.isMutuallyRecursive=m>-1,e.ruleAlphaIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesType),e.isMutuallyRecursive&&e.ruleTypeIndexes.sort(e.compRulesGroup),e.udtCount&&e.udtAlphaIndexes.sort(e.compUdtsAlpha),e.dependenciesComplete=!0},"ruleDependencies"),i=o((a=null)=>{let f=0,u=0,m=0,p=0,x=e.ruleCount-1,k=e.udtCount-1,O=100,T="",C="",$="=> ",I="<= ",U=!1,z=null,{ruleIndexes:H}=e,{udtIndexes:X}=e;for(a===97?(H=e.ruleAlphaIndexes,X=e.udtAlphaIndexes):a===116&&(H=e.ruleTypeIndexes,X=e.udtAlphaIndexes),f=0;f<e.ruleCount;f+=1){for(z=e.ruleDeps[H[f]],C=`${H[f]}:${e.typeToString(z.recursiveType)}:`,e.isMutuallyRecursive&&(C+=z.groupNumber>-1?z.groupNumber:"-",C+=":"),C+=" ",T+=`${C+e.rules[H[f]].name}
591
- `,U=!0,m=0,p=T.length,T+=C,u=0;u<e.ruleCount;u+=1)z.refersTo[H[u]]&&(U?(T+=$,U=!1,T+=e.ruleDeps[H[u]].rule.name):T+=`, ${e.ruleDeps[H[u]].rule.name}`,m+=1),T.length-p>O&&u!==x&&(T+=`
592
- ${C}${$}`,p=T.length);if(e.udtCount)for(u=0;u<e.udtCount;u+=1)z.refersToUdt[X[u]]&&(U?(T+=$,U=!1,T+=e.udts[X[u]].name):T+=`, ${e.udts[X[u]].name}`,m+=1),T.length-p>O&&u!==k&&(T+=`
590
+ `,l+=g,l+=B(),l+=F()),l},"showAttributes"),showAttributeErrors:L}},"exportRuleAttributes")()});var sy=me((WL,oy)=>{oy.exports=(()=>{let r=Tn(),e=null,t=o((a,f,u,m)=>{let p=0,x=0,k=f[u];m[u]=!0;let I=k.rule.opcodes;for(p=0;p<I.length;p+=1){let T=I[p];if(T.type===r.RNM)for(k.refersTo[T.index]=!0,m[T.index]||t(a,f,T.index,m),x=0;x<a;x+=1)f[T.index].refersTo[x]&&(k.refersTo[x]=!0);else T.type===r.UDT?k.refersToUdt[T.index]=!0:T.type===r.BKR&&(T.index<a?(k.refersTo[T.index]=!0,m[T.index]||t(a,f,T.index,m)):k.refersToUdt[a-T.index]=!0)}},"scan"),n=o(a=>{e=a;let f=0,u=0,m=0,p=null,x=null,k=!1;e.dependenciesComplete=!1;let I=e.falseArray(e.ruleCount);for(f=0;f<e.ruleCount;f+=1)e.falsifyArray(I),t(e.ruleCount,e.ruleDeps,f,I);for(f=0;f<e.ruleCount;f+=1)for(u=0;u<e.ruleCount;u+=1)f!==u&&e.ruleDeps[u].refersTo[f]&&(e.ruleDeps[f].referencedBy[u]=!0);for(f=0;f<e.ruleCount;f+=1)e.ruleDeps[f].recursiveType=r.ATTR_N,e.ruleDeps[f].refersTo[f]&&(e.ruleDeps[f].recursiveType=r.ATTR_R);for(m=-1,f=0;f<e.ruleCount;f+=1)if(p=e.ruleDeps[f],p.recursiveType===r.ATTR_R)for(k=!0,u=0;u<e.ruleCount;u+=1)f!==u&&(x=e.ruleDeps[u],x.recursiveType===r.ATTR_R&&p.refersTo[u]&&x.refersTo[f]&&(k&&(m+=1,p.recursiveType=r.ATTR_MR,p.groupNumber=m,k=!1),x.recursiveType=r.ATTR_MR,x.groupNumber=m));e.isMutuallyRecursive=m>-1,e.ruleAlphaIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesType),e.isMutuallyRecursive&&e.ruleTypeIndexes.sort(e.compRulesGroup),e.udtCount&&e.udtAlphaIndexes.sort(e.compUdtsAlpha),e.dependenciesComplete=!0},"ruleDependencies"),i=o((a=null)=>{let f=0,u=0,m=0,p=0,x=e.ruleCount-1,k=e.udtCount-1,I=100,T="",C="",$="=> ",O="<= ",U=!1,j=null,{ruleIndexes:H}=e,{udtIndexes:X}=e;for(a===97?(H=e.ruleAlphaIndexes,X=e.udtAlphaIndexes):a===116&&(H=e.ruleTypeIndexes,X=e.udtAlphaIndexes),f=0;f<e.ruleCount;f+=1){for(j=e.ruleDeps[H[f]],C=`${H[f]}:${e.typeToString(j.recursiveType)}:`,e.isMutuallyRecursive&&(C+=j.groupNumber>-1?j.groupNumber:"-",C+=":"),C+=" ",T+=`${C+e.rules[H[f]].name}
591
+ `,U=!0,m=0,p=T.length,T+=C,u=0;u<e.ruleCount;u+=1)j.refersTo[H[u]]&&(U?(T+=$,U=!1,T+=e.ruleDeps[H[u]].rule.name):T+=`, ${e.ruleDeps[H[u]].rule.name}`,m+=1),T.length-p>I&&u!==x&&(T+=`
592
+ ${C}${$}`,p=T.length);if(e.udtCount)for(u=0;u<e.udtCount;u+=1)j.refersToUdt[X[u]]&&(U?(T+=$,U=!1,T+=e.udts[X[u]].name):T+=`, ${e.udts[X[u]].name}`,m+=1),T.length-p>I&&u!==k&&(T+=`
593
593
  ${C}${$}`,p=T.length);for(m===0&&(T+=`=> <none>
594
594
  `),U===!1&&(T+=`
595
- `),U=!0,m=0,p=T.length,T+=C,u=0;u<e.ruleCount;u+=1)z.referencedBy[H[u]]&&(U?(T+=I,U=!1,T+=e.ruleDeps[H[u]].rule.name):T+=`, ${e.ruleDeps[H[u]].rule.name}`,m+=1),T.length-p>O&&u!==x&&(T+=`
595
+ `),U=!0,m=0,p=T.length,T+=C,u=0;u<e.ruleCount;u+=1)j.referencedBy[H[u]]&&(U?(T+=O,U=!1,T+=e.ruleDeps[H[u]].rule.name):T+=`, ${e.ruleDeps[H[u]].rule.name}`,m+=1),T.length-p>I&&u!==x&&(T+=`
596
596
  ${C}${$}`,p=T.length);m===0&&(T+=`<= <none>
597
597
  `),U===!1&&(T+=`
598
598
  `),T+=`
@@ -602,35 +602,35 @@ ${C}${$}`,p=T.length);m===0&&(T+=`<= <none>
602
602
  `,e.dependenciesComplete&&(a.charCodeAt(0)===97?(f+=`alphabetical by rule name
603
603
  `,f+=i(97)):a.charCodeAt(0)===116?(f+=`ordered by rule type
604
604
  `,f+=i(116)):(f+=`ordered by rule index
605
- `,f+=i(null))),f},"showRuleDependencies")}})()});var fy=me((zL,ay)=>{ay.exports=o(function(){let e=Tn(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=iy(),{ruleDependencies:s,showRuleDependencies:a}=sy();class f{constructor(p,x){this.rules=p,this.udts=x,this.ruleCount=p.length,this.udtCount=x.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let k=0;k<this.ruleCount;k+=1)this.attrs.push(this.attrGen(this.rules[k])),this.attrsWorking.push(this.attrGen(this.rules[k])),this.ruleDeps.push(this.rdGen(p[k],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(p){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:p}}attrInit(p){p.left=!1,p.nested=!1,p.right=!1,p.empty=!1,p.finite=!1,p.cyclic=!1,p.leaf=!1,p.isOpen=!1,p.isComplete=!1}attrCopy(p,x){p.left=x.left,p.nested=x.nested,p.right=x.right,p.empty=x.empty,p.finite=x.finite,p.cyclic=x.cyclic,p.leaf=x.leaf,p.isOpen=x.isOpen,p.isComplete=x.isComplete,p.rule=x.rule}rdGen(p,x,k){return{rule:p,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(x),refersToUdt:this.falseArray(k),referencedBy:this.falseArray(x)}}typeToString(p){switch(p){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(p){let x=[];if(p>0)for(let k=0;k<p;k+=1)x.push(!1);return x}falsifyArray(p){for(let x=0;x<p.length;x+=1)p[x]=!1}indexArray(p){let x=[];if(p>0)for(let k=0;k<p;k+=1)x.push(k);return x}compRulesAlpha(p,x){return this.rules[p].lower<this.rules[x].lower?-1:this.rules[p].lower>this.rules[x].lower?1:0}compUdtsAlpha(p,x){return this.udts[p].lower<this.udts[x].lower?-1:this.udts[p].lower>this.udts[x].lower?1:0}compRulesType(p,x){return this.ruleDeps[p].recursiveType<this.ruleDeps[x].recursiveType?-1:this.ruleDeps[p].recursiveType>this.ruleDeps[x].recursiveType?1:0}compRulesGroup(p,x){if(this.ruleDeps[p].recursiveType===e.ATTR_MR&&this.ruleDeps[x].recursiveType===e.ATTR_MR){if(this.ruleDeps[p].groupNumber<this.ruleDeps[x].groupNumber)return-1;if(this.ruleDeps[p].groupNumber>this.ruleDeps[x].groupNumber)return 1}return 0}}return o(f,"State"),{attributes:o(function(p=[],x=[],k=[],O=[]){let T=new f(p,x);return s(T),t(T),T.attrsErrorCount&&O.push({line:0,char:0,msg:`${T.attrsErrorCount} attribute errors`}),T.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:a}},"exportAttributes")()});var uy=me((KL,cy)=>{cy.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],a="index"){let f="showRules",u=[],m=[],p=[],x=[],k=i,O=s,T=i.length,C=s.length,$="RULE/UDT NAMES",I;function U(H,X){return k[H].lower<k[X].lower?-1:k[H].lower>k[X].lower?1:0}o(U,"compRulesAlpha");function z(H,X){return O[H].lower<O[X].lower?-1:O[H].lower>O[X].lower?1:0}if(o(z,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${f}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${f}: udts arg must be array`);for(I=0;I<T;I+=1)p.push(I);if(u=p.slice(0),u.sort(U),C){for(I=0;I<C;I+=1)x.push(I);m=x.slice(0),m.sort(z)}if(a.charCodeAt(0)===97){for($+=` - alphabetical by rule/UDT name
606
- `,I=0;I<T;I+=1)$+=`${I}: ${u[I]}: ${k[u[I]].name}
607
- `;if(C)for(I=0;I<C;I+=1)$+=`${I}: ${m[I]}: ${O[m[I]].name}
605
+ `,f+=i(null))),f},"showRuleDependencies")}})()});var fy=me((GL,ay)=>{ay.exports=o(function(){let e=Tn(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=iy(),{ruleDependencies:s,showRuleDependencies:a}=sy();class f{constructor(p,x){this.rules=p,this.udts=x,this.ruleCount=p.length,this.udtCount=x.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let k=0;k<this.ruleCount;k+=1)this.attrs.push(this.attrGen(this.rules[k])),this.attrsWorking.push(this.attrGen(this.rules[k])),this.ruleDeps.push(this.rdGen(p[k],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(p){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:p}}attrInit(p){p.left=!1,p.nested=!1,p.right=!1,p.empty=!1,p.finite=!1,p.cyclic=!1,p.leaf=!1,p.isOpen=!1,p.isComplete=!1}attrCopy(p,x){p.left=x.left,p.nested=x.nested,p.right=x.right,p.empty=x.empty,p.finite=x.finite,p.cyclic=x.cyclic,p.leaf=x.leaf,p.isOpen=x.isOpen,p.isComplete=x.isComplete,p.rule=x.rule}rdGen(p,x,k){return{rule:p,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(x),refersToUdt:this.falseArray(k),referencedBy:this.falseArray(x)}}typeToString(p){switch(p){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(p){let x=[];if(p>0)for(let k=0;k<p;k+=1)x.push(!1);return x}falsifyArray(p){for(let x=0;x<p.length;x+=1)p[x]=!1}indexArray(p){let x=[];if(p>0)for(let k=0;k<p;k+=1)x.push(k);return x}compRulesAlpha(p,x){return this.rules[p].lower<this.rules[x].lower?-1:this.rules[p].lower>this.rules[x].lower?1:0}compUdtsAlpha(p,x){return this.udts[p].lower<this.udts[x].lower?-1:this.udts[p].lower>this.udts[x].lower?1:0}compRulesType(p,x){return this.ruleDeps[p].recursiveType<this.ruleDeps[x].recursiveType?-1:this.ruleDeps[p].recursiveType>this.ruleDeps[x].recursiveType?1:0}compRulesGroup(p,x){if(this.ruleDeps[p].recursiveType===e.ATTR_MR&&this.ruleDeps[x].recursiveType===e.ATTR_MR){if(this.ruleDeps[p].groupNumber<this.ruleDeps[x].groupNumber)return-1;if(this.ruleDeps[p].groupNumber>this.ruleDeps[x].groupNumber)return 1}return 0}}return o(f,"State"),{attributes:o(function(p=[],x=[],k=[],I=[]){let T=new f(p,x);return s(T),t(T),T.attrsErrorCount&&I.push({line:0,char:0,msg:`${T.attrsErrorCount} attribute errors`}),T.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:a}},"exportAttributes")()});var uy=me((YL,cy)=>{cy.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],a="index"){let f="showRules",u=[],m=[],p=[],x=[],k=i,I=s,T=i.length,C=s.length,$="RULE/UDT NAMES",O;function U(H,X){return k[H].lower<k[X].lower?-1:k[H].lower>k[X].lower?1:0}o(U,"compRulesAlpha");function j(H,X){return I[H].lower<I[X].lower?-1:I[H].lower>I[X].lower?1:0}if(o(j,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${f}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${f}: udts arg must be array`);for(O=0;O<T;O+=1)p.push(O);if(u=p.slice(0),u.sort(U),C){for(O=0;O<C;O+=1)x.push(O);m=x.slice(0),m.sort(j)}if(a.charCodeAt(0)===97){for($+=` - alphabetical by rule/UDT name
606
+ `,O=0;O<T;O+=1)$+=`${O}: ${u[O]}: ${k[u[O]].name}
607
+ `;if(C)for(O=0;O<C;O+=1)$+=`${O}: ${m[O]}: ${I[m[O]].name}
608
608
  `}else{for($+=` - ordered by rule/UDT index
609
- `,I=0;I<T;I+=1)$+=`${I}: ${k[I].name}
610
- `;if(C)for(I=0;I<C;I+=1)$+=`${I}: ${O[I].name}
611
- `}return $},"showRules")},"exfn")()});var dy=me((VL,ly)=>{ly.exports=o(function(e){let t="api.js: ",n=this,i=fs(),s=y0(),a=G2(),f=new(ry()),{attributes:u,showAttributes:m,showAttributeErrors:p,showRuleDependencies:x}=fy(),k=uy(),O=o(function(E,l,g){let y=`<span class="${i.style.CLASS_CTRLCHAR}">`,_="</span>",w=`<span class="${i.style.CLASS_NOMATCH}">`,b="</span>",S,D="",v=!0;for(;v&&!(!Array.isArray(E)||E.length===0);){if(typeof l!="number")throw new Error("abnfToHtml: beg must be type number");if(l>=E.length)break;typeof g!="number"||l+g>=E.length?S=E.length:S=l+g;let M=0;for(let ne=l;ne<S;ne+=1){let A=E[ne];if(A>=32&&A<=126)switch(M===1?(D+=_,M=0):M===2&&(D+=b,M=0),A){case 32:D+="&nbsp;";break;case 60:D+="&lt;";break;case 62:D+="&gt;";break;case 38:D+="&amp;";break;case 34:D+="&quot;";break;case 39:D+="&#039;";break;case 92:D+="&#092;";break;default:D+=String.fromCharCode(A);break}else A===9||A===10||A===13?(M===0?(D+=y,M=1):M===2&&(D+=b+y,M=1),A===9&&(D+="TAB"),A===10&&(D+="LF"),A===13&&(D+="CR")):(M===0?(D+=w,M=2):M===1&&(D+=_+w,M=2),D+=`\\x${i.utils.charToHex(A)}`)}M===2&&(D+=b),M===1&&(D+=_);break}return D},"abnfToHtml"),T=o(function(E,l,g){let h="";for(let c=l;c<l+g;c+=1){let d=E[c];if(d>=32&&d<=126)h+=String.fromCharCode(d);else switch(d){case 9:h+="\\t";break;case 10:h+="\\n";break;case 13:h+="\\r";break;default:h+="\\unknown";break}}return h},"abnfToAscii"),C=o(function(E){let l="Annotated Input Grammar";return E.forEach(g=>{l+=`
609
+ `,O=0;O<T;O+=1)$+=`${O}: ${k[O].name}
610
+ `;if(C)for(O=0;O<C;O+=1)$+=`${O}: ${I[O].name}
611
+ `}return $},"showRules")},"exfn")()});var dy=me((JL,ly)=>{ly.exports=o(function(e){let t="api.js: ",n=this,i=fs(),s=y0(),a=G2(),f=new(ry()),{attributes:u,showAttributes:m,showAttributeErrors:p,showRuleDependencies:x}=fy(),k=uy(),I=o(function(E,l,g){let y=`<span class="${i.style.CLASS_CTRLCHAR}">`,_="</span>",w=`<span class="${i.style.CLASS_NOMATCH}">`,b="</span>",S,D="",v=!0;for(;v&&!(!Array.isArray(E)||E.length===0);){if(typeof l!="number")throw new Error("abnfToHtml: beg must be type number");if(l>=E.length)break;typeof g!="number"||l+g>=E.length?S=E.length:S=l+g;let M=0;for(let ne=l;ne<S;ne+=1){let A=E[ne];if(A>=32&&A<=126)switch(M===1?(D+=_,M=0):M===2&&(D+=b,M=0),A){case 32:D+="&nbsp;";break;case 60:D+="&lt;";break;case 62:D+="&gt;";break;case 38:D+="&amp;";break;case 34:D+="&quot;";break;case 39:D+="&#039;";break;case 92:D+="&#092;";break;default:D+=String.fromCharCode(A);break}else A===9||A===10||A===13?(M===0?(D+=y,M=1):M===2&&(D+=b+y,M=1),A===9&&(D+="TAB"),A===10&&(D+="LF"),A===13&&(D+="CR")):(M===0?(D+=w,M=2):M===1&&(D+=_+w,M=2),D+=`\\x${i.utils.charToHex(A)}`)}M===2&&(D+=b),M===1&&(D+=_);break}return D},"abnfToHtml"),T=o(function(E,l,g){let h="";for(let c=l;c<l+g;c+=1){let d=E[c];if(d>=32&&d<=126)h+=String.fromCharCode(d);else switch(d){case 9:h+="\\t";break;case 10:h+="\\n";break;case 13:h+="\\r";break;default:h+="\\unknown";break}}return h},"abnfToAscii"),C=o(function(E){let l="Annotated Input Grammar";return E.forEach(g=>{l+=`
612
612
  `,l+=`line no: ${g.lineNo}`,l+=` : char index: ${g.beginChar}`,l+=` : length: ${g.length}`,l+=` : abnf: ${T(n.chars,g.beginChar,g.length)}`}),l+=`
613
613
  `,l},"linesToAscii"),$=o(function(E){let l="";return l+=`<table class="${i.style.CLASS_GRAMMAR}">
614
614
  `,l+=`<caption>Annotated Input Grammar</caption>
615
615
  `,l+="<tr>",l+="<th>line<br>no.</th><th>first<br>char</th><th><br>length</th><th><br>text</th>",l+=`</tr>
616
- `,E.forEach(h=>{l+="<tr>",l+=`<td>${h.lineNo}`,l+=`</td><td>${h.beginChar}`,l+=`</td><td>${h.length}`,l+=`</td><td>${O(n.chars,h.beginChar,h.length)}`,l+="</td>",l+=`</tr>
616
+ `,E.forEach(h=>{l+="<tr>",l+=`<td>${h.lineNo}`,l+=`</td><td>${h.beginChar}`,l+=`</td><td>${h.length}`,l+=`</td><td>${I(n.chars,h.beginChar,h.length)}`,l+="</td>",l+=`</tr>
617
617
  `}),l+=`</table>
618
- `,l},"linesToHtml"),I=o(function(E,l,g,h){let[c]=i,d="",y=`<span class="${c.CLASS_NOMATCH}">&raquo;</span>`;return d+=`<p><table class="${c.CLASS_GRAMMAR}">
618
+ `,l},"linesToHtml"),O=o(function(E,l,g,h){let[c]=i,d="",y=`<span class="${c.CLASS_NOMATCH}">&raquo;</span>`;return d+=`<p><table class="${c.CLASS_GRAMMAR}">
619
619
  `,h&&typeof h=="string"&&(d+=`<caption>${h}</caption>
620
620
  `),d+=`<tr><th>line<br>no.</th><th>line<br>offset</th><th>error<br>offset</th><th><br>text</th></tr>
621
- `,E.forEach(_=>{let w,b,S,D,v,M="",ne="";l.length===0?(v=y,b=0):(w=l[_.line],S=w.beginChar,_.char>S&&(M=O(g,S,_.char-S)),S=_.char,D=w.beginChar+w.length,S<D&&(ne=O(g,S,D-S)),v=M+y+ne,b=_.char-w.beginChar,d+="<tr>",d+=`<td>${_.line}</td><td>${w.beginChar}</td><td>${b}</td><td>${v}</td>`,d+=`</tr>
621
+ `,E.forEach(_=>{let w,b,S,D,v,M="",ne="";l.length===0?(v=y,b=0):(w=l[_.line],S=w.beginChar,_.char>S&&(M=I(g,S,_.char-S)),S=_.char,D=w.beginChar+w.length,S<D&&(ne=I(g,S,D-S)),v=M+y+ne,b=_.char-w.beginChar,d+="<tr>",d+=`<td>${_.line}</td><td>${w.beginChar}</td><td>${b}</td><td>${v}</td>`,d+=`</tr>
622
622
  `,d+="<tr>",d+=`<td colspan="3"></td><td>&uarr;:&nbsp;${i.utils.stringToAsciiHtml(_.msg)}</td>`,d+=`</tr>
623
623
  `)}),d+=`</table></p>
624
624
  `,d},"errorsToHtml"),U=o(function(E,l,g){let h,c,d,y;return h="",E.forEach(_=>{c=l[_.line],h+=`${c.lineNo}: `,h+=`${c.beginChar}: `,h+=`${_.char-c.beginChar}: `,d=c.beginChar,y=_.char-c.beginChar,h+=T(g,d,y),h+=" >> ",d=_.char,y=c.beginChar+c.length-_.char,h+=T(g,d,y),h+=`
625
625
  `,h+=`${c.lineNo}: `,h+=`${c.beginChar}: `,h+=`${_.char-c.beginChar}: `,h+="error: ",h+=_.msg,h+=`
626
- `}),h},"errorsToAscii"),z=!1,H=!1,X=!1,B=!1,L=0,F;if(this.errors=[],Buffer.isBuffer(e))this.chars=s.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=s.decode("STRING",e);else throw new Error(`${t}input source is not a string, byte Buffer or character array`);this.sabnf=s.encode("STRING",this.chars),this.scan=o(function(E,l){this.lines=a(this.chars,this.errors,E,l),z=!0},"scan"),this.parse=o(function(E,l){if(!z)throw new Error(`${t}grammar not scanned`);f.syntax(this.chars,this.lines,this.errors,E,l),H=!0},"parse"),this.translate=o(function(){if(!H)throw new Error(`${t}grammar not scanned and parsed`);let E=f.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=E.rules,this.udts=E.udts,F=E.lineMap,X=!0)},"translate"),this.attributes=o(function(){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return L=u(this.rules,this.udts,F,this.errors),B=!0,L},"attrs"),this.generate=o(function(E){if(this.lines=a(this.chars,this.errors,E),this.errors.length||(f.syntax(this.chars,this.lines,this.errors,E),this.errors.length))return;let l=f.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=l.rules,this.udts=l.udts,F=l.lineMap,L=u(this.rules,this.udts,F,this.errors),B=!0)},"generate"),this.displayRules=o(function(E="index"){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return k(this.rules,this.udts,E)},"displayRules"),this.displayRuleDependencies=o(function(E="index"){if(!B)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return x(E)},"displayRuleDependencies"),this.displayAttributes=o(function(E="index"){if(!B)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return L&&p(E),m(E)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!B)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return p()},"displayAttributeErrors"),this.toSource=o(function(E){if(!B)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateSource(this.chars,this.lines,this.rules,this.udts,E)},"toSource"),this.toObject=o(function(){if(!B)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return U(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(E){return I(this.errors,this.lines,this.chars,E)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return C(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return $(this.lines)},"linesToHtmlFunc")},"api")});var P0=me((Sy,O0)=>{(function(r,e){"use strict";function t(h,c){if(!h)throw new Error(c||"Assertion failed")}o(t,"assert");function n(h,c){h.super_=c;var d=o(function(){},"TempCtor");d.prototype=c.prototype,h.prototype=new d,h.prototype.constructor=h}o(n,"inherits");function i(h,c,d){if(i.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(h||0,c||10,d||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=eh().Buffer}catch(h){}i.isBN=o(function(c){return c instanceof i?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===i.wordSize&&Array.isArray(c.words)},"isBN"),i.max=o(function(c,d){return c.cmp(d)>0?c:d},"max"),i.min=o(function(c,d){return c.cmp(d)<0?c:d},"min"),i.prototype._init=o(function(c,d,y){if(typeof c=="number")return this._initNumber(c,d,y);if(typeof c=="object")return this._initArray(c,d,y);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var _=0;c[0]==="-"&&(_++,this.negative=1),_<c.length&&(d===16?this._parseHex(c,_,y):(this._parseBase(c,d,_),y==="le"&&this._initArray(this.toArray(),d,y)))},"init"),i.prototype._initNumber=o(function(c,d,y){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),d,y)},"_initNumber"),i.prototype._initArray=o(function(c,d,y){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w,b,S=0;if(y==="be")for(_=c.length-1,w=0;_>=0;_-=3)b=c[_]|c[_-1]<<8|c[_-2]<<16,this.words[w]|=b<<S&67108863,this.words[w+1]=b>>>26-S&67108863,S+=24,S>=26&&(S-=26,w++);else if(y==="le")for(_=0,w=0;_<c.length;_+=3)b=c[_]|c[_+1]<<8|c[_+2]<<16,this.words[w]|=b<<S&67108863,this.words[w+1]=b>>>26-S&67108863,S+=24,S>=26&&(S-=26,w++);return this._strip()},"_initArray");function a(h,c){var d=h.charCodeAt(c);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;t(!1,"Invalid character in "+h)}o(a,"parseHex4Bits");function f(h,c,d){var y=a(h,d);return d-1>=c&&(y|=a(h,d-1)<<4),y}o(f,"parseHexByte"),i.prototype._parseHex=o(function(c,d,y){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w=0,b=0,S;if(y==="be")for(_=c.length-1;_>=d;_-=2)S=f(c,d,_)<<w,this.words[b]|=S&67108863,w>=18?(w-=18,b+=1,this.words[b]|=S>>>26):w+=8;else{var D=c.length-d;for(_=D%2===0?d+1:d;_<c.length;_+=2)S=f(c,d,_)<<w,this.words[b]|=S&67108863,w>=18?(w-=18,b+=1,this.words[b]|=S>>>26):w+=8}this._strip()},"_parseHex");function u(h,c,d,y){for(var _=0,w=0,b=Math.min(h.length,d),S=c;S<b;S++){var D=h.charCodeAt(S)-48;_*=y,D>=49?w=D-49+10:D>=17?w=D-17+10:w=D,t(D>=0&&w<y,"Invalid character"),_+=w}return _}o(u,"parseBase"),i.prototype._parseBase=o(function(c,d,y){this.words=[0],this.length=1;for(var _=0,w=1;w<=67108863;w*=d)_++;_--,w=w/d|0;for(var b=c.length-y,S=b%_,D=Math.min(b,b-S)+y,v=0,M=y;M<D;M+=_)v=u(c,M,M+_,d),this.imuln(w),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(S!==0){var ne=1;for(v=u(c,M,c.length,d),M=0;M<S;M++)ne*=d;this.imuln(ne),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},"_parseBase"),i.prototype.copy=o(function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},"copy");function m(h,c){h.words=c.words,h.length=c.length,h.negative=c.negative,h.red=c.red}if(o(m,"move"),i.prototype._move=o(function(c){m(c,this)},"_move"),i.prototype.clone=o(function(){var c=new i(null);return this.copy(c),c},"clone"),i.prototype._expand=o(function(c){for(;this.length<c;)this.words[this.length++]=0;return this},"_expand"),i.prototype._strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch(h){i.prototype.inspect=p}else i.prototype.inspect=p;function p(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(p,"inspect");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"],k=[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],O=[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];i.prototype.toString=o(function(c,d){c=c||10,d=d|0||1;var y;if(c===16||c==="hex"){y="";for(var _=0,w=0,b=0;b<this.length;b++){var S=this.words[b],D=((S<<_|w)&16777215).toString(16);w=S>>>24-_&16777215,_+=2,_>=26&&(_-=26,b--),w!==0||b!==this.length-1?y=x[6-D.length]+D+y:y=D+y}for(w!==0&&(y=w.toString(16)+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(c===(c|0)&&c>=2&&c<=36){var v=k[c],M=O[c];y="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var A=ne.modrn(M).toString(c);ne=ne.idivn(M),ne.isZero()?y=A+y:y=x[v-A.length]+A+y}for(this.isZero()&&(y="0"+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(c,d){return this.toArrayLike(s,c,d)},"toBuffer")),i.prototype.toArray=o(function(c,d){return this.toArrayLike(Array,c,d)},"toArray");var T=o(function(c,d){return c.allocUnsafe?c.allocUnsafe(d):new c(d)},"allocate");i.prototype.toArrayLike=o(function(c,d,y){this._strip();var _=this.byteLength(),w=y||Math.max(1,_);t(_<=w,"byte array longer than desired length"),t(w>0,"Requested array length <= 0");var b=T(c,w),S=d==="le"?"LE":"BE";return this["_toArrayLike"+S](b,_),b},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(c,d){for(var y=0,_=0,w=0,b=0;w<this.length;w++){var S=this.words[w]<<b|_;c[y++]=S&255,y<c.length&&(c[y++]=S>>8&255),y<c.length&&(c[y++]=S>>16&255),b===6?(y<c.length&&(c[y++]=S>>24&255),_=0,b=0):(_=S>>>24,b+=2)}if(y<c.length)for(c[y++]=_;y<c.length;)c[y++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(c,d){for(var y=c.length-1,_=0,w=0,b=0;w<this.length;w++){var S=this.words[w]<<b|_;c[y--]=S&255,y>=0&&(c[y--]=S>>8&255),y>=0&&(c[y--]=S>>16&255),b===6?(y>=0&&(c[y--]=S>>24&255),_=0,b=0):(_=S>>>24,b+=2)}if(y>=0)for(c[y--]=_;y>=0;)c[y--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(c){return 32-Math.clz32(c)},"_countBits"):i.prototype._countBits=o(function(c){var d=c,y=0;return d>=4096&&(y+=13,d>>>=13),d>=64&&(y+=7,d>>>=7),d>=8&&(y+=4,d>>>=4),d>=2&&(y+=2,d>>>=2),y+d},"_countBits"),i.prototype._zeroBits=o(function(c){if(c===0)return 26;var d=c,y=0;return(d&8191)===0&&(y+=13,d>>>=13),(d&127)===0&&(y+=7,d>>>=7),(d&15)===0&&(y+=4,d>>>=4),(d&3)===0&&(y+=2,d>>>=2),(d&1)===0&&y++,y},"_zeroBits"),i.prototype.bitLength=o(function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d},"bitLength");function C(h){for(var c=new Array(h.bitLength()),d=0;d<c.length;d++){var y=d/26|0,_=d%26;c[d]=h.words[y]>>>_&1}return c}o(C,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(c+=y,y!==26)break}return c},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this._strip()},"iuor"),i.prototype.ior=o(function(c){return t((this.negative|c.negative)===0),this.iuor(c)},"ior"),i.prototype.or=o(function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},"or"),i.prototype.uor=o(function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(c){var d;this.length>c.length?d=c:d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&c.words[y];return this.length=d.length,this._strip()},"iuand"),i.prototype.iand=o(function(c){return t((this.negative|c.negative)===0),this.iuand(c)},"iand"),i.prototype.and=o(function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},"and"),i.prototype.uand=o(function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(c){var d,y;this.length>c.length?(d=this,y=c):(d=c,y=this);for(var _=0;_<y.length;_++)this.words[_]=d.words[_]^y.words[_];if(this!==d)for(;_<d.length;_++)this.words[_]=d.words[_];return this.length=d.length,this._strip()},"iuxor"),i.prototype.ixor=o(function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},"ixor"),i.prototype.xor=o(function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,y=c%26;this._expand(d),y>0&&d--;for(var _=0;_<d;_++)this.words[_]=~this.words[_]&67108863;return y>0&&(this.words[_]=~this.words[_]&67108863>>26-y),this._strip()},"inotn"),i.prototype.notn=o(function(c){return this.clone().inotn(c)},"notn"),i.prototype.setn=o(function(c,d){t(typeof c=="number"&&c>=0);var y=c/26|0,_=c%26;return this._expand(y+1),d?this.words[y]=this.words[y]|1<<_:this.words[y]=this.words[y]&~(1<<_),this._strip()},"setn"),i.prototype.iadd=o(function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var y,_;this.length>c.length?(y=this,_=c):(y=c,_=this);for(var w=0,b=0;b<_.length;b++)d=(y.words[b]|0)+(_.words[b]|0)+w,this.words[b]=d&67108863,w=d>>>26;for(;w!==0&&b<y.length;b++)d=(y.words[b]|0)+w,this.words[b]=d&67108863,w=d>>>26;if(this.length=y.length,w!==0)this.words[this.length]=w,this.length++;else if(y!==this)for(;b<y.length;b++)this.words[b]=y.words[b];return this},"iadd"),i.prototype.add=o(function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},"add"),i.prototype.isub=o(function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var y=this.cmp(c);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,w;y>0?(_=this,w=c):(_=c,w=this);for(var b=0,S=0;S<w.length;S++)d=(_.words[S]|0)-(w.words[S]|0)+b,b=d>>26,this.words[S]=d&67108863;for(;b!==0&&S<_.length;S++)d=(_.words[S]|0)+b,b=d>>26,this.words[S]=d&67108863;if(b===0&&S<_.length&&_!==this)for(;S<_.length;S++)this.words[S]=_.words[S];return this.length=Math.max(this.length,S),_!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(c){return this.clone().isub(c)},"sub");function $(h,c,d){d.negative=c.negative^h.negative;var y=h.length+c.length|0;d.length=y,y=y-1|0;var _=h.words[0]|0,w=c.words[0]|0,b=_*w,S=b&67108863,D=b/67108864|0;d.words[0]=S;for(var v=1;v<y;v++){for(var M=D>>>26,ne=D&67108863,A=Math.min(v,c.length-1),K=Math.max(0,v-h.length+1);K<=A;K++){var J=v-K|0;_=h.words[J]|0,w=c.words[K]|0,b=_*w+ne,M+=b/67108864|0,ne=b&67108863}d.words[v]=ne|0,D=M|0}return D!==0?d.words[v]=D|0:d.length--,d._strip()}o($,"smallMulTo");var I=o(function(c,d,y){var _=c.words,w=d.words,b=y.words,S=0,D,v,M,ne=_[0]|0,A=ne&8191,K=ne>>>13,J=_[1]|0,N=J&8191,R=J>>>13,V=_[2]|0,W=V&8191,ee=V>>>13,he=_[3]|0,fe=he&8191,Y=he>>>13,pe=_[4]|0,Q=pe&8191,ce=pe>>>13,q=_[5]|0,se=q&8191,be=q>>>13,Te=_[6]|0,we=Te&8191,Oe=Te>>>13,gr=_[7]|0,te=gr&8191,G=gr>>>13,P=_[8]|0,j=P&8191,ae=P>>>13,ue=_[9]|0,le=ue&8191,ge=ue>>>13,ft=w[0]|0,Ee=ft&8191,ve=ft>>>13,lt=w[1]|0,De=lt&8191,Ne=lt>>>13,Bn=w[2]|0,Le=Bn&8191,Be=Bn>>>13,Un=w[3]|0,Ue=Un&8191,Fe=Un>>>13,Fn=w[4]|0,$e=Fn&8191,qe=Fn>>>13,$n=w[5]|0,He=$n&8191,je=$n>>>13,qn=w[6]|0,ze=qn&8191,Ke=qn>>>13,Hn=w[7]|0,Ve=Hn&8191,We=Hn>>>13,jn=w[8]|0,Ge=jn&8191,Ye=jn>>>13,gn=w[9]|0,mt=gn&8191,bt=gn>>>13;y.negative=c.negative^d.negative,y.length=19,D=Math.imul(A,Ee),v=Math.imul(A,ve),v=v+Math.imul(K,Ee)|0,M=Math.imul(K,ve);var Yr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,D=Math.imul(N,Ee),v=Math.imul(N,ve),v=v+Math.imul(R,Ee)|0,M=Math.imul(R,ve),D=D+Math.imul(A,De)|0,v=v+Math.imul(A,Ne)|0,v=v+Math.imul(K,De)|0,M=M+Math.imul(K,Ne)|0;var Jr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,D=Math.imul(W,Ee),v=Math.imul(W,ve),v=v+Math.imul(ee,Ee)|0,M=Math.imul(ee,ve),D=D+Math.imul(N,De)|0,v=v+Math.imul(N,Ne)|0,v=v+Math.imul(R,De)|0,M=M+Math.imul(R,Ne)|0,D=D+Math.imul(A,Le)|0,v=v+Math.imul(A,Be)|0,v=v+Math.imul(K,Le)|0,M=M+Math.imul(K,Be)|0;var Xr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,D=Math.imul(fe,Ee),v=Math.imul(fe,ve),v=v+Math.imul(Y,Ee)|0,M=Math.imul(Y,ve),D=D+Math.imul(W,De)|0,v=v+Math.imul(W,Ne)|0,v=v+Math.imul(ee,De)|0,M=M+Math.imul(ee,Ne)|0,D=D+Math.imul(N,Le)|0,v=v+Math.imul(N,Be)|0,v=v+Math.imul(R,Le)|0,M=M+Math.imul(R,Be)|0,D=D+Math.imul(A,Ue)|0,v=v+Math.imul(A,Fe)|0,v=v+Math.imul(K,Ue)|0,M=M+Math.imul(K,Fe)|0;var Zr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,D=Math.imul(Q,Ee),v=Math.imul(Q,ve),v=v+Math.imul(ce,Ee)|0,M=Math.imul(ce,ve),D=D+Math.imul(fe,De)|0,v=v+Math.imul(fe,Ne)|0,v=v+Math.imul(Y,De)|0,M=M+Math.imul(Y,Ne)|0,D=D+Math.imul(W,Le)|0,v=v+Math.imul(W,Be)|0,v=v+Math.imul(ee,Le)|0,M=M+Math.imul(ee,Be)|0,D=D+Math.imul(N,Ue)|0,v=v+Math.imul(N,Fe)|0,v=v+Math.imul(R,Ue)|0,M=M+Math.imul(R,Fe)|0,D=D+Math.imul(A,$e)|0,v=v+Math.imul(A,qe)|0,v=v+Math.imul(K,$e)|0,M=M+Math.imul(K,qe)|0;var Qr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,D=Math.imul(se,Ee),v=Math.imul(se,ve),v=v+Math.imul(be,Ee)|0,M=Math.imul(be,ve),D=D+Math.imul(Q,De)|0,v=v+Math.imul(Q,Ne)|0,v=v+Math.imul(ce,De)|0,M=M+Math.imul(ce,Ne)|0,D=D+Math.imul(fe,Le)|0,v=v+Math.imul(fe,Be)|0,v=v+Math.imul(Y,Le)|0,M=M+Math.imul(Y,Be)|0,D=D+Math.imul(W,Ue)|0,v=v+Math.imul(W,Fe)|0,v=v+Math.imul(ee,Ue)|0,M=M+Math.imul(ee,Fe)|0,D=D+Math.imul(N,$e)|0,v=v+Math.imul(N,qe)|0,v=v+Math.imul(R,$e)|0,M=M+Math.imul(R,qe)|0,D=D+Math.imul(A,He)|0,v=v+Math.imul(A,je)|0,v=v+Math.imul(K,He)|0,M=M+Math.imul(K,je)|0;var ko=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(ko>>>26)|0,ko&=67108863,D=Math.imul(we,Ee),v=Math.imul(we,ve),v=v+Math.imul(Oe,Ee)|0,M=Math.imul(Oe,ve),D=D+Math.imul(se,De)|0,v=v+Math.imul(se,Ne)|0,v=v+Math.imul(be,De)|0,M=M+Math.imul(be,Ne)|0,D=D+Math.imul(Q,Le)|0,v=v+Math.imul(Q,Be)|0,v=v+Math.imul(ce,Le)|0,M=M+Math.imul(ce,Be)|0,D=D+Math.imul(fe,Ue)|0,v=v+Math.imul(fe,Fe)|0,v=v+Math.imul(Y,Ue)|0,M=M+Math.imul(Y,Fe)|0,D=D+Math.imul(W,$e)|0,v=v+Math.imul(W,qe)|0,v=v+Math.imul(ee,$e)|0,M=M+Math.imul(ee,qe)|0,D=D+Math.imul(N,He)|0,v=v+Math.imul(N,je)|0,v=v+Math.imul(R,He)|0,M=M+Math.imul(R,je)|0,D=D+Math.imul(A,ze)|0,v=v+Math.imul(A,Ke)|0,v=v+Math.imul(K,ze)|0,M=M+Math.imul(K,Ke)|0;var Co=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Co>>>26)|0,Co&=67108863,D=Math.imul(te,Ee),v=Math.imul(te,ve),v=v+Math.imul(G,Ee)|0,M=Math.imul(G,ve),D=D+Math.imul(we,De)|0,v=v+Math.imul(we,Ne)|0,v=v+Math.imul(Oe,De)|0,M=M+Math.imul(Oe,Ne)|0,D=D+Math.imul(se,Le)|0,v=v+Math.imul(se,Be)|0,v=v+Math.imul(be,Le)|0,M=M+Math.imul(be,Be)|0,D=D+Math.imul(Q,Ue)|0,v=v+Math.imul(Q,Fe)|0,v=v+Math.imul(ce,Ue)|0,M=M+Math.imul(ce,Fe)|0,D=D+Math.imul(fe,$e)|0,v=v+Math.imul(fe,qe)|0,v=v+Math.imul(Y,$e)|0,M=M+Math.imul(Y,qe)|0,D=D+Math.imul(W,He)|0,v=v+Math.imul(W,je)|0,v=v+Math.imul(ee,He)|0,M=M+Math.imul(ee,je)|0,D=D+Math.imul(N,ze)|0,v=v+Math.imul(N,Ke)|0,v=v+Math.imul(R,ze)|0,M=M+Math.imul(R,Ke)|0,D=D+Math.imul(A,Ve)|0,v=v+Math.imul(A,We)|0,v=v+Math.imul(K,Ve)|0,M=M+Math.imul(K,We)|0;var Do=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Do>>>26)|0,Do&=67108863,D=Math.imul(j,Ee),v=Math.imul(j,ve),v=v+Math.imul(ae,Ee)|0,M=Math.imul(ae,ve),D=D+Math.imul(te,De)|0,v=v+Math.imul(te,Ne)|0,v=v+Math.imul(G,De)|0,M=M+Math.imul(G,Ne)|0,D=D+Math.imul(we,Le)|0,v=v+Math.imul(we,Be)|0,v=v+Math.imul(Oe,Le)|0,M=M+Math.imul(Oe,Be)|0,D=D+Math.imul(se,Ue)|0,v=v+Math.imul(se,Fe)|0,v=v+Math.imul(be,Ue)|0,M=M+Math.imul(be,Fe)|0,D=D+Math.imul(Q,$e)|0,v=v+Math.imul(Q,qe)|0,v=v+Math.imul(ce,$e)|0,M=M+Math.imul(ce,qe)|0,D=D+Math.imul(fe,He)|0,v=v+Math.imul(fe,je)|0,v=v+Math.imul(Y,He)|0,M=M+Math.imul(Y,je)|0,D=D+Math.imul(W,ze)|0,v=v+Math.imul(W,Ke)|0,v=v+Math.imul(ee,ze)|0,M=M+Math.imul(ee,Ke)|0,D=D+Math.imul(N,Ve)|0,v=v+Math.imul(N,We)|0,v=v+Math.imul(R,Ve)|0,M=M+Math.imul(R,We)|0,D=D+Math.imul(A,Ge)|0,v=v+Math.imul(A,Ye)|0,v=v+Math.imul(K,Ge)|0,M=M+Math.imul(K,Ye)|0;var Io=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Io>>>26)|0,Io&=67108863,D=Math.imul(le,Ee),v=Math.imul(le,ve),v=v+Math.imul(ge,Ee)|0,M=Math.imul(ge,ve),D=D+Math.imul(j,De)|0,v=v+Math.imul(j,Ne)|0,v=v+Math.imul(ae,De)|0,M=M+Math.imul(ae,Ne)|0,D=D+Math.imul(te,Le)|0,v=v+Math.imul(te,Be)|0,v=v+Math.imul(G,Le)|0,M=M+Math.imul(G,Be)|0,D=D+Math.imul(we,Ue)|0,v=v+Math.imul(we,Fe)|0,v=v+Math.imul(Oe,Ue)|0,M=M+Math.imul(Oe,Fe)|0,D=D+Math.imul(se,$e)|0,v=v+Math.imul(se,qe)|0,v=v+Math.imul(be,$e)|0,M=M+Math.imul(be,qe)|0,D=D+Math.imul(Q,He)|0,v=v+Math.imul(Q,je)|0,v=v+Math.imul(ce,He)|0,M=M+Math.imul(ce,je)|0,D=D+Math.imul(fe,ze)|0,v=v+Math.imul(fe,Ke)|0,v=v+Math.imul(Y,ze)|0,M=M+Math.imul(Y,Ke)|0,D=D+Math.imul(W,Ve)|0,v=v+Math.imul(W,We)|0,v=v+Math.imul(ee,Ve)|0,M=M+Math.imul(ee,We)|0,D=D+Math.imul(N,Ge)|0,v=v+Math.imul(N,Ye)|0,v=v+Math.imul(R,Ge)|0,M=M+Math.imul(R,Ye)|0,D=D+Math.imul(A,mt)|0,v=v+Math.imul(A,bt)|0,v=v+Math.imul(K,mt)|0,M=M+Math.imul(K,bt)|0;var Oo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,D=Math.imul(le,De),v=Math.imul(le,Ne),v=v+Math.imul(ge,De)|0,M=Math.imul(ge,Ne),D=D+Math.imul(j,Le)|0,v=v+Math.imul(j,Be)|0,v=v+Math.imul(ae,Le)|0,M=M+Math.imul(ae,Be)|0,D=D+Math.imul(te,Ue)|0,v=v+Math.imul(te,Fe)|0,v=v+Math.imul(G,Ue)|0,M=M+Math.imul(G,Fe)|0,D=D+Math.imul(we,$e)|0,v=v+Math.imul(we,qe)|0,v=v+Math.imul(Oe,$e)|0,M=M+Math.imul(Oe,qe)|0,D=D+Math.imul(se,He)|0,v=v+Math.imul(se,je)|0,v=v+Math.imul(be,He)|0,M=M+Math.imul(be,je)|0,D=D+Math.imul(Q,ze)|0,v=v+Math.imul(Q,Ke)|0,v=v+Math.imul(ce,ze)|0,M=M+Math.imul(ce,Ke)|0,D=D+Math.imul(fe,Ve)|0,v=v+Math.imul(fe,We)|0,v=v+Math.imul(Y,Ve)|0,M=M+Math.imul(Y,We)|0,D=D+Math.imul(W,Ge)|0,v=v+Math.imul(W,Ye)|0,v=v+Math.imul(ee,Ge)|0,M=M+Math.imul(ee,Ye)|0,D=D+Math.imul(N,mt)|0,v=v+Math.imul(N,bt)|0,v=v+Math.imul(R,mt)|0,M=M+Math.imul(R,bt)|0;var Po=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Po>>>26)|0,Po&=67108863,D=Math.imul(le,Le),v=Math.imul(le,Be),v=v+Math.imul(ge,Le)|0,M=Math.imul(ge,Be),D=D+Math.imul(j,Ue)|0,v=v+Math.imul(j,Fe)|0,v=v+Math.imul(ae,Ue)|0,M=M+Math.imul(ae,Fe)|0,D=D+Math.imul(te,$e)|0,v=v+Math.imul(te,qe)|0,v=v+Math.imul(G,$e)|0,M=M+Math.imul(G,qe)|0,D=D+Math.imul(we,He)|0,v=v+Math.imul(we,je)|0,v=v+Math.imul(Oe,He)|0,M=M+Math.imul(Oe,je)|0,D=D+Math.imul(se,ze)|0,v=v+Math.imul(se,Ke)|0,v=v+Math.imul(be,ze)|0,M=M+Math.imul(be,Ke)|0,D=D+Math.imul(Q,Ve)|0,v=v+Math.imul(Q,We)|0,v=v+Math.imul(ce,Ve)|0,M=M+Math.imul(ce,We)|0,D=D+Math.imul(fe,Ge)|0,v=v+Math.imul(fe,Ye)|0,v=v+Math.imul(Y,Ge)|0,M=M+Math.imul(Y,Ye)|0,D=D+Math.imul(W,mt)|0,v=v+Math.imul(W,bt)|0,v=v+Math.imul(ee,mt)|0,M=M+Math.imul(ee,bt)|0;var No=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(No>>>26)|0,No&=67108863,D=Math.imul(le,Ue),v=Math.imul(le,Fe),v=v+Math.imul(ge,Ue)|0,M=Math.imul(ge,Fe),D=D+Math.imul(j,$e)|0,v=v+Math.imul(j,qe)|0,v=v+Math.imul(ae,$e)|0,M=M+Math.imul(ae,qe)|0,D=D+Math.imul(te,He)|0,v=v+Math.imul(te,je)|0,v=v+Math.imul(G,He)|0,M=M+Math.imul(G,je)|0,D=D+Math.imul(we,ze)|0,v=v+Math.imul(we,Ke)|0,v=v+Math.imul(Oe,ze)|0,M=M+Math.imul(Oe,Ke)|0,D=D+Math.imul(se,Ve)|0,v=v+Math.imul(se,We)|0,v=v+Math.imul(be,Ve)|0,M=M+Math.imul(be,We)|0,D=D+Math.imul(Q,Ge)|0,v=v+Math.imul(Q,Ye)|0,v=v+Math.imul(ce,Ge)|0,M=M+Math.imul(ce,Ye)|0,D=D+Math.imul(fe,mt)|0,v=v+Math.imul(fe,bt)|0,v=v+Math.imul(Y,mt)|0,M=M+Math.imul(Y,bt)|0;var Ro=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,D=Math.imul(le,$e),v=Math.imul(le,qe),v=v+Math.imul(ge,$e)|0,M=Math.imul(ge,qe),D=D+Math.imul(j,He)|0,v=v+Math.imul(j,je)|0,v=v+Math.imul(ae,He)|0,M=M+Math.imul(ae,je)|0,D=D+Math.imul(te,ze)|0,v=v+Math.imul(te,Ke)|0,v=v+Math.imul(G,ze)|0,M=M+Math.imul(G,Ke)|0,D=D+Math.imul(we,Ve)|0,v=v+Math.imul(we,We)|0,v=v+Math.imul(Oe,Ve)|0,M=M+Math.imul(Oe,We)|0,D=D+Math.imul(se,Ge)|0,v=v+Math.imul(se,Ye)|0,v=v+Math.imul(be,Ge)|0,M=M+Math.imul(be,Ye)|0,D=D+Math.imul(Q,mt)|0,v=v+Math.imul(Q,bt)|0,v=v+Math.imul(ce,mt)|0,M=M+Math.imul(ce,bt)|0;var Lo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,D=Math.imul(le,He),v=Math.imul(le,je),v=v+Math.imul(ge,He)|0,M=Math.imul(ge,je),D=D+Math.imul(j,ze)|0,v=v+Math.imul(j,Ke)|0,v=v+Math.imul(ae,ze)|0,M=M+Math.imul(ae,Ke)|0,D=D+Math.imul(te,Ve)|0,v=v+Math.imul(te,We)|0,v=v+Math.imul(G,Ve)|0,M=M+Math.imul(G,We)|0,D=D+Math.imul(we,Ge)|0,v=v+Math.imul(we,Ye)|0,v=v+Math.imul(Oe,Ge)|0,M=M+Math.imul(Oe,Ye)|0,D=D+Math.imul(se,mt)|0,v=v+Math.imul(se,bt)|0,v=v+Math.imul(be,mt)|0,M=M+Math.imul(be,bt)|0;var Bo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,D=Math.imul(le,ze),v=Math.imul(le,Ke),v=v+Math.imul(ge,ze)|0,M=Math.imul(ge,Ke),D=D+Math.imul(j,Ve)|0,v=v+Math.imul(j,We)|0,v=v+Math.imul(ae,Ve)|0,M=M+Math.imul(ae,We)|0,D=D+Math.imul(te,Ge)|0,v=v+Math.imul(te,Ye)|0,v=v+Math.imul(G,Ge)|0,M=M+Math.imul(G,Ye)|0,D=D+Math.imul(we,mt)|0,v=v+Math.imul(we,bt)|0,v=v+Math.imul(Oe,mt)|0,M=M+Math.imul(Oe,bt)|0;var Uo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,D=Math.imul(le,Ve),v=Math.imul(le,We),v=v+Math.imul(ge,Ve)|0,M=Math.imul(ge,We),D=D+Math.imul(j,Ge)|0,v=v+Math.imul(j,Ye)|0,v=v+Math.imul(ae,Ge)|0,M=M+Math.imul(ae,Ye)|0,D=D+Math.imul(te,mt)|0,v=v+Math.imul(te,bt)|0,v=v+Math.imul(G,mt)|0,M=M+Math.imul(G,bt)|0;var dd=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(dd>>>26)|0,dd&=67108863,D=Math.imul(le,Ge),v=Math.imul(le,Ye),v=v+Math.imul(ge,Ge)|0,M=Math.imul(ge,Ye),D=D+Math.imul(j,mt)|0,v=v+Math.imul(j,bt)|0,v=v+Math.imul(ae,mt)|0,M=M+Math.imul(ae,bt)|0;var hd=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(hd>>>26)|0,hd&=67108863,D=Math.imul(le,mt),v=Math.imul(le,bt),v=v+Math.imul(ge,mt)|0,M=Math.imul(ge,bt);var pd=(S+D|0)+((v&8191)<<13)|0;return S=(M+(v>>>13)|0)+(pd>>>26)|0,pd&=67108863,b[0]=Yr,b[1]=Jr,b[2]=Xr,b[3]=Zr,b[4]=Qr,b[5]=ko,b[6]=Co,b[7]=Do,b[8]=Io,b[9]=Oo,b[10]=Po,b[11]=No,b[12]=Ro,b[13]=Lo,b[14]=Bo,b[15]=Uo,b[16]=dd,b[17]=hd,b[18]=pd,S!==0&&(b[19]=S,y.length++),y},"comb10MulTo");Math.imul||(I=$);function U(h,c,d){d.negative=c.negative^h.negative,d.length=h.length+c.length;for(var y=0,_=0,w=0;w<d.length-1;w++){var b=_;_=0;for(var S=y&67108863,D=Math.min(w,c.length-1),v=Math.max(0,w-h.length+1);v<=D;v++){var M=w-v,ne=h.words[M]|0,A=c.words[v]|0,K=ne*A,J=K&67108863;b=b+(K/67108864|0)|0,J=J+S|0,S=J&67108863,b=b+(J>>>26)|0,_+=b>>>26,b&=67108863}d.words[w]=S,y=b,b=_}return y!==0?d.words[w]=y:d.length--,d._strip()}o(U,"bigMulTo");function z(h,c,d){return U(h,c,d)}o(z,"jumboMulTo"),i.prototype.mulTo=o(function(c,d){var y,_=this.length+c.length;return this.length===10&&c.length===10?y=I(this,c,d):_<63?y=$(this,c,d):_<1024?y=U(this,c,d):y=z(this,c,d),y},"mulTo");function H(h,c){this.x=h,this.y=c}o(H,"FFTM"),H.prototype.makeRBT=o(function(c){for(var d=new Array(c),y=i.prototype._countBits(c)-1,_=0;_<c;_++)d[_]=this.revBin(_,y,c);return d},"makeRBT"),H.prototype.revBin=o(function(c,d,y){if(c===0||c===y-1)return c;for(var _=0,w=0;w<d;w++)_|=(c&1)<<d-w-1,c>>=1;return _},"revBin"),H.prototype.permute=o(function(c,d,y,_,w,b){for(var S=0;S<b;S++)_[S]=d[c[S]],w[S]=y[c[S]]},"permute"),H.prototype.transform=o(function(c,d,y,_,w,b){this.permute(b,c,d,y,_,w);for(var S=1;S<w;S<<=1)for(var D=S<<1,v=Math.cos(2*Math.PI/D),M=Math.sin(2*Math.PI/D),ne=0;ne<w;ne+=D)for(var A=v,K=M,J=0;J<S;J++){var N=y[ne+J],R=_[ne+J],V=y[ne+J+S],W=_[ne+J+S],ee=A*V-K*W;W=A*W+K*V,V=ee,y[ne+J]=N+V,_[ne+J]=R+W,y[ne+J+S]=N-V,_[ne+J+S]=R-W,J!==D&&(ee=v*A-M*K,K=v*K+M*A,A=ee)}},"transform"),H.prototype.guessLen13b=o(function(c,d){var y=Math.max(d,c)|1,_=y&1,w=0;for(y=y/2|0;y;y=y>>>1)w++;return 1<<w+1+_},"guessLen13b"),H.prototype.conjugate=o(function(c,d,y){if(!(y<=1))for(var _=0;_<y/2;_++){var w=c[_];c[_]=c[y-_-1],c[y-_-1]=w,w=d[_],d[_]=-d[y-_-1],d[y-_-1]=-w}},"conjugate"),H.prototype.normalize13b=o(function(c,d){for(var y=0,_=0;_<d/2;_++){var w=Math.round(c[2*_+1]/d)*8192+Math.round(c[2*_]/d)+y;c[_]=w&67108863,w<67108864?y=0:y=w/67108864|0}return c},"normalize13b"),H.prototype.convert13b=o(function(c,d,y,_){for(var w=0,b=0;b<d;b++)w=w+(c[b]|0),y[2*b]=w&8191,w=w>>>13,y[2*b+1]=w&8191,w=w>>>13;for(b=2*d;b<_;++b)y[b]=0;t(w===0),t((w&-8192)===0)},"convert13b"),H.prototype.stub=o(function(c){for(var d=new Array(c),y=0;y<c;y++)d[y]=0;return d},"stub"),H.prototype.mulp=o(function(c,d,y){var _=2*this.guessLen13b(c.length,d.length),w=this.makeRBT(_),b=this.stub(_),S=new Array(_),D=new Array(_),v=new Array(_),M=new Array(_),ne=new Array(_),A=new Array(_),K=y.words;K.length=_,this.convert13b(c.words,c.length,S,_),this.convert13b(d.words,d.length,M,_),this.transform(S,b,D,v,_,w),this.transform(M,b,ne,A,_,w);for(var J=0;J<_;J++){var N=D[J]*ne[J]-v[J]*A[J];v[J]=D[J]*A[J]+v[J]*ne[J],D[J]=N}return this.conjugate(D,v,_),this.transform(D,v,K,b,_,w),this.conjugate(K,b,_),this.normalize13b(K,_),y.negative=c.negative^d.negative,y.length=c.length+d.length,y._strip()},"mulp"),i.prototype.mul=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},"mul"),i.prototype.mulf=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),z(this,c,d)},"mulf"),i.prototype.imul=o(function(c){return this.clone().mulTo(c,this)},"imul"),i.prototype.imuln=o(function(c){var d=c<0;d&&(c=-c),t(typeof c=="number"),t(c<67108864);for(var y=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*c,b=(w&67108863)+(y&67108863);y>>=26,y+=w/67108864|0,y+=b>>>26,this.words[_]=b&67108863}return y!==0&&(this.words[_]=y,this.length++),d?this.ineg():this},"imuln"),i.prototype.muln=o(function(c){return this.clone().imuln(c)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(c){var d=C(c);if(d.length===0)return new i(1);for(var y=this,_=0;_<d.length&&d[_]===0;_++,y=y.sqr());if(++_<d.length)for(var w=y.sqr();_<d.length;_++,w=w.sqr())d[_]!==0&&(y=y.mul(w));return y},"pow"),i.prototype.iushln=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=67108863>>>26-d<<26-d,w;if(d!==0){var b=0;for(w=0;w<this.length;w++){var S=this.words[w]&_,D=(this.words[w]|0)-S<<d;this.words[w]=D|b,b=S>>>26-d}b&&(this.words[w]=b,this.length++)}if(y!==0){for(w=this.length-1;w>=0;w--)this.words[w+y]=this.words[w];for(w=0;w<y;w++)this.words[w]=0;this.length+=y}return this._strip()},"iushln"),i.prototype.ishln=o(function(c){return t(this.negative===0),this.iushln(c)},"ishln"),i.prototype.iushrn=o(function(c,d,y){t(typeof c=="number"&&c>=0);var _;d?_=(d-d%26)/26:_=0;var w=c%26,b=Math.min((c-w)/26,this.length),S=67108863^67108863>>>w<<w,D=y;if(_-=b,_=Math.max(0,_),D){for(var v=0;v<b;v++)D.words[v]=this.words[v];D.length=b}if(b!==0)if(this.length>b)for(this.length-=b,v=0;v<this.length;v++)this.words[v]=this.words[v+b];else this.words[0]=0,this.length=1;var M=0;for(v=this.length-1;v>=0&&(M!==0||v>=_);v--){var ne=this.words[v]|0;this.words[v]=M<<26-w|ne>>>w,M=ne&S}return D&&M!==0&&(D.words[D.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(c,d,y){return t(this.negative===0),this.iushrn(c,d,y)},"ishrn"),i.prototype.shln=o(function(c){return this.clone().ishln(c)},"shln"),i.prototype.ushln=o(function(c){return this.clone().iushln(c)},"ushln"),i.prototype.shrn=o(function(c){return this.clone().ishrn(c)},"shrn"),i.prototype.ushrn=o(function(c){return this.clone().iushrn(c)},"ushrn"),i.prototype.testn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return!1;var w=this.words[y];return!!(w&_)},"testn"),i.prototype.imaskn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0&&y++,this.length=Math.min(y,this.length),d!==0){var _=67108863^67108863>>>d<<d;this.words[this.length-1]&=_}return this._strip()},"imaskn"),i.prototype.maskn=o(function(c){return this.clone().imaskn(c)},"maskn"),i.prototype.iaddn=o(function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},"iaddn"),i.prototype._iaddn=o(function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},"_iaddn"),i.prototype.isubn=o(function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},"isubn"),i.prototype.addn=o(function(c){return this.clone().iaddn(c)},"addn"),i.prototype.subn=o(function(c){return this.clone().isubn(c)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(c,d,y){var _=c.length+y,w;this._expand(_);var b,S=0;for(w=0;w<c.length;w++){b=(this.words[w+y]|0)+S;var D=(c.words[w]|0)*d;b-=D&67108863,S=(b>>26)-(D/67108864|0),this.words[w+y]=b&67108863}for(;w<this.length-y;w++)b=(this.words[w+y]|0)+S,S=b>>26,this.words[w+y]=b&67108863;if(S===0)return this._strip();for(t(S===-1),S=0,w=0;w<this.length;w++)b=-(this.words[w]|0)+S,S=b>>26,this.words[w]=b&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(c,d){var y=this.length-c.length,_=this.clone(),w=c,b=w.words[w.length-1]|0,S=this._countBits(b);y=26-S,y!==0&&(w=w.ushln(y),_.iushln(y),b=w.words[w.length-1]|0);var D=_.length-w.length,v;if(d!=="mod"){v=new i(null),v.length=D+1,v.words=new Array(v.length);for(var M=0;M<v.length;M++)v.words[M]=0}var ne=_.clone()._ishlnsubmul(w,1,D);ne.negative===0&&(_=ne,v&&(v.words[D]=1));for(var A=D-1;A>=0;A--){var K=(_.words[w.length+A]|0)*67108864+(_.words[w.length+A-1]|0);for(K=Math.min(K/b|0,67108863),_._ishlnsubmul(w,K,A);_.negative!==0;)K--,_.negative=0,_._ishlnsubmul(w,1,A),_.isZero()||(_.negative^=1);v&&(v.words[A]=K)}return v&&v._strip(),_._strip(),d!=="div"&&y!==0&&_.iushrn(y),{div:v||null,mod:_}},"_wordDiv"),i.prototype.divmod=o(function(c,d,y){if(t(!c.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var _,w,b;return this.negative!==0&&c.negative===0?(b=this.neg().divmod(c,d),d!=="mod"&&(_=b.div.neg()),d!=="div"&&(w=b.mod.neg(),y&&w.negative!==0&&w.iadd(c)),{div:_,mod:w}):this.negative===0&&c.negative!==0?(b=this.divmod(c.neg(),d),d!=="mod"&&(_=b.div.neg()),{div:_,mod:b.mod}):(this.negative&c.negative)!==0?(b=this.neg().divmod(c.neg(),d),d!=="div"&&(w=b.mod.neg(),y&&w.negative!==0&&w.isub(c)),{div:b.div,mod:w}):c.length>this.length||this.cmp(c)<0?{div:new i(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new i(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new i(this.modrn(c.words[0]))}:this._wordDiv(c,d)},"divmod"),i.prototype.div=o(function(c){return this.divmod(c,"div",!1).div},"div"),i.prototype.mod=o(function(c){return this.divmod(c,"mod",!1).mod},"mod"),i.prototype.umod=o(function(c){return this.divmod(c,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(c):d.mod,_=c.ushrn(1),w=c.andln(1),b=y.cmp(_);return b<0||w===1&&b===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=(1<<26)%c,_=0,w=this.length-1;w>=0;w--)_=(y*_+(this.words[w]|0))%c;return d?-_:_},"modrn"),i.prototype.modn=o(function(c){return this.modrn(c)},"modn"),i.prototype.idivn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+y*67108864;this.words[_]=w/c|0,y=w%c}return this._strip(),d?this.ineg():this},"idivn"),i.prototype.divn=o(function(c){return this.clone().idivn(c)},"divn"),i.prototype.egcd=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),b=new i(0),S=new i(1),D=0;d.isEven()&&y.isEven();)d.iushrn(1),y.iushrn(1),++D;for(var v=y.clone(),M=d.clone();!d.isZero();){for(var ne=0,A=1;(d.words[0]&A)===0&&ne<26;++ne,A<<=1);if(ne>0)for(d.iushrn(ne);ne-- >0;)(_.isOdd()||w.isOdd())&&(_.iadd(v),w.isub(M)),_.iushrn(1),w.iushrn(1);for(var K=0,J=1;(y.words[0]&J)===0&&K<26;++K,J<<=1);if(K>0)for(y.iushrn(K);K-- >0;)(b.isOdd()||S.isOdd())&&(b.iadd(v),S.isub(M)),b.iushrn(1),S.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(b),w.isub(S)):(y.isub(d),b.isub(_),S.isub(w))}return{a:b,b:S,gcd:y.iushln(D)}},"egcd"),i.prototype._invmp=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),b=y.clone();d.cmpn(1)>0&&y.cmpn(1)>0;){for(var S=0,D=1;(d.words[0]&D)===0&&S<26;++S,D<<=1);if(S>0)for(d.iushrn(S);S-- >0;)_.isOdd()&&_.iadd(b),_.iushrn(1);for(var v=0,M=1;(y.words[0]&M)===0&&v<26;++v,M<<=1);if(v>0)for(y.iushrn(v);v-- >0;)w.isOdd()&&w.iadd(b),w.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(w)):(y.isub(d),w.isub(_))}var ne;return d.cmpn(1)===0?ne=_:ne=w,ne.cmpn(0)<0&&ne.iadd(c),ne},"_invmp"),i.prototype.gcd=o(function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),y=c.clone();d.negative=0,y.negative=0;for(var _=0;d.isEven()&&y.isEven();_++)d.iushrn(1),y.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;y.isEven();)y.iushrn(1);var w=d.cmp(y);if(w<0){var b=d;d=y,y=b}else if(w===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(_)},"gcd"),i.prototype.invm=o(function(c){return this.egcd(c).a.umod(c)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(c){return this.words[0]&c},"andln"),i.prototype.bincn=o(function(c){t(typeof c=="number");var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=_,this;for(var w=_,b=y;w!==0&&b<this.length;b++){var S=this.words[b]|0;S+=w,w=S>>>26,S&=67108863,this.words[b]=S}return w!==0&&(this.words[b]=w,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var _=this.words[0]|0;y=_===c?0:_<c?-1:1}return this.negative!==0?-y|0:y},"cmpn"),i.prototype.cmp=o(function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},"cmp"),i.prototype.ucmp=o(function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,y=this.length-1;y>=0;y--){var _=this.words[y]|0,w=c.words[y]|0;if(_!==w){_<w?d=-1:_>w&&(d=1);break}}return d},"ucmp"),i.prototype.gtn=o(function(c){return this.cmpn(c)===1},"gtn"),i.prototype.gt=o(function(c){return this.cmp(c)===1},"gt"),i.prototype.gten=o(function(c){return this.cmpn(c)>=0},"gten"),i.prototype.gte=o(function(c){return this.cmp(c)>=0},"gte"),i.prototype.ltn=o(function(c){return this.cmpn(c)===-1},"ltn"),i.prototype.lt=o(function(c){return this.cmp(c)===-1},"lt"),i.prototype.lten=o(function(c){return this.cmpn(c)<=0},"lten"),i.prototype.lte=o(function(c){return this.cmp(c)<=0},"lte"),i.prototype.eqn=o(function(c){return this.cmpn(c)===0},"eqn"),i.prototype.eq=o(function(c){return this.cmp(c)===0},"eq"),i.red=o(function(c){return new l(c)},"red"),i.prototype.toRed=o(function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(c){return this.red=c,this},"_forceRed"),i.prototype.forceRed=o(function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},"forceRed"),i.prototype.redAdd=o(function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},"redAdd"),i.prototype.redIAdd=o(function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},"redIAdd"),i.prototype.redSub=o(function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},"redSub"),i.prototype.redISub=o(function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},"redISub"),i.prototype.redShl=o(function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},"redShl"),i.prototype.redMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},"redMul"),i.prototype.redIMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)},"redPow");var X={k256:null,p224:null,p192:null,p25519:null};function B(h,c){this.name=h,this.p=new i(c,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(B,"MPrime"),B.prototype._tmp=o(function(){var c=new i(null);return c.words=new Array(Math.ceil(this.n/13)),c},"_tmp"),B.prototype.ireduce=o(function(c){var d=c,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var _=y<this.n?-1:d.ucmp(this.p);return _===0?(d.words[0]=0,d.length=1):_>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},"ireduce"),B.prototype.split=o(function(c,d){c.iushrn(this.n,0,d)},"split"),B.prototype.imulK=o(function(c){return c.imul(this.k)},"imulK");function L(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(L,"K256"),n(L,B),L.prototype.split=o(function(c,d){for(var y=4194303,_=Math.min(c.length,9),w=0;w<_;w++)d.words[w]=c.words[w];if(d.length=_,c.length<=9){c.words[0]=0,c.length=1;return}var b=c.words[9];for(d.words[d.length++]=b&y,w=10;w<c.length;w++){var S=c.words[w]|0;c.words[w-10]=(S&y)<<4|b>>>22,b=S}b>>>=22,c.words[w-10]=b,b===0&&c.length>10?c.length-=10:c.length-=9},"split"),L.prototype.imulK=o(function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,y=0;y<c.length;y++){var _=c.words[y]|0;d+=_*977,c.words[y]=d&67108863,d=_*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c},"imulK");function F(){B.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(F,"P224"),n(F,B);function re(){B.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(re,"P192"),n(re,B);function E(){B.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(E,"P25519"),n(E,B),E.prototype.imulK=o(function(c){for(var d=0,y=0;y<c.length;y++){var _=(c.words[y]|0)*19+d,w=_&67108863;_>>>=26,c.words[y]=w,d=_}return d!==0&&(c.words[c.length++]=d),c},"imulK"),i._prime=o(function(c){if(X[c])return X[c];var d;if(c==="k256")d=new L;else if(c==="p224")d=new F;else if(c==="p192")d=new re;else if(c==="p25519")d=new E;else throw new Error("Unknown prime "+c);return X[c]=d,d},"prime");function l(h){if(typeof h=="string"){var c=i._prime(h);this.m=c.p,this.prime=c}else t(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}o(l,"Red"),l.prototype._verify1=o(function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},"_verify1"),l.prototype._verify2=o(function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},"_verify2"),l.prototype.imod=o(function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(m(c,c.umod(this.m)._forceRed(this)),c)},"imod"),l.prototype.neg=o(function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},"neg"),l.prototype.add=o(function(c,d){this._verify2(c,d);var y=c.add(d);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},"add"),l.prototype.iadd=o(function(c,d){this._verify2(c,d);var y=c.iadd(d);return y.cmp(this.m)>=0&&y.isub(this.m),y},"iadd"),l.prototype.sub=o(function(c,d){this._verify2(c,d);var y=c.sub(d);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},"sub"),l.prototype.isub=o(function(c,d){this._verify2(c,d);var y=c.isub(d);return y.cmpn(0)<0&&y.iadd(this.m),y},"isub"),l.prototype.shl=o(function(c,d){return this._verify1(c),this.imod(c.ushln(d))},"shl"),l.prototype.imul=o(function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},"imul"),l.prototype.mul=o(function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},"mul"),l.prototype.isqr=o(function(c){return this.imul(c,c.clone())},"isqr"),l.prototype.sqr=o(function(c){return this.mul(c,c)},"sqr"),l.prototype.sqrt=o(function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var y=this.m.add(new i(1)).iushrn(2);return this.pow(c,y)}for(var _=this.m.subn(1),w=0;!_.isZero()&&_.andln(1)===0;)w++,_.iushrn(1);t(!_.isZero());var b=new i(1).toRed(this),S=b.redNeg(),D=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new i(2*v*v).toRed(this);this.pow(v,D).cmp(S)!==0;)v.redIAdd(S);for(var M=this.pow(v,_),ne=this.pow(c,_.addn(1).iushrn(1)),A=this.pow(c,_),K=w;A.cmp(b)!==0;){for(var J=A,N=0;J.cmp(b)!==0;N++)J=J.redSqr();t(N<K);var R=this.pow(M,new i(1).iushln(K-N-1));ne=ne.redMul(R),M=R.redSqr(),A=A.redMul(M),K=N}return ne},"sqrt"),l.prototype.invm=o(function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},"invm"),l.prototype.pow=o(function(c,d){if(d.isZero())return new i(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var y=4,_=new Array(1<<y);_[0]=new i(1).toRed(this),_[1]=c;for(var w=2;w<_.length;w++)_[w]=this.mul(_[w-1],c);var b=_[0],S=0,D=0,v=d.bitLength()%26;for(v===0&&(v=26),w=d.length-1;w>=0;w--){for(var M=d.words[w],ne=v-1;ne>=0;ne--){var A=M>>ne&1;if(b!==_[0]&&(b=this.sqr(b)),A===0&&S===0){D=0;continue}S<<=1,S|=A,D++,!(D!==y&&(w!==0||ne!==0))&&(b=this.mul(b,_[S]),D=0,S=0)}v=26}return b},"pow"),l.prototype.convertTo=o(function(c){var d=c.umod(this.m);return d===c?d.clone():d},"convertTo"),l.prototype.convertFrom=o(function(c){var d=c.clone();return d.red=null,d},"convertFrom"),i.mont=o(function(c){return new g(c)},"mont");function g(h){l.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(g,"Mont"),n(g,l),g.prototype.convertTo=o(function(c){return this.imod(c.ushln(this.shift))},"convertTo"),g.prototype.convertFrom=o(function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},"convertFrom"),g.prototype.imul=o(function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var y=c.imul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),b=w;return w.cmp(this.m)>=0?b=w.isub(this.m):w.cmpn(0)<0&&(b=w.iadd(this.m)),b._forceRed(this)},"imul"),g.prototype.mul=o(function(c,d){if(c.isZero()||d.isZero())return new i(0)._forceRed(this);var y=c.mul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),b=w;return w.cmp(this.m)>=0?b=w.isub(this.m):w.cmpn(0)<0&&(b=w.iadd(this.m)),b._forceRed(this)},"mul"),g.prototype.invm=o(function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)},"invm")})(typeof O0=="undefined"||O0,Sy)});var u3=me((IU,c3)=>{c3.exports=V0;var f3=128,kM=127,CM=~kM,DM=Math.pow(2,31);function V0(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw V0.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=DM;)e[t++]=r&255|f3,r/=128;for(;r&CM;)e[t++]=r&255|f3,r>>>=7;return e[t]=r|0,V0.bytes=t-n+1,e}o(V0,"encode")});var h3=me((OU,d3)=>{d3.exports=W0;var IM=128,l3=127;function W0(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f||i>49)throw W0.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&l3)<<i:(a&l3)*Math.pow(2,i),i+=7}while(a>=IM);return W0.bytes=s-n,t}o(W0,"read")});var m3=me((PU,p3)=>{var OM=Math.pow(2,7),PM=Math.pow(2,14),NM=Math.pow(2,21),RM=Math.pow(2,28),LM=Math.pow(2,35),BM=Math.pow(2,42),UM=Math.pow(2,49),FM=Math.pow(2,56),$M=Math.pow(2,63);p3.exports=function(r){return r<OM?1:r<PM?2:r<NM?3:r<RM?4:r<LM?5:r<BM?6:r<UM?7:r<FM?8:r<$M?9:10}});var Wf=me((NU,b3)=>{b3.exports={encode:u3(),decode:h3(),encodingLength:m3()}});var v3=me((RU,g3)=>{"use strict";function qM(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var n=0;n<r.length;n++){var i=r.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var a=r.length,f=r.charAt(0),u=Math.log(a)/Math.log(256),m=Math.log(256)/Math.log(a);function p(O){if(O instanceof Uint8Array||(ArrayBuffer.isView(O)?O=new Uint8Array(O.buffer,O.byteOffset,O.byteLength):Array.isArray(O)&&(O=Uint8Array.from(O))),!(O instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(O.length===0)return"";for(var T=0,C=0,$=0,I=O.length;$!==I&&O[$]===0;)$++,T++;for(var U=(I-$)*m+1>>>0,z=new Uint8Array(U);$!==I;){for(var H=O[$],X=0,B=U-1;(H!==0||X<C)&&B!==-1;B--,X++)H+=256*z[B]>>>0,z[B]=H%a>>>0,H=H/a>>>0;if(H!==0)throw new Error("Non-zero carry");C=X,$++}for(var L=U-C;L!==U&&z[L]===0;)L++;for(var F=f.repeat(T);L<U;++L)F+=r.charAt(z[L]);return F}o(p,"encode");function x(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return new Uint8Array;var T=0;if(O[T]!==" "){for(var C=0,$=0;O[T]===f;)C++,T++;for(var I=(O.length-T)*u+1>>>0,U=new Uint8Array(I);O[T];){var z=e[O.charCodeAt(T)];if(z===255)return;for(var H=0,X=I-1;(z!==0||H<$)&&X!==-1;X--,H++)z+=a*U[X]>>>0,U[X]=z%256>>>0,z=z/256>>>0;if(z!==0)throw new Error("Non-zero carry");$=H,T++}if(O[T]!==" "){for(var B=I-$;B!==I&&U[B]===0;)B++;for(var L=new Uint8Array(C+(I-B)),F=C;B!==I;)L[F++]=U[B++];return L}}}o(x,"decodeUnsafe");function k(O){var T=x(O);if(T)return T;throw new Error("Non-base"+a+" character")}return o(k,"decode"),{encode:p,decodeUnsafe:x,decode:k}}o(qM,"base");g3.exports=qM});var tl=me((LU,y3)=>{"use strict";var HM=new TextDecoder,jM=o(r=>HM.decode(r),"decodeText"),zM=new TextEncoder,KM=o(r=>zM.encode(r),"encodeText");function VM(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(VM,"concat");y3.exports={decodeText:jM,encodeText:KM,concat:VM}});var w3=me((BU,x3)=>{"use strict";var{encodeText:WM}=tl(),rl=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=WM(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(let t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}};o(rl,"Base");x3.exports=rl});var E3=me((UU,_3)=>{"use strict";var GM=o((r,e,t)=>{let n={};for(let m=0;m<e.length;++m)n[e[m]]=m;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),a=0,f=0,u=0;for(let m=0;m<i;++m){let p=n[r[m]];if(p===void 0)throw new SyntaxError("Invalid character "+r[m]);f=f<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&f>>a)}if(a>=t||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return s},"decode"),YM=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),JM=o(r=>e=>({encode(t){return YM(t,e,r)},decode(t){return GM(t,e,r)}}),"rfc4648");_3.exports={rfc4648:JM}});var T3=me((FU,A3)=>{"use strict";var Gf=v3(),XM=w3(),{rfc4648:rr}=E3(),{decodeText:ZM,encodeText:QM}=tl(),eA=o(()=>({encode:ZM,decode:QM}),"identity"),S3=[["identity","\0",eA,""],["base2","0",rr(1),"01"],["base8","7",rr(3),"01234567"],["base10","9",Gf,"0123456789"],["base16","f",rr(4),"0123456789abcdef"],["base16upper","F",rr(4),"0123456789ABCDEF"],["base32hex","v",rr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",rr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",rr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",rr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",rr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",rr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",rr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",rr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",rr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Gf,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Gf,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Gf,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Gf,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",rr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",rr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",rr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",rr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],M3=S3.reduce((r,e)=>(r[e[0]]=new XM(e[0],e[1],e[2],e[3]),r),{}),tA=S3.reduce((r,e)=>(r[e[1]]=M3[e[0]],r),{});A3.exports={names:M3,codes:tA}});var G0=me((Oi,C3)=>{"use strict";var Ca=T3(),{encodeText:rA,decodeText:nl,concat:k3}=tl();function nA(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=hs(r);return aA(t,e),k3([n,e],n.length+e.length)}o(nA,"multibase");function iA(r,e){let t=hs(r),n=rA(t.encode(e));return k3([t.codeBuf,n],t.codeBuf.length+n.length)}o(iA,"encode");function oA(r){r instanceof Uint8Array&&(r=nl(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),hs(r[0]).decode(r.substring(1))}o(oA,"decode");function sA(r){if(r instanceof Uint8Array&&(r=nl(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return hs(r[0]).name}catch(e){return!1}}o(sA,"isEncoded");function aA(r,e){hs(r).decode(nl(e))}o(aA,"validEncode");function hs(r){if(Object.prototype.hasOwnProperty.call(Ca.names,r))return Ca.names[r];if(Object.prototype.hasOwnProperty.call(Ca.codes,r))return Ca.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(hs,"encoding");function fA(r){return r instanceof Uint8Array&&(r=nl(r)),hs(r[0])}o(fA,"encodingFromData");Oi=C3.exports=nA;Oi.encode=iA;Oi.decode=oA;Oi.isEncoded=sA;Oi.encoding=hs;Oi.encodingFromData=fA;var cA=Object.freeze(Ca.names),uA=Object.freeze(Ca.codes);Oi.names=cA;Oi.codes=uA});var I3=me(($U,D3)=>{"use strict";function lA(r,e){for(let t=0;t<r.byteLength;t++){if(r[t]<e[t])return-1;if(r[t]>e[t])return 1}return r.byteLength>e.byteLength?1:r.byteLength<e.byteLength?-1:0}o(lA,"compare");D3.exports=lA});var P3=me((qU,O3)=>{"use strict";function dA(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(dA,"concat");O3.exports=dA});var R3=me((HU,N3)=>{"use strict";function hA(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}o(hA,"equals");N3.exports=hA});var J0=me((jU,F3)=>{"use strict";var{bases:L3}=(qc(),tf(s1));function U3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}o(U3,"createCodec");var B3=U3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Y0=U3("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),pA=ie({utf8:B3,"utf-8":B3,hex:L3.base16,latin1:Y0,ascii:Y0,binary:Y0},L3);F3.exports=pA});var q3=me((zU,$3)=>{"use strict";var mA=J0();function bA(r,e="utf8"){let t=mA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}o(bA,"fromString");$3.exports=bA});var j3=me((KU,H3)=>{"use strict";var gA=J0();function vA(r,e="utf8"){let t=gA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}o(vA,"toString");H3.exports=vA});var K3=me((VU,z3)=>{"use strict";function yA(r,e){if(r.length!==e.length)throw new Error("Inputs should have the same length");let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}o(yA,"xor");z3.exports=yA});var X0=me((WU,V3)=>{"use strict";var xA=I3(),wA=P3(),_A=R3(),EA=q3(),SA=j3(),MA=K3();V3.exports={compare:xA,concat:wA,equals:_A,fromString:EA,toString:SA,xor:MA}});var W3=me(ai=>{"use strict";var AA=ai&&ai.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),TA=ai&&ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),kA=ai&&ai.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&AA(e,r,t);return TA(e,r),e};Object.defineProperty(ai,"__esModule",{value:!0});ai.keyToDidDoc=void 0;var CA=kA(X0());function DA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:CA.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(DA,"keyToDidDoc");ai.keyToDidDoc=DA});var G3=me(fi=>{"use strict";var IA=fi&&fi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),OA=fi&&fi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),PA=fi&&fi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&IA(e,r,t);return OA(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.keyToDidDoc=void 0;var Z0=PA(X0()),NA=lu();function RA(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${Z0.toString(e,"base58btc")}`}o(RA,"encodeKey");function LA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=NA.convertPublicKeyToX25519(r),s=`${t}#${RA(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:Z0.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:Z0.toString(i,"base58btc")}]}}o(LA,"keyToDidDoc");fi.keyToDidDoc=LA});var ex=me(Fr=>{"use strict";var BA=Fr&&Fr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),UA=Fr&&Fr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),X3=Fr&&Fr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&BA(e,r,t);return UA(e,r),e},Z3=Fr&&Fr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getResolver=void 0;var Y3=Z3(Wf()),FA=Z3(G0()),$A=X3(W3()),qA=X3(G3()),HA="application/did+ld+json",J3="application/did+json",jA={231:$A,237:qA};function Q3(){return{key:(r,e,t,n)=>Z(this,null,function*(){let i=n.accept||J3,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let a=FA.default.decode(e.id),f=Y3.default.decode(a),u=a.slice(Y3.default.decode.bytes),m=yield jA[f].keyToDidDoc(u,e.id);i===HA?(m["@context"]="https://w3id.org/did/v1",s.didDocument=m):i===J3?s.didDocument=m:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(a){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=a.toString()}return s})}}o(Q3,"getResolver");Fr.getResolver=Q3;Fr.default={getResolver:Q3}});var rx=me((XU,tx)=>{"use strict";tx.exports=function(r,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(s){return function(a){return function(f,u){var m={key:f,value:a[f]},p={key:u,value:a[u]};return s(m,p)}}}(e.cmp),i=[];return o(function s(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var f,u;if(Array.isArray(a)){for(u="[",f=0;f<a.length;f++)f&&(u+=","),u+=s(a[f])||"null";return u+"]"}if(a===null)return"null";if(i.indexOf(a)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var m=i.push(a)-1,p=Object.keys(a).sort(n&&n(a));for(u="",f=0;f<p.length;f++){var x=p[f],k=s(a[x]);!k||(u&&(u+=","),u+=JSON.stringify(x)+":"+k)}return i.splice(m,1),"{"+u+"}"}},"stringify")(r)}});var ic=me((tc,Na)=>{var mT=200,kx="__lodash_hash_undefined__",Cx=9007199254740991,wp="[object Arguments]",bT="[object Array]",Dx="[object Boolean]",Ix="[object Date]",gT="[object Error]",_p="[object Function]",Ox="[object GeneratorFunction]",hl="[object Map]",Px="[object Number]",Ep="[object Object]",gx="[object Promise]",Nx="[object RegExp]",pl="[object Set]",Rx="[object String]",Lx="[object Symbol]",mp="[object WeakMap]",Bx="[object ArrayBuffer]",ml="[object DataView]",Ux="[object Float32Array]",Fx="[object Float64Array]",$x="[object Int8Array]",qx="[object Int16Array]",Hx="[object Int32Array]",jx="[object Uint8Array]",zx="[object Uint8ClampedArray]",Kx="[object Uint16Array]",Vx="[object Uint32Array]",vT=/[\\^$.*+?()[\]{}|]/g,yT=/\w*$/,xT=/^\[object .+?Constructor\]$/,wT=/^(?:0|[1-9]\d*)$/,At={};At[wp]=At[bT]=At[Bx]=At[ml]=At[Dx]=At[Ix]=At[Ux]=At[Fx]=At[$x]=At[qx]=At[Hx]=At[hl]=At[Px]=At[Ep]=At[Nx]=At[pl]=At[Rx]=At[Lx]=At[jx]=At[zx]=At[Kx]=At[Vx]=!0;At[gT]=At[_p]=At[mp]=!1;var _T=typeof global=="object"&&global&&global.Object===Object&&global,ET=typeof self=="object"&&self&&self.Object===Object&&self,Ni=_T||ET||Function("return this")(),Wx=typeof tc=="object"&&tc&&!tc.nodeType&&tc,vx=Wx&&typeof Na=="object"&&Na&&!Na.nodeType&&Na,ST=vx&&vx.exports===Wx;function MT(r,e){return r.set(e[0],e[1]),r}o(MT,"addMapEntry");function AT(r,e){return r.add(e),r}o(AT,"addSetEntry");function TT(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(TT,"arrayEach");function kT(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(kT,"arrayPush");function Gx(r,e,t,n){var i=-1,s=r?r.length:0;for(n&&s&&(t=r[++i]);++i<s;)t=e(t,r[i],i,r);return t}o(Gx,"arrayReduce");function CT(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(CT,"baseTimes");function DT(r,e){return r==null?void 0:r[e]}o(DT,"getValue");function Yx(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch(t){}return e}o(Yx,"isHostObject");function yx(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(yx,"mapToArray");function Sp(r,e){return function(t){return r(e(t))}}o(Sp,"overArg");function xx(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(xx,"setToArray");var IT=Array.prototype,OT=Function.prototype,bl=Object.prototype,pp=Ni["__core-js_shared__"],wx=function(){var r=/[^.]+$/.exec(pp&&pp.keys&&pp.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Jx=OT.toString,go=bl.hasOwnProperty,gl=bl.toString,PT=RegExp("^"+Jx.call(go).replace(vT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_x=ST?Ni.Buffer:void 0,Ex=Ni.Symbol,Sx=Ni.Uint8Array,NT=Sp(Object.getPrototypeOf,Object),RT=Object.create,LT=bl.propertyIsEnumerable,BT=IT.splice,Mx=Object.getOwnPropertySymbols,UT=_x?_x.isBuffer:void 0,FT=Sp(Object.keys,Object),bp=Ba(Ni,"DataView"),rc=Ba(Ni,"Map"),gp=Ba(Ni,"Promise"),vp=Ba(Ni,"Set"),yp=Ba(Ni,"WeakMap"),nc=Ba(Object,"create"),$T=vs(bp),qT=vs(rc),HT=vs(gp),jT=vs(vp),zT=vs(yp),Ax=Ex?Ex.prototype:void 0,Tx=Ax?Ax.valueOf:void 0;function gs(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(gs,"Hash");function KT(){this.__data__=nc?nc(null):{}}o(KT,"hashClear");function VT(r){return this.has(r)&&delete this.__data__[r]}o(VT,"hashDelete");function WT(r){var e=this.__data__;if(nc){var t=e[r];return t===kx?void 0:t}return go.call(e,r)?e[r]:void 0}o(WT,"hashGet");function GT(r){var e=this.__data__;return nc?e[r]!==void 0:go.call(e,r)}o(GT,"hashHas");function YT(r,e){var t=this.__data__;return t[r]=nc&&e===void 0?kx:e,this}o(YT,"hashSet");gs.prototype.clear=KT;gs.prototype.delete=VT;gs.prototype.get=WT;gs.prototype.has=GT;gs.prototype.set=YT;function Ri(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Ri,"ListCache");function JT(){this.__data__=[]}o(JT,"listCacheClear");function XT(r){var e=this.__data__,t=vl(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():BT.call(e,t,1),!0}o(XT,"listCacheDelete");function ZT(r){var e=this.__data__,t=vl(e,r);return t<0?void 0:e[t][1]}o(ZT,"listCacheGet");function QT(r){return vl(this.__data__,r)>-1}o(QT,"listCacheHas");function ek(r,e){var t=this.__data__,n=vl(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(ek,"listCacheSet");Ri.prototype.clear=JT;Ri.prototype.delete=XT;Ri.prototype.get=ZT;Ri.prototype.has=QT;Ri.prototype.set=ek;function Ra(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Ra,"MapCache");function tk(){this.__data__={hash:new gs,map:new(rc||Ri),string:new gs}}o(tk,"mapCacheClear");function rk(r){return yl(this,r).delete(r)}o(rk,"mapCacheDelete");function nk(r){return yl(this,r).get(r)}o(nk,"mapCacheGet");function ik(r){return yl(this,r).has(r)}o(ik,"mapCacheHas");function ok(r,e){return yl(this,r).set(r,e),this}o(ok,"mapCacheSet");Ra.prototype.clear=tk;Ra.prototype.delete=rk;Ra.prototype.get=nk;Ra.prototype.has=ik;Ra.prototype.set=ok;function La(r){this.__data__=new Ri(r)}o(La,"Stack");function sk(){this.__data__=new Ri}o(sk,"stackClear");function ak(r){return this.__data__.delete(r)}o(ak,"stackDelete");function fk(r){return this.__data__.get(r)}o(fk,"stackGet");function ck(r){return this.__data__.has(r)}o(ck,"stackHas");function uk(r,e){var t=this.__data__;if(t instanceof Ri){var n=t.__data__;if(!rc||n.length<mT-1)return n.push([r,e]),this;t=this.__data__=new Ra(n)}return t.set(r,e),this}o(uk,"stackSet");La.prototype.clear=sk;La.prototype.delete=ak;La.prototype.get=fk;La.prototype.has=ck;La.prototype.set=uk;function lk(r,e){var t=Ap(r)||Rk(r)?CT(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||go.call(r,s))&&!(i&&(s=="length"||Ik(s,n)))&&t.push(s);return t}o(lk,"arrayLikeKeys");function Xx(r,e,t){var n=r[e];(!(go.call(r,e)&&t6(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(Xx,"assignValue");function vl(r,e){for(var t=r.length;t--;)if(t6(r[t][0],e))return t;return-1}o(vl,"assocIndexOf");function dk(r,e){return r&&Zx(e,Tp(e),r)}o(dk,"baseAssign");function xp(r,e,t,n,i,s,a){var f;if(n&&(f=s?n(r,i,s,a):n(r)),f!==void 0)return f;if(!xl(r))return r;var u=Ap(r);if(u){if(f=kk(r),!e)return Mk(r,f)}else{var m=bs(r),p=m==_p||m==Ox;if(Bk(r))return vk(r,e);if(m==Ep||m==wp||p&&!s){if(Yx(r))return s?r:{};if(f=Ck(p?{}:r),!e)return Ak(r,dk(f,r))}else{if(!At[m])return s?r:{};f=Dk(r,m,xp,e)}}a||(a=new La);var x=a.get(r);if(x)return x;if(a.set(r,f),!u)var k=t?Tk(r):Tp(r);return TT(k||r,function(O,T){k&&(T=O,O=r[T]),Xx(f,T,xp(O,e,t,n,T,r,a))}),f}o(xp,"baseClone");function hk(r){return xl(r)?RT(r):{}}o(hk,"baseCreate");function pk(r,e,t){var n=e(r);return Ap(r)?n:kT(n,t(r))}o(pk,"baseGetAllKeys");function mk(r){return gl.call(r)}o(mk,"baseGetTag");function bk(r){if(!xl(r)||Pk(r))return!1;var e=n6(r)||Yx(r)?PT:xT;return e.test(vs(r))}o(bk,"baseIsNative");function gk(r){if(!e6(r))return FT(r);var e=[];for(var t in Object(r))go.call(r,t)&&t!="constructor"&&e.push(t);return e}o(gk,"baseKeys");function vk(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(vk,"cloneBuffer");function Mp(r){var e=new r.constructor(r.byteLength);return new Sx(e).set(new Sx(r)),e}o(Mp,"cloneArrayBuffer");function yk(r,e){var t=e?Mp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(yk,"cloneDataView");function xk(r,e,t){var n=e?t(yx(r),!0):yx(r);return Gx(n,MT,new r.constructor)}o(xk,"cloneMap");function wk(r){var e=new r.constructor(r.source,yT.exec(r));return e.lastIndex=r.lastIndex,e}o(wk,"cloneRegExp");function _k(r,e,t){var n=e?t(xx(r),!0):xx(r);return Gx(n,AT,new r.constructor)}o(_k,"cloneSet");function Ek(r){return Tx?Object(Tx.call(r)):{}}o(Ek,"cloneSymbol");function Sk(r,e){var t=e?Mp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(Sk,"cloneTypedArray");function Mk(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(Mk,"copyArray");function Zx(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var a=e[i],f=n?n(t[a],r[a],a,t,r):void 0;Xx(t,a,f===void 0?r[a]:f)}return t}o(Zx,"copyObject");function Ak(r,e){return Zx(r,Qx(r),e)}o(Ak,"copySymbols");function Tk(r){return pk(r,Tp,Qx)}o(Tk,"getAllKeys");function yl(r,e){var t=r.__data__;return Ok(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(yl,"getMapData");function Ba(r,e){var t=DT(r,e);return bk(t)?t:void 0}o(Ba,"getNative");var Qx=Mx?Sp(Mx,Object):$k,bs=mk;(bp&&bs(new bp(new ArrayBuffer(1)))!=ml||rc&&bs(new rc)!=hl||gp&&bs(gp.resolve())!=gx||vp&&bs(new vp)!=pl||yp&&bs(new yp)!=mp)&&(bs=o(function(r){var e=gl.call(r),t=e==Ep?r.constructor:void 0,n=t?vs(t):void 0;if(n)switch(n){case $T:return ml;case qT:return hl;case HT:return gx;case jT:return pl;case zT:return mp}return e},"getTag"));function kk(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&go.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(kk,"initCloneArray");function Ck(r){return typeof r.constructor=="function"&&!e6(r)?hk(NT(r)):{}}o(Ck,"initCloneObject");function Dk(r,e,t,n){var i=r.constructor;switch(e){case Bx:return Mp(r);case Dx:case Ix:return new i(+r);case ml:return yk(r,n);case Ux:case Fx:case $x:case qx:case Hx:case jx:case zx:case Kx:case Vx:return Sk(r,n);case hl:return xk(r,n,t);case Px:case Rx:return new i(r);case Nx:return wk(r);case pl:return _k(r,n,t);case Lx:return Ek(r)}}o(Dk,"initCloneByTag");function Ik(r,e){return e=e==null?Cx:e,!!e&&(typeof r=="number"||wT.test(r))&&r>-1&&r%1==0&&r<e}o(Ik,"isIndex");function Ok(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(Ok,"isKeyable");function Pk(r){return!!wx&&wx in r}o(Pk,"isMasked");function e6(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||bl;return r===t}o(e6,"isPrototype");function vs(r){if(r!=null){try{return Jx.call(r)}catch(e){}try{return r+""}catch(e){}}return""}o(vs,"toSource");function Nk(r){return xp(r,!0,!0)}o(Nk,"cloneDeep");function t6(r,e){return r===e||r!==r&&e!==e}o(t6,"eq");function Rk(r){return Lk(r)&&go.call(r,"callee")&&(!LT.call(r,"callee")||gl.call(r)==wp)}o(Rk,"isArguments");var Ap=Array.isArray;function r6(r){return r!=null&&Uk(r.length)&&!n6(r)}o(r6,"isArrayLike");function Lk(r){return Fk(r)&&r6(r)}o(Lk,"isArrayLikeObject");var Bk=UT||qk;function n6(r){var e=xl(r)?gl.call(r):"";return e==_p||e==Ox}o(n6,"isFunction");function Uk(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Cx}o(Uk,"isLength");function xl(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(xl,"isObject");function Fk(r){return!!r&&typeof r=="object"}o(Fk,"isObjectLike");function Tp(r){return r6(r)?lk(r):gk(r)}o(Tp,"keys");function $k(){return[]}o($k,"stubArray");function qk(){return!1}o(qk,"stubFalse");Na.exports=Nk});var M6=me((qF,El)=>{var i6,o6,s6,a6,f6,c6,u6,l6,d6,wl,kp,h6,p6,m6,Ua,b6,g6,v6,y6,x6,w6,_6,E6,S6,_l;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof El=="object"&&typeof El.exports=="object"?r(t(e,t(El.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}o(t,"createExporter")})(function(r){var e=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])};i6=o(function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}o(s,"__"),n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},"__extends"),o6=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(n[f]=i[f])}return n},s6=o(function(n,i){var s={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,a=Object.getOwnPropertySymbols(n);f<a.length;f++)i.indexOf(a[f])<0&&Object.prototype.propertyIsEnumerable.call(n,a[f])&&(s[a[f]]=n[a[f]]);return s},"__rest"),a6=o(function(n,i,s,a){var f=arguments.length,u=f<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,i,s,a);else for(var p=n.length-1;p>=0;p--)(m=n[p])&&(u=(f<3?m(u):f>3?m(i,s,u):m(i,s))||u);return f>3&&u&&Object.defineProperty(i,s,u),u},"__decorate"),f6=o(function(n,i){return function(s,a){i(s,a,n)}},"__param"),c6=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),u6=o(function(n,i,s,a){function f(u){return u instanceof s?u:new s(function(m){m(u)})}return o(f,"adopt"),new(s||(s=Promise))(function(u,m){function p(O){try{k(a.next(O))}catch(T){m(T)}}o(p,"fulfilled");function x(O){try{k(a.throw(O))}catch(T){m(T)}}o(x,"rejected");function k(O){O.done?u(O.value):f(O.value).then(p,x)}o(k,"step"),k((a=a.apply(n,i||[])).next())})},"__awaiter"),l6=o(function(n,i){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,f,u,m;return m={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function p(k){return function(O){return x([k,O])}}function x(k){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,f&&(u=k[0]&2?f.return:k[0]?f.throw||((u=f.return)&&u.call(f),0):f.next)&&!(u=u.call(f,k[1])).done)return u;switch(f=0,u&&(k=[k[0]&2,u.value]),k[0]){case 0:case 1:u=k;break;case 4:return s.label++,{value:k[1],done:!1};case 5:s.label++,f=k[1],k=[0];continue;case 7:k=s.ops.pop(),s.trys.pop();continue;default:if(u=s.trys,!(u=u.length>0&&u[u.length-1])&&(k[0]===6||k[0]===2)){s=0;continue}if(k[0]===3&&(!u||k[1]>u[0]&&k[1]<u[3])){s.label=k[1];break}if(k[0]===6&&s.label<u[1]){s.label=u[1],u=k;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(k);break}u[2]&&s.ops.pop(),s.trys.pop();continue}k=i.call(n,s)}catch(O){k=[6,O],f=0}finally{a=u=0}if(k[0]&5)throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}},"__generator"),d6=o(function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&_l(i,n,s)},"__exportStar"),_l=Object.create?function(n,i,s,a){a===void 0&&(a=s);var f=Object.getOwnPropertyDescriptor(i,s);(!f||("get"in f?!i.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,f)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]},wl=o(function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],a=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),kp=o(function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),f,u=[],m;try{for(;(i===void 0||i-- >0)&&!(f=a.next()).done;)u.push(f.value)}catch(p){m={error:p}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(m)throw m.error}}return u},"__read"),h6=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(kp(arguments[i]));return n},"__spread"),p6=o(function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var a=Array(n),f=0,i=0;i<s;i++)for(var u=arguments[i],m=0,p=u.length;m<p;m++,f++)a[f]=u[m];return a},"__spreadArrays"),m6=o(function(n,i,s){if(s||arguments.length===2)for(var a=0,f=i.length,u;a<f;a++)(u||!(a in i))&&(u||(u=Array.prototype.slice.call(i,0,a)),u[a]=i[a]);return n.concat(u||Array.prototype.slice.call(i))},"__spreadArray"),Ua=o(function(n){return this instanceof Ua?(this.v=n,this):new Ua(n)},"__await"),b6=o(function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(n,i||[]),f,u=[];return f={},m("next"),m("throw"),m("return"),f[Symbol.asyncIterator]=function(){return this},f;function m(C){a[C]&&(f[C]=function($){return new Promise(function(I,U){u.push([C,$,I,U])>1||p(C,$)})})}function p(C,$){try{x(a[C]($))}catch(I){T(u[0][3],I)}}function x(C){C.value instanceof Ua?Promise.resolve(C.value.v).then(k,O):T(u[0][2],C)}function k(C){p("next",C)}function O(C){p("throw",C)}function T(C,$){C($),u.shift(),u.length&&p(u[0][0],u[0][1])}},"__asyncGenerator"),g6=o(function(n){var i,s;return i={},a("next"),a("throw",function(f){throw f}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(f,u){i[f]=n[f]?function(m){return(s=!s)?{value:Ua(n[f](m)),done:f==="return"}:u?u(m):m}:u}},"__asyncDelegator"),v6=o(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof wl=="function"?wl(n):n[Symbol.iterator](),s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s);function a(u){s[u]=n[u]&&function(m){return new Promise(function(p,x){m=n[u](m),f(p,x,m.done,m.value)})}}function f(u,m,p,x){Promise.resolve(x).then(function(k){u({value:k,done:p})},m)}},"__asyncValues"),y6=o(function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n},"__makeTemplateObject");var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};x6=o(function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&_l(i,n,s);return t(i,n),i},"__importStar"),w6=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),_6=o(function(n,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(n):a?a.value:i.get(n)},"__classPrivateFieldGet"),E6=o(function(n,i,s,a,f){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!f:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?f.call(n,s):f?f.value=s:i.set(n,s),s},"__classPrivateFieldSet"),S6=o(function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},"__classPrivateFieldIn"),r("__extends",i6),r("__assign",o6),r("__rest",s6),r("__decorate",a6),r("__param",f6),r("__metadata",c6),r("__awaiter",u6),r("__generator",l6),r("__exportStar",d6),r("__createBinding",_l),r("__values",wl),r("__read",kp),r("__spread",h6),r("__spreadArrays",p6),r("__spreadArray",m6),r("__await",Ua),r("__asyncGenerator",b6),r("__asyncDelegator",g6),r("__asyncValues",v6),r("__makeTemplateObject",y6),r("__importStar",x6),r("__importDefault",w6),r("__classPrivateFieldGet",_6),r("__classPrivateFieldSet",E6),r("__classPrivateFieldIn",S6)})});var dw=me((Li,lw)=>{var uw=typeof self!="undefined"?self:Li,Vl=function(){function r(){this.fetch=!1,this.DOMException=uw.DOMException}return o(r,"F"),r.prototype=uw,new r}();(function(r){var e=function(t){var n={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(E){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function i(E){return E&&DataView.prototype.isPrototypeOf(E)}if(o(i,"isDataView"),n.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(E){return E&&s.indexOf(Object.prototype.toString.call(E))>-1};function f(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}o(f,"normalizeName");function u(E){return typeof E!="string"&&(E=String(E)),E}o(u,"normalizeValue");function m(E){var l={next:function(){var g=E.shift();return{done:g===void 0,value:g}}};return n.iterable&&(l[Symbol.iterator]=function(){return l}),l}o(m,"iteratorFor");function p(E){this.map={},E instanceof p?E.forEach(function(l,g){this.append(g,l)},this):Array.isArray(E)?E.forEach(function(l){this.append(l[0],l[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(l){this.append(l,E[l])},this)}o(p,"Headers"),p.prototype.append=function(E,l){E=f(E),l=u(l);var g=this.map[E];this.map[E]=g?g+", "+l:l},p.prototype.delete=function(E){delete this.map[f(E)]},p.prototype.get=function(E){return E=f(E),this.has(E)?this.map[E]:null},p.prototype.has=function(E){return this.map.hasOwnProperty(f(E))},p.prototype.set=function(E,l){this.map[f(E)]=u(l)},p.prototype.forEach=function(E,l){for(var g in this.map)this.map.hasOwnProperty(g)&&E.call(l,this.map[g],g,this)},p.prototype.keys=function(){var E=[];return this.forEach(function(l,g){E.push(g)}),m(E)},p.prototype.values=function(){var E=[];return this.forEach(function(l){E.push(l)}),m(E)},p.prototype.entries=function(){var E=[];return this.forEach(function(l,g){E.push([g,l])}),m(E)},n.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function x(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}o(x,"consumed");function k(E){return new Promise(function(l,g){E.onload=function(){l(E.result)},E.onerror=function(){g(E.error)}})}o(k,"fileReaderReady");function O(E){var l=new FileReader,g=k(l);return l.readAsArrayBuffer(E),g}o(O,"readBlobAsArrayBuffer");function T(E){var l=new FileReader,g=k(l);return l.readAsText(E),g}o(T,"readBlobAsText");function C(E){for(var l=new Uint8Array(E),g=new Array(l.length),h=0;h<l.length;h++)g[h]=String.fromCharCode(l[h]);return g.join("")}o(C,"readArrayBufferAsText");function $(E){if(E.slice)return E.slice(0);var l=new Uint8Array(E.byteLength);return l.set(new Uint8Array(E)),l.buffer}o($,"bufferClone");function I(){return this.bodyUsed=!1,this._initBody=function(E){this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:n.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:n.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():n.arrayBuffer&&n.blob&&i(E)?(this._bodyArrayBuffer=$(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||a(E))?this._bodyArrayBuffer=$(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var E=x(this);if(E)return E;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?x(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(O)}),this.text=function(){var E=x(this);if(E)return E;if(this._bodyBlob)return T(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(X)}),this.json=function(){return this.text().then(JSON.parse)},this}o(I,"Body");var U=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function z(E){var l=E.toUpperCase();return U.indexOf(l)>-1?l:E}o(z,"normalizeMethod");function H(E,l){l=l||{};var g=l.body;if(E instanceof H){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,l.headers||(this.headers=new p(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!g&&E._bodyInit!=null&&(g=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=l.credentials||this.credentials||"same-origin",(l.headers||!this.headers)&&(this.headers=new p(l.headers)),this.method=z(l.method||this.method||"GET"),this.mode=l.mode||this.mode||null,this.signal=l.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&g)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(g)}o(H,"Request"),H.prototype.clone=function(){return new H(this,{body:this._bodyInit})};function X(E){var l=new FormData;return E.trim().split("&").forEach(function(g){if(g){var h=g.split("="),c=h.shift().replace(/\+/g," "),d=h.join("=").replace(/\+/g," ");l.append(decodeURIComponent(c),decodeURIComponent(d))}}),l}o(X,"decode");function B(E){var l=new p,g=E.replace(/\r?\n[\t ]+/g," ");return g.split(/\r?\n/).forEach(function(h){var c=h.split(":"),d=c.shift().trim();if(d){var y=c.join(":").trim();l.append(d,y)}}),l}o(B,"parseHeaders"),I.call(H.prototype);function L(E,l){l||(l={}),this.type="default",this.status=l.status===void 0?200:l.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in l?l.statusText:"OK",this.headers=new p(l.headers),this.url=l.url||"",this._initBody(E)}o(L,"Response"),I.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},L.error=function(){var E=new L(null,{status:0,statusText:""});return E.type="error",E};var F=[301,302,303,307,308];L.redirect=function(E,l){if(F.indexOf(l)===-1)throw new RangeError("Invalid status code");return new L(null,{status:l,headers:{location:E}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(E){t.DOMException=function(l,g){this.message=l,this.name=g;var h=Error(l);this.stack=h.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function re(E,l){return new Promise(function(g,h){var c=new H(E,l);if(c.signal&&c.signal.aborted)return h(new t.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function y(){d.abort()}o(y,"abortXhr"),d.onload=function(){var _={status:d.status,statusText:d.statusText,headers:B(d.getAllResponseHeaders()||"")};_.url="responseURL"in d?d.responseURL:_.headers.get("X-Request-URL");var w="response"in d?d.response:d.responseText;g(new L(w,_))},d.onerror=function(){h(new TypeError("Network request failed"))},d.ontimeout=function(){h(new TypeError("Network request failed"))},d.onabort=function(){h(new t.DOMException("Aborted","AbortError"))},d.open(c.method,c.url,!0),c.credentials==="include"?d.withCredentials=!0:c.credentials==="omit"&&(d.withCredentials=!1),"responseType"in d&&n.blob&&(d.responseType="blob"),c.headers.forEach(function(_,w){d.setRequestHeader(w,_)}),c.signal&&(c.signal.addEventListener("abort",y),d.onreadystatechange=function(){d.readyState===4&&c.signal.removeEventListener("abort",y)}),d.send(typeof c._bodyInit=="undefined"?null:c._bodyInit)})}return o(re,"fetch"),re.polyfill=!0,r.fetch||(r.fetch=re,r.Headers=p,r.Request=H,r.Response=L),t.Headers=p,t.Request=H,t.Response=L,t.fetch=re,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(Vl);Vl.fetch.ponyfill=!0;delete Vl.fetch.polyfill;var Ka=Vl;Li=Ka.fetch;Li.default=Ka.fetch;Li.fetch=Ka.fetch;Li.Headers=Ka.Headers;Li.Request=Ka.Request;Li.Response=Ka.Response;lw.exports=Li});var Mw=me((Yz,Sw)=>{"use strict";var gC=function(){function r(t,n){if(typeof t!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+t+"."));this._batchLoadFn=t,this._maxBatchSize=wC(n),this._batchScheduleFn=_C(n),this._cacheKeyFn=EC(n),this._cacheMap=SC(n),this._batch=null}o(r,"DataLoader");var e=r.prototype;return e.load=o(function(n){if(n==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(n)+"."));var i=yC(this),s=this._cacheMap,a=this._cacheKeyFn(n);if(s){var f=s.get(a);if(f){var u=i.cacheHits||(i.cacheHits=[]);return new Promise(function(p){u.push(function(){p(f)})})}}i.keys.push(n);var m=new Promise(function(p,x){i.callbacks.push({resolve:p,reject:x})});return s&&s.set(a,m),m},"load"),e.loadMany=o(function(n){if(!Ew(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var i=[],s=0;s<n.length;s++)i.push(this.load(n[s]).catch(function(a){return a}));return Promise.all(i)},"loadMany"),e.clear=o(function(n){var i=this._cacheMap;if(i){var s=this._cacheKeyFn(n);i.delete(s)}return this},"clear"),e.clearAll=o(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),e.prime=o(function(n,i){var s=this._cacheMap;if(s){var a=this._cacheKeyFn(n);if(s.get(a)===void 0){var f;i instanceof Error?(f=Promise.reject(i),f.catch(function(){})):f=Promise.resolve(i),s.set(a,f)}}return this},"prime"),r}(),vC=typeof process=="object"&&typeof process.nextTick=="function"?function(r){Vp||(Vp=Promise.resolve()),Vp.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},Vp;function yC(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize&&(!e.cacheHits||e.cacheHits.length<r._maxBatchSize))return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){xC(r,t)}),t}o(yC,"getCurrentBatch");function xC(r,e){if(e.hasDispatched=!0,e.keys.length===0){Wp(e);return}var t=r._batchLoadFn(e.keys);if(!t||typeof t.then!="function")return _w(r,e,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(t)+".")));t.then(function(n){if(!Ew(n))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(n)+"."));if(n.length!==e.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."+(`
626
+ `}),h},"errorsToAscii"),j=!1,H=!1,X=!1,B=!1,L=0,F;if(this.errors=[],Buffer.isBuffer(e))this.chars=s.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=s.decode("STRING",e);else throw new Error(`${t}input source is not a string, byte Buffer or character array`);this.sabnf=s.encode("STRING",this.chars),this.scan=o(function(E,l){this.lines=a(this.chars,this.errors,E,l),j=!0},"scan"),this.parse=o(function(E,l){if(!j)throw new Error(`${t}grammar not scanned`);f.syntax(this.chars,this.lines,this.errors,E,l),H=!0},"parse"),this.translate=o(function(){if(!H)throw new Error(`${t}grammar not scanned and parsed`);let E=f.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=E.rules,this.udts=E.udts,F=E.lineMap,X=!0)},"translate"),this.attributes=o(function(){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return L=u(this.rules,this.udts,F,this.errors),B=!0,L},"attrs"),this.generate=o(function(E){if(this.lines=a(this.chars,this.errors,E),this.errors.length||(f.syntax(this.chars,this.lines,this.errors,E),this.errors.length))return;let l=f.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=l.rules,this.udts=l.udts,F=l.lineMap,L=u(this.rules,this.udts,F,this.errors),B=!0)},"generate"),this.displayRules=o(function(E="index"){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return k(this.rules,this.udts,E)},"displayRules"),this.displayRuleDependencies=o(function(E="index"){if(!B)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return x(E)},"displayRuleDependencies"),this.displayAttributes=o(function(E="index"){if(!B)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return L&&p(E),m(E)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!B)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return p()},"displayAttributeErrors"),this.toSource=o(function(E){if(!B)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateSource(this.chars,this.lines,this.rules,this.udts,E)},"toSource"),this.toObject=o(function(){if(!B)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return U(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(E){return O(this.errors,this.lines,this.chars,E)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return C(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return $(this.lines)},"linesToHtmlFunc")},"api")});var P0=me((Sy,I0)=>{(function(r,e){"use strict";function t(h,c){if(!h)throw new Error(c||"Assertion failed")}o(t,"assert");function n(h,c){h.super_=c;var d=o(function(){},"TempCtor");d.prototype=c.prototype,h.prototype=new d,h.prototype.constructor=h}o(n,"inherits");function i(h,c,d){if(i.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(h||0,c||10,d||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=eh().Buffer}catch(h){}i.isBN=o(function(c){return c instanceof i?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===i.wordSize&&Array.isArray(c.words)},"isBN"),i.max=o(function(c,d){return c.cmp(d)>0?c:d},"max"),i.min=o(function(c,d){return c.cmp(d)<0?c:d},"min"),i.prototype._init=o(function(c,d,y){if(typeof c=="number")return this._initNumber(c,d,y);if(typeof c=="object")return this._initArray(c,d,y);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var _=0;c[0]==="-"&&(_++,this.negative=1),_<c.length&&(d===16?this._parseHex(c,_,y):(this._parseBase(c,d,_),y==="le"&&this._initArray(this.toArray(),d,y)))},"init"),i.prototype._initNumber=o(function(c,d,y){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),d,y)},"_initNumber"),i.prototype._initArray=o(function(c,d,y){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w,b,S=0;if(y==="be")for(_=c.length-1,w=0;_>=0;_-=3)b=c[_]|c[_-1]<<8|c[_-2]<<16,this.words[w]|=b<<S&67108863,this.words[w+1]=b>>>26-S&67108863,S+=24,S>=26&&(S-=26,w++);else if(y==="le")for(_=0,w=0;_<c.length;_+=3)b=c[_]|c[_+1]<<8|c[_+2]<<16,this.words[w]|=b<<S&67108863,this.words[w+1]=b>>>26-S&67108863,S+=24,S>=26&&(S-=26,w++);return this._strip()},"_initArray");function a(h,c){var d=h.charCodeAt(c);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;t(!1,"Invalid character in "+h)}o(a,"parseHex4Bits");function f(h,c,d){var y=a(h,d);return d-1>=c&&(y|=a(h,d-1)<<4),y}o(f,"parseHexByte"),i.prototype._parseHex=o(function(c,d,y){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w=0,b=0,S;if(y==="be")for(_=c.length-1;_>=d;_-=2)S=f(c,d,_)<<w,this.words[b]|=S&67108863,w>=18?(w-=18,b+=1,this.words[b]|=S>>>26):w+=8;else{var D=c.length-d;for(_=D%2===0?d+1:d;_<c.length;_+=2)S=f(c,d,_)<<w,this.words[b]|=S&67108863,w>=18?(w-=18,b+=1,this.words[b]|=S>>>26):w+=8}this._strip()},"_parseHex");function u(h,c,d,y){for(var _=0,w=0,b=Math.min(h.length,d),S=c;S<b;S++){var D=h.charCodeAt(S)-48;_*=y,D>=49?w=D-49+10:D>=17?w=D-17+10:w=D,t(D>=0&&w<y,"Invalid character"),_+=w}return _}o(u,"parseBase"),i.prototype._parseBase=o(function(c,d,y){this.words=[0],this.length=1;for(var _=0,w=1;w<=67108863;w*=d)_++;_--,w=w/d|0;for(var b=c.length-y,S=b%_,D=Math.min(b,b-S)+y,v=0,M=y;M<D;M+=_)v=u(c,M,M+_,d),this.imuln(w),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(S!==0){var ne=1;for(v=u(c,M,c.length,d),M=0;M<S;M++)ne*=d;this.imuln(ne),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},"_parseBase"),i.prototype.copy=o(function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},"copy");function m(h,c){h.words=c.words,h.length=c.length,h.negative=c.negative,h.red=c.red}if(o(m,"move"),i.prototype._move=o(function(c){m(c,this)},"_move"),i.prototype.clone=o(function(){var c=new i(null);return this.copy(c),c},"clone"),i.prototype._expand=o(function(c){for(;this.length<c;)this.words[this.length++]=0;return this},"_expand"),i.prototype._strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch(h){i.prototype.inspect=p}else i.prototype.inspect=p;function p(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(p,"inspect");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"],k=[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],I=[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];i.prototype.toString=o(function(c,d){c=c||10,d=d|0||1;var y;if(c===16||c==="hex"){y="";for(var _=0,w=0,b=0;b<this.length;b++){var S=this.words[b],D=((S<<_|w)&16777215).toString(16);w=S>>>24-_&16777215,_+=2,_>=26&&(_-=26,b--),w!==0||b!==this.length-1?y=x[6-D.length]+D+y:y=D+y}for(w!==0&&(y=w.toString(16)+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(c===(c|0)&&c>=2&&c<=36){var v=k[c],M=I[c];y="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var A=ne.modrn(M).toString(c);ne=ne.idivn(M),ne.isZero()?y=A+y:y=x[v-A.length]+A+y}for(this.isZero()&&(y="0"+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(c,d){return this.toArrayLike(s,c,d)},"toBuffer")),i.prototype.toArray=o(function(c,d){return this.toArrayLike(Array,c,d)},"toArray");var T=o(function(c,d){return c.allocUnsafe?c.allocUnsafe(d):new c(d)},"allocate");i.prototype.toArrayLike=o(function(c,d,y){this._strip();var _=this.byteLength(),w=y||Math.max(1,_);t(_<=w,"byte array longer than desired length"),t(w>0,"Requested array length <= 0");var b=T(c,w),S=d==="le"?"LE":"BE";return this["_toArrayLike"+S](b,_),b},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(c,d){for(var y=0,_=0,w=0,b=0;w<this.length;w++){var S=this.words[w]<<b|_;c[y++]=S&255,y<c.length&&(c[y++]=S>>8&255),y<c.length&&(c[y++]=S>>16&255),b===6?(y<c.length&&(c[y++]=S>>24&255),_=0,b=0):(_=S>>>24,b+=2)}if(y<c.length)for(c[y++]=_;y<c.length;)c[y++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(c,d){for(var y=c.length-1,_=0,w=0,b=0;w<this.length;w++){var S=this.words[w]<<b|_;c[y--]=S&255,y>=0&&(c[y--]=S>>8&255),y>=0&&(c[y--]=S>>16&255),b===6?(y>=0&&(c[y--]=S>>24&255),_=0,b=0):(_=S>>>24,b+=2)}if(y>=0)for(c[y--]=_;y>=0;)c[y--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(c){return 32-Math.clz32(c)},"_countBits"):i.prototype._countBits=o(function(c){var d=c,y=0;return d>=4096&&(y+=13,d>>>=13),d>=64&&(y+=7,d>>>=7),d>=8&&(y+=4,d>>>=4),d>=2&&(y+=2,d>>>=2),y+d},"_countBits"),i.prototype._zeroBits=o(function(c){if(c===0)return 26;var d=c,y=0;return(d&8191)===0&&(y+=13,d>>>=13),(d&127)===0&&(y+=7,d>>>=7),(d&15)===0&&(y+=4,d>>>=4),(d&3)===0&&(y+=2,d>>>=2),(d&1)===0&&y++,y},"_zeroBits"),i.prototype.bitLength=o(function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d},"bitLength");function C(h){for(var c=new Array(h.bitLength()),d=0;d<c.length;d++){var y=d/26|0,_=d%26;c[d]=h.words[y]>>>_&1}return c}o(C,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(c+=y,y!==26)break}return c},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this._strip()},"iuor"),i.prototype.ior=o(function(c){return t((this.negative|c.negative)===0),this.iuor(c)},"ior"),i.prototype.or=o(function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},"or"),i.prototype.uor=o(function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(c){var d;this.length>c.length?d=c:d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&c.words[y];return this.length=d.length,this._strip()},"iuand"),i.prototype.iand=o(function(c){return t((this.negative|c.negative)===0),this.iuand(c)},"iand"),i.prototype.and=o(function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},"and"),i.prototype.uand=o(function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(c){var d,y;this.length>c.length?(d=this,y=c):(d=c,y=this);for(var _=0;_<y.length;_++)this.words[_]=d.words[_]^y.words[_];if(this!==d)for(;_<d.length;_++)this.words[_]=d.words[_];return this.length=d.length,this._strip()},"iuxor"),i.prototype.ixor=o(function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},"ixor"),i.prototype.xor=o(function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,y=c%26;this._expand(d),y>0&&d--;for(var _=0;_<d;_++)this.words[_]=~this.words[_]&67108863;return y>0&&(this.words[_]=~this.words[_]&67108863>>26-y),this._strip()},"inotn"),i.prototype.notn=o(function(c){return this.clone().inotn(c)},"notn"),i.prototype.setn=o(function(c,d){t(typeof c=="number"&&c>=0);var y=c/26|0,_=c%26;return this._expand(y+1),d?this.words[y]=this.words[y]|1<<_:this.words[y]=this.words[y]&~(1<<_),this._strip()},"setn"),i.prototype.iadd=o(function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var y,_;this.length>c.length?(y=this,_=c):(y=c,_=this);for(var w=0,b=0;b<_.length;b++)d=(y.words[b]|0)+(_.words[b]|0)+w,this.words[b]=d&67108863,w=d>>>26;for(;w!==0&&b<y.length;b++)d=(y.words[b]|0)+w,this.words[b]=d&67108863,w=d>>>26;if(this.length=y.length,w!==0)this.words[this.length]=w,this.length++;else if(y!==this)for(;b<y.length;b++)this.words[b]=y.words[b];return this},"iadd"),i.prototype.add=o(function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},"add"),i.prototype.isub=o(function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var y=this.cmp(c);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,w;y>0?(_=this,w=c):(_=c,w=this);for(var b=0,S=0;S<w.length;S++)d=(_.words[S]|0)-(w.words[S]|0)+b,b=d>>26,this.words[S]=d&67108863;for(;b!==0&&S<_.length;S++)d=(_.words[S]|0)+b,b=d>>26,this.words[S]=d&67108863;if(b===0&&S<_.length&&_!==this)for(;S<_.length;S++)this.words[S]=_.words[S];return this.length=Math.max(this.length,S),_!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(c){return this.clone().isub(c)},"sub");function $(h,c,d){d.negative=c.negative^h.negative;var y=h.length+c.length|0;d.length=y,y=y-1|0;var _=h.words[0]|0,w=c.words[0]|0,b=_*w,S=b&67108863,D=b/67108864|0;d.words[0]=S;for(var v=1;v<y;v++){for(var M=D>>>26,ne=D&67108863,A=Math.min(v,c.length-1),K=Math.max(0,v-h.length+1);K<=A;K++){var J=v-K|0;_=h.words[J]|0,w=c.words[K]|0,b=_*w+ne,M+=b/67108864|0,ne=b&67108863}d.words[v]=ne|0,D=M|0}return D!==0?d.words[v]=D|0:d.length--,d._strip()}o($,"smallMulTo");var O=o(function(c,d,y){var _=c.words,w=d.words,b=y.words,S=0,D,v,M,ne=_[0]|0,A=ne&8191,K=ne>>>13,J=_[1]|0,N=J&8191,R=J>>>13,V=_[2]|0,W=V&8191,ee=V>>>13,he=_[3]|0,fe=he&8191,Y=he>>>13,pe=_[4]|0,Q=pe&8191,ce=pe>>>13,q=_[5]|0,se=q&8191,be=q>>>13,ke=_[6]|0,we=ke&8191,Ie=ke>>>13,vr=_[7]|0,te=vr&8191,G=vr>>>13,P=_[8]|0,z=P&8191,ae=P>>>13,ue=_[9]|0,le=ue&8191,ge=ue>>>13,ft=w[0]|0,Ee=ft&8191,ve=ft>>>13,lt=w[1]|0,De=lt&8191,Ne=lt>>>13,Bn=w[2]|0,Le=Bn&8191,Be=Bn>>>13,Un=w[3]|0,Ue=Un&8191,Fe=Un>>>13,Fn=w[4]|0,$e=Fn&8191,qe=Fn>>>13,$n=w[5]|0,He=$n&8191,ze=$n>>>13,qn=w[6]|0,je=qn&8191,Ke=qn>>>13,Hn=w[7]|0,Ve=Hn&8191,We=Hn>>>13,zn=w[8]|0,Ge=zn&8191,Ye=zn>>>13,gn=w[9]|0,mt=gn&8191,bt=gn>>>13;y.negative=c.negative^d.negative,y.length=19,D=Math.imul(A,Ee),v=Math.imul(A,ve),v=v+Math.imul(K,Ee)|0,M=Math.imul(K,ve);var Yr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,D=Math.imul(N,Ee),v=Math.imul(N,ve),v=v+Math.imul(R,Ee)|0,M=Math.imul(R,ve),D=D+Math.imul(A,De)|0,v=v+Math.imul(A,Ne)|0,v=v+Math.imul(K,De)|0,M=M+Math.imul(K,Ne)|0;var Jr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,D=Math.imul(W,Ee),v=Math.imul(W,ve),v=v+Math.imul(ee,Ee)|0,M=Math.imul(ee,ve),D=D+Math.imul(N,De)|0,v=v+Math.imul(N,Ne)|0,v=v+Math.imul(R,De)|0,M=M+Math.imul(R,Ne)|0,D=D+Math.imul(A,Le)|0,v=v+Math.imul(A,Be)|0,v=v+Math.imul(K,Le)|0,M=M+Math.imul(K,Be)|0;var Xr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,D=Math.imul(fe,Ee),v=Math.imul(fe,ve),v=v+Math.imul(Y,Ee)|0,M=Math.imul(Y,ve),D=D+Math.imul(W,De)|0,v=v+Math.imul(W,Ne)|0,v=v+Math.imul(ee,De)|0,M=M+Math.imul(ee,Ne)|0,D=D+Math.imul(N,Le)|0,v=v+Math.imul(N,Be)|0,v=v+Math.imul(R,Le)|0,M=M+Math.imul(R,Be)|0,D=D+Math.imul(A,Ue)|0,v=v+Math.imul(A,Fe)|0,v=v+Math.imul(K,Ue)|0,M=M+Math.imul(K,Fe)|0;var Zr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,D=Math.imul(Q,Ee),v=Math.imul(Q,ve),v=v+Math.imul(ce,Ee)|0,M=Math.imul(ce,ve),D=D+Math.imul(fe,De)|0,v=v+Math.imul(fe,Ne)|0,v=v+Math.imul(Y,De)|0,M=M+Math.imul(Y,Ne)|0,D=D+Math.imul(W,Le)|0,v=v+Math.imul(W,Be)|0,v=v+Math.imul(ee,Le)|0,M=M+Math.imul(ee,Be)|0,D=D+Math.imul(N,Ue)|0,v=v+Math.imul(N,Fe)|0,v=v+Math.imul(R,Ue)|0,M=M+Math.imul(R,Fe)|0,D=D+Math.imul(A,$e)|0,v=v+Math.imul(A,qe)|0,v=v+Math.imul(K,$e)|0,M=M+Math.imul(K,qe)|0;var Qr=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,D=Math.imul(se,Ee),v=Math.imul(se,ve),v=v+Math.imul(be,Ee)|0,M=Math.imul(be,ve),D=D+Math.imul(Q,De)|0,v=v+Math.imul(Q,Ne)|0,v=v+Math.imul(ce,De)|0,M=M+Math.imul(ce,Ne)|0,D=D+Math.imul(fe,Le)|0,v=v+Math.imul(fe,Be)|0,v=v+Math.imul(Y,Le)|0,M=M+Math.imul(Y,Be)|0,D=D+Math.imul(W,Ue)|0,v=v+Math.imul(W,Fe)|0,v=v+Math.imul(ee,Ue)|0,M=M+Math.imul(ee,Fe)|0,D=D+Math.imul(N,$e)|0,v=v+Math.imul(N,qe)|0,v=v+Math.imul(R,$e)|0,M=M+Math.imul(R,qe)|0,D=D+Math.imul(A,He)|0,v=v+Math.imul(A,ze)|0,v=v+Math.imul(K,He)|0,M=M+Math.imul(K,ze)|0;var ko=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(ko>>>26)|0,ko&=67108863,D=Math.imul(we,Ee),v=Math.imul(we,ve),v=v+Math.imul(Ie,Ee)|0,M=Math.imul(Ie,ve),D=D+Math.imul(se,De)|0,v=v+Math.imul(se,Ne)|0,v=v+Math.imul(be,De)|0,M=M+Math.imul(be,Ne)|0,D=D+Math.imul(Q,Le)|0,v=v+Math.imul(Q,Be)|0,v=v+Math.imul(ce,Le)|0,M=M+Math.imul(ce,Be)|0,D=D+Math.imul(fe,Ue)|0,v=v+Math.imul(fe,Fe)|0,v=v+Math.imul(Y,Ue)|0,M=M+Math.imul(Y,Fe)|0,D=D+Math.imul(W,$e)|0,v=v+Math.imul(W,qe)|0,v=v+Math.imul(ee,$e)|0,M=M+Math.imul(ee,qe)|0,D=D+Math.imul(N,He)|0,v=v+Math.imul(N,ze)|0,v=v+Math.imul(R,He)|0,M=M+Math.imul(R,ze)|0,D=D+Math.imul(A,je)|0,v=v+Math.imul(A,Ke)|0,v=v+Math.imul(K,je)|0,M=M+Math.imul(K,Ke)|0;var Co=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Co>>>26)|0,Co&=67108863,D=Math.imul(te,Ee),v=Math.imul(te,ve),v=v+Math.imul(G,Ee)|0,M=Math.imul(G,ve),D=D+Math.imul(we,De)|0,v=v+Math.imul(we,Ne)|0,v=v+Math.imul(Ie,De)|0,M=M+Math.imul(Ie,Ne)|0,D=D+Math.imul(se,Le)|0,v=v+Math.imul(se,Be)|0,v=v+Math.imul(be,Le)|0,M=M+Math.imul(be,Be)|0,D=D+Math.imul(Q,Ue)|0,v=v+Math.imul(Q,Fe)|0,v=v+Math.imul(ce,Ue)|0,M=M+Math.imul(ce,Fe)|0,D=D+Math.imul(fe,$e)|0,v=v+Math.imul(fe,qe)|0,v=v+Math.imul(Y,$e)|0,M=M+Math.imul(Y,qe)|0,D=D+Math.imul(W,He)|0,v=v+Math.imul(W,ze)|0,v=v+Math.imul(ee,He)|0,M=M+Math.imul(ee,ze)|0,D=D+Math.imul(N,je)|0,v=v+Math.imul(N,Ke)|0,v=v+Math.imul(R,je)|0,M=M+Math.imul(R,Ke)|0,D=D+Math.imul(A,Ve)|0,v=v+Math.imul(A,We)|0,v=v+Math.imul(K,Ve)|0,M=M+Math.imul(K,We)|0;var Do=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Do>>>26)|0,Do&=67108863,D=Math.imul(z,Ee),v=Math.imul(z,ve),v=v+Math.imul(ae,Ee)|0,M=Math.imul(ae,ve),D=D+Math.imul(te,De)|0,v=v+Math.imul(te,Ne)|0,v=v+Math.imul(G,De)|0,M=M+Math.imul(G,Ne)|0,D=D+Math.imul(we,Le)|0,v=v+Math.imul(we,Be)|0,v=v+Math.imul(Ie,Le)|0,M=M+Math.imul(Ie,Be)|0,D=D+Math.imul(se,Ue)|0,v=v+Math.imul(se,Fe)|0,v=v+Math.imul(be,Ue)|0,M=M+Math.imul(be,Fe)|0,D=D+Math.imul(Q,$e)|0,v=v+Math.imul(Q,qe)|0,v=v+Math.imul(ce,$e)|0,M=M+Math.imul(ce,qe)|0,D=D+Math.imul(fe,He)|0,v=v+Math.imul(fe,ze)|0,v=v+Math.imul(Y,He)|0,M=M+Math.imul(Y,ze)|0,D=D+Math.imul(W,je)|0,v=v+Math.imul(W,Ke)|0,v=v+Math.imul(ee,je)|0,M=M+Math.imul(ee,Ke)|0,D=D+Math.imul(N,Ve)|0,v=v+Math.imul(N,We)|0,v=v+Math.imul(R,Ve)|0,M=M+Math.imul(R,We)|0,D=D+Math.imul(A,Ge)|0,v=v+Math.imul(A,Ye)|0,v=v+Math.imul(K,Ge)|0,M=M+Math.imul(K,Ye)|0;var Oo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,D=Math.imul(le,Ee),v=Math.imul(le,ve),v=v+Math.imul(ge,Ee)|0,M=Math.imul(ge,ve),D=D+Math.imul(z,De)|0,v=v+Math.imul(z,Ne)|0,v=v+Math.imul(ae,De)|0,M=M+Math.imul(ae,Ne)|0,D=D+Math.imul(te,Le)|0,v=v+Math.imul(te,Be)|0,v=v+Math.imul(G,Le)|0,M=M+Math.imul(G,Be)|0,D=D+Math.imul(we,Ue)|0,v=v+Math.imul(we,Fe)|0,v=v+Math.imul(Ie,Ue)|0,M=M+Math.imul(Ie,Fe)|0,D=D+Math.imul(se,$e)|0,v=v+Math.imul(se,qe)|0,v=v+Math.imul(be,$e)|0,M=M+Math.imul(be,qe)|0,D=D+Math.imul(Q,He)|0,v=v+Math.imul(Q,ze)|0,v=v+Math.imul(ce,He)|0,M=M+Math.imul(ce,ze)|0,D=D+Math.imul(fe,je)|0,v=v+Math.imul(fe,Ke)|0,v=v+Math.imul(Y,je)|0,M=M+Math.imul(Y,Ke)|0,D=D+Math.imul(W,Ve)|0,v=v+Math.imul(W,We)|0,v=v+Math.imul(ee,Ve)|0,M=M+Math.imul(ee,We)|0,D=D+Math.imul(N,Ge)|0,v=v+Math.imul(N,Ye)|0,v=v+Math.imul(R,Ge)|0,M=M+Math.imul(R,Ye)|0,D=D+Math.imul(A,mt)|0,v=v+Math.imul(A,bt)|0,v=v+Math.imul(K,mt)|0,M=M+Math.imul(K,bt)|0;var Io=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Io>>>26)|0,Io&=67108863,D=Math.imul(le,De),v=Math.imul(le,Ne),v=v+Math.imul(ge,De)|0,M=Math.imul(ge,Ne),D=D+Math.imul(z,Le)|0,v=v+Math.imul(z,Be)|0,v=v+Math.imul(ae,Le)|0,M=M+Math.imul(ae,Be)|0,D=D+Math.imul(te,Ue)|0,v=v+Math.imul(te,Fe)|0,v=v+Math.imul(G,Ue)|0,M=M+Math.imul(G,Fe)|0,D=D+Math.imul(we,$e)|0,v=v+Math.imul(we,qe)|0,v=v+Math.imul(Ie,$e)|0,M=M+Math.imul(Ie,qe)|0,D=D+Math.imul(se,He)|0,v=v+Math.imul(se,ze)|0,v=v+Math.imul(be,He)|0,M=M+Math.imul(be,ze)|0,D=D+Math.imul(Q,je)|0,v=v+Math.imul(Q,Ke)|0,v=v+Math.imul(ce,je)|0,M=M+Math.imul(ce,Ke)|0,D=D+Math.imul(fe,Ve)|0,v=v+Math.imul(fe,We)|0,v=v+Math.imul(Y,Ve)|0,M=M+Math.imul(Y,We)|0,D=D+Math.imul(W,Ge)|0,v=v+Math.imul(W,Ye)|0,v=v+Math.imul(ee,Ge)|0,M=M+Math.imul(ee,Ye)|0,D=D+Math.imul(N,mt)|0,v=v+Math.imul(N,bt)|0,v=v+Math.imul(R,mt)|0,M=M+Math.imul(R,bt)|0;var Po=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Po>>>26)|0,Po&=67108863,D=Math.imul(le,Le),v=Math.imul(le,Be),v=v+Math.imul(ge,Le)|0,M=Math.imul(ge,Be),D=D+Math.imul(z,Ue)|0,v=v+Math.imul(z,Fe)|0,v=v+Math.imul(ae,Ue)|0,M=M+Math.imul(ae,Fe)|0,D=D+Math.imul(te,$e)|0,v=v+Math.imul(te,qe)|0,v=v+Math.imul(G,$e)|0,M=M+Math.imul(G,qe)|0,D=D+Math.imul(we,He)|0,v=v+Math.imul(we,ze)|0,v=v+Math.imul(Ie,He)|0,M=M+Math.imul(Ie,ze)|0,D=D+Math.imul(se,je)|0,v=v+Math.imul(se,Ke)|0,v=v+Math.imul(be,je)|0,M=M+Math.imul(be,Ke)|0,D=D+Math.imul(Q,Ve)|0,v=v+Math.imul(Q,We)|0,v=v+Math.imul(ce,Ve)|0,M=M+Math.imul(ce,We)|0,D=D+Math.imul(fe,Ge)|0,v=v+Math.imul(fe,Ye)|0,v=v+Math.imul(Y,Ge)|0,M=M+Math.imul(Y,Ye)|0,D=D+Math.imul(W,mt)|0,v=v+Math.imul(W,bt)|0,v=v+Math.imul(ee,mt)|0,M=M+Math.imul(ee,bt)|0;var No=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(No>>>26)|0,No&=67108863,D=Math.imul(le,Ue),v=Math.imul(le,Fe),v=v+Math.imul(ge,Ue)|0,M=Math.imul(ge,Fe),D=D+Math.imul(z,$e)|0,v=v+Math.imul(z,qe)|0,v=v+Math.imul(ae,$e)|0,M=M+Math.imul(ae,qe)|0,D=D+Math.imul(te,He)|0,v=v+Math.imul(te,ze)|0,v=v+Math.imul(G,He)|0,M=M+Math.imul(G,ze)|0,D=D+Math.imul(we,je)|0,v=v+Math.imul(we,Ke)|0,v=v+Math.imul(Ie,je)|0,M=M+Math.imul(Ie,Ke)|0,D=D+Math.imul(se,Ve)|0,v=v+Math.imul(se,We)|0,v=v+Math.imul(be,Ve)|0,M=M+Math.imul(be,We)|0,D=D+Math.imul(Q,Ge)|0,v=v+Math.imul(Q,Ye)|0,v=v+Math.imul(ce,Ge)|0,M=M+Math.imul(ce,Ye)|0,D=D+Math.imul(fe,mt)|0,v=v+Math.imul(fe,bt)|0,v=v+Math.imul(Y,mt)|0,M=M+Math.imul(Y,bt)|0;var Ro=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,D=Math.imul(le,$e),v=Math.imul(le,qe),v=v+Math.imul(ge,$e)|0,M=Math.imul(ge,qe),D=D+Math.imul(z,He)|0,v=v+Math.imul(z,ze)|0,v=v+Math.imul(ae,He)|0,M=M+Math.imul(ae,ze)|0,D=D+Math.imul(te,je)|0,v=v+Math.imul(te,Ke)|0,v=v+Math.imul(G,je)|0,M=M+Math.imul(G,Ke)|0,D=D+Math.imul(we,Ve)|0,v=v+Math.imul(we,We)|0,v=v+Math.imul(Ie,Ve)|0,M=M+Math.imul(Ie,We)|0,D=D+Math.imul(se,Ge)|0,v=v+Math.imul(se,Ye)|0,v=v+Math.imul(be,Ge)|0,M=M+Math.imul(be,Ye)|0,D=D+Math.imul(Q,mt)|0,v=v+Math.imul(Q,bt)|0,v=v+Math.imul(ce,mt)|0,M=M+Math.imul(ce,bt)|0;var Lo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,D=Math.imul(le,He),v=Math.imul(le,ze),v=v+Math.imul(ge,He)|0,M=Math.imul(ge,ze),D=D+Math.imul(z,je)|0,v=v+Math.imul(z,Ke)|0,v=v+Math.imul(ae,je)|0,M=M+Math.imul(ae,Ke)|0,D=D+Math.imul(te,Ve)|0,v=v+Math.imul(te,We)|0,v=v+Math.imul(G,Ve)|0,M=M+Math.imul(G,We)|0,D=D+Math.imul(we,Ge)|0,v=v+Math.imul(we,Ye)|0,v=v+Math.imul(Ie,Ge)|0,M=M+Math.imul(Ie,Ye)|0,D=D+Math.imul(se,mt)|0,v=v+Math.imul(se,bt)|0,v=v+Math.imul(be,mt)|0,M=M+Math.imul(be,bt)|0;var Bo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,D=Math.imul(le,je),v=Math.imul(le,Ke),v=v+Math.imul(ge,je)|0,M=Math.imul(ge,Ke),D=D+Math.imul(z,Ve)|0,v=v+Math.imul(z,We)|0,v=v+Math.imul(ae,Ve)|0,M=M+Math.imul(ae,We)|0,D=D+Math.imul(te,Ge)|0,v=v+Math.imul(te,Ye)|0,v=v+Math.imul(G,Ge)|0,M=M+Math.imul(G,Ye)|0,D=D+Math.imul(we,mt)|0,v=v+Math.imul(we,bt)|0,v=v+Math.imul(Ie,mt)|0,M=M+Math.imul(Ie,bt)|0;var Uo=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,D=Math.imul(le,Ve),v=Math.imul(le,We),v=v+Math.imul(ge,Ve)|0,M=Math.imul(ge,We),D=D+Math.imul(z,Ge)|0,v=v+Math.imul(z,Ye)|0,v=v+Math.imul(ae,Ge)|0,M=M+Math.imul(ae,Ye)|0,D=D+Math.imul(te,mt)|0,v=v+Math.imul(te,bt)|0,v=v+Math.imul(G,mt)|0,M=M+Math.imul(G,bt)|0;var dd=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(dd>>>26)|0,dd&=67108863,D=Math.imul(le,Ge),v=Math.imul(le,Ye),v=v+Math.imul(ge,Ge)|0,M=Math.imul(ge,Ye),D=D+Math.imul(z,mt)|0,v=v+Math.imul(z,bt)|0,v=v+Math.imul(ae,mt)|0,M=M+Math.imul(ae,bt)|0;var hd=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(hd>>>26)|0,hd&=67108863,D=Math.imul(le,mt),v=Math.imul(le,bt),v=v+Math.imul(ge,mt)|0,M=Math.imul(ge,bt);var pd=(S+D|0)+((v&8191)<<13)|0;return S=(M+(v>>>13)|0)+(pd>>>26)|0,pd&=67108863,b[0]=Yr,b[1]=Jr,b[2]=Xr,b[3]=Zr,b[4]=Qr,b[5]=ko,b[6]=Co,b[7]=Do,b[8]=Oo,b[9]=Io,b[10]=Po,b[11]=No,b[12]=Ro,b[13]=Lo,b[14]=Bo,b[15]=Uo,b[16]=dd,b[17]=hd,b[18]=pd,S!==0&&(b[19]=S,y.length++),y},"comb10MulTo");Math.imul||(O=$);function U(h,c,d){d.negative=c.negative^h.negative,d.length=h.length+c.length;for(var y=0,_=0,w=0;w<d.length-1;w++){var b=_;_=0;for(var S=y&67108863,D=Math.min(w,c.length-1),v=Math.max(0,w-h.length+1);v<=D;v++){var M=w-v,ne=h.words[M]|0,A=c.words[v]|0,K=ne*A,J=K&67108863;b=b+(K/67108864|0)|0,J=J+S|0,S=J&67108863,b=b+(J>>>26)|0,_+=b>>>26,b&=67108863}d.words[w]=S,y=b,b=_}return y!==0?d.words[w]=y:d.length--,d._strip()}o(U,"bigMulTo");function j(h,c,d){return U(h,c,d)}o(j,"jumboMulTo"),i.prototype.mulTo=o(function(c,d){var y,_=this.length+c.length;return this.length===10&&c.length===10?y=O(this,c,d):_<63?y=$(this,c,d):_<1024?y=U(this,c,d):y=j(this,c,d),y},"mulTo");function H(h,c){this.x=h,this.y=c}o(H,"FFTM"),H.prototype.makeRBT=o(function(c){for(var d=new Array(c),y=i.prototype._countBits(c)-1,_=0;_<c;_++)d[_]=this.revBin(_,y,c);return d},"makeRBT"),H.prototype.revBin=o(function(c,d,y){if(c===0||c===y-1)return c;for(var _=0,w=0;w<d;w++)_|=(c&1)<<d-w-1,c>>=1;return _},"revBin"),H.prototype.permute=o(function(c,d,y,_,w,b){for(var S=0;S<b;S++)_[S]=d[c[S]],w[S]=y[c[S]]},"permute"),H.prototype.transform=o(function(c,d,y,_,w,b){this.permute(b,c,d,y,_,w);for(var S=1;S<w;S<<=1)for(var D=S<<1,v=Math.cos(2*Math.PI/D),M=Math.sin(2*Math.PI/D),ne=0;ne<w;ne+=D)for(var A=v,K=M,J=0;J<S;J++){var N=y[ne+J],R=_[ne+J],V=y[ne+J+S],W=_[ne+J+S],ee=A*V-K*W;W=A*W+K*V,V=ee,y[ne+J]=N+V,_[ne+J]=R+W,y[ne+J+S]=N-V,_[ne+J+S]=R-W,J!==D&&(ee=v*A-M*K,K=v*K+M*A,A=ee)}},"transform"),H.prototype.guessLen13b=o(function(c,d){var y=Math.max(d,c)|1,_=y&1,w=0;for(y=y/2|0;y;y=y>>>1)w++;return 1<<w+1+_},"guessLen13b"),H.prototype.conjugate=o(function(c,d,y){if(!(y<=1))for(var _=0;_<y/2;_++){var w=c[_];c[_]=c[y-_-1],c[y-_-1]=w,w=d[_],d[_]=-d[y-_-1],d[y-_-1]=-w}},"conjugate"),H.prototype.normalize13b=o(function(c,d){for(var y=0,_=0;_<d/2;_++){var w=Math.round(c[2*_+1]/d)*8192+Math.round(c[2*_]/d)+y;c[_]=w&67108863,w<67108864?y=0:y=w/67108864|0}return c},"normalize13b"),H.prototype.convert13b=o(function(c,d,y,_){for(var w=0,b=0;b<d;b++)w=w+(c[b]|0),y[2*b]=w&8191,w=w>>>13,y[2*b+1]=w&8191,w=w>>>13;for(b=2*d;b<_;++b)y[b]=0;t(w===0),t((w&-8192)===0)},"convert13b"),H.prototype.stub=o(function(c){for(var d=new Array(c),y=0;y<c;y++)d[y]=0;return d},"stub"),H.prototype.mulp=o(function(c,d,y){var _=2*this.guessLen13b(c.length,d.length),w=this.makeRBT(_),b=this.stub(_),S=new Array(_),D=new Array(_),v=new Array(_),M=new Array(_),ne=new Array(_),A=new Array(_),K=y.words;K.length=_,this.convert13b(c.words,c.length,S,_),this.convert13b(d.words,d.length,M,_),this.transform(S,b,D,v,_,w),this.transform(M,b,ne,A,_,w);for(var J=0;J<_;J++){var N=D[J]*ne[J]-v[J]*A[J];v[J]=D[J]*A[J]+v[J]*ne[J],D[J]=N}return this.conjugate(D,v,_),this.transform(D,v,K,b,_,w),this.conjugate(K,b,_),this.normalize13b(K,_),y.negative=c.negative^d.negative,y.length=c.length+d.length,y._strip()},"mulp"),i.prototype.mul=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},"mul"),i.prototype.mulf=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),j(this,c,d)},"mulf"),i.prototype.imul=o(function(c){return this.clone().mulTo(c,this)},"imul"),i.prototype.imuln=o(function(c){var d=c<0;d&&(c=-c),t(typeof c=="number"),t(c<67108864);for(var y=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*c,b=(w&67108863)+(y&67108863);y>>=26,y+=w/67108864|0,y+=b>>>26,this.words[_]=b&67108863}return y!==0&&(this.words[_]=y,this.length++),d?this.ineg():this},"imuln"),i.prototype.muln=o(function(c){return this.clone().imuln(c)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(c){var d=C(c);if(d.length===0)return new i(1);for(var y=this,_=0;_<d.length&&d[_]===0;_++,y=y.sqr());if(++_<d.length)for(var w=y.sqr();_<d.length;_++,w=w.sqr())d[_]!==0&&(y=y.mul(w));return y},"pow"),i.prototype.iushln=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=67108863>>>26-d<<26-d,w;if(d!==0){var b=0;for(w=0;w<this.length;w++){var S=this.words[w]&_,D=(this.words[w]|0)-S<<d;this.words[w]=D|b,b=S>>>26-d}b&&(this.words[w]=b,this.length++)}if(y!==0){for(w=this.length-1;w>=0;w--)this.words[w+y]=this.words[w];for(w=0;w<y;w++)this.words[w]=0;this.length+=y}return this._strip()},"iushln"),i.prototype.ishln=o(function(c){return t(this.negative===0),this.iushln(c)},"ishln"),i.prototype.iushrn=o(function(c,d,y){t(typeof c=="number"&&c>=0);var _;d?_=(d-d%26)/26:_=0;var w=c%26,b=Math.min((c-w)/26,this.length),S=67108863^67108863>>>w<<w,D=y;if(_-=b,_=Math.max(0,_),D){for(var v=0;v<b;v++)D.words[v]=this.words[v];D.length=b}if(b!==0)if(this.length>b)for(this.length-=b,v=0;v<this.length;v++)this.words[v]=this.words[v+b];else this.words[0]=0,this.length=1;var M=0;for(v=this.length-1;v>=0&&(M!==0||v>=_);v--){var ne=this.words[v]|0;this.words[v]=M<<26-w|ne>>>w,M=ne&S}return D&&M!==0&&(D.words[D.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(c,d,y){return t(this.negative===0),this.iushrn(c,d,y)},"ishrn"),i.prototype.shln=o(function(c){return this.clone().ishln(c)},"shln"),i.prototype.ushln=o(function(c){return this.clone().iushln(c)},"ushln"),i.prototype.shrn=o(function(c){return this.clone().ishrn(c)},"shrn"),i.prototype.ushrn=o(function(c){return this.clone().iushrn(c)},"ushrn"),i.prototype.testn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return!1;var w=this.words[y];return!!(w&_)},"testn"),i.prototype.imaskn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0&&y++,this.length=Math.min(y,this.length),d!==0){var _=67108863^67108863>>>d<<d;this.words[this.length-1]&=_}return this._strip()},"imaskn"),i.prototype.maskn=o(function(c){return this.clone().imaskn(c)},"maskn"),i.prototype.iaddn=o(function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},"iaddn"),i.prototype._iaddn=o(function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},"_iaddn"),i.prototype.isubn=o(function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},"isubn"),i.prototype.addn=o(function(c){return this.clone().iaddn(c)},"addn"),i.prototype.subn=o(function(c){return this.clone().isubn(c)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(c,d,y){var _=c.length+y,w;this._expand(_);var b,S=0;for(w=0;w<c.length;w++){b=(this.words[w+y]|0)+S;var D=(c.words[w]|0)*d;b-=D&67108863,S=(b>>26)-(D/67108864|0),this.words[w+y]=b&67108863}for(;w<this.length-y;w++)b=(this.words[w+y]|0)+S,S=b>>26,this.words[w+y]=b&67108863;if(S===0)return this._strip();for(t(S===-1),S=0,w=0;w<this.length;w++)b=-(this.words[w]|0)+S,S=b>>26,this.words[w]=b&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(c,d){var y=this.length-c.length,_=this.clone(),w=c,b=w.words[w.length-1]|0,S=this._countBits(b);y=26-S,y!==0&&(w=w.ushln(y),_.iushln(y),b=w.words[w.length-1]|0);var D=_.length-w.length,v;if(d!=="mod"){v=new i(null),v.length=D+1,v.words=new Array(v.length);for(var M=0;M<v.length;M++)v.words[M]=0}var ne=_.clone()._ishlnsubmul(w,1,D);ne.negative===0&&(_=ne,v&&(v.words[D]=1));for(var A=D-1;A>=0;A--){var K=(_.words[w.length+A]|0)*67108864+(_.words[w.length+A-1]|0);for(K=Math.min(K/b|0,67108863),_._ishlnsubmul(w,K,A);_.negative!==0;)K--,_.negative=0,_._ishlnsubmul(w,1,A),_.isZero()||(_.negative^=1);v&&(v.words[A]=K)}return v&&v._strip(),_._strip(),d!=="div"&&y!==0&&_.iushrn(y),{div:v||null,mod:_}},"_wordDiv"),i.prototype.divmod=o(function(c,d,y){if(t(!c.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var _,w,b;return this.negative!==0&&c.negative===0?(b=this.neg().divmod(c,d),d!=="mod"&&(_=b.div.neg()),d!=="div"&&(w=b.mod.neg(),y&&w.negative!==0&&w.iadd(c)),{div:_,mod:w}):this.negative===0&&c.negative!==0?(b=this.divmod(c.neg(),d),d!=="mod"&&(_=b.div.neg()),{div:_,mod:b.mod}):(this.negative&c.negative)!==0?(b=this.neg().divmod(c.neg(),d),d!=="div"&&(w=b.mod.neg(),y&&w.negative!==0&&w.isub(c)),{div:b.div,mod:w}):c.length>this.length||this.cmp(c)<0?{div:new i(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new i(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new i(this.modrn(c.words[0]))}:this._wordDiv(c,d)},"divmod"),i.prototype.div=o(function(c){return this.divmod(c,"div",!1).div},"div"),i.prototype.mod=o(function(c){return this.divmod(c,"mod",!1).mod},"mod"),i.prototype.umod=o(function(c){return this.divmod(c,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(c):d.mod,_=c.ushrn(1),w=c.andln(1),b=y.cmp(_);return b<0||w===1&&b===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=(1<<26)%c,_=0,w=this.length-1;w>=0;w--)_=(y*_+(this.words[w]|0))%c;return d?-_:_},"modrn"),i.prototype.modn=o(function(c){return this.modrn(c)},"modn"),i.prototype.idivn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+y*67108864;this.words[_]=w/c|0,y=w%c}return this._strip(),d?this.ineg():this},"idivn"),i.prototype.divn=o(function(c){return this.clone().idivn(c)},"divn"),i.prototype.egcd=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),b=new i(0),S=new i(1),D=0;d.isEven()&&y.isEven();)d.iushrn(1),y.iushrn(1),++D;for(var v=y.clone(),M=d.clone();!d.isZero();){for(var ne=0,A=1;(d.words[0]&A)===0&&ne<26;++ne,A<<=1);if(ne>0)for(d.iushrn(ne);ne-- >0;)(_.isOdd()||w.isOdd())&&(_.iadd(v),w.isub(M)),_.iushrn(1),w.iushrn(1);for(var K=0,J=1;(y.words[0]&J)===0&&K<26;++K,J<<=1);if(K>0)for(y.iushrn(K);K-- >0;)(b.isOdd()||S.isOdd())&&(b.iadd(v),S.isub(M)),b.iushrn(1),S.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(b),w.isub(S)):(y.isub(d),b.isub(_),S.isub(w))}return{a:b,b:S,gcd:y.iushln(D)}},"egcd"),i.prototype._invmp=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),b=y.clone();d.cmpn(1)>0&&y.cmpn(1)>0;){for(var S=0,D=1;(d.words[0]&D)===0&&S<26;++S,D<<=1);if(S>0)for(d.iushrn(S);S-- >0;)_.isOdd()&&_.iadd(b),_.iushrn(1);for(var v=0,M=1;(y.words[0]&M)===0&&v<26;++v,M<<=1);if(v>0)for(y.iushrn(v);v-- >0;)w.isOdd()&&w.iadd(b),w.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(w)):(y.isub(d),w.isub(_))}var ne;return d.cmpn(1)===0?ne=_:ne=w,ne.cmpn(0)<0&&ne.iadd(c),ne},"_invmp"),i.prototype.gcd=o(function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),y=c.clone();d.negative=0,y.negative=0;for(var _=0;d.isEven()&&y.isEven();_++)d.iushrn(1),y.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;y.isEven();)y.iushrn(1);var w=d.cmp(y);if(w<0){var b=d;d=y,y=b}else if(w===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(_)},"gcd"),i.prototype.invm=o(function(c){return this.egcd(c).a.umod(c)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(c){return this.words[0]&c},"andln"),i.prototype.bincn=o(function(c){t(typeof c=="number");var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=_,this;for(var w=_,b=y;w!==0&&b<this.length;b++){var S=this.words[b]|0;S+=w,w=S>>>26,S&=67108863,this.words[b]=S}return w!==0&&(this.words[b]=w,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var _=this.words[0]|0;y=_===c?0:_<c?-1:1}return this.negative!==0?-y|0:y},"cmpn"),i.prototype.cmp=o(function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},"cmp"),i.prototype.ucmp=o(function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,y=this.length-1;y>=0;y--){var _=this.words[y]|0,w=c.words[y]|0;if(_!==w){_<w?d=-1:_>w&&(d=1);break}}return d},"ucmp"),i.prototype.gtn=o(function(c){return this.cmpn(c)===1},"gtn"),i.prototype.gt=o(function(c){return this.cmp(c)===1},"gt"),i.prototype.gten=o(function(c){return this.cmpn(c)>=0},"gten"),i.prototype.gte=o(function(c){return this.cmp(c)>=0},"gte"),i.prototype.ltn=o(function(c){return this.cmpn(c)===-1},"ltn"),i.prototype.lt=o(function(c){return this.cmp(c)===-1},"lt"),i.prototype.lten=o(function(c){return this.cmpn(c)<=0},"lten"),i.prototype.lte=o(function(c){return this.cmp(c)<=0},"lte"),i.prototype.eqn=o(function(c){return this.cmpn(c)===0},"eqn"),i.prototype.eq=o(function(c){return this.cmp(c)===0},"eq"),i.red=o(function(c){return new l(c)},"red"),i.prototype.toRed=o(function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(c){return this.red=c,this},"_forceRed"),i.prototype.forceRed=o(function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},"forceRed"),i.prototype.redAdd=o(function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},"redAdd"),i.prototype.redIAdd=o(function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},"redIAdd"),i.prototype.redSub=o(function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},"redSub"),i.prototype.redISub=o(function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},"redISub"),i.prototype.redShl=o(function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},"redShl"),i.prototype.redMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},"redMul"),i.prototype.redIMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)},"redPow");var X={k256:null,p224:null,p192:null,p25519:null};function B(h,c){this.name=h,this.p=new i(c,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(B,"MPrime"),B.prototype._tmp=o(function(){var c=new i(null);return c.words=new Array(Math.ceil(this.n/13)),c},"_tmp"),B.prototype.ireduce=o(function(c){var d=c,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var _=y<this.n?-1:d.ucmp(this.p);return _===0?(d.words[0]=0,d.length=1):_>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},"ireduce"),B.prototype.split=o(function(c,d){c.iushrn(this.n,0,d)},"split"),B.prototype.imulK=o(function(c){return c.imul(this.k)},"imulK");function L(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(L,"K256"),n(L,B),L.prototype.split=o(function(c,d){for(var y=4194303,_=Math.min(c.length,9),w=0;w<_;w++)d.words[w]=c.words[w];if(d.length=_,c.length<=9){c.words[0]=0,c.length=1;return}var b=c.words[9];for(d.words[d.length++]=b&y,w=10;w<c.length;w++){var S=c.words[w]|0;c.words[w-10]=(S&y)<<4|b>>>22,b=S}b>>>=22,c.words[w-10]=b,b===0&&c.length>10?c.length-=10:c.length-=9},"split"),L.prototype.imulK=o(function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,y=0;y<c.length;y++){var _=c.words[y]|0;d+=_*977,c.words[y]=d&67108863,d=_*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c},"imulK");function F(){B.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(F,"P224"),n(F,B);function re(){B.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(re,"P192"),n(re,B);function E(){B.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(E,"P25519"),n(E,B),E.prototype.imulK=o(function(c){for(var d=0,y=0;y<c.length;y++){var _=(c.words[y]|0)*19+d,w=_&67108863;_>>>=26,c.words[y]=w,d=_}return d!==0&&(c.words[c.length++]=d),c},"imulK"),i._prime=o(function(c){if(X[c])return X[c];var d;if(c==="k256")d=new L;else if(c==="p224")d=new F;else if(c==="p192")d=new re;else if(c==="p25519")d=new E;else throw new Error("Unknown prime "+c);return X[c]=d,d},"prime");function l(h){if(typeof h=="string"){var c=i._prime(h);this.m=c.p,this.prime=c}else t(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}o(l,"Red"),l.prototype._verify1=o(function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},"_verify1"),l.prototype._verify2=o(function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},"_verify2"),l.prototype.imod=o(function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(m(c,c.umod(this.m)._forceRed(this)),c)},"imod"),l.prototype.neg=o(function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},"neg"),l.prototype.add=o(function(c,d){this._verify2(c,d);var y=c.add(d);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},"add"),l.prototype.iadd=o(function(c,d){this._verify2(c,d);var y=c.iadd(d);return y.cmp(this.m)>=0&&y.isub(this.m),y},"iadd"),l.prototype.sub=o(function(c,d){this._verify2(c,d);var y=c.sub(d);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},"sub"),l.prototype.isub=o(function(c,d){this._verify2(c,d);var y=c.isub(d);return y.cmpn(0)<0&&y.iadd(this.m),y},"isub"),l.prototype.shl=o(function(c,d){return this._verify1(c),this.imod(c.ushln(d))},"shl"),l.prototype.imul=o(function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},"imul"),l.prototype.mul=o(function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},"mul"),l.prototype.isqr=o(function(c){return this.imul(c,c.clone())},"isqr"),l.prototype.sqr=o(function(c){return this.mul(c,c)},"sqr"),l.prototype.sqrt=o(function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var y=this.m.add(new i(1)).iushrn(2);return this.pow(c,y)}for(var _=this.m.subn(1),w=0;!_.isZero()&&_.andln(1)===0;)w++,_.iushrn(1);t(!_.isZero());var b=new i(1).toRed(this),S=b.redNeg(),D=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new i(2*v*v).toRed(this);this.pow(v,D).cmp(S)!==0;)v.redIAdd(S);for(var M=this.pow(v,_),ne=this.pow(c,_.addn(1).iushrn(1)),A=this.pow(c,_),K=w;A.cmp(b)!==0;){for(var J=A,N=0;J.cmp(b)!==0;N++)J=J.redSqr();t(N<K);var R=this.pow(M,new i(1).iushln(K-N-1));ne=ne.redMul(R),M=R.redSqr(),A=A.redMul(M),K=N}return ne},"sqrt"),l.prototype.invm=o(function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},"invm"),l.prototype.pow=o(function(c,d){if(d.isZero())return new i(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var y=4,_=new Array(1<<y);_[0]=new i(1).toRed(this),_[1]=c;for(var w=2;w<_.length;w++)_[w]=this.mul(_[w-1],c);var b=_[0],S=0,D=0,v=d.bitLength()%26;for(v===0&&(v=26),w=d.length-1;w>=0;w--){for(var M=d.words[w],ne=v-1;ne>=0;ne--){var A=M>>ne&1;if(b!==_[0]&&(b=this.sqr(b)),A===0&&S===0){D=0;continue}S<<=1,S|=A,D++,!(D!==y&&(w!==0||ne!==0))&&(b=this.mul(b,_[S]),D=0,S=0)}v=26}return b},"pow"),l.prototype.convertTo=o(function(c){var d=c.umod(this.m);return d===c?d.clone():d},"convertTo"),l.prototype.convertFrom=o(function(c){var d=c.clone();return d.red=null,d},"convertFrom"),i.mont=o(function(c){return new g(c)},"mont");function g(h){l.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(g,"Mont"),n(g,l),g.prototype.convertTo=o(function(c){return this.imod(c.ushln(this.shift))},"convertTo"),g.prototype.convertFrom=o(function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},"convertFrom"),g.prototype.imul=o(function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var y=c.imul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),b=w;return w.cmp(this.m)>=0?b=w.isub(this.m):w.cmpn(0)<0&&(b=w.iadd(this.m)),b._forceRed(this)},"imul"),g.prototype.mul=o(function(c,d){if(c.isZero()||d.isZero())return new i(0)._forceRed(this);var y=c.mul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),b=w;return w.cmp(this.m)>=0?b=w.isub(this.m):w.cmpn(0)<0&&(b=w.iadd(this.m)),b._forceRed(this)},"mul"),g.prototype.invm=o(function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)},"invm")})(typeof I0=="undefined"||I0,Sy)});var u3=me((RU,c3)=>{c3.exports=V0;var f3=128,IM=127,PM=~IM,NM=Math.pow(2,31);function V0(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw V0.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=NM;)e[t++]=r&255|f3,r/=128;for(;r&PM;)e[t++]=r&255|f3,r>>>=7;return e[t]=r|0,V0.bytes=t-n+1,e}o(V0,"encode")});var h3=me((LU,d3)=>{d3.exports=W0;var RM=128,l3=127;function W0(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f||i>49)throw W0.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&l3)<<i:(a&l3)*Math.pow(2,i),i+=7}while(a>=RM);return W0.bytes=s-n,t}o(W0,"read")});var m3=me((BU,p3)=>{var LM=Math.pow(2,7),BM=Math.pow(2,14),UM=Math.pow(2,21),FM=Math.pow(2,28),$M=Math.pow(2,35),qM=Math.pow(2,42),HM=Math.pow(2,49),zM=Math.pow(2,56),jM=Math.pow(2,63);p3.exports=function(r){return r<LM?1:r<BM?2:r<UM?3:r<FM?4:r<$M?5:r<qM?6:r<HM?7:r<zM?8:r<jM?9:10}});var Wf=me((UU,b3)=>{b3.exports={encode:u3(),decode:h3(),encodingLength:m3()}});var v3=me((FU,g3)=>{"use strict";function KM(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var n=0;n<r.length;n++){var i=r.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var a=r.length,f=r.charAt(0),u=Math.log(a)/Math.log(256),m=Math.log(256)/Math.log(a);function p(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var T=0,C=0,$=0,O=I.length;$!==O&&I[$]===0;)$++,T++;for(var U=(O-$)*m+1>>>0,j=new Uint8Array(U);$!==O;){for(var H=I[$],X=0,B=U-1;(H!==0||X<C)&&B!==-1;B--,X++)H+=256*j[B]>>>0,j[B]=H%a>>>0,H=H/a>>>0;if(H!==0)throw new Error("Non-zero carry");C=X,$++}for(var L=U-C;L!==U&&j[L]===0;)L++;for(var F=f.repeat(T);L<U;++L)F+=r.charAt(j[L]);return F}o(p,"encode");function x(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var T=0;if(I[T]!==" "){for(var C=0,$=0;I[T]===f;)C++,T++;for(var O=(I.length-T)*u+1>>>0,U=new Uint8Array(O);I[T];){var j=e[I.charCodeAt(T)];if(j===255)return;for(var H=0,X=O-1;(j!==0||H<$)&&X!==-1;X--,H++)j+=a*U[X]>>>0,U[X]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");$=H,T++}if(I[T]!==" "){for(var B=O-$;B!==O&&U[B]===0;)B++;for(var L=new Uint8Array(C+(O-B)),F=C;B!==O;)L[F++]=U[B++];return L}}}o(x,"decodeUnsafe");function k(I){var T=x(I);if(T)return T;throw new Error("Non-base"+a+" character")}return o(k,"decode"),{encode:p,decodeUnsafe:x,decode:k}}o(KM,"base");g3.exports=KM});var tl=me(($U,y3)=>{"use strict";var VM=new TextDecoder,WM=o(r=>VM.decode(r),"decodeText"),GM=new TextEncoder,YM=o(r=>GM.encode(r),"encodeText");function JM(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(JM,"concat");y3.exports={decodeText:WM,encodeText:YM,concat:JM}});var w3=me((qU,x3)=>{"use strict";var{encodeText:XM}=tl(),rl=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=XM(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(let t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}};o(rl,"Base");x3.exports=rl});var E3=me((HU,_3)=>{"use strict";var ZM=o((r,e,t)=>{let n={};for(let m=0;m<e.length;++m)n[e[m]]=m;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),a=0,f=0,u=0;for(let m=0;m<i;++m){let p=n[r[m]];if(p===void 0)throw new SyntaxError("Invalid character "+r[m]);f=f<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&f>>a)}if(a>=t||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return s},"decode"),QM=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),eA=o(r=>e=>({encode(t){return QM(t,e,r)},decode(t){return ZM(t,e,r)}}),"rfc4648");_3.exports={rfc4648:eA}});var T3=me((zU,A3)=>{"use strict";var Gf=v3(),tA=w3(),{rfc4648:nr}=E3(),{decodeText:rA,encodeText:nA}=tl(),iA=o(()=>({encode:rA,decode:nA}),"identity"),S3=[["identity","\0",iA,""],["base2","0",nr(1),"01"],["base8","7",nr(3),"01234567"],["base10","9",Gf,"0123456789"],["base16","f",nr(4),"0123456789abcdef"],["base16upper","F",nr(4),"0123456789ABCDEF"],["base32hex","v",nr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",nr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",nr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",nr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",nr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",nr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",nr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",nr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",nr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Gf,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Gf,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Gf,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Gf,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],M3=S3.reduce((r,e)=>(r[e[0]]=new tA(e[0],e[1],e[2],e[3]),r),{}),oA=S3.reduce((r,e)=>(r[e[1]]=M3[e[0]],r),{});A3.exports={names:M3,codes:oA}});var G0=me((Ni,C3)=>{"use strict";var Ca=T3(),{encodeText:sA,decodeText:nl,concat:k3}=tl();function aA(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=hs(r);return lA(t,e),k3([n,e],n.length+e.length)}o(aA,"multibase");function fA(r,e){let t=hs(r),n=sA(t.encode(e));return k3([t.codeBuf,n],t.codeBuf.length+n.length)}o(fA,"encode");function cA(r){r instanceof Uint8Array&&(r=nl(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),hs(r[0]).decode(r.substring(1))}o(cA,"decode");function uA(r){if(r instanceof Uint8Array&&(r=nl(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return hs(r[0]).name}catch(e){return!1}}o(uA,"isEncoded");function lA(r,e){hs(r).decode(nl(e))}o(lA,"validEncode");function hs(r){if(Object.prototype.hasOwnProperty.call(Ca.names,r))return Ca.names[r];if(Object.prototype.hasOwnProperty.call(Ca.codes,r))return Ca.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(hs,"encoding");function dA(r){return r instanceof Uint8Array&&(r=nl(r)),hs(r[0])}o(dA,"encodingFromData");Ni=C3.exports=aA;Ni.encode=fA;Ni.decode=cA;Ni.isEncoded=uA;Ni.encoding=hs;Ni.encodingFromData=dA;var hA=Object.freeze(Ca.names),pA=Object.freeze(Ca.codes);Ni.names=hA;Ni.codes=pA});var O3=me((jU,D3)=>{"use strict";function mA(r,e){for(let t=0;t<r.byteLength;t++){if(r[t]<e[t])return-1;if(r[t]>e[t])return 1}return r.byteLength>e.byteLength?1:r.byteLength<e.byteLength?-1:0}o(mA,"compare");D3.exports=mA});var P3=me((KU,I3)=>{"use strict";function bA(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(bA,"concat");I3.exports=bA});var R3=me((VU,N3)=>{"use strict";function gA(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}o(gA,"equals");N3.exports=gA});var J0=me((WU,F3)=>{"use strict";var{bases:L3}=(qc(),tf(s1));function U3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}o(U3,"createCodec");var B3=U3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Y0=U3("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),vA=ie({utf8:B3,"utf-8":B3,hex:L3.base16,latin1:Y0,ascii:Y0,binary:Y0},L3);F3.exports=vA});var q3=me((GU,$3)=>{"use strict";var yA=J0();function xA(r,e="utf8"){let t=yA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}o(xA,"fromString");$3.exports=xA});var z3=me((YU,H3)=>{"use strict";var wA=J0();function _A(r,e="utf8"){let t=wA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}o(_A,"toString");H3.exports=_A});var K3=me((JU,j3)=>{"use strict";function EA(r,e){if(r.length!==e.length)throw new Error("Inputs should have the same length");let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}o(EA,"xor");j3.exports=EA});var X0=me((XU,V3)=>{"use strict";var SA=O3(),MA=P3(),AA=R3(),TA=q3(),kA=z3(),CA=K3();V3.exports={compare:SA,concat:MA,equals:AA,fromString:TA,toString:kA,xor:CA}});var W3=me(ai=>{"use strict";var DA=ai&&ai.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),OA=ai&&ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),IA=ai&&ai.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&DA(e,r,t);return OA(e,r),e};Object.defineProperty(ai,"__esModule",{value:!0});ai.keyToDidDoc=void 0;var PA=IA(X0());function NA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:PA.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(NA,"keyToDidDoc");ai.keyToDidDoc=NA});var G3=me(fi=>{"use strict";var RA=fi&&fi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),LA=fi&&fi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),BA=fi&&fi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&RA(e,r,t);return LA(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.keyToDidDoc=void 0;var Z0=BA(X0()),UA=lu();function FA(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${Z0.toString(e,"base58btc")}`}o(FA,"encodeKey");function $A(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=UA.convertPublicKeyToX25519(r),s=`${t}#${FA(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:Z0.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:Z0.toString(i,"base58btc")}]}}o($A,"keyToDidDoc");fi.keyToDidDoc=$A});var ex=me(Fr=>{"use strict";var qA=Fr&&Fr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),HA=Fr&&Fr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),X3=Fr&&Fr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&qA(e,r,t);return HA(e,r),e},Z3=Fr&&Fr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getResolver=void 0;var Y3=Z3(Wf()),zA=Z3(G0()),jA=X3(W3()),KA=X3(G3()),VA="application/did+ld+json",J3="application/did+json",WA={231:jA,237:KA};function Q3(){return{key:(r,e,t,n)=>Z(this,null,function*(){let i=n.accept||J3,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let a=zA.default.decode(e.id),f=Y3.default.decode(a),u=a.slice(Y3.default.decode.bytes),m=yield WA[f].keyToDidDoc(u,e.id);i===VA?(m["@context"]="https://w3id.org/did/v1",s.didDocument=m):i===J3?s.didDocument=m:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(a){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=a.toString()}return s})}}o(Q3,"getResolver");Fr.getResolver=Q3;Fr.default={getResolver:Q3}});var rx=me((tF,tx)=>{"use strict";tx.exports=function(r,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(s){return function(a){return function(f,u){var m={key:f,value:a[f]},p={key:u,value:a[u]};return s(m,p)}}}(e.cmp),i=[];return o(function s(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var f,u;if(Array.isArray(a)){for(u="[",f=0;f<a.length;f++)f&&(u+=","),u+=s(a[f])||"null";return u+"]"}if(a===null)return"null";if(i.indexOf(a)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var m=i.push(a)-1,p=Object.keys(a).sort(n&&n(a));for(u="",f=0;f<p.length;f++){var x=p[f],k=s(a[x]);!k||(u&&(u+=","),u+=JSON.stringify(x)+":"+k)}return i.splice(m,1),"{"+u+"}"}},"stringify")(r)}});var ic=me((tc,Na)=>{var yT=200,kx="__lodash_hash_undefined__",Cx=9007199254740991,wp="[object Arguments]",xT="[object Array]",Dx="[object Boolean]",Ox="[object Date]",wT="[object Error]",_p="[object Function]",Ix="[object GeneratorFunction]",hl="[object Map]",Px="[object Number]",Ep="[object Object]",gx="[object Promise]",Nx="[object RegExp]",pl="[object Set]",Rx="[object String]",Lx="[object Symbol]",mp="[object WeakMap]",Bx="[object ArrayBuffer]",ml="[object DataView]",Ux="[object Float32Array]",Fx="[object Float64Array]",$x="[object Int8Array]",qx="[object Int16Array]",Hx="[object Int32Array]",zx="[object Uint8Array]",jx="[object Uint8ClampedArray]",Kx="[object Uint16Array]",Vx="[object Uint32Array]",_T=/[\\^$.*+?()[\]{}|]/g,ET=/\w*$/,ST=/^\[object .+?Constructor\]$/,MT=/^(?:0|[1-9]\d*)$/,At={};At[wp]=At[xT]=At[Bx]=At[ml]=At[Dx]=At[Ox]=At[Ux]=At[Fx]=At[$x]=At[qx]=At[Hx]=At[hl]=At[Px]=At[Ep]=At[Nx]=At[pl]=At[Rx]=At[Lx]=At[zx]=At[jx]=At[Kx]=At[Vx]=!0;At[wT]=At[_p]=At[mp]=!1;var AT=typeof global=="object"&&global&&global.Object===Object&&global,TT=typeof self=="object"&&self&&self.Object===Object&&self,Li=AT||TT||Function("return this")(),Wx=typeof tc=="object"&&tc&&!tc.nodeType&&tc,vx=Wx&&typeof Na=="object"&&Na&&!Na.nodeType&&Na,kT=vx&&vx.exports===Wx;function CT(r,e){return r.set(e[0],e[1]),r}o(CT,"addMapEntry");function DT(r,e){return r.add(e),r}o(DT,"addSetEntry");function OT(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(OT,"arrayEach");function IT(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(IT,"arrayPush");function Gx(r,e,t,n){var i=-1,s=r?r.length:0;for(n&&s&&(t=r[++i]);++i<s;)t=e(t,r[i],i,r);return t}o(Gx,"arrayReduce");function PT(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(PT,"baseTimes");function NT(r,e){return r==null?void 0:r[e]}o(NT,"getValue");function Yx(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch(t){}return e}o(Yx,"isHostObject");function yx(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(yx,"mapToArray");function Sp(r,e){return function(t){return r(e(t))}}o(Sp,"overArg");function xx(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(xx,"setToArray");var RT=Array.prototype,LT=Function.prototype,bl=Object.prototype,pp=Li["__core-js_shared__"],wx=function(){var r=/[^.]+$/.exec(pp&&pp.keys&&pp.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Jx=LT.toString,go=bl.hasOwnProperty,gl=bl.toString,BT=RegExp("^"+Jx.call(go).replace(_T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_x=kT?Li.Buffer:void 0,Ex=Li.Symbol,Sx=Li.Uint8Array,UT=Sp(Object.getPrototypeOf,Object),FT=Object.create,$T=bl.propertyIsEnumerable,qT=RT.splice,Mx=Object.getOwnPropertySymbols,HT=_x?_x.isBuffer:void 0,zT=Sp(Object.keys,Object),bp=Ba(Li,"DataView"),rc=Ba(Li,"Map"),gp=Ba(Li,"Promise"),vp=Ba(Li,"Set"),yp=Ba(Li,"WeakMap"),nc=Ba(Object,"create"),jT=vs(bp),KT=vs(rc),VT=vs(gp),WT=vs(vp),GT=vs(yp),Ax=Ex?Ex.prototype:void 0,Tx=Ax?Ax.valueOf:void 0;function gs(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(gs,"Hash");function YT(){this.__data__=nc?nc(null):{}}o(YT,"hashClear");function JT(r){return this.has(r)&&delete this.__data__[r]}o(JT,"hashDelete");function XT(r){var e=this.__data__;if(nc){var t=e[r];return t===kx?void 0:t}return go.call(e,r)?e[r]:void 0}o(XT,"hashGet");function ZT(r){var e=this.__data__;return nc?e[r]!==void 0:go.call(e,r)}o(ZT,"hashHas");function QT(r,e){var t=this.__data__;return t[r]=nc&&e===void 0?kx:e,this}o(QT,"hashSet");gs.prototype.clear=YT;gs.prototype.delete=JT;gs.prototype.get=XT;gs.prototype.has=ZT;gs.prototype.set=QT;function Bi(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Bi,"ListCache");function ek(){this.__data__=[]}o(ek,"listCacheClear");function tk(r){var e=this.__data__,t=vl(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():qT.call(e,t,1),!0}o(tk,"listCacheDelete");function rk(r){var e=this.__data__,t=vl(e,r);return t<0?void 0:e[t][1]}o(rk,"listCacheGet");function nk(r){return vl(this.__data__,r)>-1}o(nk,"listCacheHas");function ik(r,e){var t=this.__data__,n=vl(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(ik,"listCacheSet");Bi.prototype.clear=ek;Bi.prototype.delete=tk;Bi.prototype.get=rk;Bi.prototype.has=nk;Bi.prototype.set=ik;function Ra(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Ra,"MapCache");function ok(){this.__data__={hash:new gs,map:new(rc||Bi),string:new gs}}o(ok,"mapCacheClear");function sk(r){return yl(this,r).delete(r)}o(sk,"mapCacheDelete");function ak(r){return yl(this,r).get(r)}o(ak,"mapCacheGet");function fk(r){return yl(this,r).has(r)}o(fk,"mapCacheHas");function ck(r,e){return yl(this,r).set(r,e),this}o(ck,"mapCacheSet");Ra.prototype.clear=ok;Ra.prototype.delete=sk;Ra.prototype.get=ak;Ra.prototype.has=fk;Ra.prototype.set=ck;function La(r){this.__data__=new Bi(r)}o(La,"Stack");function uk(){this.__data__=new Bi}o(uk,"stackClear");function lk(r){return this.__data__.delete(r)}o(lk,"stackDelete");function dk(r){return this.__data__.get(r)}o(dk,"stackGet");function hk(r){return this.__data__.has(r)}o(hk,"stackHas");function pk(r,e){var t=this.__data__;if(t instanceof Bi){var n=t.__data__;if(!rc||n.length<yT-1)return n.push([r,e]),this;t=this.__data__=new Ra(n)}return t.set(r,e),this}o(pk,"stackSet");La.prototype.clear=uk;La.prototype.delete=lk;La.prototype.get=dk;La.prototype.has=hk;La.prototype.set=pk;function mk(r,e){var t=Ap(r)||Fk(r)?PT(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||go.call(r,s))&&!(i&&(s=="length"||Rk(s,n)))&&t.push(s);return t}o(mk,"arrayLikeKeys");function Xx(r,e,t){var n=r[e];(!(go.call(r,e)&&t6(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(Xx,"assignValue");function vl(r,e){for(var t=r.length;t--;)if(t6(r[t][0],e))return t;return-1}o(vl,"assocIndexOf");function bk(r,e){return r&&Zx(e,Tp(e),r)}o(bk,"baseAssign");function xp(r,e,t,n,i,s,a){var f;if(n&&(f=s?n(r,i,s,a):n(r)),f!==void 0)return f;if(!xl(r))return r;var u=Ap(r);if(u){if(f=Ik(r),!e)return Ck(r,f)}else{var m=bs(r),p=m==_p||m==Ix;if(qk(r))return _k(r,e);if(m==Ep||m==wp||p&&!s){if(Yx(r))return s?r:{};if(f=Pk(p?{}:r),!e)return Dk(r,bk(f,r))}else{if(!At[m])return s?r:{};f=Nk(r,m,xp,e)}}a||(a=new La);var x=a.get(r);if(x)return x;if(a.set(r,f),!u)var k=t?Ok(r):Tp(r);return OT(k||r,function(I,T){k&&(T=I,I=r[T]),Xx(f,T,xp(I,e,t,n,T,r,a))}),f}o(xp,"baseClone");function gk(r){return xl(r)?FT(r):{}}o(gk,"baseCreate");function vk(r,e,t){var n=e(r);return Ap(r)?n:IT(n,t(r))}o(vk,"baseGetAllKeys");function yk(r){return gl.call(r)}o(yk,"baseGetTag");function xk(r){if(!xl(r)||Bk(r))return!1;var e=n6(r)||Yx(r)?BT:ST;return e.test(vs(r))}o(xk,"baseIsNative");function wk(r){if(!e6(r))return zT(r);var e=[];for(var t in Object(r))go.call(r,t)&&t!="constructor"&&e.push(t);return e}o(wk,"baseKeys");function _k(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(_k,"cloneBuffer");function Mp(r){var e=new r.constructor(r.byteLength);return new Sx(e).set(new Sx(r)),e}o(Mp,"cloneArrayBuffer");function Ek(r,e){var t=e?Mp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(Ek,"cloneDataView");function Sk(r,e,t){var n=e?t(yx(r),!0):yx(r);return Gx(n,CT,new r.constructor)}o(Sk,"cloneMap");function Mk(r){var e=new r.constructor(r.source,ET.exec(r));return e.lastIndex=r.lastIndex,e}o(Mk,"cloneRegExp");function Ak(r,e,t){var n=e?t(xx(r),!0):xx(r);return Gx(n,DT,new r.constructor)}o(Ak,"cloneSet");function Tk(r){return Tx?Object(Tx.call(r)):{}}o(Tk,"cloneSymbol");function kk(r,e){var t=e?Mp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(kk,"cloneTypedArray");function Ck(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(Ck,"copyArray");function Zx(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var a=e[i],f=n?n(t[a],r[a],a,t,r):void 0;Xx(t,a,f===void 0?r[a]:f)}return t}o(Zx,"copyObject");function Dk(r,e){return Zx(r,Qx(r),e)}o(Dk,"copySymbols");function Ok(r){return vk(r,Tp,Qx)}o(Ok,"getAllKeys");function yl(r,e){var t=r.__data__;return Lk(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(yl,"getMapData");function Ba(r,e){var t=NT(r,e);return xk(t)?t:void 0}o(Ba,"getNative");var Qx=Mx?Sp(Mx,Object):jk,bs=yk;(bp&&bs(new bp(new ArrayBuffer(1)))!=ml||rc&&bs(new rc)!=hl||gp&&bs(gp.resolve())!=gx||vp&&bs(new vp)!=pl||yp&&bs(new yp)!=mp)&&(bs=o(function(r){var e=gl.call(r),t=e==Ep?r.constructor:void 0,n=t?vs(t):void 0;if(n)switch(n){case jT:return ml;case KT:return hl;case VT:return gx;case WT:return pl;case GT:return mp}return e},"getTag"));function Ik(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&go.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(Ik,"initCloneArray");function Pk(r){return typeof r.constructor=="function"&&!e6(r)?gk(UT(r)):{}}o(Pk,"initCloneObject");function Nk(r,e,t,n){var i=r.constructor;switch(e){case Bx:return Mp(r);case Dx:case Ox:return new i(+r);case ml:return Ek(r,n);case Ux:case Fx:case $x:case qx:case Hx:case zx:case jx:case Kx:case Vx:return kk(r,n);case hl:return Sk(r,n,t);case Px:case Rx:return new i(r);case Nx:return Mk(r);case pl:return Ak(r,n,t);case Lx:return Tk(r)}}o(Nk,"initCloneByTag");function Rk(r,e){return e=e==null?Cx:e,!!e&&(typeof r=="number"||MT.test(r))&&r>-1&&r%1==0&&r<e}o(Rk,"isIndex");function Lk(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(Lk,"isKeyable");function Bk(r){return!!wx&&wx in r}o(Bk,"isMasked");function e6(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||bl;return r===t}o(e6,"isPrototype");function vs(r){if(r!=null){try{return Jx.call(r)}catch(e){}try{return r+""}catch(e){}}return""}o(vs,"toSource");function Uk(r){return xp(r,!0,!0)}o(Uk,"cloneDeep");function t6(r,e){return r===e||r!==r&&e!==e}o(t6,"eq");function Fk(r){return $k(r)&&go.call(r,"callee")&&(!$T.call(r,"callee")||gl.call(r)==wp)}o(Fk,"isArguments");var Ap=Array.isArray;function r6(r){return r!=null&&Hk(r.length)&&!n6(r)}o(r6,"isArrayLike");function $k(r){return zk(r)&&r6(r)}o($k,"isArrayLikeObject");var qk=HT||Kk;function n6(r){var e=xl(r)?gl.call(r):"";return e==_p||e==Ix}o(n6,"isFunction");function Hk(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Cx}o(Hk,"isLength");function xl(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(xl,"isObject");function zk(r){return!!r&&typeof r=="object"}o(zk,"isObjectLike");function Tp(r){return r6(r)?mk(r):wk(r)}o(Tp,"keys");function jk(){return[]}o(jk,"stubArray");function Kk(){return!1}o(Kk,"stubFalse");Na.exports=Uk});var M6=me((KF,El)=>{var i6,o6,s6,a6,f6,c6,u6,l6,d6,wl,kp,h6,p6,m6,Ua,b6,g6,v6,y6,x6,w6,_6,E6,S6,_l;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof El=="object"&&typeof El.exports=="object"?r(t(e,t(El.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}o(t,"createExporter")})(function(r){var e=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])};i6=o(function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}o(s,"__"),n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},"__extends"),o6=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(n[f]=i[f])}return n},s6=o(function(n,i){var s={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,a=Object.getOwnPropertySymbols(n);f<a.length;f++)i.indexOf(a[f])<0&&Object.prototype.propertyIsEnumerable.call(n,a[f])&&(s[a[f]]=n[a[f]]);return s},"__rest"),a6=o(function(n,i,s,a){var f=arguments.length,u=f<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,i,s,a);else for(var p=n.length-1;p>=0;p--)(m=n[p])&&(u=(f<3?m(u):f>3?m(i,s,u):m(i,s))||u);return f>3&&u&&Object.defineProperty(i,s,u),u},"__decorate"),f6=o(function(n,i){return function(s,a){i(s,a,n)}},"__param"),c6=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),u6=o(function(n,i,s,a){function f(u){return u instanceof s?u:new s(function(m){m(u)})}return o(f,"adopt"),new(s||(s=Promise))(function(u,m){function p(I){try{k(a.next(I))}catch(T){m(T)}}o(p,"fulfilled");function x(I){try{k(a.throw(I))}catch(T){m(T)}}o(x,"rejected");function k(I){I.done?u(I.value):f(I.value).then(p,x)}o(k,"step"),k((a=a.apply(n,i||[])).next())})},"__awaiter"),l6=o(function(n,i){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,f,u,m;return m={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function p(k){return function(I){return x([k,I])}}function x(k){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,f&&(u=k[0]&2?f.return:k[0]?f.throw||((u=f.return)&&u.call(f),0):f.next)&&!(u=u.call(f,k[1])).done)return u;switch(f=0,u&&(k=[k[0]&2,u.value]),k[0]){case 0:case 1:u=k;break;case 4:return s.label++,{value:k[1],done:!1};case 5:s.label++,f=k[1],k=[0];continue;case 7:k=s.ops.pop(),s.trys.pop();continue;default:if(u=s.trys,!(u=u.length>0&&u[u.length-1])&&(k[0]===6||k[0]===2)){s=0;continue}if(k[0]===3&&(!u||k[1]>u[0]&&k[1]<u[3])){s.label=k[1];break}if(k[0]===6&&s.label<u[1]){s.label=u[1],u=k;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(k);break}u[2]&&s.ops.pop(),s.trys.pop();continue}k=i.call(n,s)}catch(I){k=[6,I],f=0}finally{a=u=0}if(k[0]&5)throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}},"__generator"),d6=o(function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&_l(i,n,s)},"__exportStar"),_l=Object.create?function(n,i,s,a){a===void 0&&(a=s);var f=Object.getOwnPropertyDescriptor(i,s);(!f||("get"in f?!i.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,f)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]},wl=o(function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],a=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),kp=o(function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),f,u=[],m;try{for(;(i===void 0||i-- >0)&&!(f=a.next()).done;)u.push(f.value)}catch(p){m={error:p}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(m)throw m.error}}return u},"__read"),h6=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(kp(arguments[i]));return n},"__spread"),p6=o(function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var a=Array(n),f=0,i=0;i<s;i++)for(var u=arguments[i],m=0,p=u.length;m<p;m++,f++)a[f]=u[m];return a},"__spreadArrays"),m6=o(function(n,i,s){if(s||arguments.length===2)for(var a=0,f=i.length,u;a<f;a++)(u||!(a in i))&&(u||(u=Array.prototype.slice.call(i,0,a)),u[a]=i[a]);return n.concat(u||Array.prototype.slice.call(i))},"__spreadArray"),Ua=o(function(n){return this instanceof Ua?(this.v=n,this):new Ua(n)},"__await"),b6=o(function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(n,i||[]),f,u=[];return f={},m("next"),m("throw"),m("return"),f[Symbol.asyncIterator]=function(){return this},f;function m(C){a[C]&&(f[C]=function($){return new Promise(function(O,U){u.push([C,$,O,U])>1||p(C,$)})})}function p(C,$){try{x(a[C]($))}catch(O){T(u[0][3],O)}}function x(C){C.value instanceof Ua?Promise.resolve(C.value.v).then(k,I):T(u[0][2],C)}function k(C){p("next",C)}function I(C){p("throw",C)}function T(C,$){C($),u.shift(),u.length&&p(u[0][0],u[0][1])}},"__asyncGenerator"),g6=o(function(n){var i,s;return i={},a("next"),a("throw",function(f){throw f}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(f,u){i[f]=n[f]?function(m){return(s=!s)?{value:Ua(n[f](m)),done:f==="return"}:u?u(m):m}:u}},"__asyncDelegator"),v6=o(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof wl=="function"?wl(n):n[Symbol.iterator](),s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s);function a(u){s[u]=n[u]&&function(m){return new Promise(function(p,x){m=n[u](m),f(p,x,m.done,m.value)})}}function f(u,m,p,x){Promise.resolve(x).then(function(k){u({value:k,done:p})},m)}},"__asyncValues"),y6=o(function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n},"__makeTemplateObject");var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};x6=o(function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&_l(i,n,s);return t(i,n),i},"__importStar"),w6=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),_6=o(function(n,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(n):a?a.value:i.get(n)},"__classPrivateFieldGet"),E6=o(function(n,i,s,a,f){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!f:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?f.call(n,s):f?f.value=s:i.set(n,s),s},"__classPrivateFieldSet"),S6=o(function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},"__classPrivateFieldIn"),r("__extends",i6),r("__assign",o6),r("__rest",s6),r("__decorate",a6),r("__param",f6),r("__metadata",c6),r("__awaiter",u6),r("__generator",l6),r("__exportStar",d6),r("__createBinding",_l),r("__values",wl),r("__read",kp),r("__spread",h6),r("__spreadArrays",p6),r("__spreadArray",m6),r("__await",Ua),r("__asyncGenerator",b6),r("__asyncDelegator",g6),r("__asyncValues",v6),r("__makeTemplateObject",y6),r("__importStar",x6),r("__importDefault",w6),r("__classPrivateFieldGet",_6),r("__classPrivateFieldSet",E6),r("__classPrivateFieldIn",S6)})});var dw=me((Ui,lw)=>{var uw=typeof self!="undefined"?self:Ui,Vl=function(){function r(){this.fetch=!1,this.DOMException=uw.DOMException}return o(r,"F"),r.prototype=uw,new r}();(function(r){var e=function(t){var n={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(E){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function i(E){return E&&DataView.prototype.isPrototypeOf(E)}if(o(i,"isDataView"),n.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(E){return E&&s.indexOf(Object.prototype.toString.call(E))>-1};function f(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}o(f,"normalizeName");function u(E){return typeof E!="string"&&(E=String(E)),E}o(u,"normalizeValue");function m(E){var l={next:function(){var g=E.shift();return{done:g===void 0,value:g}}};return n.iterable&&(l[Symbol.iterator]=function(){return l}),l}o(m,"iteratorFor");function p(E){this.map={},E instanceof p?E.forEach(function(l,g){this.append(g,l)},this):Array.isArray(E)?E.forEach(function(l){this.append(l[0],l[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(l){this.append(l,E[l])},this)}o(p,"Headers"),p.prototype.append=function(E,l){E=f(E),l=u(l);var g=this.map[E];this.map[E]=g?g+", "+l:l},p.prototype.delete=function(E){delete this.map[f(E)]},p.prototype.get=function(E){return E=f(E),this.has(E)?this.map[E]:null},p.prototype.has=function(E){return this.map.hasOwnProperty(f(E))},p.prototype.set=function(E,l){this.map[f(E)]=u(l)},p.prototype.forEach=function(E,l){for(var g in this.map)this.map.hasOwnProperty(g)&&E.call(l,this.map[g],g,this)},p.prototype.keys=function(){var E=[];return this.forEach(function(l,g){E.push(g)}),m(E)},p.prototype.values=function(){var E=[];return this.forEach(function(l){E.push(l)}),m(E)},p.prototype.entries=function(){var E=[];return this.forEach(function(l,g){E.push([g,l])}),m(E)},n.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function x(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}o(x,"consumed");function k(E){return new Promise(function(l,g){E.onload=function(){l(E.result)},E.onerror=function(){g(E.error)}})}o(k,"fileReaderReady");function I(E){var l=new FileReader,g=k(l);return l.readAsArrayBuffer(E),g}o(I,"readBlobAsArrayBuffer");function T(E){var l=new FileReader,g=k(l);return l.readAsText(E),g}o(T,"readBlobAsText");function C(E){for(var l=new Uint8Array(E),g=new Array(l.length),h=0;h<l.length;h++)g[h]=String.fromCharCode(l[h]);return g.join("")}o(C,"readArrayBufferAsText");function $(E){if(E.slice)return E.slice(0);var l=new Uint8Array(E.byteLength);return l.set(new Uint8Array(E)),l.buffer}o($,"bufferClone");function O(){return this.bodyUsed=!1,this._initBody=function(E){this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:n.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:n.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():n.arrayBuffer&&n.blob&&i(E)?(this._bodyArrayBuffer=$(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||a(E))?this._bodyArrayBuffer=$(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var E=x(this);if(E)return E;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?x(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(I)}),this.text=function(){var E=x(this);if(E)return E;if(this._bodyBlob)return T(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(X)}),this.json=function(){return this.text().then(JSON.parse)},this}o(O,"Body");var U=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function j(E){var l=E.toUpperCase();return U.indexOf(l)>-1?l:E}o(j,"normalizeMethod");function H(E,l){l=l||{};var g=l.body;if(E instanceof H){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,l.headers||(this.headers=new p(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!g&&E._bodyInit!=null&&(g=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=l.credentials||this.credentials||"same-origin",(l.headers||!this.headers)&&(this.headers=new p(l.headers)),this.method=j(l.method||this.method||"GET"),this.mode=l.mode||this.mode||null,this.signal=l.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&g)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(g)}o(H,"Request"),H.prototype.clone=function(){return new H(this,{body:this._bodyInit})};function X(E){var l=new FormData;return E.trim().split("&").forEach(function(g){if(g){var h=g.split("="),c=h.shift().replace(/\+/g," "),d=h.join("=").replace(/\+/g," ");l.append(decodeURIComponent(c),decodeURIComponent(d))}}),l}o(X,"decode");function B(E){var l=new p,g=E.replace(/\r?\n[\t ]+/g," ");return g.split(/\r?\n/).forEach(function(h){var c=h.split(":"),d=c.shift().trim();if(d){var y=c.join(":").trim();l.append(d,y)}}),l}o(B,"parseHeaders"),O.call(H.prototype);function L(E,l){l||(l={}),this.type="default",this.status=l.status===void 0?200:l.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in l?l.statusText:"OK",this.headers=new p(l.headers),this.url=l.url||"",this._initBody(E)}o(L,"Response"),O.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},L.error=function(){var E=new L(null,{status:0,statusText:""});return E.type="error",E};var F=[301,302,303,307,308];L.redirect=function(E,l){if(F.indexOf(l)===-1)throw new RangeError("Invalid status code");return new L(null,{status:l,headers:{location:E}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(E){t.DOMException=function(l,g){this.message=l,this.name=g;var h=Error(l);this.stack=h.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function re(E,l){return new Promise(function(g,h){var c=new H(E,l);if(c.signal&&c.signal.aborted)return h(new t.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function y(){d.abort()}o(y,"abortXhr"),d.onload=function(){var _={status:d.status,statusText:d.statusText,headers:B(d.getAllResponseHeaders()||"")};_.url="responseURL"in d?d.responseURL:_.headers.get("X-Request-URL");var w="response"in d?d.response:d.responseText;g(new L(w,_))},d.onerror=function(){h(new TypeError("Network request failed"))},d.ontimeout=function(){h(new TypeError("Network request failed"))},d.onabort=function(){h(new t.DOMException("Aborted","AbortError"))},d.open(c.method,c.url,!0),c.credentials==="include"?d.withCredentials=!0:c.credentials==="omit"&&(d.withCredentials=!1),"responseType"in d&&n.blob&&(d.responseType="blob"),c.headers.forEach(function(_,w){d.setRequestHeader(w,_)}),c.signal&&(c.signal.addEventListener("abort",y),d.onreadystatechange=function(){d.readyState===4&&c.signal.removeEventListener("abort",y)}),d.send(typeof c._bodyInit=="undefined"?null:c._bodyInit)})}return o(re,"fetch"),re.polyfill=!0,r.fetch||(r.fetch=re,r.Headers=p,r.Request=H,r.Response=L),t.Headers=p,t.Request=H,t.Response=L,t.fetch=re,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(Vl);Vl.fetch.ponyfill=!0;delete Vl.fetch.polyfill;var Ka=Vl;Ui=Ka.fetch;Ui.default=Ka.fetch;Ui.fetch=Ka.fetch;Ui.Headers=Ka.Headers;Ui.Request=Ka.Request;Ui.Response=Ka.Response;lw.exports=Ui});var Mw=me((Qj,Sw)=>{"use strict";var wC=function(){function r(t,n){if(typeof t!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+t+"."));this._batchLoadFn=t,this._maxBatchSize=MC(n),this._batchScheduleFn=AC(n),this._cacheKeyFn=TC(n),this._cacheMap=kC(n),this._batch=null}o(r,"DataLoader");var e=r.prototype;return e.load=o(function(n){if(n==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(n)+"."));var i=EC(this),s=this._cacheMap,a=this._cacheKeyFn(n);if(s){var f=s.get(a);if(f){var u=i.cacheHits||(i.cacheHits=[]);return new Promise(function(p){u.push(function(){p(f)})})}}i.keys.push(n);var m=new Promise(function(p,x){i.callbacks.push({resolve:p,reject:x})});return s&&s.set(a,m),m},"load"),e.loadMany=o(function(n){if(!Ew(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var i=[],s=0;s<n.length;s++)i.push(this.load(n[s]).catch(function(a){return a}));return Promise.all(i)},"loadMany"),e.clear=o(function(n){var i=this._cacheMap;if(i){var s=this._cacheKeyFn(n);i.delete(s)}return this},"clear"),e.clearAll=o(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),e.prime=o(function(n,i){var s=this._cacheMap;if(s){var a=this._cacheKeyFn(n);if(s.get(a)===void 0){var f;i instanceof Error?(f=Promise.reject(i),f.catch(function(){})):f=Promise.resolve(i),s.set(a,f)}}return this},"prime"),r}(),_C=typeof process=="object"&&typeof process.nextTick=="function"?function(r){Vp||(Vp=Promise.resolve()),Vp.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},Vp;function EC(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize&&(!e.cacheHits||e.cacheHits.length<r._maxBatchSize))return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){SC(r,t)}),t}o(EC,"getCurrentBatch");function SC(r,e){if(e.hasDispatched=!0,e.keys.length===0){Wp(e);return}var t=r._batchLoadFn(e.keys);if(!t||typeof t.then!="function")return _w(r,e,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(t)+".")));t.then(function(n){if(!Ew(n))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(n)+"."));if(n.length!==e.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."+(`
627
627
 
628
628
  Keys:
629
629
  `+String(e.keys))+(`
630
630
 
631
631
  Values:
632
- `+String(n)));Wp(e);for(var i=0;i<e.callbacks.length;i++){var s=n[i];s instanceof Error?e.callbacks[i].reject(s):e.callbacks[i].resolve(s)}}).catch(function(n){_w(r,e,n)})}o(xC,"dispatchBatch");function _w(r,e,t){Wp(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(_w,"failedDispatch");function Wp(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Wp,"resolveCacheHits");function wC(r){var e=!r||r.batch!==!1;if(!e)return 1;var t=r&&r.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}o(wC,"getValidMaxBatchSize");function _C(r){var e=r&&r.batchScheduleFn;if(e===void 0)return vC;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(_C,"getValidBatchScheduleFn");function EC(r){var e=r&&r.cacheKeyFn;if(e===void 0)return function(t){return t};if(typeof e!="function")throw new TypeError("cacheKeyFn must be a function: "+e);return e}o(EC,"getValidCacheKeyFn");function SC(r){var e=!r||r.cache!==!1;if(!e)return null;var t=r&&r.cacheMap;if(t===void 0)return new Map;if(t!==null){var n=["get","set","delete","clear"],i=n.filter(function(s){return t&&typeof t[s]!="function"});if(i.length!==0)throw new TypeError("Custom cacheMap missing methods: "+i.join(", "))}return t}o(SC,"getValidCacheMap");function Ew(r){return typeof r=="object"&&r!==null&&typeof r.length=="number"&&(r.length===0||r.length>0&&Object.prototype.hasOwnProperty.call(r,r.length-1))}o(Ew,"isArrayLike");Sw.exports=gC});var Fw=me((EK,Uw)=>{Uw.exports=Bw;var Lw=128,zC=127,KC=~zC,VC=Math.pow(2,31);function Bw(r,e,t){e=e||[],t=t||0;for(var n=t;r>=VC;)e[t++]=r&255|Lw,r/=128;for(;r&KC;)e[t++]=r&255|Lw,r>>>=7;return e[t]=r|0,Bw.bytes=t-n+1,e}o(Bw,"encode")});var Hw=me((SK,qw)=>{qw.exports=om;var WC=128,$w=127;function om(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw om.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&$w)<<i:(a&$w)*Math.pow(2,i),i+=7}while(a>=WC);return om.bytes=s-n,t}o(om,"read")});var zw=me((MK,jw)=>{var GC=Math.pow(2,7),YC=Math.pow(2,14),JC=Math.pow(2,21),XC=Math.pow(2,28),ZC=Math.pow(2,35),QC=Math.pow(2,42),eD=Math.pow(2,49),tD=Math.pow(2,56),rD=Math.pow(2,63);jw.exports=function(r){return r<GC?1:r<YC?2:r<JC?3:r<XC?4:r<ZC?5:r<QC?6:r<eD?7:r<tD?8:r<rD?9:10}});var Vw=me((AK,Kw)=>{Kw.exports={encode:Fw(),decode:Hw(),encodingLength:zw()}});var Gw=me((TK,Ww)=>{"use strict";var nD=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});Ww.exports={names:nD}});var t4=me((kK,e4)=>{"use strict";var Yw=G0(),Ya=Vw(),{names:bc}=Gw(),{toString:td}=(lf(),tf(u1)),{fromString:iD}=(jc(),tf(c1)),{concat:oD}=(yd(),tf(Lm)),Ja={};for(let r in bc){let e=r;Ja[bc[e]]=e}Object.freeze(Ja);function sD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return td(r,"base16")}o(sD,"toHexString");function aD(r){return iD(r,"base16")}o(aD,"fromHexString");function fD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return td(Yw.encode("base58btc",r)).slice(1)}o(fD,"toB58String");function cD(r){let e=r instanceof Uint8Array?td(r):r;return Yw.decode("z"+e)}o(cD,"fromB58String");function Jw(r){if(!(r instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(r.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=Ya.decode(r);if(!Zw(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Ya.decode.bytes);let t=Ya.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Ya.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${td(r,"base16")}`);return{code:e,name:Ja[e],length:t,digest:r}}o(Jw,"decode");function uD(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=Xw(e);if(!(r instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(t==null&&(t=r.length),t&&r.length!==t)throw new Error("digest length should be equal to specified length.");let i=Ya.encode(n),s=Ya.encode(t);return oD([i,s,r],i.length+s.length+r.length)}o(uD,"encode");function Xw(r){let e=r;if(typeof r=="string"){if(bc[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=bc[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Ja[e]===void 0&&!sm(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(Xw,"coerceCode");function sm(r){return r>0&&r<16}o(sm,"isAppCode");function Zw(r){return!!(sm(r)||Ja[r])}o(Zw,"isValidCode");function Qw(r){Jw(r)}o(Qw,"validate");function lD(r){return Qw(r),r.subarray(0,2)}o(lD,"prefix");e4.exports={names:bc,codes:Ja,toHexString:sD,fromHexString:aD,toB58String:fD,fromB58String:cD,decode:Jw,encode:uD,coerceCode:Xw,isAppCode:sm,validate:Qw,prefix:lD,isValidCode:Zw}});var $O={};St($O,{walletFromKey:()=>s5});module.exports=tf($O);var pY=require("isomorphic-fetch");var Pm=at(require("isomorphic-webcrypto"));typeof window=="undefined"&&(globalThis.crypto=Pm.default);var p5=o((r,e)=>Z(void 0,null,function*(){return rf(r.contents,{plugins:[...r.plugins,e]})}),"addPluginToWallet"),m5=o((r,e)=>Z(void 0,null,function*(){return rf([...r.contents,e],r)}),"addToWallet"),b5=o((r,e)=>Z(void 0,null,function*(){let t=JSON.parse(JSON.stringify(r.contents)),n=t.find(i=>i.id===e);return rf(t.filter(i=>i.id!==n.id),r)}),"removeFromWallet"),g5=o((r,e)=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.bind(r,r)])),"bindMethods"),rf=o((...t)=>Z(void 0,[...t],function*(r=[],e={}){let{plugins:n=[]}=e,i=n.reduce((a,f)=>ie(ie({},a),f.pluginMethods),{}),s={contents:[...r],add:function(a){return m5(this,a)},remove:function(a){return b5(this,a)},status:"UNLOCKED",plugins:n,pluginMethods:i,addPlugin:function(a){return p5(this,a)}};return i&&(s.pluginMethods=g5(s,i)),s}),"generateWallet");function v5(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(v5,"_catch");function y5(){let r=new Map;return function(e,t){try{let i=function(a){if(n)return a;let f=r.get(e.didUrl);return f!==void 0?f:Promise.resolve(t()).then(function(u){var m;return((m=u.didResolutionMetadata)==null?void 0:m.error)!=="notFound"&&r.set(e.didUrl,u),u})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(a){return n=1,a})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(y5,"inMemoryCache");function x5(r,e){return e()}o(x5,"noCache");var w5="(?:%[0-9a-fA-F]{2})",Nm=`(?:[a-zA-Z0-9._-]|${w5})`,_5="([a-z0-9]+)",E5=`((?:${Nm}*:)*(${Nm}+))`,Rm="[a-zA-Z0-9_.:%-]",S5=`;${Rm}+=${Rm}*`,M5=`((${S5})*)`,A5="(/[^#?]*)?",T5="([?][^#]*)?",k5="(#.*)?",C5=new RegExp(`^did:${_5}:${E5}${M5}${A5}${T5}${k5}$`);function vd(r){if(r===""||!r)return null;let e=r.match(C5);if(e){let t={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:r};if(e[4]){let n=e[4].slice(1).split(";");t.params={};for(let i of n){let s=i.split("=");t.params[s[0]]=s[1]}}return e[6]&&(t.path=e[6]),e[7]&&(t.query=e[7].slice(1)),e[8]&&(t.fragment=e[8].slice(1)),t}return null}o(vd,"parse");var Cc={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function D5(r){return function(e,t,n){try{return Promise.resolve(v5(function(){return Promise.resolve(r(e,t,n)).then(function(i){return Ae(ie({},Cc),{didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i})})},function(i){return Ae(ie({},Cc),{didResolutionMetadata:{error:"notFound",message:i.toString()}})}))}catch(i){return Promise.reject(i)}}}o(D5,"wrapLegacyResolver");var nf=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?y5():t.cache||x5,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=D5(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=vd(e);if(i===null)return Promise.resolve(Ae(ie({},Cc),{didResolutionMetadata:{error:"invalidDid"}}));let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve(Ae(ie({},Cc),{didResolutionMetadata:{error:"unsupportedDidMethod"}}))}catch(n){return Promise.reject(n)}}};o(nf,"Resolver");yd();jc();lf();qc();var Gh=at(v1()),Hg=at(Qd()),Yh=at(Kb()),vu=at(lu()),jg=at(bg()),Af=at(xg()),Jh=at(Ng()),Xh=at(no());function sn(r){return It(r,"base64url")}o(sn,"bytesToBase64url");function Mr(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Rt(e,"base64url")}o(Mr,"base64ToBytes");function Zh(r){return Rt(r,"base58btc")}o(Zh,"base58ToBytes");function Kh(r){let e=r.startsWith("0x")?r.substring(2):r;return Rt(e.toLowerCase(),"base16")}o(Kh,"hexToBytes");function Vh(r){return sn(Rt(r))}o(Vh,"encodeBase64url");function zg(r){return It(Mr(r))}o(zg,"decodeBase64url");function ts(r){return It(r,"base16")}o(ts,"bytesToHex");function Kg(r){return Rt(r)}o(Kg,"stringToBytes");function g7({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Rt(r,"base16"),0),i.set(Rt(e,"base16"),32),n){if(typeof t=="undefined")throw new Error("Signer did not return a recoveryParam");i[64]=t}return sn(i)}o(g7,"toJose");function v7(r){let e=Mr(r);if(e.length<64||e.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${e.length}`);let t=ts(e.slice(0,32)),n=ts(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(v7,"fromJose");function Vg(r,e){return vn([Mr(r),Mr(e)])}o(Vg,"toSealed");var y7=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,x7=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,w7=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function _7(r){if(typeof r=="string"){if(y7.test(r))return Kh(r);if(x7.test(r))return Zh(r);if(w7.test(r))return Mr(r);throw TypeError("bad_key: Invalid private key format")}else{if(r instanceof Uint8Array)return r;throw TypeError("bad_key: Invalid private key format")}}o(_7,"parseKey");function Wg(r){let e=typeof r=="string"?Rt(r):r;return(0,Gh.hash)(e)}o(Wg,"sha256");function E7(r){return new Uint8Array(Hg.keccak_256.arrayBuffer(r))}o(E7,"keccak");function S7(r){let e=Rt(r.slice(2),"base16");return`0x${It(E7(e).slice(-20),"base16")}`}o(S7,"toEthereumAddress");function Wh(r,e=new Uint8Array(4)){let t=Rt(r.toString(),"base10");return e.set(t,4-t.length),e}o(Wh,"writeUint32BE");var zh=o(r=>vn([Wh(r.length),r]),"lengthAndInput");function Gg(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=vn([zh(Rt(t)),zh(typeof n=="undefined"?new Uint8Array(0):n),zh(typeof i=="undefined"?new Uint8Array(0):i),Wh(e)]);return(0,Gh.hash)(vn([Wh(1),r,s]))}o(Gg,"concatKDF");var XN=new Yh.ec("secp256k1");function Yg(r){let e=_7(r);if(e.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${e.length}`);return function(t){try{let n=typeof t=="string"?Kg(t):t,i=(0,vu.sign)(e,n);return Promise.resolve(sn(i))}catch(n){return Promise.reject(n)}}}o(Yg,"EdDSASigner");function Jg(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Jg,"instanceOfEcdsaSignature");function Rg(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Jg(i))return g7(i,r);if(r&&typeof v7(i).recoveryParam=="undefined")throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return i})}catch(i){return Promise.reject(i)}},"sign")}o(Rg,"ES256KSignerAlg");function Lg(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Jg(n))throw new Error("invalid_config: expected a signer function that returns a string instead of signature object");return n})}catch(n){return Promise.reject(n)}},"sign")}o(Lg,"Ed25519SignerAlg");var M7={ES256K:Rg(),"ES256K-R":Rg(!0),Ed25519:Lg(),EdDSA:Lg()};function A7(r){let e=M7[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(A7,"SignerAlg");var Qh=new Yh.ec("secp256k1");function gu(r,e=!1){let t=Mr(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=ts(t.slice(0,32)),i=ts(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(gu,"toSignatureObject");function e0(r){if(r.publicKeyBase58)return Zh(r.publicKeyBase58);if(r.publicKeyBase64)return Mr(r.publicKeyBase64);if(r.publicKeyHex)return Kh(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return Kh(Qh.keyFromPublic({x:ts(Mr(r.publicKeyJwk.x)),y:ts(Mr(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Ys;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(e0,"extractPublicKeyBytes");function T7(r,e,t){let n=Wg(r),i=gu(e),s=t.filter(({ethereumAddress:u,blockchainAccountId:m})=>typeof u=="undefined"&&typeof m=="undefined"),a=t.filter(({ethereumAddress:u,blockchainAccountId:m})=>typeof u!="undefined"||typeof m!==void 0),f=s.find(u=>{try{let m=e0(u);return Qh.keyFromPublic(m).verify(n,i)}catch(m){return!1}});if(!f&&a.length>0&&(f=Xg(r,e,a)),!f)throw new Error("invalid_signature: Signature invalid for JWT");return f}o(T7,"verifyES256K");function Xg(r,e,t){let n;if(e.length>86)n=[gu(e,!0)];else{let a=gu(e,!1);n=[Ae(ie({},a),{recoveryParam:0}),Ae(ie({},a),{recoveryParam:1})]}let i=o(a=>{let f=Wg(r),u=Qh.recoverPubKey(f,a,a.recoveryParam),m=u.encode("hex"),p=u.encode("hex",!0),x=S7(m);return t.find(O=>{var T,C,$;let I=ts(e0(O));return I===m||I===p||((T=O.ethereumAddress)==null?void 0:T.toLowerCase())===x||((C=O.blockchainAccountId)==null||($=C.split("@eip155"))==null?void 0:$[0].toLowerCase())===x})},"checkSignatureAgainstSigner"),s=n.map(i).filter(a=>typeof a!="undefined");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(Xg,"verifyRecoverableES256K");function Bg(r,e,t){let n=Kg(r),i=Mr(e),s=t.find(a=>(0,vu.verify)(e0(a),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Bg,"verifyEd25519");var k7={ES256K:T7,"ES256K-R":Xg,Ed25519:Bg,EdDSA:Bg};function Zg(r){let e=k7[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(Zg,"VerifierAlgorithm");Zg.toSignatureObject=gu;var Qg=o(function(r,e,t={},n={}){try{t.alg||(t.alg=C7);let i=typeof r=="string"?r:Ug(r,n.canonicalize),s=[Ug(t,n.canonicalize),i].join("."),a=A7(t.alg);return Promise.resolve(a(s,e)).then(function(f){return[s,f].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var C7="ES256K";function Ug(r,e=!1){return Vh(e?(0,jg.default)(r):JSON.stringify(r))}o(Ug,"encodeSection");function D7(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(zg(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(D7,"decodeJWS");function I7({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),Zg(r.alg)(e,t,n)}o(I7,"verifyJWSDecoded");function ev(r,e){let t=D7(r);return I7(t,e)}o(ev,"verifyJWS");function O7(r,e,t){for(var n;;){var i=r();if(so(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(so(s))s=s.s;else{n=1;break}if(e){var a=e();if(a&&a.then&&!so(a)){n=2;break}}}var f=new rs,u=qt.bind(null,f,2);return(n===0?i.then(p):n===1?s.then(m):a.then(x)).then(void 0,u),f;function m(k){s=k;do{if(e&&(a=e(),a&&a.then&&!so(a))){a.then(x).then(void 0,u);return}if(i=r(),!i||so(i)&&!i.v){qt(f,1,s);return}if(i.then){i.then(p).then(void 0,u);return}s=t(),so(s)&&(s=s.v)}while(!s||!s.then);s.then(m).then(void 0,u)}o(m,"_resumeAfterBody");function p(k){k?(s=t(),s&&s.then?s.then(m).then(void 0,u):m(s)):qt(f,1,s)}o(p,"_resumeAfterTest");function x(){(i=r())?i.then?i.then(p).then(void 0,u):p(i):qt(f,1,s)}o(x,"_resumeAfterUpdate")}o(O7,"_for");var tv=o(function(r,e){try{let n=function(m){if(f===null)throw new Error("failure: Failed to decrypt");return f};o(n,"_temp5");let t;R7(r);let i=JSON.parse(zg(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=Vg(r.ciphertext,r.tag),a=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),f=null,u=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,Mr(r.iv),a)).then(function(m){f=m}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let m=0;return O7(function(){return!f&&m<r.recipients.length},function(){return m++},function(){let p=r.recipients[m];Object.assign(p.header,i);let x=function(){if(p.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Mr(r.iv),a,p)).then(function(k){f=k})}();if(x&&x.then)return x.then(function(){})})}}()}();return Promise.resolve(u&&u.then?u.then(n):n(u))}catch(t){return Promise.reject(t)}},"decryptJWE"),Fg=typeof Symbol!="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function qt(r,e,t){if(!r.s){if(t instanceof rs)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=qt.bind(null,r,e);return}if(t&&t.then){t.then(qt.bind(null,r,e),qt.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(qt,"_settle");var rs=function(){function r(){}return o(r,"_Pact"),r.prototype.then=function(e,t){let n=new r,i=this.s;if(i){let s=i&1?e:t;if(s){try{qt(n,1,s(this.v))}catch(a){qt(n,2,a)}return n}else return this}return this.o=function(s){try{let a=s.v;s.s&1?qt(n,1,e?e(a):a):t?qt(n,1,t(a)):qt(n,2,a)}catch(a){qt(n,2,a)}},n},r}();function so(r){return r instanceof rs&&r.s&1}o(so,"_isSettledPact");function P7(r,e,t){var n=-1,i,s;function a(f){try{for(;++n<r.length&&(!t||!t());)if(f=e(n),f&&f.then)if(so(f))f=f.v;else{f.then(a,s||(s=qt.bind(null,i=new rs,2)));return}i?qt(i,1,f):i=f}catch(u){qt(i||(i=new rs),2,u)}}return o(a,"_cycle"),a(),i}o(P7,"_forTo");function N7(r,e,t){if(typeof r[Fg]=="function"){let p=function(x){try{for(;!(i=n.next()).done&&(!t||!t());)if(x=e(i.value),x&&x.then)if(so(x))x=x.v;else{x.then(p,a||(a=qt.bind(null,s=new rs,2)));return}s?qt(s,1,x):s=x}catch(k){qt(s||(s=new rs),2,k)}};o(p,"_cycle");var n=r[Fg](),i,s,a;if(p(),n.return){var f=o(function(x){try{i.done||n.return()}catch(k){}return x},"_fixup");if(s&&s.then)return s.then(f,function(x){throw f(x)});f()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var u=[],m=0;m<r.length;m++)u.push(r[m]);return P7(u,function(p){return e(u[p])},t)}o(N7,"_forOf");function R7(r){if(!(r.protected&&r.iv&&r.ciphertext&&r.tag))throw new Error("bad_jwe: missing properties");r.recipients&&r.recipients.map(e=>{if(!(e.header&&e.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}o(R7,"validateJWE");function $g({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let a={protected:n,iv:sn(t),ciphertext:sn(r),tag:sn(e)};return s&&(a.aad=sn(s)),i&&(a.recipients=[i]),a}o($g,"encodeJWE");var rv=o(function(r,e,t={},n){try{if(e[0].alg==="dir"){if(e.length>1)throw new Error('not_supported: Can only do "dir" encryption to one key.');return Promise.resolve(e[0].encrypt(r,t,n)).then(function(i){return $g(i,n)})}else{let i=e[0].enc;if(!e.reduce((u,m)=>u&&m.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,a,f=N7(e,function(u){let m=function(){return s?Promise.resolve(u.encryptCek==null?void 0:u.encryptCek(s)).then(function(p){if(p){var x,k;(x=a)==null||(k=x.recipients)==null||k.push(p)}}):Promise.resolve(u.encrypt(r,t,n)).then(function(p){s=p.cek,a=$g(p,n)})}();if(m&&m.then)return m.then(function(){})});return Promise.resolve(f&&f.then?f.then(function(){return a}):a)}}catch(i){return Promise.reject(i)}},"createJWE");var nv=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:a}){var f;if(s!=null&&s.error||a==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!a.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let m=((f=a.keyAgreement)==null?void 0:f.map(p=>typeof p=="string"?[...a.publicKey||[],...a.verificationMethod||[]].find(x=>x.id===p):p).filter(p=>typeof p!="undefined")).filter(p=>p.type==="X25519KeyAgreementKey2019"&&Boolean(p.publicKeyBase58));if(!m.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return m.map(p=>B7(Zh(p.publicKeyBase58),p.id))})}catch(s){return Promise.reject(s)}},"encryptersForDID"),n=r.map(i=>t(i));return Promise.resolve(Promise.all(n)).then(function(i){return[].concat(...i)})}catch(t){return Promise.reject(t)}},"resolveX25519Encrypters");function iv(r){let e=new Jh.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Xh.randomBytes)(e.nonceLength),s=e.seal(i,t,n);return{ciphertext:s.subarray(0,s.length-e.tagLength),tag:s.subarray(s.length-e.tagLength),iv:i}}}o(iv,"xc20pEncrypter");function L7(r){let e=o(function(s,a={},f){try{let u=Vh(JSON.stringify(Object.assign({alg:i},a,{enc:n}))),m=new Uint8Array(Buffer.from(f?`${u}.${sn(f)}`:u));return Promise.resolve(Ae(ie({},t(s,m)),{protectedHeader:u}))}catch(u){return Promise.reject(u)}},"encrypt"),t=iv(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(L7,"xc20pDirEncrypter");function qg(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(a){return Promise.reject(a)}},"decrypt"),t=new Jh.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(qg,"xc20pDirDecrypter");function B7(r,e){let t=o(function(f,u={},m){try{Object.assign(u,{alg:void 0});let p=(0,Xh.randomBytes)(32);return Promise.resolve(L7(p).encrypt(f,u,m)).then(function(x){return Promise.resolve(n(p)).then(function(k){return Ae(ie({},x),{recipient:k,cek:p})})})}catch(p){return Promise.reject(p)}},"encrypt"),n=o(function(f){try{let u=(0,Af.generateKeyPair)(),m=(0,Af.sharedKey)(u.secretKey,r),p=Gg(m,s,i),x=iv(p)(f),k={encrypted_key:sn(x.ciphertext),header:{alg:i,iv:sn(x.iv),tag:sn(x.tag),epk:{kty:"OKP",crv:a,x:sn(u.publicKey)}}};return e&&(k.header.kid=e),Promise.resolve(k)}catch(u){return Promise.reject(u)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,a="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(B7,"x25519Encrypter");function U7(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(U7,"validateHeader");function ov(r){let e=o(function(s,a,f,u){try{let x=function(){let C=Gg(O,n,t),$=Vg(u.encrypted_key,u.header.tag);return Promise.resolve(qg(C).decrypt($,Mr(u.header.iv))).then(function(I){return I===null?null:qg(I).decrypt(s,a,f)})};o(x,"_temp4");var m,p;if(U7((m=u)==null?void 0:m.header),u=u,((p=u.header.epk)==null?void 0:p.crv)!==i||typeof u.header.epk.x=="undefined")return Promise.resolve(null);let k=Mr(u.header.epk.x),O,T=function(){if(r instanceof Uint8Array)O=(0,Af.sharedKey)(r,k);else return Promise.resolve(r(k)).then(function(C){O=C})}();return Promise.resolve(T&&T.then?T.then(x):x(T))}catch(x){return Promise.reject(x)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(ov,"x25519Decrypter");zd();var yu=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),t0=o(function*(r,e){if(r!=null&&!(r instanceof Uint8Array))for(let[t,n]of Object.entries(r)){let i=[...e,t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s],u=Pe.asCID(a);u?yield[f.join("/"),u]:typeof a=="object"&&(yield*t0(a,f))}else{let s=Pe.asCID(n);s?yield[i.join("/"),s]:yield*t0(n,i)}}},"links"),r0=o(function*(r,e){if(r!=null)for(let[t,n]of Object.entries(r)){let i=[...e,t];if(yield i.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!Pe.asCID(n))if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s];yield f.join("/"),typeof a=="object"&&!Pe.asCID(a)&&(yield*r0(a,f))}else yield*r0(n,i)}},"tree"),F7=o((r,e)=>{let t=r;for(let[n,i]of e.entries()){if(t=t[i],t==null)throw new Error(`Object has no property at ${e.slice(0,n+1).map(a=>`[${JSON.stringify(a)}]`).join("")}`);let s=Pe.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),xu=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n=="undefined")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:yu(),bytes:yu(),value:yu(),asBlock:yu()})}links(){return t0(this.value,[])}tree(){return r0(this.value,[])}get(e="/"){return F7(this.value,e.split("/").filter(Boolean))}};o(xu,"Block");var ns=o(n=>Z(void 0,[n],function*({value:r,codec:e,hasher:t}){if(typeof r=="undefined")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let i=e.encode(r),s=yield t.digest(i),a=Pe.create(1,e.code,s);return new xu({value:r,bytes:i,cid:a})}),"encode");Vn();cf();qd();Nd();var Ti={};St(Ti,{code:()=>ga,decode:()=>h0,encode:()=>Of,name:()=>wS});var $7=["string","number","bigint","symbol"],q7=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function sv(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if($7.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(H7(r))return"Buffer";let t=j7(r);return t||"Object"}o(sv,"is");function H7(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(H7,"isBuffer");function j7(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(q7.includes(e))return e}o(j7,"getObjectType");var de=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};o(de,"Type");de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);var _e=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};o(_e,"Token");var la=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",z7=new TextDecoder,K7=new TextEncoder;function wu(r){return la&&globalThis.Buffer.isBuffer(r)}o(wu,"isBuffer");function i0(r){return r instanceof Uint8Array?wu(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(i0,"asU8A");var uv=la?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):fv(r,e,t):(r,e,t)=>t-e>64?z7.decode(r.subarray(e,t)):fv(r,e,t),lv=la?r=>r.length>64?globalThis.Buffer.from(r):av(r):r=>r.length>64?K7.encode(r):av(r),ri=o(r=>Uint8Array.from(r),"fromArray"),da=la?(r,e,t)=>wu(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),dv=la?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),i0(globalThis.Buffer.concat(r,e))):(r,e)=>{let t=new Uint8Array(e),n=0;for(let i of r)n+i.length>t.length&&(i=i.subarray(0,t.length-n)),t.set(i,n),n+=i.length;return t},hv=la?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function pv(r,e){if(wu(r)&&wu(e))return r.compare(e);for(let t=0;t<r.length;t++)if(r[t]!==e[t])return r[t]<e[t]?-1:1;return 0}o(pv,"compare");function av(r,e=1/0){let t,n=r.length,i=null,s=[];for(let a=0;a<n;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}o(av,"utf8ToBytes");function fv(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,a=i>239?4:i>223?3:i>191?2:1;if(e+a<=t){let f,u,m,p;switch(a){case 1:i<128&&(s=i);break;case 2:f=r[e+1],(f&192)===128&&(p=(i&31)<<6|f&63,p>127&&(s=p));break;case 3:f=r[e+1],u=r[e+2],(f&192)===128&&(u&192)===128&&(p=(i&15)<<12|(f&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:f=r[e+1],u=r[e+2],m=r[e+3],(f&192)===128&&(u&192)===128&&(m&192)===128&&(p=(i&15)<<18|(f&63)<<12|(u&63)<<6|m&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=a}return V7(n)}o(fv,"utf8Slice");var cv=4096;function V7(r){let e=r.length;if(e<=cv)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=cv));return t}o(V7,"decodeCodePointsArray");var W7=256,ha=class{constructor(e=W7){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=t.length-(this.maxCursor-this.cursor)-1;t.set(e,i)}else{if(t){let i=t.length-(this.maxCursor-this.cursor)-1;i<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=hv(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=da(n,0,this.cursor)}else t=dv(this.chunks,this.cursor);return e&&this.reset(),t}};o(ha,"Bl");var Xe="CBOR decode error:",o0="CBOR encode error:",Tf=[];Tf[23]=1;Tf[24]=2;Tf[25]=3;Tf[26]=5;Tf[27]=9;function Ai(r,e,t){if(r.length-e<t)throw new Error(`${Xe} not enough data for type`)}o(Ai,"assertEnoughData");var Vt=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Pr(r,e,t){Ai(r,e,1);let n=r[e];if(t.strict===!0&&n<Vt[0])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Pr,"readUint8");function Nr(r,e,t){Ai(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Vt[1])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Nr,"readUint16");function Rr(r,e,t){Ai(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Vt[2])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Rr,"readUint32");function Lr(r,e,t){Ai(r,e,8);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3],i=r[e+4]*16777216+(r[e+5]<<16)+(r[e+6]<<8)+r[e+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(t.strict===!0&&s<Vt[3])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(t.allowBigInt===!0)return s;throw new Error(`${Xe} integers outside of the safe integer range are not supported`)}o(Lr,"readUint64");function mv(r,e,t,n){return new _e(de.uint,Pr(r,e+1,n),2)}o(mv,"decodeUint8");function bv(r,e,t,n){return new _e(de.uint,Nr(r,e+1,n),3)}o(bv,"decodeUint16");function gv(r,e,t,n){return new _e(de.uint,Rr(r,e+1,n),5)}o(gv,"decodeUint32");function vv(r,e,t,n){return new _e(de.uint,Lr(r,e+1,n),9)}o(vv,"decodeUint64");function an(r,e){return Qt(r,0,e.value)}o(an,"encodeUint");function Qt(r,e,t){if(t<Vt[0]){let n=Number(t);r.push([e|n])}else if(t<Vt[1]){let n=Number(t);r.push([e|24,n])}else if(t<Vt[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Vt[3]){let n=Number(t);r.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(t);if(n<Vt[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=a&255,a=a>>8,i[3]=a&255,a=a>>8,i[2]=a&255,a=a>>8,i[1]=a&255,r.push(i)}else throw new Error(`${Xe} encountered BigInt larger than allowable range`)}}o(Qt,"encodeUintValue");an.encodedSize=o(function(e){return Qt.encodedSize(e.value)},"encodedSize");Qt.encodedSize=o(function(e){return e<Vt[0]?1:e<Vt[1]?2:e<Vt[2]?3:e<Vt[3]?5:9},"encodedSize");an.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function yv(r,e,t,n){return new _e(de.negint,-1-Pr(r,e+1,n),2)}o(yv,"decodeNegint8");function xv(r,e,t,n){return new _e(de.negint,-1-Nr(r,e+1,n),3)}o(xv,"decodeNegint16");function wv(r,e,t,n){return new _e(de.negint,-1-Rr(r,e+1,n),5)}o(wv,"decodeNegint32");var s0=BigInt(-1),_v=BigInt(1);function Ev(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new _e(de.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Xe} integers outside of the safe integer range are not supported`);return new _e(de.negint,s0-BigInt(i),9)}o(Ev,"decodeNegint64");function _u(r,e){let t=e.value,n=typeof t=="bigint"?t*s0-_v:t*-1-1;Qt(r,e.type.majorEncoded,n)}o(_u,"encodeNegint");_u.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*s0-_v:t*-1-1;return n<Vt[0]?1:n<Vt[1]?2:n<Vt[2]?3:n<Vt[3]?5:9},"encodedSize");_u.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function kf(r,e,t,n){Ai(r,e,t+n);let i=da(r,e+t,e+t+n);return new _e(de.bytes,i,t+n)}o(kf,"toToken");function Sv(r,e,t,n){return kf(r,e,1,t)}o(Sv,"decodeBytesCompact");function Mv(r,e,t,n){return kf(r,e,2,Pr(r,e+1,n))}o(Mv,"decodeBytes8");function Av(r,e,t,n){return kf(r,e,3,Nr(r,e+1,n))}o(Av,"decodeBytes16");function Tv(r,e,t,n){return kf(r,e,5,Rr(r,e+1,n))}o(Tv,"decodeBytes32");function kv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer bytes lengths not supported`);return kf(r,e,9,i)}o(kv,"decodeBytes64");function Eu(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===de.string?lv(r.value):r.value),r.encodedBytes}o(Eu,"tokenBytes");function pa(r,e){let t=Eu(e);Qt(r,e.type.majorEncoded,t.length),r.push(t)}o(pa,"encodeBytes");pa.encodedSize=o(function(e){let t=Eu(e);return Qt.encodedSize(t.length)+t.length},"encodedSize");pa.compareTokens=o(function(e,t){return Y7(Eu(e),Eu(t))},"compareTokens");function Y7(r,e){return r.length<e.length?-1:r.length>e.length?1:pv(r,e)}o(Y7,"compareBytes");function Cf(r,e,t,n,i){let s=t+n;Ai(r,e,s);let a=new _e(de.string,uv(r,e+t,e+s),s);return i.retainStringBytes===!0&&(a.byteValue=da(r,e+t,e+s)),a}o(Cf,"toToken");function Cv(r,e,t,n){return Cf(r,e,1,t,n)}o(Cv,"decodeStringCompact");function Dv(r,e,t,n){return Cf(r,e,2,Pr(r,e+1,n),n)}o(Dv,"decodeString8");function Iv(r,e,t,n){return Cf(r,e,3,Nr(r,e+1,n),n)}o(Iv,"decodeString16");function Ov(r,e,t,n){return Cf(r,e,5,Rr(r,e+1,n),n)}o(Ov,"decodeString32");function Pv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer string lengths not supported`);return Cf(r,e,9,i,n)}o(Pv,"decodeString64");var Nv=pa;function ma(r,e,t,n){return new _e(de.array,n,t)}o(ma,"toToken");function Rv(r,e,t,n){return ma(r,e,1,t)}o(Rv,"decodeArrayCompact");function Lv(r,e,t,n){return ma(r,e,2,Pr(r,e+1,n))}o(Lv,"decodeArray8");function Bv(r,e,t,n){return ma(r,e,3,Nr(r,e+1,n))}o(Bv,"decodeArray16");function Uv(r,e,t,n){return ma(r,e,5,Rr(r,e+1,n))}o(Uv,"decodeArray32");function Fv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer array lengths not supported`);return ma(r,e,9,i)}o(Fv,"decodeArray64");function $v(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return ma(r,e,1,1/0)}o($v,"decodeArrayIndefinite");function Su(r,e){Qt(r,de.array.majorEncoded,e.value)}o(Su,"encodeArray");Su.compareTokens=an.compareTokens;Su.encodedSize=o(function(e){return Qt.encodedSize(e.value)},"encodedSize");function ba(r,e,t,n){return new _e(de.map,n,t)}o(ba,"toToken");function qv(r,e,t,n){return ba(r,e,1,t)}o(qv,"decodeMapCompact");function Hv(r,e,t,n){return ba(r,e,2,Pr(r,e+1,n))}o(Hv,"decodeMap8");function jv(r,e,t,n){return ba(r,e,3,Nr(r,e+1,n))}o(jv,"decodeMap16");function zv(r,e,t,n){return ba(r,e,5,Rr(r,e+1,n))}o(zv,"decodeMap32");function Kv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer map lengths not supported`);return ba(r,e,9,i)}o(Kv,"decodeMap64");function Vv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return ba(r,e,1,1/0)}o(Vv,"decodeMapIndefinite");function Mu(r,e){Qt(r,de.map.majorEncoded,e.value)}o(Mu,"encodeMap");Mu.compareTokens=an.compareTokens;Mu.encodedSize=o(function(e){return Qt.encodedSize(e.value)},"encodedSize");function Wv(r,e,t,n){return new _e(de.tag,t,1)}o(Wv,"decodeTagCompact");function Gv(r,e,t,n){return new _e(de.tag,Pr(r,e+1,n),2)}o(Gv,"decodeTag8");function Yv(r,e,t,n){return new _e(de.tag,Nr(r,e+1,n),3)}o(Yv,"decodeTag16");function Jv(r,e,t,n){return new _e(de.tag,Rr(r,e+1,n),5)}o(Jv,"decodeTag32");function Xv(r,e,t,n){return new _e(de.tag,Lr(r,e+1,n),9)}o(Xv,"decodeTag64");function Au(r,e){Qt(r,de.tag.majorEncoded,e.value)}o(Au,"encodeTag");Au.compareTokens=an.compareTokens;Au.encodedSize=o(function(e){return Qt.encodedSize(e.value)},"encodedSize");var tS=20,rS=21,nS=22,iS=23;function Zv(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${Xe} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new _e(de.null,null,1):new _e(de.undefined,void 0,1)}o(Zv,"decodeUndefined");function Qv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return new _e(de.break,void 0,1)}o(Qv,"decodeBreak");function a0(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${Xe} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${Xe} Infinity values are not supported`)}return new _e(de.float,r,e)}o(a0,"createToken");function e2(r,e,t,n){return a0(f0(r,e+1),3,n)}o(e2,"decodeFloat16");function t2(r,e,t,n){return a0(c0(r,e+1),5,n)}o(t2,"decodeFloat32");function r2(r,e,t,n){return a0(s2(r,e+1),9,n)}o(r2,"decodeFloat64");function Tu(r,e,t){let n=e.value;if(n===!1)r.push([de.float.majorEncoded|tS]);else if(n===!0)r.push([de.float.majorEncoded|rS]);else if(n===null)r.push([de.float.majorEncoded|nS]);else if(n===void 0)r.push([de.float.majorEncoded|iS]);else{let i,s=!1;(!t||t.float64!==!0)&&(i2(n),i=f0(Mn,1),n===i||Number.isNaN(n)?(Mn[0]=249,r.push(Mn.slice(0,3)),s=!0):(o2(n),i=c0(Mn,1),n===i&&(Mn[0]=250,r.push(Mn.slice(0,5)),s=!0))),s||(oS(n),i=s2(Mn,1),Mn[0]=251,r.push(Mn.slice(0,9)))}}o(Tu,"encodeFloat");Tu.encodedSize=o(function(e,t){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!t||t.float64!==!0){i2(n);let i=f0(Mn,1);if(n===i||Number.isNaN(n))return 3;if(o2(n),i=c0(Mn,1),n===i)return 5}return 9},"encodedSize");var n2=new ArrayBuffer(9),fn=new DataView(n2,1),Mn=new Uint8Array(n2,0);function i2(r){if(r===1/0)fn.setUint16(0,31744,!1);else if(r===-1/0)fn.setUint16(0,64512,!1);else if(Number.isNaN(r))fn.setUint16(0,32256,!1);else{fn.setFloat32(0,r);let e=fn.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)fn.setUint16(0,31744,!1);else if(t===0)fn.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?fn.setUint16(0,0):i<-14?fn.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):fn.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(i2,"encodeFloat16");function f0(r,e){if(r.length-e<2)throw new Error(`${Xe} not enough data for float16`);let t=(r[e]<<8)+r[e+1];if(t===31744)return 1/0;if(t===64512)return-1/0;if(t===32256)return NaN;let n=t>>10&31,i=t&1023,s;return n===0?s=i*bd(2,-24):n!==31?s=(i+1024)*bd(2,n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(f0,"readFloat16");function o2(r){fn.setFloat32(0,r,!1)}o(o2,"encodeFloat32");function c0(r,e){if(r.length-e<4)throw new Error(`${Xe} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(c0,"readFloat32");function oS(r){fn.setFloat64(0,r,!1)}o(oS,"encodeFloat64");function s2(r,e){if(r.length-e<8)throw new Error(`${Xe} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(s2,"readFloat64");Tu.compareTokens=an.compareTokens;function ct(r,e,t){throw new Error(`${Xe} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(ct,"invalidMinor");function ku(r){return()=>{throw new Error(`${Xe} ${r}`)}}o(ku,"errorer");var ye=[];for(let r=0;r<=23;r++)ye[r]=ct;ye[24]=mv;ye[25]=bv;ye[26]=gv;ye[27]=vv;ye[28]=ct;ye[29]=ct;ye[30]=ct;ye[31]=ct;for(let r=32;r<=55;r++)ye[r]=ct;ye[56]=yv;ye[57]=xv;ye[58]=wv;ye[59]=Ev;ye[60]=ct;ye[61]=ct;ye[62]=ct;ye[63]=ct;for(let r=64;r<=87;r++)ye[r]=Sv;ye[88]=Mv;ye[89]=Av;ye[90]=Tv;ye[91]=kv;ye[92]=ct;ye[93]=ct;ye[94]=ct;ye[95]=ku("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)ye[r]=Cv;ye[120]=Dv;ye[121]=Iv;ye[122]=Ov;ye[123]=Pv;ye[124]=ct;ye[125]=ct;ye[126]=ct;ye[127]=ku("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)ye[r]=Rv;ye[152]=Lv;ye[153]=Bv;ye[154]=Uv;ye[155]=Fv;ye[156]=ct;ye[157]=ct;ye[158]=ct;ye[159]=$v;for(let r=160;r<=183;r++)ye[r]=qv;ye[184]=Hv;ye[185]=jv;ye[186]=zv;ye[187]=Kv;ye[188]=ct;ye[189]=ct;ye[190]=ct;ye[191]=Vv;for(let r=192;r<=215;r++)ye[r]=Wv;ye[216]=Gv;ye[217]=Yv;ye[218]=Jv;ye[219]=Xv;ye[220]=ct;ye[221]=ct;ye[222]=ct;ye[223]=ct;for(let r=224;r<=243;r++)ye[r]=ku("simple values are not supported");ye[244]=ct;ye[245]=ct;ye[246]=ct;ye[247]=Zv;ye[248]=ku("simple values are not supported");ye[249]=e2;ye[250]=t2;ye[251]=r2;ye[252]=ct;ye[253]=ct;ye[254]=ct;ye[255]=Qv;var An=[];for(let r=0;r<24;r++)An[r]=new _e(de.uint,r,1);for(let r=-1;r>=-24;r--)An[31-r]=new _e(de.negint,r,1);An[64]=new _e(de.bytes,new Uint8Array(0),1);An[96]=new _e(de.string,"",1);An[128]=new _e(de.array,0,1);An[160]=new _e(de.map,0,1);An[244]=new _e(de.false,!1,1);An[245]=new _e(de.true,!0,1);An[246]=new _e(de.null,null,1);function a2(r){switch(r.type){case de.false:return ri([244]);case de.true:return ri([245]);case de.null:return ri([246]);case de.bytes:return r.value.length?void 0:ri([64]);case de.string:return r.value===""?ri([96]):void 0;case de.array:return r.value===0?ri([128]):void 0;case de.map:return r.value===0?ri([160]):void 0;case de.uint:return r.value<24?ri([Number(r.value)]):void 0;case de.negint:if(r.value>=-24)return ri([31-Number(r.value)])}}o(a2,"quickEncodeToken");var aS={float64:!1,mapSorter:uS,quickEncodeToken:a2};function fS(){let r=[];return r[de.uint.major]=an,r[de.negint.major]=_u,r[de.bytes.major]=pa,r[de.string.major]=Nv,r[de.array.major]=Su,r[de.map.major]=Mu,r[de.tag.major]=Au,r[de.float.major]=Tu,r}o(fS,"makeCborEncoders");var f2=fS(),u0=new ha,os=class{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error(`${o0} object contains circular references`);return new os(t,e)}};o(os,"Ref");var ao={null:new _e(de.null,null),undefined:new _e(de.undefined,void 0),true:new _e(de.true,!0),false:new _e(de.false,!1),emptyArray:new _e(de.array,0),emptyMap:new _e(de.map,0)},fo={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new _e(de.float,r):r>=0?new _e(de.uint,r):new _e(de.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new _e(de.uint,r):new _e(de.negint,r)},Uint8Array(r,e,t,n){return new _e(de.bytes,r)},string(r,e,t,n){return new _e(de.string,r)},boolean(r,e,t,n){return r?ao.true:ao.false},null(r,e,t,n){return ao.null},undefined(r,e,t,n){return ao.undefined},ArrayBuffer(r,e,t,n){return new _e(de.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new _e(de.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[ao.emptyArray,new _e(de.break)]:ao.emptyArray;n=os.createCheck(n,r);let i=[],s=0;for(let a of r)i[s++]=Cu(a,t,n);return t.addBreakTokens?[new _e(de.array,r.length),i,new _e(de.break)]:[new _e(de.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),a=i?r.size:s.length;if(!a)return t.addBreakTokens===!0?[ao.emptyMap,new _e(de.break)]:ao.emptyMap;n=os.createCheck(n,r);let f=[],u=0;for(let m of s)f[u++]=[Cu(m,t,n),Cu(i?r.get(m):r[m],t,n)];return cS(f,t),t.addBreakTokens?[new _e(de.map,a),f,new _e(de.break)]:[new _e(de.map,a),f]}};fo.Map=fo.Object;fo.Buffer=fo.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))fo[`${r}Array`]=fo.DataView;function Cu(r,e={},t){let n=sv(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||fo[n];if(typeof i=="function"){let a=i(r,n,e,t);if(a!=null)return a}let s=fo[n];if(!s)throw new Error(`${o0} unsupported type: ${n}`);return s(r,n,e,t)}o(Cu,"objectToTokens");function cS(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(cS,"sortMapEntries");function uS(r,e){let t=Array.isArray(r[0])?r[0][0]:r[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(t.type!==n.type)return t.type.compare(n.type);let i=t.type.major,s=f2[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(uS,"mapSorter");function c2(r,e,t,n){if(Array.isArray(e))for(let i of e)c2(r,i,t,n);else t[e.type.major](r,e,n)}o(c2,"tokensToEncoded");function lS(r,e,t){let n=Cu(r,t);if(!Array.isArray(n)&&t.quickEncodeToken){let i=t.quickEncodeToken(n);if(i)return i;let s=e[n.type.major];if(s.encodedSize){let a=s.encodedSize(n,t),f=new ha(a);if(s(f,n,t),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return i0(f.chunks[0])}}return u0.reset(),c2(u0,n,e,t),u0.toBytes(!0)}o(lS,"encodeCustom");function l0(r,e){return e=Object.assign({},aS,e),lS(r,f2,e)}o(l0,"encode");var dS={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Du=class{constructor(e,t={}){this.pos=0,this.data=e,this.options=t}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],t=An[e];if(t===void 0){let n=ye[e];if(!n)throw new Error(`${Xe} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;t=n(this.data,this.pos,i,this.options)}return this.pos+=t.encodedLength,t}};o(Du,"Tokeniser");var Df=Symbol.for("DONE"),Iu=Symbol.for("BREAK");function hS(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=If(e,t);if(s===Iu){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed array`)}if(s===Df)throw new Error(`${Xe} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(hS,"tokenToArray");function pS(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let a=0;a<r.value;a++){let f=If(e,t);if(f===Iu){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed map`)}if(f===Df)throw new Error(`${Xe} found map but not enough entries (got ${a} [no key], expected ${r.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${Xe} non-string keys not supported (got ${typeof f})`);let u=If(e,t);if(u===Df)throw new Error(`${Xe} found map but not enough entries (got ${a} [no value], expected ${r.value})`);n?s.set(f,u):i[f]=u}return n?s:i}o(pS,"tokenToMap");function If(r,e){if(r.done())return Df;let t=r.next();if(t.type===de.break)return Iu;if(t.type.terminal)return t.value;if(t.type===de.array)return hS(t,r,e);if(t.type===de.map)return pS(t,r,e);if(t.type===de.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=If(r,e);return e.tags[t.value](n)}throw new Error(`${Xe} tag not supported (${t.value})`)}throw new Error("unsupported")}o(If,"tokensToObject");function d0(r,e){if(!(r instanceof Uint8Array))throw new Error(`${Xe} data to decode must be a Uint8Array`);e=Object.assign({},dS,e);let t=e.tokenizer||new Du(r,e),n=If(t,e);if(n===Df)throw new Error(`${Xe} did not find any content to decode`);if(n===Iu)throw new Error(`${Xe} got unexpected break`);if(!t.done())throw new Error(`${Xe} too many terminals, data makes no sense`);return n}o(d0,"decode");Vn();var u2=42;function bS(r){if(r.asCID!==r)return null;let e=Pe.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new _e(de.tag,u2),new _e(de.bytes,t)]}o(bS,"cidEncoder");function gS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(gS,"undefinedEncoder");function vS(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}o(vS,"numberEncoder");var yS={float64:!0,typeEncoders:{Object:bS,undefined:gS,number:vS}};function xS(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Pe.decode(r.subarray(1))}o(xS,"cidDecoder");var l2={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};l2.tags[u2]=xS;var wS="dag-cbor",ga=113,Of=o(r=>l0(r,yS),"encode"),h0=o(r=>d0(r,l2),"decode");var _S=24;function d2(r){return Z(this,null,function*(){let e=yield ns({value:r,codec:Ti,hasher:zo});return{cid:e.cid,linkedBlock:e.bytes}})}o(d2,"encodePayload");function ES(r,e=_S){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(ES,"pad");function SS(r){return Z(this,null,function*(){return(yield ns({value:r,codec:Ti,hasher:Uc})).cid})}o(SS,"encodeIdentityCID");function MS(r){if(r=Pe.asCID(r),r.code!==ga)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==Uc.code)throw new Error("CID must use identity multihash");return h0(r.multihash.digest)}o(MS,"decodeIdentityCID");function h2(r,e){return Z(this,null,function*(){return ES((yield SS(r)).bytes,e)})}o(h2,"prepareCleartext");function p2(r){return MS(Pe.decodeFirst(r)[0])}o(p2,"decodeCleartext");var m2=Symbol("abortable"),Ou=Symbol("aborted");function b2(r,e){if(e.aborted)return Promise.reject(Ou);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Ou)}),Promise.race([r,n])}o(b2,"abortable");var g2=o((r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""),"nanoid");var Pu="utils_abort_request";var vr;(function(r){r[r.PARSE_ERROR=-32700]="PARSE_ERROR",r[r.INVALID_REQUEST=-32600]="INVALID_REQUEST",r[r.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",r[r.INVALID_PARAMS=-32602]="INVALID_PARAMS",r[r.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(vr||(vr={}));var v2={[vr.PARSE_ERROR]:"Parse error",[vr.INVALID_REQUEST]:"Invalid request",[vr.METHOD_NOT_FOUND]:"Method not found",[vr.INVALID_PARAMS]:"Invalid params",[vr.INTERNAL_ERROR]:"Internal error"};function AS(r){return-32e3>=r&&r>=-32099}o(AS,"isServerError");function Nu(r){var e;return(e=v2[r.toString()])!=null?e:AS(r)?"Server error":"Application error"}o(Nu,"getErrorMessage");var Ar=class extends Error{static fromObject(e){return new Ar(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,t,n){super(),Object.setPrototypeOf(this,Ar.prototype),this.code=e,this.data=n,this.message=t!=null?t:Nu(e)}};o(Ar,"RPCError");function Pf(r){let e=v2[r];return o(function(n){return new Ar(r,e,n)},"createError")}o(Pf,"createErrorFactory");var TS=Pf(vr.PARSE_ERROR),cL=Pf(vr.INVALID_REQUEST),uL=Pf(vr.METHOD_NOT_FOUND),lL=Pf(vr.INVALID_PARAMS),dL=Pf(vr.INTERNAL_ERROR);function kS(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(kS,"_checkPrivateRedeclaration");function CS(r,e){return e.get?e.get.call(r):e.value}o(CS,"_classApplyDescriptorGet");function DS(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(DS,"_classApplyDescriptorSet");function y2(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(y2,"_classExtractFieldDescriptor");function p0(r,e){var t=y2(r,e,"get");return CS(r,t)}o(p0,"_classPrivateFieldGet");function IS(r,e,t){kS(r,e),e.set(r,t)}o(IS,"_classPrivateFieldInit");function OS(r,e,t){var n=y2(r,e,"set");return DS(r,n,t),t}o(OS,"_classPrivateFieldSet");var Nf=new WeakMap,va=class{get connection(){return p0(this,Nf)}createID(){return g2()}request(e,t=void 0,n={}){let{signal:i}=n;if(i!=null&&i.aborted)return Promise.reject(Ou);let s=this.createID(),a=p0(this,Nf).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(f=>{if(f==null)throw new Error("Missing response");if(f.error!=null)throw Ar.fromObject(f.error);return f.result});return i==null?a:(i.addEventListener("abort",()=>{this.notify(Pu,{id:s})}),b2(a,i))}notify(e,t=void 0){return Z(this,null,function*(){yield p0(this,Nf).send({jsonrpc:"2.0",method:e,params:t})})}constructor(e){IS(this,Nf,{writable:!0,value:void 0}),OS(this,Nf,e)}};o(va,"RPCClient");function x2(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:Nu(e)}}}o(x2,"createErrorResponse");function PS(r,e,t){console.warn("Unhandled handler error",e,t)}o(PS,"fallbackOnHandlerError");function NS(r,e){console.warn("Unhandled invalid message",e)}o(NS,"fallbackOnInvalidMessage");function RS(r,e){console.warn("Unhandled notification",e)}o(RS,"fallbackOnNotification");function w2(r,e={}){var f,u,m;let t=(f=e.onHandlerError)!=null?f:PS,n=(u=e.onInvalidMessage)!=null?u:NS,i=(m=e.onNotification)!=null?m:RS,s={};function a(p,x){var k,O;if(x.method===Pu){let T=(k=x.params)==null?void 0:k.id;T!=null&&((O=s[T])==null||O.abort())}else i(p,x)}return o(a,"handleNotification"),o(function(x,k){return Z(this,null,function*(){var C,$,I;let O=k.id;if(k.jsonrpc!=="2.0"||k.method==null)return O==null?(n(x,k),null):x2(O,vr.INVALID_REQUEST);let T=r[k.method];if(T==null)return O==null?(a(x,k),null):x2(O,vr.METHOD_NOT_FOUND);try{let U;if(O!=null&&T[m2]){let H=new AbortController;s[O]=H,U=T(x,k.params,{signal:H.signal})}else U=T(x,k.params,{});let z=U==null?U:typeof U.then=="function"?yield U:U;return O==null||((C=s[O])==null?void 0:C.signal.aborted)?null:{jsonrpc:"2.0",id:O,result:z}}catch(U){if(O==null||(($=s[O])==null?void 0:$.signal.aborted))return t(x,k,U),null;let z;if(U instanceof Ar)z=U.toObject();else{t(x,k,U);let H=(I=U.code)!=null?I:-32e3;z={code:H,message:U.message||Nu(H)}}return{jsonrpc:"2.0",id:O,error:z}}finally{O!=null&&delete s[O]}})},"handleRequest")}o(w2,"createHandler");Vn();var Xy=at(dy(),1),lr=at(fs(),1);function E0(){return E0=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},E0.apply(this,arguments)}o(E0,"_extends");var S0={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},eM={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},M0={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},tM={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:S0,1:M0}}},rM={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:S0,1:M0,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},Ff={2:S0,10:eM,19:{assetName:M0,assetType:tM,assetId:rM}};function hy(r,e){return r.split(e.parameters.delimiter)}o(hy,"splitParams");function $f(r,e){var t=hy(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o($f,"getParams");function Ea(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Ea(n,t)}).join(e.parameters.delimiter)}o(Ea,"joinParams");function qf(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=hy(r,e);if(t.length!==Object.keys(e.parameters.values).length)return!1;var n=t.map(function(i,s){return new RegExp(e.parameters.values[s].regex).test(i)}).filter(function(i){return!!i});return n.length===t.length}o(qf,"isValidId");var ho=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"ChainId"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();ho.spec=Ff[2];var cs=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=$f(n,this.spec),s=i.namespace,a=i.reference,f=i.address,u=new ho({namespace:s,reference:a});return new r({chainId:u,address:f}).toJSON()},"parse"),r.format=o(function(n){var i=new ho(n.chainId),s=E0({},i.toJSON(),{address:n.address});return Ea(s,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),r}();cs.spec=Ff[10];var A0=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"AssetName"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();A0.spec=Ff[19].assetName;var nM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new A0(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),r}();nM.spec=Ff[19].assetType;var iM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new A0(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),r}();iM.spec=Ff[19].assetId;var py="logger/5.6.0";var my=!1,by=!1,$u={debug:1,default:2,info:2,warning:3,error:4,off:5},gy=$u.default,T0=null;function oM(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch(t){r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}o(oM,"_checkNormalize");var vy=oM(),k0;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(k0||(k0={}));var kn;(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"})(kn||(kn={}));var yy="0123456789abcdef",tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();$u[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(gy>$u[n])&&console.log.apply(console,t)}debug(...e){this._log(tt.levels.DEBUG,e)}info(...e){this._log(tt.levels.INFO,e)}warn(...e){this._log(tt.levels.WARNING,e)}makeError(e,t,n){if(by)return this.makeError("censored error",t,{});t||(t=tt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(u=>{let m=n[u];try{if(m instanceof Uint8Array){let p="";for(let x=0;x<m.length;x++)p+=yy[m[x]>>4],p+=yy[m[x]&15];i.push(u+"=Uint8Array(0x"+p+")")}else i.push(u+"="+JSON.stringify(m))}catch(p){i.push(u+"="+JSON.stringify(n[u].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let s=e,a="";switch(t){case kn.NUMERIC_FAULT:{a="NUMERIC_FAULT";let u=e;switch(u){case"overflow":case"underflow":case"division-by-zero":a+="-"+u;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case kn.CALL_EXCEPTION:case kn.INSUFFICIENT_FUNDS:case kn.MISSING_NEW:case kn.NONCE_EXPIRED:case kn.REPLACEMENT_UNDERPRICED:case kn.TRANSACTION_REPLACED:case kn.UNPREDICTABLE_GAS_LIMIT:a=t;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let f=new Error(e);return f.reason=s,f.code=t,Object.keys(n).forEach(function(u){f[u]=n[u]}),f}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,tt.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,i){e||this.throwError(t,n,i)}assertArgument(e,t,n,i){e||this.throwArgumentError(t,n,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),vy&&this.throwError("platform missing String.prototype.normalize",tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:vy})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n?n=": "+n:n="",e<t&&this.throwError("missing argument"+n,tt.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,tt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",tt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return T0||(T0=new tt(py)),T0}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),my){if(!e)return;this.globalLogger().throwError("error censorship permanent",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}by=!!e,my=!!t}static setLogLevel(e){let t=$u[e.toLowerCase()];if(t==null){tt.globalLogger().warn("invalid log level - "+e);return}gy=t}static from(e){return new tt(e)}};o(tt,"Logger");tt.errors=kn;tt.levels=k0;var xy="bytes/5.6.1";var Lt=new tt(xy);function _y(r){return!!r.toHexString}o(_y,"isHexable");function Sa(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Sa(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Sa,"addSlice");function Ey(r){return Cn(r)&&!(r.length%2)||D0(r)}o(Ey,"isBytesLike");function wy(r){return typeof r=="number"&&r==r&&r%1===0}o(wy,"isInteger");function D0(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!wy(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!wy(t)||t<0||t>=256)return!1}return!0}o(D0,"isBytes");function Tt(r,e){if(e||(e={}),typeof r=="number"){Lt.checkSafeUint53(r,"invalid arrayify value");let t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),Sa(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),_y(r)&&(r=r.toHexString()),Cn(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":Lt.throwArgumentError("hex data is odd-length","value",r));let n=[];for(let i=0;i<t.length;i+=2)n.push(parseInt(t.substring(i,i+2),16));return Sa(new Uint8Array(n))}return D0(r)?Sa(new Uint8Array(r)):Lt.throwArgumentError("invalid arrayify value","value",r)}o(Tt,"arrayify");function I0(r){let e=r.map(i=>Tt(i)),t=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(t);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Sa(n)}o(I0,"concat");function sM(r,e){r=Tt(r),r.length>e&&Lt.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Sa(t)}o(sM,"zeroPad");function Cn(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Cn,"isHexString");var C0="0123456789abcdef";function cr(r,e){if(e||(e={}),typeof r=="number"){Lt.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=C0[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"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),_y(r))return r.toHexString();if(Cn(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":Lt.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(D0(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=C0[(i&240)>>4]+C0[i&15]}return t}return Lt.throwArgumentError("invalid hexlify value","value",r)}o(cr,"hexlify");function qu(r){if(typeof r!="string")r=cr(r);else if(!Cn(r)||r.length%2)return null;return(r.length-2)/2}o(qu,"hexDataLength");function Hu(r,e,t){return typeof r!="string"?r=cr(r):(!Cn(r)||r.length%2)&&Lt.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(Hu,"hexDataSlice");function po(r,e){for(typeof r!="string"?r=cr(r):Cn(r)||Lt.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&Lt.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(po,"hexZeroPad");function ju(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ey(r)){let t=Tt(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=cr(t.slice(0,32)),e.s=cr(t.slice(32,64))):t.length===65?(e.r=cr(t.slice(0,32)),e.s=cr(t.slice(32,64)),e.v=t[64]):Lt.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:Lt.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=cr(t.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){let i=sM(Tt(e._vs),32);e._vs=cr(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Lt.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let a=cr(i);e.s==null?e.s=a:e.s!==a&&Lt.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?Lt.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Lt.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Cn(e.r)?Lt.throwArgumentError("signature missing or invalid r","signature",r):e.r=po(e.r,32),e.s==null||!Cn(e.s)?Lt.throwArgumentError("signature missing or invalid s","signature",r):e.s=po(e.s,32);let t=Tt(e.s);t[0]>=128&&Lt.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=cr(t);e._vs&&(Cn(e._vs)||Lt.throwArgumentError("signature invalid _vs","signature",r),e._vs=po(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Lt.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(ju,"splitSignature");var Ay=at(P0());var My="bignumber/5.6.2";var aM=Ay.default.BN,iB=new tt(My);function N0(r){return new aM(r,36).toString(16)}o(N0,"_base36To16");var Ty=at(Qd());function Ma(r){return"0x"+Ty.default.keccak_256(Tt(r))}o(Ma,"keccak256");var ky="address/5.6.1";var Hf=new tt(ky);function Cy(r){Cn(r,20)||Hf.throwArgumentError("invalid address","address",r),r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);let n=Tt(Ma(t));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}o(Cy,"getChecksumAddress");var uM=9007199254740991;function lM(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(lM,"log10");var R0={};for(let r=0;r<10;r++)R0[String(r)]=String(r);for(let r=0;r<26;r++)R0[String.fromCharCode(65+r)]=String(10+r);var Dy=Math.floor(lM(uM));function dM(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>R0[n]).join("");for(;e.length>=Dy;){let n=e.substring(0,Dy);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}o(dM,"ibanChecksum");function Iy(r){let e=null;if(typeof r!="string"&&Hf.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=Cy(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&Hf.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)!==dM(r)&&Hf.throwArgumentError("bad icap checksum","address",r),e=N0(r.substring(4));e.length<40;)e="0"+e;e=Cy("0x"+e)}else Hf.throwArgumentError("invalid address","address",r);return e}o(Iy,"getAddress");var Oy="properties/5.6.0";var wB=new tt(Oy);function Aa(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Aa,"defineReadOnly");var Py="strings/5.6.1";var Ny=new tt(Py),jf;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(jf||(jf={}));var us;(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"})(us||(us={}));function hM(r,e,t,n,i){return Ny.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(hM,"errorFunc");function Ry(r,e,t,n,i){if(r===us.BAD_PREFIX||r===us.UNEXPECTED_CONTINUE){let s=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)s++;return s}return r===us.OVERRUN?t.length-e-1:0}o(Ry,"ignoreFunc");function pM(r,e,t,n,i){return r===us.OVERLONG?(n.push(i),0):(n.push(65533),Ry(r,e,t,n,i))}o(pM,"replaceFunc");var mM=Object.freeze({error:hM,ignore:Ry,replace:pM});function zf(r,e=jf.current){e!=jf.current&&(Ny.checkNormalize(),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){n++;let s=r.charCodeAt(n);if(n>=r.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");let a=65536+((i&1023)<<10)+(s&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return Tt(t)}o(zf,"toUtf8Bytes");var Ly=`Ethereum Signed Message:
633
- `;function L0(r){return typeof r=="string"&&(r=zf(r)),Ma(I0([zf(Ly),zf(String(r.length)),r]))}o(L0,"hashMessage");var Qe=at(P0()),oi=at(gf());function Ta(r,e,t){return t={path:e,exports:{},require:function(n,i){return bM(n,i==null?t.path:i)}},r(t,t.exports),t.exports}o(Ta,"createCommonjsModule");function bM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(bM,"commonjsRequire");var $0=Uy;function Uy(r,e){if(!r)throw new Error(e||"Assertion failed")}o(Uy,"assert");Uy.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Dn=Ta(function(r,e){"use strict";var t=e;function n(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var u=[];if(typeof a!="string"){for(var m=0;m<a.length;m++)u[m]=a[m]|0;return u}if(f==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var m=0;m<a.length;m+=2)u.push(parseInt(a[m]+a[m+1],16))}else for(var m=0;m<a.length;m++){var p=a.charCodeAt(m),x=p>>8,k=p&255;x?u.push(x,k):u.push(k)}return u}o(n,"toArray"),t.toArray=n;function i(a){return a.length===1?"0"+a:a}o(i,"zero2"),t.zero2=i;function s(a){for(var f="",u=0;u<a.length;u++)f+=i(a[u].toString(16));return f}o(s,"toHex"),t.toHex=s,t.encode=o(function(f,u){return u==="hex"?s(f):f},"encode")}),Ur=Ta(function(r,e){"use strict";var t=e;t.assert=$0,t.toArray=Dn.toArray,t.zero2=Dn.zero2,t.toHex=Dn.toHex,t.encode=Dn.encode;function n(u,m,p){var x=new Array(Math.max(u.bitLength(),p)+1);x.fill(0);for(var k=1<<m+1,O=u.clone(),T=0;T<x.length;T++){var C,$=O.andln(k-1);O.isOdd()?($>(k>>1)-1?C=(k>>1)-$:C=$,O.isubn(C)):C=0,x[T]=C,O.iushrn(1)}return x}o(n,"getNAF"),t.getNAF=n;function i(u,m){var p=[[],[]];u=u.clone(),m=m.clone();for(var x=0,k=0,O;u.cmpn(-x)>0||m.cmpn(-k)>0;){var T=u.andln(3)+x&3,C=m.andln(3)+k&3;T===3&&(T=-1),C===3&&(C=-1);var $;(T&1)===0?$=0:(O=u.andln(7)+x&7,(O===3||O===5)&&C===2?$=-T:$=T),p[0].push($);var I;(C&1)===0?I=0:(O=m.andln(7)+k&7,(O===3||O===5)&&T===2?I=-C:I=C),p[1].push(I),2*x===$+1&&(x=1-x),2*k===I+1&&(k=1-k),u.iushrn(1),m.iushrn(1)}return p}o(i,"getJSF"),t.getJSF=i;function s(u,m,p){var x="_"+m;u.prototype[m]=o(function(){return this[x]!==void 0?this[x]:this[x]=p.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function a(u){return typeof u=="string"?t.toArray(u,"hex"):u}o(a,"parseBytes"),t.parseBytes=a;function f(u){return new Qe.default(u,"hex","le")}o(f,"intFromLE"),t.intFromLE=f}),Vu=Ur.getNAF,gM=Ur.getJSF,Wu=Ur.assert;function bo(r,e){this.type=r,this.p=new Qe.default(e.p,16),this.red=e.prime?Qe.default.red(e.prime):Qe.default.mont(this.p),this.zero=new Qe.default(0).toRed(this.red),this.one=new Qe.default(1).toRed(this.red),this.two=new Qe.default(2).toRed(this.red),this.n=e.n&&new Qe.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(bo,"BaseCurve");var ls=bo;bo.prototype.point=o(function(){throw new Error("Not implemented")},"point");bo.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");bo.prototype._fixedNafMul=o(function(e,t){Wu(e.precomputed);var n=e._getDoubles(),i=Vu(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var m=f+n.step-1;m>=f;m--)u=(u<<1)+i[m];a.push(u)}for(var p=this.jpoint(null,null,null),x=this.jpoint(null,null,null),k=s;k>0;k--){for(f=0;f<a.length;f++)u=a[f],u===k?x=x.mixedAdd(n.points[f]):u===-k&&(x=x.mixedAdd(n.points[f].neg()));p=p.add(x)}return p.toP()},"_fixedNafMul");bo.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Vu(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var m=0;u>=0&&a[u]===0;u--)m++;if(u>=0&&m++,f=f.dblp(m),u<0)break;var p=a[u];Wu(p!==0),e.type==="affine"?p>0?f=f.mixedAdd(s[p-1>>1]):f=f.mixedAdd(s[-p-1>>1].neg()):p>0?f=f.add(s[p-1>>1]):f=f.add(s[-p-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");bo.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,m=0,p,x,k;for(p=0;p<i;p++){k=t[p];var O=k._getNAFPoints(e);a[p]=O.wnd,f[p]=O.points}for(p=i-1;p>=1;p-=2){var T=p-1,C=p;if(a[T]!==1||a[C]!==1){u[T]=Vu(n[T],a[T],this._bitLength),u[C]=Vu(n[C],a[C],this._bitLength),m=Math.max(u[T].length,m),m=Math.max(u[C].length,m);continue}var $=[t[T],null,null,t[C]];t[T].y.cmp(t[C].y)===0?($[1]=t[T].add(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg())):t[T].y.cmp(t[C].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].add(t[C].neg())):($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],U=gM(n[T],n[C]);for(m=Math.max(U[0].length,m),u[T]=new Array(m),u[C]=new Array(m),x=0;x<m;x++){var z=U[0][x]|0,H=U[1][x]|0;u[T][x]=I[(z+1)*3+(H+1)],u[C][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),B=this._wnafT4;for(p=m;p>=0;p--){for(var L=0;p>=0;){var F=!0;for(x=0;x<i;x++)B[x]=u[x][p]|0,B[x]!==0&&(F=!1);if(!F)break;L++,p--}if(p>=0&&L++,X=X.dblp(L),p<0)break;for(x=0;x<i;x++){var re=B[x];re!==0&&(re>0?k=f[x][re-1>>1]:re<0&&(k=f[x][-re-1>>1].neg()),k.type==="affine"?X=X.mixedAdd(k):X=X.add(k))}}for(p=0;p<i;p++)f[p]=null;return s?X:X.toP()},"_wnafMulAdd");function ln(r,e){this.curve=r,this.type=e,this.precomputed=null}o(ln,"BasePoint");bo.BasePoint=ln;ln.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");ln.prototype.validate=o(function(){return this.curve.validate(this)},"validate");bo.prototype.decodePoint=o(function(e,t){e=Ur.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Wu(e[e.length-1]%2===0):e[0]===7&&Wu(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");ln.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");ln.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");ln.prototype.encode=o(function(e,t){return Ur.encode(this._encode(t),e)},"encode");ln.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");ln.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");ln.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");ln.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");ln.prototype._getBeta=o(function(){return null},"_getBeta");ln.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var q0=Ta(function(r){typeof Object.create=="function"?r.exports=o(function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):r.exports=o(function(t,n){if(n){t.super_=n;var i=o(function(){},"TempCtor");i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t}},"inherits")}),vM=Ur.assert;function dn(r){ls.call(this,"short",r),this.a=new Qe.default(r.a,16).toRed(this.red),this.b=new Qe.default(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(dn,"ShortCurve");q0(dn,ls);var yM=dn;dn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new Qe.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new Qe.default(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],vM(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new Qe.default(f.a,16),b:new Qe.default(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");dn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:Qe.default.mont(e),n=new Qe.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new Qe.default(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");dn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new Qe.default(1),a=new Qe.default(0),f=new Qe.default(0),u=new Qe.default(1),m,p,x,k,O,T,C,$=0,I,U;n.cmpn(0)!==0;){var z=i.div(n);I=i.sub(z.mul(n)),U=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&I.cmp(t)<0)m=C.neg(),p=s,x=I.neg(),k=U;else if(x&&++$===2)break;C=I,i=n,n=I,f=s,s=U,u=a,a=H}O=I.neg(),T=U;var X=x.sqr().add(k.sqr()),B=O.sqr().add(T.sqr());return B.cmp(X)>=0&&(O=m,T=p),x.negative&&(x=x.neg(),k=k.neg()),O.negative&&(O=O.neg(),T=T.neg()),[{a:x,b:k},{a:O,b:T}]},"_getEndoBasis");dn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),m=s.mul(n.b),p=a.mul(i.b),x=e.sub(f).sub(u),k=m.add(p).neg();return{k1:x,k2:k}},"_endoSplit");dn.prototype.pointFromX=o(function(e,t){e=new Qe.default(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");dn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");dn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],m=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),m=m.neg(!0)),i[a*2]=u,i[a*2+1]=m,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var p=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return p},"_endoWnafMulAdd");function Gt(r,e,t,n){ls.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(Gt,"Point");q0(Gt,ls.BasePoint);dn.prototype.point=o(function(e,t,n){return new Gt(this,e,t,n)},"point");dn.prototype.pointFromJSON=o(function(e,t){return Gt.fromJSON(this,e,t)},"pointFromJSON");Gt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");Gt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");Gt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");Gt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");Gt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Gt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");Gt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");Gt.prototype.getX=o(function(){return this.x.fromRed()},"getX");Gt.prototype.getY=o(function(){return this.y.fromRed()},"getY");Gt.prototype.mul=o(function(e){return e=new Qe.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");Gt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");Gt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");Gt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");Gt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");Gt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function tr(r,e,t,n){ls.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Qe.default(0)):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),this.z=new Qe.default(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(tr,"JPoint");q0(tr,ls.BasePoint);dn.prototype.jpoint=o(function(e,t,n){return new tr(this,e,t,n)},"jpoint");tr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");tr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");tr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),m=a.redSub(f);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),x=p.redMul(u),k=i.redMul(p),O=m.redSqr().redIAdd(x).redISub(k).redISub(k),T=m.redMul(k.redISub(O)).redISub(a.redMul(x)),C=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(O,T,C)},"add");tr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=f.redSqr(),p=m.redMul(f),x=n.redMul(m),k=u.redSqr().redIAdd(p).redISub(x).redISub(x),O=u.redMul(x.redISub(k)).redISub(s.redMul(p)),T=this.z.redMul(f);return this.curve.jpoint(k,O,T)},"mixedAdd");tr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,m=u.redSqr().redSqr(),p=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),k=p.redSqr(),O=k.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(m)),C=a.redMul(k),$=T.redSqr().redISub(C.redAdd(C)),I=C.redISub($),U=T.redMul(I);U=U.redIAdd(U).redISub(O);var z=p.redMul(u);t+1<e&&(m=m.redMul(O)),a=$,u=z,p=U}return this.curve.jpoint(a,p.redMul(s),u)},"dblp");tr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");tr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),m=u.redSqr().redISub(f).redISub(f),p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),e=m,t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),k=this.y.redSqr(),O=k.redSqr(),T=this.x.redAdd(k).redSqr().redISub(x).redISub(O);T=T.redIAdd(T);var C=x.redAdd(x).redIAdd(x),$=C.redSqr(),I=O.redIAdd(O);I=I.redIAdd(I),I=I.redIAdd(I),e=$.redISub(T).redISub(T),t=C.redMul(T.redISub(e)).redISub(I),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");tr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),m=u.redSqr().redISub(f).redISub(f);e=m;var p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),k=this.y.redSqr(),O=this.x.redMul(k),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var C=O.redIAdd(O);C=C.redIAdd(C);var $=C.redAdd(C);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(k).redISub(x);var I=k.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I),t=T.redMul(C.redISub(e)).redISub(I)}return this.curve.jpoint(e,t,n)},"_threeDbl");tr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),m=t.redAdd(t);m=m.redIAdd(m);var p=m.redMul(f),x=u.redSqr().redISub(p.redAdd(p)),k=p.redISub(x),O=f.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=u.redMul(k).redISub(O),C=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,C)},"_dbl");tr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),m=i.redIAdd(i);m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var p=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(m),x=t.redMul(p);x=x.redIAdd(x),x=x.redIAdd(x);var k=this.x.redMul(u).redISub(x);k=k.redIAdd(k),k=k.redIAdd(k);var O=this.y.redMul(p.redMul(m.redISub(p)).redISub(f.redMul(u)));O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(k,O,T)},"trpl");tr.prototype.mul=o(function(e,t){return e=new Qe.default(e,t),this.curve._wnafMul(this,e)},"mul");tr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");tr.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");tr.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");tr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var zu=Ta(function(r,e){"use strict";var t=e;t.base=ls,t.short=yM,t.mont=null,t.edwards=null}),Ku=Ta(function(r,e){"use strict";var t=e,n=Ur.assert;function i(f){f.type==="short"?this.curve=new zu.short(f):f.type==="edwards"?this.curve=new zu.edwards(f):this.curve=new zu.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(i,"PresetCurve"),t.PresetCurve=i;function s(f,u){Object.defineProperty(t,f,{configurable:!0,enumerable:!0,get:function(){var m=new i(u);return Object.defineProperty(t,f,{configurable:!0,enumerable:!0,value:m}),m}})}o(s,"defineCurve"),s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:oi.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:oi.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:oi.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:oi.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:oi.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch(f){a=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:oi.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function mo(r){if(!(this instanceof mo))return new mo(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Dn.toArray(r.entropy,r.entropyEnc||"hex"),t=Dn.toArray(r.nonce,r.nonceEnc||"hex"),n=Dn.toArray(r.pers,r.persEnc||"hex");$0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(mo,"HmacDRBG");var Fy=mo;mo.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");mo.prototype._hmac=o(function(){return new oi.default.hmac(this.hash,this.K)},"hmac");mo.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");mo.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Dn.toArray(e,t),n=Dn.toArray(n,i),$0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");mo.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Dn.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Dn.encode(a,t)},"generate");var F0=Ur.assert;function ur(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(ur,"KeyPair");var H0=ur;ur.fromPublic=o(function(e,t,n){return t instanceof ur?t:new ur(e,{pub:t,pubEnc:n})},"fromPublic");ur.fromPrivate=o(function(e,t,n){return t instanceof ur?t:new ur(e,{priv:t,privEnc:n})},"fromPrivate");ur.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");ur.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");ur.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");ur.prototype._importPrivate=o(function(e,t){this.priv=new Qe.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");ur.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?F0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&F0(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");ur.prototype.derive=o(function(e){return e.validate()||F0(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");ur.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");ur.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");ur.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var xM=Ur.assert;function Gu(r,e){if(r instanceof Gu)return r;this._importDER(r,e)||(xM(r.r&&r.s,"Signature without r or s"),this.r=new Qe.default(r.r,16),this.s=new Qe.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(Gu,"Signature");var Yu=Gu;function wM(){this.place=0}o(wM,"Position");function B0(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(B0,"getLength");function By(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(By,"rmPadding");Gu.prototype._importDER=o(function(e,t){e=Ur.toArray(e,t);var n=new wM;if(e[n.place++]!==48)return!1;var i=B0(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=B0(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=B0(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new Qe.default(a),this.s=new Qe.default(u),this.recoveryParam=null,!0},"_importDER");function U0(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(U0,"constructLength");Gu.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=By(t),n=By(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];U0(i,t.length),i=i.concat(t),i.push(2),U0(i,n.length);var s=i.concat(n),a=[48];return U0(a,s.length),a=a.concat(s),Ur.encode(a,e)},"toDER");var _M=o(function(){throw new Error("unsupported")},"rand"),$y=Ur.assert;function un(r){if(!(this instanceof un))return new un(r);typeof r=="string"&&($y(Object.prototype.hasOwnProperty.call(Ku,r),"Unknown curve "+r),r=Ku[r]),r instanceof Ku.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(un,"EC");var EM=un;un.prototype.keyPair=o(function(e){return new H0(this,e)},"keyPair");un.prototype.keyFromPrivate=o(function(e,t){return H0.fromPrivate(this,e,t)},"keyFromPrivate");un.prototype.keyFromPublic=o(function(e,t){return H0.fromPublic(this,e,t)},"keyFromPublic");un.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Fy({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||_M(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Qe.default(2));;){var s=new Qe.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");un.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");un.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Qe.default(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new Fy({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),m=this.n.sub(new Qe.default(1)),p=0;;p++){var x=i.k?i.k(p):new Qe.default(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(m)>=0)){var k=this.g.mul(x);if(!k.isInfinity()){var O=k.getX(),T=O.umod(this.n);if(T.cmpn(0)!==0){var C=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(C=C.umod(this.n),C.cmpn(0)!==0){var $=(k.getY().isOdd()?1:0)|(O.cmp(T)!==0?2:0);return i.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),$^=1),new Yu({r:T,s:C,recoveryParam:$})}}}}}},"sign");un.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Qe.default(e,16)),n=this.keyFromPublic(n,i),t=new Yu(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),m=f.mul(s).umod(this.n),p;return this.curve._maxwellTrick?(p=this.g.jmulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.eqXToP(s)):(p=this.g.mulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.getX().umod(this.n).cmp(s)===0)},"verify");un.prototype.recoverPubKey=function(r,e,t,n){$y((3&t)===t,"The recovery param is more than two bits"),e=new Yu(e,n);var i=this.n,s=new Qe.default(r),a=e.r,f=e.s,u=t&1,m=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");m?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var p=e.r.invm(i),x=i.sub(s).mul(p).umod(i),k=f.mul(p).umod(i);return this.g.mulAdd(x,a,k)};un.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Yu(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var SM=Ta(function(r,e){"use strict";var t=e;t.version="6.5.4",t.utils=Ur,t.rand=function(){throw new Error("unsupported")},t.curve=zu,t.curves=Ku,t.ec=EM,t.eddsa=null}),qy=SM.ec;var Hy="signing-key/5.6.2";var z0=new tt(Hy),j0=null;function si(){return j0||(j0=new qy("secp256k1")),j0}o(si,"getCurve");var Ju=class{constructor(e){Aa(this,"curve","secp256k1"),Aa(this,"privateKey",cr(e)),qu(this.privateKey)!==32&&z0.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=si().keyFromPrivate(Tt(this.privateKey));Aa(this,"publicKey","0x"+t.getPublic(!1,"hex")),Aa(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Aa(this,"_isSigningKey",!0)}_addPoint(e){let t=si().keyFromPublic(Tt(this.publicKey)),n=si().keyFromPublic(Tt(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=Tt(e);n.length!==32&&z0.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return ju({recoveryParam:i.recoveryParam,r:po("0x"+i.r.toString(16),32),s:po("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=si().keyFromPublic(Tt(K0(e)));return po("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(Ju,"SigningKey");function jy(r,e){let t=ju(e),n={r:Tt(t.r),s:Tt(t.s)};return"0x"+si().recoverPubKey(Tt(r),n,t.recoveryParam).encode("hex",!1)}o(jy,"recoverPublicKey");function K0(r,e){let t=Tt(r);if(t.length===32){let n=new Ju(t);return e?"0x"+si().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?cr(t):"0x"+si().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+si().keyFromPublic(t).getPublic(!0,"hex"):cr(t)}return z0.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(K0,"computePublicKey");var zy="transactions/5.6.2";var tU=new tt(zy),Ky;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(Ky||(Ky={}));function Vy(r){let e=K0(r);return Iy(Hu(Ma(Hu(e,1)),12))}o(Vy,"computeAddress");function Wy(r,e){return Vy(jy(Tt(r),e))}o(Wy,"recoverAddress");var Gy="wallet/5.6.2";var uU=new tt(Gy);function Yy(r,e){return Wy(L0(r),e)}o(Yy,"verifyMessage");cf();var MM=`
632
+ `+String(n)));Wp(e);for(var i=0;i<e.callbacks.length;i++){var s=n[i];s instanceof Error?e.callbacks[i].reject(s):e.callbacks[i].resolve(s)}}).catch(function(n){_w(r,e,n)})}o(SC,"dispatchBatch");function _w(r,e,t){Wp(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(_w,"failedDispatch");function Wp(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Wp,"resolveCacheHits");function MC(r){var e=!r||r.batch!==!1;if(!e)return 1;var t=r&&r.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}o(MC,"getValidMaxBatchSize");function AC(r){var e=r&&r.batchScheduleFn;if(e===void 0)return _C;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(AC,"getValidBatchScheduleFn");function TC(r){var e=r&&r.cacheKeyFn;if(e===void 0)return function(t){return t};if(typeof e!="function")throw new TypeError("cacheKeyFn must be a function: "+e);return e}o(TC,"getValidCacheKeyFn");function kC(r){var e=!r||r.cache!==!1;if(!e)return null;var t=r&&r.cacheMap;if(t===void 0)return new Map;if(t!==null){var n=["get","set","delete","clear"],i=n.filter(function(s){return t&&typeof t[s]!="function"});if(i.length!==0)throw new TypeError("Custom cacheMap missing methods: "+i.join(", "))}return t}o(kC,"getValidCacheMap");function Ew(r){return typeof r=="object"&&r!==null&&typeof r.length=="number"&&(r.length===0||r.length>0&&Object.prototype.hasOwnProperty.call(r,r.length-1))}o(Ew,"isArrayLike");Sw.exports=wC});var Fw=me((TK,Uw)=>{Uw.exports=Bw;var Lw=128,GC=127,YC=~GC,JC=Math.pow(2,31);function Bw(r,e,t){e=e||[],t=t||0;for(var n=t;r>=JC;)e[t++]=r&255|Lw,r/=128;for(;r&YC;)e[t++]=r&255|Lw,r>>>=7;return e[t]=r|0,Bw.bytes=t-n+1,e}o(Bw,"encode")});var Hw=me((kK,qw)=>{qw.exports=om;var XC=128,$w=127;function om(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw om.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&$w)<<i:(a&$w)*Math.pow(2,i),i+=7}while(a>=XC);return om.bytes=s-n,t}o(om,"read")});var jw=me((CK,zw)=>{var ZC=Math.pow(2,7),QC=Math.pow(2,14),eD=Math.pow(2,21),tD=Math.pow(2,28),rD=Math.pow(2,35),nD=Math.pow(2,42),iD=Math.pow(2,49),oD=Math.pow(2,56),sD=Math.pow(2,63);zw.exports=function(r){return r<ZC?1:r<QC?2:r<eD?3:r<tD?4:r<rD?5:r<nD?6:r<iD?7:r<oD?8:r<sD?9:10}});var Vw=me((DK,Kw)=>{Kw.exports={encode:Fw(),decode:Hw(),encodingLength:jw()}});var Gw=me((OK,Ww)=>{"use strict";var aD=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});Ww.exports={names:aD}});var t4=me((IK,e4)=>{"use strict";var Yw=G0(),Ya=Vw(),{names:bc}=Gw(),{toString:td}=(lf(),tf(u1)),{fromString:fD}=(zc(),tf(c1)),{concat:cD}=(yd(),tf(Lm)),Ja={};for(let r in bc){let e=r;Ja[bc[e]]=e}Object.freeze(Ja);function uD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return td(r,"base16")}o(uD,"toHexString");function lD(r){return fD(r,"base16")}o(lD,"fromHexString");function dD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return td(Yw.encode("base58btc",r)).slice(1)}o(dD,"toB58String");function hD(r){let e=r instanceof Uint8Array?td(r):r;return Yw.decode("z"+e)}o(hD,"fromB58String");function Jw(r){if(!(r instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(r.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=Ya.decode(r);if(!Zw(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Ya.decode.bytes);let t=Ya.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Ya.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${td(r,"base16")}`);return{code:e,name:Ja[e],length:t,digest:r}}o(Jw,"decode");function pD(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=Xw(e);if(!(r instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(t==null&&(t=r.length),t&&r.length!==t)throw new Error("digest length should be equal to specified length.");let i=Ya.encode(n),s=Ya.encode(t);return cD([i,s,r],i.length+s.length+r.length)}o(pD,"encode");function Xw(r){let e=r;if(typeof r=="string"){if(bc[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=bc[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Ja[e]===void 0&&!sm(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(Xw,"coerceCode");function sm(r){return r>0&&r<16}o(sm,"isAppCode");function Zw(r){return!!(sm(r)||Ja[r])}o(Zw,"isValidCode");function Qw(r){Jw(r)}o(Qw,"validate");function mD(r){return Qw(r),r.subarray(0,2)}o(mD,"prefix");e4.exports={names:bc,codes:Ja,toHexString:uD,fromHexString:lD,toB58String:dD,fromB58String:hD,decode:Jw,encode:pD,coerceCode:Xw,isAppCode:sm,validate:Qw,prefix:mD,isValidCode:Zw}});var jI={};St(jI,{walletFromKey:()=>u5});module.exports=tf(jI);var xY=require("isomorphic-fetch");var Pm=at(require("isomorphic-webcrypto"));typeof window=="undefined"&&(globalThis.crypto=Pm.default);var v5=o((r,e)=>Z(void 0,null,function*(){return rf(r.contents,{plugins:[...r.plugins,e]})}),"addPluginToWallet"),y5=o((r,e)=>Z(void 0,null,function*(){return rf([...r.contents,e],r)}),"addToWallet"),x5=o((r,e)=>Z(void 0,null,function*(){let t=JSON.parse(JSON.stringify(r.contents)),n=t.find(i=>i.id===e);return rf(t.filter(i=>i.id!==n.id),r)}),"removeFromWallet"),w5=o((r,e)=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.bind(r,r)])),"bindMethods"),rf=o((...t)=>Z(void 0,[...t],function*(r=[],e={}){let{plugins:n=[]}=e,i=n.reduce((a,f)=>ie(ie({},a),f.pluginMethods),{}),s={contents:[...r],add:function(a){return y5(this,a)},remove:function(a){return x5(this,a)},status:"UNLOCKED",plugins:n,pluginMethods:i,addPlugin:function(a){return v5(this,a)}};return i&&(s.pluginMethods=w5(s,i)),s}),"generateWallet");function _5(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(_5,"_catch");function E5(){let r=new Map;return function(e,t){try{let i=function(a){if(n)return a;let f=r.get(e.didUrl);return f!==void 0?f:Promise.resolve(t()).then(function(u){var m;return((m=u.didResolutionMetadata)==null?void 0:m.error)!=="notFound"&&r.set(e.didUrl,u),u})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(a){return n=1,a})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(E5,"inMemoryCache");function S5(r,e){return e()}o(S5,"noCache");var M5="(?:%[0-9a-fA-F]{2})",Nm=`(?:[a-zA-Z0-9._-]|${M5})`,A5="([a-z0-9]+)",T5=`((?:${Nm}*:)*(${Nm}+))`,Rm="[a-zA-Z0-9_.:%-]",k5=`;${Rm}+=${Rm}*`,C5=`((${k5})*)`,D5="(/[^#?]*)?",O5="([?][^#]*)?",I5="(#.*)?",P5=new RegExp(`^did:${A5}:${T5}${C5}${D5}${O5}${I5}$`);function vd(r){if(r===""||!r)return null;let e=r.match(P5);if(e){let t={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:r};if(e[4]){let n=e[4].slice(1).split(";");t.params={};for(let i of n){let s=i.split("=");t.params[s[0]]=s[1]}}return e[6]&&(t.path=e[6]),e[7]&&(t.query=e[7].slice(1)),e[8]&&(t.fragment=e[8].slice(1)),t}return null}o(vd,"parse");var Cc={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function N5(r){return function(e,t,n){try{return Promise.resolve(_5(function(){return Promise.resolve(r(e,t,n)).then(function(i){return Te(ie({},Cc),{didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i})})},function(i){return Te(ie({},Cc),{didResolutionMetadata:{error:"notFound",message:i.toString()}})}))}catch(i){return Promise.reject(i)}}}o(N5,"wrapLegacyResolver");var nf=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?E5():t.cache||S5,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=N5(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=vd(e);if(i===null)return Promise.resolve(Te(ie({},Cc),{didResolutionMetadata:{error:"invalidDid"}}));let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve(Te(ie({},Cc),{didResolutionMetadata:{error:"unsupportedDidMethod"}}))}catch(n){return Promise.reject(n)}}};o(nf,"Resolver");yd();zc();lf();qc();var Gh=at(v1()),Hg=at(Qd()),Yh=at(Kb()),vu=at(lu()),zg=at(bg()),Af=at(xg()),Jh=at(Ng()),Xh=at(no());function sn(r){return Ot(r,"base64url")}o(sn,"bytesToBase64url");function Ar(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Lt(e,"base64url")}o(Ar,"base64ToBytes");function Zh(r){return Lt(r,"base58btc")}o(Zh,"base58ToBytes");function Kh(r){let e=r.startsWith("0x")?r.substring(2):r;return Lt(e.toLowerCase(),"base16")}o(Kh,"hexToBytes");function Vh(r){return sn(Lt(r))}o(Vh,"encodeBase64url");function jg(r){return Ot(Ar(r))}o(jg,"decodeBase64url");function ts(r){return Ot(r,"base16")}o(ts,"bytesToHex");function Kg(r){return Lt(r)}o(Kg,"stringToBytes");function w7({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Lt(r,"base16"),0),i.set(Lt(e,"base16"),32),n){if(typeof t=="undefined")throw new Error("Signer did not return a recoveryParam");i[64]=t}return sn(i)}o(w7,"toJose");function _7(r){let e=Ar(r);if(e.length<64||e.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${e.length}`);let t=ts(e.slice(0,32)),n=ts(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(_7,"fromJose");function Vg(r,e){return vn([Ar(r),Ar(e)])}o(Vg,"toSealed");var E7=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,S7=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,M7=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function A7(r){if(typeof r=="string"){if(E7.test(r))return Kh(r);if(S7.test(r))return Zh(r);if(M7.test(r))return Ar(r);throw TypeError("bad_key: Invalid private key format")}else{if(r instanceof Uint8Array)return r;throw TypeError("bad_key: Invalid private key format")}}o(A7,"parseKey");function Wg(r){let e=typeof r=="string"?Lt(r):r;return(0,Gh.hash)(e)}o(Wg,"sha256");function T7(r){return new Uint8Array(Hg.keccak_256.arrayBuffer(r))}o(T7,"keccak");function k7(r){let e=Lt(r.slice(2),"base16");return`0x${Ot(T7(e).slice(-20),"base16")}`}o(k7,"toEthereumAddress");function Wh(r,e=new Uint8Array(4)){let t=Lt(r.toString(),"base10");return e.set(t,4-t.length),e}o(Wh,"writeUint32BE");var jh=o(r=>vn([Wh(r.length),r]),"lengthAndInput");function Gg(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=vn([jh(Lt(t)),jh(typeof n=="undefined"?new Uint8Array(0):n),jh(typeof i=="undefined"?new Uint8Array(0):i),Wh(e)]);return(0,Gh.hash)(vn([Wh(1),r,s]))}o(Gg,"concatKDF");var tR=new Yh.ec("secp256k1");function Yg(r){let e=A7(r);if(e.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${e.length}`);return function(t){try{let n=typeof t=="string"?Kg(t):t,i=(0,vu.sign)(e,n);return Promise.resolve(sn(i))}catch(n){return Promise.reject(n)}}}o(Yg,"EdDSASigner");function Jg(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Jg,"instanceOfEcdsaSignature");function Rg(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Jg(i))return w7(i,r);if(r&&typeof _7(i).recoveryParam=="undefined")throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return i})}catch(i){return Promise.reject(i)}},"sign")}o(Rg,"ES256KSignerAlg");function Lg(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Jg(n))throw new Error("invalid_config: expected a signer function that returns a string instead of signature object");return n})}catch(n){return Promise.reject(n)}},"sign")}o(Lg,"Ed25519SignerAlg");var C7={ES256K:Rg(),"ES256K-R":Rg(!0),Ed25519:Lg(),EdDSA:Lg()};function D7(r){let e=C7[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(D7,"SignerAlg");var Qh=new Yh.ec("secp256k1");function gu(r,e=!1){let t=Ar(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=ts(t.slice(0,32)),i=ts(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(gu,"toSignatureObject");function e0(r){if(r.publicKeyBase58)return Zh(r.publicKeyBase58);if(r.publicKeyBase64)return Ar(r.publicKeyBase64);if(r.publicKeyHex)return Kh(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return Kh(Qh.keyFromPublic({x:ts(Ar(r.publicKeyJwk.x)),y:ts(Ar(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Ys;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(e0,"extractPublicKeyBytes");function O7(r,e,t){let n=Wg(r),i=gu(e),s=t.filter(({ethereumAddress:u,blockchainAccountId:m})=>typeof u=="undefined"&&typeof m=="undefined"),a=t.filter(({ethereumAddress:u,blockchainAccountId:m})=>typeof u!="undefined"||typeof m!==void 0),f=s.find(u=>{try{let m=e0(u);return Qh.keyFromPublic(m).verify(n,i)}catch(m){return!1}});if(!f&&a.length>0&&(f=Xg(r,e,a)),!f)throw new Error("invalid_signature: Signature invalid for JWT");return f}o(O7,"verifyES256K");function Xg(r,e,t){let n;if(e.length>86)n=[gu(e,!0)];else{let a=gu(e,!1);n=[Te(ie({},a),{recoveryParam:0}),Te(ie({},a),{recoveryParam:1})]}let i=o(a=>{let f=Wg(r),u=Qh.recoverPubKey(f,a,a.recoveryParam),m=u.encode("hex"),p=u.encode("hex",!0),x=k7(m);return t.find(I=>{var T,C,$;let O=ts(e0(I));return O===m||O===p||((T=I.ethereumAddress)==null?void 0:T.toLowerCase())===x||((C=I.blockchainAccountId)==null||($=C.split("@eip155"))==null?void 0:$[0].toLowerCase())===x})},"checkSignatureAgainstSigner"),s=n.map(i).filter(a=>typeof a!="undefined");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(Xg,"verifyRecoverableES256K");function Bg(r,e,t){let n=Kg(r),i=Ar(e),s=t.find(a=>(0,vu.verify)(e0(a),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Bg,"verifyEd25519");var I7={ES256K:O7,"ES256K-R":Xg,Ed25519:Bg,EdDSA:Bg};function Zg(r){let e=I7[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(Zg,"VerifierAlgorithm");Zg.toSignatureObject=gu;var Qg=o(function(r,e,t={},n={}){try{t.alg||(t.alg=P7);let i=typeof r=="string"?r:Ug(r,n.canonicalize),s=[Ug(t,n.canonicalize),i].join("."),a=D7(t.alg);return Promise.resolve(a(s,e)).then(function(f){return[s,f].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var P7="ES256K";function Ug(r,e=!1){return Vh(e?(0,zg.default)(r):JSON.stringify(r))}o(Ug,"encodeSection");function N7(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(jg(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(N7,"decodeJWS");function R7({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),Zg(r.alg)(e,t,n)}o(R7,"verifyJWSDecoded");function ev(r,e){let t=N7(r);return R7(t,e)}o(ev,"verifyJWS");function L7(r,e,t){for(var n;;){var i=r();if(so(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(so(s))s=s.s;else{n=1;break}if(e){var a=e();if(a&&a.then&&!so(a)){n=2;break}}}var f=new rs,u=qt.bind(null,f,2);return(n===0?i.then(p):n===1?s.then(m):a.then(x)).then(void 0,u),f;function m(k){s=k;do{if(e&&(a=e(),a&&a.then&&!so(a))){a.then(x).then(void 0,u);return}if(i=r(),!i||so(i)&&!i.v){qt(f,1,s);return}if(i.then){i.then(p).then(void 0,u);return}s=t(),so(s)&&(s=s.v)}while(!s||!s.then);s.then(m).then(void 0,u)}o(m,"_resumeAfterBody");function p(k){k?(s=t(),s&&s.then?s.then(m).then(void 0,u):m(s)):qt(f,1,s)}o(p,"_resumeAfterTest");function x(){(i=r())?i.then?i.then(p).then(void 0,u):p(i):qt(f,1,s)}o(x,"_resumeAfterUpdate")}o(L7,"_for");var tv=o(function(r,e){try{let n=function(m){if(f===null)throw new Error("failure: Failed to decrypt");return f};o(n,"_temp5");let t;F7(r);let i=JSON.parse(jg(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=Vg(r.ciphertext,r.tag),a=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),f=null,u=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,Ar(r.iv),a)).then(function(m){f=m}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let m=0;return L7(function(){return!f&&m<r.recipients.length},function(){return m++},function(){let p=r.recipients[m];Object.assign(p.header,i);let x=function(){if(p.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Ar(r.iv),a,p)).then(function(k){f=k})}();if(x&&x.then)return x.then(function(){})})}}()}();return Promise.resolve(u&&u.then?u.then(n):n(u))}catch(t){return Promise.reject(t)}},"decryptJWE"),Fg=typeof Symbol!="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function qt(r,e,t){if(!r.s){if(t instanceof rs)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=qt.bind(null,r,e);return}if(t&&t.then){t.then(qt.bind(null,r,e),qt.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(qt,"_settle");var rs=function(){function r(){}return o(r,"_Pact"),r.prototype.then=function(e,t){let n=new r,i=this.s;if(i){let s=i&1?e:t;if(s){try{qt(n,1,s(this.v))}catch(a){qt(n,2,a)}return n}else return this}return this.o=function(s){try{let a=s.v;s.s&1?qt(n,1,e?e(a):a):t?qt(n,1,t(a)):qt(n,2,a)}catch(a){qt(n,2,a)}},n},r}();function so(r){return r instanceof rs&&r.s&1}o(so,"_isSettledPact");function B7(r,e,t){var n=-1,i,s;function a(f){try{for(;++n<r.length&&(!t||!t());)if(f=e(n),f&&f.then)if(so(f))f=f.v;else{f.then(a,s||(s=qt.bind(null,i=new rs,2)));return}i?qt(i,1,f):i=f}catch(u){qt(i||(i=new rs),2,u)}}return o(a,"_cycle"),a(),i}o(B7,"_forTo");function U7(r,e,t){if(typeof r[Fg]=="function"){let p=function(x){try{for(;!(i=n.next()).done&&(!t||!t());)if(x=e(i.value),x&&x.then)if(so(x))x=x.v;else{x.then(p,a||(a=qt.bind(null,s=new rs,2)));return}s?qt(s,1,x):s=x}catch(k){qt(s||(s=new rs),2,k)}};o(p,"_cycle");var n=r[Fg](),i,s,a;if(p(),n.return){var f=o(function(x){try{i.done||n.return()}catch(k){}return x},"_fixup");if(s&&s.then)return s.then(f,function(x){throw f(x)});f()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var u=[],m=0;m<r.length;m++)u.push(r[m]);return B7(u,function(p){return e(u[p])},t)}o(U7,"_forOf");function F7(r){if(!(r.protected&&r.iv&&r.ciphertext&&r.tag))throw new Error("bad_jwe: missing properties");r.recipients&&r.recipients.map(e=>{if(!(e.header&&e.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}o(F7,"validateJWE");function $g({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let a={protected:n,iv:sn(t),ciphertext:sn(r),tag:sn(e)};return s&&(a.aad=sn(s)),i&&(a.recipients=[i]),a}o($g,"encodeJWE");var rv=o(function(r,e,t={},n){try{if(e[0].alg==="dir"){if(e.length>1)throw new Error('not_supported: Can only do "dir" encryption to one key.');return Promise.resolve(e[0].encrypt(r,t,n)).then(function(i){return $g(i,n)})}else{let i=e[0].enc;if(!e.reduce((u,m)=>u&&m.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,a,f=U7(e,function(u){let m=function(){return s?Promise.resolve(u.encryptCek==null?void 0:u.encryptCek(s)).then(function(p){if(p){var x,k;(x=a)==null||(k=x.recipients)==null||k.push(p)}}):Promise.resolve(u.encrypt(r,t,n)).then(function(p){s=p.cek,a=$g(p,n)})}();if(m&&m.then)return m.then(function(){})});return Promise.resolve(f&&f.then?f.then(function(){return a}):a)}}catch(i){return Promise.reject(i)}},"createJWE");var nv=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:a}){var f;if(s!=null&&s.error||a==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!a.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let m=((f=a.keyAgreement)==null?void 0:f.map(p=>typeof p=="string"?[...a.publicKey||[],...a.verificationMethod||[]].find(x=>x.id===p):p).filter(p=>typeof p!="undefined")).filter(p=>p.type==="X25519KeyAgreementKey2019"&&Boolean(p.publicKeyBase58));if(!m.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return m.map(p=>q7(Zh(p.publicKeyBase58),p.id))})}catch(s){return Promise.reject(s)}},"encryptersForDID"),n=r.map(i=>t(i));return Promise.resolve(Promise.all(n)).then(function(i){return[].concat(...i)})}catch(t){return Promise.reject(t)}},"resolveX25519Encrypters");function iv(r){let e=new Jh.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Xh.randomBytes)(e.nonceLength),s=e.seal(i,t,n);return{ciphertext:s.subarray(0,s.length-e.tagLength),tag:s.subarray(s.length-e.tagLength),iv:i}}}o(iv,"xc20pEncrypter");function $7(r){let e=o(function(s,a={},f){try{let u=Vh(JSON.stringify(Object.assign({alg:i},a,{enc:n}))),m=new Uint8Array(Buffer.from(f?`${u}.${sn(f)}`:u));return Promise.resolve(Te(ie({},t(s,m)),{protectedHeader:u}))}catch(u){return Promise.reject(u)}},"encrypt"),t=iv(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o($7,"xc20pDirEncrypter");function qg(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(a){return Promise.reject(a)}},"decrypt"),t=new Jh.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(qg,"xc20pDirDecrypter");function q7(r,e){let t=o(function(f,u={},m){try{Object.assign(u,{alg:void 0});let p=(0,Xh.randomBytes)(32);return Promise.resolve($7(p).encrypt(f,u,m)).then(function(x){return Promise.resolve(n(p)).then(function(k){return Te(ie({},x),{recipient:k,cek:p})})})}catch(p){return Promise.reject(p)}},"encrypt"),n=o(function(f){try{let u=(0,Af.generateKeyPair)(),m=(0,Af.sharedKey)(u.secretKey,r),p=Gg(m,s,i),x=iv(p)(f),k={encrypted_key:sn(x.ciphertext),header:{alg:i,iv:sn(x.iv),tag:sn(x.tag),epk:{kty:"OKP",crv:a,x:sn(u.publicKey)}}};return e&&(k.header.kid=e),Promise.resolve(k)}catch(u){return Promise.reject(u)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,a="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(q7,"x25519Encrypter");function H7(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(H7,"validateHeader");function ov(r){let e=o(function(s,a,f,u){try{let x=function(){let C=Gg(I,n,t),$=Vg(u.encrypted_key,u.header.tag);return Promise.resolve(qg(C).decrypt($,Ar(u.header.iv))).then(function(O){return O===null?null:qg(O).decrypt(s,a,f)})};o(x,"_temp4");var m,p;if(H7((m=u)==null?void 0:m.header),u=u,((p=u.header.epk)==null?void 0:p.crv)!==i||typeof u.header.epk.x=="undefined")return Promise.resolve(null);let k=Ar(u.header.epk.x),I,T=function(){if(r instanceof Uint8Array)I=(0,Af.sharedKey)(r,k);else return Promise.resolve(r(k)).then(function(C){I=C})}();return Promise.resolve(T&&T.then?T.then(x):x(T))}catch(x){return Promise.reject(x)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(ov,"x25519Decrypter");jd();var yu=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),t0=o(function*(r,e){if(r!=null&&!(r instanceof Uint8Array))for(let[t,n]of Object.entries(r)){let i=[...e,t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s],u=Pe.asCID(a);u?yield[f.join("/"),u]:typeof a=="object"&&(yield*t0(a,f))}else{let s=Pe.asCID(n);s?yield[i.join("/"),s]:yield*t0(n,i)}}},"links"),r0=o(function*(r,e){if(r!=null)for(let[t,n]of Object.entries(r)){let i=[...e,t];if(yield i.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!Pe.asCID(n))if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s];yield f.join("/"),typeof a=="object"&&!Pe.asCID(a)&&(yield*r0(a,f))}else yield*r0(n,i)}},"tree"),z7=o((r,e)=>{let t=r;for(let[n,i]of e.entries()){if(t=t[i],t==null)throw new Error(`Object has no property at ${e.slice(0,n+1).map(a=>`[${JSON.stringify(a)}]`).join("")}`);let s=Pe.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),xu=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n=="undefined")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:yu(),bytes:yu(),value:yu(),asBlock:yu()})}links(){return t0(this.value,[])}tree(){return r0(this.value,[])}get(e="/"){return z7(this.value,e.split("/").filter(Boolean))}};o(xu,"Block");var ns=o(n=>Z(void 0,[n],function*({value:r,codec:e,hasher:t}){if(typeof r=="undefined")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let i=e.encode(r),s=yield t.digest(i),a=Pe.create(1,e.code,s);return new xu({value:r,bytes:i,cid:a})}),"encode");Vn();cf();qd();Nd();var Ci={};St(Ci,{code:()=>ga,decode:()=>h0,encode:()=>If,name:()=>MS});var j7=["string","number","bigint","symbol"],K7=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function sv(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(j7.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(V7(r))return"Buffer";let t=W7(r);return t||"Object"}o(sv,"is");function V7(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(V7,"isBuffer");function W7(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(K7.includes(e))return e}o(W7,"getObjectType");var de=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};o(de,"Type");de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);var _e=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};o(_e,"Token");var la=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",G7=new TextDecoder,Y7=new TextEncoder;function wu(r){return la&&globalThis.Buffer.isBuffer(r)}o(wu,"isBuffer");function i0(r){return r instanceof Uint8Array?wu(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(i0,"asU8A");var uv=la?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):fv(r,e,t):(r,e,t)=>t-e>64?G7.decode(r.subarray(e,t)):fv(r,e,t),lv=la?r=>r.length>64?globalThis.Buffer.from(r):av(r):r=>r.length>64?Y7.encode(r):av(r),ri=o(r=>Uint8Array.from(r),"fromArray"),da=la?(r,e,t)=>wu(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),dv=la?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),i0(globalThis.Buffer.concat(r,e))):(r,e)=>{let t=new Uint8Array(e),n=0;for(let i of r)n+i.length>t.length&&(i=i.subarray(0,t.length-n)),t.set(i,n),n+=i.length;return t},hv=la?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function pv(r,e){if(wu(r)&&wu(e))return r.compare(e);for(let t=0;t<r.length;t++)if(r[t]!==e[t])return r[t]<e[t]?-1:1;return 0}o(pv,"compare");function av(r,e=1/0){let t,n=r.length,i=null,s=[];for(let a=0;a<n;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}o(av,"utf8ToBytes");function fv(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,a=i>239?4:i>223?3:i>191?2:1;if(e+a<=t){let f,u,m,p;switch(a){case 1:i<128&&(s=i);break;case 2:f=r[e+1],(f&192)===128&&(p=(i&31)<<6|f&63,p>127&&(s=p));break;case 3:f=r[e+1],u=r[e+2],(f&192)===128&&(u&192)===128&&(p=(i&15)<<12|(f&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:f=r[e+1],u=r[e+2],m=r[e+3],(f&192)===128&&(u&192)===128&&(m&192)===128&&(p=(i&15)<<18|(f&63)<<12|(u&63)<<6|m&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=a}return J7(n)}o(fv,"utf8Slice");var cv=4096;function J7(r){let e=r.length;if(e<=cv)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=cv));return t}o(J7,"decodeCodePointsArray");var X7=256,ha=class{constructor(e=X7){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=t.length-(this.maxCursor-this.cursor)-1;t.set(e,i)}else{if(t){let i=t.length-(this.maxCursor-this.cursor)-1;i<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=hv(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=da(n,0,this.cursor)}else t=dv(this.chunks,this.cursor);return e&&this.reset(),t}};o(ha,"Bl");var Xe="CBOR decode error:",o0="CBOR encode error:",Tf=[];Tf[23]=1;Tf[24]=2;Tf[25]=3;Tf[26]=5;Tf[27]=9;function ki(r,e,t){if(r.length-e<t)throw new Error(`${Xe} not enough data for type`)}o(ki,"assertEnoughData");var Vt=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Pr(r,e,t){ki(r,e,1);let n=r[e];if(t.strict===!0&&n<Vt[0])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Pr,"readUint8");function Nr(r,e,t){ki(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Vt[1])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Nr,"readUint16");function Rr(r,e,t){ki(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Vt[2])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Rr,"readUint32");function Lr(r,e,t){ki(r,e,8);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3],i=r[e+4]*16777216+(r[e+5]<<16)+(r[e+6]<<8)+r[e+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(t.strict===!0&&s<Vt[3])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(t.allowBigInt===!0)return s;throw new Error(`${Xe} integers outside of the safe integer range are not supported`)}o(Lr,"readUint64");function mv(r,e,t,n){return new _e(de.uint,Pr(r,e+1,n),2)}o(mv,"decodeUint8");function bv(r,e,t,n){return new _e(de.uint,Nr(r,e+1,n),3)}o(bv,"decodeUint16");function gv(r,e,t,n){return new _e(de.uint,Rr(r,e+1,n),5)}o(gv,"decodeUint32");function vv(r,e,t,n){return new _e(de.uint,Lr(r,e+1,n),9)}o(vv,"decodeUint64");function an(r,e){return er(r,0,e.value)}o(an,"encodeUint");function er(r,e,t){if(t<Vt[0]){let n=Number(t);r.push([e|n])}else if(t<Vt[1]){let n=Number(t);r.push([e|24,n])}else if(t<Vt[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Vt[3]){let n=Number(t);r.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(t);if(n<Vt[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=a&255,a=a>>8,i[3]=a&255,a=a>>8,i[2]=a&255,a=a>>8,i[1]=a&255,r.push(i)}else throw new Error(`${Xe} encountered BigInt larger than allowable range`)}}o(er,"encodeUintValue");an.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");er.encodedSize=o(function(e){return e<Vt[0]?1:e<Vt[1]?2:e<Vt[2]?3:e<Vt[3]?5:9},"encodedSize");an.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function yv(r,e,t,n){return new _e(de.negint,-1-Pr(r,e+1,n),2)}o(yv,"decodeNegint8");function xv(r,e,t,n){return new _e(de.negint,-1-Nr(r,e+1,n),3)}o(xv,"decodeNegint16");function wv(r,e,t,n){return new _e(de.negint,-1-Rr(r,e+1,n),5)}o(wv,"decodeNegint32");var s0=BigInt(-1),_v=BigInt(1);function Ev(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new _e(de.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Xe} integers outside of the safe integer range are not supported`);return new _e(de.negint,s0-BigInt(i),9)}o(Ev,"decodeNegint64");function _u(r,e){let t=e.value,n=typeof t=="bigint"?t*s0-_v:t*-1-1;er(r,e.type.majorEncoded,n)}o(_u,"encodeNegint");_u.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*s0-_v:t*-1-1;return n<Vt[0]?1:n<Vt[1]?2:n<Vt[2]?3:n<Vt[3]?5:9},"encodedSize");_u.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function kf(r,e,t,n){ki(r,e,t+n);let i=da(r,e+t,e+t+n);return new _e(de.bytes,i,t+n)}o(kf,"toToken");function Sv(r,e,t,n){return kf(r,e,1,t)}o(Sv,"decodeBytesCompact");function Mv(r,e,t,n){return kf(r,e,2,Pr(r,e+1,n))}o(Mv,"decodeBytes8");function Av(r,e,t,n){return kf(r,e,3,Nr(r,e+1,n))}o(Av,"decodeBytes16");function Tv(r,e,t,n){return kf(r,e,5,Rr(r,e+1,n))}o(Tv,"decodeBytes32");function kv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer bytes lengths not supported`);return kf(r,e,9,i)}o(kv,"decodeBytes64");function Eu(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===de.string?lv(r.value):r.value),r.encodedBytes}o(Eu,"tokenBytes");function pa(r,e){let t=Eu(e);er(r,e.type.majorEncoded,t.length),r.push(t)}o(pa,"encodeBytes");pa.encodedSize=o(function(e){let t=Eu(e);return er.encodedSize(t.length)+t.length},"encodedSize");pa.compareTokens=o(function(e,t){return Q7(Eu(e),Eu(t))},"compareTokens");function Q7(r,e){return r.length<e.length?-1:r.length>e.length?1:pv(r,e)}o(Q7,"compareBytes");function Cf(r,e,t,n,i){let s=t+n;ki(r,e,s);let a=new _e(de.string,uv(r,e+t,e+s),s);return i.retainStringBytes===!0&&(a.byteValue=da(r,e+t,e+s)),a}o(Cf,"toToken");function Cv(r,e,t,n){return Cf(r,e,1,t,n)}o(Cv,"decodeStringCompact");function Dv(r,e,t,n){return Cf(r,e,2,Pr(r,e+1,n),n)}o(Dv,"decodeString8");function Ov(r,e,t,n){return Cf(r,e,3,Nr(r,e+1,n),n)}o(Ov,"decodeString16");function Iv(r,e,t,n){return Cf(r,e,5,Rr(r,e+1,n),n)}o(Iv,"decodeString32");function Pv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer string lengths not supported`);return Cf(r,e,9,i,n)}o(Pv,"decodeString64");var Nv=pa;function ma(r,e,t,n){return new _e(de.array,n,t)}o(ma,"toToken");function Rv(r,e,t,n){return ma(r,e,1,t)}o(Rv,"decodeArrayCompact");function Lv(r,e,t,n){return ma(r,e,2,Pr(r,e+1,n))}o(Lv,"decodeArray8");function Bv(r,e,t,n){return ma(r,e,3,Nr(r,e+1,n))}o(Bv,"decodeArray16");function Uv(r,e,t,n){return ma(r,e,5,Rr(r,e+1,n))}o(Uv,"decodeArray32");function Fv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer array lengths not supported`);return ma(r,e,9,i)}o(Fv,"decodeArray64");function $v(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return ma(r,e,1,1/0)}o($v,"decodeArrayIndefinite");function Su(r,e){er(r,de.array.majorEncoded,e.value)}o(Su,"encodeArray");Su.compareTokens=an.compareTokens;Su.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function ba(r,e,t,n){return new _e(de.map,n,t)}o(ba,"toToken");function qv(r,e,t,n){return ba(r,e,1,t)}o(qv,"decodeMapCompact");function Hv(r,e,t,n){return ba(r,e,2,Pr(r,e+1,n))}o(Hv,"decodeMap8");function zv(r,e,t,n){return ba(r,e,3,Nr(r,e+1,n))}o(zv,"decodeMap16");function jv(r,e,t,n){return ba(r,e,5,Rr(r,e+1,n))}o(jv,"decodeMap32");function Kv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer map lengths not supported`);return ba(r,e,9,i)}o(Kv,"decodeMap64");function Vv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return ba(r,e,1,1/0)}o(Vv,"decodeMapIndefinite");function Mu(r,e){er(r,de.map.majorEncoded,e.value)}o(Mu,"encodeMap");Mu.compareTokens=an.compareTokens;Mu.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function Wv(r,e,t,n){return new _e(de.tag,t,1)}o(Wv,"decodeTagCompact");function Gv(r,e,t,n){return new _e(de.tag,Pr(r,e+1,n),2)}o(Gv,"decodeTag8");function Yv(r,e,t,n){return new _e(de.tag,Nr(r,e+1,n),3)}o(Yv,"decodeTag16");function Jv(r,e,t,n){return new _e(de.tag,Rr(r,e+1,n),5)}o(Jv,"decodeTag32");function Xv(r,e,t,n){return new _e(de.tag,Lr(r,e+1,n),9)}o(Xv,"decodeTag64");function Au(r,e){er(r,de.tag.majorEncoded,e.value)}o(Au,"encodeTag");Au.compareTokens=an.compareTokens;Au.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");var oS=20,sS=21,aS=22,fS=23;function Zv(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${Xe} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new _e(de.null,null,1):new _e(de.undefined,void 0,1)}o(Zv,"decodeUndefined");function Qv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return new _e(de.break,void 0,1)}o(Qv,"decodeBreak");function a0(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${Xe} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${Xe} Infinity values are not supported`)}return new _e(de.float,r,e)}o(a0,"createToken");function e2(r,e,t,n){return a0(f0(r,e+1),3,n)}o(e2,"decodeFloat16");function t2(r,e,t,n){return a0(c0(r,e+1),5,n)}o(t2,"decodeFloat32");function r2(r,e,t,n){return a0(s2(r,e+1),9,n)}o(r2,"decodeFloat64");function Tu(r,e,t){let n=e.value;if(n===!1)r.push([de.float.majorEncoded|oS]);else if(n===!0)r.push([de.float.majorEncoded|sS]);else if(n===null)r.push([de.float.majorEncoded|aS]);else if(n===void 0)r.push([de.float.majorEncoded|fS]);else{let i,s=!1;(!t||t.float64!==!0)&&(i2(n),i=f0(Mn,1),n===i||Number.isNaN(n)?(Mn[0]=249,r.push(Mn.slice(0,3)),s=!0):(o2(n),i=c0(Mn,1),n===i&&(Mn[0]=250,r.push(Mn.slice(0,5)),s=!0))),s||(cS(n),i=s2(Mn,1),Mn[0]=251,r.push(Mn.slice(0,9)))}}o(Tu,"encodeFloat");Tu.encodedSize=o(function(e,t){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!t||t.float64!==!0){i2(n);let i=f0(Mn,1);if(n===i||Number.isNaN(n))return 3;if(o2(n),i=c0(Mn,1),n===i)return 5}return 9},"encodedSize");var n2=new ArrayBuffer(9),fn=new DataView(n2,1),Mn=new Uint8Array(n2,0);function i2(r){if(r===1/0)fn.setUint16(0,31744,!1);else if(r===-1/0)fn.setUint16(0,64512,!1);else if(Number.isNaN(r))fn.setUint16(0,32256,!1);else{fn.setFloat32(0,r);let e=fn.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)fn.setUint16(0,31744,!1);else if(t===0)fn.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?fn.setUint16(0,0):i<-14?fn.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):fn.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(i2,"encodeFloat16");function f0(r,e){if(r.length-e<2)throw new Error(`${Xe} not enough data for float16`);let t=(r[e]<<8)+r[e+1];if(t===31744)return 1/0;if(t===64512)return-1/0;if(t===32256)return NaN;let n=t>>10&31,i=t&1023,s;return n===0?s=i*bd(2,-24):n!==31?s=(i+1024)*bd(2,n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(f0,"readFloat16");function o2(r){fn.setFloat32(0,r,!1)}o(o2,"encodeFloat32");function c0(r,e){if(r.length-e<4)throw new Error(`${Xe} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(c0,"readFloat32");function cS(r){fn.setFloat64(0,r,!1)}o(cS,"encodeFloat64");function s2(r,e){if(r.length-e<8)throw new Error(`${Xe} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(s2,"readFloat64");Tu.compareTokens=an.compareTokens;function ct(r,e,t){throw new Error(`${Xe} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(ct,"invalidMinor");function ku(r){return()=>{throw new Error(`${Xe} ${r}`)}}o(ku,"errorer");var ye=[];for(let r=0;r<=23;r++)ye[r]=ct;ye[24]=mv;ye[25]=bv;ye[26]=gv;ye[27]=vv;ye[28]=ct;ye[29]=ct;ye[30]=ct;ye[31]=ct;for(let r=32;r<=55;r++)ye[r]=ct;ye[56]=yv;ye[57]=xv;ye[58]=wv;ye[59]=Ev;ye[60]=ct;ye[61]=ct;ye[62]=ct;ye[63]=ct;for(let r=64;r<=87;r++)ye[r]=Sv;ye[88]=Mv;ye[89]=Av;ye[90]=Tv;ye[91]=kv;ye[92]=ct;ye[93]=ct;ye[94]=ct;ye[95]=ku("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)ye[r]=Cv;ye[120]=Dv;ye[121]=Ov;ye[122]=Iv;ye[123]=Pv;ye[124]=ct;ye[125]=ct;ye[126]=ct;ye[127]=ku("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)ye[r]=Rv;ye[152]=Lv;ye[153]=Bv;ye[154]=Uv;ye[155]=Fv;ye[156]=ct;ye[157]=ct;ye[158]=ct;ye[159]=$v;for(let r=160;r<=183;r++)ye[r]=qv;ye[184]=Hv;ye[185]=zv;ye[186]=jv;ye[187]=Kv;ye[188]=ct;ye[189]=ct;ye[190]=ct;ye[191]=Vv;for(let r=192;r<=215;r++)ye[r]=Wv;ye[216]=Gv;ye[217]=Yv;ye[218]=Jv;ye[219]=Xv;ye[220]=ct;ye[221]=ct;ye[222]=ct;ye[223]=ct;for(let r=224;r<=243;r++)ye[r]=ku("simple values are not supported");ye[244]=ct;ye[245]=ct;ye[246]=ct;ye[247]=Zv;ye[248]=ku("simple values are not supported");ye[249]=e2;ye[250]=t2;ye[251]=r2;ye[252]=ct;ye[253]=ct;ye[254]=ct;ye[255]=Qv;var An=[];for(let r=0;r<24;r++)An[r]=new _e(de.uint,r,1);for(let r=-1;r>=-24;r--)An[31-r]=new _e(de.negint,r,1);An[64]=new _e(de.bytes,new Uint8Array(0),1);An[96]=new _e(de.string,"",1);An[128]=new _e(de.array,0,1);An[160]=new _e(de.map,0,1);An[244]=new _e(de.false,!1,1);An[245]=new _e(de.true,!0,1);An[246]=new _e(de.null,null,1);function a2(r){switch(r.type){case de.false:return ri([244]);case de.true:return ri([245]);case de.null:return ri([246]);case de.bytes:return r.value.length?void 0:ri([64]);case de.string:return r.value===""?ri([96]):void 0;case de.array:return r.value===0?ri([128]):void 0;case de.map:return r.value===0?ri([160]):void 0;case de.uint:return r.value<24?ri([Number(r.value)]):void 0;case de.negint:if(r.value>=-24)return ri([31-Number(r.value)])}}o(a2,"quickEncodeToken");var lS={float64:!1,mapSorter:pS,quickEncodeToken:a2};function dS(){let r=[];return r[de.uint.major]=an,r[de.negint.major]=_u,r[de.bytes.major]=pa,r[de.string.major]=Nv,r[de.array.major]=Su,r[de.map.major]=Mu,r[de.tag.major]=Au,r[de.float.major]=Tu,r}o(dS,"makeCborEncoders");var f2=dS(),u0=new ha,os=class{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error(`${o0} object contains circular references`);return new os(t,e)}};o(os,"Ref");var ao={null:new _e(de.null,null),undefined:new _e(de.undefined,void 0),true:new _e(de.true,!0),false:new _e(de.false,!1),emptyArray:new _e(de.array,0),emptyMap:new _e(de.map,0)},fo={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new _e(de.float,r):r>=0?new _e(de.uint,r):new _e(de.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new _e(de.uint,r):new _e(de.negint,r)},Uint8Array(r,e,t,n){return new _e(de.bytes,r)},string(r,e,t,n){return new _e(de.string,r)},boolean(r,e,t,n){return r?ao.true:ao.false},null(r,e,t,n){return ao.null},undefined(r,e,t,n){return ao.undefined},ArrayBuffer(r,e,t,n){return new _e(de.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new _e(de.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[ao.emptyArray,new _e(de.break)]:ao.emptyArray;n=os.createCheck(n,r);let i=[],s=0;for(let a of r)i[s++]=Cu(a,t,n);return t.addBreakTokens?[new _e(de.array,r.length),i,new _e(de.break)]:[new _e(de.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),a=i?r.size:s.length;if(!a)return t.addBreakTokens===!0?[ao.emptyMap,new _e(de.break)]:ao.emptyMap;n=os.createCheck(n,r);let f=[],u=0;for(let m of s)f[u++]=[Cu(m,t,n),Cu(i?r.get(m):r[m],t,n)];return hS(f,t),t.addBreakTokens?[new _e(de.map,a),f,new _e(de.break)]:[new _e(de.map,a),f]}};fo.Map=fo.Object;fo.Buffer=fo.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))fo[`${r}Array`]=fo.DataView;function Cu(r,e={},t){let n=sv(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||fo[n];if(typeof i=="function"){let a=i(r,n,e,t);if(a!=null)return a}let s=fo[n];if(!s)throw new Error(`${o0} unsupported type: ${n}`);return s(r,n,e,t)}o(Cu,"objectToTokens");function hS(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(hS,"sortMapEntries");function pS(r,e){let t=Array.isArray(r[0])?r[0][0]:r[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(t.type!==n.type)return t.type.compare(n.type);let i=t.type.major,s=f2[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(pS,"mapSorter");function c2(r,e,t,n){if(Array.isArray(e))for(let i of e)c2(r,i,t,n);else t[e.type.major](r,e,n)}o(c2,"tokensToEncoded");function mS(r,e,t){let n=Cu(r,t);if(!Array.isArray(n)&&t.quickEncodeToken){let i=t.quickEncodeToken(n);if(i)return i;let s=e[n.type.major];if(s.encodedSize){let a=s.encodedSize(n,t),f=new ha(a);if(s(f,n,t),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return i0(f.chunks[0])}}return u0.reset(),c2(u0,n,e,t),u0.toBytes(!0)}o(mS,"encodeCustom");function l0(r,e){return e=Object.assign({},lS,e),mS(r,f2,e)}o(l0,"encode");var bS={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Du=class{constructor(e,t={}){this.pos=0,this.data=e,this.options=t}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],t=An[e];if(t===void 0){let n=ye[e];if(!n)throw new Error(`${Xe} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;t=n(this.data,this.pos,i,this.options)}return this.pos+=t.encodedLength,t}};o(Du,"Tokeniser");var Df=Symbol.for("DONE"),Ou=Symbol.for("BREAK");function gS(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=Of(e,t);if(s===Ou){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed array`)}if(s===Df)throw new Error(`${Xe} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(gS,"tokenToArray");function vS(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let a=0;a<r.value;a++){let f=Of(e,t);if(f===Ou){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed map`)}if(f===Df)throw new Error(`${Xe} found map but not enough entries (got ${a} [no key], expected ${r.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${Xe} non-string keys not supported (got ${typeof f})`);let u=Of(e,t);if(u===Df)throw new Error(`${Xe} found map but not enough entries (got ${a} [no value], expected ${r.value})`);n?s.set(f,u):i[f]=u}return n?s:i}o(vS,"tokenToMap");function Of(r,e){if(r.done())return Df;let t=r.next();if(t.type===de.break)return Ou;if(t.type.terminal)return t.value;if(t.type===de.array)return gS(t,r,e);if(t.type===de.map)return vS(t,r,e);if(t.type===de.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=Of(r,e);return e.tags[t.value](n)}throw new Error(`${Xe} tag not supported (${t.value})`)}throw new Error("unsupported")}o(Of,"tokensToObject");function d0(r,e){if(!(r instanceof Uint8Array))throw new Error(`${Xe} data to decode must be a Uint8Array`);e=Object.assign({},bS,e);let t=e.tokenizer||new Du(r,e),n=Of(t,e);if(n===Df)throw new Error(`${Xe} did not find any content to decode`);if(n===Ou)throw new Error(`${Xe} got unexpected break`);if(!t.done())throw new Error(`${Xe} too many terminals, data makes no sense`);return n}o(d0,"decode");Vn();var u2=42;function xS(r){if(r.asCID!==r)return null;let e=Pe.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new _e(de.tag,u2),new _e(de.bytes,t)]}o(xS,"cidEncoder");function wS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(wS,"undefinedEncoder");function _S(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}o(_S,"numberEncoder");var ES={float64:!0,typeEncoders:{Object:xS,undefined:wS,number:_S}};function SS(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Pe.decode(r.subarray(1))}o(SS,"cidDecoder");var l2={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};l2.tags[u2]=SS;var MS="dag-cbor",ga=113,If=o(r=>l0(r,ES),"encode"),h0=o(r=>d0(r,l2),"decode");var AS=24;function d2(r){return Z(this,null,function*(){let e=yield ns({value:r,codec:Ci,hasher:jo});return{cid:e.cid,linkedBlock:e.bytes}})}o(d2,"encodePayload");function TS(r,e=AS){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(TS,"pad");function kS(r){return Z(this,null,function*(){return(yield ns({value:r,codec:Ci,hasher:Uc})).cid})}o(kS,"encodeIdentityCID");function CS(r){if(r=Pe.asCID(r),r.code!==ga)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==Uc.code)throw new Error("CID must use identity multihash");return h0(r.multihash.digest)}o(CS,"decodeIdentityCID");function h2(r,e){return Z(this,null,function*(){return TS((yield kS(r)).bytes,e)})}o(h2,"prepareCleartext");function p2(r){return CS(Pe.decodeFirst(r)[0])}o(p2,"decodeCleartext");var m2=Symbol("abortable"),Iu=Symbol("aborted");function b2(r,e){if(e.aborted)return Promise.reject(Iu);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Iu)}),Promise.race([r,n])}o(b2,"abortable");var g2=o((r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""),"nanoid");var Pu="utils_abort_request";var yr;(function(r){r[r.PARSE_ERROR=-32700]="PARSE_ERROR",r[r.INVALID_REQUEST=-32600]="INVALID_REQUEST",r[r.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",r[r.INVALID_PARAMS=-32602]="INVALID_PARAMS",r[r.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(yr||(yr={}));var v2={[yr.PARSE_ERROR]:"Parse error",[yr.INVALID_REQUEST]:"Invalid request",[yr.METHOD_NOT_FOUND]:"Method not found",[yr.INVALID_PARAMS]:"Invalid params",[yr.INTERNAL_ERROR]:"Internal error"};function DS(r){return-32e3>=r&&r>=-32099}o(DS,"isServerError");function Nu(r){var e;return(e=v2[r.toString()])!=null?e:DS(r)?"Server error":"Application error"}o(Nu,"getErrorMessage");var Tr=class extends Error{static fromObject(e){return new Tr(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,t,n){super(),Object.setPrototypeOf(this,Tr.prototype),this.code=e,this.data=n,this.message=t!=null?t:Nu(e)}};o(Tr,"RPCError");function Pf(r){let e=v2[r];return o(function(n){return new Tr(r,e,n)},"createError")}o(Pf,"createErrorFactory");var OS=Pf(yr.PARSE_ERROR),hL=Pf(yr.INVALID_REQUEST),pL=Pf(yr.METHOD_NOT_FOUND),mL=Pf(yr.INVALID_PARAMS),bL=Pf(yr.INTERNAL_ERROR);function IS(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(IS,"_checkPrivateRedeclaration");function PS(r,e){return e.get?e.get.call(r):e.value}o(PS,"_classApplyDescriptorGet");function NS(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(NS,"_classApplyDescriptorSet");function y2(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(y2,"_classExtractFieldDescriptor");function p0(r,e){var t=y2(r,e,"get");return PS(r,t)}o(p0,"_classPrivateFieldGet");function RS(r,e,t){IS(r,e),e.set(r,t)}o(RS,"_classPrivateFieldInit");function LS(r,e,t){var n=y2(r,e,"set");return NS(r,n,t),t}o(LS,"_classPrivateFieldSet");var Nf=new WeakMap,va=class{get connection(){return p0(this,Nf)}createID(){return g2()}request(e,t=void 0,n={}){let{signal:i}=n;if(i!=null&&i.aborted)return Promise.reject(Iu);let s=this.createID(),a=p0(this,Nf).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(f=>{if(f==null)throw new Error("Missing response");if(f.error!=null)throw Tr.fromObject(f.error);return f.result});return i==null?a:(i.addEventListener("abort",()=>{this.notify(Pu,{id:s})}),b2(a,i))}notify(e,t=void 0){return Z(this,null,function*(){yield p0(this,Nf).send({jsonrpc:"2.0",method:e,params:t})})}constructor(e){RS(this,Nf,{writable:!0,value:void 0}),LS(this,Nf,e)}};o(va,"RPCClient");function x2(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:Nu(e)}}}o(x2,"createErrorResponse");function BS(r,e,t){console.warn("Unhandled handler error",e,t)}o(BS,"fallbackOnHandlerError");function US(r,e){console.warn("Unhandled invalid message",e)}o(US,"fallbackOnInvalidMessage");function FS(r,e){console.warn("Unhandled notification",e)}o(FS,"fallbackOnNotification");function w2(r,e={}){var f,u,m;let t=(f=e.onHandlerError)!=null?f:BS,n=(u=e.onInvalidMessage)!=null?u:US,i=(m=e.onNotification)!=null?m:FS,s={};function a(p,x){var k,I;if(x.method===Pu){let T=(k=x.params)==null?void 0:k.id;T!=null&&((I=s[T])==null||I.abort())}else i(p,x)}return o(a,"handleNotification"),o(function(x,k){return Z(this,null,function*(){var C,$,O;let I=k.id;if(k.jsonrpc!=="2.0"||k.method==null)return I==null?(n(x,k),null):x2(I,yr.INVALID_REQUEST);let T=r[k.method];if(T==null)return I==null?(a(x,k),null):x2(I,yr.METHOD_NOT_FOUND);try{let U;if(I!=null&&T[m2]){let H=new AbortController;s[I]=H,U=T(x,k.params,{signal:H.signal})}else U=T(x,k.params,{});let j=U==null?U:typeof U.then=="function"?yield U:U;return I==null||((C=s[I])==null?void 0:C.signal.aborted)?null:{jsonrpc:"2.0",id:I,result:j}}catch(U){if(I==null||(($=s[I])==null?void 0:$.signal.aborted))return t(x,k,U),null;let j;if(U instanceof Tr)j=U.toObject();else{t(x,k,U);let H=(O=U.code)!=null?O:-32e3;j={code:H,message:U.message||Nu(H)}}return{jsonrpc:"2.0",id:I,error:j}}finally{I!=null&&delete s[I]}})},"handleRequest")}o(w2,"createHandler");Vn();var Xy=at(dy(),1),dr=at(fs(),1);function E0(){return E0=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},E0.apply(this,arguments)}o(E0,"_extends");var S0={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},iM={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},M0={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},oM={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:S0,1:M0}}},sM={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:S0,1:M0,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},Ff={2:S0,10:iM,19:{assetName:M0,assetType:oM,assetId:sM}};function hy(r,e){return r.split(e.parameters.delimiter)}o(hy,"splitParams");function $f(r,e){var t=hy(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o($f,"getParams");function Ea(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Ea(n,t)}).join(e.parameters.delimiter)}o(Ea,"joinParams");function qf(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=hy(r,e);if(t.length!==Object.keys(e.parameters.values).length)return!1;var n=t.map(function(i,s){return new RegExp(e.parameters.values[s].regex).test(i)}).filter(function(i){return!!i});return n.length===t.length}o(qf,"isValidId");var ho=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"ChainId"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();ho.spec=Ff[2];var cs=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=$f(n,this.spec),s=i.namespace,a=i.reference,f=i.address,u=new ho({namespace:s,reference:a});return new r({chainId:u,address:f}).toJSON()},"parse"),r.format=o(function(n){var i=new ho(n.chainId),s=E0({},i.toJSON(),{address:n.address});return Ea(s,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),r}();cs.spec=Ff[10];var A0=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"AssetName"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();A0.spec=Ff[19].assetName;var aM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new A0(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),r}();aM.spec=Ff[19].assetType;var fM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new A0(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!qf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r($f(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),r}();fM.spec=Ff[19].assetId;var py="logger/5.6.0";var my=!1,by=!1,$u={debug:1,default:2,info:2,warning:3,error:4,off:5},gy=$u.default,T0=null;function cM(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch(t){r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}o(cM,"_checkNormalize");var vy=cM(),k0;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(k0||(k0={}));var kn;(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"})(kn||(kn={}));var yy="0123456789abcdef",tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();$u[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(gy>$u[n])&&console.log.apply(console,t)}debug(...e){this._log(tt.levels.DEBUG,e)}info(...e){this._log(tt.levels.INFO,e)}warn(...e){this._log(tt.levels.WARNING,e)}makeError(e,t,n){if(by)return this.makeError("censored error",t,{});t||(t=tt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(u=>{let m=n[u];try{if(m instanceof Uint8Array){let p="";for(let x=0;x<m.length;x++)p+=yy[m[x]>>4],p+=yy[m[x]&15];i.push(u+"=Uint8Array(0x"+p+")")}else i.push(u+"="+JSON.stringify(m))}catch(p){i.push(u+"="+JSON.stringify(n[u].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let s=e,a="";switch(t){case kn.NUMERIC_FAULT:{a="NUMERIC_FAULT";let u=e;switch(u){case"overflow":case"underflow":case"division-by-zero":a+="-"+u;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case kn.CALL_EXCEPTION:case kn.INSUFFICIENT_FUNDS:case kn.MISSING_NEW:case kn.NONCE_EXPIRED:case kn.REPLACEMENT_UNDERPRICED:case kn.TRANSACTION_REPLACED:case kn.UNPREDICTABLE_GAS_LIMIT:a=t;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let f=new Error(e);return f.reason=s,f.code=t,Object.keys(n).forEach(function(u){f[u]=n[u]}),f}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,tt.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,i){e||this.throwError(t,n,i)}assertArgument(e,t,n,i){e||this.throwArgumentError(t,n,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),vy&&this.throwError("platform missing String.prototype.normalize",tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:vy})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n?n=": "+n:n="",e<t&&this.throwError("missing argument"+n,tt.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,tt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",tt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return T0||(T0=new tt(py)),T0}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),my){if(!e)return;this.globalLogger().throwError("error censorship permanent",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}by=!!e,my=!!t}static setLogLevel(e){let t=$u[e.toLowerCase()];if(t==null){tt.globalLogger().warn("invalid log level - "+e);return}gy=t}static from(e){return new tt(e)}};o(tt,"Logger");tt.errors=kn;tt.levels=k0;var xy="bytes/5.6.1";var Bt=new tt(xy);function _y(r){return!!r.toHexString}o(_y,"isHexable");function Sa(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Sa(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Sa,"addSlice");function Ey(r){return Cn(r)&&!(r.length%2)||D0(r)}o(Ey,"isBytesLike");function wy(r){return typeof r=="number"&&r==r&&r%1===0}o(wy,"isInteger");function D0(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!wy(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!wy(t)||t<0||t>=256)return!1}return!0}o(D0,"isBytes");function Tt(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid arrayify value");let t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),Sa(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),_y(r)&&(r=r.toHexString()),Cn(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":Bt.throwArgumentError("hex data is odd-length","value",r));let n=[];for(let i=0;i<t.length;i+=2)n.push(parseInt(t.substring(i,i+2),16));return Sa(new Uint8Array(n))}return D0(r)?Sa(new Uint8Array(r)):Bt.throwArgumentError("invalid arrayify value","value",r)}o(Tt,"arrayify");function O0(r){let e=r.map(i=>Tt(i)),t=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(t);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Sa(n)}o(O0,"concat");function uM(r,e){r=Tt(r),r.length>e&&Bt.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Sa(t)}o(uM,"zeroPad");function Cn(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Cn,"isHexString");var C0="0123456789abcdef";function ur(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=C0[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"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),_y(r))return r.toHexString();if(Cn(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":Bt.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(D0(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=C0[(i&240)>>4]+C0[i&15]}return t}return Bt.throwArgumentError("invalid hexlify value","value",r)}o(ur,"hexlify");function qu(r){if(typeof r!="string")r=ur(r);else if(!Cn(r)||r.length%2)return null;return(r.length-2)/2}o(qu,"hexDataLength");function Hu(r,e,t){return typeof r!="string"?r=ur(r):(!Cn(r)||r.length%2)&&Bt.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(Hu,"hexDataSlice");function po(r,e){for(typeof r!="string"?r=ur(r):Cn(r)||Bt.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&Bt.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(po,"hexZeroPad");function zu(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ey(r)){let t=Tt(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=ur(t.slice(0,32)),e.s=ur(t.slice(32,64))):t.length===65?(e.r=ur(t.slice(0,32)),e.s=ur(t.slice(32,64)),e.v=t[64]):Bt.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:Bt.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=ur(t.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){let i=uM(Tt(e._vs),32);e._vs=ur(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Bt.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let a=ur(i);e.s==null?e.s=a:e.s!==a&&Bt.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?Bt.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Bt.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Cn(e.r)?Bt.throwArgumentError("signature missing or invalid r","signature",r):e.r=po(e.r,32),e.s==null||!Cn(e.s)?Bt.throwArgumentError("signature missing or invalid s","signature",r):e.s=po(e.s,32);let t=Tt(e.s);t[0]>=128&&Bt.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=ur(t);e._vs&&(Cn(e._vs)||Bt.throwArgumentError("signature invalid _vs","signature",r),e._vs=po(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Bt.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(zu,"splitSignature");var Ay=at(P0());var My="bignumber/5.6.2";var lM=Ay.default.BN,fB=new tt(My);function N0(r){return new lM(r,36).toString(16)}o(N0,"_base36To16");var Ty=at(Qd());function Ma(r){return"0x"+Ty.default.keccak_256(Tt(r))}o(Ma,"keccak256");var ky="address/5.6.1";var Hf=new tt(ky);function Cy(r){Cn(r,20)||Hf.throwArgumentError("invalid address","address",r),r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);let n=Tt(Ma(t));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}o(Cy,"getChecksumAddress");var pM=9007199254740991;function mM(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(mM,"log10");var R0={};for(let r=0;r<10;r++)R0[String(r)]=String(r);for(let r=0;r<26;r++)R0[String.fromCharCode(65+r)]=String(10+r);var Dy=Math.floor(mM(pM));function bM(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>R0[n]).join("");for(;e.length>=Dy;){let n=e.substring(0,Dy);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}o(bM,"ibanChecksum");function Oy(r){let e=null;if(typeof r!="string"&&Hf.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=Cy(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&Hf.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)!==bM(r)&&Hf.throwArgumentError("bad icap checksum","address",r),e=N0(r.substring(4));e.length<40;)e="0"+e;e=Cy("0x"+e)}else Hf.throwArgumentError("invalid address","address",r);return e}o(Oy,"getAddress");var Iy="properties/5.6.0";var MB=new tt(Iy);function Aa(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Aa,"defineReadOnly");var Py="strings/5.6.1";var Ny=new tt(Py),zf;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(zf||(zf={}));var us;(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"})(us||(us={}));function gM(r,e,t,n,i){return Ny.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(gM,"errorFunc");function Ry(r,e,t,n,i){if(r===us.BAD_PREFIX||r===us.UNEXPECTED_CONTINUE){let s=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)s++;return s}return r===us.OVERRUN?t.length-e-1:0}o(Ry,"ignoreFunc");function vM(r,e,t,n,i){return r===us.OVERLONG?(n.push(i),0):(n.push(65533),Ry(r,e,t,n,i))}o(vM,"replaceFunc");var yM=Object.freeze({error:gM,ignore:Ry,replace:vM});function jf(r,e=zf.current){e!=zf.current&&(Ny.checkNormalize(),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){n++;let s=r.charCodeAt(n);if(n>=r.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");let a=65536+((i&1023)<<10)+(s&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return Tt(t)}o(jf,"toUtf8Bytes");var Ly=`Ethereum Signed Message:
633
+ `;function L0(r){return typeof r=="string"&&(r=jf(r)),Ma(O0([jf(Ly),jf(String(r.length)),r]))}o(L0,"hashMessage");var Qe=at(P0()),oi=at(gf());function Ta(r,e,t){return t={path:e,exports:{},require:function(n,i){return xM(n,i==null?t.path:i)}},r(t,t.exports),t.exports}o(Ta,"createCommonjsModule");function xM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(xM,"commonjsRequire");var $0=Uy;function Uy(r,e){if(!r)throw new Error(e||"Assertion failed")}o(Uy,"assert");Uy.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Dn=Ta(function(r,e){"use strict";var t=e;function n(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var u=[];if(typeof a!="string"){for(var m=0;m<a.length;m++)u[m]=a[m]|0;return u}if(f==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var m=0;m<a.length;m+=2)u.push(parseInt(a[m]+a[m+1],16))}else for(var m=0;m<a.length;m++){var p=a.charCodeAt(m),x=p>>8,k=p&255;x?u.push(x,k):u.push(k)}return u}o(n,"toArray"),t.toArray=n;function i(a){return a.length===1?"0"+a:a}o(i,"zero2"),t.zero2=i;function s(a){for(var f="",u=0;u<a.length;u++)f+=i(a[u].toString(16));return f}o(s,"toHex"),t.toHex=s,t.encode=o(function(f,u){return u==="hex"?s(f):f},"encode")}),Ur=Ta(function(r,e){"use strict";var t=e;t.assert=$0,t.toArray=Dn.toArray,t.zero2=Dn.zero2,t.toHex=Dn.toHex,t.encode=Dn.encode;function n(u,m,p){var x=new Array(Math.max(u.bitLength(),p)+1);x.fill(0);for(var k=1<<m+1,I=u.clone(),T=0;T<x.length;T++){var C,$=I.andln(k-1);I.isOdd()?($>(k>>1)-1?C=(k>>1)-$:C=$,I.isubn(C)):C=0,x[T]=C,I.iushrn(1)}return x}o(n,"getNAF"),t.getNAF=n;function i(u,m){var p=[[],[]];u=u.clone(),m=m.clone();for(var x=0,k=0,I;u.cmpn(-x)>0||m.cmpn(-k)>0;){var T=u.andln(3)+x&3,C=m.andln(3)+k&3;T===3&&(T=-1),C===3&&(C=-1);var $;(T&1)===0?$=0:(I=u.andln(7)+x&7,(I===3||I===5)&&C===2?$=-T:$=T),p[0].push($);var O;(C&1)===0?O=0:(I=m.andln(7)+k&7,(I===3||I===5)&&T===2?O=-C:O=C),p[1].push(O),2*x===$+1&&(x=1-x),2*k===O+1&&(k=1-k),u.iushrn(1),m.iushrn(1)}return p}o(i,"getJSF"),t.getJSF=i;function s(u,m,p){var x="_"+m;u.prototype[m]=o(function(){return this[x]!==void 0?this[x]:this[x]=p.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function a(u){return typeof u=="string"?t.toArray(u,"hex"):u}o(a,"parseBytes"),t.parseBytes=a;function f(u){return new Qe.default(u,"hex","le")}o(f,"intFromLE"),t.intFromLE=f}),Vu=Ur.getNAF,wM=Ur.getJSF,Wu=Ur.assert;function bo(r,e){this.type=r,this.p=new Qe.default(e.p,16),this.red=e.prime?Qe.default.red(e.prime):Qe.default.mont(this.p),this.zero=new Qe.default(0).toRed(this.red),this.one=new Qe.default(1).toRed(this.red),this.two=new Qe.default(2).toRed(this.red),this.n=e.n&&new Qe.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(bo,"BaseCurve");var ls=bo;bo.prototype.point=o(function(){throw new Error("Not implemented")},"point");bo.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");bo.prototype._fixedNafMul=o(function(e,t){Wu(e.precomputed);var n=e._getDoubles(),i=Vu(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var m=f+n.step-1;m>=f;m--)u=(u<<1)+i[m];a.push(u)}for(var p=this.jpoint(null,null,null),x=this.jpoint(null,null,null),k=s;k>0;k--){for(f=0;f<a.length;f++)u=a[f],u===k?x=x.mixedAdd(n.points[f]):u===-k&&(x=x.mixedAdd(n.points[f].neg()));p=p.add(x)}return p.toP()},"_fixedNafMul");bo.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Vu(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var m=0;u>=0&&a[u]===0;u--)m++;if(u>=0&&m++,f=f.dblp(m),u<0)break;var p=a[u];Wu(p!==0),e.type==="affine"?p>0?f=f.mixedAdd(s[p-1>>1]):f=f.mixedAdd(s[-p-1>>1].neg()):p>0?f=f.add(s[p-1>>1]):f=f.add(s[-p-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");bo.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,m=0,p,x,k;for(p=0;p<i;p++){k=t[p];var I=k._getNAFPoints(e);a[p]=I.wnd,f[p]=I.points}for(p=i-1;p>=1;p-=2){var T=p-1,C=p;if(a[T]!==1||a[C]!==1){u[T]=Vu(n[T],a[T],this._bitLength),u[C]=Vu(n[C],a[C],this._bitLength),m=Math.max(u[T].length,m),m=Math.max(u[C].length,m);continue}var $=[t[T],null,null,t[C]];t[T].y.cmp(t[C].y)===0?($[1]=t[T].add(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg())):t[T].y.cmp(t[C].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].add(t[C].neg())):($[1]=t[T].toJ().mixedAdd(t[C]),$[2]=t[T].toJ().mixedAdd(t[C].neg()));var O=[-3,-1,-5,-7,0,7,5,1,3],U=wM(n[T],n[C]);for(m=Math.max(U[0].length,m),u[T]=new Array(m),u[C]=new Array(m),x=0;x<m;x++){var j=U[0][x]|0,H=U[1][x]|0;u[T][x]=O[(j+1)*3+(H+1)],u[C][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),B=this._wnafT4;for(p=m;p>=0;p--){for(var L=0;p>=0;){var F=!0;for(x=0;x<i;x++)B[x]=u[x][p]|0,B[x]!==0&&(F=!1);if(!F)break;L++,p--}if(p>=0&&L++,X=X.dblp(L),p<0)break;for(x=0;x<i;x++){var re=B[x];re!==0&&(re>0?k=f[x][re-1>>1]:re<0&&(k=f[x][-re-1>>1].neg()),k.type==="affine"?X=X.mixedAdd(k):X=X.add(k))}}for(p=0;p<i;p++)f[p]=null;return s?X:X.toP()},"_wnafMulAdd");function ln(r,e){this.curve=r,this.type=e,this.precomputed=null}o(ln,"BasePoint");bo.BasePoint=ln;ln.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");ln.prototype.validate=o(function(){return this.curve.validate(this)},"validate");bo.prototype.decodePoint=o(function(e,t){e=Ur.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Wu(e[e.length-1]%2===0):e[0]===7&&Wu(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");ln.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");ln.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");ln.prototype.encode=o(function(e,t){return Ur.encode(this._encode(t),e)},"encode");ln.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");ln.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");ln.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");ln.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");ln.prototype._getBeta=o(function(){return null},"_getBeta");ln.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var q0=Ta(function(r){typeof Object.create=="function"?r.exports=o(function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):r.exports=o(function(t,n){if(n){t.super_=n;var i=o(function(){},"TempCtor");i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t}},"inherits")}),_M=Ur.assert;function dn(r){ls.call(this,"short",r),this.a=new Qe.default(r.a,16).toRed(this.red),this.b=new Qe.default(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(dn,"ShortCurve");q0(dn,ls);var EM=dn;dn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new Qe.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new Qe.default(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],_M(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new Qe.default(f.a,16),b:new Qe.default(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");dn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:Qe.default.mont(e),n=new Qe.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new Qe.default(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");dn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new Qe.default(1),a=new Qe.default(0),f=new Qe.default(0),u=new Qe.default(1),m,p,x,k,I,T,C,$=0,O,U;n.cmpn(0)!==0;){var j=i.div(n);O=i.sub(j.mul(n)),U=f.sub(j.mul(s));var H=u.sub(j.mul(a));if(!x&&O.cmp(t)<0)m=C.neg(),p=s,x=O.neg(),k=U;else if(x&&++$===2)break;C=O,i=n,n=O,f=s,s=U,u=a,a=H}I=O.neg(),T=U;var X=x.sqr().add(k.sqr()),B=I.sqr().add(T.sqr());return B.cmp(X)>=0&&(I=m,T=p),x.negative&&(x=x.neg(),k=k.neg()),I.negative&&(I=I.neg(),T=T.neg()),[{a:x,b:k},{a:I,b:T}]},"_getEndoBasis");dn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),m=s.mul(n.b),p=a.mul(i.b),x=e.sub(f).sub(u),k=m.add(p).neg();return{k1:x,k2:k}},"_endoSplit");dn.prototype.pointFromX=o(function(e,t){e=new Qe.default(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");dn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");dn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],m=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),m=m.neg(!0)),i[a*2]=u,i[a*2+1]=m,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var p=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return p},"_endoWnafMulAdd");function Gt(r,e,t,n){ls.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(Gt,"Point");q0(Gt,ls.BasePoint);dn.prototype.point=o(function(e,t,n){return new Gt(this,e,t,n)},"point");dn.prototype.pointFromJSON=o(function(e,t){return Gt.fromJSON(this,e,t)},"pointFromJSON");Gt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");Gt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");Gt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");Gt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");Gt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Gt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");Gt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");Gt.prototype.getX=o(function(){return this.x.fromRed()},"getX");Gt.prototype.getY=o(function(){return this.y.fromRed()},"getY");Gt.prototype.mul=o(function(e){return e=new Qe.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");Gt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");Gt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");Gt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");Gt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");Gt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function rr(r,e,t,n){ls.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Qe.default(0)):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),this.z=new Qe.default(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(rr,"JPoint");q0(rr,ls.BasePoint);dn.prototype.jpoint=o(function(e,t,n){return new rr(this,e,t,n)},"jpoint");rr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");rr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");rr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),m=a.redSub(f);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),x=p.redMul(u),k=i.redMul(p),I=m.redSqr().redIAdd(x).redISub(k).redISub(k),T=m.redMul(k.redISub(I)).redISub(a.redMul(x)),C=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(I,T,C)},"add");rr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=f.redSqr(),p=m.redMul(f),x=n.redMul(m),k=u.redSqr().redIAdd(p).redISub(x).redISub(x),I=u.redMul(x.redISub(k)).redISub(s.redMul(p)),T=this.z.redMul(f);return this.curve.jpoint(k,I,T)},"mixedAdd");rr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,m=u.redSqr().redSqr(),p=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),k=p.redSqr(),I=k.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(m)),C=a.redMul(k),$=T.redSqr().redISub(C.redAdd(C)),O=C.redISub($),U=T.redMul(O);U=U.redIAdd(U).redISub(I);var j=p.redMul(u);t+1<e&&(m=m.redMul(I)),a=$,u=j,p=U}return this.curve.jpoint(a,p.redMul(s),u)},"dblp");rr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");rr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),m=u.redSqr().redISub(f).redISub(f),p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),e=m,t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),k=this.y.redSqr(),I=k.redSqr(),T=this.x.redAdd(k).redSqr().redISub(x).redISub(I);T=T.redIAdd(T);var C=x.redAdd(x).redIAdd(x),$=C.redSqr(),O=I.redIAdd(I);O=O.redIAdd(O),O=O.redIAdd(O),e=$.redISub(T).redISub(T),t=C.redMul(T.redISub(e)).redISub(O),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");rr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),m=u.redSqr().redISub(f).redISub(f);e=m;var p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),t=u.redMul(f.redISub(m)).redISub(p),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),k=this.y.redSqr(),I=this.x.redMul(k),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var C=I.redIAdd(I);C=C.redIAdd(C);var $=C.redAdd(C);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(k).redISub(x);var O=k.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O),t=T.redMul(C.redISub(e)).redISub(O)}return this.curve.jpoint(e,t,n)},"_threeDbl");rr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),m=t.redAdd(t);m=m.redIAdd(m);var p=m.redMul(f),x=u.redSqr().redISub(p.redAdd(p)),k=p.redISub(x),I=f.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=u.redMul(k).redISub(I),C=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,C)},"_dbl");rr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),m=i.redIAdd(i);m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var p=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(m),x=t.redMul(p);x=x.redIAdd(x),x=x.redIAdd(x);var k=this.x.redMul(u).redISub(x);k=k.redIAdd(k),k=k.redIAdd(k);var I=this.y.redMul(p.redMul(m.redISub(p)).redISub(f.redMul(u)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(k,I,T)},"trpl");rr.prototype.mul=o(function(e,t){return e=new Qe.default(e,t),this.curve._wnafMul(this,e)},"mul");rr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");rr.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");rr.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");rr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var ju=Ta(function(r,e){"use strict";var t=e;t.base=ls,t.short=EM,t.mont=null,t.edwards=null}),Ku=Ta(function(r,e){"use strict";var t=e,n=Ur.assert;function i(f){f.type==="short"?this.curve=new ju.short(f):f.type==="edwards"?this.curve=new ju.edwards(f):this.curve=new ju.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(i,"PresetCurve"),t.PresetCurve=i;function s(f,u){Object.defineProperty(t,f,{configurable:!0,enumerable:!0,get:function(){var m=new i(u);return Object.defineProperty(t,f,{configurable:!0,enumerable:!0,value:m}),m}})}o(s,"defineCurve"),s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:oi.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:oi.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:oi.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:oi.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:oi.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch(f){a=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:oi.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function mo(r){if(!(this instanceof mo))return new mo(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Dn.toArray(r.entropy,r.entropyEnc||"hex"),t=Dn.toArray(r.nonce,r.nonceEnc||"hex"),n=Dn.toArray(r.pers,r.persEnc||"hex");$0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(mo,"HmacDRBG");var Fy=mo;mo.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");mo.prototype._hmac=o(function(){return new oi.default.hmac(this.hash,this.K)},"hmac");mo.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");mo.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Dn.toArray(e,t),n=Dn.toArray(n,i),$0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");mo.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Dn.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Dn.encode(a,t)},"generate");var F0=Ur.assert;function lr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(lr,"KeyPair");var H0=lr;lr.fromPublic=o(function(e,t,n){return t instanceof lr?t:new lr(e,{pub:t,pubEnc:n})},"fromPublic");lr.fromPrivate=o(function(e,t,n){return t instanceof lr?t:new lr(e,{priv:t,privEnc:n})},"fromPrivate");lr.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");lr.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");lr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");lr.prototype._importPrivate=o(function(e,t){this.priv=new Qe.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");lr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?F0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&F0(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");lr.prototype.derive=o(function(e){return e.validate()||F0(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");lr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");lr.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");lr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var SM=Ur.assert;function Gu(r,e){if(r instanceof Gu)return r;this._importDER(r,e)||(SM(r.r&&r.s,"Signature without r or s"),this.r=new Qe.default(r.r,16),this.s=new Qe.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(Gu,"Signature");var Yu=Gu;function MM(){this.place=0}o(MM,"Position");function B0(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(B0,"getLength");function By(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(By,"rmPadding");Gu.prototype._importDER=o(function(e,t){e=Ur.toArray(e,t);var n=new MM;if(e[n.place++]!==48)return!1;var i=B0(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=B0(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=B0(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new Qe.default(a),this.s=new Qe.default(u),this.recoveryParam=null,!0},"_importDER");function U0(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(U0,"constructLength");Gu.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=By(t),n=By(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];U0(i,t.length),i=i.concat(t),i.push(2),U0(i,n.length);var s=i.concat(n),a=[48];return U0(a,s.length),a=a.concat(s),Ur.encode(a,e)},"toDER");var AM=o(function(){throw new Error("unsupported")},"rand"),$y=Ur.assert;function un(r){if(!(this instanceof un))return new un(r);typeof r=="string"&&($y(Object.prototype.hasOwnProperty.call(Ku,r),"Unknown curve "+r),r=Ku[r]),r instanceof Ku.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(un,"EC");var TM=un;un.prototype.keyPair=o(function(e){return new H0(this,e)},"keyPair");un.prototype.keyFromPrivate=o(function(e,t){return H0.fromPrivate(this,e,t)},"keyFromPrivate");un.prototype.keyFromPublic=o(function(e,t){return H0.fromPublic(this,e,t)},"keyFromPublic");un.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Fy({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||AM(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Qe.default(2));;){var s=new Qe.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");un.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");un.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Qe.default(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new Fy({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),m=this.n.sub(new Qe.default(1)),p=0;;p++){var x=i.k?i.k(p):new Qe.default(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(m)>=0)){var k=this.g.mul(x);if(!k.isInfinity()){var I=k.getX(),T=I.umod(this.n);if(T.cmpn(0)!==0){var C=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(C=C.umod(this.n),C.cmpn(0)!==0){var $=(k.getY().isOdd()?1:0)|(I.cmp(T)!==0?2:0);return i.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),$^=1),new Yu({r:T,s:C,recoveryParam:$})}}}}}},"sign");un.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Qe.default(e,16)),n=this.keyFromPublic(n,i),t=new Yu(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),m=f.mul(s).umod(this.n),p;return this.curve._maxwellTrick?(p=this.g.jmulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.eqXToP(s)):(p=this.g.mulAdd(u,n.getPublic(),m),p.isInfinity()?!1:p.getX().umod(this.n).cmp(s)===0)},"verify");un.prototype.recoverPubKey=function(r,e,t,n){$y((3&t)===t,"The recovery param is more than two bits"),e=new Yu(e,n);var i=this.n,s=new Qe.default(r),a=e.r,f=e.s,u=t&1,m=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");m?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var p=e.r.invm(i),x=i.sub(s).mul(p).umod(i),k=f.mul(p).umod(i);return this.g.mulAdd(x,a,k)};un.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Yu(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var kM=Ta(function(r,e){"use strict";var t=e;t.version="6.5.4",t.utils=Ur,t.rand=function(){throw new Error("unsupported")},t.curve=ju,t.curves=Ku,t.ec=TM,t.eddsa=null}),qy=kM.ec;var Hy="signing-key/5.6.2";var j0=new tt(Hy),z0=null;function si(){return z0||(z0=new qy("secp256k1")),z0}o(si,"getCurve");var Ju=class{constructor(e){Aa(this,"curve","secp256k1"),Aa(this,"privateKey",ur(e)),qu(this.privateKey)!==32&&j0.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=si().keyFromPrivate(Tt(this.privateKey));Aa(this,"publicKey","0x"+t.getPublic(!1,"hex")),Aa(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Aa(this,"_isSigningKey",!0)}_addPoint(e){let t=si().keyFromPublic(Tt(this.publicKey)),n=si().keyFromPublic(Tt(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=Tt(e);n.length!==32&&j0.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return zu({recoveryParam:i.recoveryParam,r:po("0x"+i.r.toString(16),32),s:po("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=si().keyFromPublic(Tt(K0(e)));return po("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(Ju,"SigningKey");function zy(r,e){let t=zu(e),n={r:Tt(t.r),s:Tt(t.s)};return"0x"+si().recoverPubKey(Tt(r),n,t.recoveryParam).encode("hex",!1)}o(zy,"recoverPublicKey");function K0(r,e){let t=Tt(r);if(t.length===32){let n=new Ju(t);return e?"0x"+si().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?ur(t):"0x"+si().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+si().keyFromPublic(t).getPublic(!0,"hex"):ur(t)}return j0.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(K0,"computePublicKey");var jy="transactions/5.6.2";var oU=new tt(jy),Ky;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(Ky||(Ky={}));function Vy(r){let e=K0(r);return Oy(Hu(Ma(Hu(e,1)),12))}o(Vy,"computeAddress");function Wy(r,e){return Vy(zy(Tt(r),e))}o(Wy,"recoverAddress");var Gy="wallet/5.6.2";var pU=new tt(Gy);function Yy(r,e){return Wy(L0(r),e)}o(Yy,"verifyMessage");cf();var CM=`
634
634
  sign-in-with-ethereum =
635
635
  domain %s" wants you to sign in with your Ethereum account:" LF
636
636
  address LF
@@ -777,19 +777,19 @@ LF = %x0A
777
777
  DIGIT = %x30-39
778
778
  ; 0-9
779
779
  HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
780
- `,Xu=class{constructor(e){this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0;let t=new Xy.default(MM);if(t.generate(),t.errors.length)throw console.error(t.errorsToAscii()),console.error(t.linesToAscii()),console.log(t.displayAttributeErrors()),new Error("ABNF grammar has errors");let n=t.toObject(),i=new lr.default.parser;i.ast=new lr.default.ast;let s=lr.default.ids,a=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.domain=lr.default.utils.charsToString(X,B,L)),re},"domain");i.ast.callbacks.domain=a;let f=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.address=lr.default.utils.charsToString(X,B,L)),re},"address");i.ast.callbacks.address=f;let u=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.statement=lr.default.utils.charsToString(X,B,L)),re},"statement");i.ast.callbacks.statement=u;let m=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.uri||(F.uri=lr.default.utils.charsToString(X,B,L))),re},"uri");i.ast.callbacks.uri=m;let p=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.version=lr.default.utils.charsToString(X,B,L)),re},"version");i.ast.callbacks.version=p;let x=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.chainId=lr.default.utils.charsToString(X,B,L)),re},"chainId");i.ast.callbacks["chain-id"]=x;let k=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.nonce=lr.default.utils.charsToString(X,B,L)),re},"nonce");i.ast.callbacks.nonce=k;let O=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.issuedAt=lr.default.utils.charsToString(X,B,L)),re},"issuedAt");i.ast.callbacks["issued-at"]=O;let T=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.expirationTime=lr.default.utils.charsToString(X,B,L)),re},"expirationTime");i.ast.callbacks["expiration-time"]=T;let C=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.notBefore=lr.default.utils.charsToString(X,B,L)),re},"notBefore");i.ast.callbacks["not-before"]=C;let $=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.requestId=lr.default.utils.charsToString(X,B,L)),re},"requestId");i.ast.callbacks["request-id"]=$;let I=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.resources=lr.default.utils.charsToString(X,B,L).slice(3).split(`
781
- - `)),re},"resources");i.ast.callbacks.resources=I;let U=i.parse(n,"sign-in-with-ethereum",e);if(!U.success)throw new Error(`Invalid message: ${JSON.stringify(U)}`);let z={};i.ast.translate(z);for(let[H,X]of Object.entries(z))this[H]=X}};o(Xu,"ParsedMessage");var Jy;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(Jy||(Jy={}));var Zu;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(Zu||(Zu={}));var ka=class{constructor(e){if(this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0,this.signature=void 0,this.type=void 0,typeof e=="string"){let t=new Xu(e);this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else Object.assign(this,e)}static fromCacao(e){let t=cs.parse(e.p.iss.replace("did:pkh:","")),n=new ka({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new ho(t.chainId).reference});return e.p.statement&&(n.statement=e.p.statement),e.p.nonce&&(n.nonce=e.p.nonce),e.p.iat&&(n.issuedAt=e.p.iat),e.p.exp&&(n.expirationTime=e.p.exp),e.p.nbf&&(n.notBefore=e.p.nbf),e.p.requestId&&(n.requestId=e.p.requestId),e.p.resources&&(n.resources=e.p.resources),e.s&&(e.s.s&&(n.signature=e.s.s),e.s.t==="eip191"&&(n.type=Zu.PERSONAL_SIGNATURE)),n}toMessage(){let e=`${this.domain} wants you to sign in with your Ethereum account:`,t=`URI: ${this.uri}`,n=[e,this.address].join(`
780
+ `,Xu=class{constructor(e){this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0;let t=new Xy.default(CM);if(t.generate(),t.errors.length)throw console.error(t.errorsToAscii()),console.error(t.linesToAscii()),console.log(t.displayAttributeErrors()),new Error("ABNF grammar has errors");let n=t.toObject(),i=new dr.default.parser;i.ast=new dr.default.ast;let s=dr.default.ids,a=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.domain=dr.default.utils.charsToString(X,B,L)),re},"domain");i.ast.callbacks.domain=a;let f=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.address=dr.default.utils.charsToString(X,B,L)),re},"address");i.ast.callbacks.address=f;let u=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.statement=dr.default.utils.charsToString(X,B,L)),re},"statement");i.ast.callbacks.statement=u;let m=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.uri||(F.uri=dr.default.utils.charsToString(X,B,L))),re},"uri");i.ast.callbacks.uri=m;let p=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.version=dr.default.utils.charsToString(X,B,L)),re},"version");i.ast.callbacks.version=p;let x=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.chainId=dr.default.utils.charsToString(X,B,L)),re},"chainId");i.ast.callbacks["chain-id"]=x;let k=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.nonce=dr.default.utils.charsToString(X,B,L)),re},"nonce");i.ast.callbacks.nonce=k;let I=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.issuedAt=dr.default.utils.charsToString(X,B,L)),re},"issuedAt");i.ast.callbacks["issued-at"]=I;let T=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.expirationTime=dr.default.utils.charsToString(X,B,L)),re},"expirationTime");i.ast.callbacks["expiration-time"]=T;let C=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.notBefore=dr.default.utils.charsToString(X,B,L)),re},"notBefore");i.ast.callbacks["not-before"]=C;let $=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.requestId=dr.default.utils.charsToString(X,B,L)),re},"requestId");i.ast.callbacks["request-id"]=$;let O=o(function(H,X,B,L,F){let re=s.SEM_OK;return H===s.SEM_PRE&&(F.resources=dr.default.utils.charsToString(X,B,L).slice(3).split(`
781
+ - `)),re},"resources");i.ast.callbacks.resources=O;let U=i.parse(n,"sign-in-with-ethereum",e);if(!U.success)throw new Error(`Invalid message: ${JSON.stringify(U)}`);let j={};i.ast.translate(j);for(let[H,X]of Object.entries(j))this[H]=X}};o(Xu,"ParsedMessage");var Jy;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(Jy||(Jy={}));var Zu;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(Zu||(Zu={}));var ka=class{constructor(e){if(this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0,this.signature=void 0,this.type=void 0,typeof e=="string"){let t=new Xu(e);this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else Object.assign(this,e)}static fromCacao(e){let t=cs.parse(e.p.iss.replace("did:pkh:","")),n=new ka({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new ho(t.chainId).reference});return e.p.statement&&(n.statement=e.p.statement),e.p.nonce&&(n.nonce=e.p.nonce),e.p.iat&&(n.issuedAt=e.p.iat),e.p.exp&&(n.expirationTime=e.p.exp),e.p.nbf&&(n.notBefore=e.p.nbf),e.p.requestId&&(n.requestId=e.p.requestId),e.p.resources&&(n.resources=e.p.resources),e.s&&(e.s.s&&(n.signature=e.s.s),e.s.t==="eip191"&&(n.type=Zu.PERSONAL_SIGNATURE)),n}toMessage(){let e=`${this.domain} wants you to sign in with your Ethereum account:`,t=`URI: ${this.uri}`,n=[e,this.address].join(`
782
782
  `),i=`Version: ${this.version}`;this.nonce||(this.nonce=(Math.random()+1).toString(36).substring(4));let s=`Nonce: ${this.nonce}`,a=[t,i,s];if(this.issuedAt=this.issuedAt?this.issuedAt:new Date().toISOString(),a.push(`Issued At: ${this.issuedAt}`),this.expirationTime){let u=`Expiration Time: ${this.expirationTime}`;a.push(u)}this.notBefore&&a.push(`Not Before: ${this.notBefore}`),this.requestId&&a.push(`Request ID: ${this.requestId}`),this.chainId&&a.push(`Chain ID: ${this.chainId}`),this.resources&&a.push(["Resources:",...this.resources.map(u=>`- ${u}`)].join(`
783
783
  `));let f=a.join(`
784
784
  `);return this.statement&&(n=[n,this.statement].join(`
785
785
 
786
786
  `)),[n,f].join(`
787
787
 
788
- `)}signMessage(){let e;switch(this.type){case Zu.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(ka,"SiweMessage");var AM=5*60,Kf;(function(r){function e(i){let s={h:{t:"eip4361"},p:{domain:i.domain,iat:i.issuedAt,iss:`did:pkh:eip155:${i.chainId}:${i.address}`,aud:i.uri,version:i.version,nonce:i.nonce}};return i.signature&&(s.s={t:"eip191",s:i.signature}),i.notBefore&&(s.p.nbf=i.notBefore),i.expirationTime&&(s.p.exp=i.expirationTime),i.statement&&(s.p.statement=i.statement),i.requestId&&(s.p.requestId=i.requestId),i.resources&&(s.p.resources=i.resources),s}o(e,"fromSiweMessage"),r.fromSiweMessage=e;function t(i,s={}){var a;if(i.h.t==="eip4361"&&((a=i.s)==null?void 0:a.t)==="eip191")return n(i,s);throw new Error("Unsupported CACAO signature type")}o(t,"verify"),r.verify=t;function n(i,s){var O;if(!i.s)throw new Error("CACAO does not have a signature");let a=s.atTime?s.atTime.getTime():Date.now(),f=((O=s.clockSkewSecs)!=null?O:AM)*1e3;if(Date.parse(i.p.iat)>a+f||Date.parse(i.p.nbf)>a+f)throw new Error("CACAO is not valid yet");let u=s.revocationPhaseOutSecs?s.revocationPhaseOutSecs*1e3:0;if(Date.parse(i.p.exp)+u+f<a)throw new Error("CACAO has expired");let m=ka.fromCacao(i),p=i.s.s,x=Yy(m.toMessage(),p),k=cs.parse(i.p.iss.replace("did:pkh:","")).address;if(x.toLowerCase()!==k.toLowerCase())throw new Error("Signature does not belong to issuer")}o(n,"verifyEIP191Signature"),r.verifyEIP191Signature=n})(Kf||(Kf={}));var Vf;(function(r){let e=o(function(t){try{return Promise.resolve(ns({value:t,codec:Ti,hasher:zo}))}catch(n){return Promise.reject(n)}},"fromCacao");r.fromCacao=e})(Vf||(Vf={}));lf();jc();var Zy=at(no(),1);lf();function Qy(){return It((0,Zy.randomBytes)(16),"base64")}o(Qy,"randomString");var e3="base64pad",t3="base64url";function r3(r){return It(r,e3)}o(r3,"encodeBase64");function n3(r){return It(r,t3)}o(n3,"encodeBase64Url");function i3(r){return Rt(r,e3)}o(i3,"decodeBase64");function Qu(r){return JSON.parse(It(Rt(r,t3)))}o(Qu,"base64urlToJSON");function o3(r){if(r.signatures.length>1)throw new Error("Cant convert to compact jws");return`${r.signatures[0].protected}.${r.payload}.${r.signatures[0].signature}`}o(o3,"fromDagJWS");function s3(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(s3,"didWithTime");function a3(r){return r?Array.isArray(r)?r:[r]:[]}o(a3,"extractControllers");function TM(r){return"registry"in r&&"cache"in r}o(TM,"isResolver");var ds=class{constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new va(e)),i){if(this._capability=i,this._parentId=this._capability.p.iss,s&&this._parentId!==s)throw new Error("Capability issuer and parent not equal")}else s&&(this._parentId=s);this.setResolver(t,n)}get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){var t;return new ds({provider:(t=this._client)==null?void 0:t.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new va(e);else if(this._client.connection!==e)throw new Error("A different provider is already set, create a new DID instance to use another provider")}setResolver(e,t){this._resolver=TM(e)?e:new nf(e,t)}authenticate(){return Z(this,arguments,function*({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=Qy(),s=yield this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:a}=yield this.verifyJWS(s),f=Qu(s.payload);if(!a.includes(f.did))throw new Error("Invalid authencation response, kid mismatch");if(f.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(f.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(f.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=f.did,this._id})}createJWS(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");if(this._capability){let s=yield Vf.fromCacao(this._capability),a=Pe.asCID(s.cid);if(!a)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");t.protected=t.protected||{},t.protected.cap=`ipfs://${a==null?void 0:a.toString()}`}let{jws:i}=yield this._client.request("did_createJWS",Ae(ie({did:this._id},t),{payload:e}));return i})}createDagJWS(n){return Z(this,arguments,function*(e,t={}){let{cid:i,linkedBlock:s}=yield d2(e),a=n3(i.bytes);Object.assign(t,{linkedBlock:r3(s)});let f=yield this.createJWS(a,t),u=Pe.asCID(i);if(!u)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(f.link=u,this._capability){let m=yield Vf.fromCacao(this._capability);return{jws:f,linkedBlock:s,cacaoBlock:m.bytes}}return{jws:f,linkedBlock:s}})}verifyJWS(n){return Z(this,arguments,function*(e,t={}){var p,x,k,O,T,C,$;typeof e!="string"&&(e=o3(e));let i=Qu(e.split(".")[0]).kid;if(!i)throw new Error('No "kid" found in jws');let s=yield this.resolve(i);if(!t.disableTimecheck){let I=(p=s.didDocumentMetadata)==null?void 0:p.nextUpdate;if(I){let z=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,H=new Date(I).valueOf()+z;if(!(t.atTime&&t.atTime.getTime()<H))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${i}`)}let U=(x=s.didDocumentMetadata)==null?void 0:x.updated;if(U&&t.atTime&&t.atTime.getTime()<new Date(U).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${i}`)}let f=(k=s.didDocument)==null?void 0:k.id;if(t.issuer&&t.issuer===((O=t.capability)==null?void 0:O.p.iss)&&f===t.capability.p.aud)Kf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(t.issuer&&t.issuer!==f){let I=s3(t.issuer,t.atTime),z=(T=(yield this.resolve(I)).didDocument)==null?void 0:T.controller,H=a3(z);if(((C=t.capability)==null?void 0:C.s)&&t.capability.p.aud===f&&H.includes(t.capability.p.iss))Kf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(!(f?H.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${i}`)}let u=(($=s.didDocument)==null?void 0:$.verificationMethod)||[];ev(e,u);let m;try{m=Qu(e.split(".")[1])}catch(I){}return{kid:i,payload:m,didResolutionResult:s}})}createJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield nv(t,this._resolver);return rv(e,a,n.protectedHeader,n.aad)})}createDagJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield h2(e);return this.createJWE(a,t,n)})}decryptJWE(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");let{cleartext:i}=yield this._client.request("did_decryptJWE",Ae(ie({did:this._id},t),{jwe:e}));return i3(i)})}decryptDagJWE(e){return Z(this,null,function*(){let t=yield this.decryptJWE(e);return p2(t)})}resolve(e){return Z(this,null,function*(){let t=yield this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:n,message:i}=t.didResolutionMetadata,s=i?`, ${i}`:"";throw new Error(`Failed to resolve ${e}: ${n}${s}`)}return t})}};o(ds,"DID");function el(r){var e=0,t=r.length,n=[];if(t%2)throw new Error("invalid hex:"+r);for(;e<t;e+=2)n.push(parseInt(r.substr(e,2),16));return new Uint8Array(n)}o(el,"toUint8Array");var l4=at(ex());var il=at(lu(),1);var sx=at(rx(),1);var zA="base64pad";function nx(r){return JSON.parse((0,sx.default)(r))}o(nx,"toStableObject");function KA(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${It(e,"base58btc")}`}o(KA,"encodeDID");function ix(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(ix,"toGeneralJWS");var ox=o((i,s,a,...f)=>Z(void 0,[i,s,a,...f],function*(r,e,t,n={}){let u=`${e}#${e.split(":")[2]}`,m=Yg(t),p=nx(Object.assign(n,{kid:u,alg:"EdDSA"}));return Qg(typeof r=="string"?r:nx(r),m,p)}),"sign"),VA={did_authenticate:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){let s=yield ox({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return ix(s)}),did_createJWS:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){if(t.did.split("#")[0]!==r)throw new Ar(4100,`Unknown DID: ${r}`);let a=yield ox(t.payload,r,e,t.protected);return{jws:ix(a)}}),did_decryptJWE:(t,n)=>Z(void 0,[t,n],function*({secretKey:r},e){let i=ov((0,il.convertSecretKeyToX25519)(r));try{let s=yield tv(e.jwe,i);return{cleartext:It(s,zA)}}catch(s){throw new Ar(-32e3,s.message)}})},Yf=class{constructor(e){let{secretKey:t,publicKey:n}=(0,il.generateKeyPairFromSeed)(e),i=KA(n),s=w2(VA);this._handle=a=>Z(this,null,function*(){return yield s({did:i,secretKey:t},a)})}get isDidProvider(){return!0}send(e){return Z(this,null,function*(){return yield this._handle(e)})}};o(Yf,"Ed25519Provider");Vn();Nc();var ax={tile:0,"caip10-link":1,model:2,MID:3};function WA(r){let e=ax[r];if(typeof e!="undefined")return e;throw new Error(`No stream type registered for name ${r}`)}o(WA,"codeByName");function GA(r){let e=Object.entries(ax).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(GA,"nameByCode");var kr=class{};o(kr,"StreamType");kr.nameByCode=GA;kr.codeByName=WA;var ap=at(Wf(),1);function $r(r){let e,t,n;return typeof r=="object"?(e=r.hashFunction,t=r.expiring,n=r.tags):e=r,(i,s,a)=>{if(a.value!=null)a.value=fx(a.value,e,t,n);else if(a.get!=null)a.get=fx(a.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o($r,"Memoize");var Q0=new Map;function fx(r,e,t=0,n){let i=Symbol("__memoized_map__");return function(...s){let a;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[i];if(Array.isArray(n))for(let u of n)Q0.has(u)?Q0.get(u).push(f):Q0.set(u,[f]);if(e||s.length>0||t>0){let u;e===!0?u=s.map(x=>x.toString()).join("!"):e?u=e.apply(this,s):u=s[0];let m=`${u}__timestamp`,p=!1;if(t>0)if(!f.has(m))p=!0;else{let x=f.get(m);p=Date.now()-x>t}f.has(u)&&!p?a=f.get(u):(a=r.apply(this,s),f.set(u,a),t>0&&f.set(m,Date.now()))}else{let u=this;f.has(u)?a=f.get(u):(a=r.apply(this,s),f.set(u,a))}return a}}o(fx,"getNewFunction");Vn();var ep=at(Wf(),1);jo();function ci(r){let e=ep.default.decode(r),t=ep.default.decode.bytes,n=r.slice(t);return[e,n,t]}o(ci,"readVarint");function YA(r){return r===0||r===1}o(YA,"isCidVersion");function tp(r){let e=rp(r);if(e instanceof Error)throw e;return e}o(tp,"readCid");function rp(r){let[e,t]=ci(r);if(!YA(e))return new Error(`Unknown CID version ${e}`);let[n,i]=ci(t),[,s,a]=ci(i),[f,,u]=ci(s),m=i.slice(0,a+u+f),p=i.slice(a+u+f);return[Pe.create(e,n,af(m)),p]}o(rp,"readCidNoThrow");Vn();Nc();cf();var np=at(Wf(),1);var Jf=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},hn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)};function JA(r){let e=op(r);if(e instanceof Error)throw e;return e}o(JA,"fromBytes");function op(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=rp(i);if(s instanceof Error)return s;let[a,f]=s;return f.length>0?new Error("Invalid StreamID: contains commit"):new Je(n,a)}o(op,"fromBytesNoThrow");function XA(r){let e=ux(r);if(e instanceof Error)throw e;return e}o(XA,"fromString");function ux(r){let e=r.replace("ceramic://","").replace("/ceramic/",""),t=e.includes("commit")?e.split("?")[0]:e,n=Fo.decode(t);return op(n)}o(ux,"fromStringNoThrow");var cx=Symbol.for("@ceramicnetwork/streamid/StreamID"),Je=class{constructor(e,t){if(this._tag=cx,!(e||e===0))throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");this._type=typeof e=="string"?kr.codeByName(e):e,this._cid=typeof t=="string"?Pe.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===cx}static fromGenesis(e,t){return Z(this,null,function*(){let n=yield ns({value:t,codec:Ti,hasher:zo});return new Je(e,n.cid)})}get type(){return this._type}get typeName(){return kr.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=np.default.encode(206),t=np.default.encode(this.type);return vn([e,t,this.cid.bytes])}get baseID(){return new Je(this._type,this._cid)}equals(e){return Je.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Fo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Je,"StreamID");Je.fromBytes=JA;Je.fromBytesNoThrow=op;Je.fromString=XA;Je.fromStringNoThrow=ux;Jf([$r(),hn("design:type",String),hn("design:paramtypes",[])],Je.prototype,"typeName",null);Jf([$r(),hn("design:type",Uint8Array),hn("design:paramtypes",[])],Je.prototype,"bytes",null);Jf([$r(),hn("design:type",Je),hn("design:paramtypes",[])],Je.prototype,"baseID",null);Jf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toString",null);Jf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toUrl",null);var Ia=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Cr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},sp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Pi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Da,ps,Xf;function ZA(r){let e=fp(r);if(e instanceof Error)throw e;return e}o(ZA,"fromBytes");function fp(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=tp(i);if(s instanceof Error)return s;let[a,f]=s;if(f.length===0)return new Error("No commit information provided");if(f.length===1)return new ht(n,a,f[0]);{let[u]=tp(f);return new ht(n,a,u)}}o(fp,"fromBytesNoThrow");function QA(r){try{return typeof r=="string"?Pe.parse(r):Pe.asCID(r)}catch(e){return}}o(QA,"parseCID");function eT(r,e=null){if(!e)return null;let t=QA(e);if(t)return r.equals(t)?null:t;if(String(e)==="0")return null;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(eT,"parseCommit");function tT(r){let e=dx(r);if(e instanceof Error)throw e;return e}o(tT,"fromString");function dx(r){let e=r.replace("ceramic://","").replace("/ceramic/","");if(e.includes("commit")){let t=e.split("?")[1].split("=")[1],n=e.split("?")[0];return hx(Je.fromString(n),t)}else return fp(Fo.decode(e))}o(dx,"fromStringNoThrow");var lx=Symbol.for("@ceramicnetwork/streamid/CommitID");function hx(r,e){return new ht(r.type,r.cid,e)}o(hx,"make");var ht=class{constructor(e,t,n=null){if(this._tag=lx,Da.set(this,void 0),ps.set(this,void 0),Xf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");sp(this,Da,typeof e=="string"?kr.codeByName(e):e,"f"),sp(this,ps,typeof t=="string"?Pe.parse(t):t,"f"),sp(this,Xf,eT(Pi(this,ps,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===lx}get baseID(){return new Je(Pi(this,Da,"f"),Pi(this,ps,"f"))}get type(){return Pi(this,Da,"f")}get typeName(){return kr.nameByCode(Pi(this,Da,"f"))}get cid(){return Pi(this,ps,"f")}get commit(){return Pi(this,Xf,"f")||Pi(this,ps,"f")}get bytes(){var i;let e=ap.default.encode(206),t=ap.default.encode(this.type),n=((i=Pi(this,Xf,"f"))==null?void 0:i.bytes)||new Uint8Array([0]);return vn([e,t,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Fo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Da=new WeakMap,ps=new WeakMap,Xf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(ht,"CommitID");ht.fromBytes=ZA;ht.fromBytesNoThrow=fp;ht.fromString=tT;ht.fromStringNoThrow=dx;ht.make=hx;Ia([$r(),Cr("design:type",Je),Cr("design:paramtypes",[])],ht.prototype,"baseID",null);Ia([$r(),Cr("design:type",String),Cr("design:paramtypes",[])],ht.prototype,"typeName",null);Ia([$r(),Cr("design:type",Pe),Cr("design:paramtypes",[])],ht.prototype,"commit",null);Ia([$r(),Cr("design:type",Uint8Array),Cr("design:paramtypes",[])],ht.prototype,"bytes",null);Ia([$r(),Cr("design:type",Function),Cr("design:paramtypes",[]),Cr("design:returntype",String)],ht.prototype,"toString",null);Ia([$r(),Cr("design:type",Function),Cr("design:paramtypes",[]),Cr("design:returntype",String)],ht.prototype,"toUrl",null);var yr;(function(r){function e(t){if(Je.isInstance(t))return t;if(ht.isInstance(t))return t;if(t instanceof Uint8Array){let n=ht.fromBytesNoThrow(t);return n instanceof Error?Je.fromBytes(t):n}else if(typeof t=="string"){let n=ht.fromStringNoThrow(t);return n instanceof Error?Je.fromString(t):n}else throw new Error("Can not build CommitID or StreamID")}o(e,"from"),r.from=e})(yr||(yr={}));var px="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",ol="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var cp={};St(cp,{JsonPatchError:()=>Nt,_areEquals:()=>ec,applyOperation:()=>ms,applyPatch:()=>dl,applyReducer:()=>sT,deepClone:()=>iT,getValueByPointer:()=>ul,validate:()=>bx,validator:()=>ll});var rT=function(){var r=o(function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)},"extendStatics");return function(e,t){r(e,t);function n(){this.constructor=e}o(n,"__"),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),nT=Object.prototype.hasOwnProperty;function al(r,e){return nT.call(r,e)}o(al,"hasOwnProperty");function fl(r){if(Array.isArray(r)){for(var e=new Array(r.length),t=0;t<e.length;t++)e[t]=""+t;return e}if(Object.keys)return Object.keys(r);var n=[];for(var i in r)al(r,i)&&n.push(i);return n}o(fl,"_objectKeys");function nr(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(nr,"_deepClone");function cl(r){for(var e=0,t=r.length,n;e<t;){if(n=r.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}o(cl,"isInteger");function ui(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(ui,"escapePathComponent");function Zf(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Zf,"unescapePathComponent");function sl(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(sl(r[e]))return!0}else if(typeof r=="object"){for(var n=fl(r),i=n.length,s=0;s<i;s++)if(sl(r[n[s]]))return!0}}return!1}o(sl,"hasUndefined");function mx(r,e){var t=[r];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i!="undefined"&&t.push(n+": "+i)}return t.join(`
789
- `)}o(mx,"patchErrorMessageFormatter");var Qf=function(r){rT(e,r);function e(t,n,i,s,a){var f=this.constructor,u=r.call(this,mx(t,{name:n,index:i,operation:s,tree:a}))||this;return u.name=n,u.index=i,u.operation=s,u.tree=a,Object.setPrototypeOf(u,f.prototype),u.message=mx(t,{name:n,index:i,operation:s,tree:a}),u}return o(e,"PatchError"),e}(Error);var Nt=Qf,iT=nr,Oa={add:function(r,e,t){return r[e]=this.value,{newDocument:t}},remove:function(r,e,t){var n=r[e];return delete r[e],{newDocument:t,removed:n}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:function(r,e,t){var n=ul(t,this.path);n&&(n=nr(n));var i=ms(t,{op:"remove",path:this.from}).removed;return ms(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=ul(t,this.from);return ms(t,{op:"add",path:this.path,value:nr(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:ec(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},oT={add:function(r,e,t){return cl(e)?r.splice(e,0,this.value):r[e]=this.value,{newDocument:t,index:e}},remove:function(r,e,t){var n=r.splice(e,1);return{newDocument:t,removed:n[0]}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:Oa.move,copy:Oa.copy,test:Oa.test,_get:Oa._get};function ul(r,e){if(e=="")return r;var t={op:"_get",path:e};return ms(r,t),t.value}o(ul,"getValueByPointer");function ms(r,e,t,n,i,s){if(t===void 0&&(t=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=0),t&&(typeof t=="function"?t(e,0,r,e.path):ll(e,0)),e.path===""){var a={newDocument:r};if(e.op==="add")return a.newDocument=e.value,a;if(e.op==="replace")return a.newDocument=e.value,a.removed=r,a;if(e.op==="move"||e.op==="copy")return a.newDocument=ul(r,e.from),e.op==="move"&&(a.removed=r),a;if(e.op==="test"){if(a.test=ec(r,e.value),a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a.newDocument=r,a}else{if(e.op==="remove")return a.removed=r,a.newDocument=null,a;if(e.op==="_get")return e.value=r,a;if(t)throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,r);return a}}else{n||(r=nr(r));var f=e.path||"",u=f.split("/"),m=r,p=1,x=u.length,k=void 0,O=void 0,T=void 0;for(typeof t=="function"?T=t:T=ll;;){if(O=u[p],O&&O.indexOf("~")!=-1&&(O=Zf(O)),i&&(O=="__proto__"||O=="prototype"&&p>0&&u[p-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(t&&k===void 0&&(m[O]===void 0?k=u.slice(0,p).join("/"):p==x-1&&(k=e.path),k!==void 0&&T(e,0,r,k)),p++,Array.isArray(m)){if(O==="-")O=m.length;else{if(t&&!cl(O))throw new Nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,e,r);cl(O)&&(O=~~O)}if(p>=x){if(t&&e.op==="add"&&O>m.length)throw new Nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,r);var a=oT[e.op].call(e,m,O,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}}else if(p>=x){var a=Oa[e.op].call(e,m,O,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}if(m=m[O],t&&p<x&&(!m||typeof m!="object"))throw new Nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(ms,"applyOperation");function dl(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(r=nr(r));for(var s=new Array(e.length),a=0,f=e.length;a<f;a++)s[a]=ms(r,e[a],t,!0,i,a),r=s[a].newDocument;return s.newDocument=r,s}o(dl,"applyPatch");function sT(r,e,t){var n=ms(r,e);if(n.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(sT,"applyReducer");function ll(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new Nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if(Oa[r.op]){if(typeof r.path!="string")throw new Nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new Nt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,r,t);if((r.op==="move"||r.op==="copy")&&typeof r.from!="string")throw new Nt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&r.value===void 0)throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&sl(r.value))throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,r,t);if(t){if(r.op=="add"){var i=r.path.split("/").length,s=n.split("/").length;if(i!==s+1&&i!==s)throw new Nt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,r,t)}else if(r.op==="replace"||r.op==="remove"||r.op==="_get"){if(r.path!==n)throw new Nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,r,t)}else if(r.op==="move"||r.op==="copy"){var a={op:"_get",path:r.from,value:void 0},f=bx([a],t);if(f&&f.name==="OPERATION_PATH_UNRESOLVABLE")throw new Nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(ll,"validator");function bx(r,e,t){try{if(!Array.isArray(r))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)dl(nr(e),nr(r),t||!0);else{t=t||ll;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof Nt)return i;throw i}}o(bx,"validate");function ec(r,e){if(r===e)return!0;if(r&&e&&typeof r=="object"&&typeof e=="object"){var t=Array.isArray(r),n=Array.isArray(e),i,s,a;if(t&&n){if(s=r.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!ec(r[i],e[i]))return!1;return!0}if(t!=n)return!1;var f=Object.keys(r);if(s=f.length,s!==Object.keys(e).length)return!1;for(i=s;i--!==0;)if(!e.hasOwnProperty(f[i]))return!1;for(i=s;i--!==0;)if(a=f[i],!ec(r[a],e[a]))return!1;return!0}return r!==r&&e!==e}o(ec,"_areEquals");var hp={};St(hp,{compare:()=>pT,generate:()=>up,observe:()=>hT,unobserve:()=>dT});var lp=new WeakMap,aT=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),fT=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function cT(r){return lp.get(r)}o(cT,"getMirror");function uT(r,e){return r.observers.get(e)}o(uT,"getObserverFromMirror");function lT(r,e){r.observers.delete(e.callback)}o(lT,"removeObserverFromMirror");function dT(r,e){e.unobserve()}o(dT,"unobserve");function hT(r,e){var t=[],n,i=cT(r);if(!i)i=new aT(r),lp.set(r,i);else{var s=uT(i,e);n=s&&s.observer}if(n)return n;if(n={},i.value=nr(r),e){n.callback=e,n.next=null;var a=o(function(){up(n)},"dirtyCheck"),f=o(function(){clearTimeout(n.next),n.next=setTimeout(a)},"fastCheck");typeof window!="undefined"&&(window.addEventListener("mouseup",f),window.addEventListener("keyup",f),window.addEventListener("mousedown",f),window.addEventListener("keydown",f),window.addEventListener("change",f))}return n.patches=t,n.object=r,n.unobserve=function(){up(n),clearTimeout(n.next),lT(i,n),typeof window!="undefined"&&(window.removeEventListener("mouseup",f),window.removeEventListener("keyup",f),window.removeEventListener("mousedown",f),window.removeEventListener("keydown",f),window.removeEventListener("change",f))},i.observers.set(e,new fT(e,n)),n}o(hT,"observe");function up(r,e){e===void 0&&(e=!1);var t=lp.get(r.object);dp(t.value,r.object,r.patches,"",e),r.patches.length&&dl(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(up,"generate");function dp(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=fl(e),a=fl(r),f=!1,u=!1,m=a.length-1;m>=0;m--){var p=a[m],x=r[p];if(al(e,p)&&!(e[p]===void 0&&x!==void 0&&Array.isArray(e)===!1)){var k=e[p];typeof x=="object"&&x!=null&&typeof k=="object"&&k!=null&&Array.isArray(x)===Array.isArray(k)?dp(x,k,t,n+"/"+ui(p),i):x!==k&&(f=!0,i&&t.push({op:"test",path:n+"/"+ui(p),value:nr(x)}),t.push({op:"replace",path:n+"/"+ui(p),value:nr(k)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+ui(p),value:nr(x)}),t.push({op:"remove",path:n+"/"+ui(p)}),u=!0):(i&&t.push({op:"test",path:n,value:r}),t.push({op:"replace",path:n,value:e}),f=!0)}if(!(!u&&s.length==a.length))for(var m=0;m<s.length;m++){var p=s[m];!al(r,p)&&e[p]!==void 0&&t.push({op:"add",path:n+"/"+ui(p),value:nr(e[p])})}}}o(dp,"_generate");function pT(r,e,t){t===void 0&&(t=!1);var n=[];return dp(r,e,n,"",t),n}o(pT,"compare");var Pa=Object.assign({},cp,hp,{JsonPatchError:Qf,deepClone:nr,escapePathComponent:ui,unescapePathComponent:Zf});var xw=at(ic(),1);var ww=at(no(),1);var Ct;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC"})(Ct||(Ct={}));var qp=at(ic(),1);var A6=at(M6(),1),{__extends:dr,__assign:HF,__rest:jF,__decorate:zF,__param:KF,__metadata:VF,__awaiter:T6,__generator:Sl,__exportStar:WF,__createBinding:GF,__values:ys,__read:qr,__spread:YF,__spreadArrays:JF,__spreadArray:In,__await:Ml,__asyncGenerator:k6,__asyncDelegator:XF,__asyncValues:C6,__makeTemplateObject:ZF,__importStar:QF,__importDefault:e$,__classPrivateFieldGet:t$,__classPrivateFieldSet:r$,__classPrivateFieldIn:n$}=A6.default;function rt(r){return typeof r=="function"}o(rt,"isFunction");function Fa(r){var e=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}o(Fa,"createErrorClass");var Al=Fa(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
788
+ `)}signMessage(){let e;switch(this.type){case Zu.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(ka,"SiweMessage");var DM=5*60,Kf;(function(r){function e(i){let s={h:{t:"eip4361"},p:{domain:i.domain,iat:i.issuedAt,iss:`did:pkh:eip155:${i.chainId}:${i.address}`,aud:i.uri,version:i.version,nonce:i.nonce}};return i.signature&&(s.s={t:"eip191",s:i.signature}),i.notBefore&&(s.p.nbf=i.notBefore),i.expirationTime&&(s.p.exp=i.expirationTime),i.statement&&(s.p.statement=i.statement),i.requestId&&(s.p.requestId=i.requestId),i.resources&&(s.p.resources=i.resources),s}o(e,"fromSiweMessage"),r.fromSiweMessage=e;function t(i,s={}){var a;if(i.h.t==="eip4361"&&((a=i.s)==null?void 0:a.t)==="eip191")return n(i,s);throw new Error("Unsupported CACAO signature type")}o(t,"verify"),r.verify=t;function n(i,s){var I;if(!i.s)throw new Error("CACAO does not have a signature");let a=s.atTime?s.atTime.getTime():Date.now(),f=((I=s.clockSkewSecs)!=null?I:DM)*1e3;if(Date.parse(i.p.iat)>a+f||Date.parse(i.p.nbf)>a+f)throw new Error("CACAO is not valid yet");let u=s.revocationPhaseOutSecs?s.revocationPhaseOutSecs*1e3:0;if(Date.parse(i.p.exp)+u+f<a)throw new Error("CACAO has expired");let m=ka.fromCacao(i),p=i.s.s,x=Yy(m.toMessage(),p),k=cs.parse(i.p.iss.replace("did:pkh:","")).address;if(x.toLowerCase()!==k.toLowerCase())throw new Error("Signature does not belong to issuer")}o(n,"verifyEIP191Signature"),r.verifyEIP191Signature=n})(Kf||(Kf={}));var Vf;(function(r){let e=o(function(t){try{return Promise.resolve(ns({value:t,codec:Ci,hasher:jo}))}catch(n){return Promise.reject(n)}},"fromCacao");r.fromCacao=e})(Vf||(Vf={}));lf();zc();var Zy=at(no(),1);lf();function Qy(){return Ot((0,Zy.randomBytes)(16),"base64")}o(Qy,"randomString");var e3="base64pad",t3="base64url";function r3(r){return Ot(r,e3)}o(r3,"encodeBase64");function n3(r){return Ot(r,t3)}o(n3,"encodeBase64Url");function i3(r){return Lt(r,e3)}o(i3,"decodeBase64");function Qu(r){return JSON.parse(Ot(Lt(r,t3)))}o(Qu,"base64urlToJSON");function o3(r){if(r.signatures.length>1)throw new Error("Cant convert to compact jws");return`${r.signatures[0].protected}.${r.payload}.${r.signatures[0].signature}`}o(o3,"fromDagJWS");function s3(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(s3,"didWithTime");function a3(r){return r?Array.isArray(r)?r:[r]:[]}o(a3,"extractControllers");function OM(r){return"registry"in r&&"cache"in r}o(OM,"isResolver");var ds=class{constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new va(e)),i){if(this._capability=i,this._parentId=this._capability.p.iss,s&&this._parentId!==s)throw new Error("Capability issuer and parent not equal")}else s&&(this._parentId=s);this.setResolver(t,n)}get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){var t;return new ds({provider:(t=this._client)==null?void 0:t.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new va(e);else if(this._client.connection!==e)throw new Error("A different provider is already set, create a new DID instance to use another provider")}setResolver(e,t){this._resolver=OM(e)?e:new nf(e,t)}authenticate(){return Z(this,arguments,function*({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=Qy(),s=yield this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:a}=yield this.verifyJWS(s),f=Qu(s.payload);if(!a.includes(f.did))throw new Error("Invalid authencation response, kid mismatch");if(f.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(f.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(f.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=f.did,this._id})}createJWS(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");if(this._capability){let s=yield Vf.fromCacao(this._capability),a=Pe.asCID(s.cid);if(!a)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");t.protected=t.protected||{},t.protected.cap=`ipfs://${a==null?void 0:a.toString()}`}let{jws:i}=yield this._client.request("did_createJWS",Te(ie({did:this._id},t),{payload:e}));return i})}createDagJWS(n){return Z(this,arguments,function*(e,t={}){let{cid:i,linkedBlock:s}=yield d2(e),a=n3(i.bytes);Object.assign(t,{linkedBlock:r3(s)});let f=yield this.createJWS(a,t),u=Pe.asCID(i);if(!u)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(f.link=u,this._capability){let m=yield Vf.fromCacao(this._capability);return{jws:f,linkedBlock:s,cacaoBlock:m.bytes}}return{jws:f,linkedBlock:s}})}verifyJWS(n){return Z(this,arguments,function*(e,t={}){var p,x,k,I,T,C,$;typeof e!="string"&&(e=o3(e));let i=Qu(e.split(".")[0]).kid;if(!i)throw new Error('No "kid" found in jws');let s=yield this.resolve(i);if(!t.disableTimecheck){let O=(p=s.didDocumentMetadata)==null?void 0:p.nextUpdate;if(O){let j=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,H=new Date(O).valueOf()+j;if(!(t.atTime&&t.atTime.getTime()<H))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${i}`)}let U=(x=s.didDocumentMetadata)==null?void 0:x.updated;if(U&&t.atTime&&t.atTime.getTime()<new Date(U).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${i}`)}let f=(k=s.didDocument)==null?void 0:k.id;if(t.issuer&&t.issuer===((I=t.capability)==null?void 0:I.p.iss)&&f===t.capability.p.aud)Kf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(t.issuer&&t.issuer!==f){let O=s3(t.issuer,t.atTime),j=(T=(yield this.resolve(O)).didDocument)==null?void 0:T.controller,H=a3(j);if(((C=t.capability)==null?void 0:C.s)&&t.capability.p.aud===f&&H.includes(t.capability.p.iss))Kf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(!(f?H.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${i}`)}let u=(($=s.didDocument)==null?void 0:$.verificationMethod)||[];ev(e,u);let m;try{m=Qu(e.split(".")[1])}catch(O){}return{kid:i,payload:m,didResolutionResult:s}})}createJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield nv(t,this._resolver);return rv(e,a,n.protectedHeader,n.aad)})}createDagJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield h2(e);return this.createJWE(a,t,n)})}decryptJWE(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");let{cleartext:i}=yield this._client.request("did_decryptJWE",Te(ie({did:this._id},t),{jwe:e}));return i3(i)})}decryptDagJWE(e){return Z(this,null,function*(){let t=yield this.decryptJWE(e);return p2(t)})}resolve(e){return Z(this,null,function*(){let t=yield this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:n,message:i}=t.didResolutionMetadata,s=i?`, ${i}`:"";throw new Error(`Failed to resolve ${e}: ${n}${s}`)}return t})}};o(ds,"DID");function el(r){var e=0,t=r.length,n=[];if(t%2)throw new Error("invalid hex:"+r);for(;e<t;e+=2)n.push(parseInt(r.substr(e,2),16));return new Uint8Array(n)}o(el,"toUint8Array");var l4=at(ex());var il=at(lu(),1);var sx=at(rx(),1);var GA="base64pad";function nx(r){return JSON.parse((0,sx.default)(r))}o(nx,"toStableObject");function YA(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${Ot(e,"base58btc")}`}o(YA,"encodeDID");function ix(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(ix,"toGeneralJWS");var ox=o((i,s,a,...f)=>Z(void 0,[i,s,a,...f],function*(r,e,t,n={}){let u=`${e}#${e.split(":")[2]}`,m=Yg(t),p=nx(Object.assign(n,{kid:u,alg:"EdDSA"}));return Qg(typeof r=="string"?r:nx(r),m,p)}),"sign"),JA={did_authenticate:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){let s=yield ox({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return ix(s)}),did_createJWS:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){if(t.did.split("#")[0]!==r)throw new Tr(4100,`Unknown DID: ${r}`);let a=yield ox(t.payload,r,e,t.protected);return{jws:ix(a)}}),did_decryptJWE:(t,n)=>Z(void 0,[t,n],function*({secretKey:r},e){let i=ov((0,il.convertSecretKeyToX25519)(r));try{let s=yield tv(e.jwe,i);return{cleartext:Ot(s,GA)}}catch(s){throw new Tr(-32e3,s.message)}})},Yf=class{constructor(e){let{secretKey:t,publicKey:n}=(0,il.generateKeyPairFromSeed)(e),i=YA(n),s=w2(JA);this._handle=a=>Z(this,null,function*(){return yield s({did:i,secretKey:t},a)})}get isDidProvider(){return!0}send(e){return Z(this,null,function*(){return yield this._handle(e)})}};o(Yf,"Ed25519Provider");Vn();Nc();var ax={tile:0,"caip10-link":1,model:2,MID:3};function XA(r){let e=ax[r];if(typeof e!="undefined")return e;throw new Error(`No stream type registered for name ${r}`)}o(XA,"codeByName");function ZA(r){let e=Object.entries(ax).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(ZA,"nameByCode");var Cr=class{};o(Cr,"StreamType");Cr.nameByCode=ZA;Cr.codeByName=XA;var ap=at(Wf(),1);function $r(r){let e,t,n;return typeof r=="object"?(e=r.hashFunction,t=r.expiring,n=r.tags):e=r,(i,s,a)=>{if(a.value!=null)a.value=fx(a.value,e,t,n);else if(a.get!=null)a.get=fx(a.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o($r,"Memoize");var Q0=new Map;function fx(r,e,t=0,n){let i=Symbol("__memoized_map__");return function(...s){let a;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[i];if(Array.isArray(n))for(let u of n)Q0.has(u)?Q0.get(u).push(f):Q0.set(u,[f]);if(e||s.length>0||t>0){let u;e===!0?u=s.map(x=>x.toString()).join("!"):e?u=e.apply(this,s):u=s[0];let m=`${u}__timestamp`,p=!1;if(t>0)if(!f.has(m))p=!0;else{let x=f.get(m);p=Date.now()-x>t}f.has(u)&&!p?a=f.get(u):(a=r.apply(this,s),f.set(u,a),t>0&&f.set(m,Date.now()))}else{let u=this;f.has(u)?a=f.get(u):(a=r.apply(this,s),f.set(u,a))}return a}}o(fx,"getNewFunction");Vn();var ep=at(Wf(),1);zo();function ci(r){let e=ep.default.decode(r),t=ep.default.decode.bytes,n=r.slice(t);return[e,n,t]}o(ci,"readVarint");function QA(r){return r===0||r===1}o(QA,"isCidVersion");function tp(r){let e=rp(r);if(e instanceof Error)throw e;return e}o(tp,"readCid");function rp(r){let[e,t]=ci(r);if(!QA(e))return new Error(`Unknown CID version ${e}`);let[n,i]=ci(t),[,s,a]=ci(i),[f,,u]=ci(s),m=i.slice(0,a+u+f),p=i.slice(a+u+f);return[Pe.create(e,n,af(m)),p]}o(rp,"readCidNoThrow");Vn();Nc();cf();var np=at(Wf(),1);var Jf=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},hn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)};function eT(r){let e=op(r);if(e instanceof Error)throw e;return e}o(eT,"fromBytes");function op(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=rp(i);if(s instanceof Error)return s;let[a,f]=s;return f.length>0?new Error("Invalid StreamID: contains commit"):new Je(n,a)}o(op,"fromBytesNoThrow");function tT(r){let e=ux(r);if(e instanceof Error)throw e;return e}o(tT,"fromString");function ux(r){let e=r.replace("ceramic://","").replace("/ceramic/",""),t=e.includes("commit")?e.split("?")[0]:e,n=Fo.decode(t);return op(n)}o(ux,"fromStringNoThrow");var cx=Symbol.for("@ceramicnetwork/streamid/StreamID"),Je=class{constructor(e,t){if(this._tag=cx,!(e||e===0))throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");this._type=typeof e=="string"?Cr.codeByName(e):e,this._cid=typeof t=="string"?Pe.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===cx}static fromGenesis(e,t){return Z(this,null,function*(){let n=yield ns({value:t,codec:Ci,hasher:jo});return new Je(e,n.cid)})}get type(){return this._type}get typeName(){return Cr.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=np.default.encode(206),t=np.default.encode(this.type);return vn([e,t,this.cid.bytes])}get baseID(){return new Je(this._type,this._cid)}equals(e){return Je.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Fo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Je,"StreamID");Je.fromBytes=eT;Je.fromBytesNoThrow=op;Je.fromString=tT;Je.fromStringNoThrow=ux;Jf([$r(),hn("design:type",String),hn("design:paramtypes",[])],Je.prototype,"typeName",null);Jf([$r(),hn("design:type",Uint8Array),hn("design:paramtypes",[])],Je.prototype,"bytes",null);Jf([$r(),hn("design:type",Je),hn("design:paramtypes",[])],Je.prototype,"baseID",null);Jf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toString",null);Jf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toUrl",null);var Oa=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Dr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},sp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ri=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Da,ps,Xf;function rT(r){let e=fp(r);if(e instanceof Error)throw e;return e}o(rT,"fromBytes");function fp(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=tp(i);if(s instanceof Error)return s;let[a,f]=s;if(f.length===0)return new Error("No commit information provided");if(f.length===1)return new ht(n,a,f[0]);{let[u]=tp(f);return new ht(n,a,u)}}o(fp,"fromBytesNoThrow");function nT(r){try{return typeof r=="string"?Pe.parse(r):Pe.asCID(r)}catch(e){return}}o(nT,"parseCID");function iT(r,e=null){if(!e)return null;let t=nT(e);if(t)return r.equals(t)?null:t;if(String(e)==="0")return null;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(iT,"parseCommit");function oT(r){let e=dx(r);if(e instanceof Error)throw e;return e}o(oT,"fromString");function dx(r){let e=r.replace("ceramic://","").replace("/ceramic/","");if(e.includes("commit")){let t=e.split("?")[1].split("=")[1],n=e.split("?")[0];return hx(Je.fromString(n),t)}else return fp(Fo.decode(e))}o(dx,"fromStringNoThrow");var lx=Symbol.for("@ceramicnetwork/streamid/CommitID");function hx(r,e){return new ht(r.type,r.cid,e)}o(hx,"make");var ht=class{constructor(e,t,n=null){if(this._tag=lx,Da.set(this,void 0),ps.set(this,void 0),Xf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");sp(this,Da,typeof e=="string"?Cr.codeByName(e):e,"f"),sp(this,ps,typeof t=="string"?Pe.parse(t):t,"f"),sp(this,Xf,iT(Ri(this,ps,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===lx}get baseID(){return new Je(Ri(this,Da,"f"),Ri(this,ps,"f"))}get type(){return Ri(this,Da,"f")}get typeName(){return Cr.nameByCode(Ri(this,Da,"f"))}get cid(){return Ri(this,ps,"f")}get commit(){return Ri(this,Xf,"f")||Ri(this,ps,"f")}get bytes(){var i;let e=ap.default.encode(206),t=ap.default.encode(this.type),n=((i=Ri(this,Xf,"f"))==null?void 0:i.bytes)||new Uint8Array([0]);return vn([e,t,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Fo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Da=new WeakMap,ps=new WeakMap,Xf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(ht,"CommitID");ht.fromBytes=rT;ht.fromBytesNoThrow=fp;ht.fromString=oT;ht.fromStringNoThrow=dx;ht.make=hx;Oa([$r(),Dr("design:type",Je),Dr("design:paramtypes",[])],ht.prototype,"baseID",null);Oa([$r(),Dr("design:type",String),Dr("design:paramtypes",[])],ht.prototype,"typeName",null);Oa([$r(),Dr("design:type",Pe),Dr("design:paramtypes",[])],ht.prototype,"commit",null);Oa([$r(),Dr("design:type",Uint8Array),Dr("design:paramtypes",[])],ht.prototype,"bytes",null);Oa([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("design:returntype",String)],ht.prototype,"toString",null);Oa([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("design:returntype",String)],ht.prototype,"toUrl",null);var xr;(function(r){function e(t){if(Je.isInstance(t))return t;if(ht.isInstance(t))return t;if(t instanceof Uint8Array){let n=ht.fromBytesNoThrow(t);return n instanceof Error?Je.fromBytes(t):n}else if(typeof t=="string"){let n=ht.fromStringNoThrow(t);return n instanceof Error?Je.fromString(t):n}else throw new Error("Can not build CommitID or StreamID")}o(e,"from"),r.from=e})(xr||(xr={}));var px="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",ol="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var cp={};St(cp,{JsonPatchError:()=>Nt,_areEquals:()=>ec,applyOperation:()=>ms,applyPatch:()=>dl,applyReducer:()=>uT,deepClone:()=>fT,getValueByPointer:()=>ul,validate:()=>bx,validator:()=>ll});var sT=function(){var r=o(function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)},"extendStatics");return function(e,t){r(e,t);function n(){this.constructor=e}o(n,"__"),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),aT=Object.prototype.hasOwnProperty;function al(r,e){return aT.call(r,e)}o(al,"hasOwnProperty");function fl(r){if(Array.isArray(r)){for(var e=new Array(r.length),t=0;t<e.length;t++)e[t]=""+t;return e}if(Object.keys)return Object.keys(r);var n=[];for(var i in r)al(r,i)&&n.push(i);return n}o(fl,"_objectKeys");function ir(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(ir,"_deepClone");function cl(r){for(var e=0,t=r.length,n;e<t;){if(n=r.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}o(cl,"isInteger");function ui(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(ui,"escapePathComponent");function Zf(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Zf,"unescapePathComponent");function sl(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(sl(r[e]))return!0}else if(typeof r=="object"){for(var n=fl(r),i=n.length,s=0;s<i;s++)if(sl(r[n[s]]))return!0}}return!1}o(sl,"hasUndefined");function mx(r,e){var t=[r];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i!="undefined"&&t.push(n+": "+i)}return t.join(`
789
+ `)}o(mx,"patchErrorMessageFormatter");var Qf=function(r){sT(e,r);function e(t,n,i,s,a){var f=this.constructor,u=r.call(this,mx(t,{name:n,index:i,operation:s,tree:a}))||this;return u.name=n,u.index=i,u.operation=s,u.tree=a,Object.setPrototypeOf(u,f.prototype),u.message=mx(t,{name:n,index:i,operation:s,tree:a}),u}return o(e,"PatchError"),e}(Error);var Nt=Qf,fT=ir,Ia={add:function(r,e,t){return r[e]=this.value,{newDocument:t}},remove:function(r,e,t){var n=r[e];return delete r[e],{newDocument:t,removed:n}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:function(r,e,t){var n=ul(t,this.path);n&&(n=ir(n));var i=ms(t,{op:"remove",path:this.from}).removed;return ms(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=ul(t,this.from);return ms(t,{op:"add",path:this.path,value:ir(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:ec(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},cT={add:function(r,e,t){return cl(e)?r.splice(e,0,this.value):r[e]=this.value,{newDocument:t,index:e}},remove:function(r,e,t){var n=r.splice(e,1);return{newDocument:t,removed:n[0]}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:Ia.move,copy:Ia.copy,test:Ia.test,_get:Ia._get};function ul(r,e){if(e=="")return r;var t={op:"_get",path:e};return ms(r,t),t.value}o(ul,"getValueByPointer");function ms(r,e,t,n,i,s){if(t===void 0&&(t=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=0),t&&(typeof t=="function"?t(e,0,r,e.path):ll(e,0)),e.path===""){var a={newDocument:r};if(e.op==="add")return a.newDocument=e.value,a;if(e.op==="replace")return a.newDocument=e.value,a.removed=r,a;if(e.op==="move"||e.op==="copy")return a.newDocument=ul(r,e.from),e.op==="move"&&(a.removed=r),a;if(e.op==="test"){if(a.test=ec(r,e.value),a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a.newDocument=r,a}else{if(e.op==="remove")return a.removed=r,a.newDocument=null,a;if(e.op==="_get")return e.value=r,a;if(t)throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,r);return a}}else{n||(r=ir(r));var f=e.path||"",u=f.split("/"),m=r,p=1,x=u.length,k=void 0,I=void 0,T=void 0;for(typeof t=="function"?T=t:T=ll;;){if(I=u[p],I&&I.indexOf("~")!=-1&&(I=Zf(I)),i&&(I=="__proto__"||I=="prototype"&&p>0&&u[p-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(t&&k===void 0&&(m[I]===void 0?k=u.slice(0,p).join("/"):p==x-1&&(k=e.path),k!==void 0&&T(e,0,r,k)),p++,Array.isArray(m)){if(I==="-")I=m.length;else{if(t&&!cl(I))throw new Nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,e,r);cl(I)&&(I=~~I)}if(p>=x){if(t&&e.op==="add"&&I>m.length)throw new Nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,r);var a=cT[e.op].call(e,m,I,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}}else if(p>=x){var a=Ia[e.op].call(e,m,I,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}if(m=m[I],t&&p<x&&(!m||typeof m!="object"))throw new Nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(ms,"applyOperation");function dl(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(r=ir(r));for(var s=new Array(e.length),a=0,f=e.length;a<f;a++)s[a]=ms(r,e[a],t,!0,i,a),r=s[a].newDocument;return s.newDocument=r,s}o(dl,"applyPatch");function uT(r,e,t){var n=ms(r,e);if(n.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(uT,"applyReducer");function ll(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new Nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if(Ia[r.op]){if(typeof r.path!="string")throw new Nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new Nt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,r,t);if((r.op==="move"||r.op==="copy")&&typeof r.from!="string")throw new Nt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&r.value===void 0)throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&sl(r.value))throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,r,t);if(t){if(r.op=="add"){var i=r.path.split("/").length,s=n.split("/").length;if(i!==s+1&&i!==s)throw new Nt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,r,t)}else if(r.op==="replace"||r.op==="remove"||r.op==="_get"){if(r.path!==n)throw new Nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,r,t)}else if(r.op==="move"||r.op==="copy"){var a={op:"_get",path:r.from,value:void 0},f=bx([a],t);if(f&&f.name==="OPERATION_PATH_UNRESOLVABLE")throw new Nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(ll,"validator");function bx(r,e,t){try{if(!Array.isArray(r))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)dl(ir(e),ir(r),t||!0);else{t=t||ll;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof Nt)return i;throw i}}o(bx,"validate");function ec(r,e){if(r===e)return!0;if(r&&e&&typeof r=="object"&&typeof e=="object"){var t=Array.isArray(r),n=Array.isArray(e),i,s,a;if(t&&n){if(s=r.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!ec(r[i],e[i]))return!1;return!0}if(t!=n)return!1;var f=Object.keys(r);if(s=f.length,s!==Object.keys(e).length)return!1;for(i=s;i--!==0;)if(!e.hasOwnProperty(f[i]))return!1;for(i=s;i--!==0;)if(a=f[i],!ec(r[a],e[a]))return!1;return!0}return r!==r&&e!==e}o(ec,"_areEquals");var hp={};St(hp,{compare:()=>vT,generate:()=>up,observe:()=>gT,unobserve:()=>bT});var lp=new WeakMap,lT=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),dT=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function hT(r){return lp.get(r)}o(hT,"getMirror");function pT(r,e){return r.observers.get(e)}o(pT,"getObserverFromMirror");function mT(r,e){r.observers.delete(e.callback)}o(mT,"removeObserverFromMirror");function bT(r,e){e.unobserve()}o(bT,"unobserve");function gT(r,e){var t=[],n,i=hT(r);if(!i)i=new lT(r),lp.set(r,i);else{var s=pT(i,e);n=s&&s.observer}if(n)return n;if(n={},i.value=ir(r),e){n.callback=e,n.next=null;var a=o(function(){up(n)},"dirtyCheck"),f=o(function(){clearTimeout(n.next),n.next=setTimeout(a)},"fastCheck");typeof window!="undefined"&&(window.addEventListener("mouseup",f),window.addEventListener("keyup",f),window.addEventListener("mousedown",f),window.addEventListener("keydown",f),window.addEventListener("change",f))}return n.patches=t,n.object=r,n.unobserve=function(){up(n),clearTimeout(n.next),mT(i,n),typeof window!="undefined"&&(window.removeEventListener("mouseup",f),window.removeEventListener("keyup",f),window.removeEventListener("mousedown",f),window.removeEventListener("keydown",f),window.removeEventListener("change",f))},i.observers.set(e,new dT(e,n)),n}o(gT,"observe");function up(r,e){e===void 0&&(e=!1);var t=lp.get(r.object);dp(t.value,r.object,r.patches,"",e),r.patches.length&&dl(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(up,"generate");function dp(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=fl(e),a=fl(r),f=!1,u=!1,m=a.length-1;m>=0;m--){var p=a[m],x=r[p];if(al(e,p)&&!(e[p]===void 0&&x!==void 0&&Array.isArray(e)===!1)){var k=e[p];typeof x=="object"&&x!=null&&typeof k=="object"&&k!=null&&Array.isArray(x)===Array.isArray(k)?dp(x,k,t,n+"/"+ui(p),i):x!==k&&(f=!0,i&&t.push({op:"test",path:n+"/"+ui(p),value:ir(x)}),t.push({op:"replace",path:n+"/"+ui(p),value:ir(k)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+ui(p),value:ir(x)}),t.push({op:"remove",path:n+"/"+ui(p)}),u=!0):(i&&t.push({op:"test",path:n,value:r}),t.push({op:"replace",path:n,value:e}),f=!0)}if(!(!u&&s.length==a.length))for(var m=0;m<s.length;m++){var p=s[m];!al(r,p)&&e[p]!==void 0&&t.push({op:"add",path:n+"/"+ui(p),value:ir(e[p])})}}}o(dp,"_generate");function vT(r,e,t){t===void 0&&(t=!1);var n=[];return dp(r,e,n,"",t),n}o(vT,"compare");var Pa=Object.assign({},cp,hp,{JsonPatchError:Qf,deepClone:ir,escapePathComponent:ui,unescapePathComponent:Zf});var xw=at(ic(),1);var ww=at(no(),1);var Ct;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC"})(Ct||(Ct={}));var qp=at(ic(),1);var A6=at(M6(),1),{__extends:hr,__assign:VF,__rest:WF,__decorate:GF,__param:YF,__metadata:JF,__awaiter:T6,__generator:Sl,__exportStar:XF,__createBinding:ZF,__values:ys,__read:qr,__spread:QF,__spreadArrays:e$,__spreadArray:On,__await:Ml,__asyncGenerator:k6,__asyncDelegator:t$,__asyncValues:C6,__makeTemplateObject:r$,__importStar:n$,__importDefault:i$,__classPrivateFieldGet:o$,__classPrivateFieldSet:s$,__classPrivateFieldIn:a$}=A6.default;function rt(r){return typeof r=="function"}o(rt,"isFunction");function Fa(r){var e=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}o(Fa,"createErrorClass");var Al=Fa(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
790
790
  `+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
791
- `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function xs(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(xs,"arrRemove");var vo=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return o(r,"Subscription"),r.prototype.unsubscribe=function(){var e,t,n,i,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var f=ys(a),u=f.next();!u.done;u=f.next()){var m=u.value;m.remove(this)}}catch(C){e={error:C}}finally{try{u&&!u.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else a.remove(this);var p=this.initialTeardown;if(rt(p))try{p()}catch(C){s=C instanceof Al?C.errors:[C]}var x=this._finalizers;if(x){this._finalizers=null;try{for(var k=ys(x),O=k.next();!O.done;O=k.next()){var T=O.value;try{D6(T)}catch(C){s=s!=null?s:[],C instanceof Al?s=In(In([],qr(s)),qr(C.errors)):s.push(C)}}}catch(C){n={error:C}}finally{try{O&&!O.done&&(i=k.return)&&i.call(k)}finally{if(n)throw n.error}}}if(s)throw new Al(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)D6(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&xs(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&xs(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var Cp=vo.EMPTY;function Tl(r){return r instanceof vo||r&&"closed"in r&&rt(r.remove)&&rt(r.add)&&rt(r.unsubscribe)}o(Tl,"isSubscription");function D6(r){rt(r)?r():r.unsubscribe()}o(D6,"execFinalizer");var On={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var $a={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=$a.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,In([r,e],qr(t))):setTimeout.apply(void 0,In([r,e],qr(t)))},clearTimeout:function(r){var e=$a.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function kl(r){$a.setTimeout(function(){var e=On.onUnhandledError;if(e)e(r);else throw r})}o(kl,"reportUnhandledError");function Dp(){}o(Dp,"noop");var I6=function(){return Ip("C",void 0,void 0)}();function O6(r){return Ip("E",void 0,r)}o(O6,"errorNotification");function P6(r){return Ip("N",r,void 0)}o(P6,"nextNotification");function Ip(r,e,t){return{kind:r,value:e,error:t}}o(Ip,"createNotification");var ws=null;function qa(r){if(On.useDeprecatedSynchronousErrorHandling){var e=!ws;if(e&&(ws={errorThrown:!1,error:null}),r(),e){var t=ws,n=t.errorThrown,i=t.error;if(ws=null,n)throw i}}else r()}o(qa,"errorContext");function N6(r){On.useDeprecatedSynchronousErrorHandling&&ws&&(ws.errorThrown=!0,ws.error=r)}o(N6,"captureError");var oc=function(r){dr(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Tl(t)&&t.add(n)):n.destination=Kk,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new Dl(t,n,i)},e.prototype.next=function(t){this.isStopped?Pp(P6(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Pp(O6(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Pp(I6,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(vo);var Hk=Function.prototype.bind;function Op(r,e){return Hk.call(r,e)}o(Op,"bind");var jk=function(){function r(e){this.partialObserver=e}return o(r,"ConsumerObserver"),r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){Cl(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Cl(n)}else Cl(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Cl(t)}},r}(),Dl=function(r){dr(e,r);function e(t,n,i){var s=r.call(this)||this,a;if(rt(t)||!t)a={next:t!=null?t:void 0,error:n!=null?n:void 0,complete:i!=null?i:void 0};else{var f;s&&On.useDeprecatedNextContext?(f=Object.create(t),f.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Op(t.next,f),error:t.error&&Op(t.error,f),complete:t.complete&&Op(t.complete,f)}):a=t}return s.destination=new jk(a),s}return o(e,"SafeSubscriber"),e}(oc);function Cl(r){On.useDeprecatedSynchronousErrorHandling?N6(r):kl(r)}o(Cl,"handleUnhandledError");function zk(r){throw r}o(zk,"defaultErrorHandler");function Pp(r,e){var t=On.onStoppedNotification;t&&$a.setTimeout(function(){return t(r,e)})}o(Pp,"handleStoppedNotification");var Kk={closed:!0,next:Dp,error:zk,complete:Dp};var Ha=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ja(r){return r}o(ja,"identity");function R6(r){return r.length===0?ja:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(R6,"pipeFromArray");var _t=function(){function r(e){e&&(this._subscribe=e)}return o(r,"Observable"),r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,s=Wk(e)?e:new Dl(e,t,n);return qa(function(){var a=i,f=a.operator,u=a.source;s.add(f?f.call(s,u):u?i._subscribe(s):i._trySubscribe(s))}),s},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=L6(t),new t(function(i,s){var a=new Dl({next:function(f){try{e(f)}catch(u){s(u),a.unsubscribe()}},error:s,complete:i});n.subscribe(a)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Ha]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R6(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=L6(e),new e(function(n,i){var s;t.subscribe(function(a){return s=a},function(a){return i(a)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function L6(r){var e;return(e=r!=null?r:On.Promise)!==null&&e!==void 0?e:Promise}o(L6,"getPromiseCtor");function Vk(r){return r&&rt(r.next)&&rt(r.error)&&rt(r.complete)}o(Vk,"isObserver");function Wk(r){return r&&r instanceof oc||Vk(r)&&Tl(r)}o(Wk,"isSubscriber");function Gk(r){return rt(r==null?void 0:r.lift)}o(Gk,"hasLift");function Yt(r){return function(e){if(Gk(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}o(Yt,"operate");function Jt(r,e,t,n,i){return new Yk(r,e,t,n,i)}o(Jt,"createOperatorSubscriber");var Yk=function(r){dr(e,r);function e(t,n,i,s,a,f){var u=r.call(this,t)||this;return u.onFinalize=a,u.shouldUnsubscribe=f,u._next=n?function(m){try{n(m)}catch(p){t.error(p)}}:r.prototype._next,u._error=s?function(m){try{s(m)}catch(p){t.error(p)}finally{this.unsubscribe()}}:r.prototype._error,u._complete=i?function(){try{i()}catch(m){t.error(m)}finally{this.unsubscribe()}}:r.prototype._complete,u}return o(e,"OperatorSubscriber"),e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(oc);var B6=Fa(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Np=function(r){dr(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o(e,"Subject"),e.prototype.lift=function(t){var n=new U6(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new B6},e.prototype.next=function(t){var n=this;qa(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=ys(n.currentObservers),f=a.next();!f.done;f=a.next()){var u=f.value;u.next(t)}}catch(m){i={error:m}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;qa(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;qa(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,s=i.hasError,a=i.isStopped,f=i.observers;return s||a?Cp:(this.currentObservers=null,f.push(t),new vo(function(){n.currentObservers=null,xs(f,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,a=n.isStopped;i?t.error(s):a&&t.complete()},e.prototype.asObservable=function(){var t=new _t;return t.source=this,t},e.create=function(t,n){return new U6(t,n)},e}(_t);var U6=function(r){dr(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return o(e,"AnonymousSubject"),e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:Cp},e}(Np);var Rp=function(r){dr(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return o(e,"BehaviorSubject"),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,s=t._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(Np);var Lp={now:function(){return(Lp.delegate||Date).now()},delegate:void 0};var F6=function(r){dr(e,r);function e(t,n){return r.call(this)||this}return o(e,"Action"),e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e}(vo);var sc={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=sc.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,In([r,e],qr(t))):setInterval.apply(void 0,In([r,e],qr(t)))},clearInterval:function(r){var e=sc.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(r)},delegate:void 0};var $6=function(r){dr(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.pending=!1,i}return o(e,"AsyncAction"),e.prototype.schedule=function(t,n){if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),sc.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;sc.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var i=!1,s;try{this.work(t)}catch(a){i=!0,s=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,xs(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(F6);var Bp=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return o(r,"Scheduler"),r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=Lp.now,r}();var q6=function(r){dr(e,r);function e(t,n){n===void 0&&(n=Bp.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return o(e,"AsyncScheduler"),e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,i){for(;t=n.shift();)t.unsubscribe();throw i}},e}(Bp);var Jk=new q6($6),H6=Jk;var Il=new _t(function(r){return r.complete()});function Ol(r){return r&&rt(r.schedule)}o(Ol,"isScheduler");function j6(r){return r[r.length-1]}o(j6,"last");function z6(r){return Ol(j6(r))?r.pop():void 0}o(z6,"popScheduler");function K6(r,e){return typeof j6(r)=="number"?r.pop():e}o(K6,"popNumber");var za=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function Pl(r){return rt(r==null?void 0:r.then)}o(Pl,"isPromise");function Nl(r){return rt(r[Ha])}o(Nl,"isInteropObservable");function Rl(r){return Symbol.asyncIterator&&rt(r==null?void 0:r[Symbol.asyncIterator])}o(Rl,"isAsyncIterable");function Ll(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}o(Ll,"createInvalidObservableTypeError");function Xk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Xk,"getSymbolIterator");var Bl=Xk();function Ul(r){return rt(r==null?void 0:r[Bl])}o(Ul,"isIterable");function Fl(r){return k6(this,arguments,o(function(){var t,n,i,s;return Sl(this,function(a){switch(a.label){case 0:t=r.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Ml(t.read())];case 3:return n=a.sent(),i=n.value,s=n.done,s?[4,Ml(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Ml(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(Fl,"readableStreamLikeToAsyncGenerator");function $l(r){return rt(r==null?void 0:r.getReader)}o($l,"isReadableStreamLike");function hr(r){if(r instanceof _t)return r;if(r!=null){if(Nl(r))return Zk(r);if(za(r))return Qk(r);if(Pl(r))return eC(r);if(Rl(r))return V6(r);if(Ul(r))return tC(r);if($l(r))return rC(r)}throw Ll(r)}o(hr,"innerFrom");function Zk(r){return new _t(function(e){var t=r[Ha]();if(rt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(Zk,"fromInteropObservable");function Qk(r){return new _t(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(Qk,"fromArrayLike");function eC(r){return new _t(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,kl)})}o(eC,"fromPromise");function tC(r){return new _t(function(e){var t,n;try{for(var i=ys(r),s=i.next();!s.done;s=i.next()){var a=s.value;if(e.next(a),e.closed)return}}catch(f){t={error:f}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(tC,"fromIterable");function V6(r){return new _t(function(e){nC(r,e).catch(function(t){return e.error(t)})})}o(V6,"fromAsyncIterable");function rC(r){return V6(Fl(r))}o(rC,"fromReadableStreamLike");function nC(r,e){var t,n,i,s;return T6(this,void 0,void 0,function(){var a,f;return Sl(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=C6(r),u.label=1;case 1:return[4,t.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=u.sent(),i={error:f},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}o(nC,"process");function pn(r,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(s),!i)return s}o(pn,"executeSchedule");function ql(r,e){return e===void 0&&(e=0),Yt(function(t,n){t.subscribe(Jt(n,function(i){return pn(n,r,function(){return n.next(i)},e)},function(){return pn(n,r,function(){return n.complete()},e)},function(i){return pn(n,r,function(){return n.error(i)},e)}))})}o(ql,"observeOn");function Hl(r,e){return e===void 0&&(e=0),Yt(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(Hl,"subscribeOn");function W6(r,e){return hr(r).pipe(Hl(e),ql(e))}o(W6,"scheduleObservable");function G6(r,e){return hr(r).pipe(Hl(e),ql(e))}o(G6,"schedulePromise");function Y6(r,e){return new _t(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(Y6,"scheduleArray");function J6(r,e){return new _t(function(t){var n;return pn(t,e,function(){n=r[Bl](),pn(t,e,function(){var i,s,a;try{i=n.next(),s=i.value,a=i.done}catch(f){t.error(f);return}a?t.complete():t.next(s)},0,!0)}),function(){return rt(n==null?void 0:n.return)&&n.return()}})}o(J6,"scheduleIterable");function jl(r,e){if(!r)throw new Error("Iterable cannot be null");return new _t(function(t){pn(t,e,function(){var n=r[Symbol.asyncIterator]();pn(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(jl,"scheduleAsyncIterable");function X6(r,e){return jl(Fl(r),e)}o(X6,"scheduleReadableStreamLike");function Z6(r,e){if(r!=null){if(Nl(r))return W6(r,e);if(za(r))return Y6(r,e);if(Pl(r))return G6(r,e);if(Rl(r))return jl(r,e);if(Ul(r))return J6(r,e);if($l(r))return X6(r,e)}throw Ll(r)}o(Z6,"scheduled");function Q6(r,e){return e?Z6(r,e):hr(r)}o(Q6,"from");var zl=Fa(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function ew(r){return r instanceof Date&&!isNaN(r)}o(ew,"isValidDate");function Kl(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){n.next(r.call(e,s,i++))}))})}o(Kl,"map");var iC=Array.isArray;function oC(r,e){return iC(e)?r.apply(void 0,In([],qr(e))):r(e)}o(oC,"callOrApply");function tw(r){return Kl(function(e){return oC(r,e)})}o(tw,"mapOneOrManyArgs");function rw(r,e,t,n,i,s,a,f){var u=[],m=0,p=0,x=!1,k=o(function(){x&&!u.length&&!m&&e.complete()},"checkComplete"),O=o(function(C){return m<n?T(C):u.push(C)},"outerNext"),T=o(function(C){s&&e.next(C),m++;var $=!1;hr(t(C,p++)).subscribe(Jt(e,function(I){i==null||i(I),s?O(I):e.next(I)},function(){$=!0},void 0,function(){if($)try{m--;for(var I=o(function(){var U=u.shift();a?pn(e,a,function(){return T(U)}):T(U)},"_loop_1");u.length&&m<n;)I();k()}catch(U){e.error(U)}}))},"doInnerSub");return r.subscribe(Jt(e,O,function(){x=!0,k()})),function(){f==null||f()}}o(rw,"mergeInternals");function ac(r,e,t){return t===void 0&&(t=1/0),rt(e)?ac(function(n,i){return Kl(function(s,a){return e(n,s,i,a)})(hr(r(n,i)))},t):(typeof e=="number"&&(t=e),Yt(function(n,i){return rw(n,i,r,t)}))}o(ac,"mergeMap");function nw(r){return r===void 0&&(r=1/0),ac(ja,r)}o(nw,"mergeAll");var sC=["addListener","removeListener"],aC=["addEventListener","removeEventListener"],fC=["on","off"];function fc(r,e,t,n){if(rt(t)&&(n=t,t=void 0),n)return fc(r,e,t).pipe(tw(n));var i=qr(lC(r)?aC.map(function(f){return function(u){return r[f](e,u,t)}}):cC(r)?sC.map(iw(r,e)):uC(r)?fC.map(iw(r,e)):[],2),s=i[0],a=i[1];if(!s&&za(r))return ac(function(f){return fc(f,e,t)})(hr(r));if(!s)throw new TypeError("Invalid event target");return new _t(function(f){var u=o(function(){for(var m=[],p=0;p<arguments.length;p++)m[p]=arguments[p];return f.next(1<m.length?m:m[0])},"handler");return s(u),function(){return a(u)}})}o(fc,"fromEvent");function iw(r,e){return function(t){return function(n){return r[t](e,n)}}}o(iw,"toCommonHandlerRegistry");function cC(r){return rt(r.addListener)&&rt(r.removeListener)}o(cC,"isNodeStyleEventEmitter");function uC(r){return rt(r.on)&&rt(r.off)}o(uC,"isJQueryStyleEventEmitter");function lC(r){return rt(r.addEventListener)&&rt(r.removeEventListener)}o(lC,"isEventTarget");function cc(r,e,t){r===void 0&&(r=0),t===void 0&&(t=H6);var n=-1;return e!=null&&(Ol(e)?t=e:n=e),new _t(function(i){var s=ew(r)?+r-t.now():r;s<0&&(s=0);var a=0;return t.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(cc,"timer");function Up(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=z6(r),n=K6(r,1/0),i=r;return i.length?i.length===1?hr(i[0]):nw(n)(Q6(i,t)):Il}o(Up,"merge");function ow(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(ow,"filter");function sw(r){return Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(sw,"defaultIfEmpty");function aw(r){return r<=0?function(){return Il}:Yt(function(e,t){var n=0;e.subscribe(Jt(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(aw,"take");function fw(r){return r===void 0&&(r=dC),Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(fw,"throwIfEmpty");function dC(){return new zl}o(dC,"defaultErrorFactory");function Fp(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?ow(function(i,s){return r(i,s,n)}):ja,aw(1),t?sw(e):fw(function(){return new zl}))}}o(Fp,"first");var hC={leading:!0,trailing:!1};function $p(r,e){return e===void 0&&(e=hC),Yt(function(t,n){var i=e.leading,s=e.trailing,a=!1,f=null,u=null,m=!1,p=o(function(){u==null||u.unsubscribe(),u=null,s&&(O(),m&&n.complete())},"endThrottling"),x=o(function(){u=null,m&&n.complete()},"cleanupThrottling"),k=o(function(T){return u=hr(r(T)).subscribe(Jt(n,p,x))},"startThrottle"),O=o(function(){if(a){a=!1;var T=f;f=null,n.next(T),!m&&k(T)}},"send");t.subscribe(Jt(n,function(T){a=!0,f=T,!(u&&!u.closed)&&(i?O():k(T))},function(){m=!0,!(s&&a&&u&&!u.closed)&&n.complete()}))})}o($p,"throttle");var cw;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(cw||(cw={}));var _s;(function(r){r[r.NOT_REQUESTED=0]="NOT_REQUESTED",r[r.PENDING=1]="PENDING",r[r.PROCESSING=2]="PROCESSING",r[r.ANCHORED=3]="ANCHORED",r[r.FAILED=4]="FAILED"})(_s||(_s={}));var Hp;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(Hp||(Hp={}));var Pn=class extends _t{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){var n;let{next:e,content:t}=this.state$.value;return(0,qp.default)((n=e==null?void 0:e.content)!=null?n:t)}get controllers(){return this.metadata.controllers}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return ht.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>ht.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Hp.ANCHOR).map(({cid:e})=>ht.make(this.id,e))}get state(){return(0,qp.default)(this.state$.value)}sync(){return Z(this,arguments,function*(e={}){e=ie({sync:Ct.PREFER_CACHE},e);let t=yield this.api.loadStream(this.id,e);this.state$.next(t.state)})}requestAnchor(){return Z(this,null,function*(){return this.api.requestAnchor(this.id)})}};o(Pn,"Stream");function yo(){return r=>{}}o(yo,"StreamStatic");var mw=at(dw(),1);function hw(r){let e=new AbortController;if(r.length===0)throw Error("Need abort signals to create a merged abort signal");return r.some(t=>t.aborted)?(e.abort(),e.signal):(Up(...r.map(t=>fc(t,"abort"))).pipe(Fp()).subscribe(()=>{e.abort()}),e.signal)}o(hw,"mergeAbortSignals");var uc=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=cc(e).subscribe(()=>{t.abort()})}clear(){var e;(e=this._subscription)==null||e.unsubscribe()}};o(uc,"TimedAbortSignal");function pw(r,e){return Z(this,null,function*(){let t=new AbortController,n=o(()=>{t.abort()},"onAbort");return r.addEventListener("abort",n),r.aborted&&t.abort(),e(t.signal).finally(()=>{r.removeEventListener("abort",n)})})}o(pw,"abortable");var pC=60*1e3*3;function xr(t){return Z(this,arguments,function*(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{"Content-Type":"application/json"}});let n=e.timeout||pC,i=new uc(n),s=e.signal?hw([e.signal,i.signal]):i.signal,a=yield pw(s,f=>(0,mw.default)(String(r),Ae(ie({},e),{signal:f}))).finally(()=>i.clear());if(!a.ok){let f=yield a.text();throw new Error(`HTTP request to '${r}' failed with status '${a.statusText}': ${f}`)}return a.json()})}o(xr,"fetchJson");var lc=at(ic(),1);Vn();function Bi(r){let e=Pe.asCID(r);if(e)return e;if(typeof r=="string")return Pe.parse(r);if(r instanceof Uint8Array)return Pe.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(Bi,"toCID");var bw=0,yt=class{static streamIdFromState(e){return new Je(e.type,e.log[0].cid)}static serializeCommit(e){var n;let t=(0,lc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=It(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=It(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(e)&&(t.link=t.link.toString()),yt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),(n=e.header)!=null&&n.model&&(t.header.model=e.header.model.toString()),t)}static deserializeCommit(e){var n;let t=(0,lc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=Bi(t.jws.link),t.linkedBlock=Rt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Rt(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(t)&&(t.link=Bi(t.link)),yt.isAnchorCommit(t)&&(t.proof=Bi(t.proof)),t.id&&(t.id=Bi(t.id)),t.prev&&(t.prev=Bi(t.prev)),(n=t.header)!=null&&n.model&&(t.header.model=Je.fromString(t.header.model)),t)}static serializeState(e){var n,i,s,a;let t=(0,lc.default)(e);return t.log=t.log.map(f=>Ae(ie({},f),{cid:f.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=_s[t.anchorStatus]),t.anchorScheduledFor!=null&&(t.anchorScheduledFor=new Date(t.anchorScheduledFor).toISOString()),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),(n=e.metadata)!=null&&n.model&&(t.metadata.model=e.metadata.model.toString()),(s=(i=e.next)==null?void 0:i.metadata)!=null&&s.model&&(t.next.metadata.model=e.next.metadata.model.toString()),((a=e.metadata)==null?void 0:a.unique)&&e.type!=bw&&(t.metadata.unique=It(t.metadata.unique,"base64")),t.doctype=kr.nameByCode(t.type),t}static deserializeState(e){var i,s,a,f;let t=(0,lc.default)(e);t.doctype&&(t.type=kr.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(u=>Ae(ie({},u),{cid:Bi(u.cid)})),t.anchorProof&&(t.anchorProof.txHash=Bi(t.anchorProof.txHash),t.anchorProof.root=Bi(t.anchorProof.root));let n=!0;return t.anchorStatus&&(t.anchorStatus=_s[t.anchorStatus],n=t.anchorStatus!==_s.FAILED&&t.anchorStatus!==_s.ANCHORED),t.anchorScheduledFor&&(n?t.anchorScheduledFor=Date.parse(t.anchorScheduledFor):delete t.anchorScheduledFor),(i=e.metadata)!=null&&i.model&&(t.metadata.model=Je.fromString(e.metadata.model)),(a=(s=e.next)==null?void 0:s.metadata)!=null&&a.model&&(t.next.metadata.model=Je.fromString(e.next.metadata.model)),((f=e.metadata)==null?void 0:f.unique)&&e.type!=bw&&(t.metadata.unique=Rt(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(yt.serializeState(e))===JSON.stringify(yt.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(let n in t.log)if(!e.log[n].cid.equals(t.log[n].cid))return!1;return e.anchorStatus==t.anchorStatus}static assertCommitLinksToState(e,t){let n=this.streamIdFromState(e);if(t.id&&!t.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${n.toString()}. Found: ${t.id}, expected ${e.log[0].cid}`);let i=e.log[e.log.length-1].cid;if(!t.prev.equals(i))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${i}, found 'prev' ${t.prev}`)}static convertCommitToSignedCommitContainer(e,t){return Z(this,null,function*(){if(yt.isSignedCommit(e)){let n=yield t.block.get(e.link);return{jws:e,linkedBlock:n}}return e})}static isSignedCommitContainer(e){return e&&e.jws!==void 0}static isSignedCommit(e){return e&&e.link!==void 0}static isAnchorCommit(e){return e&&e.proof!==void 0}static isSignedCommitData(e){return e&&e.envelope!==void 0}static isAnchorCommitData(e){return e&&e.proof!==void 0}};o(yt,"StreamUtils");function gw(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new cs({address:e,chainId:t})}return new cs(r)}o(gw,"normalizeAccountId");var dc=class extends Rp{next(e){let t=this.value;yt.statesEqual(t,e)||super.next(e)}};o(dc,"StreamStateSubject");var mC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Hr,jp={anchor:!0,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},bC={sync:Ct.PREFER_CACHE},vw={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function zp(r,e){var n;if(typeof(r==null?void 0:r.schema)=="string")try{ht.fromString(r.schema)}catch(i){throw new Error("Schema must be a CommitID")}let t={controllers:r==null?void 0:r.controllers,family:r==null?void 0:r.family,schema:(n=r==null?void 0:r.schema)==null?void 0:n.toString(),tags:r==null?void 0:r.tags};if(e)r!=null&&r.deterministic||(t.unique=It((0,ww.randomBytes)(12),"base64")),r!=null&&r.forbidControllerChange&&(t.forbidControllerChange=!0);else{if((r==null?void 0:r.deterministic)!==void 0||(r==null?void 0:r.unique)!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if((r==null?void 0:r.forbidControllerChange)!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(i=>t[i]===void 0&&delete t[i]),t}o(zp,"headerFromMetadata");function yw(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(yw,"_ensureAuthenticated");function Kp(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(Kp,"throwReadOnlyError");var jr=Hr=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,xw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=ie(ie({},jp),i),!(n!=null&&n.deterministic)&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let u=i.asDID?{did:i.asDID}:e,m=yield Hr.makeGenesis(u,t,n);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,m,i)})}static createFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){var f;n=ie(ie({},jp),n),((f=t.header)==null?void 0:f.unique)&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=t.data?yield Hr._signDagJWS(e,t):t;return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static deterministic(i,s){return Z(this,arguments,function*(e,t,n={}){if(n=ie(ie({},jp),n),t=Ae(ie({},t),{deterministic:!0}),t.family==null&&t.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=yield Hr.makeGenesis(e,null,t);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},bC),n);let a=yr.from(t);if(a.type!=Hr.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Hr.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}update(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},vw),n);let a=n.asDID?{did:n.asDID}:this.api,f=yield this.makeCommit(a,e,t),u=yield this.api.applyCommit(this.id,f,n);this.state$.next(u.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},vw),t);let s={header:zp(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},a=yield Hr._signDagJWS(this.api,s),f=yield this.api.applyCommit(this.id,a,t);this.state$.next(f.state)})}makeReadOnly(){this.update=Kp,this.patch=Kp,this.sync=Kp,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}makeCommit(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawCommit(e,t,n);return Hr._signDagJWS(e,i)})}_makeRawCommit(e,t,n){return Z(this,null,function*(){let i=zp(n,!1);if(t==null&&(t=this.content),i.controllers){if(i.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!i.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let s=Pa.compare(this.content,t);return{header:i,data:s,prev:this.tip,id:this.state.log[0].cid}})}static makeGenesis(e,t,n){return Z(this,null,function*(){var a;if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did)yield yw(e),n.controllers=[e.did.hasParent?e.did.parent:e.did.id];else throw new Error("No controllers specified");if(((a=n.controllers)==null?void 0:a.length)!==1)throw new Error("Exactly one controller must be specified");let i=zp(n,!0);if((n==null?void 0:n.deterministic)&&t)throw new Error("Initial content must be null when creating a deterministic Tile document");if(t==null){let f={header:i};return Of(f),f}let s={data:t,header:i};return Hr._signDagJWS(e,s)})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield yw(e),e.did.createDagJWS(t)})}},"TileDocument");jr.STREAM_TYPE_NAME="tile";jr.STREAM_TYPE_ID=0;jr=Hr=mC([yo()],jr);var Cw=at(Mw(),1);function MC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(MC,"_checkPrivateRedeclaration");function AC(r,e){return e.get?e.get.call(r):e.value}o(AC,"_classApplyDescriptorGet");function TC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(TC,"_classApplyDescriptorSet");function kw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(kw,"_classExtractFieldDescriptor");function Gp(r,e){var t=kw(r,e,"get");return AC(r,t)}o(Gp,"_classPrivateFieldGet");function Aw(r,e,t){MC(r,e),e.set(r,t)}o(Aw,"_classPrivateFieldInit");function Tw(r,e,t){var n=kw(r,e,"set");return TC(r,n,t),t}o(Tw,"_classPrivateFieldSet");function kC(r){return typeof r=="string"||ht.isInstance(r)||Je.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(kC,"keyToQuery");function Yp(r){return typeof r=="string"?yr.from(r).toString():ht.isInstance(r)||Je.isInstance(r)?r.toString():r.streamId.toString()}o(Yp,"keyToString");function Xp(r){return Z(this,null,function*(){let e=yield jr.makeGenesis({},null,Ae(ie({},r),{deterministic:!0})),t=yield Je.fromGenesis("tile",e);return{genesis:e,streamId:t}})}o(Xp,"getDeterministicQuery");var CC=o(()=>Promise.resolve([]),"tempBatchLoadFn"),Wl=new WeakMap,Jp=new WeakMap,mn=class extends Cw.default{cache(e){if(!Gp(this,Jp))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}create(e,t,n){return Z(this,null,function*(){let i=yield jr.create(Gp(this,Wl),e,t,n);return this.cache(i),i})}deterministic(e,t){return Z(this,null,function*(){let n=yield Xp(e);try{return yield gd(mn.prototype,this,"load").call(this,n)}catch(i){let s=yield jr.createFromGenesis(Gp(this,Wl),n.genesis,t);return this.cache(s),s}})}load(e){return Z(this,null,function*(){return yield gd(mn.prototype,this,"load").call(this,e)})}update(e,t,n,i){return Z(this,null,function*(){let s=Yp(e);this.clear(s);let a=yield this.load({streamId:s});return yield a.update(t,n,i),a})}constructor(e){super(CC,{cache:!0,cacheKeyFn:Yp,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),Aw(this,Wl,{writable:!0,value:void 0}),Aw(this,Jp,{writable:!0,value:void 0}),this._batchLoadFn=t=>Z(this,null,function*(){e.cache||this.clearAll();let n=yield e.ceramic.multiQuery(t.map(kC),e.multiqueryTimeout);return t.map(i=>{let s=Yp(i),a=n[s];return a||new Error(`Failed to load stream: ${s}`)})}),Tw(this,Wl,e.ceramic),Tw(this,Jp,!!e.cache)}};o(mn,"TileLoader");function DC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(DC,"_checkPrivateRedeclaration");function IC(r,e){return e.get?e.get.call(r):e.value}o(IC,"_classApplyDescriptorGet");function OC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(OC,"_classApplyDescriptorSet");function Iw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Iw,"_classExtractFieldDescriptor");function Es(r,e){var t=Iw(r,e,"get");return IC(r,t)}o(Es,"_classPrivateFieldGet");function Dw(r,e,t){DC(r,e),e.set(r,t)}o(Dw,"_classPrivateFieldInit");function Zp(r,e,t){var n=Iw(r,e,"set");return OC(r,n,t),t}o(Zp,"_classPrivateFieldSet");var Va=new WeakMap,Wa=new WeakMap,Ga=class{get aliases(){return Es(this,Va)}get loader(){return Es(this,Wa)}getDefinitionID(e){var t;return(t=Es(this,Va).definitions[e])!=null?t:null}getSchemaURL(e){var t;return(t=Es(this,Va).schemas[e])!=null?t:null}getTileID(e){var t;return(t=Es(this,Va).tiles[e])!=null?t:null}loadTile(e){return Z(this,null,function*(){let t=this.getTileID(e);if(t==null)throw new Error(`Tile alias "${e}" is not defined`);return yield Es(this,Wa).load(t)})}createTile(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getSchemaURL(e);if(a==null)throw new Error(`Schema alias "${e}" is not defined`);let p=n,{controller:f}=p,u=Im(p,["controller"]),m={schema:a};return f!=null&&(m.controllers=[f]),yield Es(this,Wa).create(t,m,u)})}constructor(e){if(Dw(this,Va,{writable:!0,value:void 0}),Dw(this,Wa,{writable:!0,value:void 0}),Zp(this,Va,e.aliases),e.loader!=null)Zp(this,Wa,e.loader);else{if(e.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");Zp(this,Wa,new mn({ceramic:e.ceramic,cache:e.cache}))}}};o(Ga,"DataModel");function PC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(PC,"_checkPrivateRedeclaration");function NC(r,e){return e.get?e.get.call(r):e.value}o(NC,"_classApplyDescriptorGet");function RC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(RC,"_classApplyDescriptorSet");function Ow(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Ow,"_classExtractFieldDescriptor");function li(r,e){var t=Ow(r,e,"get");return NC(r,t)}o(li,"_classPrivateFieldGet");function Gl(r,e,t){PC(r,e),e.set(r,t)}o(Gl,"_classPrivateFieldInit");function Yl(r,e,t){var n=Ow(r,e,"set");return RC(r,n,t),t}o(Yl,"_classPrivateFieldSet");var Jl=new WeakMap,Ss=new WeakMap,Qp=new WeakMap,Xl=new WeakMap,hc=class{_createValuePromise(){Yl(this,Qp,new Promise((e,t)=>{Yl(this,Xl,{resolve:e,reject:t})}))}change(e){return new Promise((t,n)=>{let i=o(s=>Z(this,null,function*(){try{let a=yield e(s);t(),this._next(a)}catch(a){n(a),this._next(s)}}),"run");li(this,Ss).push({reject:n,run:i}),li(this,Ss).length===1&&this._start()})}changeContent(e){return Z(this,null,function*(){let t=o(n=>Z(this,null,function*(){return yield n.update(e(n.content),n.metadata),n}),"mutation");return yield this.change(t)})}get(){return Z(this,null,function*(){return li(this,Ss).length===0?yield li(this,Jl).call(this):yield li(this,Qp)})}_start(){return Z(this,null,function*(){try{let e=yield li(this,Jl).call(this);this._next(e)}catch(e){li(this,Ss).forEach(t=>{t.reject(e)}),Yl(this,Ss,[]),li(this,Xl).reject(e),this._createValuePromise()}})}_next(e){let t=li(this,Ss).shift();t==null?this._end(e):t.run(e)}_end(e){li(this,Xl).resolve(e),this._createValuePromise()}constructor(e){Gl(this,Jl,{writable:!0,value:void 0}),Gl(this,Ss,{writable:!0,value:[]}),Gl(this,Qp,{writable:!0,value:void 0}),Gl(this,Xl,{writable:!0,value:void 0}),Yl(this,Jl,e),this._createValuePromise()}};o(hc,"TileProxy");var LC=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function BC(r){return LC.test(r)}o(BC,"isDIDstring");function UC(r){if(!BC(r))throw new Error(`Invalid DID: ${r}`)}o(UC,"assertDIDstring");function em(r){return UC(r),{controllers:[r],family:"IDX"}}o(em,"getIDXMetadata");function FC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(FC,"_checkPrivateRedeclaration");function $C(r,e){return e.get?e.get.call(r):e.value}o($C,"_classApplyDescriptorGet");function qC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(qC,"_classApplyDescriptorSet");function Pw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Pw,"_classExtractFieldDescriptor");function Bt(r,e){var t=Pw(r,e,"get");return $C(r,t)}o(Bt,"_classPrivateFieldGet");function pc(r,e,t){FC(r,e),e.set(r,t)}o(pc,"_classPrivateFieldInit");function Zl(r,e,t){var n=Pw(r,e,"set");return qC(r,n,t),t}o(Zl,"_classPrivateFieldSet");var Ui=new WeakMap,Ql=new WeakMap,tm=new WeakMap,di=new WeakMap,ed=new WeakMap,mc=class{get authenticated(){return Bt(this,Ui).did!=null}get ceramic(){return Bt(this,Ui)}get id(){if(Bt(this,Ql)!=null)return Bt(this,Ql);if(Bt(this,Ui).did==null)throw new Error("Ceramic instance is not authenticated");return Bt(this,Ui).did.hasParent?Bt(this,Ui).did.parent:Bt(this,Ui).did.id}get loader(){return Bt(this,di)}get model(){return Bt(this,ed)}has(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return(yield this.getRecordID(n,t))!=null})}get(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return yield this.getRecord(n,t)})}getMultiple(e,t){return Z(this,null,function*(){var f,u,m;let n=this.getDefinitionID(e),i=yield Promise.all(t.map(p=>Z(this,null,function*(){let{genesis:x,streamId:k}=yield Xp(em(p));return{genesis:x,streamId:k.toString(),paths:[n]}}))),s=yield Bt(this,Ui).multiQuery(i),a=[];for(let p of i){let x=(u=(f=s[p.streamId])==null?void 0:f.content)==null?void 0:u[n],k=x?s[Je.fromString(x).toString()]:null;a.push((m=k==null?void 0:k.content)!=null?m:null)}return a})}set(i,s){return Z(this,arguments,function*(e,t,n={}){var m;let a=this.getDefinitionID(e),[f,u]=yield this._setRecordOnly(a,t,n);return f&&(yield this._setReference((m=n.controller)!=null?m:this.id,a,u)),u})}merge(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getDefinitionID(e),f=yield this.getRecord(a),u=f?ie(ie({},f),t):t;return yield this.setRecord(a,u,n)})}setAll(n){return Z(this,arguments,function*(e,t={}){var f;let i=Object.entries(e).map(p=>Z(this,[p],function*([u,m]){let x=this.getDefinitionID(u),[k,O]=yield this._setRecordOnly(x,m,t);return[k,x,O]})),a=(yield Promise.all(i)).reduce((u,[m,p,x])=>(m&&(u[p]=x.toUrl()),u),{});return yield this._setReferences((f=t.controller)!=null?f:this.id,a),a})}setDefaults(n){return Z(this,arguments,function*(e,t={}){var u,m;let i=(u=yield this.getIndex())!=null?u:{},s=Object.entries(e).map(([p,x])=>[this.getDefinitionID(p),x]).filter(p=>i[p[0]]==null).map(k=>Z(this,[k],function*([p,x]){let O=yield this.getDefinition(p),T=yield this._createRecord(O,x,t);return{[p]:T.toUrl()}})),f=(yield Promise.all(s)).reduce((p,x)=>Object.assign(p,x),{});return yield this._setReferences((m=t.controller)!=null?m:this.id,f),f})}remove(n){return Z(this,arguments,function*(e,t=this.id){yield this._getIndexProxy(t).changeContent(i=>(i!=null&&delete i[this.getDefinitionID(e)],i))})}getIndex(){return Z(this,arguments,function*(e=this.id){let t=this.authenticated&&e===this.id?yield this._getIndexProxy(e).get():yield this._getIDXDoc(e);return t?t.content:null})}iterator(e){let t,n=0;return{[Symbol.asyncIterator](){return this},next:()=>Z(this,null,function*(){if(t==null){let f=yield this.getIndex(e);t=Object.entries(f!=null?f:{})}if(n===t.length)return{done:!0,value:null};let[i,s]=t[n++],a=yield Bt(this,di).load(s);return{done:!1,value:{key:i,id:s,record:a.content}}})}}_createIDXDoc(e){return Z(this,null,function*(){return yield Bt(this,di).deterministic(em(e))})}_getIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)return null;if(t.metadata.schema!==ol)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getOwnIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)yield t.update({},{schema:ol});else if(t.metadata.schema!==ol)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getIndexProxy(e){let t=Bt(this,tm)[e];return t==null&&(t=new hc(()=>Z(this,null,function*(){return yield this._getOwnIDXDoc(e)})),Bt(this,tm)[e]=t),t}getDefinitionID(e){var t;return(t=Bt(this,ed).getDefinitionID(e))!=null?t:e}getDefinition(e){return Z(this,null,function*(){let t=yield Bt(this,di).load(e);if(t.metadata.schema!==px)throw new Error("Invalid document: schema is not Definition");return Ae(ie({},t.content),{id:t.id})})}getRecordID(e,t){return Z(this,null,function*(){var i;let n=yield this.getIndex(t!=null?t:this.id);return(i=n==null?void 0:n[e])!=null?i:null})}getRecordDocument(e,t){return Z(this,null,function*(){let n=yield this.getRecordID(e,t);return n?yield Bt(this,di).load(n):null})}getRecord(e,t){return Z(this,null,function*(){let n=yield this.getRecordDocument(e,t);return n?n.content:null})}setRecord(i,s){return Z(this,arguments,function*(e,t,n={}){var u;let[a,f]=yield this._setRecordOnly(e,t,n);return a&&(yield this._setReference((u=n.controller)!=null?u:this.id,e,f)),f})}_setRecordOnly(e,t,n){return Z(this,null,function*(){var s;let i=yield this.getRecordID(e,(s=n.controller)!=null?s:this.id);if(i==null){let a=yield this.getDefinition(e),f=yield this._createRecord(a,t,n);return[!0,f]}else{let a=yield Bt(this,di).update(i,t);return[!1,a.id]}})}_createRecord(s,a,f){return Z(this,arguments,function*(e,t,{controller:n,pin:i}){let u=yield Bt(this,di).deterministic({controllers:[n!=null?n:this.id],family:e.id.toString()},{pin:i});return yield u.update(t,{schema:e.schema}),u.id})}_setReference(e,t,n){return Z(this,null,function*(){yield this._getIndexProxy(e).changeContent(i=>Ae(ie({},i),{[t]:n.toUrl()}))})}_setReferences(e,t){return Z(this,null,function*(){Object.keys(t).length!==0&&(yield this._getIndexProxy(e).changeContent(n=>ie(ie({},n),t)))})}constructor(e){pc(this,Ui,{writable:!0,value:void 0}),pc(this,Ql,{writable:!0,value:void 0}),pc(this,tm,{writable:!0,value:{}}),pc(this,di,{writable:!0,value:void 0}),pc(this,ed,{writable:!0,value:void 0});let{cache:t,ceramic:n,id:i,loader:s,model:a}=e;Zl(this,Ui,n),Zl(this,Ql,i),Zl(this,di,s!=null?s:new mn({ceramic:n,cache:t})),Zl(this,ed,a instanceof Ga?a:new Ga({loader:Bt(this,di),aliases:a}))}};o(mc,"DIDDataStore");function rm(r){return typeof r=="string"?Je.fromString(r):r}o(rm,"typeStreamID");var pr=class extends _t{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=cc(0,n).pipe($p(()=>this._syncState(this.id,{sync:Ct.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{var f;this.state$.observers.length===0&&((f=this.periodicSubscription)==null||f.unsubscribe())})}),this.state$=new dc(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}_syncState(e,t){return Z(this,null,function*(){let n=yield pr._load(e,this._apiUrl,t);this.state$.next(yt.deserializeState(n))})}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}static createFromGenesis(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./streams",e),{state:f}=yield xr(a,{method:"post",body:{type:t,genesis:yt.serializeCommit(n),opts:i}});return new pr(yt.deserializeState(f),e,s)})}static applyCommit(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./commits",e),{state:f}=yield xr(a,{method:"post",body:{streamId:t.toString(),commit:yt.serializeCommit(n),opts:i}});return new pr(yt.deserializeState(f),e,s)})}static _load(e,t,n){return Z(this,null,function*(){let i=new URL(`./streams/${e}`,t);for(let a in n)i.searchParams.set(a,n[a]);let{state:s}=yield xr(i);return s})}static load(e,t,n,i){return Z(this,null,function*(){let s=yield pr._load(e,t,i);return new pr(yt.deserializeState(s),t,n)})}static loadStreamCommits(e,t){return Z(this,null,function*(){let n=new URL(`./commits/${e}`,t),{commits:i}=yield xr(n);return i.map(s=>({cid:s.cid,value:yt.deserializeCommit(s.value)}))})}complete(){this.state$.complete()}};o(pr,"Document");var Rw=at(ic(),1),HC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ms,nm=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),Nw={anchor:!1,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},im={anchor:!0,publish:!0,throwOnInvalidCommit:!0},jC={sync:Ct.PREFER_CACHE},As=Ms=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,Rw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static fromAccount(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},Nw),n);let a=gw(t),f=Ms.makeGenesis(a);return Ms.fromGenesis(e,f,n)})}static fromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){return n=ie(ie({},Nw),n),e.createStreamFromGenesis(Ms.STREAM_TYPE_ID,t,n)})}setDid(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},im),n);let a=typeof e=="string"?e.trim():e.id,f=vd(a);if((f==null?void 0:f.did)!==a)throw new Error(`DID is not valid: '${a}'`);let u=yield t.createLink(a);return this.setDidProof(u,n)})}setDidProof(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},im),t);let i=this.makeCommit(e),s=yield this.api.applyCommit(this.id,i,t);this.state$.next(s.state)})}clearDid(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},im),t);let i=yield e.createLink("");return this.setDidProof(i,t)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},jC),n);let a=yr.from(t);if(a.type!=Ms.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Ms.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}static makeGenesis(e){return e.chainId.namespace==="eip155"&&(e.address=e.address.toLowerCase()),{header:{controllers:[`${e.address}@${e.chainId.toString()}`],family:`caip10-${e.chainId.toString()}`}}}makeCommit(e){return{data:e,prev:this.tip,id:this.id.cid}}makeReadOnly(){this.setDidProof=nm,this.setDid=nm,this.sync=nm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");As.STREAM_TYPE_NAME="caip10-link";As.STREAM_TYPE_ID=1;As=Ms=HC([yo()],As);var o4=at(no(),1);Vn();jo();var s4=at(t4(),1),dD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},mr,hD={sync:Ct.PREFER_CACHE};function r4(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(r4,"_ensureAuthenticated");function n4(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(n4,"throwReadOnlyError");var i4;(function(r){r.LIST="list",r.SINGLE="single"})(i4||(i4={}));var xo=mr=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:mr.MODEL}}static create(e,t,n){return Z(this,null,function*(){mr.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield mr._makeGenesis(e,t,n);return yield e.createStreamFromGenesis(mr.STREAM_TYPE_ID,s,i)})}static createPlaceholder(e,t,n){return Z(this,null,function*(){let i={publish:!1,anchor:!1,pin:!1,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield mr._makeGenesis(e,t,n);return e.createStreamFromGenesis(mr.STREAM_TYPE_ID,s,i)})}replacePlaceholder(e){return Z(this,null,function*(){mr.assertComplete(e,this.id);let t={publish:!0,anchor:!0,pin:!0,throwOnInvalidCommit:!0},n=yield this._makeCommit(this.api,e),i=yield this.api.applyCommit(this.id,n,t);this.state$.next(i.state)})}static assertComplete(e,t){if(!e.name)throw t?new Error(`Model with StreamID ${t.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!e.schema)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'schema' field`):new Error(`Model ${e.name} is missing a 'schema' field`);if(!e.accountRelation)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${e.name} is missing a 'accountRelation' field`)}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},hD),n);let a=yr.from(t);if(a.type!=mr.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${mr.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);let f=yield e.loadStream(a,n);try{mr.assertComplete(f.content,t)}catch(u){throw new Error(`Incomplete placeholder Models cannot be loaded: ${u.message}`)}return f})}_makeCommit(e,t){return Z(this,null,function*(){let n=this._makeRawCommit(t);return mr._signDagJWS(e,n)})}_makeRawCommit(e){if(e==null)throw new Error("Cannot set Model content to null");return{data:Pa.compare(this.content,e),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return mr._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)yield r4(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,o4.randomBytes)(12),model:mr.MODEL.bytes};return{data:t,header:i}})}makeReadOnly(){this.replacePlaceholder=n4,this.sync=n4,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static _signDagJWS(e,t){return Z(this,null,function*(){return yield r4(e),e.did.createDagJWS(t)})}},"Model");xo.STREAM_TYPE_NAME="model";xo.STREAM_TYPE_ID=2;xo.MODEL=function(){let r=Of("model-v1"),e=s4.default.encode(r,"identity"),t=Kn(ga,e),n=Pe.createV1(ga,t);return new Je(mr.STREAM_TYPE_ID,n)}();xo=mr=dD([yo()],xo);var c4=at(no(),1);var pD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Fi,mD={anchor:!0,publish:!0,pin:!0,sync:Ct.NEVER_SYNC,syncTimeoutSeconds:0},bD={sync:Ct.PREFER_CACHE},a4={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function f4(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(f4,"_ensureAuthenticated");function am(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(am,"throwReadOnlyError");var Ts=Fi=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let e=this.state$.value.metadata;return{controller:e.controllers[0],model:e.model}}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=ie(ie({},mD),i);let u=i.asDID?{did:i.asDID}:e,m=yield Fi._makeGenesis(u,t,n);return e.createStreamFromGenesis(Fi.STREAM_TYPE_ID,m,i)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},bD),n);let a=yr.from(t);if(a.type!=Fi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Fi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}replace(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},a4),t);let i=t.asDID?{did:t.asDID}:this.api,s=yield this._makeCommit(i,e),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},a4),t);let i={data:e,prev:this.tip,id:this.id.cid},s=yield Fi._signDagJWS(this.api,i),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}makeReadOnly(){this.replace=am,this.patch=am,this.sync=am,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return Fi._signDagJWS(e,n)}_makeRawCommit(e){return{data:Pa.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return Fi._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");if(!n.controller)if(e.did)yield f4(e),n.controller=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,c4.randomBytes)(12),model:n.model.bytes};return{data:t,header:i}})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield f4(e),e.did.createDagJWS(t)})}},"ModelInstanceDocument");Ts.STREAM_TYPE_NAME="MID";Ts.STREAM_TYPE_ID=3;Ts=Fi=pD([yo()],Ts);var gc=class{constructor(e){this._apiUrl=e}add(e,t){return Z(this,null,function*(){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);yield xr(i,{method:"post",body:n})})}rm(e,t){return Z(this,null,function*(){let n=new URL(`./pins/${e}`,this._apiUrl);yield xr(n,{method:"delete",body:{opts:t}})})}ls(e){return Z(this,null,function*(){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=yield xr(t),{pinnedStreamIds:i}=n;return{[Symbol.asyncIterator](){let s=0;return{next(){return s===i.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:i[s++],done:!1})}}}}})}};o(gc,"RemotePinApi");var vc=class{constructor(e){this._fetchJson=xr,this._collectionURL=new URL("./collection",e)}queryIndex(e){return Z(this,null,function*(){let t=new URL(this._collectionURL);for(let s in e)t.searchParams.set(s,e[s]);let n=yield this._fetchJson(t);return{edges:n.edges.map(s=>({cursor:s.cursor,node:yt.deserializeState(s.node)})),pageInfo:n.pageInfo}})}};o(vc,"RemoteIndexApi");var gD="/api/v0/",vD="http://localhost:7007",yD={syncInterval:5e3},xD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},wD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},u4={sync:Ct.PREFER_CACHE},yc=class{constructor(e=vD,t={}){this._config=ie(ie({},yD),t),this._apiUrl=new URL(gD,e),this._streamCache=new Map,this.context={api:this},this.pin=new gc(this._apiUrl),this.index=new vc(this._apiUrl),this._streamConstructors={[As.STREAM_TYPE_ID]:As,[xo.STREAM_TYPE_ID]:xo,[Ts.STREAM_TYPE_ID]:Ts,[jr.STREAM_TYPE_ID]:jr}}get did(){return this.context.did}set did(e){this.context.did=e}createStreamFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},wD),n);let a=yield pr.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),f=this._streamCache.get(a.id.toString());return f?(yt.statesEqual(a.state,f.state)||f.next(a.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.id.toString(),a),this.buildStreamFromDocument(a))})}loadStream(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},u4),t);let i=yr.from(e),s=this._streamCache.get(i.baseID.toString());return s?yield s._syncState(i,t):(s=yield pr.load(i,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(s.id.toString(),s)),this.buildStreamFromDocument(s)})}multiQuery(e,t){return Z(this,null,function*(){let n=e.map(a=>Ae(ie({},a),{streamId:typeof a.streamId=="string"?a.streamId:a.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=yield xr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((a,f)=>{let[u,m]=f,p=yt.deserializeState(m),x=new pr(p,this._apiUrl,this._config.syncInterval);return a[u]=this.buildStreamFromDocument(x),a},{})})}loadStreamCommits(e){let t=rm(e);return pr.loadStreamCommits(t,this._apiUrl)}applyCommit(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},xD),n);let a=rm(e),f=yield pr.applyCommit(this._apiUrl,a,t,n,this._config.syncInterval),u=this._streamCache.get(a.toString());return u?(u.next(f.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.toString(),f),this.buildStreamFromDocument(f))})}requestAnchor(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},u4),t);let{anchorStatus:i}=yield xr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return i})}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new pr(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(t)}buildStreamFromDocument(e){let t=e.state.type,n=this._streamConstructors[t];if(!n)throw new Error(`Failed to find constructor for stream ${t}`);return new n(e,this.context)}setDID(e){return Z(this,null,function*(){this.context.did=e})}getSupportedChains(){return Z(this,null,function*(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=yield xr(this._apiUrl+"/node/chains");return this._supportedChains=e,e})}close(){return Z(this,null,function*(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()})}};o(yc,"CeramicClient");var _D=o((r,e)=>Z(void 0,null,function*(){let t=new yc(e),n=ie({},l4.default.getResolver()),i=new ds({resolver:n});t.did=i;let s=r.pluginMethods.getKey(),a=new Yf(el(s));return t.did.setProvider(a),yield t.did.authenticate(),t}),"getCeramicClientFromWalletSuite"),rd=o((s,a)=>Z(void 0,[s,a],function*(r,{modelData:e,credentialAlias:t,ceramicEndpoint:n,defaultContentFamily:i}){let f=yield _D(r,n),u=new mn({ceramic:f}),m=new mc({ceramic:f,model:e}),p=o((...C)=>Z(void 0,[...C],function*(T=t){return(yield m.get(T))||{credentials:[]}}),"getCredentialsListFromIndex"),x=o((T,C)=>Z(void 0,null,function*(){if(!T)throw new Error("record is required");if(!T.id)throw Error("No streamId provided");T.id.indexOf("ceramic://")===-1&&(T.id="ceramic://"+T.id),C||(C=t);let $=yield p(C);return $.credentials.push(ie({storageType:"ceramic"},T)),m.set(C,$)}),"addCredentialStreamIdToIndex"),k=o((I,...U)=>Z(void 0,[I,...U],function*(T,C={},$={}){if(!T)throw new Error("content is required");return C.controllers||(C.controllers=[f.did.id]),C.family||(C.family=i),"pin"in $||($.pin=!0),(yield jr.create(f,T,C,$)).id.toString()}),"publishContentToCeramic"),O=o(T=>Z(void 0,null,function*(){var C;return(C=yield u.load(T))==null?void 0:C.content}),"readContentFromCeramic");return{pluginMethods:{getCredentialsListFromIndex:($,...I)=>Z(void 0,[$,...I],function*(T,C=t){return p(C)}),publishContentToCeramic:(T,C)=>Z(void 0,null,function*(){return k(C)}),readContentFromCeramic:(T,C)=>Z(void 0,null,function*(){return O(C)}),getVerifiableCredentialFromIndex:(T,C)=>Z(void 0,null,function*(){var U;let $=yield p(),I=(U=$==null?void 0:$.credentials)==null?void 0:U.find(z=>(z==null?void 0:z.title)===C);return I&&(yield O(I.id))}),getVerifiableCredentialsFromIndex:()=>Z(void 0,null,function*(){var $,I;let T=yield p(),C=(I=($=T==null?void 0:T.credentials)==null?void 0:$.map(U=>U==null?void 0:U.id))!=null?I:[];return Promise.all(C.map(U=>Z(void 0,null,function*(){return O(U)})))}),addVerifiableCredentialInIdx:(I,U)=>Z(void 0,[I,U],function*(T,{title:C,id:$}){return x({title:C,id:$})})}}}),"getIDXPlugin");var ED=o(r=>/^[0-9a-f]+$/i.test(r),"isHex"),d4=o((r,e)=>Z(void 0,null,function*(){if(e.length===0)throw new Error("Please don't use an empty string for a key!");if(!ED(e))throw new Error("Key must be a hexadecimal string!");if(e.length>64)throw new Error("Key must be less than 64 characters");let t=r.pluginMethods.generateEd25519KeyFromBytes(el(e.padStart(64,"0")));return{pluginMethods:{getSubjectDid:(n,i)=>r.pluginMethods.keyToDid(i,t),getSubjectKeypair:()=>t,getKey:()=>e.padStart(64,"0")}}}),"getDidKeyPlugin");var h4=o(r=>({pluginMethods:{verifyCredential:(e,t)=>Z(void 0,null,function*(){let n=yield r.pluginMethods.verifyCredential(t);return t.expirationDate&&new Date>new Date(t.expirationDate)?n.errors.push("expiration error: Credential is expired"):n.checks.push("expiration"),n})}}),"ExpirationPlugin");var p4=o(r=>({}),"recycleDependents");var m4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectKeypair();if(!n)throw new Error("Cannot issue credential: Could not get subject keypair");let i={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",n),proofPurpose:"assertionMethod"};return r.pluginMethods.issueCredential(t,i,n)}),"issueCredential");var b4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyCredential(t)}),"verifyCredential");var g4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectDid("key");if(!n)throw new Error("Cannot create presentation: No holder key found");let i=n,s=e.pluginMethods.getSubjectKeypair();if(!s)throw new Error("Cannot issue credential: Could not get subject keypair");let a={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",s),proofPurpose:"assertionMethod"},f={"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],holder:i,verifiableCredential:t};return r.pluginMethods.issuePresentation(f,a,s)}),"issuePresentation");var v4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyPresentation(t)}),"verifyPresentation");var fm=o(r=>Z(void 0,null,function*(){return{pluginMethods:Ae(ie({},p4(r.pluginMethods)),{issueCredential:m4(r),verifyCredential:b4(r),issuePresentation:g4(r),verifyPresentation:v4(r),getTestVc:(e,t="did:example:d23dd687a7dc6787646f2eb98d0")=>{let n=e.pluginMethods.getSubjectDid("key");return{"@context":["https://www.w3.org/2018/credentials/v1"],id:"http://example.org/credentials/3731",type:["VerifiableCredential"],issuer:n,issuanceDate:"2020-08-19T21:41:50Z",credentialSubject:{id:t}}}})}}),"getVCPlugin");var kt;(function(r){function e(n){throw new Error}o(e,"assertNever"),r.assertNever=e,r.arrayToEnum=n=>{let i={};for(let s of n)i[s]=s;return i},r.getValidEnumValues=n=>{let i=r.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of i)s[a]=n[a];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(i){return n[i]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},r.find=(n,i)=>{for(let s of n)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function t(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}o(t,"joinValues"),r.joinValues=t})(kt||(kt={}));var Me=kt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wo=o(r=>{switch(typeof r){case"undefined":return Me.undefined;case"string":return Me.string;case"number":return isNaN(r)?Me.nan:Me.number;case"boolean":return Me.boolean;case"function":return Me.function;case"bigint":return Me.bigint;case"object":return Array.isArray(r)?Me.array:r===null?Me.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Me.promise:typeof Map!="undefined"&&r instanceof Map?Me.map:typeof Set!="undefined"&&r instanceof Set?Me.set:typeof Date!="undefined"&&r instanceof Date?Me.date:Me.object;default:return Me.unknown}},"getParsedType"),Se=kt.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"]),SD=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),bn=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let f=n,u=0;for(;u<a.path.length;){let m=a.path[u];u===a.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(t(a))):f[m]=f[m]||{_errors:[]},f=f[m],u++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,null,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};o(bn,"ZodError");bn.create=r=>new bn(r);var xc=o((r,e)=>{let t;switch(r.code){case Se.invalid_type:r.received===Me.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Se.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected)}`;break;case Se.unrecognized_keys:t=`Unrecognized key(s) in object: ${kt.joinValues(r.keys,", ")}`;break;case Se.invalid_union:t="Invalid input";break;case Se.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${kt.joinValues(r.options)}`;break;case Se.invalid_enum_value:t=`Invalid enum value. Expected ${kt.joinValues(r.options)}, received '${r.received}'`;break;case Se.invalid_arguments:t="Invalid function arguments";break;case Se.invalid_return_type:t="Invalid function return type";break;case Se.invalid_date:t="Invalid date";break;case Se.invalid_string:r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Se.too_small:r.type==="array"?t=`Array must contain ${r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be greater than ${r.inclusive?"or equal to ":""}${r.minimum}`:t="Invalid input";break;case Se.too_big:r.type==="array"?t=`Array must contain ${r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be less than ${r.inclusive?"or equal to ":""}${r.maximum}`:t="Invalid input";break;case Se.custom:t="Invalid input";break;case Se.invalid_intersection_types:t="Intersection results could not be merged";break;case Se.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;default:t=e.defaultError,kt.assertNever(r)}return{message:t}},"defaultErrorMap"),wc=xc,MD=o(r=>{wc=r},"setErrorMap"),nd=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],a=Ae(ie({},i),{path:s}),f="",u=n.filter(m=>!!m).slice().reverse();for(let m of u)f=m(a,{data:e,defaultError:f}).message;return Ae(ie({},i),{path:s,message:i.message||f})},"makeIssue"),AD=[];function Re(r,e){let t=nd({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wc,xc].filter(n=>!!n)});r.common.issues.push(t)}o(Re,"addIssueToContext");var ir=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return nt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static mergeObjectAsync(e,t){return Z(this,null,function*(){let n=[];for(let i of t)n.push({key:yield i.key,value:yield i.value});return ir.mergeObjectSync(e,n)})}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return nt;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),(typeof a.value!="undefined"||i.alwaysSet)&&(n[s.value]=a.value)}return{status:e.value,value:n}}};o(ir,"ParseStatus");var nt=Object.freeze({status:"aborted"}),TD=o(r=>({status:"dirty",value:r}),"DIRTY"),wr=o(r=>({status:"valid",value:r}),"OK"),cm=o(r=>r.status==="aborted","isAborted"),um=o(r=>r.status==="dirty","isDirty"),id=o(r=>r.status==="valid","isValid"),lm=o(r=>typeof Promise!==void 0&&r instanceof Promise,"isAsync"),xt;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(xt||(xt={}));var zr=class{constructor(e,t,n,i){this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._path.concat(this._key)}};o(zr,"ParseInputLazyPath");var y4=o((r,e)=>{if(id(e))return{success:!0,data:e.value};{if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");let t=new bn(r.common.issues);return{success:!1,error:t}}},"handleResult");function st(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||n))throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((a,f)=>a.code!=="invalid_type"?{message:f.defaultError}:typeof f.data=="undefined"&&n?{message:n}:r.invalid_type_error?{message:r.invalid_type_error}:{message:f.defaultError},"customMap"),description:i}}o(st,"processCreateParams");var ot=class{constructor(e){this.spa=this.safeParseAsync,this.superRefine=this._refinement,this._def=e,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.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return wo(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ir,ctx:{common:e.parent.common,data:e.data,parsedType:wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(lm(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wo(e)},s=this._parseSync({data:e,path:i.path,parent:i});return y4(i,s)}parseAsync(e,t){return Z(this,null,function*(){let n=yield this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error})}safeParseAsync(e,t){return Z(this,null,function*(){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wo(e)},i=this._parse({data:e,path:[],parent:n}),s=yield lm(i)?i:Promise.resolve(i);return y4(n,s)})}refine(e,t){let n=o(i=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let a=e(i),f=o(()=>s.addIssue(ie({code:Se.custom},n(i))),"setError");return typeof Promise!="undefined"&&a instanceof Promise?a.then(u=>u?!0:(f(),!1)):a?!0:(f(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"refinement",refinement:e}})}optional(){return Gr.create(this)}nullable(){return bi.create(this)}nullish(){return this.optional().nullable()}array(){return Kr.create(this)}promise(){return qi.create(this)}or(e){return _o.create([this,e])}and(e){return Eo.create(this,e)}transform(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Za({innerType:this,defaultValue:t,typeName:et.ZodDefault})}describe(e){let t=this.constructor;return new t(Ae(ie({},this._def),{description:e}))}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(ot,"ZodType");var kD=/^c[^\s-]{8,}$/i,CD=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,DD=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Nn=class extends ot{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(i=>e.test(i),ie({validation:t,code:Se.invalid_string},xt.errToObj(n))),this.nonempty=e=>this.min(1,xt.errToObj(e)),this.trim=()=>new Nn(Ae(ie({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}_parse(e){if(this._getType(e)!==Me.string){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.string,received:s.parsedType}),nt}let n=new ir,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_small,minimum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_big,maximum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="email")DD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"email",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")CD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"uuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")kD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"cuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch(a){i=this._getOrReturnCtx(e,i),Re(i,{validation:"url",code:Se.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"regex",code:Se.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():kt.assertNever(s);return{status:n.value,value:e.data}}_addCheck(e){return new Nn(Ae(ie({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(ie({kind:"email"},xt.errToObj(e)))}url(e){return this._addCheck(ie({kind:"url"},xt.errToObj(e)))}uuid(e){return this._addCheck(ie({kind:"uuid"},xt.errToObj(e)))}cuid(e){return this._addCheck(ie({kind:"cuid"},xt.errToObj(e)))}regex(e,t){return this._addCheck(ie({kind:"regex",regex:e},xt.errToObj(t)))}min(e,t){return this._addCheck(ie({kind:"min",value:e},xt.errToObj(t)))}max(e,t){return this._addCheck(ie({kind:"max",value:e},xt.errToObj(t)))}length(e,t){return this.min(e,t).max(e,t)}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=-1/0;return this._def.checks.map(t=>{t.kind==="min"&&(e===null||t.value>e)&&(e=t.value)}),e}get maxLength(){let e=null;return this._def.checks.map(t=>{t.kind==="max"&&(e===null||t.value<e)&&(e=t.value)}),e}};o(Nn,"ZodString");Nn.create=r=>new Nn(ie({checks:[],typeName:et.ZodString},st(r)));function ID(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,s=parseInt(r.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}o(ID,"floatSafeRemainder");var hi=class extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._getType(e)!==Me.number){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.number,received:s.parsedType}),nt}let n,i=new ir;for(let s of this._def.checks)s.kind==="int"?kt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?ID(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):kt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xt.toString(t))}setLimit(e,t,n,i){return new hi(Ae(ie({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:xt.toString(i)}]}))}_addCheck(e){return new hi(Ae(ie({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:xt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xt.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};o(hi,"ZodNumber");hi.create=r=>new hi(ie({checks:[],typeName:et.ZodNumber},st(r)));var ks=class extends ot{_parse(e){if(this._getType(e)!==Me.bigint){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.bigint,received:n.parsedType}),nt}return wr(e.data)}};o(ks,"ZodBigInt");ks.create=r=>new ks(ie({typeName:et.ZodBigInt},st(r)));var Cs=class extends ot{_parse(e){if(this._getType(e)!==Me.boolean){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.boolean,received:n.parsedType}),nt}return wr(e.data)}};o(Cs,"ZodBoolean");Cs.create=r=>new Cs(ie({typeName:et.ZodBoolean},st(r)));var Ds=class extends ot{_parse(e){if(this._getType(e)!==Me.date){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.date,received:n.parsedType}),nt}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_date}),nt}return{status:"valid",value:new Date(e.data.getTime())}}};o(Ds,"ZodDate");Ds.create=r=>new Ds(ie({typeName:et.ZodDate},st(r)));var Is=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.undefined,received:n.parsedType}),nt}return wr(e.data)}};o(Is,"ZodUndefined");Is.create=r=>new Is(ie({typeName:et.ZodUndefined},st(r)));var Os=class extends ot{_parse(e){if(this._getType(e)!==Me.null){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.null,received:n.parsedType}),nt}return wr(e.data)}};o(Os,"ZodNull");Os.create=r=>new Os(ie({typeName:et.ZodNull},st(r)));var $i=class extends ot{constructor(){super(...arguments),this._any=!0}_parse(e){return wr(e.data)}};o($i,"ZodAny");$i.create=r=>new $i(ie({typeName:et.ZodAny},st(r)));var Rn=class extends ot{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wr(e.data)}};o(Rn,"ZodUnknown");Rn.create=r=>new Rn(ie({typeName:et.ZodUnknown},st(r)));var Ln=class extends ot{_parse(e){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_type,expected:Me.never,received:t.parsedType}),nt}};o(Ln,"ZodNever");Ln.create=r=>new Ln(ie({typeName:et.ZodNever},st(r)));var Ps=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.void,received:n.parsedType}),nt}return wr(e.data)}};o(Ps,"ZodVoid");Ps.create=r=>new Ps(ie({typeName:et.ZodVoid},st(r)));var Kr=class extends ot{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==Me.array)return Re(t,{code:Se.invalid_type,expected:Me.array,received:t.parsedType}),nt;if(i.minLength!==null&&t.data.length<i.minLength.value&&(Re(t,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(Re(t,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all(t.data.map((a,f)=>i.type._parseAsync(new zr(t,a,t.path,f)))).then(a=>ir.mergeArray(n,a));let s=t.data.map((a,f)=>i.type._parseSync(new zr(t,a,t.path,f)));return ir.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Kr(Ae(ie({},this._def),{minLength:{value:e,message:xt.toString(t)}}))}max(e,t){return new Kr(Ae(ie({},this._def),{maxLength:{value:e,message:xt.toString(t)}}))}length(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Kr,"ZodArray");Kr.create=(r,e)=>new Kr(ie({type:r,minLength:null,maxLength:null,typeName:et.ZodArray},st(e)));var od;(function(r){r.mergeShapes=(e,t)=>ie(ie({},e),t)})(od||(od={}));var x4=o(r=>e=>new Et(Ae(ie({},r),{shape:()=>ie(ie({},r.shape()),e)})),"AugmentFactory");function Xa(r){if(r instanceof Et){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Gr.create(Xa(n))}return new Et(Ae(ie({},r._def),{shape:()=>e}))}else return r instanceof Kr?Kr.create(Xa(r.element)):r instanceof Gr?Gr.create(Xa(r.unwrap())):r instanceof bi?bi.create(Xa(r.unwrap())):r instanceof Vr?Vr.create(r.items.map(e=>Xa(e))):r}o(Xa,"deepPartialify");var Et=class extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=x4(this._def),this.extend=x4(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=kt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Me.object){let m=this._getOrReturnCtx(e);return Re(m,{code:Se.invalid_type,expected:Me.object,received:m.parsedType}),nt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),f=[];for(let m in i.data)a.includes(m)||f.push(m);let u=[];for(let m of a){let p=s[m],x=i.data[m];u.push({key:{status:"valid",value:m},value:p._parse(new zr(i,x,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof Ln){let m=this._def.unknownKeys;if(m==="passthrough")for(let p of f)u.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(m==="strict")f.length>0&&(Re(i,{code:Se.unrecognized_keys,keys:f}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let p of f){let x=i.data[p];u.push({key:{status:"valid",value:p},value:m._parse(new zr(i,x,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(()=>Z(this,null,function*(){let m=[];for(let p of u){let x=yield p.key;m.push({key:x,value:yield p.value,alwaysSet:p.alwaysSet})}return m})).then(m=>ir.mergeObjectSync(n,m)):ir.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return xt.errToObj,new Et(ie(Ae(ie({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,a,f;let u=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&a!==void 0?a:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=xt.errToObj(e).message)!==null&&f!==void 0?f:u}:{message:u}}}:{}))}strip(){return new Et(Ae(ie({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Et(Ae(ie({},this._def),{unknownKeys:"passthrough"}))}setKey(e,t){return this.augment({[e]:t})}merge(e){return new Et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>od.mergeShapes(this._def.shape(),e._def.shape()),typeName:et.ZodObject})}catchall(e){return new Et(Ae(ie({},this._def),{catchall:e}))}pick(e){let t={};return kt.objectKeys(e).map(n=>{this.shape[n]&&(t[n]=this.shape[n])}),new Et(Ae(ie({},this._def),{shape:()=>t}))}omit(e){let t={};return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1&&(t[n]=this.shape[n])}),new Et(Ae(ie({},this._def),{shape:()=>t}))}deepPartial(){return Xa(this)}partial(e){let t={};if(e)return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1?t[n]=this.shape[n]:t[n]=this.shape[n].optional()}),new Et(Ae(ie({},this._def),{shape:()=>t}));for(let n in this.shape){let i=this.shape[n];t[n]=i.optional()}return new Et(Ae(ie({},this._def),{shape:()=>t}))}required(){let e={};for(let t in this.shape){let i=this.shape[t];for(;i instanceof Gr;)i=i._def.innerType;e[t]=i}return new Et(Ae(ie({},this._def),{shape:()=>e}))}};o(Et,"ZodObject");Et.create=(r,e)=>new Et(ie({shape:()=>r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.strictCreate=(r,e)=>new Et(ie({shape:()=>r,unknownKeys:"strict",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.lazycreate=(r,e)=>new Et(ie({shape:r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));var _o=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let f of s)if(f.result.status==="valid")return f.result;for(let f of s)if(f.result.status==="dirty")return t.common.issues.push(...f.ctx.common.issues),f.result;let a=s.map(f=>new bn(f.ctx.common.issues));return Re(t,{code:Se.invalid_union,unionErrors:a}),nt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(s=>Z(this,null,function*(){let a=Ae(ie({},t),{common:Ae(ie({},t.common),{issues:[]}),parent:null});return{result:yield s._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then(i);{let s,a=[];for(let u of n){let m=Ae(ie({},t),{common:Ae(ie({},t.common),{issues:[]}),parent:null}),p=u._parseSync({data:t.data,path:t.path,parent:m});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:m}),m.common.issues.length&&a.push(m.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let f=a.map(u=>new bn(u));return Re(t,{code:Se.invalid_union,unionErrors:f}),nt}}get options(){return this._def.options}};o(_o,"ZodUnion");_o.create=(r,e)=>new _o(ie({options:r,typeName:et.ZodUnion},st(e)));var Ns=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.object)return Re(t,{code:Se.invalid_type,expected:Me.object,received:t.parsedType}),nt;let n=this.discriminator,i=t.data[n],s=this.options.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(Re(t,{code:Se.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[n]}),nt)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(e,t,n){let i=new Map;try{t.forEach(s=>{let a=s.shape[e].value;i.set(a,s)})}catch(s){throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==t.length)throw new Error("Some of the discriminator values are not unique");return new Ns(ie({typeName:et.ZodDiscriminatedUnion,discriminator:e,options:i},st(n)))}};o(Ns,"ZodDiscriminatedUnion");function dm(r,e){let t=wo(r),n=wo(e);if(r===e)return{valid:!0,data:r};if(t===Me.object&&n===Me.object){let i=kt.objectKeys(e),s=kt.objectKeys(r).filter(f=>i.indexOf(f)!==-1),a=ie(ie({},r),e);for(let f of s){let u=dm(r[f],e[f]);if(!u.valid)return{valid:!1};a[f]=u.data}return{valid:!0,data:a}}else if(t===Me.array&&n===Me.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let a=r[s],f=e[s],u=dm(a,f);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===Me.date&&n===Me.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(dm,"mergeValues");var Eo=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,a)=>{if(cm(s)||cm(a))return nt;let f=dm(s.value,a.value);return f.valid?((um(s)||um(a))&&t.dirty(),{status:t.value,value:f.data}):(Re(n,{code:Se.invalid_intersection_types}),nt)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(Eo,"ZodIntersection");Eo.create=(r,e,t)=>new Eo(ie({left:r,right:e,typeName:et.ZodIntersection},st(t)));var Vr=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.array)return Re(n,{code:Se.invalid_type,expected:Me.array,received:n.parsedType}),nt;if(n.data.length<this._def.items.length)return Re(n,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),nt;!this._def.rest&&n.data.length>this._def.items.length&&(Re(n,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),t.dirty());let s=n.data.map((a,f)=>{let u=this._def.items[f]||this._def.rest;return u?u._parse(new zr(n,a,n.path,f)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>ir.mergeArray(t,a)):ir.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Vr(Ae(ie({},this._def),{rest:e}))}};o(Vr,"ZodTuple");Vr.create=(r,e)=>new Vr(ie({items:r,typeName:et.ZodTuple,rest:null},st(e)));var So=class extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.object)return Re(n,{code:Se.invalid_type,expected:Me.object,received:n.parsedType}),nt;let i=[],s=this._def.keyType,a=this._def.valueType;for(let f in n.data)i.push({key:s._parse(new zr(n,f,n.path,f)),value:a._parse(new zr(n,n.data[f],n.path,f))});return n.common.async?ir.mergeObjectAsync(t,i):ir.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ot?new So(ie({keyType:e,valueType:t,typeName:et.ZodRecord},st(n))):new So(ie({keyType:Nn.create(),valueType:e,typeName:et.ZodRecord},st(t)))}};o(So,"ZodRecord");var Rs=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.map)return Re(n,{code:Se.invalid_type,expected:Me.map,received:n.parsedType}),nt;let i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([f,u],m)=>({key:i._parse(new zr(n,f,n.path,[m,"key"])),value:s._parse(new zr(n,u,n.path,[m,"value"]))}));if(n.common.async){let f=new Map;return Promise.resolve().then(()=>Z(this,null,function*(){for(let u of a){let m=yield u.key,p=yield u.value;if(m.status==="aborted"||p.status==="aborted")return nt;(m.status==="dirty"||p.status==="dirty")&&t.dirty(),f.set(m.value,p.value)}return{status:t.value,value:f}}))}else{let f=new Map;for(let u of a){let m=u.key,p=u.value;if(m.status==="aborted"||p.status==="aborted")return nt;(m.status==="dirty"||p.status==="dirty")&&t.dirty(),f.set(m.value,p.value)}return{status:t.value,value:f}}}};o(Rs,"ZodMap");Rs.create=(r,e,t)=>new Rs(ie({valueType:e,keyType:r,typeName:et.ZodMap},st(t)));var pi=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.set)return Re(n,{code:Se.invalid_type,expected:Me.set,received:n.parsedType}),nt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Re(n,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Re(n,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function a(u){let m=new Set;for(let p of u){if(p.status==="aborted")return nt;p.status==="dirty"&&t.dirty(),m.add(p.value)}return{status:t.value,value:m}}o(a,"finalizeSet");let f=[...n.data.values()].map((u,m)=>s._parse(new zr(n,u,n.path,m)));return n.common.async?Promise.all(f).then(u=>a(u)):a(f)}min(e,t){return new pi(Ae(ie({},this._def),{minSize:{value:e,message:xt.toString(t)}}))}max(e,t){return new pi(Ae(ie({},this._def),{maxSize:{value:e,message:xt.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(pi,"ZodSet");pi.create=(r,e)=>new pi(ie({valueType:r,minSize:null,maxSize:null,typeName:et.ZodSet},st(e)));var mi=class extends ot{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.function)return Re(t,{code:Se.invalid_type,expected:Me.function,received:t.parsedType}),nt;function n(f,u){return nd({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wc,xc].filter(m=>!!m),issueData:{code:Se.invalid_arguments,argumentsError:u}})}o(n,"makeArgsIssue");function i(f,u){return nd({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wc,xc].filter(m=>!!m),issueData:{code:Se.invalid_return_type,returnTypeError:u}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},a=t.data;return this._def.returns instanceof qi?wr((...f)=>Z(this,null,function*(){let u=new bn([]),m=yield this._def.args.parseAsync(f,s).catch(k=>{throw u.addIssue(n(f,k)),u}),p=yield a(...m);return yield this._def.returns._def.type.parseAsync(p,s).catch(k=>{throw u.addIssue(i(p,k)),u})})):wr((...f)=>{let u=this._def.args.safeParse(f,s);if(!u.success)throw new bn([n(f,u.error)]);let m=a(...u.data),p=this._def.returns.safeParse(m,s);if(!p.success)throw new bn([i(m,p.error)]);return p.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mi(Ae(ie({},this._def),{args:Vr.create(e).rest(Rn.create())}))}returns(e){return new mi(Ae(ie({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}};o(mi,"ZodFunction");mi.create=(r,e,t)=>new mi(ie({args:r?r.rest(Rn.create()):Vr.create([]).rest(Rn.create()),returns:e||Rn.create(),typeName:et.ZodFunction},st(t)));var Ls=class extends ot{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};o(Ls,"ZodLazy");Ls.create=(r,e)=>new Ls(ie({getter:r,typeName:et.ZodLazy},st(e)));var Bs=class extends ot{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(Bs,"ZodLiteral");Bs.create=(r,e)=>new Bs(ie({value:r,typeName:et.ZodLiteral},st(e)));function OD(r,e){return new Us(ie({values:r,typeName:et.ZodEnum},st(e)))}o(OD,"createZodEnum");var Us=class extends ot{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{expected:kt.joinValues(n),received:t.parsedType,code:Se.invalid_type}),nt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{received:t.data,code:Se.invalid_enum_value,options:n}),nt}return wr(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}};o(Us,"ZodEnum");Us.create=OD;var Fs=class extends ot{_parse(e){let t=kt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Me.string&&n.parsedType!==Me.number){let i=kt.objectValues(t);return Re(n,{expected:kt.joinValues(i),received:n.parsedType,code:Se.invalid_type}),nt}if(t.indexOf(e.data)===-1){let i=kt.objectValues(t);return Re(n,{received:n.data,code:Se.invalid_enum_value,options:i}),nt}return wr(e.data)}get enum(){return this._def.values}};o(Fs,"ZodNativeEnum");Fs.create=(r,e)=>new Fs(ie({values:r,typeName:et.ZodNativeEnum},st(e)));var qi=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.promise&&t.common.async===!1)return Re(t,{code:Se.invalid_type,expected:Me.promise,received:t.parsedType}),nt;let n=t.parsedType===Me.promise?t.data:Promise.resolve(t.data);return wr(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(qi,"ZodPromise");qi.create=(r,e)=>new qi(ie({type:r,typeName:et.ZodPromise},st(e)));var Wr=class extends ot{innerType(){return this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let a=i.transform(n.data);return n.common.async?Promise.resolve(a).then(f=>this._def.schema._parseAsync({data:f,path:n.path,parent:n})):this._def.schema._parseSync({data:a,path:n.path,parent:n})}let s={addIssue:a=>{Re(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="refinement"){let a=o(f=>{let u=i.refinement(f,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f},"executeRefinement");if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value),{status:t.value,value:f.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value).then(()=>({status:t.value,value:f.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!id(a))return a;let f=i.transform(a.value,s);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:f}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>id(a)?Promise.resolve(i.transform(a.value,s)).then(f=>({status:t.value,value:f})):a);kt.assertNever(i)}};o(Wr,"ZodEffects");Wr.create=(r,e,t)=>new Wr(ie({schema:r,typeName:et.ZodEffects,effect:e},st(t)));Wr.createWithPreprocess=(r,e,t)=>new Wr(ie({schema:e,effect:{type:"preprocess",transform:r},typeName:et.ZodEffects},st(t)));var Gr=class extends ot{_parse(e){return this._getType(e)===Me.undefined?wr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Gr,"ZodOptional");Gr.create=(r,e)=>new Gr(ie({innerType:r,typeName:et.ZodOptional},st(e)));var bi=class extends ot{_parse(e){return this._getType(e)===Me.null?wr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(bi,"ZodNullable");bi.create=(r,e)=>new bi(ie({innerType:r,typeName:et.ZodNullable},st(e)));var Za=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(Za,"ZodDefault");Za.create=(r,e)=>new Gr(ie({innerType:r,typeName:et.ZodOptional},st(e)));var $s=class extends ot{_parse(e){if(this._getType(e)!==Me.nan){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.nan,received:n.parsedType}),nt}return{status:"valid",value:e.data}}};o($s,"ZodNaN");$s.create=r=>new $s(ie({typeName:et.ZodNaN},st(r)));var _4=o((r,e={},t)=>r?$i.create().superRefine((n,i)=>{if(!r(n)){let s=typeof e=="function"?e(n):e,a=typeof s=="string"?{message:s}:s;i.addIssue(Ae(ie({code:"custom"},a),{fatal:t}))}}):$i.create(),"custom"),PD={object:Et.lazycreate},et;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodPromise="ZodPromise"})(et||(et={}));var ND=o((r,e={message:`Input not instance of ${r.name}`})=>_4(t=>t instanceof r,e,!0),"instanceOfType"),E4=Nn.create,S4=hi.create,RD=$s.create,LD=ks.create,M4=Cs.create,BD=Ds.create,UD=Is.create,FD=Os.create,$D=$i.create,qD=Rn.create,HD=Ln.create,jD=Ps.create,zD=Kr.create,KD=Et.create,VD=Et.strictCreate,WD=_o.create,GD=Ns.create,YD=Eo.create,JD=Vr.create,XD=So.create,ZD=Rs.create,QD=pi.create,eI=mi.create,tI=Ls.create,rI=Bs.create,nI=Us.create,iI=Fs.create,oI=qi.create,w4=Wr.create,sI=Gr.create,aI=bi.create,fI=Wr.createWithPreprocess,cI=o(()=>E4().optional(),"ostring"),uI=o(()=>S4().optional(),"onumber"),lI=o(()=>M4().optional(),"oboolean"),oe=Object.freeze({__proto__:null,getParsedType:wo,ZodParsedType:Me,makeIssue:nd,EMPTY_PATH:AD,addIssueToContext:Re,ParseStatus:ir,INVALID:nt,DIRTY:TD,OK:wr,isAborted:cm,isDirty:um,isValid:id,isAsync:lm,ZodType:ot,ZodString:Nn,ZodNumber:hi,ZodBigInt:ks,ZodBoolean:Cs,ZodDate:Ds,ZodUndefined:Is,ZodNull:Os,ZodAny:$i,ZodUnknown:Rn,ZodNever:Ln,ZodVoid:Ps,ZodArray:Kr,get objectUtil(){return od},ZodObject:Et,ZodUnion:_o,ZodDiscriminatedUnion:Ns,ZodIntersection:Eo,ZodTuple:Vr,ZodRecord:So,ZodMap:Rs,ZodSet:pi,ZodFunction:mi,ZodLazy:Ls,ZodLiteral:Bs,ZodEnum:Us,ZodNativeEnum:Fs,ZodPromise:qi,ZodEffects:Wr,ZodTransformer:Wr,ZodOptional:Gr,ZodNullable:bi,ZodDefault:Za,ZodNaN:$s,custom:_4,Schema:ot,ZodSchema:ot,late:PD,get ZodFirstPartyTypeKind(){return et},any:$D,array:zD,bigint:LD,boolean:M4,date:BD,discriminatedUnion:GD,effect:w4,enum:nI,function:eI,instanceof:ND,intersection:YD,lazy:tI,literal:rI,map:ZD,nan:RD,nativeEnum:iI,never:HD,null:FD,nullable:aI,number:S4,object:KD,oboolean:lI,onumber:uI,optional:sI,ostring:cI,preprocess:fI,promise:oI,record:XD,set:QD,strictObject:VD,string:E4,transformer:w4,tuple:JD,undefined:UD,union:WD,unknown:qD,void:jD,ZodIssueCode:Se,quotelessJson:SD,ZodError:bn,defaultErrorMap:xc,get overrideErrorMap(){return wc},setErrorMap:MD});var k4=oe.string().array(),qV=oe.object({type:oe.string().optional(),narrative:oe.string().optional()}),pm=oe.string().or(oe.object({id:oe.string(),type:oe.string(),caption:oe.string().optional()})),dI=oe.object({type:oe.string().array().nonempty(),latitude:oe.number(),longitude:oe.number()}),hI=oe.object({type:oe.string().array().nonempty(),addressCountry:oe.string().optional(),addressCountryCode:oe.string().optional(),addressRegion:oe.string().optional(),addressLocality:oe.string().optional(),streetAddress:oe.string().optional(),postOfficeBoxNumber:oe.string().optional(),postalCode:oe.string().optional(),geo:dI.optional()}),pI=oe.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(oe.string()),C4=oe.object({type:oe.string().array().nonempty(),identifier:oe.string(),identifierType:pI}),_c=oe.string().or(oe.object({id:oe.string().optional(),type:oe.string().array().nonempty().optional(),name:oe.string().optional(),url:oe.string().optional(),phone:oe.string().optional(),description:oe.string().optional(),endorsement:oe.any().array().optional(),image:pm.optional(),email:oe.string().email().optional(),address:hI.optional(),otherIdentifier:C4.array().optional(),official:oe.string().optional(),parentOrg:oe.any().optional(),familyName:oe.string().optional(),givenName:oe.string().optional(),additionalName:oe.string().optional(),patronymicName:oe.string().optional(),honorificPrefix:oe.string().optional(),honorificSuffix:oe.string().optional(),familyNamePrefix:oe.string().optional(),dateOfBirth:oe.string().optional()}).catchall(oe.any())),hm=oe.object({id:oe.string().optional()}).catchall(oe.any()),mI=oe.object({type:oe.string(),id:oe.string()}),bI=oe.object({id:oe.string(),type:oe.string()}),gI=oe.object({id:oe.string(),type:oe.string()}).catchall(oe.any()),sd=oe.object({"@context":k4,id:oe.string().optional(),type:oe.string().array().nonempty(),issuer:_c,issuanceDate:oe.string(),expirationDate:oe.string().optional(),credentialSubject:hm.or(hm.array()),credentialStatus:mI.optional(),credentialSchema:bI.array().optional(),refreshService:gI.optional()}).catchall(oe.any()),Mo=oe.object({type:oe.string(),created:oe.string(),challenge:oe.string().optional(),domain:oe.string().optional(),nonce:oe.string().optional(),proofPurpose:oe.string(),verificationMethod:oe.string(),jws:oe.string().optional()}).catchall(oe.any()),A4=sd.extend({proof:Mo.or(Mo.array())}),vI=oe.object({"@context":k4,id:oe.string().optional(),type:oe.string().array().nonempty(),verifiableCredential:A4.or(A4.array()),holder:oe.string().optional()}).catchall(oe.any()),HV=vI.extend({proof:Mo.or(Mo.array())}),yI=oe.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(oe.string()),ad=oe.object({type:oe.string().array().nonempty(),targetCode:oe.string().optional(),targetDescription:oe.string().optional(),targetName:oe.string(),targetFramework:oe.string().optional(),targetType:yI.optional(),targetUrl:oe.string()}),xI=oe.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]).or(oe.string()),wI=oe.object({id:oe.string().optional(),narrative:oe.string().optional()}).catchall(oe.any()),_I=oe.object({id:oe.string(),type:oe.string().array().nonempty(),endorsementComment:oe.string().optional()}),EI=sd.extend({credentialSubject:_I,proof:Mo.or(Mo.array()).optional()}),SI=oe.object({id:oe.string(),"@language":oe.string().optional(),version:oe.string().optional()}),MI=oe.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(oe.string()),AI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ad.array().optional(),description:oe.string().optional(),level:oe.string().optional(),name:oe.string(),points:oe.string().optional()}).catchall(oe.any()),TI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ad.array().optional(),allowedValue:oe.string().array().optional(),name:oe.string(),requiredLevel:oe.string().optional(),requiredValue:oe.string().optional(),resultType:MI,rubricCriterionLevel:AI.array().optional(),valueMax:oe.string().optional(),valueMin:oe.string().optional()}).catchall(oe.any()),kI=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),alignment:ad.array().optional(),achievementType:xI.optional(),creator:_c.optional(),creditsAvailable:oe.number().optional(),criteria:wI,description:oe.string(),endorsement:EI.array().optional(),fieldOfStudy:oe.string().optional(),humanCode:oe.string().optional(),image:pm.optional(),"@language":oe.string().optional(),name:oe.string(),otherIdentifier:C4.array().optional(),related:SI.array().optional(),resultDescription:TI.array().optional(),specialization:oe.string().optional(),tag:oe.string().array().optional(),version:oe.string().optional()}).catchall(oe.any()),CI=oe.object({type:oe.string(),hashed:oe.boolean(),identityHash:oe.string(),identityType:oe.string(),salt:oe.string().optional()}),DI=oe.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),II=oe.object({type:oe.string().array().nonempty(),achievedLevel:oe.string().optional(),alignment:ad.array().optional(),resultDescription:oe.string().optional(),status:DI.optional(),value:oe.string().optional()}).catchall(oe.any()),T4=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),activityEndDate:oe.string().optional(),activityStartDate:oe.string().optional(),creditsEarned:oe.number().optional(),achievement:kI.optional(),identifier:CI.optional(),image:pm.optional(),licenseNumber:oe.string().optional(),narrative:oe.string().optional(),result:II.array().optional(),role:oe.string().optional(),source:_c.optional(),term:oe.string().optional()}).catchall(oe.any()),OI=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),narrative:oe.string().optional(),name:oe.string().optional(),description:oe.string().optional(),genre:oe.string().optional(),audience:oe.string().optional()}).catchall(oe.any()),PI=sd.extend({name:oe.string().optional(),description:oe.string().optional(),image:oe.string().optional(),credentialSubject:T4.or(T4.array()),endorsement:sd.array().optional(),evidence:OI.array().optional()}),zV=PI.extend({proof:Mo.or(Mo.array())}),VV=oe.object({checks:oe.string().array(),warnings:oe.string().array(),errors:oe.string().array()}),D4=oe.enum(["Success","Failed","Error"]),fd=D4.enum,WV=oe.object({check:oe.string(),status:D4,message:oe.string().optional(),details:oe.string().optional()}),GV=oe.object({title:oe.string().optional(),createdAt:oe.string().optional(),issuer:_c.optional(),issuee:_c.optional(),credentialSubject:hm.optional()});function Ht(r){if(r===null||r===!0||r===!1)return NaN;var e=Number(r);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}o(Ht,"toInteger");function pt(r,e){if(e.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+e.length+" present")}o(pt,"requiredArgs");function Ut(r){pt(1,arguments);var e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new Date(r.getTime()):typeof r=="number"||e==="[object Number]"?new Date(r):((typeof r=="string"||e==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}o(Ut,"toDate");function mm(r,e){pt(2,arguments);var t=Ut(r).getTime(),n=Ht(e);return new Date(t+n)}o(mm,"addMilliseconds");function bm(r){var e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),r.getTime()-e.getTime()}o(bm,"getTimezoneOffsetInMilliseconds");function gm(r){return pt(1,arguments),r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}o(gm,"isDate");function vm(r){if(pt(1,arguments),!gm(r)&&typeof r!="number")return!1;var e=Ut(r);return!isNaN(Number(e))}o(vm,"isValid");var NI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},RI=o(function(r,e,t){var n,i=NI[r];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n},"formatDistance"),I4=RI;function Ec(r){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):r.defaultWidth,n=r.formats[t]||r.formats[r.defaultWidth];return n}}o(Ec,"buildFormatLongFn");var LI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},BI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},UI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},FI={date:Ec({formats:LI,defaultWidth:"full"}),time:Ec({formats:BI,defaultWidth:"full"}),dateTime:Ec({formats:UI,defaultWidth:"full"})},O4=FI;var $I={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qI=o(function(r,e,t,n){return $I[r]},"formatRelative"),P4=qI;function qs(r){return function(e,t){var n=t||{},i=n.context?String(n.context):"standalone",s;if(i==="formatting"&&r.formattingValues){var a=r.defaultFormattingWidth||r.defaultWidth,f=n.width?String(n.width):a;s=r.formattingValues[f]||r.formattingValues[a]}else{var u=r.defaultWidth,m=n.width?String(n.width):r.defaultWidth;s=r.values[m]||r.values[u]}var p=r.argumentCallback?r.argumentCallback(e):e;return s[p]}}o(qs,"buildLocalizeFn");var HI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},KI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},VI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},WI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},GI=o(function(r,e){var t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},"ordinalNumber"),YI={ordinalNumber:GI,era:qs({values:HI,defaultWidth:"wide"}),quarter:qs({values:jI,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:qs({values:zI,defaultWidth:"wide"}),day:qs({values:KI,defaultWidth:"wide"}),dayPeriod:qs({values:VI,defaultWidth:"wide",formattingValues:WI,defaultFormattingWidth:"wide"})},N4=YI;function Hs(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(i);if(!s)return null;var a=s[0],f=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],u=Array.isArray(f)?XI(f,function(x){return x.test(a)}):JI(f,function(x){return x.test(a)}),m;m=r.valueCallback?r.valueCallback(u):u,m=t.valueCallback?t.valueCallback(m):m;var p=e.slice(a.length);return{value:m,rest:p}}}o(Hs,"buildMatchFn");function JI(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}o(JI,"findKey");function XI(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}o(XI,"findIndex");function ym(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.match(r.matchPattern);if(!n)return null;var i=n[0],s=e.match(r.parsePattern);if(!s)return null;var a=r.valueCallback?r.valueCallback(s[0]):s[0];a=t.valueCallback?t.valueCallback(a):a;var f=e.slice(i.length);return{value:a,rest:f}}}o(ym,"buildMatchPatternFn");var ZI=/^(\d+)(th|st|nd|rd)?/i,QI=/\d+/i,eO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tO={any:[/^b/i,/^(a|c)/i]},rO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nO={any:[/1/i,/2/i,/3/i,/4/i]},iO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},oO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},sO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},aO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fO={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},uO={ordinalNumber:ym({matchPattern:ZI,parsePattern:QI,valueCallback:function(r){return parseInt(r,10)}}),era:Hs({matchPatterns:eO,defaultMatchWidth:"wide",parsePatterns:tO,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:rO,defaultMatchWidth:"wide",parsePatterns:nO,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Hs({matchPatterns:iO,defaultMatchWidth:"wide",parsePatterns:oO,defaultParseWidth:"any"}),day:Hs({matchPatterns:sO,defaultMatchWidth:"wide",parsePatterns:aO,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:fO,defaultMatchWidth:"any",parsePatterns:cO,defaultParseWidth:"any"})},R4=uO;var lO={code:"en-US",formatDistance:I4,formatLong:O4,formatRelative:P4,localize:N4,match:R4,options:{weekStartsOn:0,firstWeekContainsDate:1}},L4=lO;function xm(r,e){pt(2,arguments);var t=Ht(e);return mm(r,-t)}o(xm,"subMilliseconds");var dO=864e5;function wm(r){pt(1,arguments);var e=Ut(r),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),i=t-n;return Math.floor(i/dO)+1}o(wm,"getUTCDayOfYear");function Ao(r){pt(1,arguments);var e=1,t=Ut(r),n=t.getUTCDay(),i=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}o(Ao,"startOfUTCISOWeek");function Sc(r){pt(1,arguments);var e=Ut(r),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Ao(n),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var a=Ao(s);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}o(Sc,"getUTCISOWeekYear");function _m(r){pt(1,arguments);var e=Sc(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=Ao(t);return n}o(_m,"startOfUTCISOWeekYear");var hO=6048e5;function Em(r){pt(1,arguments);var e=Ut(r),t=Ao(e).getTime()-_m(e).getTime();return Math.round(t/hO)+1}o(Em,"getUTCISOWeek");function To(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.weekStartsOn,s=i==null?0:Ht(i),a=t.weekStartsOn==null?s:Ht(t.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Ut(r),u=f.getUTCDay(),m=(u<a?7:0)+u-a;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}o(To,"startOfUTCWeek");function Mc(r,e){pt(1,arguments);var t=Ut(r),n=t.getUTCFullYear(),i=e||{},s=i.locale,a=s&&s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(n+1,0,u),m.setUTCHours(0,0,0,0);var p=To(m,e),x=new Date(0);x.setUTCFullYear(n,0,u),x.setUTCHours(0,0,0,0);var k=To(x,e);return t.getTime()>=p.getTime()?n+1:t.getTime()>=k.getTime()?n:n-1}o(Mc,"getUTCWeekYear");function Sm(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.firstWeekContainsDate,s=i==null?1:Ht(i),a=t.firstWeekContainsDate==null?s:Ht(t.firstWeekContainsDate),f=Mc(r,e),u=new Date(0);u.setUTCFullYear(f,0,a),u.setUTCHours(0,0,0,0);var m=To(u,e);return m}o(Sm,"startOfUTCWeekYear");var pO=6048e5;function Mm(r,e){pt(1,arguments);var t=Ut(r),n=To(t,e).getTime()-Sm(t,e).getTime();return Math.round(n/pO)+1}o(Mm,"getUTCWeek");function ut(r,e){for(var t=r<0?"-":"",n=Math.abs(r).toString();n.length<e;)n="0"+n;return t+n}o(ut,"addLeadingZeros");var mO={y:function(r,e){var t=r.getUTCFullYear(),n=t>0?t:1-t;return ut(e==="yy"?n%100:n,e.length)},M:function(r,e){var t=r.getUTCMonth();return e==="M"?String(t+1):ut(t+1,2)},d:function(r,e){return ut(r.getUTCDate(),e.length)},a:function(r,e){var t=r.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h:function(r,e){return ut(r.getUTCHours()%12||12,e.length)},H:function(r,e){return ut(r.getUTCHours(),e.length)},m:function(r,e){return ut(r.getUTCMinutes(),e.length)},s:function(r,e){return ut(r.getUTCSeconds(),e.length)},S:function(r,e){var t=e.length,n=r.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,t-3));return ut(i,e.length)}},Hi=mO;var Qa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bO={G:function(r,e,t){var n=r.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){var n=r.getUTCFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return Hi.y(r,e)},Y:function(r,e,t,n){var i=Mc(r,n),s=i>0?i:1-i;if(e==="YY"){var a=s%100;return ut(a,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):ut(s,e.length)},R:function(r,e){var t=Sc(r);return ut(t,e.length)},u:function(r,e){var t=r.getUTCFullYear();return ut(t,e.length)},Q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return ut(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return ut(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){var n=r.getUTCMonth();switch(e){case"M":case"MM":return Hi.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){var n=r.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return ut(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){var i=Mm(r,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):ut(i,e.length)},I:function(r,e,t){var n=Em(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):ut(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getUTCDate(),{unit:"date"}):Hi.d(r,e)},D:function(r,e,t){var n=wm(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):ut(n,e.length)},E:function(r,e,t){var n=r.getUTCDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return ut(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return ut(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(r,e,t){var n=r.getUTCDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return ut(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){var n=r.getUTCHours(),i=n/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,e,t){var n=r.getUTCHours(),i;switch(n===12?i=Qa.noon:n===0?i=Qa.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,e,t){var n=r.getUTCHours(),i;switch(n>=17?i=Qa.evening:n>=12?i=Qa.afternoon:n>=4?i=Qa.morning:i=Qa.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){var n=r.getUTCHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return Hi.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Hi.H(r,e)},K:function(r,e,t){var n=r.getUTCHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},k:function(r,e,t){var n=r.getUTCHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):Hi.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Hi.s(r,e)},S:function(r,e){return Hi.S(r,e)},X:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return U4(s);case"XXXX":case"XX":return js(s);case"XXXXX":case"XXX":default:return js(s,":")}},x:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"x":return U4(s);case"xxxx":case"xx":return js(s);case"xxxxx":case"xxx":default:return js(s,":")}},O:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+B4(s,":");case"OOOO":default:return"GMT"+js(s,":")}},z:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+B4(s,":");case"zzzz":default:return"GMT"+js(s,":")}},t:function(r,e,t,n){var i=n._originalDate||r,s=Math.floor(i.getTime()/1e3);return ut(s,e.length)},T:function(r,e,t,n){var i=n._originalDate||r,s=i.getTime();return ut(s,e.length)}};function B4(r,e){var t=r>0?"-":"+",n=Math.abs(r),i=Math.floor(n/60),s=n%60;if(s===0)return t+String(i);var a=e||"";return t+String(i)+a+ut(s,2)}o(B4,"formatTimezoneShort");function U4(r,e){if(r%60===0){var t=r>0?"-":"+";return t+ut(Math.abs(r)/60,2)}return js(r,e)}o(U4,"formatTimezoneWithOptionalMinutes");function js(r,e){var t=e||"",n=r>0?"-":"+",i=Math.abs(r),s=ut(Math.floor(i/60),2),a=ut(i%60,2);return n+s+t+a}o(js,"formatTimezone");var F4=bO;function $4(r,e){switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}o($4,"dateLongFormatter");function q4(r,e){switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}o(q4,"timeLongFormatter");function gO(r,e){var t=r.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return $4(r,e);var s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",$4(n,e)).replace("{{time}}",q4(i,e))}o(gO,"dateTimeLongFormatter");var vO={p:q4,P:gO},H4=vO;var yO=["D","DD"],xO=["YY","YYYY"];function j4(r){return yO.indexOf(r)!==-1}o(j4,"isProtectedDayOfYearToken");function z4(r){return xO.indexOf(r)!==-1}o(z4,"isProtectedWeekYearToken");function Am(r,e,t){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"))}o(Am,"throwProtectedError");var wO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_O=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,EO=/^'([^]*?)'?$/,SO=/''/g,MO=/[a-zA-Z]/;function Ac(r,e,t){pt(2,arguments);var n=String(e),i=t||{},s=i.locale||L4,a=s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=s.options&&s.options.weekStartsOn,p=m==null?0:Ht(m),x=i.weekStartsOn==null?p:Ht(i.weekStartsOn);if(!(x>=0&&x<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!s.localize)throw new RangeError("locale must contain localize property");if(!s.formatLong)throw new RangeError("locale must contain formatLong property");var k=Ut(r);if(!vm(k))throw new RangeError("Invalid time value");var O=bm(k),T=xm(k,O),C={firstWeekContainsDate:u,weekStartsOn:x,locale:s,_originalDate:k},$=n.match(_O).map(function(I){var U=I[0];if(U==="p"||U==="P"){var z=H4[U];return z(I,s.formatLong,C)}return I}).join("").match(wO).map(function(I){if(I==="''")return"'";var U=I[0];if(U==="'")return AO(I);var z=F4[U];if(z)return!i.useAdditionalWeekYearTokens&&z4(I)&&Am(I,e,r),!i.useAdditionalDayOfYearTokens&&j4(I)&&Am(I,e,r),z(T,I,s.localize,C);if(U.match(MO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return I}).join("");return $}o(Ac,"format");function AO(r){return r.match(EO)[1].replace(SO,"'")}o(AO,"cleanEscapedString");var TO=o((r,e)=>r.split(" error")[0]||r,"transformErrorCheck"),kO=o((r,e)=>r.startsWith("expiration")?e.expirationDate?`Invalid \u2022 Expired ${Ac(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Invalid \u2022 Expired":r,"transformErrorMessage"),CO=o((r,e)=>({proof:"Valid",expiration:e.expirationDate?`Valid \u2022 Expires ${Ac(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Valid \u2022 Does Not Expire"})[r]||r,"transformCheckMessage"),K4=o(r=>e=>Z(void 0,null,function*(){let t=yield r.pluginMethods.verifyCredential(e),n=[];return t.errors.forEach(i=>{n.push({status:fd.Failed,check:TO(i,e),details:kO(i,e)})}),t.warnings.forEach(i=>{n.push({status:fd.Error,check:"hmm",message:i})}),t.checks.forEach(i=>{n.push({status:fd.Success,check:i,message:CO(i,e)})}),n}),"verifyCredential");var V4={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials",ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var ke,W4=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});W4.decode();var cd=null;function ef(){return(cd===null||cd.buffer!==ke.memory.buffer)&&(cd=new Uint8Array(ke.memory.buffer)),cd}o(ef,"getUint8Memory0");function ji(r,e){return W4.decode(ef().subarray(r,r+e))}o(ji,"getStringFromWasm0");var zi=new Array(32).fill(void 0);zi.push(void 0,null,!0,!1);var Tc=zi.length;function Ze(r){Tc===zi.length&&zi.push(zi.length+1);let e=Tc;return Tc=zi[e],zi[e]=r,e}o(Ze,"addHeapObject");function Ie(r){return zi[r]}o(Ie,"getObject");function DO(r){r<36||(zi[r]=Tc,Tc=r)}o(DO,"dropObject");function Ki(r){let e=Ie(r);return DO(r),e}o(Ki,"takeObject");var Ft=0,ld=new TextEncoder("utf-8"),IO=typeof ld.encodeInto=="function"?function(r,e){return ld.encodeInto(r,e)}:function(r,e){let t=ld.encode(r);return e.set(t),{read:r.length,written:t.length}};function or(r,e,t){if(t===void 0){let f=ld.encode(r),u=e(f.length);return ef().subarray(u,u+f.length).set(f),Ft=f.length,u}let n=r.length,i=e(n),s=ef(),a=0;for(;a<n;a++){let f=r.charCodeAt(a);if(f>127)break;s[i+a]=f}if(a!==n){a!==0&&(r=r.slice(a)),i=t(i,n,n=a+r.length*3);let f=ef().subarray(i+a,i+n);a+=IO(r,f).written}return Ft=a,i}o(or,"passStringToWasm0");function OO(r){return r==null}o(OO,"isLikeNone");var ud=null;function Dr(){return(ud===null||ud.buffer!==ke.memory.buffer)&&(ud=new Int32Array(ke.memory.buffer)),ud}o(Dr,"getInt32Memory0");function Tm(r){let e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){let i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){let i=r.length,s="[";i>0&&(s+=Tm(r[0]));for(let a=1;a<i;a++)s+=", "+Tm(r[a]);return s+="]",s}let t=/\[object ([^\]]+)\]/.exec(toString.call(r)),n;if(t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch(i){return"Object"}return r instanceof Error?`${r.name}: ${r.message}
792
- ${r.stack}`:n}o(Tm,"debugString");function PO(r,e,t,n){let i={a:r,b:e,cnt:1,dtor:t},s=o((...a)=>{i.cnt++;let f=i.a;i.a=0;try{return n(f,i.b,...a)}finally{--i.cnt===0?ke.__wbindgen_export_2.get(i.dtor)(f,i.b):i.a=f}},"real");return s.original=i,s}o(PO,"makeMutClosure");function NO(r,e,t){ke._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(r,e,Ze(t))}o(NO,"__wbg_adapter_24");function RO(r,e){let t=e(r.length*1);return ef().set(r,t/1),Ft=r.length,t}o(RO,"passArray8ToWasm0");function G4(r){try{let f=ke.__wbindgen_add_to_stack_pointer(-16),u=RO(r,ke.__wbindgen_malloc),m=Ft;ke.generateEd25519KeyFromBytes(f,u,m);var e=Dr()[f/4+0],t=Dr()[f/4+1],n=Dr()[f/4+2],i=Dr()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,Ki(n);return ji(s,a)}finally{ke.__wbindgen_add_to_stack_pointer(16),ke.__wbindgen_free(s,a)}}o(G4,"generateEd25519KeyFromBytes");function Y4(r,e){try{let u=ke.__wbindgen_add_to_stack_pointer(-16),m=or(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),p=Ft,x=or(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),k=Ft;ke.keyToDID(u,m,p,x,k);var t=Dr()[u/4+0],n=Dr()[u/4+1],i=Dr()[u/4+2],s=Dr()[u/4+3],a=t,f=n;if(s)throw a=0,f=0,Ki(i);return ji(a,f)}finally{ke.__wbindgen_add_to_stack_pointer(16),ke.__wbindgen_free(a,f)}}o(Y4,"keyToDID");function J4(r,e){let t=or(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Ft,i=or(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Ft,a=ke.keyToVerificationMethod(t,n,i,s);return Ki(a)}o(J4,"keyToVerificationMethod");function X4(r,e,t){let n=or(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),i=Ft,s=or(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),a=Ft,f=or(t,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Ft,m=ke.issueCredential(n,i,s,a,f,u);return Ki(m)}o(X4,"issueCredential");function Z4(r,e){let t=or(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Ft,i=or(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Ft,a=ke.verifyCredential(t,n,i,s);return Ki(a)}o(Z4,"verifyCredential");function Q4(r,e,t){let n=or(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),i=Ft,s=or(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),a=Ft,f=or(t,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Ft,m=ke.issuePresentation(n,i,s,a,f,u);return Ki(m)}o(Q4,"issuePresentation");function e5(r,e){let t=or(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Ft,i=or(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Ft,a=ke.verifyPresentation(t,n,i,s);return Ki(a)}o(e5,"verifyPresentation");function br(r,e){try{return r.apply(this,e)}catch(t){ke.__wbindgen_exn_store(Ze(t))}}o(br,"handleError");function LO(r,e){return ef().subarray(r/1,r/1+e)}o(LO,"getArrayU8FromWasm0");function BO(r,e,t,n){ke.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(r,e,Ze(t),Ze(n))}o(BO,"__wbg_adapter_108");function UO(r,e){return Z(this,null,function*(){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.headers.get("Content-Type")!="application/wasm")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",n);else throw n}let t=yield r.arrayBuffer();return yield WebAssembly.instantiate(t,e)}else{let t=yield WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}})}o(UO,"load");function t5(r){return Z(this,null,function*(){let e={};e.wbg={},e.wbg.__wbindgen_string_new=function(i,s){let a=ji(i,s);return Ze(a)},e.wbg.__wbindgen_object_drop_ref=function(i){Ki(i)},e.wbg.__wbindgen_cb_drop=function(i){let s=Ki(i).original;return s.cnt--==1?(s.a=0,!0):!1},e.wbg.__wbindgen_object_clone_ref=function(i){let s=Ie(i);return Ze(s)},e.wbg.__wbg_fetch_811d43d6bdcad5b1=function(i){let s=fetch(Ie(i));return Ze(s)},e.wbg.__wbg_fetch_bf56e2a9f0644e3f=function(i,s){let a=Ie(i).fetch(Ie(s));return Ze(a)},e.wbg.__wbg_new_89d7f088c1c45353=function(){return br(function(){let i=new Headers;return Ze(i)},arguments)},e.wbg.__wbg_append_f4f93bc73c45ee3e=function(){return br(function(i,s,a,f,u){Ie(i).append(ji(s,a),ji(f,u))},arguments)},e.wbg.__wbindgen_string_get=function(i,s){let a=Ie(s),f=typeof a=="string"?a:void 0;var u=OO(f)?0:or(f,ke.__wbindgen_malloc,ke.__wbindgen_realloc),m=Ft;Dr()[i/4+1]=m,Dr()[i/4+0]=u},e.wbg.__wbg_instanceof_Response_ccfeb62399355bcd=function(i){return Ie(i)instanceof Response},e.wbg.__wbg_url_06c0f822d68d195c=function(i,s){let a=Ie(s).url,f=or(a,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Ft;Dr()[i/4+1]=u,Dr()[i/4+0]=f},e.wbg.__wbg_status_600fd8b881393898=function(i){return Ie(i).status},e.wbg.__wbg_headers_9e7f2c05a9b962ea=function(i){let s=Ie(i).headers;return Ze(s)},e.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return br(function(i){let s=Ie(i).arrayBuffer();return Ze(s)},arguments)},e.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return br(function(i,s,a){let f=new Request(ji(i,s),Ie(a));return Ze(f)},arguments)},e.wbg.__wbindgen_is_object=function(i){let s=Ie(i);return typeof s=="object"&&s!==null},e.wbg.__wbg_self_86b4b13392c7af56=function(){return br(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_crypto_b8c92eaac23d0d80=function(i){let s=Ie(i).crypto;return Ze(s)},e.wbg.__wbg_msCrypto_9ad6677321a08dd8=function(i){let s=Ie(i).msCrypto;return Ze(s)},e.wbg.__wbindgen_is_undefined=function(i){return Ie(i)===void 0},e.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return Ze(n)},e.wbg.__wbg_require_f5521a5b85ad2542=function(i,s,a){let f=Ie(i).require(ji(s,a));return Ze(f)},e.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(i){let s=Ie(i).getRandomValues;return Ze(s)},e.wbg.__wbg_getRandomValues_e57c9b75ddead065=function(i,s){Ie(i).getRandomValues(Ie(s))},e.wbg.__wbg_randomFillSync_d2ba53160aec6aba=function(i,s,a){Ie(i).randomFillSync(LO(s,a))},e.wbg.__wbindgen_is_function=function(i){return typeof Ie(i)=="function"},e.wbg.__wbg_newnoargs_e23b458e372830de=function(i,s){let a=new Function(ji(i,s));return Ze(a)},e.wbg.__wbg_next_cabb70b365520721=function(i){let s=Ie(i).next;return Ze(s)},e.wbg.__wbg_next_bf3d83fc18df496e=function(){return br(function(i){let s=Ie(i).next();return Ze(s)},arguments)},e.wbg.__wbg_done_040f966faa9a72b3=function(i){return Ie(i).done},e.wbg.__wbg_value_419afbd9b9574c4c=function(i){let s=Ie(i).value;return Ze(s)},e.wbg.__wbg_iterator_4832ef1f15b0382b=function(){return Ze(Symbol.iterator)},e.wbg.__wbg_get_a9cab131e3152c49=function(){return br(function(i,s){let a=Reflect.get(Ie(i),Ie(s));return Ze(a)},arguments)},e.wbg.__wbg_call_ae78342adc33730a=function(){return br(function(i,s){let a=Ie(i).call(Ie(s));return Ze(a)},arguments)},e.wbg.__wbg_new_36359baae5a47e27=function(){let i=new Object;return Ze(i)},e.wbg.__wbg_call_3ed288a247f13ea5=function(){return br(function(i,s,a){let f=Ie(i).call(Ie(s),Ie(a));return Ze(f)},arguments)},e.wbg.__wbg_getTime_bffb1c09df09618b=function(i){return Ie(i).getTime()},e.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){let i=new Date;return Ze(i)},e.wbg.__wbg_new_37705eed627d5ed9=function(i,s){try{var a={a:i,b:s},f=o((m,p)=>{let x=a.a;a.a=0;try{return BO(x,a.b,m,p)}finally{a.a=x}},"cb0");let u=new Promise(f);return Ze(u)}finally{a.a=a.b=0}},e.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(i){let s=Promise.resolve(Ie(i));return Ze(s)},e.wbg.__wbg_then_ce526c837d07b68f=function(i,s){let a=Ie(i).then(Ie(s));return Ze(a)},e.wbg.__wbg_then_842e65b843962f56=function(i,s,a){let f=Ie(i).then(Ie(s),Ie(a));return Ze(f)},e.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return br(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return br(function(){let i=window.window;return Ze(i)},arguments)},e.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return br(function(){let i=globalThis.globalThis;return Ze(i)},arguments)},e.wbg.__wbg_global_5de1e0f82bddcd27=function(){return br(function(){let i=global.global;return Ze(i)},arguments)},e.wbg.__wbg_buffer_7af23f65f6c64548=function(i){let s=Ie(i).buffer;return Ze(s)},e.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(i,s,a){let f=new Uint8Array(Ie(i),s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_new_cc9018bd6f283b6f=function(i){let s=new Uint8Array(Ie(i));return Ze(s)},e.wbg.__wbg_set_f25e869e4565d2a2=function(i,s,a){Ie(i).set(Ie(s),a>>>0)},e.wbg.__wbg_length_0acb1cf9bbaf8519=function(i){return Ie(i).length},e.wbg.__wbg_newwithlength_8f0657faca9f1422=function(i){let s=new Uint8Array(i>>>0);return Ze(s)},e.wbg.__wbg_subarray_da527dbd24eafb6b=function(i,s,a){let f=Ie(i).subarray(s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_has_ce995ec88636803d=function(){return br(function(i,s){return Reflect.has(Ie(i),Ie(s))},arguments)},e.wbg.__wbg_set_93b1c87ee2af852e=function(){return br(function(i,s,a){return Reflect.set(Ie(i),Ie(s),Ie(a))},arguments)},e.wbg.__wbg_stringify_c760003feffcc1f2=function(){return br(function(i){let s=JSON.stringify(Ie(i));return Ze(s)},arguments)},e.wbg.__wbindgen_debug_string=function(i,s){let a=Tm(Ie(s)),f=or(a,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Ft;Dr()[i/4+1]=u,Dr()[i/4+0]=f},e.wbg.__wbindgen_throw=function(i,s){throw new Error(ji(i,s))},e.wbg.__wbindgen_memory=function(){let i=ke.memory;return Ze(i)},e.wbg.__wbindgen_closure_wrapper10902=function(i,s,a){let f=PO(i,s,3717,NO);return Ze(f)},(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));let{instance:t,module:n}=yield UO(yield r,e);return ke=t.exports,t5.__wbindgen_wasm_module=n,ke})}o(t5,"init");var r5=t5;var n5=!1,FO=o((r="https://cdn.filestackcontent.com/jXExSjNXSerFVDMIYOgy")=>Z(void 0,null,function*(){if(!n5)return n5=!0,r5(r)}),"init"),i5=FO;var o5=o(r=>Z(void 0,null,function*(){yield i5(r);let e={};return{pluginMethods:{generateEd25519KeyFromBytes:(t,n)=>JSON.parse(G4(n)),keyToDid:(t,n,i)=>{let s=e[n];if(!s){let a=Y4(n,JSON.stringify(i));return e[n]=a,a}return s},keyToVerificationMethod:(t,n,i)=>Z(void 0,null,function*(){return J4(n,JSON.stringify(i))}),issueCredential:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield X4(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyCredential:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield Z4(JSON.stringify(n),"{}"))}),issuePresentation:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield Q4(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyPresentation:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield e5(JSON.stringify(n),"{}"))})}}}),"getDidKitPlugin");var s5=o((i,...s)=>Z(void 0,[i,...s],function*(r,{ceramicIdx:e=V4,didkit:t,defaultContents:n=[]}={}){let a=yield(yield rf(n)).addPlugin(yield o5(t)),f=yield a.addPlugin(yield d4(a,r)),u=yield f.addPlugin(yield fm(f)),m=yield u.addPlugin(yield rd(u,e)),p=yield m.addPlugin(h4(m));return{_wallet:p,did:(x="key")=>p.pluginMethods.getSubjectDid(x),get keypair(){return p.pluginMethods.getSubjectKeypair()},issueCredential:p.pluginMethods.issueCredential,verifyCredential:K4(p),issuePresentation:p.pluginMethods.issuePresentation,verifyPresentation:p.pluginMethods.verifyPresentation,getCredential:p.pluginMethods.getVerifiableCredentialFromIndex,getCredentials:p.pluginMethods.getVerifiableCredentialsFromIndex,publishCredential:p.pluginMethods.publishContentToCeramic,addCredential:x=>Z(void 0,null,function*(){yield p.pluginMethods.addVerifiableCredentialInIdx(x)}),readFromCeramic:p.pluginMethods.readContentFromCeramic,getTestVc:p.pluginMethods.getTestVc}}),"walletFromKey");
791
+ `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function xs(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(xs,"arrRemove");var vo=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return o(r,"Subscription"),r.prototype.unsubscribe=function(){var e,t,n,i,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var f=ys(a),u=f.next();!u.done;u=f.next()){var m=u.value;m.remove(this)}}catch(C){e={error:C}}finally{try{u&&!u.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else a.remove(this);var p=this.initialTeardown;if(rt(p))try{p()}catch(C){s=C instanceof Al?C.errors:[C]}var x=this._finalizers;if(x){this._finalizers=null;try{for(var k=ys(x),I=k.next();!I.done;I=k.next()){var T=I.value;try{D6(T)}catch(C){s=s!=null?s:[],C instanceof Al?s=On(On([],qr(s)),qr(C.errors)):s.push(C)}}}catch(C){n={error:C}}finally{try{I&&!I.done&&(i=k.return)&&i.call(k)}finally{if(n)throw n.error}}}if(s)throw new Al(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)D6(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&xs(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&xs(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var Cp=vo.EMPTY;function Tl(r){return r instanceof vo||r&&"closed"in r&&rt(r.remove)&&rt(r.add)&&rt(r.unsubscribe)}o(Tl,"isSubscription");function D6(r){rt(r)?r():r.unsubscribe()}o(D6,"execFinalizer");var In={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var $a={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=$a.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,On([r,e],qr(t))):setTimeout.apply(void 0,On([r,e],qr(t)))},clearTimeout:function(r){var e=$a.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function kl(r){$a.setTimeout(function(){var e=In.onUnhandledError;if(e)e(r);else throw r})}o(kl,"reportUnhandledError");function Dp(){}o(Dp,"noop");var O6=function(){return Op("C",void 0,void 0)}();function I6(r){return Op("E",void 0,r)}o(I6,"errorNotification");function P6(r){return Op("N",r,void 0)}o(P6,"nextNotification");function Op(r,e,t){return{kind:r,value:e,error:t}}o(Op,"createNotification");var ws=null;function qa(r){if(In.useDeprecatedSynchronousErrorHandling){var e=!ws;if(e&&(ws={errorThrown:!1,error:null}),r(),e){var t=ws,n=t.errorThrown,i=t.error;if(ws=null,n)throw i}}else r()}o(qa,"errorContext");function N6(r){In.useDeprecatedSynchronousErrorHandling&&ws&&(ws.errorThrown=!0,ws.error=r)}o(N6,"captureError");var oc=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Tl(t)&&t.add(n)):n.destination=Yk,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new Dl(t,n,i)},e.prototype.next=function(t){this.isStopped?Pp(P6(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Pp(I6(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Pp(O6,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(vo);var Vk=Function.prototype.bind;function Ip(r,e){return Vk.call(r,e)}o(Ip,"bind");var Wk=function(){function r(e){this.partialObserver=e}return o(r,"ConsumerObserver"),r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){Cl(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Cl(n)}else Cl(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Cl(t)}},r}(),Dl=function(r){hr(e,r);function e(t,n,i){var s=r.call(this)||this,a;if(rt(t)||!t)a={next:t!=null?t:void 0,error:n!=null?n:void 0,complete:i!=null?i:void 0};else{var f;s&&In.useDeprecatedNextContext?(f=Object.create(t),f.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Ip(t.next,f),error:t.error&&Ip(t.error,f),complete:t.complete&&Ip(t.complete,f)}):a=t}return s.destination=new Wk(a),s}return o(e,"SafeSubscriber"),e}(oc);function Cl(r){In.useDeprecatedSynchronousErrorHandling?N6(r):kl(r)}o(Cl,"handleUnhandledError");function Gk(r){throw r}o(Gk,"defaultErrorHandler");function Pp(r,e){var t=In.onStoppedNotification;t&&$a.setTimeout(function(){return t(r,e)})}o(Pp,"handleStoppedNotification");var Yk={closed:!0,next:Dp,error:Gk,complete:Dp};var Ha=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function za(r){return r}o(za,"identity");function R6(r){return r.length===0?za:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(R6,"pipeFromArray");var _t=function(){function r(e){e&&(this._subscribe=e)}return o(r,"Observable"),r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,s=Xk(e)?e:new Dl(e,t,n);return qa(function(){var a=i,f=a.operator,u=a.source;s.add(f?f.call(s,u):u?i._subscribe(s):i._trySubscribe(s))}),s},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=L6(t),new t(function(i,s){var a=new Dl({next:function(f){try{e(f)}catch(u){s(u),a.unsubscribe()}},error:s,complete:i});n.subscribe(a)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Ha]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R6(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=L6(e),new e(function(n,i){var s;t.subscribe(function(a){return s=a},function(a){return i(a)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function L6(r){var e;return(e=r!=null?r:In.Promise)!==null&&e!==void 0?e:Promise}o(L6,"getPromiseCtor");function Jk(r){return r&&rt(r.next)&&rt(r.error)&&rt(r.complete)}o(Jk,"isObserver");function Xk(r){return r&&r instanceof oc||Jk(r)&&Tl(r)}o(Xk,"isSubscriber");function Zk(r){return rt(r==null?void 0:r.lift)}o(Zk,"hasLift");function Yt(r){return function(e){if(Zk(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}o(Yt,"operate");function Jt(r,e,t,n,i){return new Qk(r,e,t,n,i)}o(Jt,"createOperatorSubscriber");var Qk=function(r){hr(e,r);function e(t,n,i,s,a,f){var u=r.call(this,t)||this;return u.onFinalize=a,u.shouldUnsubscribe=f,u._next=n?function(m){try{n(m)}catch(p){t.error(p)}}:r.prototype._next,u._error=s?function(m){try{s(m)}catch(p){t.error(p)}finally{this.unsubscribe()}}:r.prototype._error,u._complete=i?function(){try{i()}catch(m){t.error(m)}finally{this.unsubscribe()}}:r.prototype._complete,u}return o(e,"OperatorSubscriber"),e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(oc);var B6=Fa(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Np=function(r){hr(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o(e,"Subject"),e.prototype.lift=function(t){var n=new U6(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new B6},e.prototype.next=function(t){var n=this;qa(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=ys(n.currentObservers),f=a.next();!f.done;f=a.next()){var u=f.value;u.next(t)}}catch(m){i={error:m}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;qa(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;qa(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,s=i.hasError,a=i.isStopped,f=i.observers;return s||a?Cp:(this.currentObservers=null,f.push(t),new vo(function(){n.currentObservers=null,xs(f,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,a=n.isStopped;i?t.error(s):a&&t.complete()},e.prototype.asObservable=function(){var t=new _t;return t.source=this,t},e.create=function(t,n){return new U6(t,n)},e}(_t);var U6=function(r){hr(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return o(e,"AnonymousSubject"),e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:Cp},e}(Np);var Rp=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return o(e,"BehaviorSubject"),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,s=t._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(Np);var Lp={now:function(){return(Lp.delegate||Date).now()},delegate:void 0};var F6=function(r){hr(e,r);function e(t,n){return r.call(this)||this}return o(e,"Action"),e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e}(vo);var sc={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=sc.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,On([r,e],qr(t))):setInterval.apply(void 0,On([r,e],qr(t)))},clearInterval:function(r){var e=sc.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(r)},delegate:void 0};var $6=function(r){hr(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.pending=!1,i}return o(e,"AsyncAction"),e.prototype.schedule=function(t,n){if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),sc.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;sc.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var i=!1,s;try{this.work(t)}catch(a){i=!0,s=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,xs(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(F6);var Bp=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return o(r,"Scheduler"),r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=Lp.now,r}();var q6=function(r){hr(e,r);function e(t,n){n===void 0&&(n=Bp.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return o(e,"AsyncScheduler"),e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,i){for(;t=n.shift();)t.unsubscribe();throw i}},e}(Bp);var eC=new q6($6),H6=eC;var Ol=new _t(function(r){return r.complete()});function Il(r){return r&&rt(r.schedule)}o(Il,"isScheduler");function z6(r){return r[r.length-1]}o(z6,"last");function j6(r){return Il(z6(r))?r.pop():void 0}o(j6,"popScheduler");function K6(r,e){return typeof z6(r)=="number"?r.pop():e}o(K6,"popNumber");var ja=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function Pl(r){return rt(r==null?void 0:r.then)}o(Pl,"isPromise");function Nl(r){return rt(r[Ha])}o(Nl,"isInteropObservable");function Rl(r){return Symbol.asyncIterator&&rt(r==null?void 0:r[Symbol.asyncIterator])}o(Rl,"isAsyncIterable");function Ll(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}o(Ll,"createInvalidObservableTypeError");function tC(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(tC,"getSymbolIterator");var Bl=tC();function Ul(r){return rt(r==null?void 0:r[Bl])}o(Ul,"isIterable");function Fl(r){return k6(this,arguments,o(function(){var t,n,i,s;return Sl(this,function(a){switch(a.label){case 0:t=r.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Ml(t.read())];case 3:return n=a.sent(),i=n.value,s=n.done,s?[4,Ml(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Ml(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(Fl,"readableStreamLikeToAsyncGenerator");function $l(r){return rt(r==null?void 0:r.getReader)}o($l,"isReadableStreamLike");function pr(r){if(r instanceof _t)return r;if(r!=null){if(Nl(r))return rC(r);if(ja(r))return nC(r);if(Pl(r))return iC(r);if(Rl(r))return V6(r);if(Ul(r))return oC(r);if($l(r))return sC(r)}throw Ll(r)}o(pr,"innerFrom");function rC(r){return new _t(function(e){var t=r[Ha]();if(rt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(rC,"fromInteropObservable");function nC(r){return new _t(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(nC,"fromArrayLike");function iC(r){return new _t(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,kl)})}o(iC,"fromPromise");function oC(r){return new _t(function(e){var t,n;try{for(var i=ys(r),s=i.next();!s.done;s=i.next()){var a=s.value;if(e.next(a),e.closed)return}}catch(f){t={error:f}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(oC,"fromIterable");function V6(r){return new _t(function(e){aC(r,e).catch(function(t){return e.error(t)})})}o(V6,"fromAsyncIterable");function sC(r){return V6(Fl(r))}o(sC,"fromReadableStreamLike");function aC(r,e){var t,n,i,s;return T6(this,void 0,void 0,function(){var a,f;return Sl(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=C6(r),u.label=1;case 1:return[4,t.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=u.sent(),i={error:f},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}o(aC,"process");function pn(r,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(s),!i)return s}o(pn,"executeSchedule");function ql(r,e){return e===void 0&&(e=0),Yt(function(t,n){t.subscribe(Jt(n,function(i){return pn(n,r,function(){return n.next(i)},e)},function(){return pn(n,r,function(){return n.complete()},e)},function(i){return pn(n,r,function(){return n.error(i)},e)}))})}o(ql,"observeOn");function Hl(r,e){return e===void 0&&(e=0),Yt(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(Hl,"subscribeOn");function W6(r,e){return pr(r).pipe(Hl(e),ql(e))}o(W6,"scheduleObservable");function G6(r,e){return pr(r).pipe(Hl(e),ql(e))}o(G6,"schedulePromise");function Y6(r,e){return new _t(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(Y6,"scheduleArray");function J6(r,e){return new _t(function(t){var n;return pn(t,e,function(){n=r[Bl](),pn(t,e,function(){var i,s,a;try{i=n.next(),s=i.value,a=i.done}catch(f){t.error(f);return}a?t.complete():t.next(s)},0,!0)}),function(){return rt(n==null?void 0:n.return)&&n.return()}})}o(J6,"scheduleIterable");function zl(r,e){if(!r)throw new Error("Iterable cannot be null");return new _t(function(t){pn(t,e,function(){var n=r[Symbol.asyncIterator]();pn(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(zl,"scheduleAsyncIterable");function X6(r,e){return zl(Fl(r),e)}o(X6,"scheduleReadableStreamLike");function Z6(r,e){if(r!=null){if(Nl(r))return W6(r,e);if(ja(r))return Y6(r,e);if(Pl(r))return G6(r,e);if(Rl(r))return zl(r,e);if(Ul(r))return J6(r,e);if($l(r))return X6(r,e)}throw Ll(r)}o(Z6,"scheduled");function Q6(r,e){return e?Z6(r,e):pr(r)}o(Q6,"from");var jl=Fa(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function ew(r){return r instanceof Date&&!isNaN(r)}o(ew,"isValidDate");function Kl(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){n.next(r.call(e,s,i++))}))})}o(Kl,"map");var fC=Array.isArray;function cC(r,e){return fC(e)?r.apply(void 0,On([],qr(e))):r(e)}o(cC,"callOrApply");function tw(r){return Kl(function(e){return cC(r,e)})}o(tw,"mapOneOrManyArgs");function rw(r,e,t,n,i,s,a,f){var u=[],m=0,p=0,x=!1,k=o(function(){x&&!u.length&&!m&&e.complete()},"checkComplete"),I=o(function(C){return m<n?T(C):u.push(C)},"outerNext"),T=o(function(C){s&&e.next(C),m++;var $=!1;pr(t(C,p++)).subscribe(Jt(e,function(O){i==null||i(O),s?I(O):e.next(O)},function(){$=!0},void 0,function(){if($)try{m--;for(var O=o(function(){var U=u.shift();a?pn(e,a,function(){return T(U)}):T(U)},"_loop_1");u.length&&m<n;)O();k()}catch(U){e.error(U)}}))},"doInnerSub");return r.subscribe(Jt(e,I,function(){x=!0,k()})),function(){f==null||f()}}o(rw,"mergeInternals");function ac(r,e,t){return t===void 0&&(t=1/0),rt(e)?ac(function(n,i){return Kl(function(s,a){return e(n,s,i,a)})(pr(r(n,i)))},t):(typeof e=="number"&&(t=e),Yt(function(n,i){return rw(n,i,r,t)}))}o(ac,"mergeMap");function nw(r){return r===void 0&&(r=1/0),ac(za,r)}o(nw,"mergeAll");var uC=["addListener","removeListener"],lC=["addEventListener","removeEventListener"],dC=["on","off"];function fc(r,e,t,n){if(rt(t)&&(n=t,t=void 0),n)return fc(r,e,t).pipe(tw(n));var i=qr(mC(r)?lC.map(function(f){return function(u){return r[f](e,u,t)}}):hC(r)?uC.map(iw(r,e)):pC(r)?dC.map(iw(r,e)):[],2),s=i[0],a=i[1];if(!s&&ja(r))return ac(function(f){return fc(f,e,t)})(pr(r));if(!s)throw new TypeError("Invalid event target");return new _t(function(f){var u=o(function(){for(var m=[],p=0;p<arguments.length;p++)m[p]=arguments[p];return f.next(1<m.length?m:m[0])},"handler");return s(u),function(){return a(u)}})}o(fc,"fromEvent");function iw(r,e){return function(t){return function(n){return r[t](e,n)}}}o(iw,"toCommonHandlerRegistry");function hC(r){return rt(r.addListener)&&rt(r.removeListener)}o(hC,"isNodeStyleEventEmitter");function pC(r){return rt(r.on)&&rt(r.off)}o(pC,"isJQueryStyleEventEmitter");function mC(r){return rt(r.addEventListener)&&rt(r.removeEventListener)}o(mC,"isEventTarget");function cc(r,e,t){r===void 0&&(r=0),t===void 0&&(t=H6);var n=-1;return e!=null&&(Il(e)?t=e:n=e),new _t(function(i){var s=ew(r)?+r-t.now():r;s<0&&(s=0);var a=0;return t.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(cc,"timer");function Up(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=j6(r),n=K6(r,1/0),i=r;return i.length?i.length===1?pr(i[0]):nw(n)(Q6(i,t)):Ol}o(Up,"merge");function ow(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(ow,"filter");function sw(r){return Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(sw,"defaultIfEmpty");function aw(r){return r<=0?function(){return Ol}:Yt(function(e,t){var n=0;e.subscribe(Jt(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(aw,"take");function fw(r){return r===void 0&&(r=bC),Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(fw,"throwIfEmpty");function bC(){return new jl}o(bC,"defaultErrorFactory");function Fp(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?ow(function(i,s){return r(i,s,n)}):za,aw(1),t?sw(e):fw(function(){return new jl}))}}o(Fp,"first");var gC={leading:!0,trailing:!1};function $p(r,e){return e===void 0&&(e=gC),Yt(function(t,n){var i=e.leading,s=e.trailing,a=!1,f=null,u=null,m=!1,p=o(function(){u==null||u.unsubscribe(),u=null,s&&(I(),m&&n.complete())},"endThrottling"),x=o(function(){u=null,m&&n.complete()},"cleanupThrottling"),k=o(function(T){return u=pr(r(T)).subscribe(Jt(n,p,x))},"startThrottle"),I=o(function(){if(a){a=!1;var T=f;f=null,n.next(T),!m&&k(T)}},"send");t.subscribe(Jt(n,function(T){a=!0,f=T,!(u&&!u.closed)&&(i?I():k(T))},function(){m=!0,!(s&&a&&u&&!u.closed)&&n.complete()}))})}o($p,"throttle");var cw;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(cw||(cw={}));var _s;(function(r){r[r.NOT_REQUESTED=0]="NOT_REQUESTED",r[r.PENDING=1]="PENDING",r[r.PROCESSING=2]="PROCESSING",r[r.ANCHORED=3]="ANCHORED",r[r.FAILED=4]="FAILED"})(_s||(_s={}));var Hp;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(Hp||(Hp={}));var Pn=class extends _t{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){var n;let{next:e,content:t}=this.state$.value;return(0,qp.default)((n=e==null?void 0:e.content)!=null?n:t)}get controllers(){return this.metadata.controllers}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return ht.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>ht.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Hp.ANCHOR).map(({cid:e})=>ht.make(this.id,e))}get state(){return(0,qp.default)(this.state$.value)}sync(){return Z(this,arguments,function*(e={}){e=ie({sync:Ct.PREFER_CACHE},e);let t=yield this.api.loadStream(this.id,e);this.state$.next(t.state)})}requestAnchor(){return Z(this,null,function*(){return this.api.requestAnchor(this.id)})}};o(Pn,"Stream");function yo(){return r=>{}}o(yo,"StreamStatic");var mw=at(dw(),1);function hw(r){let e=new AbortController;if(r.length===0)throw Error("Need abort signals to create a merged abort signal");return r.some(t=>t.aborted)?(e.abort(),e.signal):(Up(...r.map(t=>fc(t,"abort"))).pipe(Fp()).subscribe(()=>{e.abort()}),e.signal)}o(hw,"mergeAbortSignals");var uc=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=cc(e).subscribe(()=>{t.abort()})}clear(){var e;(e=this._subscription)==null||e.unsubscribe()}};o(uc,"TimedAbortSignal");function pw(r,e){return Z(this,null,function*(){let t=new AbortController,n=o(()=>{t.abort()},"onAbort");return r.addEventListener("abort",n),r.aborted&&t.abort(),e(t.signal).finally(()=>{r.removeEventListener("abort",n)})})}o(pw,"abortable");var vC=60*1e3*3;function wr(t){return Z(this,arguments,function*(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{"Content-Type":"application/json"}});let n=e.timeout||vC,i=new uc(n),s=e.signal?hw([e.signal,i.signal]):i.signal,a=yield pw(s,f=>(0,mw.default)(String(r),Te(ie({},e),{signal:f}))).finally(()=>i.clear());if(!a.ok){let f=yield a.text();throw new Error(`HTTP request to '${r}' failed with status '${a.statusText}': ${f}`)}return a.json()})}o(wr,"fetchJson");var lc=at(ic(),1);Vn();function Fi(r){let e=Pe.asCID(r);if(e)return e;if(typeof r=="string")return Pe.parse(r);if(r instanceof Uint8Array)return Pe.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(Fi,"toCID");var bw=0,yt=class{static streamIdFromState(e){return new Je(e.type,e.log[0].cid)}static serializeCommit(e){var n;let t=(0,lc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Ot(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ot(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(e)&&(t.link=t.link.toString()),yt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),(n=e.header)!=null&&n.model&&(t.header.model=e.header.model.toString()),t)}static deserializeCommit(e){var n;let t=(0,lc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=Fi(t.jws.link),t.linkedBlock=Lt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Lt(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(t)&&(t.link=Fi(t.link)),yt.isAnchorCommit(t)&&(t.proof=Fi(t.proof)),t.id&&(t.id=Fi(t.id)),t.prev&&(t.prev=Fi(t.prev)),(n=t.header)!=null&&n.model&&(t.header.model=Je.fromString(t.header.model)),t)}static serializeState(e){var n,i,s,a;let t=(0,lc.default)(e);return t.log=t.log.map(f=>Te(ie({},f),{cid:f.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=_s[t.anchorStatus]),t.anchorScheduledFor!=null&&(t.anchorScheduledFor=new Date(t.anchorScheduledFor).toISOString()),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),(n=e.metadata)!=null&&n.model&&(t.metadata.model=e.metadata.model.toString()),(s=(i=e.next)==null?void 0:i.metadata)!=null&&s.model&&(t.next.metadata.model=e.next.metadata.model.toString()),((a=e.metadata)==null?void 0:a.unique)&&e.type!=bw&&(t.metadata.unique=Ot(t.metadata.unique,"base64")),t.doctype=Cr.nameByCode(t.type),t}static deserializeState(e){var i,s,a,f;let t=(0,lc.default)(e);t.doctype&&(t.type=Cr.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(u=>Te(ie({},u),{cid:Fi(u.cid)})),t.anchorProof&&(t.anchorProof.txHash=Fi(t.anchorProof.txHash),t.anchorProof.root=Fi(t.anchorProof.root));let n=!0;return t.anchorStatus&&(t.anchorStatus=_s[t.anchorStatus],n=t.anchorStatus!==_s.FAILED&&t.anchorStatus!==_s.ANCHORED),t.anchorScheduledFor&&(n?t.anchorScheduledFor=Date.parse(t.anchorScheduledFor):delete t.anchorScheduledFor),(i=e.metadata)!=null&&i.model&&(t.metadata.model=Je.fromString(e.metadata.model)),(a=(s=e.next)==null?void 0:s.metadata)!=null&&a.model&&(t.next.metadata.model=Je.fromString(e.next.metadata.model)),((f=e.metadata)==null?void 0:f.unique)&&e.type!=bw&&(t.metadata.unique=Lt(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(yt.serializeState(e))===JSON.stringify(yt.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(let n in t.log)if(!e.log[n].cid.equals(t.log[n].cid))return!1;return e.anchorStatus==t.anchorStatus}static assertCommitLinksToState(e,t){let n=this.streamIdFromState(e);if(t.id&&!t.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${n.toString()}. Found: ${t.id}, expected ${e.log[0].cid}`);let i=e.log[e.log.length-1].cid;if(!t.prev.equals(i))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${i}, found 'prev' ${t.prev}`)}static convertCommitToSignedCommitContainer(e,t){return Z(this,null,function*(){if(yt.isSignedCommit(e)){let n=yield t.block.get(e.link);return{jws:e,linkedBlock:n}}return e})}static isSignedCommitContainer(e){return e&&e.jws!==void 0}static isSignedCommit(e){return e&&e.link!==void 0}static isAnchorCommit(e){return e&&e.proof!==void 0}static isSignedCommitData(e){return e&&e.envelope!==void 0}static isAnchorCommitData(e){return e&&e.proof!==void 0}};o(yt,"StreamUtils");function gw(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new cs({address:e,chainId:t})}return new cs(r)}o(gw,"normalizeAccountId");var dc=class extends Rp{next(e){let t=this.value;yt.statesEqual(t,e)||super.next(e)}};o(dc,"StreamStateSubject");var yC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Hr,zp={anchor:!0,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},xC={sync:Ct.PREFER_CACHE},vw={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function jp(r,e){var n;if(typeof(r==null?void 0:r.schema)=="string")try{ht.fromString(r.schema)}catch(i){throw new Error("Schema must be a CommitID")}let t={controllers:r==null?void 0:r.controllers,family:r==null?void 0:r.family,schema:(n=r==null?void 0:r.schema)==null?void 0:n.toString(),tags:r==null?void 0:r.tags};if(e)r!=null&&r.deterministic||(t.unique=Ot((0,ww.randomBytes)(12),"base64")),r!=null&&r.forbidControllerChange&&(t.forbidControllerChange=!0);else{if((r==null?void 0:r.deterministic)!==void 0||(r==null?void 0:r.unique)!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if((r==null?void 0:r.forbidControllerChange)!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(i=>t[i]===void 0&&delete t[i]),t}o(jp,"headerFromMetadata");function yw(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(yw,"_ensureAuthenticated");function Kp(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(Kp,"throwReadOnlyError");var zr=Hr=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,xw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=ie(ie({},zp),i),!(n!=null&&n.deterministic)&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let u=i.asDID?{did:i.asDID}:e,m=yield Hr.makeGenesis(u,t,n);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,m,i)})}static createFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){var f;n=ie(ie({},zp),n),((f=t.header)==null?void 0:f.unique)&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=t.data?yield Hr._signDagJWS(e,t):t;return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static deterministic(i,s){return Z(this,arguments,function*(e,t,n={}){if(n=ie(ie({},zp),n),t=Te(ie({},t),{deterministic:!0}),t.family==null&&t.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=yield Hr.makeGenesis(e,null,t);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},xC),n);let a=xr.from(t);if(a.type!=Hr.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Hr.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}update(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},vw),n);let a=n.asDID?{did:n.asDID}:this.api,f=yield this.makeCommit(a,e,t),u=yield this.api.applyCommit(this.id,f,n);this.state$.next(u.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},vw),t);let s={header:jp(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},a=yield Hr._signDagJWS(this.api,s),f=yield this.api.applyCommit(this.id,a,t);this.state$.next(f.state)})}makeReadOnly(){this.update=Kp,this.patch=Kp,this.sync=Kp,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}makeCommit(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawCommit(e,t,n);return Hr._signDagJWS(e,i)})}_makeRawCommit(e,t,n){return Z(this,null,function*(){let i=jp(n,!1);if(t==null&&(t=this.content),i.controllers){if(i.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!i.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let s=Pa.compare(this.content,t);return{header:i,data:s,prev:this.tip,id:this.state.log[0].cid}})}static makeGenesis(e,t,n){return Z(this,null,function*(){var a;if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did)yield yw(e),n.controllers=[e.did.hasParent?e.did.parent:e.did.id];else throw new Error("No controllers specified");if(((a=n.controllers)==null?void 0:a.length)!==1)throw new Error("Exactly one controller must be specified");let i=jp(n,!0);if((n==null?void 0:n.deterministic)&&t)throw new Error("Initial content must be null when creating a deterministic Tile document");if(t==null){let f={header:i};return If(f),f}let s={data:t,header:i};return Hr._signDagJWS(e,s)})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield yw(e),e.did.createDagJWS(t)})}},"TileDocument");zr.STREAM_TYPE_NAME="tile";zr.STREAM_TYPE_ID=0;zr=Hr=yC([yo()],zr);var Cw=at(Mw(),1);function CC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(CC,"_checkPrivateRedeclaration");function DC(r,e){return e.get?e.get.call(r):e.value}o(DC,"_classApplyDescriptorGet");function OC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(OC,"_classApplyDescriptorSet");function kw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(kw,"_classExtractFieldDescriptor");function Gp(r,e){var t=kw(r,e,"get");return DC(r,t)}o(Gp,"_classPrivateFieldGet");function Aw(r,e,t){CC(r,e),e.set(r,t)}o(Aw,"_classPrivateFieldInit");function Tw(r,e,t){var n=kw(r,e,"set");return OC(r,n,t),t}o(Tw,"_classPrivateFieldSet");function IC(r){return typeof r=="string"||ht.isInstance(r)||Je.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(IC,"keyToQuery");function Yp(r){return typeof r=="string"?xr.from(r).toString():ht.isInstance(r)||Je.isInstance(r)?r.toString():r.streamId.toString()}o(Yp,"keyToString");function Xp(r){return Z(this,null,function*(){let e=yield zr.makeGenesis({},null,Te(ie({},r),{deterministic:!0})),t=yield Je.fromGenesis("tile",e);return{genesis:e,streamId:t}})}o(Xp,"getDeterministicQuery");var PC=o(()=>Promise.resolve([]),"tempBatchLoadFn"),Wl=new WeakMap,Jp=new WeakMap,mn=class extends Cw.default{cache(e){if(!Gp(this,Jp))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}create(e,t,n){return Z(this,null,function*(){let i=yield zr.create(Gp(this,Wl),e,t,n);return this.cache(i),i})}deterministic(e,t){return Z(this,null,function*(){let n=yield Xp(e);try{return yield gd(mn.prototype,this,"load").call(this,n)}catch(i){let s=yield zr.createFromGenesis(Gp(this,Wl),n.genesis,t);return this.cache(s),s}})}load(e){return Z(this,null,function*(){return yield gd(mn.prototype,this,"load").call(this,e)})}update(e,t,n,i){return Z(this,null,function*(){let s=Yp(e);this.clear(s);let a=yield this.load({streamId:s});return yield a.update(t,n,i),a})}constructor(e){super(PC,{cache:!0,cacheKeyFn:Yp,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),Aw(this,Wl,{writable:!0,value:void 0}),Aw(this,Jp,{writable:!0,value:void 0}),this._batchLoadFn=t=>Z(this,null,function*(){e.cache||this.clearAll();let n=yield e.ceramic.multiQuery(t.map(IC),e.multiqueryTimeout);return t.map(i=>{let s=Yp(i),a=n[s];return a||new Error(`Failed to load stream: ${s}`)})}),Tw(this,Wl,e.ceramic),Tw(this,Jp,!!e.cache)}};o(mn,"TileLoader");function NC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(NC,"_checkPrivateRedeclaration");function RC(r,e){return e.get?e.get.call(r):e.value}o(RC,"_classApplyDescriptorGet");function LC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(LC,"_classApplyDescriptorSet");function Ow(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Ow,"_classExtractFieldDescriptor");function Es(r,e){var t=Ow(r,e,"get");return RC(r,t)}o(Es,"_classPrivateFieldGet");function Dw(r,e,t){NC(r,e),e.set(r,t)}o(Dw,"_classPrivateFieldInit");function Zp(r,e,t){var n=Ow(r,e,"set");return LC(r,n,t),t}o(Zp,"_classPrivateFieldSet");var Va=new WeakMap,Wa=new WeakMap,Ga=class{get aliases(){return Es(this,Va)}get loader(){return Es(this,Wa)}getDefinitionID(e){var t;return(t=Es(this,Va).definitions[e])!=null?t:null}getSchemaURL(e){var t;return(t=Es(this,Va).schemas[e])!=null?t:null}getTileID(e){var t;return(t=Es(this,Va).tiles[e])!=null?t:null}loadTile(e){return Z(this,null,function*(){let t=this.getTileID(e);if(t==null)throw new Error(`Tile alias "${e}" is not defined`);return yield Es(this,Wa).load(t)})}createTile(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getSchemaURL(e);if(a==null)throw new Error(`Schema alias "${e}" is not defined`);let p=n,{controller:f}=p,u=Om(p,["controller"]),m={schema:a};return f!=null&&(m.controllers=[f]),yield Es(this,Wa).create(t,m,u)})}constructor(e){if(Dw(this,Va,{writable:!0,value:void 0}),Dw(this,Wa,{writable:!0,value:void 0}),Zp(this,Va,e.aliases),e.loader!=null)Zp(this,Wa,e.loader);else{if(e.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");Zp(this,Wa,new mn({ceramic:e.ceramic,cache:e.cache}))}}};o(Ga,"DataModel");function BC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(BC,"_checkPrivateRedeclaration");function UC(r,e){return e.get?e.get.call(r):e.value}o(UC,"_classApplyDescriptorGet");function FC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(FC,"_classApplyDescriptorSet");function Iw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Iw,"_classExtractFieldDescriptor");function li(r,e){var t=Iw(r,e,"get");return UC(r,t)}o(li,"_classPrivateFieldGet");function Gl(r,e,t){BC(r,e),e.set(r,t)}o(Gl,"_classPrivateFieldInit");function Yl(r,e,t){var n=Iw(r,e,"set");return FC(r,n,t),t}o(Yl,"_classPrivateFieldSet");var Jl=new WeakMap,Ss=new WeakMap,Qp=new WeakMap,Xl=new WeakMap,hc=class{_createValuePromise(){Yl(this,Qp,new Promise((e,t)=>{Yl(this,Xl,{resolve:e,reject:t})}))}change(e){return new Promise((t,n)=>{let i=o(s=>Z(this,null,function*(){try{let a=yield e(s);t(),this._next(a)}catch(a){n(a),this._next(s)}}),"run");li(this,Ss).push({reject:n,run:i}),li(this,Ss).length===1&&this._start()})}changeContent(e){return Z(this,null,function*(){let t=o(n=>Z(this,null,function*(){return yield n.update(e(n.content),n.metadata),n}),"mutation");return yield this.change(t)})}get(){return Z(this,null,function*(){return li(this,Ss).length===0?yield li(this,Jl).call(this):yield li(this,Qp)})}_start(){return Z(this,null,function*(){try{let e=yield li(this,Jl).call(this);this._next(e)}catch(e){li(this,Ss).forEach(t=>{t.reject(e)}),Yl(this,Ss,[]),li(this,Xl).reject(e),this._createValuePromise()}})}_next(e){let t=li(this,Ss).shift();t==null?this._end(e):t.run(e)}_end(e){li(this,Xl).resolve(e),this._createValuePromise()}constructor(e){Gl(this,Jl,{writable:!0,value:void 0}),Gl(this,Ss,{writable:!0,value:[]}),Gl(this,Qp,{writable:!0,value:void 0}),Gl(this,Xl,{writable:!0,value:void 0}),Yl(this,Jl,e),this._createValuePromise()}};o(hc,"TileProxy");var $C=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function qC(r){return $C.test(r)}o(qC,"isDIDstring");function HC(r){if(!qC(r))throw new Error(`Invalid DID: ${r}`)}o(HC,"assertDIDstring");function em(r){return HC(r),{controllers:[r],family:"IDX"}}o(em,"getIDXMetadata");function zC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(zC,"_checkPrivateRedeclaration");function jC(r,e){return e.get?e.get.call(r):e.value}o(jC,"_classApplyDescriptorGet");function KC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(KC,"_classApplyDescriptorSet");function Pw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Pw,"_classExtractFieldDescriptor");function Ut(r,e){var t=Pw(r,e,"get");return jC(r,t)}o(Ut,"_classPrivateFieldGet");function pc(r,e,t){zC(r,e),e.set(r,t)}o(pc,"_classPrivateFieldInit");function Zl(r,e,t){var n=Pw(r,e,"set");return KC(r,n,t),t}o(Zl,"_classPrivateFieldSet");var $i=new WeakMap,Ql=new WeakMap,tm=new WeakMap,di=new WeakMap,ed=new WeakMap,mc=class{get authenticated(){return Ut(this,$i).did!=null}get ceramic(){return Ut(this,$i)}get id(){if(Ut(this,Ql)!=null)return Ut(this,Ql);if(Ut(this,$i).did==null)throw new Error("Ceramic instance is not authenticated");return Ut(this,$i).did.hasParent?Ut(this,$i).did.parent:Ut(this,$i).did.id}get loader(){return Ut(this,di)}get model(){return Ut(this,ed)}has(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return(yield this.getRecordID(n,t))!=null})}get(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return yield this.getRecord(n,t)})}getMultiple(e,t){return Z(this,null,function*(){var f,u,m;let n=this.getDefinitionID(e),i=yield Promise.all(t.map(p=>Z(this,null,function*(){let{genesis:x,streamId:k}=yield Xp(em(p));return{genesis:x,streamId:k.toString(),paths:[n]}}))),s=yield Ut(this,$i).multiQuery(i),a=[];for(let p of i){let x=(u=(f=s[p.streamId])==null?void 0:f.content)==null?void 0:u[n],k=x?s[Je.fromString(x).toString()]:null;a.push((m=k==null?void 0:k.content)!=null?m:null)}return a})}set(i,s){return Z(this,arguments,function*(e,t,n={}){var m;let a=this.getDefinitionID(e),[f,u]=yield this._setRecordOnly(a,t,n);return f&&(yield this._setReference((m=n.controller)!=null?m:this.id,a,u)),u})}merge(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getDefinitionID(e),f=yield this.getRecord(a),u=f?ie(ie({},f),t):t;return yield this.setRecord(a,u,n)})}setAll(n){return Z(this,arguments,function*(e,t={}){var f;let i=Object.entries(e).map(p=>Z(this,[p],function*([u,m]){let x=this.getDefinitionID(u),[k,I]=yield this._setRecordOnly(x,m,t);return[k,x,I]})),a=(yield Promise.all(i)).reduce((u,[m,p,x])=>(m&&(u[p]=x.toUrl()),u),{});return yield this._setReferences((f=t.controller)!=null?f:this.id,a),a})}setDefaults(n){return Z(this,arguments,function*(e,t={}){var u,m;let i=(u=yield this.getIndex())!=null?u:{},s=Object.entries(e).map(([p,x])=>[this.getDefinitionID(p),x]).filter(p=>i[p[0]]==null).map(k=>Z(this,[k],function*([p,x]){let I=yield this.getDefinition(p),T=yield this._createRecord(I,x,t);return{[p]:T.toUrl()}})),f=(yield Promise.all(s)).reduce((p,x)=>Object.assign(p,x),{});return yield this._setReferences((m=t.controller)!=null?m:this.id,f),f})}remove(n){return Z(this,arguments,function*(e,t=this.id){yield this._getIndexProxy(t).changeContent(i=>(i!=null&&delete i[this.getDefinitionID(e)],i))})}getIndex(){return Z(this,arguments,function*(e=this.id){let t=this.authenticated&&e===this.id?yield this._getIndexProxy(e).get():yield this._getIDXDoc(e);return t?t.content:null})}iterator(e){let t,n=0;return{[Symbol.asyncIterator](){return this},next:()=>Z(this,null,function*(){if(t==null){let f=yield this.getIndex(e);t=Object.entries(f!=null?f:{})}if(n===t.length)return{done:!0,value:null};let[i,s]=t[n++],a=yield Ut(this,di).load(s);return{done:!1,value:{key:i,id:s,record:a.content}}})}}_createIDXDoc(e){return Z(this,null,function*(){return yield Ut(this,di).deterministic(em(e))})}_getIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)return null;if(t.metadata.schema!==ol)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getOwnIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)yield t.update({},{schema:ol});else if(t.metadata.schema!==ol)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getIndexProxy(e){let t=Ut(this,tm)[e];return t==null&&(t=new hc(()=>Z(this,null,function*(){return yield this._getOwnIDXDoc(e)})),Ut(this,tm)[e]=t),t}getDefinitionID(e){var t;return(t=Ut(this,ed).getDefinitionID(e))!=null?t:e}getDefinition(e){return Z(this,null,function*(){let t=yield Ut(this,di).load(e);if(t.metadata.schema!==px)throw new Error("Invalid document: schema is not Definition");return Te(ie({},t.content),{id:t.id})})}getRecordID(e,t){return Z(this,null,function*(){var i;let n=yield this.getIndex(t!=null?t:this.id);return(i=n==null?void 0:n[e])!=null?i:null})}getRecordDocument(e,t){return Z(this,null,function*(){let n=yield this.getRecordID(e,t);return n?yield Ut(this,di).load(n):null})}getRecord(e,t){return Z(this,null,function*(){let n=yield this.getRecordDocument(e,t);return n?n.content:null})}setRecord(i,s){return Z(this,arguments,function*(e,t,n={}){var u;let[a,f]=yield this._setRecordOnly(e,t,n);return a&&(yield this._setReference((u=n.controller)!=null?u:this.id,e,f)),f})}_setRecordOnly(e,t,n){return Z(this,null,function*(){var s;let i=yield this.getRecordID(e,(s=n.controller)!=null?s:this.id);if(i==null){let a=yield this.getDefinition(e),f=yield this._createRecord(a,t,n);return[!0,f]}else{let a=yield Ut(this,di).update(i,t);return[!1,a.id]}})}_createRecord(s,a,f){return Z(this,arguments,function*(e,t,{controller:n,pin:i}){let u=yield Ut(this,di).deterministic({controllers:[n!=null?n:this.id],family:e.id.toString()},{pin:i});return yield u.update(t,{schema:e.schema}),u.id})}_setReference(e,t,n){return Z(this,null,function*(){yield this._getIndexProxy(e).changeContent(i=>Te(ie({},i),{[t]:n.toUrl()}))})}_setReferences(e,t){return Z(this,null,function*(){Object.keys(t).length!==0&&(yield this._getIndexProxy(e).changeContent(n=>ie(ie({},n),t)))})}constructor(e){pc(this,$i,{writable:!0,value:void 0}),pc(this,Ql,{writable:!0,value:void 0}),pc(this,tm,{writable:!0,value:{}}),pc(this,di,{writable:!0,value:void 0}),pc(this,ed,{writable:!0,value:void 0});let{cache:t,ceramic:n,id:i,loader:s,model:a}=e;Zl(this,$i,n),Zl(this,Ql,i),Zl(this,di,s!=null?s:new mn({ceramic:n,cache:t})),Zl(this,ed,a instanceof Ga?a:new Ga({loader:Ut(this,di),aliases:a}))}};o(mc,"DIDDataStore");function rm(r){return typeof r=="string"?Je.fromString(r):r}o(rm,"typeStreamID");var mr=class extends _t{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=cc(0,n).pipe($p(()=>this._syncState(this.id,{sync:Ct.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{var f;this.state$.observers.length===0&&((f=this.periodicSubscription)==null||f.unsubscribe())})}),this.state$=new dc(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}_syncState(e,t){return Z(this,null,function*(){let n=yield mr._load(e,this._apiUrl,t);this.state$.next(yt.deserializeState(n))})}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}static createFromGenesis(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./streams",e),{state:f}=yield wr(a,{method:"post",body:{type:t,genesis:yt.serializeCommit(n),opts:i}});return new mr(yt.deserializeState(f),e,s)})}static applyCommit(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./commits",e),{state:f}=yield wr(a,{method:"post",body:{streamId:t.toString(),commit:yt.serializeCommit(n),opts:i}});return new mr(yt.deserializeState(f),e,s)})}static _load(e,t,n){return Z(this,null,function*(){let i=new URL(`./streams/${e}`,t);for(let a in n)i.searchParams.set(a,n[a]);let{state:s}=yield wr(i);return s})}static load(e,t,n,i){return Z(this,null,function*(){let s=yield mr._load(e,t,i);return new mr(yt.deserializeState(s),t,n)})}static loadStreamCommits(e,t){return Z(this,null,function*(){let n=new URL(`./commits/${e}`,t),{commits:i}=yield wr(n);return i.map(s=>({cid:s.cid,value:yt.deserializeCommit(s.value)}))})}complete(){this.state$.complete()}};o(mr,"Document");var Rw=at(ic(),1),VC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ms,nm=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),Nw={anchor:!1,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},im={anchor:!0,publish:!0,throwOnInvalidCommit:!0},WC={sync:Ct.PREFER_CACHE},As=Ms=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,Rw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static fromAccount(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},Nw),n);let a=gw(t),f=Ms.makeGenesis(a);return Ms.fromGenesis(e,f,n)})}static fromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){return n=ie(ie({},Nw),n),e.createStreamFromGenesis(Ms.STREAM_TYPE_ID,t,n)})}setDid(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},im),n);let a=typeof e=="string"?e.trim():e.id,f=vd(a);if((f==null?void 0:f.did)!==a)throw new Error(`DID is not valid: '${a}'`);let u=yield t.createLink(a);return this.setDidProof(u,n)})}setDidProof(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},im),t);let i=this.makeCommit(e),s=yield this.api.applyCommit(this.id,i,t);this.state$.next(s.state)})}clearDid(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},im),t);let i=yield e.createLink("");return this.setDidProof(i,t)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},WC),n);let a=xr.from(t);if(a.type!=Ms.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Ms.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}static makeGenesis(e){return e.chainId.namespace==="eip155"&&(e.address=e.address.toLowerCase()),{header:{controllers:[`${e.address}@${e.chainId.toString()}`],family:`caip10-${e.chainId.toString()}`}}}makeCommit(e){return{data:e,prev:this.tip,id:this.id.cid}}makeReadOnly(){this.setDidProof=nm,this.setDid=nm,this.sync=nm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");As.STREAM_TYPE_NAME="caip10-link";As.STREAM_TYPE_ID=1;As=Ms=VC([yo()],As);var o4=at(no(),1);Vn();zo();var s4=at(t4(),1),bD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},br,gD={sync:Ct.PREFER_CACHE};function r4(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(r4,"_ensureAuthenticated");function n4(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(n4,"throwReadOnlyError");var i4;(function(r){r.LIST="list",r.SINGLE="single"})(i4||(i4={}));var xo=br=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:br.MODEL}}static create(e,t,n){return Z(this,null,function*(){br.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield br._makeGenesis(e,t,n);return yield e.createStreamFromGenesis(br.STREAM_TYPE_ID,s,i)})}static createPlaceholder(e,t,n){return Z(this,null,function*(){let i={publish:!1,anchor:!1,pin:!1,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield br._makeGenesis(e,t,n);return e.createStreamFromGenesis(br.STREAM_TYPE_ID,s,i)})}replacePlaceholder(e){return Z(this,null,function*(){br.assertComplete(e,this.id);let t={publish:!0,anchor:!0,pin:!0,throwOnInvalidCommit:!0},n=yield this._makeCommit(this.api,e),i=yield this.api.applyCommit(this.id,n,t);this.state$.next(i.state)})}static assertComplete(e,t){if(!e.name)throw t?new Error(`Model with StreamID ${t.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!e.schema)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'schema' field`):new Error(`Model ${e.name} is missing a 'schema' field`);if(!e.accountRelation)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${e.name} is missing a 'accountRelation' field`)}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},gD),n);let a=xr.from(t);if(a.type!=br.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${br.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);let f=yield e.loadStream(a,n);try{br.assertComplete(f.content,t)}catch(u){throw new Error(`Incomplete placeholder Models cannot be loaded: ${u.message}`)}return f})}_makeCommit(e,t){return Z(this,null,function*(){let n=this._makeRawCommit(t);return br._signDagJWS(e,n)})}_makeRawCommit(e){if(e==null)throw new Error("Cannot set Model content to null");return{data:Pa.compare(this.content,e),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return br._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)yield r4(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,o4.randomBytes)(12),model:br.MODEL.bytes};return{data:t,header:i}})}makeReadOnly(){this.replacePlaceholder=n4,this.sync=n4,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static _signDagJWS(e,t){return Z(this,null,function*(){return yield r4(e),e.did.createDagJWS(t)})}},"Model");xo.STREAM_TYPE_NAME="model";xo.STREAM_TYPE_ID=2;xo.MODEL=function(){let r=If("model-v1"),e=s4.default.encode(r,"identity"),t=Kn(ga,e),n=Pe.createV1(ga,t);return new Je(br.STREAM_TYPE_ID,n)}();xo=br=bD([yo()],xo);var c4=at(no(),1);var vD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},qi,yD={anchor:!0,publish:!0,pin:!0,sync:Ct.NEVER_SYNC,syncTimeoutSeconds:0},xD={sync:Ct.PREFER_CACHE},a4={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function f4(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(f4,"_ensureAuthenticated");function am(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(am,"throwReadOnlyError");var Ts=qi=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let e=this.state$.value.metadata;return{controller:e.controllers[0],model:e.model}}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=ie(ie({},yD),i);let u=i.asDID?{did:i.asDID}:e,m=yield qi._makeGenesis(u,t,n);return e.createStreamFromGenesis(qi.STREAM_TYPE_ID,m,i)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},xD),n);let a=xr.from(t);if(a.type!=qi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${qi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}replace(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},a4),t);let i=t.asDID?{did:t.asDID}:this.api,s=yield this._makeCommit(i,e),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},a4),t);let i={data:e,prev:this.tip,id:this.id.cid},s=yield qi._signDagJWS(this.api,i),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}makeReadOnly(){this.replace=am,this.patch=am,this.sync=am,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return qi._signDagJWS(e,n)}_makeRawCommit(e){return{data:Pa.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return qi._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");if(!n.controller)if(e.did)yield f4(e),n.controller=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,c4.randomBytes)(12),model:n.model.bytes};return{data:t,header:i}})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield f4(e),e.did.createDagJWS(t)})}},"ModelInstanceDocument");Ts.STREAM_TYPE_NAME="MID";Ts.STREAM_TYPE_ID=3;Ts=qi=vD([yo()],Ts);var gc=class{constructor(e){this._apiUrl=e}add(e,t){return Z(this,null,function*(){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);yield wr(i,{method:"post",body:n})})}rm(e,t){return Z(this,null,function*(){let n=new URL(`./pins/${e}`,this._apiUrl);yield wr(n,{method:"delete",body:{opts:t}})})}ls(e){return Z(this,null,function*(){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=yield wr(t),{pinnedStreamIds:i}=n;return{[Symbol.asyncIterator](){let s=0;return{next(){return s===i.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:i[s++],done:!1})}}}}})}};o(gc,"RemotePinApi");var vc=class{constructor(e){this._fetchJson=wr,this._collectionURL=new URL("./collection",e)}queryIndex(e){return Z(this,null,function*(){let t=new URL(this._collectionURL);for(let s in e)t.searchParams.set(s,e[s]);let n=yield this._fetchJson(t);return{edges:n.edges.map(s=>({cursor:s.cursor,node:yt.deserializeState(s.node)})),pageInfo:n.pageInfo}})}};o(vc,"RemoteIndexApi");var wD="/api/v0/",_D="http://localhost:7007",ED={syncInterval:5e3},SD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},MD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},u4={sync:Ct.PREFER_CACHE},yc=class{constructor(e=_D,t={}){this._config=ie(ie({},ED),t),this._apiUrl=new URL(wD,e),this._streamCache=new Map,this.context={api:this},this.pin=new gc(this._apiUrl),this.index=new vc(this._apiUrl),this._streamConstructors={[As.STREAM_TYPE_ID]:As,[xo.STREAM_TYPE_ID]:xo,[Ts.STREAM_TYPE_ID]:Ts,[zr.STREAM_TYPE_ID]:zr}}get did(){return this.context.did}set did(e){this.context.did=e}createStreamFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},MD),n);let a=yield mr.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),f=this._streamCache.get(a.id.toString());return f?(yt.statesEqual(a.state,f.state)||f.next(a.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.id.toString(),a),this.buildStreamFromDocument(a))})}loadStream(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},u4),t);let i=xr.from(e),s=this._streamCache.get(i.baseID.toString());return s?yield s._syncState(i,t):(s=yield mr.load(i,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(s.id.toString(),s)),this.buildStreamFromDocument(s)})}multiQuery(e,t){return Z(this,null,function*(){let n=e.map(a=>Te(ie({},a),{streamId:typeof a.streamId=="string"?a.streamId:a.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=yield wr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((a,f)=>{let[u,m]=f,p=yt.deserializeState(m),x=new mr(p,this._apiUrl,this._config.syncInterval);return a[u]=this.buildStreamFromDocument(x),a},{})})}loadStreamCommits(e){let t=rm(e);return mr.loadStreamCommits(t,this._apiUrl)}applyCommit(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},SD),n);let a=rm(e),f=yield mr.applyCommit(this._apiUrl,a,t,n,this._config.syncInterval),u=this._streamCache.get(a.toString());return u?(u.next(f.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.toString(),f),this.buildStreamFromDocument(f))})}requestAnchor(n){return Z(this,arguments,function*(e,t={}){t=ie(ie({},u4),t);let{anchorStatus:i}=yield wr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return i})}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new mr(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(t)}buildStreamFromDocument(e){let t=e.state.type,n=this._streamConstructors[t];if(!n)throw new Error(`Failed to find constructor for stream ${t}`);return new n(e,this.context)}setDID(e){return Z(this,null,function*(){this.context.did=e})}getSupportedChains(){return Z(this,null,function*(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=yield wr(this._apiUrl+"/node/chains");return this._supportedChains=e,e})}close(){return Z(this,null,function*(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()})}};o(yc,"CeramicClient");var AD=o((r,e)=>Z(void 0,null,function*(){let t=new yc(e),n=ie({},l4.default.getResolver()),i=new ds({resolver:n});t.did=i;let s=r.pluginMethods.getKey(),a=new Yf(el(s));return t.did.setProvider(a),yield t.did.authenticate(),t}),"getCeramicClientFromWalletSuite"),rd=o((s,a)=>Z(void 0,[s,a],function*(r,{modelData:e,credentialAlias:t,ceramicEndpoint:n,defaultContentFamily:i}){let f=yield AD(r,n),u=new mn({ceramic:f}),m=new mc({ceramic:f,model:e}),p=o((...C)=>Z(void 0,[...C],function*(T=t){return(yield m.get(T))||{credentials:[]}}),"getCredentialsListFromIndex"),x=o((T,C)=>Z(void 0,null,function*(){if(!T)throw new Error("record is required");if(!T.id)throw Error("No streamId provided");T.id.indexOf("ceramic://")===-1&&(T.id="ceramic://"+T.id),C||(C=t);let $=yield p(C);return $.credentials.push(ie({storageType:"ceramic"},T)),m.set(C,$)}),"addCredentialStreamIdToIndex"),k=o((O,...U)=>Z(void 0,[O,...U],function*(T,C={},$={}){if(!T)throw new Error("content is required");return C.controllers||(C.controllers=[f.did.id]),C.family||(C.family=i),"pin"in $||($.pin=!0),(yield zr.create(f,T,C,$)).id.toString()}),"publishContentToCeramic"),I=o(T=>Z(void 0,null,function*(){var C;return(C=yield u.load(T))==null?void 0:C.content}),"readContentFromCeramic");return{pluginMethods:{getCredentialsListFromIndex:($,...O)=>Z(void 0,[$,...O],function*(T,C=t){return p(C)}),publishContentToCeramic:(T,C)=>Z(void 0,null,function*(){return k(C)}),readContentFromCeramic:(T,C)=>Z(void 0,null,function*(){return I(C)}),getVerifiableCredentialFromIndex:(T,C)=>Z(void 0,null,function*(){var U;let $=yield p(),O=(U=$==null?void 0:$.credentials)==null?void 0:U.find(j=>(j==null?void 0:j.title)===C);return O&&(yield I(O.id))}),getVerifiableCredentialsFromIndex:()=>Z(void 0,null,function*(){var $,O;let T=yield p(),C=(O=($=T==null?void 0:T.credentials)==null?void 0:$.map(U=>U==null?void 0:U.id))!=null?O:[];return Promise.all(C.map(U=>Z(void 0,null,function*(){return I(U)})))}),addVerifiableCredentialInIdx:(O,U)=>Z(void 0,[O,U],function*(T,{title:C,id:$}){return x({title:C,id:$})})}}}),"getIDXPlugin");var TD=["key","tz","pkh:tz","pkh:tezos","pkh:sol","pkh:solana"],kD=["key","tz","ethr","pkh:tz","pkh:tezos","pkh:eth","pkh:celo","pkh:poly","pkh:btc","pkh:doge","pkh:eip155","pkh:bip122"],d4=o(r=>/^[0-9a-f]+$/i.test(r),"isHex"),h4=o(r=>{if(TD.includes(r))return"ed25519";if(kD.includes(r)||r.startsWith("pkh:eip155:")||r.startsWith("pkh:bip122:"))return"secp256k1";throw new Error("Unspported Did Method")},"getAlgorithmForDidMethod");var p4=o((r,e)=>Z(void 0,null,function*(){if(e.length===0)throw new Error("Please don't use an empty string for a key!");if(!d4(e))throw new Error("Key must be a hexadecimal string!");if(e.length>64)throw new Error("Key must be less than 64 characters");let t=e.padStart(64,"0"),n=el(t),i={},s={ed25519:r.pluginMethods.generateEd25519KeyFromBytes(n),secp256k1:r.pluginMethods.generateSecp256k1KeyFromBytes(n)};return{pluginMethods:{getSubjectDid:(a,f)=>{if(!i[f]){let u=h4(f);i[f]=r.pluginMethods.keyToDid(f,s[u])}return i[f]},getSubjectKeypair:(a,f="ed25519")=>{if(!s[f])throw new Error("Unsupported algorithm");return s[f]},getKey:()=>t}}}),"getDidKeyPlugin");var m4=o(r=>({pluginMethods:{verifyCredential:(e,t)=>Z(void 0,null,function*(){let n=yield r.pluginMethods.verifyCredential(t);return t.expirationDate&&new Date>new Date(t.expirationDate)?n.errors.push("expiration error: Credential is expired"):n.checks.push("expiration"),n})}}),"ExpirationPlugin");var b4=o(r=>({}),"recycleDependents");var g4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectKeypair();if(!n)throw new Error("Cannot issue credential: Could not get subject keypair");let i={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",n),proofPurpose:"assertionMethod"};return r.pluginMethods.issueCredential(t,i,n)}),"issueCredential");var v4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyCredential(t)}),"verifyCredential");var y4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectDid("key");if(!n)throw new Error("Cannot create presentation: No holder key found");let i=n,s=e.pluginMethods.getSubjectKeypair();if(!s)throw new Error("Cannot issue credential: Could not get subject keypair");let a={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",s),proofPurpose:"assertionMethod"},f={"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],holder:i,verifiableCredential:t};return r.pluginMethods.issuePresentation(f,a,s)}),"issuePresentation");var x4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyPresentation(t)}),"verifyPresentation");var fm=o(r=>Z(void 0,null,function*(){return{pluginMethods:Te(ie({},b4(r.pluginMethods)),{issueCredential:g4(r),verifyCredential:v4(r),issuePresentation:y4(r),verifyPresentation:x4(r),getTestVc:(e,t="did:example:d23dd687a7dc6787646f2eb98d0")=>{let n=e.pluginMethods.getSubjectDid("key");return{"@context":["https://www.w3.org/2018/credentials/v1"],id:"http://example.org/credentials/3731",type:["VerifiableCredential"],issuer:n,issuanceDate:"2020-08-19T21:41:50Z",credentialSubject:{id:t}}}})}}),"getVCPlugin");var kt;(function(r){function e(n){throw new Error}o(e,"assertNever"),r.assertNever=e,r.arrayToEnum=n=>{let i={};for(let s of n)i[s]=s;return i},r.getValidEnumValues=n=>{let i=r.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of i)s[a]=n[a];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(i){return n[i]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},r.find=(n,i)=>{for(let s of n)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function t(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}o(t,"joinValues"),r.joinValues=t})(kt||(kt={}));var Me=kt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wo=o(r=>{switch(typeof r){case"undefined":return Me.undefined;case"string":return Me.string;case"number":return isNaN(r)?Me.nan:Me.number;case"boolean":return Me.boolean;case"function":return Me.function;case"bigint":return Me.bigint;case"object":return Array.isArray(r)?Me.array:r===null?Me.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Me.promise:typeof Map!="undefined"&&r instanceof Map?Me.map:typeof Set!="undefined"&&r instanceof Set?Me.set:typeof Date!="undefined"&&r instanceof Date?Me.date:Me.object;default:return Me.unknown}},"getParsedType"),Se=kt.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"]),CD=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),bn=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let f=n,u=0;for(;u<a.path.length;){let m=a.path[u];u===a.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(t(a))):f[m]=f[m]||{_errors:[]},f=f[m],u++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,null,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};o(bn,"ZodError");bn.create=r=>new bn(r);var xc=o((r,e)=>{let t;switch(r.code){case Se.invalid_type:r.received===Me.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Se.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected)}`;break;case Se.unrecognized_keys:t=`Unrecognized key(s) in object: ${kt.joinValues(r.keys,", ")}`;break;case Se.invalid_union:t="Invalid input";break;case Se.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${kt.joinValues(r.options)}`;break;case Se.invalid_enum_value:t=`Invalid enum value. Expected ${kt.joinValues(r.options)}, received '${r.received}'`;break;case Se.invalid_arguments:t="Invalid function arguments";break;case Se.invalid_return_type:t="Invalid function return type";break;case Se.invalid_date:t="Invalid date";break;case Se.invalid_string:r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Se.too_small:r.type==="array"?t=`Array must contain ${r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be greater than ${r.inclusive?"or equal to ":""}${r.minimum}`:t="Invalid input";break;case Se.too_big:r.type==="array"?t=`Array must contain ${r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be less than ${r.inclusive?"or equal to ":""}${r.maximum}`:t="Invalid input";break;case Se.custom:t="Invalid input";break;case Se.invalid_intersection_types:t="Intersection results could not be merged";break;case Se.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;default:t=e.defaultError,kt.assertNever(r)}return{message:t}},"defaultErrorMap"),wc=xc,DD=o(r=>{wc=r},"setErrorMap"),nd=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],a=Te(ie({},i),{path:s}),f="",u=n.filter(m=>!!m).slice().reverse();for(let m of u)f=m(a,{data:e,defaultError:f}).message;return Te(ie({},i),{path:s,message:i.message||f})},"makeIssue"),OD=[];function Re(r,e){let t=nd({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wc,xc].filter(n=>!!n)});r.common.issues.push(t)}o(Re,"addIssueToContext");var or=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return nt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static mergeObjectAsync(e,t){return Z(this,null,function*(){let n=[];for(let i of t)n.push({key:yield i.key,value:yield i.value});return or.mergeObjectSync(e,n)})}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return nt;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),(typeof a.value!="undefined"||i.alwaysSet)&&(n[s.value]=a.value)}return{status:e.value,value:n}}};o(or,"ParseStatus");var nt=Object.freeze({status:"aborted"}),ID=o(r=>({status:"dirty",value:r}),"DIRTY"),_r=o(r=>({status:"valid",value:r}),"OK"),cm=o(r=>r.status==="aborted","isAborted"),um=o(r=>r.status==="dirty","isDirty"),id=o(r=>r.status==="valid","isValid"),lm=o(r=>typeof Promise!==void 0&&r instanceof Promise,"isAsync"),xt;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(xt||(xt={}));var jr=class{constructor(e,t,n,i){this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._path.concat(this._key)}};o(jr,"ParseInputLazyPath");var w4=o((r,e)=>{if(id(e))return{success:!0,data:e.value};{if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");let t=new bn(r.common.issues);return{success:!1,error:t}}},"handleResult");function st(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||n))throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((a,f)=>a.code!=="invalid_type"?{message:f.defaultError}:typeof f.data=="undefined"&&n?{message:n}:r.invalid_type_error?{message:r.invalid_type_error}:{message:f.defaultError},"customMap"),description:i}}o(st,"processCreateParams");var ot=class{constructor(e){this.spa=this.safeParseAsync,this.superRefine=this._refinement,this._def=e,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.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return wo(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new or,ctx:{common:e.parent.common,data:e.data,parsedType:wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(lm(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wo(e)},s=this._parseSync({data:e,path:i.path,parent:i});return w4(i,s)}parseAsync(e,t){return Z(this,null,function*(){let n=yield this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error})}safeParseAsync(e,t){return Z(this,null,function*(){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wo(e)},i=this._parse({data:e,path:[],parent:n}),s=yield lm(i)?i:Promise.resolve(i);return w4(n,s)})}refine(e,t){let n=o(i=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let a=e(i),f=o(()=>s.addIssue(ie({code:Se.custom},n(i))),"setError");return typeof Promise!="undefined"&&a instanceof Promise?a.then(u=>u?!0:(f(),!1)):a?!0:(f(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"refinement",refinement:e}})}optional(){return Gr.create(this)}nullable(){return bi.create(this)}nullish(){return this.optional().nullable()}array(){return Kr.create(this)}promise(){return zi.create(this)}or(e){return _o.create([this,e])}and(e){return Eo.create(this,e)}transform(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Za({innerType:this,defaultValue:t,typeName:et.ZodDefault})}describe(e){let t=this.constructor;return new t(Te(ie({},this._def),{description:e}))}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(ot,"ZodType");var PD=/^c[^\s-]{8,}$/i,ND=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,RD=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Nn=class extends ot{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(i=>e.test(i),ie({validation:t,code:Se.invalid_string},xt.errToObj(n))),this.nonempty=e=>this.min(1,xt.errToObj(e)),this.trim=()=>new Nn(Te(ie({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}_parse(e){if(this._getType(e)!==Me.string){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.string,received:s.parsedType}),nt}let n=new or,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_small,minimum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_big,maximum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="email")RD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"email",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")ND.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"uuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")PD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"cuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch(a){i=this._getOrReturnCtx(e,i),Re(i,{validation:"url",code:Se.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"regex",code:Se.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():kt.assertNever(s);return{status:n.value,value:e.data}}_addCheck(e){return new Nn(Te(ie({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(ie({kind:"email"},xt.errToObj(e)))}url(e){return this._addCheck(ie({kind:"url"},xt.errToObj(e)))}uuid(e){return this._addCheck(ie({kind:"uuid"},xt.errToObj(e)))}cuid(e){return this._addCheck(ie({kind:"cuid"},xt.errToObj(e)))}regex(e,t){return this._addCheck(ie({kind:"regex",regex:e},xt.errToObj(t)))}min(e,t){return this._addCheck(ie({kind:"min",value:e},xt.errToObj(t)))}max(e,t){return this._addCheck(ie({kind:"max",value:e},xt.errToObj(t)))}length(e,t){return this.min(e,t).max(e,t)}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=-1/0;return this._def.checks.map(t=>{t.kind==="min"&&(e===null||t.value>e)&&(e=t.value)}),e}get maxLength(){let e=null;return this._def.checks.map(t=>{t.kind==="max"&&(e===null||t.value<e)&&(e=t.value)}),e}};o(Nn,"ZodString");Nn.create=r=>new Nn(ie({checks:[],typeName:et.ZodString},st(r)));function LD(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,s=parseInt(r.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}o(LD,"floatSafeRemainder");var hi=class extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._getType(e)!==Me.number){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.number,received:s.parsedType}),nt}let n,i=new or;for(let s of this._def.checks)s.kind==="int"?kt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?LD(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):kt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xt.toString(t))}setLimit(e,t,n,i){return new hi(Te(ie({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:xt.toString(i)}]}))}_addCheck(e){return new hi(Te(ie({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:xt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xt.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};o(hi,"ZodNumber");hi.create=r=>new hi(ie({checks:[],typeName:et.ZodNumber},st(r)));var ks=class extends ot{_parse(e){if(this._getType(e)!==Me.bigint){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.bigint,received:n.parsedType}),nt}return _r(e.data)}};o(ks,"ZodBigInt");ks.create=r=>new ks(ie({typeName:et.ZodBigInt},st(r)));var Cs=class extends ot{_parse(e){if(this._getType(e)!==Me.boolean){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.boolean,received:n.parsedType}),nt}return _r(e.data)}};o(Cs,"ZodBoolean");Cs.create=r=>new Cs(ie({typeName:et.ZodBoolean},st(r)));var Ds=class extends ot{_parse(e){if(this._getType(e)!==Me.date){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.date,received:n.parsedType}),nt}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_date}),nt}return{status:"valid",value:new Date(e.data.getTime())}}};o(Ds,"ZodDate");Ds.create=r=>new Ds(ie({typeName:et.ZodDate},st(r)));var Os=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.undefined,received:n.parsedType}),nt}return _r(e.data)}};o(Os,"ZodUndefined");Os.create=r=>new Os(ie({typeName:et.ZodUndefined},st(r)));var Is=class extends ot{_parse(e){if(this._getType(e)!==Me.null){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.null,received:n.parsedType}),nt}return _r(e.data)}};o(Is,"ZodNull");Is.create=r=>new Is(ie({typeName:et.ZodNull},st(r)));var Hi=class extends ot{constructor(){super(...arguments),this._any=!0}_parse(e){return _r(e.data)}};o(Hi,"ZodAny");Hi.create=r=>new Hi(ie({typeName:et.ZodAny},st(r)));var Rn=class extends ot{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _r(e.data)}};o(Rn,"ZodUnknown");Rn.create=r=>new Rn(ie({typeName:et.ZodUnknown},st(r)));var Ln=class extends ot{_parse(e){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_type,expected:Me.never,received:t.parsedType}),nt}};o(Ln,"ZodNever");Ln.create=r=>new Ln(ie({typeName:et.ZodNever},st(r)));var Ps=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.void,received:n.parsedType}),nt}return _r(e.data)}};o(Ps,"ZodVoid");Ps.create=r=>new Ps(ie({typeName:et.ZodVoid},st(r)));var Kr=class extends ot{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==Me.array)return Re(t,{code:Se.invalid_type,expected:Me.array,received:t.parsedType}),nt;if(i.minLength!==null&&t.data.length<i.minLength.value&&(Re(t,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(Re(t,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all(t.data.map((a,f)=>i.type._parseAsync(new jr(t,a,t.path,f)))).then(a=>or.mergeArray(n,a));let s=t.data.map((a,f)=>i.type._parseSync(new jr(t,a,t.path,f)));return or.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Kr(Te(ie({},this._def),{minLength:{value:e,message:xt.toString(t)}}))}max(e,t){return new Kr(Te(ie({},this._def),{maxLength:{value:e,message:xt.toString(t)}}))}length(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Kr,"ZodArray");Kr.create=(r,e)=>new Kr(ie({type:r,minLength:null,maxLength:null,typeName:et.ZodArray},st(e)));var od;(function(r){r.mergeShapes=(e,t)=>ie(ie({},e),t)})(od||(od={}));var _4=o(r=>e=>new Et(Te(ie({},r),{shape:()=>ie(ie({},r.shape()),e)})),"AugmentFactory");function Xa(r){if(r instanceof Et){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Gr.create(Xa(n))}return new Et(Te(ie({},r._def),{shape:()=>e}))}else return r instanceof Kr?Kr.create(Xa(r.element)):r instanceof Gr?Gr.create(Xa(r.unwrap())):r instanceof bi?bi.create(Xa(r.unwrap())):r instanceof Vr?Vr.create(r.items.map(e=>Xa(e))):r}o(Xa,"deepPartialify");var Et=class extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=_4(this._def),this.extend=_4(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=kt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Me.object){let m=this._getOrReturnCtx(e);return Re(m,{code:Se.invalid_type,expected:Me.object,received:m.parsedType}),nt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),f=[];for(let m in i.data)a.includes(m)||f.push(m);let u=[];for(let m of a){let p=s[m],x=i.data[m];u.push({key:{status:"valid",value:m},value:p._parse(new jr(i,x,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof Ln){let m=this._def.unknownKeys;if(m==="passthrough")for(let p of f)u.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(m==="strict")f.length>0&&(Re(i,{code:Se.unrecognized_keys,keys:f}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let p of f){let x=i.data[p];u.push({key:{status:"valid",value:p},value:m._parse(new jr(i,x,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(()=>Z(this,null,function*(){let m=[];for(let p of u){let x=yield p.key;m.push({key:x,value:yield p.value,alwaysSet:p.alwaysSet})}return m})).then(m=>or.mergeObjectSync(n,m)):or.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return xt.errToObj,new Et(ie(Te(ie({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,a,f;let u=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&a!==void 0?a:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=xt.errToObj(e).message)!==null&&f!==void 0?f:u}:{message:u}}}:{}))}strip(){return new Et(Te(ie({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Et(Te(ie({},this._def),{unknownKeys:"passthrough"}))}setKey(e,t){return this.augment({[e]:t})}merge(e){return new Et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>od.mergeShapes(this._def.shape(),e._def.shape()),typeName:et.ZodObject})}catchall(e){return new Et(Te(ie({},this._def),{catchall:e}))}pick(e){let t={};return kt.objectKeys(e).map(n=>{this.shape[n]&&(t[n]=this.shape[n])}),new Et(Te(ie({},this._def),{shape:()=>t}))}omit(e){let t={};return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1&&(t[n]=this.shape[n])}),new Et(Te(ie({},this._def),{shape:()=>t}))}deepPartial(){return Xa(this)}partial(e){let t={};if(e)return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1?t[n]=this.shape[n]:t[n]=this.shape[n].optional()}),new Et(Te(ie({},this._def),{shape:()=>t}));for(let n in this.shape){let i=this.shape[n];t[n]=i.optional()}return new Et(Te(ie({},this._def),{shape:()=>t}))}required(){let e={};for(let t in this.shape){let i=this.shape[t];for(;i instanceof Gr;)i=i._def.innerType;e[t]=i}return new Et(Te(ie({},this._def),{shape:()=>e}))}};o(Et,"ZodObject");Et.create=(r,e)=>new Et(ie({shape:()=>r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.strictCreate=(r,e)=>new Et(ie({shape:()=>r,unknownKeys:"strict",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.lazycreate=(r,e)=>new Et(ie({shape:r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));var _o=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let f of s)if(f.result.status==="valid")return f.result;for(let f of s)if(f.result.status==="dirty")return t.common.issues.push(...f.ctx.common.issues),f.result;let a=s.map(f=>new bn(f.ctx.common.issues));return Re(t,{code:Se.invalid_union,unionErrors:a}),nt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(s=>Z(this,null,function*(){let a=Te(ie({},t),{common:Te(ie({},t.common),{issues:[]}),parent:null});return{result:yield s._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then(i);{let s,a=[];for(let u of n){let m=Te(ie({},t),{common:Te(ie({},t.common),{issues:[]}),parent:null}),p=u._parseSync({data:t.data,path:t.path,parent:m});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:m}),m.common.issues.length&&a.push(m.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let f=a.map(u=>new bn(u));return Re(t,{code:Se.invalid_union,unionErrors:f}),nt}}get options(){return this._def.options}};o(_o,"ZodUnion");_o.create=(r,e)=>new _o(ie({options:r,typeName:et.ZodUnion},st(e)));var Ns=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.object)return Re(t,{code:Se.invalid_type,expected:Me.object,received:t.parsedType}),nt;let n=this.discriminator,i=t.data[n],s=this.options.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(Re(t,{code:Se.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[n]}),nt)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(e,t,n){let i=new Map;try{t.forEach(s=>{let a=s.shape[e].value;i.set(a,s)})}catch(s){throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==t.length)throw new Error("Some of the discriminator values are not unique");return new Ns(ie({typeName:et.ZodDiscriminatedUnion,discriminator:e,options:i},st(n)))}};o(Ns,"ZodDiscriminatedUnion");function dm(r,e){let t=wo(r),n=wo(e);if(r===e)return{valid:!0,data:r};if(t===Me.object&&n===Me.object){let i=kt.objectKeys(e),s=kt.objectKeys(r).filter(f=>i.indexOf(f)!==-1),a=ie(ie({},r),e);for(let f of s){let u=dm(r[f],e[f]);if(!u.valid)return{valid:!1};a[f]=u.data}return{valid:!0,data:a}}else if(t===Me.array&&n===Me.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let a=r[s],f=e[s],u=dm(a,f);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===Me.date&&n===Me.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(dm,"mergeValues");var Eo=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,a)=>{if(cm(s)||cm(a))return nt;let f=dm(s.value,a.value);return f.valid?((um(s)||um(a))&&t.dirty(),{status:t.value,value:f.data}):(Re(n,{code:Se.invalid_intersection_types}),nt)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(Eo,"ZodIntersection");Eo.create=(r,e,t)=>new Eo(ie({left:r,right:e,typeName:et.ZodIntersection},st(t)));var Vr=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.array)return Re(n,{code:Se.invalid_type,expected:Me.array,received:n.parsedType}),nt;if(n.data.length<this._def.items.length)return Re(n,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),nt;!this._def.rest&&n.data.length>this._def.items.length&&(Re(n,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),t.dirty());let s=n.data.map((a,f)=>{let u=this._def.items[f]||this._def.rest;return u?u._parse(new jr(n,a,n.path,f)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>or.mergeArray(t,a)):or.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Vr(Te(ie({},this._def),{rest:e}))}};o(Vr,"ZodTuple");Vr.create=(r,e)=>new Vr(ie({items:r,typeName:et.ZodTuple,rest:null},st(e)));var So=class extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.object)return Re(n,{code:Se.invalid_type,expected:Me.object,received:n.parsedType}),nt;let i=[],s=this._def.keyType,a=this._def.valueType;for(let f in n.data)i.push({key:s._parse(new jr(n,f,n.path,f)),value:a._parse(new jr(n,n.data[f],n.path,f))});return n.common.async?or.mergeObjectAsync(t,i):or.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ot?new So(ie({keyType:e,valueType:t,typeName:et.ZodRecord},st(n))):new So(ie({keyType:Nn.create(),valueType:e,typeName:et.ZodRecord},st(t)))}};o(So,"ZodRecord");var Rs=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.map)return Re(n,{code:Se.invalid_type,expected:Me.map,received:n.parsedType}),nt;let i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([f,u],m)=>({key:i._parse(new jr(n,f,n.path,[m,"key"])),value:s._parse(new jr(n,u,n.path,[m,"value"]))}));if(n.common.async){let f=new Map;return Promise.resolve().then(()=>Z(this,null,function*(){for(let u of a){let m=yield u.key,p=yield u.value;if(m.status==="aborted"||p.status==="aborted")return nt;(m.status==="dirty"||p.status==="dirty")&&t.dirty(),f.set(m.value,p.value)}return{status:t.value,value:f}}))}else{let f=new Map;for(let u of a){let m=u.key,p=u.value;if(m.status==="aborted"||p.status==="aborted")return nt;(m.status==="dirty"||p.status==="dirty")&&t.dirty(),f.set(m.value,p.value)}return{status:t.value,value:f}}}};o(Rs,"ZodMap");Rs.create=(r,e,t)=>new Rs(ie({valueType:e,keyType:r,typeName:et.ZodMap},st(t)));var pi=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.set)return Re(n,{code:Se.invalid_type,expected:Me.set,received:n.parsedType}),nt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Re(n,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Re(n,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function a(u){let m=new Set;for(let p of u){if(p.status==="aborted")return nt;p.status==="dirty"&&t.dirty(),m.add(p.value)}return{status:t.value,value:m}}o(a,"finalizeSet");let f=[...n.data.values()].map((u,m)=>s._parse(new jr(n,u,n.path,m)));return n.common.async?Promise.all(f).then(u=>a(u)):a(f)}min(e,t){return new pi(Te(ie({},this._def),{minSize:{value:e,message:xt.toString(t)}}))}max(e,t){return new pi(Te(ie({},this._def),{maxSize:{value:e,message:xt.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(pi,"ZodSet");pi.create=(r,e)=>new pi(ie({valueType:r,minSize:null,maxSize:null,typeName:et.ZodSet},st(e)));var mi=class extends ot{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.function)return Re(t,{code:Se.invalid_type,expected:Me.function,received:t.parsedType}),nt;function n(f,u){return nd({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wc,xc].filter(m=>!!m),issueData:{code:Se.invalid_arguments,argumentsError:u}})}o(n,"makeArgsIssue");function i(f,u){return nd({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wc,xc].filter(m=>!!m),issueData:{code:Se.invalid_return_type,returnTypeError:u}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},a=t.data;return this._def.returns instanceof zi?_r((...f)=>Z(this,null,function*(){let u=new bn([]),m=yield this._def.args.parseAsync(f,s).catch(k=>{throw u.addIssue(n(f,k)),u}),p=yield a(...m);return yield this._def.returns._def.type.parseAsync(p,s).catch(k=>{throw u.addIssue(i(p,k)),u})})):_r((...f)=>{let u=this._def.args.safeParse(f,s);if(!u.success)throw new bn([n(f,u.error)]);let m=a(...u.data),p=this._def.returns.safeParse(m,s);if(!p.success)throw new bn([i(m,p.error)]);return p.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mi(Te(ie({},this._def),{args:Vr.create(e).rest(Rn.create())}))}returns(e){return new mi(Te(ie({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}};o(mi,"ZodFunction");mi.create=(r,e,t)=>new mi(ie({args:r?r.rest(Rn.create()):Vr.create([]).rest(Rn.create()),returns:e||Rn.create(),typeName:et.ZodFunction},st(t)));var Ls=class extends ot{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};o(Ls,"ZodLazy");Ls.create=(r,e)=>new Ls(ie({getter:r,typeName:et.ZodLazy},st(e)));var Bs=class extends ot{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(Bs,"ZodLiteral");Bs.create=(r,e)=>new Bs(ie({value:r,typeName:et.ZodLiteral},st(e)));function BD(r,e){return new Us(ie({values:r,typeName:et.ZodEnum},st(e)))}o(BD,"createZodEnum");var Us=class extends ot{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{expected:kt.joinValues(n),received:t.parsedType,code:Se.invalid_type}),nt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{received:t.data,code:Se.invalid_enum_value,options:n}),nt}return _r(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}};o(Us,"ZodEnum");Us.create=BD;var Fs=class extends ot{_parse(e){let t=kt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Me.string&&n.parsedType!==Me.number){let i=kt.objectValues(t);return Re(n,{expected:kt.joinValues(i),received:n.parsedType,code:Se.invalid_type}),nt}if(t.indexOf(e.data)===-1){let i=kt.objectValues(t);return Re(n,{received:n.data,code:Se.invalid_enum_value,options:i}),nt}return _r(e.data)}get enum(){return this._def.values}};o(Fs,"ZodNativeEnum");Fs.create=(r,e)=>new Fs(ie({values:r,typeName:et.ZodNativeEnum},st(e)));var zi=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.promise&&t.common.async===!1)return Re(t,{code:Se.invalid_type,expected:Me.promise,received:t.parsedType}),nt;let n=t.parsedType===Me.promise?t.data:Promise.resolve(t.data);return _r(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(zi,"ZodPromise");zi.create=(r,e)=>new zi(ie({type:r,typeName:et.ZodPromise},st(e)));var Wr=class extends ot{innerType(){return this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let a=i.transform(n.data);return n.common.async?Promise.resolve(a).then(f=>this._def.schema._parseAsync({data:f,path:n.path,parent:n})):this._def.schema._parseSync({data:a,path:n.path,parent:n})}let s={addIssue:a=>{Re(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="refinement"){let a=o(f=>{let u=i.refinement(f,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f},"executeRefinement");if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value),{status:t.value,value:f.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value).then(()=>({status:t.value,value:f.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!id(a))return a;let f=i.transform(a.value,s);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:f}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>id(a)?Promise.resolve(i.transform(a.value,s)).then(f=>({status:t.value,value:f})):a);kt.assertNever(i)}};o(Wr,"ZodEffects");Wr.create=(r,e,t)=>new Wr(ie({schema:r,typeName:et.ZodEffects,effect:e},st(t)));Wr.createWithPreprocess=(r,e,t)=>new Wr(ie({schema:e,effect:{type:"preprocess",transform:r},typeName:et.ZodEffects},st(t)));var Gr=class extends ot{_parse(e){return this._getType(e)===Me.undefined?_r(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Gr,"ZodOptional");Gr.create=(r,e)=>new Gr(ie({innerType:r,typeName:et.ZodOptional},st(e)));var bi=class extends ot{_parse(e){return this._getType(e)===Me.null?_r(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(bi,"ZodNullable");bi.create=(r,e)=>new bi(ie({innerType:r,typeName:et.ZodNullable},st(e)));var Za=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(Za,"ZodDefault");Za.create=(r,e)=>new Gr(ie({innerType:r,typeName:et.ZodOptional},st(e)));var $s=class extends ot{_parse(e){if(this._getType(e)!==Me.nan){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.nan,received:n.parsedType}),nt}return{status:"valid",value:e.data}}};o($s,"ZodNaN");$s.create=r=>new $s(ie({typeName:et.ZodNaN},st(r)));var S4=o((r,e={},t)=>r?Hi.create().superRefine((n,i)=>{if(!r(n)){let s=typeof e=="function"?e(n):e,a=typeof s=="string"?{message:s}:s;i.addIssue(Te(ie({code:"custom"},a),{fatal:t}))}}):Hi.create(),"custom"),UD={object:Et.lazycreate},et;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodPromise="ZodPromise"})(et||(et={}));var FD=o((r,e={message:`Input not instance of ${r.name}`})=>S4(t=>t instanceof r,e,!0),"instanceOfType"),M4=Nn.create,A4=hi.create,$D=$s.create,qD=ks.create,T4=Cs.create,HD=Ds.create,zD=Os.create,jD=Is.create,KD=Hi.create,VD=Rn.create,WD=Ln.create,GD=Ps.create,YD=Kr.create,JD=Et.create,XD=Et.strictCreate,ZD=_o.create,QD=Ns.create,eO=Eo.create,tO=Vr.create,rO=So.create,nO=Rs.create,iO=pi.create,oO=mi.create,sO=Ls.create,aO=Bs.create,fO=Us.create,cO=Fs.create,uO=zi.create,E4=Wr.create,lO=Gr.create,dO=bi.create,hO=Wr.createWithPreprocess,pO=o(()=>M4().optional(),"ostring"),mO=o(()=>A4().optional(),"onumber"),bO=o(()=>T4().optional(),"oboolean"),oe=Object.freeze({__proto__:null,getParsedType:wo,ZodParsedType:Me,makeIssue:nd,EMPTY_PATH:OD,addIssueToContext:Re,ParseStatus:or,INVALID:nt,DIRTY:ID,OK:_r,isAborted:cm,isDirty:um,isValid:id,isAsync:lm,ZodType:ot,ZodString:Nn,ZodNumber:hi,ZodBigInt:ks,ZodBoolean:Cs,ZodDate:Ds,ZodUndefined:Os,ZodNull:Is,ZodAny:Hi,ZodUnknown:Rn,ZodNever:Ln,ZodVoid:Ps,ZodArray:Kr,get objectUtil(){return od},ZodObject:Et,ZodUnion:_o,ZodDiscriminatedUnion:Ns,ZodIntersection:Eo,ZodTuple:Vr,ZodRecord:So,ZodMap:Rs,ZodSet:pi,ZodFunction:mi,ZodLazy:Ls,ZodLiteral:Bs,ZodEnum:Us,ZodNativeEnum:Fs,ZodPromise:zi,ZodEffects:Wr,ZodTransformer:Wr,ZodOptional:Gr,ZodNullable:bi,ZodDefault:Za,ZodNaN:$s,custom:S4,Schema:ot,ZodSchema:ot,late:UD,get ZodFirstPartyTypeKind(){return et},any:KD,array:YD,bigint:qD,boolean:T4,date:HD,discriminatedUnion:QD,effect:E4,enum:fO,function:oO,instanceof:FD,intersection:eO,lazy:sO,literal:aO,map:nO,nan:$D,nativeEnum:cO,never:WD,null:jD,nullable:dO,number:A4,object:JD,oboolean:bO,onumber:mO,optional:lO,ostring:pO,preprocess:hO,promise:uO,record:rO,set:iO,strictObject:XD,string:M4,transformer:E4,tuple:tO,undefined:zD,union:ZD,unknown:VD,void:GD,ZodIssueCode:Se,quotelessJson:CD,ZodError:bn,defaultErrorMap:xc,get overrideErrorMap(){return wc},setErrorMap:DD});var D4=oe.string().array(),WV=oe.object({type:oe.string().optional(),narrative:oe.string().optional()}),pm=oe.string().or(oe.object({id:oe.string(),type:oe.string(),caption:oe.string().optional()})),gO=oe.object({type:oe.string().array().nonempty(),latitude:oe.number(),longitude:oe.number()}),vO=oe.object({type:oe.string().array().nonempty(),addressCountry:oe.string().optional(),addressCountryCode:oe.string().optional(),addressRegion:oe.string().optional(),addressLocality:oe.string().optional(),streetAddress:oe.string().optional(),postOfficeBoxNumber:oe.string().optional(),postalCode:oe.string().optional(),geo:gO.optional()}),yO=oe.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(oe.string()),O4=oe.object({type:oe.string().array().nonempty(),identifier:oe.string(),identifierType:yO}),_c=oe.string().or(oe.object({id:oe.string().optional(),type:oe.string().array().nonempty().optional(),name:oe.string().optional(),url:oe.string().optional(),phone:oe.string().optional(),description:oe.string().optional(),endorsement:oe.any().array().optional(),image:pm.optional(),email:oe.string().email().optional(),address:vO.optional(),otherIdentifier:O4.array().optional(),official:oe.string().optional(),parentOrg:oe.any().optional(),familyName:oe.string().optional(),givenName:oe.string().optional(),additionalName:oe.string().optional(),patronymicName:oe.string().optional(),honorificPrefix:oe.string().optional(),honorificSuffix:oe.string().optional(),familyNamePrefix:oe.string().optional(),dateOfBirth:oe.string().optional()}).catchall(oe.any())),hm=oe.object({id:oe.string().optional()}).catchall(oe.any()),xO=oe.object({type:oe.string(),id:oe.string()}),wO=oe.object({id:oe.string(),type:oe.string()}),_O=oe.object({id:oe.string(),type:oe.string()}).catchall(oe.any()),sd=oe.object({"@context":D4,id:oe.string().optional(),type:oe.string().array().nonempty(),issuer:_c,issuanceDate:oe.string(),expirationDate:oe.string().optional(),credentialSubject:hm.or(hm.array()),credentialStatus:xO.optional(),credentialSchema:wO.array().optional(),refreshService:_O.optional()}).catchall(oe.any()),Mo=oe.object({type:oe.string(),created:oe.string(),challenge:oe.string().optional(),domain:oe.string().optional(),nonce:oe.string().optional(),proofPurpose:oe.string(),verificationMethod:oe.string(),jws:oe.string().optional()}).catchall(oe.any()),k4=sd.extend({proof:Mo.or(Mo.array())}),EO=oe.object({"@context":D4,id:oe.string().optional(),type:oe.string().array().nonempty(),verifiableCredential:k4.or(k4.array()),holder:oe.string().optional()}).catchall(oe.any()),GV=EO.extend({proof:Mo.or(Mo.array())}),SO=oe.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(oe.string()),ad=oe.object({type:oe.string().array().nonempty(),targetCode:oe.string().optional(),targetDescription:oe.string().optional(),targetName:oe.string(),targetFramework:oe.string().optional(),targetType:SO.optional(),targetUrl:oe.string()}),MO=oe.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]).or(oe.string()),AO=oe.object({id:oe.string().optional(),narrative:oe.string().optional()}).catchall(oe.any()),TO=oe.object({id:oe.string(),type:oe.string().array().nonempty(),endorsementComment:oe.string().optional()}),kO=sd.extend({credentialSubject:TO,proof:Mo.or(Mo.array()).optional()}),CO=oe.object({id:oe.string(),"@language":oe.string().optional(),version:oe.string().optional()}),DO=oe.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(oe.string()),OO=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ad.array().optional(),description:oe.string().optional(),level:oe.string().optional(),name:oe.string(),points:oe.string().optional()}).catchall(oe.any()),IO=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ad.array().optional(),allowedValue:oe.string().array().optional(),name:oe.string(),requiredLevel:oe.string().optional(),requiredValue:oe.string().optional(),resultType:DO,rubricCriterionLevel:OO.array().optional(),valueMax:oe.string().optional(),valueMin:oe.string().optional()}).catchall(oe.any()),PO=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),alignment:ad.array().optional(),achievementType:MO.optional(),creator:_c.optional(),creditsAvailable:oe.number().optional(),criteria:AO,description:oe.string(),endorsement:kO.array().optional(),fieldOfStudy:oe.string().optional(),humanCode:oe.string().optional(),image:pm.optional(),"@language":oe.string().optional(),name:oe.string(),otherIdentifier:O4.array().optional(),related:CO.array().optional(),resultDescription:IO.array().optional(),specialization:oe.string().optional(),tag:oe.string().array().optional(),version:oe.string().optional()}).catchall(oe.any()),NO=oe.object({type:oe.string(),hashed:oe.boolean(),identityHash:oe.string(),identityType:oe.string(),salt:oe.string().optional()}),RO=oe.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),LO=oe.object({type:oe.string().array().nonempty(),achievedLevel:oe.string().optional(),alignment:ad.array().optional(),resultDescription:oe.string().optional(),status:RO.optional(),value:oe.string().optional()}).catchall(oe.any()),C4=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),activityEndDate:oe.string().optional(),activityStartDate:oe.string().optional(),creditsEarned:oe.number().optional(),achievement:PO.optional(),identifier:NO.optional(),image:pm.optional(),licenseNumber:oe.string().optional(),narrative:oe.string().optional(),result:LO.array().optional(),role:oe.string().optional(),source:_c.optional(),term:oe.string().optional()}).catchall(oe.any()),BO=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),narrative:oe.string().optional(),name:oe.string().optional(),description:oe.string().optional(),genre:oe.string().optional(),audience:oe.string().optional()}).catchall(oe.any()),UO=sd.extend({name:oe.string().optional(),description:oe.string().optional(),image:oe.string().optional(),credentialSubject:C4.or(C4.array()),endorsement:sd.array().optional(),evidence:BO.array().optional()}),JV=UO.extend({proof:Mo.or(Mo.array())}),ZV=oe.object({checks:oe.string().array(),warnings:oe.string().array(),errors:oe.string().array()}),I4=oe.enum(["Success","Failed","Error"]),fd=I4.enum,QV=oe.object({check:oe.string(),status:I4,message:oe.string().optional(),details:oe.string().optional()}),eW=oe.object({title:oe.string().optional(),createdAt:oe.string().optional(),issuer:_c.optional(),issuee:_c.optional(),credentialSubject:hm.optional()});function Ht(r){if(r===null||r===!0||r===!1)return NaN;var e=Number(r);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}o(Ht,"toInteger");function pt(r,e){if(e.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+e.length+" present")}o(pt,"requiredArgs");function Ft(r){pt(1,arguments);var e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new Date(r.getTime()):typeof r=="number"||e==="[object Number]"?new Date(r):((typeof r=="string"||e==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}o(Ft,"toDate");function mm(r,e){pt(2,arguments);var t=Ft(r).getTime(),n=Ht(e);return new Date(t+n)}o(mm,"addMilliseconds");function bm(r){var e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),r.getTime()-e.getTime()}o(bm,"getTimezoneOffsetInMilliseconds");function gm(r){return pt(1,arguments),r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}o(gm,"isDate");function vm(r){if(pt(1,arguments),!gm(r)&&typeof r!="number")return!1;var e=Ft(r);return!isNaN(Number(e))}o(vm,"isValid");var FO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$O=o(function(r,e,t){var n,i=FO[r];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n},"formatDistance"),P4=$O;function Ec(r){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):r.defaultWidth,n=r.formats[t]||r.formats[r.defaultWidth];return n}}o(Ec,"buildFormatLongFn");var qO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},HO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},jO={date:Ec({formats:qO,defaultWidth:"full"}),time:Ec({formats:HO,defaultWidth:"full"}),dateTime:Ec({formats:zO,defaultWidth:"full"})},N4=jO;var KO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},VO=o(function(r,e,t,n){return KO[r]},"formatRelative"),R4=VO;function qs(r){return function(e,t){var n=t||{},i=n.context?String(n.context):"standalone",s;if(i==="formatting"&&r.formattingValues){var a=r.defaultFormattingWidth||r.defaultWidth,f=n.width?String(n.width):a;s=r.formattingValues[f]||r.formattingValues[a]}else{var u=r.defaultWidth,m=n.width?String(n.width):r.defaultWidth;s=r.values[m]||r.values[u]}var p=r.argumentCallback?r.argumentCallback(e):e;return s[p]}}o(qs,"buildLocalizeFn");var WO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},GO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YO={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},JO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},XO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ZO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},QO=o(function(r,e){var t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},"ordinalNumber"),eI={ordinalNumber:QO,era:qs({values:WO,defaultWidth:"wide"}),quarter:qs({values:GO,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:qs({values:YO,defaultWidth:"wide"}),day:qs({values:JO,defaultWidth:"wide"}),dayPeriod:qs({values:XO,defaultWidth:"wide",formattingValues:ZO,defaultFormattingWidth:"wide"})},L4=eI;function Hs(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(i);if(!s)return null;var a=s[0],f=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],u=Array.isArray(f)?rI(f,function(x){return x.test(a)}):tI(f,function(x){return x.test(a)}),m;m=r.valueCallback?r.valueCallback(u):u,m=t.valueCallback?t.valueCallback(m):m;var p=e.slice(a.length);return{value:m,rest:p}}}o(Hs,"buildMatchFn");function tI(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}o(tI,"findKey");function rI(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}o(rI,"findIndex");function ym(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.match(r.matchPattern);if(!n)return null;var i=n[0],s=e.match(r.parsePattern);if(!s)return null;var a=r.valueCallback?r.valueCallback(s[0]):s[0];a=t.valueCallback?t.valueCallback(a):a;var f=e.slice(i.length);return{value:a,rest:f}}}o(ym,"buildMatchPatternFn");var nI=/^(\d+)(th|st|nd|rd)?/i,iI=/\d+/i,oI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sI={any:[/^b/i,/^(a|c)/i]},aI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fI={any:[/1/i,/2/i,/3/i,/4/i]},cI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lI={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dI={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hI={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},pI={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},mI={ordinalNumber:ym({matchPattern:nI,parsePattern:iI,valueCallback:function(r){return parseInt(r,10)}}),era:Hs({matchPatterns:oI,defaultMatchWidth:"wide",parsePatterns:sI,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:aI,defaultMatchWidth:"wide",parsePatterns:fI,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Hs({matchPatterns:cI,defaultMatchWidth:"wide",parsePatterns:uI,defaultParseWidth:"any"}),day:Hs({matchPatterns:lI,defaultMatchWidth:"wide",parsePatterns:dI,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:hI,defaultMatchWidth:"any",parsePatterns:pI,defaultParseWidth:"any"})},B4=mI;var bI={code:"en-US",formatDistance:P4,formatLong:N4,formatRelative:R4,localize:L4,match:B4,options:{weekStartsOn:0,firstWeekContainsDate:1}},U4=bI;function xm(r,e){pt(2,arguments);var t=Ht(e);return mm(r,-t)}o(xm,"subMilliseconds");var gI=864e5;function wm(r){pt(1,arguments);var e=Ft(r),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),i=t-n;return Math.floor(i/gI)+1}o(wm,"getUTCDayOfYear");function Ao(r){pt(1,arguments);var e=1,t=Ft(r),n=t.getUTCDay(),i=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}o(Ao,"startOfUTCISOWeek");function Sc(r){pt(1,arguments);var e=Ft(r),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Ao(n),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var a=Ao(s);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}o(Sc,"getUTCISOWeekYear");function _m(r){pt(1,arguments);var e=Sc(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=Ao(t);return n}o(_m,"startOfUTCISOWeekYear");var vI=6048e5;function Em(r){pt(1,arguments);var e=Ft(r),t=Ao(e).getTime()-_m(e).getTime();return Math.round(t/vI)+1}o(Em,"getUTCISOWeek");function To(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.weekStartsOn,s=i==null?0:Ht(i),a=t.weekStartsOn==null?s:Ht(t.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Ft(r),u=f.getUTCDay(),m=(u<a?7:0)+u-a;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}o(To,"startOfUTCWeek");function Mc(r,e){pt(1,arguments);var t=Ft(r),n=t.getUTCFullYear(),i=e||{},s=i.locale,a=s&&s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(n+1,0,u),m.setUTCHours(0,0,0,0);var p=To(m,e),x=new Date(0);x.setUTCFullYear(n,0,u),x.setUTCHours(0,0,0,0);var k=To(x,e);return t.getTime()>=p.getTime()?n+1:t.getTime()>=k.getTime()?n:n-1}o(Mc,"getUTCWeekYear");function Sm(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.firstWeekContainsDate,s=i==null?1:Ht(i),a=t.firstWeekContainsDate==null?s:Ht(t.firstWeekContainsDate),f=Mc(r,e),u=new Date(0);u.setUTCFullYear(f,0,a),u.setUTCHours(0,0,0,0);var m=To(u,e);return m}o(Sm,"startOfUTCWeekYear");var yI=6048e5;function Mm(r,e){pt(1,arguments);var t=Ft(r),n=To(t,e).getTime()-Sm(t,e).getTime();return Math.round(n/yI)+1}o(Mm,"getUTCWeek");function ut(r,e){for(var t=r<0?"-":"",n=Math.abs(r).toString();n.length<e;)n="0"+n;return t+n}o(ut,"addLeadingZeros");var xI={y:function(r,e){var t=r.getUTCFullYear(),n=t>0?t:1-t;return ut(e==="yy"?n%100:n,e.length)},M:function(r,e){var t=r.getUTCMonth();return e==="M"?String(t+1):ut(t+1,2)},d:function(r,e){return ut(r.getUTCDate(),e.length)},a:function(r,e){var t=r.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h:function(r,e){return ut(r.getUTCHours()%12||12,e.length)},H:function(r,e){return ut(r.getUTCHours(),e.length)},m:function(r,e){return ut(r.getUTCMinutes(),e.length)},s:function(r,e){return ut(r.getUTCSeconds(),e.length)},S:function(r,e){var t=e.length,n=r.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,t-3));return ut(i,e.length)}},ji=xI;var Qa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wI={G:function(r,e,t){var n=r.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){var n=r.getUTCFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return ji.y(r,e)},Y:function(r,e,t,n){var i=Mc(r,n),s=i>0?i:1-i;if(e==="YY"){var a=s%100;return ut(a,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):ut(s,e.length)},R:function(r,e){var t=Sc(r);return ut(t,e.length)},u:function(r,e){var t=r.getUTCFullYear();return ut(t,e.length)},Q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return ut(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return ut(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){var n=r.getUTCMonth();switch(e){case"M":case"MM":return ji.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){var n=r.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return ut(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){var i=Mm(r,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):ut(i,e.length)},I:function(r,e,t){var n=Em(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):ut(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getUTCDate(),{unit:"date"}):ji.d(r,e)},D:function(r,e,t){var n=wm(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):ut(n,e.length)},E:function(r,e,t){var n=r.getUTCDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return ut(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return ut(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(r,e,t){var n=r.getUTCDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return ut(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){var n=r.getUTCHours(),i=n/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,e,t){var n=r.getUTCHours(),i;switch(n===12?i=Qa.noon:n===0?i=Qa.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,e,t){var n=r.getUTCHours(),i;switch(n>=17?i=Qa.evening:n>=12?i=Qa.afternoon:n>=4?i=Qa.morning:i=Qa.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){var n=r.getUTCHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return ji.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getUTCHours(),{unit:"hour"}):ji.H(r,e)},K:function(r,e,t){var n=r.getUTCHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},k:function(r,e,t){var n=r.getUTCHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):ji.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):ji.s(r,e)},S:function(r,e){return ji.S(r,e)},X:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return $4(s);case"XXXX":case"XX":return zs(s);case"XXXXX":case"XXX":default:return zs(s,":")}},x:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"x":return $4(s);case"xxxx":case"xx":return zs(s);case"xxxxx":case"xxx":default:return zs(s,":")}},O:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+F4(s,":");case"OOOO":default:return"GMT"+zs(s,":")}},z:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+F4(s,":");case"zzzz":default:return"GMT"+zs(s,":")}},t:function(r,e,t,n){var i=n._originalDate||r,s=Math.floor(i.getTime()/1e3);return ut(s,e.length)},T:function(r,e,t,n){var i=n._originalDate||r,s=i.getTime();return ut(s,e.length)}};function F4(r,e){var t=r>0?"-":"+",n=Math.abs(r),i=Math.floor(n/60),s=n%60;if(s===0)return t+String(i);var a=e||"";return t+String(i)+a+ut(s,2)}o(F4,"formatTimezoneShort");function $4(r,e){if(r%60===0){var t=r>0?"-":"+";return t+ut(Math.abs(r)/60,2)}return zs(r,e)}o($4,"formatTimezoneWithOptionalMinutes");function zs(r,e){var t=e||"",n=r>0?"-":"+",i=Math.abs(r),s=ut(Math.floor(i/60),2),a=ut(i%60,2);return n+s+t+a}o(zs,"formatTimezone");var q4=wI;function H4(r,e){switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}o(H4,"dateLongFormatter");function z4(r,e){switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}o(z4,"timeLongFormatter");function _I(r,e){var t=r.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return H4(r,e);var s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",H4(n,e)).replace("{{time}}",z4(i,e))}o(_I,"dateTimeLongFormatter");var EI={p:z4,P:_I},j4=EI;var SI=["D","DD"],MI=["YY","YYYY"];function K4(r){return SI.indexOf(r)!==-1}o(K4,"isProtectedDayOfYearToken");function V4(r){return MI.indexOf(r)!==-1}o(V4,"isProtectedWeekYearToken");function Am(r,e,t){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"))}o(Am,"throwProtectedError");var AI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,TI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,kI=/^'([^]*?)'?$/,CI=/''/g,DI=/[a-zA-Z]/;function Ac(r,e,t){pt(2,arguments);var n=String(e),i=t||{},s=i.locale||U4,a=s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=s.options&&s.options.weekStartsOn,p=m==null?0:Ht(m),x=i.weekStartsOn==null?p:Ht(i.weekStartsOn);if(!(x>=0&&x<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!s.localize)throw new RangeError("locale must contain localize property");if(!s.formatLong)throw new RangeError("locale must contain formatLong property");var k=Ft(r);if(!vm(k))throw new RangeError("Invalid time value");var I=bm(k),T=xm(k,I),C={firstWeekContainsDate:u,weekStartsOn:x,locale:s,_originalDate:k},$=n.match(TI).map(function(O){var U=O[0];if(U==="p"||U==="P"){var j=j4[U];return j(O,s.formatLong,C)}return O}).join("").match(AI).map(function(O){if(O==="''")return"'";var U=O[0];if(U==="'")return OI(O);var j=q4[U];if(j)return!i.useAdditionalWeekYearTokens&&V4(O)&&Am(O,e,r),!i.useAdditionalDayOfYearTokens&&K4(O)&&Am(O,e,r),j(T,O,s.localize,C);if(U.match(DI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return O}).join("");return $}o(Ac,"format");function OI(r){return r.match(kI)[1].replace(CI,"'")}o(OI,"cleanEscapedString");var II=o((r,e)=>r.split(" error")[0]||r,"transformErrorCheck"),PI=o((r,e)=>r.startsWith("expiration")?e.expirationDate?`Invalid \u2022 Expired ${Ac(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Invalid \u2022 Expired":r,"transformErrorMessage"),NI=o((r,e)=>({proof:"Valid",expiration:e.expirationDate?`Valid \u2022 Expires ${Ac(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Valid \u2022 Does Not Expire"})[r]||r,"transformCheckMessage"),W4=o(r=>e=>Z(void 0,null,function*(){let t=yield r.pluginMethods.verifyCredential(e),n=[];return t.errors.forEach(i=>{n.push({status:fd.Failed,check:II(i,e),details:PI(i,e)})}),t.warnings.forEach(i=>{n.push({status:fd.Error,check:"hmm",message:i})}),t.checks.forEach(i=>{n.push({status:fd.Success,check:i,message:NI(i,e)})}),n}),"verifyCredential");var G4={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials",ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var Ae,Y4=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Y4.decode();var cd=null;function ef(){return(cd===null||cd.buffer!==Ae.memory.buffer)&&(cd=new Uint8Array(Ae.memory.buffer)),cd}o(ef,"getUint8Memory0");function gi(r,e){return Y4.decode(ef().subarray(r,r+e))}o(gi,"getStringFromWasm0");var Ki=new Array(32).fill(void 0);Ki.push(void 0,null,!0,!1);var Tc=Ki.length;function Ze(r){Tc===Ki.length&&Ki.push(Ki.length+1);let e=Tc;return Tc=Ki[e],Ki[e]=r,e}o(Ze,"addHeapObject");function Oe(r){return Ki[r]}o(Oe,"getObject");function RI(r){r<36||(Ki[r]=Tc,Tc=r)}o(RI,"dropObject");function vi(r){let e=Oe(r);return RI(r),e}o(vi,"takeObject");var Rt=0,ld=new TextEncoder("utf-8"),LI=typeof ld.encodeInto=="function"?function(r,e){return ld.encodeInto(r,e)}:function(r,e){let t=ld.encode(r);return e.set(t),{read:r.length,written:t.length}};function sr(r,e,t){if(t===void 0){let f=ld.encode(r),u=e(f.length);return ef().subarray(u,u+f.length).set(f),Rt=f.length,u}let n=r.length,i=e(n),s=ef(),a=0;for(;a<n;a++){let f=r.charCodeAt(a);if(f>127)break;s[i+a]=f}if(a!==n){a!==0&&(r=r.slice(a)),i=t(i,n,n=a+r.length*3);let f=ef().subarray(i+a,i+n);a+=LI(r,f).written}return Rt=a,i}o(sr,"passStringToWasm0");function BI(r){return r==null}o(BI,"isLikeNone");var ud=null;function Xt(){return(ud===null||ud.buffer!==Ae.memory.buffer)&&(ud=new Int32Array(Ae.memory.buffer)),ud}o(Xt,"getInt32Memory0");function Tm(r){let e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){let i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){let i=r.length,s="[";i>0&&(s+=Tm(r[0]));for(let a=1;a<i;a++)s+=", "+Tm(r[a]);return s+="]",s}let t=/\[object ([^\]]+)\]/.exec(toString.call(r)),n;if(t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch(i){return"Object"}return r instanceof Error?`${r.name}: ${r.message}
792
+ ${r.stack}`:n}o(Tm,"debugString");function UI(r,e,t,n){let i={a:r,b:e,cnt:1,dtor:t},s=o((...a)=>{i.cnt++;let f=i.a;i.a=0;try{return n(f,i.b,...a)}finally{--i.cnt===0?Ae.__wbindgen_export_2.get(i.dtor)(f,i.b):i.a=f}},"real");return s.original=i,s}o(UI,"makeMutClosure");function FI(r,e,t){Ae._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(r,e,Ze(t))}o(FI,"__wbg_adapter_24");function J4(r,e){let t=e(r.length*1);return ef().set(r,t/1),Rt=r.length,t}o(J4,"passArray8ToWasm0");function X4(r){try{let f=Ae.__wbindgen_add_to_stack_pointer(-16),u=J4(r,Ae.__wbindgen_malloc),m=Rt;Ae.generateEd25519KeyFromBytes(f,u,m);var e=Xt()[f/4+0],t=Xt()[f/4+1],n=Xt()[f/4+2],i=Xt()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,vi(n);return gi(s,a)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(s,a)}}o(X4,"generateEd25519KeyFromBytes");function Z4(r){try{let f=Ae.__wbindgen_add_to_stack_pointer(-16),u=J4(r,Ae.__wbindgen_malloc),m=Rt;Ae.generateSecp256k1KeyFromBytes(f,u,m);var e=Xt()[f/4+0],t=Xt()[f/4+1],n=Xt()[f/4+2],i=Xt()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,vi(n);return gi(s,a)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(s,a)}}o(Z4,"generateSecp256k1KeyFromBytes");function Q4(r,e){try{let u=Ae.__wbindgen_add_to_stack_pointer(-16),m=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),p=Rt,x=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),k=Rt;Ae.keyToDID(u,m,p,x,k);var t=Xt()[u/4+0],n=Xt()[u/4+1],i=Xt()[u/4+2],s=Xt()[u/4+3],a=t,f=n;if(s)throw a=0,f=0,vi(i);return gi(a,f)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(a,f)}}o(Q4,"keyToDID");function e5(r,e){let t=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.keyToVerificationMethod(t,n,i,s);return vi(a)}o(e5,"keyToVerificationMethod");function t5(r,e,t){let n=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),i=Rt,s=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),a=Rt,f=sr(t,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt,m=Ae.issueCredential(n,i,s,a,f,u);return vi(m)}o(t5,"issueCredential");function r5(r,e){let t=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.verifyCredential(t,n,i,s);return vi(a)}o(r5,"verifyCredential");function n5(r,e,t){let n=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),i=Rt,s=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),a=Rt,f=sr(t,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt,m=Ae.issuePresentation(n,i,s,a,f,u);return vi(m)}o(n5,"issuePresentation");function i5(r,e){let t=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.verifyPresentation(t,n,i,s);return vi(a)}o(i5,"verifyPresentation");function gr(r,e){try{return r.apply(this,e)}catch(t){Ae.__wbindgen_exn_store(Ze(t))}}o(gr,"handleError");function $I(r,e){return ef().subarray(r/1,r/1+e)}o($I,"getArrayU8FromWasm0");function qI(r,e,t,n){Ae.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(r,e,Ze(t),Ze(n))}o(qI,"__wbg_adapter_110");function HI(r,e){return Z(this,null,function*(){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.headers.get("Content-Type")!="application/wasm")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",n);else throw n}let t=yield r.arrayBuffer();return yield WebAssembly.instantiate(t,e)}else{let t=yield WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}})}o(HI,"load");function o5(r){return Z(this,null,function*(){let e={};e.wbg={},e.wbg.__wbindgen_string_new=function(i,s){let a=gi(i,s);return Ze(a)},e.wbg.__wbindgen_object_drop_ref=function(i){vi(i)},e.wbg.__wbindgen_cb_drop=function(i){let s=vi(i).original;return s.cnt--==1?(s.a=0,!0):!1},e.wbg.__wbindgen_object_clone_ref=function(i){let s=Oe(i);return Ze(s)},e.wbg.__wbg_fetch_811d43d6bdcad5b1=function(i){let s=fetch(Oe(i));return Ze(s)},e.wbg.__wbg_fetch_bf56e2a9f0644e3f=function(i,s){let a=Oe(i).fetch(Oe(s));return Ze(a)},e.wbg.__wbg_new_89d7f088c1c45353=function(){return gr(function(){let i=new Headers;return Ze(i)},arguments)},e.wbg.__wbg_append_f4f93bc73c45ee3e=function(){return gr(function(i,s,a,f,u){Oe(i).append(gi(s,a),gi(f,u))},arguments)},e.wbg.__wbindgen_string_get=function(i,s){let a=Oe(s),f=typeof a=="string"?a:void 0;var u=BI(f)?0:sr(f,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),m=Rt;Xt()[i/4+1]=m,Xt()[i/4+0]=u},e.wbg.__wbg_instanceof_Response_ccfeb62399355bcd=function(i){return Oe(i)instanceof Response},e.wbg.__wbg_url_06c0f822d68d195c=function(i,s){let a=Oe(s).url,f=sr(a,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt;Xt()[i/4+1]=u,Xt()[i/4+0]=f},e.wbg.__wbg_status_600fd8b881393898=function(i){return Oe(i).status},e.wbg.__wbg_headers_9e7f2c05a9b962ea=function(i){let s=Oe(i).headers;return Ze(s)},e.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return gr(function(i){let s=Oe(i).arrayBuffer();return Ze(s)},arguments)},e.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return gr(function(i,s,a){let f=new Request(gi(i,s),Oe(a));return Ze(f)},arguments)},e.wbg.__wbindgen_is_object=function(i){let s=Oe(i);return typeof s=="object"&&s!==null},e.wbg.__wbg_self_86b4b13392c7af56=function(){return gr(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_crypto_b8c92eaac23d0d80=function(i){let s=Oe(i).crypto;return Ze(s)},e.wbg.__wbg_msCrypto_9ad6677321a08dd8=function(i){let s=Oe(i).msCrypto;return Ze(s)},e.wbg.__wbindgen_is_undefined=function(i){return Oe(i)===void 0},e.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return Ze(n)},e.wbg.__wbg_require_f5521a5b85ad2542=function(i,s,a){let f=Oe(i).require(gi(s,a));return Ze(f)},e.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(i){let s=Oe(i).getRandomValues;return Ze(s)},e.wbg.__wbg_getRandomValues_e57c9b75ddead065=function(i,s){Oe(i).getRandomValues(Oe(s))},e.wbg.__wbg_randomFillSync_d2ba53160aec6aba=function(i,s,a){Oe(i).randomFillSync($I(s,a))},e.wbg.__wbindgen_is_function=function(i){return typeof Oe(i)=="function"},e.wbg.__wbg_newnoargs_e23b458e372830de=function(i,s){let a=new Function(gi(i,s));return Ze(a)},e.wbg.__wbg_next_cabb70b365520721=function(i){let s=Oe(i).next;return Ze(s)},e.wbg.__wbg_next_bf3d83fc18df496e=function(){return gr(function(i){let s=Oe(i).next();return Ze(s)},arguments)},e.wbg.__wbg_done_040f966faa9a72b3=function(i){return Oe(i).done},e.wbg.__wbg_value_419afbd9b9574c4c=function(i){let s=Oe(i).value;return Ze(s)},e.wbg.__wbg_iterator_4832ef1f15b0382b=function(){return Ze(Symbol.iterator)},e.wbg.__wbg_get_a9cab131e3152c49=function(){return gr(function(i,s){let a=Reflect.get(Oe(i),Oe(s));return Ze(a)},arguments)},e.wbg.__wbg_call_ae78342adc33730a=function(){return gr(function(i,s){let a=Oe(i).call(Oe(s));return Ze(a)},arguments)},e.wbg.__wbg_new_36359baae5a47e27=function(){let i=new Object;return Ze(i)},e.wbg.__wbg_call_3ed288a247f13ea5=function(){return gr(function(i,s,a){let f=Oe(i).call(Oe(s),Oe(a));return Ze(f)},arguments)},e.wbg.__wbg_getTime_bffb1c09df09618b=function(i){return Oe(i).getTime()},e.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){let i=new Date;return Ze(i)},e.wbg.__wbg_new_37705eed627d5ed9=function(i,s){try{var a={a:i,b:s},f=o((m,p)=>{let x=a.a;a.a=0;try{return qI(x,a.b,m,p)}finally{a.a=x}},"cb0");let u=new Promise(f);return Ze(u)}finally{a.a=a.b=0}},e.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(i){let s=Promise.resolve(Oe(i));return Ze(s)},e.wbg.__wbg_then_ce526c837d07b68f=function(i,s){let a=Oe(i).then(Oe(s));return Ze(a)},e.wbg.__wbg_then_842e65b843962f56=function(i,s,a){let f=Oe(i).then(Oe(s),Oe(a));return Ze(f)},e.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return gr(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return gr(function(){let i=window.window;return Ze(i)},arguments)},e.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return gr(function(){let i=globalThis.globalThis;return Ze(i)},arguments)},e.wbg.__wbg_global_5de1e0f82bddcd27=function(){return gr(function(){let i=global.global;return Ze(i)},arguments)},e.wbg.__wbg_buffer_7af23f65f6c64548=function(i){let s=Oe(i).buffer;return Ze(s)},e.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(i,s,a){let f=new Uint8Array(Oe(i),s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_new_cc9018bd6f283b6f=function(i){let s=new Uint8Array(Oe(i));return Ze(s)},e.wbg.__wbg_set_f25e869e4565d2a2=function(i,s,a){Oe(i).set(Oe(s),a>>>0)},e.wbg.__wbg_length_0acb1cf9bbaf8519=function(i){return Oe(i).length},e.wbg.__wbg_newwithlength_8f0657faca9f1422=function(i){let s=new Uint8Array(i>>>0);return Ze(s)},e.wbg.__wbg_subarray_da527dbd24eafb6b=function(i,s,a){let f=Oe(i).subarray(s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_has_ce995ec88636803d=function(){return gr(function(i,s){return Reflect.has(Oe(i),Oe(s))},arguments)},e.wbg.__wbg_set_93b1c87ee2af852e=function(){return gr(function(i,s,a){return Reflect.set(Oe(i),Oe(s),Oe(a))},arguments)},e.wbg.__wbg_stringify_c760003feffcc1f2=function(){return gr(function(i){let s=JSON.stringify(Oe(i));return Ze(s)},arguments)},e.wbg.__wbindgen_debug_string=function(i,s){let a=Tm(Oe(s)),f=sr(a,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt;Xt()[i/4+1]=u,Xt()[i/4+0]=f},e.wbg.__wbindgen_throw=function(i,s){throw new Error(gi(i,s))},e.wbg.__wbindgen_memory=function(){let i=Ae.memory;return Ze(i)},e.wbg.__wbindgen_closure_wrapper10913=function(i,s,a){let f=UI(i,s,3725,FI);return Ze(f)},(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));let{instance:t,module:n}=yield HI(yield r,e);return Ae=t.exports,o5.__wbindgen_wasm_module=n,Ae})}o(o5,"init");var s5=o5;var a5=!1,zI=o((r="https://cdn.filestackcontent.com/dlXanMvQCGDR76JXcBkA")=>Z(void 0,null,function*(){if(!a5)return a5=!0,s5(r)}),"init"),f5=zI;var c5=o(r=>Z(void 0,null,function*(){yield f5(r);let e={};return{pluginMethods:{generateEd25519KeyFromBytes:(t,n)=>JSON.parse(X4(n)),generateSecp256k1KeyFromBytes:(t,n)=>JSON.parse(Z4(n)),keyToDid:(t,n,i)=>{let s=e[n];if(!s){let a=Q4(n,JSON.stringify(i));return e[n]=a,a}return s},keyToVerificationMethod:(t,n,i)=>Z(void 0,null,function*(){return e5(n,JSON.stringify(i))}),issueCredential:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield t5(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyCredential:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield r5(JSON.stringify(n),"{}"))}),issuePresentation:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield n5(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyPresentation:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield i5(JSON.stringify(n),"{}"))})}}}),"getDidKitPlugin");var u5=o((i,...s)=>Z(void 0,[i,...s],function*(r,{ceramicIdx:e=G4,didkit:t,defaultContents:n=[]}={}){let a=yield(yield rf(n)).addPlugin(yield c5(t)),f=yield a.addPlugin(yield p4(a,r)),u=yield f.addPlugin(yield fm(f)),m=yield u.addPlugin(yield rd(u,e)),p=yield m.addPlugin(m4(m));return{_wallet:p,did:(x="key")=>p.pluginMethods.getSubjectDid(x),keypair:(x="ed25519")=>p.pluginMethods.getSubjectKeypair(x),issueCredential:p.pluginMethods.issueCredential,verifyCredential:W4(p),issuePresentation:p.pluginMethods.issuePresentation,verifyPresentation:p.pluginMethods.verifyPresentation,getCredential:p.pluginMethods.getVerifiableCredentialFromIndex,getCredentials:p.pluginMethods.getVerifiableCredentialsFromIndex,publishCredential:p.pluginMethods.publishContentToCeramic,addCredential:x=>Z(void 0,null,function*(){yield p.pluginMethods.addVerifiableCredentialInIdx(x)}),readFromCeramic:p.pluginMethods.readContentFromCeramic,getTestVc:p.pluginMethods.getTestVc}}),"walletFromKey");
793
793
  /*!
794
794
  * https://github.com/Starcounter-Jack/JSON-Patch
795
795
  * (c) 2017-2021 Joachim Wester
@@ -808,3 +808,4 @@ ${r.stack}`:n}o(Tm,"debugString");function PO(r,e,t,n){let i={a:r,b:e,cnt:1,dtor
808
808
  * @copyright Chen, Yi-Cyuan 2015-2018
809
809
  * @license MIT
810
810
  */
811
+ //# sourceMappingURL=core.cjs.production.min.js.map